Liuyi
2024-11-12 0ed8e370659ad4e0582301ae31cfa155da114590
pages/index/index.vue
@@ -24,6 +24,7 @@
      balance:'',
      count:'',
      state:'',//state:true:挂失,false:正常
      cardType:'',//卡类型01卡消费 02计次消费 03游客消费 04电子卡
      userCardType:'',//userCardType:true:共享卡,false:正常卡
   })
   // const showHeadImg = ref(BASE_URL + '/upload' + cardInfo.value.headImg)
@@ -76,23 +77,26 @@
         scanType: ['qrCode'],
         success: async function (res) {
            console.log('条码内容:' + res.result);
            let data = {
               cardType:cardInfo.value.cardType,
               card:cardInfo.value.waterCardNumber,
               sn:res.result
            }
            await buyWaterApi(data).then((res) =>{
               if(res.code == 200){
                  uni.navigateTo({
                     url:'/pages/scanWater/index'
            // let data = {
            //    cardType:cardInfo.value.cardType,
            //    card:cardInfo.value.waterCardNumber,
            //    sn:res.result
            // }
            // await buyWaterApi(data).then((res) =>{
            //    if(res.code == 200){
            //       uni.navigateTo({
            //          url:'/pages/scanWater/index'
            //       })
            //    }else{
            //       uni.showToast({
            //          title:'扫码失败!',
            //          icon:'none'
            //       })
            //    }
            // })
            uni.navigateTo({
                     url:`/pages/scanWater/index?facilityCode=${res.result}`
                  })
               }else{
                  uni.showToast({
                     title:'扫码失败!',
                     icon:'none'
                  })
               }
            })
         }
      });
   }
@@ -107,7 +111,7 @@
      {text:'故障上报',icon:'../../static/images/index/icon35.png',bgColor:'#a88ff1',url:'/pages/infoBreakdown/index',isUrl:1},
      {text:'优惠卷',icon:'../../static/images/index/icon36.png',bgColor:'#18bfc4',url:'',isUrl:4},
      {text:'会员卡挂失',icon:'../../static/images/index/icon37.png',bgColor:'#4875f0',url:'',isUrl:2},
      {text:'会员卡注销',icon:'../../static/images/index/icon38.png',bgColor:'#f45088',url:'',isUrl:3},
      {text:'会员卡解绑',icon:'../../static/images/index/icon38.png',bgColor:'#f45088',url:'',isUrl:3},
   ])
   function navTo(itemUrl){
      if(itemUrl){
@@ -249,7 +253,8 @@
               <image v-else class="user-img" src='../../static/images/index/head.png' alt=''></image>
               <text @click="navTo('/pages/userInfo/index')">{{cardInfo.userName}}</text>
               <image @click="navTo('/pages/userInfo/index')" class="user-more"src="../../static/images/index/back.png"></image>
               <view class="user-add-card" @click="navTo('/pages/addCard/index')">
               <!-- <view class="user-add-card" @click="navTo('/pages/addCard/index')"> -->
               <view class="user-add-card">
                  <image src='../../static/images/index/vip-add.png' alt=''></image>
                  <text>添加会员卡</text>
               </view>
@@ -285,21 +290,13 @@
            </view>
         </view>
         <view class="function-box1">
            <view class="box1-bg box1-one" @click="upGrade()">
            <view class="box1-bg box1-one" @click="navTo('/pages/sendWater/index')">
               <image src="../../static/images/index/home21.png" alt=""></image>
               <view>送水到家</view>
            </view>
            <view @click="navTo('/pages/facilityList/index')" class="box1-bg box1-two">
               <image src="../../static/images/index/icon22.png" alt=""></image>
               <view>附近设备</view>
               <!-- <view>账户余额(元)</view>
               <view class="recharge">
                  <text>¥</text>
                  <text>120.00</text>
               </view>
               <view @click="navTo('/pages/recharge/index')">
                  充值
               </view> -->
            </view>
            <view class="box1-bg box1-three" @click="toScan()">
               <image src="../../static/images/index/icon23.png" alt=""></image>
@@ -332,7 +329,8 @@
                     <image src="../../static/images/index/more-info5.png" alt=""></image>
                  </view>
               </view>
               <view class="service-bg" @click="upGrade">
               <!-- <view class="service-bg" @click="upGrade"> -->
               <view class="service-bg" @click="navTo('/pages/counterRecharge/index')">
                     <view>
                        <image src="../../static/images/index/notice5.png" alt=""></image>
                        <text>公示公告</text>