web
10 小时以前 49fa0d82a40345342966e810b44429aec0480ef3
pages/scanWater/index.vue
@@ -41,7 +41,15 @@
      payMethod.value = payList.value[index1].value
      console.log('index',index1,payMethod.value)
   }
   //确认支付
   let timerId
   let payState = ref(true)
   async function submit(){
      if(payState.value){
         payState.value = false
         timerId = setTimeout(() =>{
            payState.value = true
         },20000)
      //余额支付
      if(payMethod.value == 1){
         if(choosedMoney.value > Number(userBalance.value)){
@@ -132,13 +140,19 @@
            }
         })
      }
      }else{
         uni.showToast({
            title:'支付间隔20秒,请稍后!',
            icon:'none'
         })
      }
   }
   const facilityCode = ref()
   onLoad((option) =>{
      facilityCode.value = option.facilityCode
      console.log('小程序扫码取水','option.facilityCode',option.facilityCode,'facilityCode',facilityCode.value)
      console.log('小程序扫码取水','option.facilityCode',option.facilityCode,'传参SN',facilityCode.value)
   })
   //设置水价及支付方式
   //设置水价,设置支付方式,用户未绑定会员卡不显示余额支付选项
   async function getWaterPrice(){
      await getPriceBySnApi(facilityCode.value).then((res) =>{
         moneyList.value.forEach((item,index) =>{
@@ -146,9 +160,10 @@
            item.volume = ((index + 1) * res.data.yield).toFixed(1)
         })
         choosedMoney.value = res.data.price
         console.log('水价设置回调',res,'传参',facilityCode.value)
         console.log('水价设置回调',res,'传参',facilityCode.value,'水价列表',choosedMoney.value)
      })
      let waterCardNumber = JSON.parse(uni.getStorageSync('userInfo')).waterCardNumber
      let waterCardNumber = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).waterCardNumber )
      console.log('用户水卡信息',uni.getStorageSync('userInfo'))
      if(!waterCardNumber){
         payList.value.splice(1,1)
      }
@@ -196,7 +211,7 @@
               </view>
            </view>
         </view>
         <view class="submit-btn" @click="submit()">确认支付</view>
         <view :style="{opacity:payState ? 1 : 0.7}" class="submit-btn" @click="submit()">确认支付</view>
      </view>
   </view>
</template>