zpj 1 год назад
Родитель
Сommit
ad0ce4f474
1 измененных файлов с 18 добавлено и 4 удалено
  1. 18 4
      pages/index/order.vue

+ 18 - 4
pages/index/order.vue

@@ -220,7 +220,7 @@
 
 <script>
 	import {
-		projectDiscount
+		projectDiscount,projectWriteDiscount
 	} from '@/api/project.js';
 
 	import keyboardListener from 'uniapp-keyboard-listener';
@@ -350,7 +350,7 @@
 								if (res.code == 1) {
 									this.payFLag = true;
 									this.isAJAX = false;
-
+									this.upData();
 									uni.redirectTo({
 										url: '/pages/index/success?money=' + this.totalPrice +
 											"&discount=" + this.discount + '&invite_code=' + this
@@ -366,7 +366,19 @@
 					this.keyArr = [];
 				}
 			},
-
+			
+			upData() {
+				this.shop_id = uni.getStorageSync('shop_id')
+				if (this.shop_id == 299) {
+					projectWriteDiscount({
+						order_money: this.money,
+						invite_code: this.invite_code,
+						discount: this.discount,
+						phone: this.phone
+					}).then((res) => {})
+				}
+			},
+			
 			// 获取商品
 			getGoods() {
 				GoodsInfo({
@@ -406,6 +418,8 @@
 					}
 				})
 			},
+			
+			
 			// 删除商品
 			delGoods(i) {
 				this.totalNum = this.totalNum - this.goodsList[i].num;
@@ -529,7 +543,7 @@
 				}).then((res) => {
 					this.isAJAX = false;
 					if (res.code == 1) {
-						this.phone = '';
+						
 						this.member_id = res.data.member_id;
 						this.discount = res.data.discount * 1 / 10;
 						this.$refs.inputPhone.close();