6ea0086f by simon

版本提交

1 parent e56c47ce
......@@ -8,7 +8,11 @@ Component({
wishList: {
type: Object,
value: [],
}
},
eleVal: {
type: Number,
value: 0,
},
},
data: {
// 这里是一些组件内部数据
......
......@@ -17,7 +17,7 @@
<view wx:if="{{wishList[1]}}" class="row row2">
<view class="wish-item ">
<view class="desc">
<view class="name">{{wishList[1].productName}}</view>
<view class="name">{{wishList[1].productName}}</view>
<view class="val">需弹力值:{{wishList[1].conditionElasticValue}}</view>
</view>
<view class="prod">
......@@ -26,7 +26,7 @@
</view>
</view>
<view wx:if="{{wishList[2]}}" class="row">
<view class="wish-item">
<view class="wish-item">
<view class="prod">
<image mode="widthFix" src="../../image/prize/prize-{{wishList[2].tag}}.png" />
</view>
......@@ -40,7 +40,7 @@
<view class="wish-val">
<image class="icon" mode="widthFix" src="../../image/oss/question/question-light.png" />
累计心愿单所需弹力值:
<span class="val">2500</span>
<span class="val">{{eleVal}}</span>
</view>
</view>
<view class="btn-wrap">
......
......@@ -21,7 +21,7 @@ Page({
curStatus: 1, // 当前场景
candidate: [], // 心愿候选列表
myWishList: [], // 我的心愿列表
valTotal:0, // 心愿单累计需要弹力值
valElasticTotal: 0, // 心愿单累计需要弹力值
curWish: {}, // 当前选择心愿
userInfo: {}
},
......@@ -108,12 +108,17 @@ Page({
*/
onSubmitHandler() {
this.checkSubmit().then((result) => {
let valTotal = 0;
let myWishList = this.data.myWishList;
let valElasticTotal = 0;
myWishList.forEach(element => {
valElasticTotal += element.conditionElasticValue
});
this.setData({
tipsWishVisible: true
tipsWishVisible: true,
valElasticTotal: valElasticTotal
})
console.log("wish:",this.data.myWishList);
console.log("wish:", this.data.myWishList);
}).catch((err) => {});;
},
// billCode
......
......@@ -65,7 +65,7 @@
<tips-new-comp bind:evtcomp="evtcomp" user-info="{{userInfo}}"></tips-new-comp>
</van-popup>
<van-popup show="{{ tipsWishVisible }}">
<tips-wish-comp bind:evtcomp="evtcomp" wish-list="{{myWishList}}"></tips-wish-comp>
<tips-wish-comp bind:evtcomp="evtcomp" wish-list="{{myWishList}}" ele-val="{{valElasticTotal}}"></tips-wish-comp>
</van-popup>
<van-popup show="{{ tipsShakeVisible }}">
<tips-shake-comp bind:evtcomp="evtcomp"></tips-shake-comp>
......