Commit 5b8deb53 authored by jyx's avatar jyx

开通vip更新我的页面状态

parent 26c71fb4
<template> <template>
<view v-if="localActiviteFlag==1" class="body"> <view v-if="localActiviteFlag==1" class="body">
<view style="height: 92%;"> <view style="height: 92%;">
<bookshelf v-show="currentPage==0" ref="index" /> <bookshelf v-show="currentPage==0" ref="index" />
<warehouse v-show="currentPage==1" ref="recommend" /> <warehouse v-show="currentPage==1" ref="recommend" />
...@@ -35,22 +35,22 @@ ...@@ -35,22 +35,22 @@
我的 我的
</view> </view>
</view> </view>
</view> </view>
<view v-else class="body"> <view v-else class="body">
<view <view
:style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'"> :style="'display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;margin-top:'+10+'px;'">
<image class="avatar" src="@/static/logo-about.png"></image> <image class="avatar" src="@/static/logo-about.png"></image>
<view> <view>
<view style="font-size: 34rpx;color: black;margin-left: 30rpx;">用户ID:{{localIdcode}}</view> <view style="font-size: 34rpx;color: black;margin-left: 30rpx;">用户ID:{{localIdcode}}</view>
<view style="font-size: 26rpx;color: #b5b5b5;margin-left: 30rpx;margin-top: 10rpx;"> <view style="font-size: 26rpx;color: #b5b5b5;margin-left: 30rpx;margin-top: 10rpx;">
书中自有颜如玉,书中自有黄金屋,书中自有千钟黍</view> 书中自有颜如玉,书中自有黄金屋,书中自有千钟黍</view>
</view> </view>
</view> </view>
<view style="height: 92%;"> <view style="height: 92%;">
<warehouse v-show="currentPage==1" ref="recommend" /> <warehouse v-show="currentPage==1" ref="recommend" />
</view> </view>
</view> </view>
</template> </template>
...@@ -77,13 +77,13 @@ ...@@ -77,13 +77,13 @@
data() { data() {
return { return {
currentPage: 1, currentPage: 1,
localActiviteFlag: 0, localActiviteFlag: 0,
localIdcode: 0, localIdcode: 0,
} }
}, },
onLoad(options) { onLoad(options) {
let index = options.index ?? '' let index = options.index ?? ''
this.localActiviteFlag = options.activiteFlag; this.localActiviteFlag = options.activiteFlag;
this.localIdcode = options.idcode; this.localIdcode = options.idcode;
if (index != '' && index != undefined) { if (index != '' && index != undefined) {
this.currentPage = index this.currentPage = index
...@@ -106,14 +106,23 @@ ...@@ -106,14 +106,23 @@
mounted() { mounted() {
// 渲染完成 初始化首页数据 // 渲染完成 初始化首页数据
this.loadComponentData(); this.loadComponentData();
let that = this
if (this.localActiviteFlag == 1) { if (this.localActiviteFlag == 1) {
let that = this
uni.$on('goWareHouse', function(data) { uni.$on('goWareHouse', function(data) {
that.tabChange(1) that.tabChange(1)
}) })
} }
uni.$on('refreshPreviousPage', (data) => {
if (data.vipFlag == '1') {
// 开通vip刷新状态
if (that.currentPage == 2) {
that.$refs.user.show();
}
}
});
}, },
methods: { methods: {
tabChange(index) { tabChange(index) {
...@@ -144,14 +153,14 @@ ...@@ -144,14 +153,14 @@
.body { .body {
height: 100%; height: 100%;
background-color: whitesmoke; background-color: whitesmoke;
} }
.avatar { .avatar {
background-color: #d8d8d8; background-color: #d8d8d8;
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
//box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) //box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
} }
</style> </style>
\ No newline at end of file
...@@ -209,7 +209,12 @@ ...@@ -209,7 +209,12 @@
message.notify('支付成功') message.notify('支付成功')
setTimeout(() => { setTimeout(() => {
navigateBack(); uni.$emit('refreshPreviousPage', {
vipFlag: '1'
});
uni.navigateBack({
delta: 1,
});
}, 1000); }, 1000);
}, },
fail(res) { fail(res) {
......
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