@zykjcommon/questions 0.0.50 → 0.0.51

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": "@zykjcommon/questions",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "main": "src/components/questions/entry.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
package/readme CHANGED
@@ -5,4 +5,6 @@ watch(() => props.questionList, (nv) => {
5
5
  }
6
6
  },{immediate:true,deep:true})
7
7
 
8
+ 如果源是cnpm需要cnpm sync手动同步
9
+
8
10
 
Binary file
@@ -512,6 +512,7 @@ $greenItemFontSize:0.13em;
512
512
  }
513
513
  }
514
514
  .list-item{
515
+ position: relative;
515
516
  /*background: url("../../img/classify-green-item.png") no-repeat center;*/
516
517
  background-repeat: no-repeat;
517
518
  background-position: center;
@@ -624,6 +625,7 @@ $greenItemFontSize:0.13em;
624
625
  img{
625
626
  width: 100%;
626
627
  height: 100%;
628
+ display: block;
627
629
  }
628
630
  &:hover {
629
631
  background: rgba(0, 0, 0, 0.2);
@@ -659,4 +661,16 @@ $greenItemFontSize:0.13em;
659
661
  &:hover {
660
662
  background-color: #fff;
661
663
  }
664
+ }
665
+
666
+ .look-big-img-btn{
667
+ z-index:2;
668
+ cursor: pointer;
669
+ width: 0.16em;
670
+ height: 0.16em;
671
+ background: url("../../img/lookBigImgBtn.png") no-repeat center;
672
+ background-size: 100% 100%;
673
+ position: absolute;
674
+ right:0;
675
+ top:0;
662
676
  }
@@ -4,8 +4,8 @@
4
4
  <div class="close" @click="cancel">
5
5
  <img src="../../assets/img/big-close.png" alt="" />
6
6
  </div>
7
- <div class="prev" @click="prev"></div>
8
- <div class="next" @click="next"></div>
7
+ <div class="prev" @click="prev" v-if="mediaLookerList.length > 1"></div>
8
+ <div class="next" @click="next" v-if="mediaLookerList.length > 1"></div>
9
9
  <!-- <button style="position: fixed;z-index: 9999;top:0;left:0" @click="fn">click</button>-->
10
10
  <div class="imgLooker" v-if="curMediaObj.mediaType == 1"
11
11
  @click="enlarge"
@@ -56,11 +56,7 @@ export default {
56
56
  mediaLookerList:{
57
57
  handler(nv,ov){
58
58
  if(nv && nv.length){
59
- if(nv && nv.length){
60
- // console.log(nv,3333);
61
- this.getCurMedia(this.mediaCount)
62
- // console.log(props.mediaCount,11113);
63
- }
59
+ this.getCurMedia(this.mediaCount)
64
60
  }
65
61
  },
66
62
  immediate:true,
@@ -29,15 +29,24 @@
29
29
  v-for="(item,index) in optionList"
30
30
  :key="index">
31
31
  <div class="list-item-text" v-show="item.content_type!=2">{{item.content}}</div>
32
+ <div class="look-big-img-btn"></div>
32
33
  </div>
33
34
  </div>
34
35
  </div>
35
36
  </div>
37
+
38
+ <MediaLooker :visible.sync="visible"
39
+ v-model:visible="visible"
40
+ v-if="visible"
41
+ :mediaCount="curMediaCount"
42
+ :mediaLookerList="mediaLookerList"></MediaLooker>
36
43
  </div>
37
44
  </template>
38
45
  <script>
39
46
  import fun from "../../assets/js/fun";
40
47
  import {setRemFixedHeight} from "../../assets/js/rem";
48
+ import {commonData} from './mixin'
49
+ import MediaLooker from '../common/MediaLooker.vue'
41
50
  let env = fun.getDeviceEnv()
42
51
  export default {
43
52
  name: 'Question_Classify',
@@ -114,7 +123,8 @@ export default {
114
123
  flag : false,
115
124
  scrollDistance : 3000,//设置一个死的滚动距离,保证能滚到底,目前够用
116
125
  lazyDragTimer:null,
117
- dragingStart:false
126
+ dragingStart:false,
127
+ ...JSON.parse(commonData)
118
128
  };
119
129
  },
120
130
  watch: {
@@ -272,6 +282,21 @@ export default {
272
282
  })
273
283
  return specArr
274
284
  },
285
+ lookBigImg(e){
286
+ let self = this
287
+ let bgStr = $(e.target).parent('.list-item').css('background-image')
288
+ let bgStrReg = /url\(["'](.+)["']\)/
289
+ let matchArr = bgStr.match(bgStrReg)
290
+ if(matchArr && matchArr.length > 1){
291
+ let bgUrl = matchArr[1].replace(/^\s+/ig,'').replace(/\s+$/ig,'')
292
+ self.mediaLookerList = []
293
+ self.mediaLookerList.push({
294
+ url:bgUrl,
295
+ mediaType:1
296
+ })
297
+ self.visible = true
298
+ }
299
+ },
275
300
  //移动端为了解决拖动事件和原生滚动条事件冲突,设置延迟100毫秒拖动(PC端不变)
276
301
  bindDragDomEvent(appendItem,way){
277
302
  let self = this
@@ -313,6 +338,13 @@ export default {
313
338
  }
314
339
  appendItem.off(this.mousedown)
315
340
  appendItem.on(this.mousedown,function(e){
341
+ e.stopPropagation()
342
+ let curClassName = e.target.className
343
+ if(curClassName.indexOf('look-big-img-btn') > -1){
344
+ self.lookBigImg(e)
345
+ return
346
+ }
347
+ console.log(123);
316
348
  if(env === 'mobile'){
317
349
  self.lazyDragTimer = setTimeout(()=>{
318
350
  dragDomEventFn(e,this)
@@ -329,7 +361,8 @@ export default {
329
361
  let itemBgCss = `${self.moveDiv.get(0).style.backgroundImage}`
330
362
  let itemColorCss = `${self.moveDiv.get(0).style.color}`
331
363
  let textDisplayCss = self.moveDiv.find('.list-item-text').get(0).style.display
332
- let appendItem = $(`<div class="${options.appendItemClassName}" idx="${idx}"><div class="list-item-text" style="${textDisplayCss?'display:'+textDisplayCss:''}">${self.moveDiv.find('.list-item-text').text()}</div></div>`)
364
+ let lookBigImgBtnStr = options.appendItemClassName === 'list-item' ? '<div class="look-big-img-btn"></div>' : ''
365
+ let appendItem = $(`<div class="${options.appendItemClassName}" idx="${idx}"><div class="list-item-text" style="${textDisplayCss?'display:'+textDisplayCss:''}">${self.moveDiv.find('.list-item-text').text()}</div>${lookBigImgBtnStr}</div>`)
333
366
  appendItem.css({opacity:0,backgroundImage:itemBgCss,color:itemColorCss})
334
367
  options.targetList.append(appendItem)
335
368
  options.targetList[options.scrollDirection](self.scrollDistance)
@@ -381,6 +414,7 @@ export default {
381
414
  return
382
415
  }
383
416
  // e.preventDefault()
417
+ console.log(self.dragWay,7788);
384
418
  if(self.dragWay === 'go'){
385
419
  $(document).off(self.mousemove)
386
420
  self.listItem && self.listItem.removeClass('drag')
@@ -520,7 +554,7 @@ export default {
520
554
  }
521
555
  },
522
556
  components:{
523
-
557
+ MediaLooker
524
558
  }
525
559
  };
526
560
  </script>