zpj 1 жил өмнө
parent
commit
e9e6a74ff7
1 өөрчлөгдсөн 13 нэмэгдсэн , 5 устгасан
  1. 13 5
      pages/index/order.vue

+ 13 - 5
pages/index/order.vue

@@ -61,14 +61,13 @@
 					<view class="fs-30 fc-3">
 						共{{totalNum}}件
 						<span v-if="discount&&discount>0">,已优惠</span>
-						<span class="fs-30 fc-ED301D fw-600 mr-10"
-							v-if="discount&&discount>0">¥{{(totalPrice - (totalPrice*discount)).toFixed(2)}}</span>
+						<span class="fs-30 fc-ED301D fw-600 mr-10" v-if="discount&&discount>0">¥{{setYHmoney()}}</span>
 						<span class="fs-30 fc-ED301D fw-600" v-if="discount&&discount>0">{{discount*10||'0'}}折</span>
 					</view>
 					<view class="">
 						<span class="fs-30 fc-3">合计</span>
 						<span class="fs-30 fc-ED301D">¥</span>
-						<span class="fs-40 fc-ED301D fw-600" v-if="discount&&discount>0">{{(totalPrice*discount).toFixed(2)}}</span>
+						<span class="fs-40 fc-ED301D fw-600" v-if="discount&&discount>0">{{setMoney()}}</span>
 						<span class="fs-40 fc-ED301D fw-600" v-else>{{totalPrice}}</span>
 					</view>
 				</view>
@@ -101,7 +100,7 @@
 					<view class="fs-42 fw-b fc-lan text-align-center">请出示{{payType == 1?'微信':'支付宝'}}付款码</view>
 					<view class="text-align-center">
 						<span class="fs-30 fc-9">应付</span>
-						<span class="fs-40 fc-ED301D fw-b" v-if="discount&&discount>0">¥{{(totalPrice*discount).toFixed(2)}}</span>
+						<span class="fs-40 fc-ED301D fw-b" v-if="discount&&discount>0">¥{{setMoney()}}</span>
 						<span class="fs-42 fc-ED301D fw-b" v-else>¥{{totalPrice}}</span>
 					</view>
 					<image src="@/static/img/code-1.png" mode="scaleToFill"></image>
@@ -277,10 +276,19 @@
 		},
 
 		onShow() {
-			this.shop_id = uni.getStorageSync('shop_id')
+			this.shop_id = uni.getStorageSync('shop_id');
 		},
 
 		methods: {
+			setYHmoney(){
+				let money = (((this.totalPrice - (this.totalPrice*this.discount))*1000).toFixed(2)/1000).toFixed(2)
+				return money
+			},
+			setMoney(){
+				let money = ((this.totalPrice*this.discount*1000).toFixed(2)/1000).toFixed(2)
+				return money
+			},
+			
 			monitorKeyboard(e) {
 				if (e.key.length == 1) { // 字母和数字的长度都是1,所以只要字母和数字的按键,适配不同的设备
 					this.keyArr.push(e.key)