Commit cf7f7364 authored by Mac's avatar Mac

1

parent 324a8b4e
......@@ -153,11 +153,12 @@
</view>
<view class="buybtn-box" style="">
<!-- <image src="" style="width: 100%;height: auto;" mode="widthFix"></image> -->
<view class="buybtn">
<view class="buybtn" @click="show=true">
<text style="color: #00C6C1;margin-right: 5px;font-family: aa;">{{data.MemberBuyMoney?data.MemberBuyMoney.toFixed(2):0}}</text>
立即购买
</view>
</view>
<u-modal v-model="show" :content="content" :show-cancel-button='true' @confirm='queren'></u-modal>
</view>
</scroll-view>
</template>
......@@ -168,12 +169,15 @@
data(){
return{
pageTitle: '会员权益',
show:false,
MemberGradeId:0,
mainColor:'',
scrollTop:0,
headStyle: {},
nav:0,
data:{},
orderInfo:{},
content:'',
}
},
created() {
......@@ -211,10 +215,56 @@
res => {
if (res.resultCode == 1) {
this.data = res.data
this.data = res.data;
this.content ='确定花费¥' + this.data.MemberBuyMoney +'购买' +this.data.GradeName+'吗?';
}
}
);
},
queren(){
let url='/api/WeChatPay/GetMemberBuyPayInfo'
this.request2({
url: url,
data: {
GradeId:this.data.Grade,
Money:this.data.MemberBuyMoney,
PayWay:1,
}
},
res => {
this.orderInfo = JSON.parse(res.data);
console.log(this.orderInfo)
this.Pay()
}
);
},
Pay(){
let that=this;
uni.requestPayment({
provider: 'wxpay',
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log('success', res);
uni.showToast({
title: "支付成功"
})
that.getdianshu()
},
fail: function(err) {
console.log('fail:', err);
uni.showToast({
title: "支付失败"
})
}
});
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment