Commit cf7f7364 authored by Mac's avatar Mac

1

parent 324a8b4e
...@@ -153,11 +153,12 @@ ...@@ -153,11 +153,12 @@
</view> </view>
<view class="buybtn-box" style=""> <view class="buybtn-box" style="">
<!-- <image src="" style="width: 100%;height: auto;" mode="widthFix"></image> --> <!-- <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> <text style="color: #00C6C1;margin-right: 5px;font-family: aa;">{{data.MemberBuyMoney?data.MemberBuyMoney.toFixed(2):0}}</text>
立即购买 立即购买
</view> </view>
</view> </view>
<u-modal v-model="show" :content="content" :show-cancel-button='true' @confirm='queren'></u-modal>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
...@@ -168,12 +169,15 @@ ...@@ -168,12 +169,15 @@
data(){ data(){
return{ return{
pageTitle: '会员权益', pageTitle: '会员权益',
show:false,
MemberGradeId:0, MemberGradeId:0,
mainColor:'', mainColor:'',
scrollTop:0, scrollTop:0,
headStyle: {}, headStyle: {},
nav:0, nav:0,
data:{}, data:{},
orderInfo:{},
content:'',
} }
}, },
created() { created() {
...@@ -211,10 +215,56 @@ ...@@ -211,10 +215,56 @@
res => { res => {
if (res.resultCode == 1) { 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