Commit 830d4cef by zhangzhen

权益会员功能调试

parent 85d9f140
import http from "@/common/vmeitime-http/index.js"
// 查询充值记录列表
export const recordsList=(data)=>{
let url=`/recharge/list`
// 可购买的权益列表
export const equityMembersList=(data)=>{
let url=`/equityMembersOrderConfig/list`
return http.get(url,data)
}
export const createEquityMembers=(data)=>{
let url=`/equityMembersOrder/createEquityMembers`
return http.post(url,data)
}
......@@ -142,6 +142,13 @@
"style": {
"navigationBarTitleText": "设备控制"
}
},
{
"path" : "pages/vipCreate/vipCreate",
"style" :
{
"navigationBarTitleText" : "权益充值"
}
}
],
......
<template>
<view class="vip-create">
<view class="banner-box">
<image :src="assetsPath+'/vip/bg.png'" mode="widthFix"></image>
<view class="footer-box">
<button class="cu-btn round bg-pink" @tap="onSubmit">立即充值</button>
</view>
</view>
</view>
</template>
<script>
import {equityMembersList,createEquityMembers} from "@/api/uerInfo.js";
import config from "@/config/index.config";
export default {
data() {
return {
assetsPath: config.assetsPath,
list:[],
index: 0
};
},
onLoad() {
this.onLoading();
},
methods:{
onLoading(){
equityMembersList().then(res => {
console.log(res,999999)
if(res.data.code == 200 && res.data.rows){
this.list = res.data.rows
}
})
},
onSubmit(){
createEquityMembers({
payType:1,
equityMembersConfigId:this.list[this.index].id
}).then(res =>{
console.log(res,9999)
if (res.data.data.jsConfig) {
wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp,
"nonceStr": res.data.data.jsConfig.nonceStr,
"package": res.data.data.jsConfig.packages,
"signType": res.data.data.jsConfig.signType,
"paySign": res.data.data.jsConfig.paySign,
"success": (resp) => {
// 支付成功
uni.showToast({
icon: "success",
title: "下单成功",
success: () => {
}
})
},
"fail": (resp) => {
// 取消支付或支付失败
uni.showToast({
title: "取消支付"
})
},
"complete": (resp) => {
// 接口调用结束的回调函数(调用成功、失败都会执行)
}
});
}
})
}
}
}
</script>
<style lang="scss" scoped>
.vip-create{
display: flex;
flex-direction: column;
width: 100%;
}
.banner-box{
position: relative;
width: 100%;
}
image{
width: 100%;
}
.footer-box{
position: absolute;
left: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 30upx;
}
</style>
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