萤火科技 1 år sedan
förälder
incheckning
d0b4fcef37

+ 8 - 5
components/goods-sku-popup/index.vue

@@ -39,11 +39,14 @@
                 </view>
               </view>
             </view>
+            <!-- 显示限购 -->
             <view class="number-box-view">
-              <view style="flex: 1;">数量</view>
-              <view style="flex: 4;text-align: right;">
+              <view style="flex: 1; display: flex; align-items: center;">数量</view>
+              <view style="flex: 4; display: flex; align-items: center; justify-content: flex-end;">
+                <text v-if="maxBuyNum > 0" style="margin-right: 18rpx; font-size: 26rpx; color: #e74800;">限购{{ maxBuyNum }}件</text>
                 <number-box v-model="selectNum" :min="minBuyNum || 1" :max="maxBuyNumCom" :step="stepBuyNum || 1"
-                  :step-strictly="stepStrictly" :positive-integer="true" @change="numChange" />
+                  :step-strictly="stepStrictly" :positive-integer="true">
+                </number-box>
               </view>
             </view>
           </view>
@@ -1161,11 +1164,11 @@
 
             .specification-right {
               flex: 1;
-              padding: 0 35rpx 10rpx 28rpx;
+              padding: 0 50rpx 10rpx 28rpx;
               box-sizing: border-box;
               display: flex;
               flex-direction: column;
-              justify-content: flex-end;
+              justify-content: center;
               font-weight: 500;
 
               .price-content {

+ 2 - 2
index.html

@@ -11,8 +11,8 @@
       uni-app,
       uni-page,
       uni-page-wrapper {
-        min-height: 100%;
-        height: auto !important;
+        /* min-height: 100%;
+        height: auto !important; */
       }
     </style>
   </head>

+ 11 - 30
pages/checkout/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="container p-bottom" :style="appThemeStyle">
-    <view v-if="order.goodsList.length">
+    <view v-if="order.goodsList.length && order.goodsList.length">
       <!-- 实物订单:选择配送方式 -->
       <block v-if="order.orderType == OrderTypeEnum.PHYSICAL.value">
         <!-- 配送方式选项卡 -->
@@ -285,24 +285,7 @@
         // 是否显示优惠券弹窗
         showPopup: false,
         // 订单信息 (从后端api中获取)
-        order: {
-          // 商品列表
-          goodsList: [],
-          // 优惠券列表
-          couponList: [],
-          // 是否存在收货地址
-          existAddress: false,
-          // 默认收货地址
-          address: null,
-          // 是否存在收货地址
-          existAddress: false,
-          // 当前用户收货城市是否存在配送规则中
-          isIntraRegion: true,
-          // 是否存在错误
-          hasError: false,
-          // 错误信息
-          errorMsg: '',
-        },
+        order: {},
         // 个人信息
         personal: {},
         // 商城设置
@@ -457,23 +440,21 @@
         getCheckoutApi(app.options.mode)
           .submit(app.options.mode, app.getFormData())
           .then(result => {
-            // 订单创建成功: 跳转到订单支付页
+            // 订单创建成功
             const orderId = result.data.orderId
-            setTimeout(() => {
-              this.$navTo('pages/checkout/cashier/index', { orderId }, 'redirectTo')
-            }, 100)
+            // 判断订单是否已支付: 已支付跳转订单列表  未支付跳转支付页
+            if (result.data.isPaySuccess) {
+              app.showToast(result.message, 1500)
+              setTimeout(() => app.$navTo('pages/order/index', {}, 'redirectTo'), 1500)
+            } else {
+              // 订单未支付: 跳转到订单支付页
+              setTimeout(() => app.$navTo('pages/checkout/cashier/index', { orderId }, 'redirectTo'), 100)
+            }
           })
           .catch(res => app.showToast(res.errMsg, 3000))
           .finally(() => setTimeout(() => app.disabled = false, 800))
       },
 
-      // 跳转到我的订单(等待1秒)
-      navToMyOrder() {
-        setTimeout(() => {
-          this.$navTo('pages/order/index', {}, 'redirectTo')
-        }, 1000)
-      },
-
       // 表单提交的数据
       getFormData() {
         const app = this

+ 1 - 1
pages/checkout/style.scss

@@ -391,7 +391,7 @@
   line-height: 50rpx;
   text-align: left;
   color: #606266;
-  height: 620rpx;
+  height: 520rpx;
   box-sizing: border-box;
 }
 

+ 1 - 1
pages/goods/components/SkuPopup.vue

@@ -23,7 +23,7 @@
         Type: Boolean,
         default: false
       },
-      // 模式 1:都显示 2:只显示购物车 3:只显示立即购买
+      // 模式 1:都显示 2:只显示购物车 3:只显示立即购买 4:显示缺货按钮 默认 1
       skuMode: {
         type: Number,
         default: 1

+ 1 - 1
pages/goods/detail.vue

@@ -171,7 +171,7 @@
         cartTotal: 0,
         // 显示/隐藏SKU弹窗
         showSkuPopup: false,
-        // 模式 1:都显示 2:只显示购物车 3:只显示立即购买
+        // 模式 1:都显示 2:只显示购物车 3:只显示立即购买 4:显示缺货按钮 默认 1
         skuMode: 1,
         // 显示/隐藏分享菜单
         showShareSheet: false,

+ 8 - 3
pages/order/detail.vue

@@ -260,7 +260,7 @@
 
   export default {
     data() {
-      return {    
+      return {
         // 外部方法
         inArray,
         // 枚举类
@@ -614,7 +614,7 @@
       .item-lable {
         display: flex;
         align-items: center;
-        font-size: 24rpx;
+        font-size: 26rpx;
         color: #999;
         margin-right: 30rpx;
       }
@@ -814,10 +814,15 @@
       display: flex;
       justify-content: flex-end;
 
+      .lable {
+        font-size: 26rpx;
+      }
+
       .goods-price {
-        margin-left: 12rpx;
+        // margin-left: 12rpx;
         vertical-align: bottom;
         color: $main-bg;
+        font-size: 28rpx;
 
         .unit {
           margin-right: -2rpx;

+ 31 - 26
pages/order/index.vue

@@ -58,7 +58,8 @@
               </block>
               <!-- 已支付进行中的订单 -->
               <block v-if="item.order_status != OrderStatusEnum.APPLY_CANCEL.value">
-                <block v-if="item.pay_status == PayStatusEnum.SUCCESS.value && item.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value">
+                <block
+                  v-if="item.pay_status == PayStatusEnum.SUCCESS.value && item.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value">
                   <view class="btn-item" @click="onCancel(item.order_id)">申请取消</view>
                 </block>
               </block>
@@ -69,7 +70,8 @@
                 <view class="btn-item active" @click="onPay(item.order_id)">去支付</view>
               </block>
               <!-- 确认收货 -->
-              <block v-if="item.delivery_status == DeliveryStatusEnum.DELIVERED.value && item.receipt_status == ReceiptStatusEnum.NOT_RECEIVED.value">
+              <block
+                v-if="item.delivery_status == DeliveryStatusEnum.DELIVERED.value && item.receipt_status == ReceiptStatusEnum.NOT_RECEIVED.value">
                 <view class="btn-item active" @click="onReceipt(index)">确认收货</view>
               </block>
               <!-- 订单评价 -->
@@ -86,6 +88,7 @@
 
 <script>
   import {
+    OrderSourceEnum,
     DeliveryStatusEnum,
     DeliveryTypeEnum,
     OrderStatusEnum,
@@ -126,21 +129,20 @@
     data() {
       return {
         // 枚举类
+        OrderSourceEnum,
         DeliveryStatusEnum,
         DeliveryTypeEnum,
         OrderStatusEnum,
         PayStatusEnum,
         ReceiptStatusEnum,
-
         // 当前页面参数
-        options: { dataType: 'all' },
+        options: { dataType: 'all', orderSource: null },
         // tab栏数据
         tabs,
         // 当前标签索引
         curTab: 0,
         // 订单列表数据
         list: getEmptyPaginateObj(),
-
         // 上拉加载配置
         upOption: {
           // 首次自动执行
@@ -150,9 +152,7 @@
           // 数量要大于4条才显示无更多数据
           noMoreSize: 4,
           // 空布局
-          empty: {
-            tip: '亲,暂无订单记录'
-          }
+          empty: { tip: '亲,暂无订单记录' }
         },
         // 控制onShow事件是否刷新订单列表
         canReset: false
@@ -163,8 +163,10 @@
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
+      // 记录query参数
+      this.options = { ...this.options, ...options }
       // 初始化当前选中的标签
-      this.initCurTab(options)
+      this.initCurTab()
       // 注册全局事件订阅: 是否刷新订单列表
       uni.$on('syncRefresh', canReset => {
         this.canReset = canReset
@@ -199,11 +201,11 @@
     methods: {
 
       // 初始化当前选中的标签
-      initCurTab(options) {
-        const app = this
+      initCurTab() {
+        const { options } = this
         if (options.dataType) {
-          const index = app.tabs.findIndex(item => item.value == options.dataType)
-          app.curTab = index > -1 ? index : 0
+          const index = this.tabs.findIndex(item => item.value == options.dataType)
+          this.curTab = index > -1 ? index : 0
         }
       },
 
@@ -228,7 +230,11 @@
       getOrderList(pageNo = 1) {
         const app = this
         return new Promise((resolve, reject) => {
-          OrderApi.list({ dataType: app.getTabValue(), page: pageNo }, { load: false })
+          OrderApi.list({
+              dataType: app.getTabValue(),
+              orderSource: app.options.orderSource,
+              page: pageNo,
+            }, { load: false })
             .then(result => {
               // 合并新数据
               const newList = app.initList(result.data.list)
@@ -464,18 +470,18 @@
           max-height: 76rpx;
         }
 
-      .goods-props {
-        margin-top: 14rpx;
-        color: #ababab;
-        font-size: 24rpx;
-        overflow: hidden;
+        .goods-props {
+          margin-top: 14rpx;
+          color: #ababab;
+          font-size: 24rpx;
+          overflow: hidden;
 
-        .goods-props-item {
-          padding: 4rpx 16rpx;
-          border-radius: 12rpx;
-          background-color: #fcfcfc;
+          .goods-props-item {
+            padding: 4rpx 16rpx;
+            border-radius: 12rpx;
+            background-color: #fcfcfc;
+          }
         }
-      }
 
 
       }
@@ -548,5 +554,4 @@
     }
 
   }
-
-</style>
+</style>

+ 4 - 1
pages/refund/detail.vue

@@ -293,7 +293,10 @@
               uni.navigateBack()
             }, 1500)
           })
-          .catch(err => app.disabled = false)
+          .catch(err => {
+            app.$toast(err.errMsg)
+            app.disabled = false
+          })
       }
 
     }

+ 9 - 0
utils/utils.scss

@@ -250,6 +250,10 @@
   margin-left: 20rpx;
 }
 
+.m-r-3 {
+  margin-right: 3rpx;
+}
+
 .m-r-6 {
   margin-right: 6rpx;
 }
@@ -258,6 +262,11 @@
   margin-right: 10rpx;
 }
 
+.m-lr-6 {
+  margin-left: 6rpx;
+  margin-right: 6rpx;
+}
+
 .p-bottom {
   padding-bottom: 112rpx;
 }