|
@@ -5,14 +5,17 @@
|
|
|
<image class="image" src="../../static/imgs/recharge/recharge_top_bg.png" mode="aspectFit"></image>
|
|
|
</view>
|
|
|
<view class="top__container">
|
|
|
- <view class="top__container__title">
|
|
|
- <view class="top__container__title__name">购买会员</view>
|
|
|
- <view class="top__container__title__icon">
|
|
|
- <image class="image" src="../../static/imgs/public/img_coin.png" mode="aspectFill"></image>
|
|
|
- </view>
|
|
|
+ <view class="top__container__kaitong" v-if="user_data.is_vip">已开通</view>
|
|
|
+ <view class="top__container__avatar">
|
|
|
+ <image class="image" :src="UserData().getData().avatar_url" mode=""></image>
|
|
|
</view>
|
|
|
- <view class="top__container__coins">
|
|
|
- {{UserData().getData().coin}}
|
|
|
+ <view class="top__container__info">
|
|
|
+ <view class="top__container__info__name">
|
|
|
+ {{user_data.user_name}}
|
|
|
+ </view>
|
|
|
+ <view class="top__container__info__date" v-if="user_data.is_vip">
|
|
|
+ 有效期至:{{util.timeFormat(user_data.vip_effective_time_time)}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -39,7 +42,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="bottom">
|
|
|
- <view class="bottom__button-ljgm">
|
|
|
+ <view class="bottom__button-ljgm" @click="clickLjgm">
|
|
|
<image class="image" src="../../static/imgs/public/img_ljgm.png" mode=""></image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -52,7 +55,10 @@
|
|
|
import { http } from '../../framework/http';
|
|
|
import { log } from '../../framework/log';
|
|
|
import { UserData } from '../../stores/userDataManager';
|
|
|
+ import { util } from '../../framework/util';
|
|
|
+import { tools } from '../../framework/tools';
|
|
|
|
|
|
+ let user_data = UserData().getData()
|
|
|
let data_list = ref([])
|
|
|
let current_index = ref(-1)
|
|
|
|
|
@@ -71,8 +77,6 @@
|
|
|
console.log('vip-',data)
|
|
|
if(data.code==config.url_confg.StatesCode.SUCCESS){
|
|
|
data_list.value = data.content
|
|
|
- } else {
|
|
|
-
|
|
|
}
|
|
|
} else {
|
|
|
log.Error(err)
|
|
@@ -84,6 +88,31 @@
|
|
|
current_index.value = index
|
|
|
}
|
|
|
|
|
|
+ function clickLjgm() {
|
|
|
+ if(current_index.value<0) {
|
|
|
+ util.showInfoToast('请选择购买会员金额')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let data = data_list.value[current_index.value]
|
|
|
+ util.showLoading('',true)
|
|
|
+ tools.requestRechargeOrderBuy(3,data.goods_id,(order_id:string)=>{
|
|
|
+ if(order_id.length>0) {
|
|
|
+ setTimeout(function() {
|
|
|
+ tools.requestRechargeOrderInfo(order_id,(status:number)=>{
|
|
|
+ util.hideLoading()
|
|
|
+ if(status==2) {
|
|
|
+ UserData().update_user_info(()=>{
|
|
|
+ util.showSuccessToast('VIP成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 2000);
|
|
|
+ } else {
|
|
|
+ util.hideLoading()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -108,35 +137,53 @@
|
|
|
&__container{
|
|
|
position: absolute;
|
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
+ flex-direction: row;
|
|
|
width: 90%;
|
|
|
// background-color: green;
|
|
|
- &__title{
|
|
|
- margin-top: 40rpx;
|
|
|
+
|
|
|
+ &__kaitong {
|
|
|
+ position: absolute;
|
|
|
+ top: 6rpx;
|
|
|
+ right: 0;
|
|
|
+ width: 128rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ border-top-right-radius: 30rpx;
|
|
|
+ border-bottom-left-radius: 30rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ background-color: #9A71F1;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ &__avatar{
|
|
|
+ margin-top: 70rpx;
|
|
|
margin-left: 60rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 110rpx;
|
|
|
+ height: 110rpx;
|
|
|
+ .image{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &__info {
|
|
|
+ margin-top: 60rpx;
|
|
|
+ margin-left: 30rpx;
|
|
|
display: flex;
|
|
|
- flex-direction: row;
|
|
|
-
|
|
|
+ flex-direction: column;
|
|
|
+ // height: 150rpx;
|
|
|
+ // background-color: red;
|
|
|
&__name{
|
|
|
- font-size: 20px;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ font-size: 25px;
|
|
|
+ font-weight: 450;
|
|
|
}
|
|
|
- &__icon{
|
|
|
- margin-left: 10rpx;
|
|
|
- flex-shrink: 0;
|
|
|
- width: 52rpx;
|
|
|
- height: 52rpx;
|
|
|
- .image{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
+ &__date{
|
|
|
+ margin-top: 10rpx;
|
|
|
+ font-size: 17px;
|
|
|
}
|
|
|
}
|
|
|
- &__coins{
|
|
|
- margin-top: 20rpx;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- font-size: 29px;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|