MrShi
17 小时以前 47d56a8b0f22fb15a46b69dfd46fac23560ad2cd
mini-program/pages/confirm-order/confirm-order.vue
@@ -140,24 +140,27 @@
         <view class="coupon">
            <view class="coupon-title">选择优惠券</view>
            <scroll-view scroll-y class="coupon-list">
               <view class="coupon-list-item" v-for="(item, index) in orderInfo.memberCouponList" :key="index" @click="selectCoupon(index)">
                  <view class="jiage" v-if="item.couponType === 0">
                     <text>{{item.price}}</text>
                     <text>满{{item.limitPrice}}可用</text>
                  </view>
                  <view class="jiage1" v-if="item.couponType === 1">
                     <text>{{item.price}}</text>
                     <text>满{{item.limitPrice}}可用</text>
                  </view>
                  <view class="juaninfo">
                     <view class="juaninfo-info">
                        <text>{{item.name}}</text>
                        <text>{{item.endDate.substring(0, 10)}} 日到期</text>
               <template v-if="orderInfo.memberCouponList && orderInfo.memberCouponList.length > 0">
                  <view class="coupon-list-item" v-for="(item, index) in orderInfo.memberCouponList" :key="index" @click="selectCoupon(index)">
                     <view class="jiage" v-if="item.couponType === 0">
                        <text>{{item.price}}</text>
                        <text>满{{item.limitPrice}}可用</text>
                     </view>
                     <image src="/static/icon/ic_agree@2x.png" mode="widthFix" v-if="!item.active"></image>
                     <image src="/static/icon/cart_ic_sel@2x.png" mode="widthFix" v-else></image>
                     <view class="jiage1" v-if="item.couponType === 1">
                        <text>{{item.price}}</text>
                        <text>满{{item.limitPrice}}可用</text>
                     </view>
                     <view class="juaninfo">
                        <view class="juaninfo-info">
                           <text>{{item.name}}</text>
                           <text>{{item.endDate.substring(0, 10)}} 日到期</text>
                        </view>
                        <image src="/static/icon/ic_agree@2x.png" mode="widthFix" v-if="!item.active"></image>
                        <image src="/static/icon/cart_ic_sel@2x.png" mode="widthFix" v-else></image>
                     </view>
                  </view>
               </view>
               </template>
               <view class="coupon-list-wuData">暂无可用优惠卷</view>
            </scroll-view>
            <view class="coupon-btn" @click="confirmCoupon">确定</view>
            <view style="width: 100%; height: 30rpx;"></view>
@@ -239,6 +242,8 @@
            <view class="coupon-phone" @click="dianhua(shopId.phone)">{{shopId.phone}}</view>
         </view>
      </u-popup>
      <!-- 下单报错提示 -->
       <u-modal :show="show4" :content='content' @confirm="show4 = false"></u-modal>
   </view>
</template>
@@ -255,6 +260,8 @@
            show1: false,
            show2: false,
            show3: false,
            show4: false,
            content: '',
            shopName: '',
            orderInfo: null,
            addr: null,
@@ -314,7 +321,7 @@
               success: function (addr) {
                  const locParam = { latitude: addr.latitude, longitude: addr.longitude };
                  const qqmapsdk = new QQMapWX({
                     key: 'HEIBZ-QJLLM-SZ36X-6ZBHI-S6Y2J-S6FND'
                     key: 'WE3BZ-HN6WS-ONDOH-62QCV-MNL6F-5NFNE'
                  });
                  qqmapsdk.reverseGeocoder({
                     locParam,
@@ -387,7 +394,7 @@
            this.$u.api.getShopList({
               cityName: this.cityName,
               lat: this.lat,
               lgt: this.lng,
               lgt: this.lgt,
               shopName: this.shopName
            }).then(res => {
               if (res.code === 200) {
@@ -424,6 +431,7 @@
               titlePrice: this.orderInfo.payAmount,
               shopId: this.shopId ? this.shopId.id : null
            }).then(res => {
               console.log(res)
               if (res.code === 200) {
                  // 积分抵扣
                  if (res.data.payType === 1) {
@@ -455,6 +463,10 @@
                     })
                  }
               }
            }).catch(err => {
               console.log(err)
               this.show4 = true
               this.content = err.data.message || '下单失败,请稍后重试'
            }).finally(() => {
               this.loading = false
            })
@@ -785,6 +797,15 @@
                  }
               }
            }
            .coupon-list-wuData {
               width: 100%;
               height: 600rpx;
               line-height: 600rpx;
               text-align: center;
               font-size: 26rpx;
               color: #999999;
               font-weight: 400;
            }
            .coupon-list-item {
               width: 100%;
               height: 170rpx;