Browse Source

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
优惠券修改

1004749546@qq.com 4 years ago
parent
commit
4a7aa6b72f
3 changed files with 11 additions and 44 deletions
  1. 1 1
      pages/coupon/couponTpl.vue
  2. 5 42
      pages/coupon/index/index.vue
  3. 5 1
      pages/getOrder/getOrder.vue

+ 1 - 1
pages/coupon/couponTpl.vue

@@ -12,7 +12,7 @@
 				</view>
 			</view>
 			<view class="coupon-desc">
-				<view><u-icon class="icon" size="30" name="clock"></u-icon> 有效期至:{{item.validEndTime}}</view>
+				<view><u-icon class="icon" size="30" name="clock"></u-icon>{{item.validEndTimeStr}}</view>
 				<view><u-icon class="icon" size="30" name="info-circle"></u-icon>{{item.couponRuleDesc}}</view>
 			</view>
 		</view>

+ 5 - 42
pages/coupon/index/index.vue

@@ -39,47 +39,7 @@
 					name: '已过期',
 					status: -1
 				}],
-				couponList: [{
-						id: 23432445,
-						couponTitle: "满100减50",
-						couponAmount: 100,
-						validEndTime: "2020-05-16",
-						remarks: '优惠卷使用说明优惠卷使用说明优惠卷使用说明',
-						checked: false
-					},
-					{
-						id: 3544355,
-						couponTitle: "满100减50",
-						couponAmount: 100,
-						validEndTime: "2020-05-16",
-						remarks: '优惠卷使用说明优惠卷使用说明优惠卷使用说明',
-						checked: false
-					},
-					{
-						id: 234234234,
-						couponTitle: "满100减50",
-						couponAmount: 100,
-						validEndTime: "2020-05-16",
-						remarks: '优惠卷使用说明优惠卷使用说明优惠卷使用说明',
-						checked: false
-					},
-					{
-						id: 66264646,
-						couponTitle: "满100减50",
-						couponAmount: 100,
-						validEndTime: "2020-05-16",
-						remarks: '优惠卷使用说明优惠卷使用说明优惠卷使用说明',
-						checked: false
-					},
-					{
-						id: 9794694698,
-						couponTitle: "满100减50",
-						couponAmount: 100,
-						validEndTime: "2020-05-16",
-						remarks: '优惠卷使用说明优惠卷使用说明优惠卷使用说明',
-						checked: false
-					}
-				], // 优惠卷列表
+				couponList: [], // 优惠卷列表
 				// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
 				current: 0, // tabs组件的current值,表示当前活动的tab选项
 				swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
@@ -104,7 +64,7 @@
 				this.swiperCurrent = index;
 				this.couponList = []
 				this.count = 0
-				this.getList()
+				// this.getList()
 			},
 			// swiper-item左右移动,通知tabs的滑块跟随移动
 			transition(e) {
@@ -168,5 +128,8 @@
 		uni-swiper{
 			flex-grow: 1;
 		}
+		.u-empty.data-v-6938e513{
+			height: 90%;
+		}
 	}
 </style>

+ 5 - 1
pages/getOrder/getOrder.vue

@@ -367,7 +367,11 @@
 					"deviceNo": deviceNo, // 设备编号
 					"orderTime": this.$u.timeFormat(Date.now(), 'yyyy-mm-dd hh:MM:ss'),
 					"payableAmount": this.amount, // 应付金额 即优惠前金额
-					"paymentAmount": this.finalAmount // 实收金额 即优惠后金额
+					"paymentAmount": this.finalAmount, // 实收金额 即优惠后金额
+					"couponAmount": this.couponAmount, // 优惠金额
+				}
+				if (this.checkedCoupon) {
+					params.couponReceivesList = [{couponId:this.checkedCoupon.id}]
 				}
 				saveOrder(params).then(res => {
 					if (res.status == 200) {