Commit 2bcc4c1b authored by jyx's avatar jyx

代码优化

parent 5a8927e4
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
@close='closeBeanPop'></bean-pop> --> @close='closeBeanPop'></bean-pop> -->
<recommend-pop :show='showRecommend' @close='closeRecommendPop' :bookId="bookId"></recommend-pop> <recommend-pop :show='showRecommend' @close='closeRecommendPop' :bookId="bookId"></recommend-pop>
<coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="closeVipPop" <coin-popup v-if="bookData.isUnlock==0 && !isVip()" :show="showVip" @close="closeVipPop"
:vedioId="bookData.id" @paySuccess="paySuccess"> :vedioId="bookData.id">
</coin-popup> </coin-popup>
</template> </template>
</view> </view>
...@@ -110,6 +110,10 @@ ...@@ -110,6 +110,10 @@
addReadRecord(this.bookId) addReadRecord(this.bookId)
} }
if (this.isVip() && this.bookData) {
this.paySuccess()
}
// // 用户变动,需要刷新数据 // // 用户变动,需要刷新数据
// this.$nextTick(() => { // this.$nextTick(() => {
// uni.startPullDownRefresh({}) // uni.startPullDownRefresh({})
...@@ -239,10 +243,8 @@ ...@@ -239,10 +243,8 @@
} }
}, },
isVip() { isVip() {
if (this.userInfo != null && this.userInfo.memberFlag) { if (this.userInfo != null && this.userInfo.memberExpirationDate > 0) {
let cDate = new Date(); return true;
cDate = cDate.getTime();
return this.userInfo.memberExpirationDate >= cDate;
} }
return false; return false;
}, },
......
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