|
@@ -65,7 +65,7 @@
|
|
|
</view>
|
|
|
<view style="display: flex;align-items: center;">
|
|
|
<view style="color: #999999;margin-right: 8rpx;">合计</view>
|
|
|
- <view class="priceTag">¥ {{ totalPrice }}</view>
|
|
|
+ <view class="priceTag">¥ {{ toFixed(totalPrice) }}</view>
|
|
|
<view style="display: flex;color: #FFFFFF;align-items: center;"><view class="btn2" @click="goBuy()">结算</view></view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -192,6 +192,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ toFixed(num) {
|
|
|
+ console.log(num)
|
|
|
+ return num.toFixed(2)
|
|
|
+ },
|
|
|
bindChangeE(e) {
|
|
|
console.log(e.detail.value);
|
|
|
this.examIndex = e.detail.value[0];
|
|
@@ -359,9 +363,6 @@ export default {
|
|
|
console.log(this.checkboxList)
|
|
|
},
|
|
|
countPrice(list) {},
|
|
|
- checkboxChange1(e) {
|
|
|
- //console.log(e);
|
|
|
- },
|
|
|
|
|
|
login() {
|
|
|
uni.navigateTo({ url: '/pages/login/login' });
|
|
@@ -441,26 +442,35 @@ export default {
|
|
|
},
|
|
|
checkboxChange(n) {
|
|
|
console.log('change', n);
|
|
|
- if (n.value) {
|
|
|
- this.totalPrice += this.list[n.name].standPrice;
|
|
|
- } else {
|
|
|
- this.totalPrice -= this.list[n.name].standPrice;
|
|
|
- }
|
|
|
- },
|
|
|
- checkboxAllChange(n) {
|
|
|
- this.totalPrice = 0.0;
|
|
|
- this.checkboxList = [];
|
|
|
- if (n.value) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+
|
|
|
+ this.totalPrice = 0.0;
|
|
|
for (let i = 0; i < this.list.length; i++) {
|
|
|
- this.list[i].checked = true;
|
|
|
- this.totalPrice += this.list[i].standPrice;
|
|
|
- this.checkboxList.push(i);
|
|
|
+ if(this.list[i].checked) {
|
|
|
+ console.log(this.list[i],999)
|
|
|
+ this.totalPrice += this.list[i].standPrice;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- } else {
|
|
|
- for (let i = 0; i < this.list.length; i++) {
|
|
|
- this.list[i].checked = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkboxAllChange(n) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.totalPrice = 0.0;
|
|
|
+ this.checkboxList = [];
|
|
|
+ if (n.value) {
|
|
|
+ for (let i = 0; i < this.list.length; i++) {
|
|
|
+ this.list[i].checked = true;
|
|
|
+ this.totalPrice += this.list[i].standPrice;
|
|
|
+ this.checkboxList.push(i);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < this.list.length; i++) {
|
|
|
+ this.list[i].checked = false;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
};
|