会员充值与设置密码

This commit is contained in:
魏啾
2024-05-22 15:13:29 +08:00
parent 75ac4e967c
commit 83413a2776
8 changed files with 1828 additions and 89 deletions

View File

@@ -1,24 +1,18 @@
<template>
<view class="content">
<view class="towcontentitem">
<!-- <image class="towcontentitemimage" src="@/static/recharges.png" mode="widthFix"></image> -->
<view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="userInfo.avatar" mode="aspectFill"></image>
<image class="towcontentitemoneimage" :src="userInfo.headImg" mode="aspectFill"></image>
<view class="towcontentitemonetext flex-colum-start">
<text class="towcontentitemonetextone">{{userInfo.nickName || '暂无昵称'}}</text>
</view>
</view>
<view class="towcontentitemthere flex-start">
余额<text class="towcontentitemtheretext">{{memberlist.vip_number || '0.00'}}</text>
</view>
<view class="towcontentitemprogress">
<!-- 可用余额:{{memberlist.money || '0.00'}}
<text style="font-size: 16rpx; color:#000 ; margin-left: 10rpx;">冻结金额:{{memberlist.freeze_money}}</text>
<view class="towcontentitemoneabsolute">
加购
</view> -->
</view>
<view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext">{{memberlist.vip_number}}</text>
<!-- <text class="towcontentitemtowetext" style="color: #fff;">保洁清洗卡</text> -->
<text class="towcontentitemtowetext">{{memberlist.vip_number || '无'}}</text>
</view>
</view>
<view class="therecontent">
@@ -28,12 +22,12 @@
<view class="fourcontentlnage" v-for="(item,index) in listdata" :key="index">
<view class="flex-colum" :class="index == inputshow?'fourcontentitems':'fourcontentitem'"
@click="clickinput(item,index)">
<text>{{item.amount}}</text>
<!-- <text style="margin-top: 10rpx;">{{item.deliver}}</text> -->
<text>{{item.minNum}}</text>
<text style="margin-top: 10rpx;">{{item.minNum}}{{item.handselNum}}</text>
</view>
</view>
</view>
<view class="fivecontent" @click="userbalancerechangesub">
<view class="fivecontent" @tap="$u.debounce(userbalancerechangesub, 500)">
立即充值
</view>
</view>
@@ -45,20 +39,7 @@
return {
inputshow: 0,
memberlist: {},
listdata: [{
amount: 100
},{
amount: 200
},{
amount:300
},{
amount:400
},{
amount:500
},{
amount:1000
}
],
listdata: [],
amount: '',
shopUser: {},
userInfo: {}
@@ -66,9 +47,23 @@
},
onLoad(e) {
// this.shopUser = uni.cache.get('shopUser')
// this.userInfo = uni.cache.get('userInfo')
this.userInfo = uni.cache.get('userInfo')
this.paygetActive()
},
methods: {
async paygetActive() {
let res = await this.api.paygetActive({
shopId: uni.cache.get('shopUser'),
page: 1,
pageSize: 10
})
try {
this.listdata = res.data.list
this.amount = res.data.list[0].minNum
} catch (e) {
//TODO handle the exception
}
},
async userbalancerechangesub() {
if (this.amount == null || this.amount == '') {
uni.showToast({
@@ -85,26 +80,28 @@
// #ifdef MP-WEIXIN
uni.requestPayment({
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.payAppId, // 微信支付商户号
timeStamp: res.data.payTimeStamp, // 时间戳(单位:秒)
nonceStr: res.data.paynonceStr, // 随机字符串
package: res.data.payPackage, // 固定值
signType: res.data.paySignType, //固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
nonceStr: res.data.nonceStr, // 随机字符串
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
success: (res) => {
uni.showToast({
title: "支付成功"
})
uni.navigateBack()
setTimeout(res => {
uni.navigateBack()
}, 1000)
},
fail: (err) => {
uni.showToast({
icon: 'none',
title: '支付失败'
})
setTimeout(res => {
uni.showToast({
icon: 'none',
title: '支付失败'
})
uni.hideLoading()
}, 2000)
}, 1000)
}
});
// #endif
@@ -113,7 +110,7 @@
clickinput(a, b) {
console.log(a, b)
this.inputshow = b
this.amount = a.amount
this.amount = a.minNum
},
eeInfo(e) {
uni.pro.navigateTo('my/member/memberinfo', {
@@ -137,21 +134,19 @@
position: relative;
padding: 32rpx;
border-radius: 12rpx;
background: linear-gradient(126deg, #FFFBF2 0%, #F2D093 100%);
border-radius: 12rpx 12rpx 12rpx 12rpx;
.fourcontentitemabsolute {
z-index: 9;
&::after {
position: absolute;
right: 0;
top: 0;
padding: 6rpx 28rpx;
font-size: 20rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #FFFFFF;
text-shadow: 0px 6rpx 12rpx rgba(255, 255, 255, 0.19);
background: linear-gradient(NaNdeg, #4A4A4A 0%, #919191 100%);
border-radius: 0px 12rpx 0px 12rpx;
opacity: 1;
bottom: 0;
right: 68rpx;
content: '';
display: inline-block;
width: 240rpx;
height: 232rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/member.png) no-repeat;
background-size: 100% 100%;
}
.towcontentitemimage {
@@ -165,7 +160,6 @@
}
.towcontentitemone {
margin-top: 42rpx;
width: 100%;
position: relative;
z-index: 9;
@@ -183,10 +177,10 @@
margin-left: 16rpx;
.towcontentitemonetextone {
font-size: 32rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
color: #422A07;
font-size: 36rpx;
color: #333333;
}
.towcontentitemonetexttow {
@@ -206,44 +200,28 @@
margin-top: 54rpx;
}
.towcontentitemprogress {
z-index: 10;
position: relative;
margin-top: 24rpx;
border-radius: 28rpx;
font-size: 32rpx;
height: 56rpx;
line-height: 56rpx;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #333;
.towcontentitemoneabsolute {
position: absolute;
padding: 0 44rpx;
height: 56rpx;
line-height: 56rpx;
top: 0;
right: 0;
font-size: 28rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(130deg, #F4AE46 0%, #EE9437 100%);
box-shadow: 0px 4rpx 8rpx 2rpx rgba(243, 169, 67, 0.37);
border-radius: 28rpx;
}
}
.towcontentitemtow {
z-index: 10;
position: relative;
margin-top: 42rpx;
font-size: 24rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #422A07;
}
.towcontentitemthere {
margin-left: 92rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: Medium;
font-size: 24rpx;
color: #333333;
.towcontentitemtheretext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
}
}
.therecontent {