#
whycq
2022-07-21 ffbf023869b73dd342463f516d34fe9b069e1cbb
pages/basics/pakin.vue
@@ -87,7 +87,8 @@
      
      <!-- 弹窗 -->
      <!-- 修改数量 -->
      <uni-popup ref="revise" background-color="#fff" @change="change">
      <uni-popup ref="revise" background-color="#fff">
         <view class="revise-box">
            <view class="revise-box-top">
               <view class="color-block-blue"></view>
@@ -126,6 +127,7 @@
            matList:[],
            result: '',
            enableQty:'',
            count:'',
            counts:'',
            minCount:0,
            maxCount:'',
@@ -210,12 +212,6 @@
         },
         remove(item,index) {
            this.matList.splice(index,1)
            // for (var i = 0; i < this.matList.length; i++) {
            //    if (this.matList[i].checked == true) {
            //       this.matList.splice(i,1)
            //    }
            // }
            this.checkList();
            uni.vibrateShort();
         },
@@ -329,58 +325,41 @@
            this.$refs.goodsSearch.open(type)
         },
         checkbox: function (e) {
            var items = this.matList,
               values = e.detail.value;
            for (var i = 0, lenI = items.length; i < lenI; ++i) {
               const item = items[i]
               item.id = item.id + ''
               if(values.indexOf(item.id) >= 0){
                  this.$set(item,'checked',true)
               }else{
                  this.$set(item,'checked',false)
               }
            }
            if (values.length == items.length) {
               this.check = true
               this.checkText = "取消全选"
            } else {
               this.check = false
               this.checkText = "全选"
            }
            uni.vibrateShort();
            // var items = this.matList,
            //    values = e.detail.value;
            // for (var i = 0, lenI = items.length; i < lenI; ++i) {
            //    const item = items[i]
            //    item.id = item.id + ''
            //    if(values.indexOf(item.id) >= 0){
            //       this.$set(item,'checked',true)
            //    }else{
            //       this.$set(item,'checked',false)
            //    }
            // }
            // if (values.length == items.length) {
            //    this.check = true
            //    this.checkText = "取消全选"
            // } else {
            //    this.check = false
            //    this.checkText = "全选"
            // }
            // uni.vibrateShort();
         },
         revise(index) {
            this.rowNum = index
            this.$refs.revise.open()
            
            // this.matList[this.rowNum].count = this.count
            // this.eject()
            // var maxCount = this.item.maxCount
            // if (maxCount == undefined ) {
            //    this.matList[index]["maxCount"] = item.enableQty
            // }
            // this.enableQty = item.enableQty
            // this.count = this.minCount
            // this.maxCount = item.maxCount
         },
         changeCount(e) {
            
         },
         eject() {
            // this.type = type
            // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
            this.$refs.revise.open()
         },
         // 确认组托数量
         confirm() {
            this.matList[this.rowNum].count = this.counts
            this.matList = this.matList
            console.log(this.counts)
            console.log(this.matList[this.rowNum].count)
            console.log(this.counts )
            this.matList[this.rowNum].count = this.counts
            this.$refs.revise.close()
         },
         // 列表反选
         reChecked() {