|
|
@@ -36,15 +36,7 @@
|
|
|
</view>
|
|
|
|
|
|
<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">
|
|
|
<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"
|
|
|
style="border-top: 1rpx solid #e5e5e5;padding: 30rpx;z-index: 9;">
|
|
|
<view class="text-red">
|
|
|
- <text class="padding-right">总共</text>
|
|
|
+ <text >需支付现金</text>
|
|
|
<text>¥</text>
|
|
|
- <text>{{totalCash}}</text>
|
|
|
+ <text>{{cashValue}}</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
<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>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -135,6 +127,10 @@
|
|
|
onLoad(options) {
|
|
|
this.id = options.id;
|
|
|
this.activityId = options.activityId;
|
|
|
+ if (this.$u.test.isEmpty(this.id)) {
|
|
|
+ this.$u.toast('商品id不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.userId = uni.getStorageSync("userId");
|
|
|
this.authorization();
|
|
|
this.fetchGoodsDetail();
|
|
|
@@ -145,6 +141,17 @@
|
|
|
let total = this.data.cashValue + this.changeCash.hotCash + this.changeCash.pointsCash
|
|
|
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() {
|