react_hsbc_teller 1.7.8 → 1.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -48,6 +48,7 @@ let beautyDiv = {};
48
48
  let isBackgroundBlur = true
49
49
  let isSuccuseHs = false
50
50
  let isGraffiti = false
51
+ let strokeColor = '#333'
51
52
  let CanvasHome = styled.div`
52
53
  position: fixed;
53
54
  z-index: ${props=>props.zIndexNum};
@@ -2335,15 +2336,7 @@ class Video extends Component {
2335
2336
  }
2336
2337
  }
2337
2338
  if(sid == document.getElementById('publish_video1').name) {
2338
- var box=document.getElementById("whiteboardDIV");
2339
- if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
2340
- this.setState({
2341
- whiteboardTop: box.getBoundingClientRect().top * 1.08 - 40,
2342
- whiteboardLeft: box.getBoundingClientRect().left,
2343
- leftVideo: (box.offsetWidth - this.state.widthVideo)/2 + box.getBoundingClientRect().left
2344
- })
2345
- console.log('whiteboardDIV',this.state.whiteboardTop,this.state.whiteboardLeft)
2346
- }
2339
+
2347
2340
  this.setState({
2348
2341
 
2349
2342
  loading: false,
@@ -2381,6 +2374,18 @@ class Video extends Component {
2381
2374
  },
2382
2375
  1000
2383
2376
  );
2377
+ } else {
2378
+ var box=document.getElementById("whiteboardDIV");
2379
+ var box1 = document.getElementById("operate")
2380
+ var height = box1 ? box1.offsetHeight : 40
2381
+ if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
2382
+ this.setState({
2383
+ whiteboardTop: box.getBoundingClientRect().top - height,
2384
+ whiteboardLeft: box.getBoundingClientRect().left,
2385
+ leftVideo: (box.offsetWidth - this.state.widthVideo)/2 + box.getBoundingClientRect().left
2386
+ })
2387
+ console.log('whiteboardDIV',this.state.whiteboardTop,this.state.whiteboardLeft)
2388
+ }
2384
2389
  }
2385
2390
  };
2386
2391
  // 发布媒体流失败
@@ -4721,7 +4726,7 @@ userType:'1'
4721
4726
  openCanvas(drawCanvas) {
4722
4727
  if (!this.boardOperate) {
4723
4728
  this.boardOperate = new BoardOperate(drawCanvas, {
4724
- drawColor: "#000000",
4729
+ drawColor: strokeColor,
4725
4730
  drawType: "pen",
4726
4731
  lineWidth: 5,
4727
4732
  fillStyle: '', // 初始背景色,若为空则透明背景
@@ -4741,8 +4746,23 @@ userType:'1'
4741
4746
  });
4742
4747
 
4743
4748
  this.setState({ drawConfig,selectSpan: type });
4749
+ this.boardOperate.drawColor = '#333'
4744
4750
  }
4751
+ setStrokeColor() {
4752
+ console.log(this.boardOperate)
4753
+ const { drawConfig } = this.state;
4754
+ const type = 'pen'
4755
+ drawConfig.curryControl = type;
4756
+ this.boardOperate.changeWay({
4757
+ type
4758
+ });
4745
4759
 
4760
+ this.setState({ drawConfig,selectSpan: type });
4761
+ this.boardOperate.drawColor = '#ff4d4f'
4762
+ this.setState({
4763
+ selectSpan: 'redPen'
4764
+ })
4765
+ }
4746
4766
  setOpreate(type) {
4747
4767
  this.boardOperate[type]();
4748
4768
  }
@@ -4811,6 +4831,9 @@ userType:'1'
4811
4831
  this.openCanvas(canvas)
4812
4832
  }, 0);
4813
4833
  this.graffitiClick()
4834
+ this.setState({
4835
+ selectSpan: 'pen'
4836
+ })
4814
4837
  } else {
4815
4838
  // this.downCanvas()
4816
4839
  this.closeCanvas();
@@ -4887,11 +4910,13 @@ userType:'1'
4887
4910
  }
4888
4911
  componentDidMount() {
4889
4912
  var box=document.getElementById("whiteboardDIV");
4913
+ var box1 = document.getElementById("operate")
4914
+ var height = box1 ? box1.offsetHeight : 40
4890
4915
  if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
4891
4916
  this.state.whiteboardWidth = box.offsetWidth,
4892
4917
  this.state.whiteboardHeight = box.offsetHeight * 0.92,
4893
4918
  this.state.widthVideo = this.state.whiteboardHeight * 1280 / 720
4894
- this.state.whiteboardTop = box.getBoundingClientRect().top * 1.08 - 40
4919
+ this.state.whiteboardTop = box.getBoundingClientRect().top - height
4895
4920
  this.state.whiteboardLeft = box.getBoundingClientRect().left
4896
4921
  this.state.leftVideo = (box.offsetWidth - this.state.widthVideo)/2 + box.getBoundingClientRect().left
4897
4922
  console.log('whiteboardDIV', this.state.whiteboardHeight,this.state.whiteboardWidth,this.state.whiteboardTop,this.state.whiteboardLeft)
@@ -5201,6 +5226,7 @@ userType:'1'
5201
5226
  {this.state.operateShow &&
5202
5227
  <OpreateDiv id="operate">
5203
5228
  <span style={{color: this.state.selectSpan == 'pen' ? '#1890ff' : '#333'}} onClick={() => this.setTool('pen')}>铅笔</span>
5229
+ <span style={{color: this.state.selectSpan == 'redPen' ? '#1890ff' : '#333'}} onClick={() => this.setStrokeColor()}>红笔</span>
5204
5230
  <span style={{color: this.state.selectSpan == 'eraser' ? '#1890ff' : '#333'}} onClick={() => this.setTool('eraser')}>橡皮</span>
5205
5231
  <span onClick={() => this.setOpreate('undo')}>撤销</span>
5206
5232
  <span onClick={() => this.setOpreate('redo')}>恢复</span>