zpj 1 سال پیش
والد
کامیت
9497801aa6
3فایلهای تغییر یافته به همراه21 افزوده شده و 10 حذف شده
  1. 2 2
      manifest.json
  2. 9 4
      pages/index/order.vue
  3. 10 4
      pages/index/success.vue

+ 2 - 2
manifest.json

@@ -85,8 +85,8 @@
                     }
                 },
                 "/api" : {
-                    // "target" : "https://adopted.jhcs888.com/",
-                    "target" : "http://testadopted.jhcs888.com/",
+                    "target" : "https://adopted.jhcs888.com/",
+                    // "target" : "http://testadopted.jhcs888.com/",
                     "changeOrigin" : true,
                     "secure" : false
                 }

+ 9 - 4
pages/index/order.vue

@@ -281,12 +281,17 @@
 
 		methods: {
 			setYHmoney(){
-				let money = (((this.totalPrice - (this.totalPrice*this.discount))*1000).toFixed(2)/1000).toFixed(2)
-				return money
+				let num1 = this.totalPrice*1
+				let num2 = this.discount*1
+				let num3 = (((num1*num2*10000)/100).toFixed(0)/100).toFixed(2)
+				let num4 = ((((num1-num3)*10000)/100).toFixed(0)/100).toFixed(2)
+				return num4
 			},
 			setMoney(){
-				let money = ((this.totalPrice*this.discount*1000).toFixed(2)/1000).toFixed(2)
-				return money
+				let num1 = this.totalPrice*1
+				let num2 = this.discount*1
+				let num3 = (((num1*num2*10000)/100).toFixed(0)/100).toFixed(2)
+				return num3
 			},
 			
 			monitorKeyboard(e) {

+ 10 - 4
pages/index/success.vue

@@ -32,8 +32,17 @@
 			}
 		},
 		onLoad(e) {
+			this.shop_id = uni.getStorageSync('shop_id')
+			if(this.shop_id == 299){
+				this.upData();
+			}
+			
 			if(e.discount*1 > 0){
 				this.totalPrice = (((e.money*1)*(e.discount*1)*100).toFixed(2)/100).toFixed(2);
+				let num1 = e.money*1
+				let num2 = e.discount*1
+				this.totalPrice = (((num1*num2*10000)/100).toFixed(0)/100).toFixed(2)
+				
 			}else{
 				this.totalPrice = e.money;
 			}
@@ -42,10 +51,7 @@
 			this.invite_code = e.invite_code;
 			this.discount = e.discount;
 			
-			this.shop_id = uni.getStorageSync('shop_id')
-			if(this.shop_id == 299){
-				this.upData();
-			}
+			
 		},
 		methods:{
 			buy(){