喻文俊 3 лет назад
Родитель
Сommit
d4113a0432
1 измененных файлов с 29 добавлено и 29 удалено
  1. 29 29
      pages/user/order/create-order.vue

+ 29 - 29
pages/user/order/create-order.vue

@@ -175,7 +175,7 @@
 			}
 		},
 		onLoad(option){//商品数据
-			let data = JSON.parse(option.data);
+			let data = JSON.parse(option.data)
 			if(option.type =='prodcut'){
 				this.cartType = 2
 				this.productCount = data.data.productCount
@@ -187,12 +187,12 @@
 			}
 			this.$api.getStorage().then((resolve) =>{
 				this.userID = resolve.userId ? resolve.userId : 0
-				this.getInitCrearOrder();
+				this.getInitCrearOrder()
 			})
 		},
 		filters:{
 			NumFormat(value) {//处理金额
-				return Number(value).toFixed(2);
+				return Number(value).toFixed(2)
 			},
 		},	
 		methods: {
@@ -216,8 +216,8 @@
 						this.isCouponShow = true
 						this.couponAmount = data.couponList[0].couponAmount
 						this.clubCouponId = data.couponList[0].clubCouponId 
-						this.payAllPrice = this.allPrice - this.couponAmount
 					}
+                    this.payAllPrice = this.allPrice - this.couponAmount
 					this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				})
 				.catch(error =>{
@@ -265,18 +265,18 @@
 						this.isAddress = true
 						this.addressData = {}
 						if(response.data.results != ''){
-							this.addressID = response.data.results[0].addressID;
-							this.townID = response.data.results[0].townID;
-							this.addressData = response.data.results[0];
+							this.addressID = response.data.results[0].addressID
+							this.townID = response.data.results[0].townID
+							this.addressData = response.data.results[0]
 							this.getFreightData()
 						}else{
-							this.addressData = this.addressData;
+							this.addressData = this.addressData
 						}
 					})
 				})
 			},
 			handChangeInputGoodsList(data){//对应供应商的留言信息
-				this.goodsData = data;
+				this.goodsData = data
 			},
 			handleChoiceaInvoiceData(data){//获取发票信息
 				this.invoiceData = data
@@ -303,7 +303,7 @@
 				}
 			},
 			hanldFreightBeans(data){//是否勾选采美豆抵扣
-				this.isCheckedBeans = data;
+				this.isCheckedBeans = data
 				if(this.isCheckedBeans){
 					// 判断如果采美豆大于等于运费*100
 					if( this.freightData.userBeans > 0 ){
@@ -341,7 +341,7 @@
 			handleChoiceaCouponData(data){// 勾选使用优惠券
 				console.log('优惠券信息',data)
 				this.couponAmount = data.couponAmount
-				this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
+				this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				this.clubCouponId = data.clubCouponId
 				this.attributePallPrice()
 				this.hanldFreightBeans(this.isCheckedBeans)
@@ -390,9 +390,9 @@
 						this.surplusMoney = this.userMoney - this.deductMoney	    // 剩余余额等于总余额-当前使用金额
 					}
 				}else{
-					this.payAllPrice = this.allPrice - this.couponAmount;
-					this.deductMoney = 0.00; // 当前使用
-					this.surplusMoney = this.userMoney; // 剩余余额
+					this.payAllPrice = this.allPrice - this.couponAmount
+					this.deductMoney = 0.00 // 当前使用
+					this.surplusMoney = this.userMoney // 剩余余额
 				}
 				console.log('最终订单支付金额',this.payAllPrice)
 				console.log('优惠券金额',this.couponAmount)
@@ -429,13 +429,13 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){// 提交订单
-				if(this.isSubLoading){ return; }
+				if(this.isSubLoading){ return }
 				if(this.addressID == ''){
 					this.$util.msg('请先添加收货地址~',2000)
 					return
 				}
 				this.orderInfo = this.goodsData.map(el => {
-					let productInfo = [];
+					let productInfo = []
 					el.cartList.forEach(item => {
 						productInfo.push({
 							productId:item.productId,
@@ -466,9 +466,9 @@
 						orderInvoice:this.invoiceData
 					}
 					console.log(param)
-				this.isSubLoading = true;	
+				this.isSubLoading = true	
 				this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
-					const data = response.data;
+					const data = response.data
 					// 友盟埋点收集机构自主提交订单
 					if(process.env.NODE_ENV != 'development'){
 						this.$uma.trackEvent('Um_Event_ConfirmOrder', {
@@ -480,7 +480,7 @@
 					if(data.code === '1'){
 						this.submitState ='success'
 						setTimeout(()=>{
-							this.isSubLoading = false;
+							this.isSubLoading = false
 						},2000)
 						let data = {orderID:response.data.orderID}
 						this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:data})}`)
@@ -488,35 +488,35 @@
 						this.submitState ='confirm'
 						this.$util.msg('订单提交成功',3000,true,'success')
 						setTimeout(()=>{
-							this.isSubLoading = false;
+							this.isSubLoading = false
 						},2000)
 						setTimeout(()=>{
 							this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderID=${response.data.orderID}`)
 						},3000)
 					}
 				}).catch(error =>{
-					this.$util.msg(error.msg,3000);
+					this.$util.msg(error.msg,3000)
 				})
 			},
 			handFreightAlertShow(){//显示邮费弹窗
-				this.isfreightTip = true;
+				this.isfreightTip = true
 			},
 			handleClickCancel(){// 关闭优惠券弹窗
-				this.isCouponModel = false;
-				this.getInitCrearOrder();
+				this.isCouponModel = false
+				this.getInitCrearOrder()
 			},
 			hideFreight(){//关闭邮费弹窗
-				this.isfreightTip = false;
+				this.isfreightTip = false
 			},
 		},
 		onShow() {
 			// this.addressID = ''
-			let pages = getCurrentPages();
-			let currPage = pages[pages.length-1];
+			let pages = getCurrentPages()
+			let currPage = pages[pages.length-1]
 			if(currPage.data.select =='select'){
 				this.isAddress = true
-				let SelectData = uni.getStorageSync('selectAddress');
-				this.addressID = SelectData.addressID;
+				let SelectData = uni.getStorageSync('selectAddress')
+				this.addressID = SelectData.addressID
 				this.addressData = SelectData
 				this.getFreightData()
 			}else{