小程序端页面调整
This commit is contained in:
		@@ -14,10 +14,10 @@
 | 
			
		||||
                </u-card> -->
 | 
			
		||||
 | 
			
		||||
        <u-card :padding="10" :show-head="true">
 | 
			
		||||
          <view slot="head" class="u-m-10">提货人联系方式</view>
 | 
			
		||||
          <view slot="head" class="u-m-10">联系方式</view>
 | 
			
		||||
          <view slot="body" class="u-m-10">
 | 
			
		||||
            <u-input v-model="sumbitOrderForm.receiverName" class="u-p-b-20" placeholder="请输入提货人姓名"/>
 | 
			
		||||
            <u-input v-model="sumbitOrderForm.receiverPhone" placeholder="请输入提货人电话" type="number"/>
 | 
			
		||||
            <u-input v-model="sumbitOrderForm.receiverName" class="u-p-b-20" placeholder="请输入姓名"/>
 | 
			
		||||
            <u-input v-model="sumbitOrderForm.receiverPhone" placeholder="请输入电话" type="number"/>
 | 
			
		||||
          </view>
 | 
			
		||||
        </u-card>
 | 
			
		||||
 | 
			
		||||
@@ -32,15 +32,10 @@
 | 
			
		||||
                <!-- 动态class绑定是为了确保最后一条底部线条不显示 -->
 | 
			
		||||
                <view :class="{ 'u-border-bottom': idx !== cartInfoListItem.cartInfoList.length - 1 }"
 | 
			
		||||
                      class="u-body-item u-flex u-col-between u-p-10">
 | 
			
		||||
                  <ListImgItem
 | 
			
		||||
                      :lazyLoad="false"
 | 
			
		||||
                      :showBottom="cartInfoItem.skuType === 0 && cartInfoItem.isNewPerson === 1"
 | 
			
		||||
                      :showLeft="cartInfoItem.skuType === 1"
 | 
			
		||||
                      :showRight="false"
 | 
			
		||||
                      :src="cartInfoItem.imgUrl"
 | 
			
		||||
                      height="200rpx"
 | 
			
		||||
                      width="200rpx"
 | 
			
		||||
                  ></ListImgItem>
 | 
			
		||||
                  <ListImgItem :lazyLoad="false"
 | 
			
		||||
                               :showBottom="cartInfoItem.skuType === 0 && cartInfoItem.isNewPerson === 1"
 | 
			
		||||
                               :showLeft="cartInfoItem.skuType === 1" :showRight="false"
 | 
			
		||||
                               :src="cartInfoItem.imgUrl" height="200rpx" width="200rpx"></ListImgItem>
 | 
			
		||||
                  <view class="u-p-b-20 u-m-l-20" style="flex:1">
 | 
			
		||||
                    <view>{{ cartInfoItem.skuName }}</view>
 | 
			
		||||
                    <view>购买数量:{{ cartInfoItem.skuNum }}</view>
 | 
			
		||||
@@ -61,25 +56,25 @@
 | 
			
		||||
        <u-card v-if="getCartCouponInfoList.length > 0" :padding="10" :show-head="false">
 | 
			
		||||
          <view slot="body">
 | 
			
		||||
            <view class="coupon">
 | 
			
		||||
              <view
 | 
			
		||||
                  v-for="couponInfoItem in getCartCouponInfoList"
 | 
			
		||||
                  :key="couponInfoItem.id"
 | 
			
		||||
                  :class="{ selected: couponInfoItem.selected }"
 | 
			
		||||
                  class="content u-m-b-20"
 | 
			
		||||
                  @click="switchCouponInfoItem(couponInfoItem)"
 | 
			
		||||
              >
 | 
			
		||||
              <view v-for="couponInfoItem in getCartCouponInfoList" :key="couponInfoItem.id"
 | 
			
		||||
                    :class="{ selected: couponInfoItem.selected }" class="content u-m-b-20"
 | 
			
		||||
                    @click="switchCouponInfoItem(couponInfoItem)">
 | 
			
		||||
                <view class="left">
 | 
			
		||||
                  <view class="sum">
 | 
			
		||||
                    ¥
 | 
			
		||||
                    <text class="num">{{ couponInfoItem.amount }}</text>
 | 
			
		||||
                  </view>
 | 
			
		||||
                  <view class="type">{{ couponInfoItem.couponType === 'FULL_REDUCTION' ? '满减券' : '现金券' }}</view>
 | 
			
		||||
                  <view class="type">
 | 
			
		||||
                    {{ couponInfoItem.couponType === 'FULL_REDUCTION' ? '满减券' : '现金券' }}
 | 
			
		||||
                  </view>
 | 
			
		||||
                  <view class="type">{{ getRangeType(couponInfoItem.rangeType) }}</view>
 | 
			
		||||
                </view>
 | 
			
		||||
                <view class="centre">
 | 
			
		||||
                  <view class="title">{{ couponInfoItem.couponName }}</view>
 | 
			
		||||
                  <view class="u-type-info">{{ couponInfoItem.rangeDesc }}</view>
 | 
			
		||||
                  <view class="valid-date">过期时间:{{ dayjs(couponInfoItem.expireTime).format('YYYY-MM-DD') }}</view>
 | 
			
		||||
                  <view class="valid-date">
 | 
			
		||||
                    过期时间:{{ dayjs(couponInfoItem.expireTime).format('YYYY-MM-DD') }}
 | 
			
		||||
                  </view>
 | 
			
		||||
                </view>
 | 
			
		||||
                <view class="right">
 | 
			
		||||
                  <block v-if="couponInfoItem.isSelect === 1">
 | 
			
		||||
@@ -111,7 +106,9 @@
 | 
			
		||||
                <view class="u-font-xs u-type-info">
 | 
			
		||||
                  优惠券优惠:¥{{ getCartPriceInfo.couponReduceAmount }}
 | 
			
		||||
                  <text class="u-font-xs u-m-l-20 u-type-info">原价:</text>
 | 
			
		||||
                  <text class="u-font-xs u-type-info">¥{{ getCartPriceInfo.originalTotalAmount }}</text>
 | 
			
		||||
                  <text
 | 
			
		||||
                      class="u-font-xs u-type-info">¥{{ getCartPriceInfo.originalTotalAmount }}
 | 
			
		||||
                  </text>
 | 
			
		||||
                </view>
 | 
			
		||||
              </view>
 | 
			
		||||
            </view>
 | 
			
		||||
@@ -144,7 +141,9 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapState('orderModule', ['order']),
 | 
			
		||||
    ...mapGetters('orderModule', ['getCartInfoList', 'getSelectedCount', 'getCartPriceInfo', 'getLeaderAddressVo', 'showMultiCheckbox', 'getCartCouponInfoList']),
 | 
			
		||||
    ...mapGetters('orderModule', ['getCartInfoList', 'getSelectedCount', 'getCartPriceInfo', 'getLeaderAddressVo',
 | 
			
		||||
      'showMultiCheckbox', 'getCartCouponInfoList'
 | 
			
		||||
    ]),
 | 
			
		||||
    getRangeType() {
 | 
			
		||||
      return function (rangeType) {
 | 
			
		||||
        switch (rangeType) {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,11 +9,11 @@
 | 
			
		||||
      <scroll-view class="gg-cart-sv-container" scroll-y="true">
 | 
			
		||||
        <!-- 提货点 -->
 | 
			
		||||
        <u-card :padding="10" :show-head="true">
 | 
			
		||||
          <view slot="head" class="u-m-10">提货人联系方式</view>
 | 
			
		||||
          <view slot="head" class="u-m-10">联系方式</view>
 | 
			
		||||
          <view slot="body" class="u-m-10">
 | 
			
		||||
            <view class="u-p-20">收货人员:{{ order.receiverName }}</view>
 | 
			
		||||
            <view class="u-p-20">姓名:{{ order.receiverName }}</view>
 | 
			
		||||
            <view class="u-p-20">联系方式:{{ order.receiverPhone }}</view>
 | 
			
		||||
            <view class="u-p-20">提货地点:{{ order.receiverAddress }}</view>
 | 
			
		||||
            <view class="u-p-20">地点:{{ order.receiverAddress }}</view>
 | 
			
		||||
          </view>
 | 
			
		||||
        </u-card>
 | 
			
		||||
 | 
			
		||||
@@ -28,8 +28,11 @@
 | 
			
		||||
                  <view class="u-font-xl">{{ orderItem.skuName }}</view>
 | 
			
		||||
                  <view>单价:¥{{ orderItem.skuPrice }}</view>
 | 
			
		||||
                  <view>数量:{{ orderItem.skuNum }}</view>
 | 
			
		||||
                  <view v-if="orderItem.splitActivityAmount > 0">活动金额:¥{{ orderItem.splitActivityAmount }}</view>
 | 
			
		||||
                  <view v-if="orderItem.splitCouponAmount > 0">优惠券额:¥{{ orderItem.splitCouponAmount }}</view>
 | 
			
		||||
                  <view v-if="orderItem.splitActivityAmount > 0">
 | 
			
		||||
                    活动金额:¥{{ orderItem.splitActivityAmount }}
 | 
			
		||||
                  </view>
 | 
			
		||||
                  <view v-if="orderItem.splitCouponAmount > 0">优惠券额:¥{{ orderItem.splitCouponAmount }}
 | 
			
		||||
                  </view>
 | 
			
		||||
                  <view>
 | 
			
		||||
                    小计:
 | 
			
		||||
                    <text class="u-type-error">¥{{ orderItem.splitTotalAmount }}</text>
 | 
			
		||||
@@ -69,7 +72,8 @@
 | 
			
		||||
 | 
			
		||||
      <view class="gg-navigation">
 | 
			
		||||
        <view class="navigation">
 | 
			
		||||
          <view class="buy btn u-line-1" @click="payOrder">支付订单</view>
 | 
			
		||||
          <view class="buy btn u-line-1" @click="payWxOrder">微信支付订单</view>
 | 
			
		||||
          <view class="buy btn u-line-1" @click="payAliOrder">支付宝支付订单</view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
@@ -91,7 +95,9 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    async getOrderInfoById(orderId) {
 | 
			
		||||
      const result = await this.$u.api.getOrderInfo({orderId});
 | 
			
		||||
      const result = await this.$u.api.getOrderInfo({
 | 
			
		||||
        orderId
 | 
			
		||||
      });
 | 
			
		||||
      this.order = result;
 | 
			
		||||
    },
 | 
			
		||||
    copyOrderNo() {
 | 
			
		||||
@@ -106,8 +112,10 @@ export default {
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    async payOrder() {
 | 
			
		||||
      const result = await this.$u.api.getWxPayment({orderNo: this.order.orderNo});
 | 
			
		||||
    async payWxOrder() {
 | 
			
		||||
      const result = await this.$u.api.getWxPayment({
 | 
			
		||||
        orderNo: this.order.orderNo
 | 
			
		||||
      });
 | 
			
		||||
      wx.requestPayment({
 | 
			
		||||
        timeStamp: result.timeStamp,
 | 
			
		||||
        nonceStr: result.nonceStr,
 | 
			
		||||
@@ -115,7 +123,9 @@ export default {
 | 
			
		||||
        signType: 'MD5',
 | 
			
		||||
        paySign: result.paySign,
 | 
			
		||||
        success: res => {
 | 
			
		||||
          this.$u.api.getOrderStatus({orderNo: this.order.orderNo});
 | 
			
		||||
          this.$u.api.getOrderStatus({
 | 
			
		||||
            orderNo: this.order.orderNo
 | 
			
		||||
          });
 | 
			
		||||
          uni.showToast({
 | 
			
		||||
            title: '支付成功',
 | 
			
		||||
            icon: 'none'
 | 
			
		||||
@@ -131,7 +141,46 @@ export default {
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    async payAliOrder() {
 | 
			
		||||
      try {
 | 
			
		||||
        const result = await this.$u.api.getAliPayment({
 | 
			
		||||
          orderNo: this.order.orderNo
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        my.tradePay({
 | 
			
		||||
          tradeNO: result.tradeNO,
 | 
			
		||||
          success: res => {
 | 
			
		||||
            if (res.resultCode === '9000') {
 | 
			
		||||
              this.$u.api.getOrderStatus({
 | 
			
		||||
                orderNo: this.order.orderNo
 | 
			
		||||
              });
 | 
			
		||||
              uni.showToast({
 | 
			
		||||
                title: '支付成功',
 | 
			
		||||
                icon: 'none'
 | 
			
		||||
              });
 | 
			
		||||
              uni.switchTab({
 | 
			
		||||
                url: '/pages/index/index'
 | 
			
		||||
              });
 | 
			
		||||
            } else {
 | 
			
		||||
              throw new Error('支付失败');
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          fail: err => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              title: err.errorMessage || '支付失败'
 | 
			
		||||
            });
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        uni.showToast({
 | 
			
		||||
          icon: 'none',
 | 
			
		||||
          title: error.message || '支付失败'
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getOrderInfoById(this.orderId);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,9 @@
 | 
			
		||||
                </view>
 | 
			
		||||
                <view class="total">
 | 
			
		||||
                  <text class="total-price">
 | 
			
		||||
                    <text class="decimal">现价:¥{{ res.totalAmount }} 原价:¥{{ res.originalTotalAmount }}</text>
 | 
			
		||||
                    <text class="decimal">现价:¥{{ res.totalAmount }}
 | 
			
		||||
                      原价:¥{{ res.originalTotalAmount }}
 | 
			
		||||
                    </text>
 | 
			
		||||
                  </text>
 | 
			
		||||
                </view>
 | 
			
		||||
                <view class="bottom">
 | 
			
		||||
@@ -45,6 +47,7 @@
 | 
			
		||||
                  </view>
 | 
			
		||||
                  <view class="logistics btn">查看物流</view>
 | 
			
		||||
                  <view class="exchange btn">卖了换钱</view>
 | 
			
		||||
                  <button class="evaluate btn" @click="getOrderInfo(res.id)">订单详情</button>
 | 
			
		||||
                  <view class="evaluate btn">评价</view>
 | 
			
		||||
                </view>
 | 
			
		||||
              </view>
 | 
			
		||||
@@ -63,14 +66,19 @@ export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 订单列表
 | 
			
		||||
      orderList: [[], [], [], [], []],
 | 
			
		||||
      orderList: [
 | 
			
		||||
        [],
 | 
			
		||||
        [],
 | 
			
		||||
        [],
 | 
			
		||||
        [],
 | 
			
		||||
        []
 | 
			
		||||
      ],
 | 
			
		||||
      // 订单类型、状态与数量
 | 
			
		||||
      list: [
 | 
			
		||||
        {
 | 
			
		||||
          name: '待付款',
 | 
			
		||||
          orderStatus: 'UNPAID',
 | 
			
		||||
          count: 0
 | 
			
		||||
        },
 | 
			
		||||
      list: [{
 | 
			
		||||
        name: '待付款',
 | 
			
		||||
        orderStatus: 'UNPAID',
 | 
			
		||||
        count: 0
 | 
			
		||||
      },
 | 
			
		||||
        {
 | 
			
		||||
          name: '待发货',
 | 
			
		||||
          orderStatus: 'WAITING_DELEVER',
 | 
			
		||||
@@ -159,6 +167,9 @@ export default {
 | 
			
		||||
        this.loadStatus.splice(idx, 1, 'nomore');
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getOrderInfo(id) {
 | 
			
		||||
      this.$u.route(`/pagesOrder/getOrderInfo/getOrderInfo?orderId=${id}`);
 | 
			
		||||
    },
 | 
			
		||||
    // tab栏切换
 | 
			
		||||
    change(index) {
 | 
			
		||||
      this.swiperCurrent = index;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user