소스 검색

订单提交支付修改

yuwenjun1997 3 년 전
부모
커밋
ccc326fdad
3개의 변경된 파일38개의 추가작업 그리고 24개의 파일을 삭제
  1. 2 3
      App.vue
  2. 27 1
      pages/order/order-create.vue
  3. 9 20
      pages/order/order-pay.vue

+ 2 - 3
App.vue

@@ -5,11 +5,10 @@
 import Vue from 'vue'
 import { mapActions, mapMutations } from 'vuex'
 export default {
-    onLaunch: function() {
-        console.log('清空本地缓存')
+    onLaunch: async function() {
         uni.clearStorageSync()
         this.initSystemInfo()
-        this.wechatlogin()
+        await this.wechatlogin()
         // 判断优惠券弹窗是否显示
         // this.checkShowCouponPopup()
     },

+ 27 - 1
pages/order/order-create.vue

@@ -68,6 +68,19 @@
 			@confirm="closeCouponList"
 			:currentId="currentCouponUniqueId"
 		></cm-coupon-list>
+
+		<!-- 阻止下单弹框 -->
+		<tui-modal
+			:show="preventModal"
+			:size="30"
+			:button="[{ text: '确定', type: 'danger' }]"
+			shape="circle"
+			color="#333333"
+			title="提示"
+			:content="preventText"
+			@click="onPreventConfirm"
+		></tui-modal>
+
 		<cm-loading :visible="isSubLoading" :text="loadingText"></cm-loading>
 		<view class="reserved" v-if="isIphoneX"></view>
 	</view>
@@ -102,8 +115,9 @@ export default {
 	},
 	data() {
 		return {
+			preventModal: false,
+			preventText: '抱歉,该商品支付正在调整暂不支持下单!',
 			isRequest: true,
-
 			// 收货地址
 			addressData: {},
 
@@ -246,6 +260,9 @@ export default {
 	},
 
 	methods: {
+		onPreventConfirm() {
+			uni.navigateBack({ delta: 1 })
+		},
 		// 支付回调执行函数
 		orderPaySuccess() {
 			this.$on('orderPaySuccess', () => {
@@ -378,6 +395,15 @@ export default {
 					this.fetchCouponList()
 					this.reduction = res.data.reduction
 					this.isRequest = false
+
+					if (res.data.onlinePay === -1) {
+						this.preventModal = true
+						this.preventText = '抱歉,该商品支付正在调整,暂不支持下单'
+					}
+					if (res.data.onlinePay === -2) {
+						this.preventModal = true
+						this.preventText = '抱歉,部分商品支付正在调整,暂不支持下单'
+					}
 				})
 				.catch(error => {
 					this.$util.msg(error.msg, 2000)

+ 9 - 20
pages/order/order-pay.vue

@@ -1,14 +1,15 @@
 <template>
 	<view class="order-pay">
 		<view class="top-tip">请对每家店铺分别进行付款</view>
-		<template v-for="item in orderList">
-			<view class="shop-info" :key="item.shopId">
+		<template v-for="order in orderList">
+			<view class="shop-info" :key="order.shopId">
 				<view class="shop-name">{{ item.shopName }}</view>
 				<view class="product-list">
-					<template v-for="product in item.orderProductList">
+					<template v-for="product in order.orderProductList">
 						<view class="product" :key="product.orderProductId">
 							<image class="cover" :src="product.productImage" mode="widthFix"></image>
 							<view class="content">
+								<view class="count">×{{ product.num }}</view>
 								<view class="title">{{ product.name }}</view>
 								<view class="unit">规格:{{ product.productUnit }}</view>
 								<view class="tags">
@@ -32,15 +33,15 @@
 					</template>
 				</view>
 				<view class="total">
-					<text v-if="item.eachDiscount">优惠:¥{{ item.eachDiscount }}</text>
-					<text v-if="item.receiptAmount">已付:¥{{ item.receiptAmount }}</text>
+					<text v-if="order.eachDiscount">优惠:¥{{ order.eachDiscount }}</text>
+					<text v-if="order.receiptAmount">已付:¥{{ order.receiptAmount }}</text>
 				</view>
-				<view class="foot">
+				<view class="foot" v-if="receiptStatus !== 3">
 					<view class="price">
 						<text>待付:</text>
-						<text class="active">¥{{ item.restAmount | formatPrice }}</text>
+						<text class="active">¥{{ order.restAmount | formatPrice }}</text>
 					</view>
-					<view class="submit" @click="onPayOrder(item)">付款</view>
+					<view class="submit" @click="onPayOrder(order)">付款</view>
 				</view>
 			</view>
 		</template>
@@ -70,18 +71,6 @@
 			</view>
 		</view> -->
 
-		<!-- 弹框 -->
-		<!-- <tui-modal
-			:show="modal"
-			:size="30"
-			:button="[{ text: '确定', type: 'danger' }]"
-			shape="circle"
-			color="#333333"
-			title="提示"
-			content="抱歉,该商品支付正在调整暂不支持下单!"
-			@click="onConfirm"
-		></tui-modal> -->
-
 		<!-- 操作弹窗 -->
 		<tui-modal
 			:show="modal"