Просмотр исходного кода

Merge branch 'master' of http://192.168.1.218:3000/liyingqu/cyzh-SoundOfMusic-H5

lyqu 4 лет назад
Родитель
Сommit
3012c8089a
2 измененных файлов с 20 добавлено и 13 удалено
  1. 19 12
      pages/activityList/goods/detail.vue
  2. 1 1
      pages/activityList/mine/pointsDetail.vue

+ 19 - 12
pages/activityList/goods/detail.vue

@@ -36,15 +36,7 @@
 			</view>
 			</view>
 			
 			
 			<view class="padding-sm">
 			<view class="padding-sm">
-				<view class="flex padding-xs">
-					<text class="flex justify-center align-center">现金值:</text>
-					<u-number-box :input-width="200" :min="0" :step="cashStep" :positive-integer="cashPositive" :max="+detail.cashValue" v-model="data.cashValue">
-					</u-number-box>
-					<view v-if="data.cashValue!=0" class="padding-left-sm text-red flex justify-center align-center">
-						=
-						<text class="padding-left-sm ">{{data.cashValue}} 元</text>
-					</view>
-				</view>
+				
 			
 			
 				<view class="flex padding-xs">
 				<view class="flex padding-xs">
 					<text class="flex justify-center align-center">热力值:</text>
 					<text class="flex justify-center align-center">热力值:</text>
@@ -86,13 +78,13 @@
 		<view v-else class="footer-fixed flex align-center justify-between  bg-white"
 		<view v-else class="footer-fixed flex align-center justify-between  bg-white"
 			style="border-top: 1rpx solid #e5e5e5;padding: 30rpx;z-index: 9;">
 			style="border-top: 1rpx solid #e5e5e5;padding: 30rpx;z-index: 9;">
 			<view class="text-red">
 			<view class="text-red">
-				<text class="padding-right">总共</text>
+				<text >需支付现金</text>
 				<text>¥</text>
 				<text>¥</text>
-				<text>{{totalCash}}</text>
+				<text>{{cashValue}}</text>
 			</view>
 			</view>
 			<view>
 			<view>
 				<button class="cu-btn round text-white theme-bg-color"
 				<button class="cu-btn round text-white theme-bg-color"
-					style="width: 180upx;height: 80upx;margin-right: 30upx;" @click="confirm">兑换</button>
+					style="width: 180upx;height: 80upx;margin-right: 10upx;" @click="confirm">兑换</button>
 				<button @click="exchangeShow = false" class="cu-btn round line-gray" style="width: 180upx;height: 80upx;z-index: 99;">取消</button>
 				<button @click="exchangeShow = false" class="cu-btn round line-gray" style="width: 180upx;height: 80upx;z-index: 99;">取消</button>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -135,6 +127,10 @@
 		onLoad(options) {
 		onLoad(options) {
 			this.id = options.id;
 			this.id = options.id;
 			this.activityId = options.activityId;
 			this.activityId = options.activityId;
+			if (this.$u.test.isEmpty(this.id)) {
+				this.$u.toast('商品id不能为空')
+				return
+			}
 			this.userId = uni.getStorageSync("userId");
 			this.userId = uni.getStorageSync("userId");
 			this.authorization();
 			this.authorization();
 			this.fetchGoodsDetail();
 			this.fetchGoodsDetail();
@@ -145,6 +141,17 @@
 					let total = this.data.cashValue + this.changeCash.hotCash + this.changeCash.pointsCash
 					let total = this.data.cashValue + this.changeCash.hotCash + this.changeCash.pointsCash
 					return total
 					return total
 				}
 				}
+			},
+			cashValue:{
+				get(){
+					let val=this.detail.cashValue - (this.changeCash.hotCash + this.changeCash.pointsCash)
+					if (val<0) {
+						this.$u.toast('不可以超过商品价格')
+						return 0
+					}
+					this.data.cashValue=val
+					return  val
+				}
 			}
 			}
 		},
 		},
 		onShow() {
 		onShow() {

+ 1 - 1
pages/activityList/mine/pointsDetail.vue

@@ -55,7 +55,7 @@
 				})
 				})
 			},
 			},
 			getPointsDetail() {
 			getPointsDetail() {
-				this.$u.api.points.list({id: this.userId, current: this.current, size: this.size}).then(res => {
+				this.$u.api.points.list({userId: this.userId, current: this.current, size: this.size}).then(res => {
 					this.pointsList = [...this.pointsList,...res.records];
 					this.pointsList = [...this.pointsList,...res.records];
 				})
 				})
 			}
 			}