Commit d7d657f0 authored by jyx's avatar jyx

代码优化

parent 74bec2b7
...@@ -240,6 +240,22 @@ function logout(callback, exprireOut = false) { ...@@ -240,6 +240,22 @@ function logout(callback, exprireOut = false) {
// } // }
} }
const KEY_STORAGE_ACTIVITY = "ACTIVITY"
let LOCAL_ACTIVITY;
function saveActivity(activity) {
LOCAL_ACTIVITY = activity;
saveStorage(KEY_STORAGE_ACTIVITY, activity);
}
function readaActivity() {
if (!LOCAL_ACTIVITY) {
LOCAL_ACTIVITY = readStorage(KEY_STORAGE_ACTIVITY)
}
return LOCAL_ACTIVITY;
}
const KEY_STORAGE_TOKEN = "TOKEN" const KEY_STORAGE_TOKEN = "TOKEN"
let LOCAL_TOKEN; let LOCAL_TOKEN;
...@@ -339,4 +355,6 @@ module.exports = { ...@@ -339,4 +355,6 @@ module.exports = {
removeUserInfoChangeWatch, removeUserInfoChangeWatch,
saveToken, saveToken,
readToken, readToken,
saveActivity,
readaActivity
} }
\ No newline at end of file
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
watchUserInfoChange, watchUserInfoChange,
removeUserInfoChangeWatch, removeUserInfoChangeWatch,
refreshUserInfo, refreshUserInfo,
postPhone postPhone,
readaActivity
} from "../../../common/services/userServices.js" } from "../../../common/services/userServices.js"
import { import {
noticeCollectionListChange, noticeCollectionListChange,
...@@ -250,6 +251,10 @@ ...@@ -250,6 +251,10 @@
// setTimeout(() => { // setTimeout(() => {
// uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
if (success) { if (success) {
if (readaActivity() != 1) {
data.isUnlock = 1
}
this.bookData = new BookDetail(data); this.bookData = new BookDetail(data);
// console.log('bookData=' + JSON.stringify(this.bookData)); // console.log('bookData=' + JSON.stringify(this.bookData));
} }
......
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
<script> <script>
import { import {
saveToken saveToken,
saveActivity
} from '../common/services/userServices.js' } from '../common/services/userServices.js'
import { import {
...@@ -69,23 +70,22 @@ ...@@ -69,23 +70,22 @@
}, },
onShow(options) { onShow(options) {
this.ttLoging() this.ttLoging()
this.isVipStatus()
}, },
methods: { methods: {
isVipStatus() { isVipStatus() {
if (this.sourceType == 'android' && this.localToken) {
let that = this;
this.post({ this.post({
url: '/user/baseMsg', url: '/vip/getVipProducts/cyc/forVApp',
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
if (data.expireTime > 0) { that.isVip = data.vip
this.isVip = true
} else {
this.isVip = false
}
} }
}); });
}
}, },
ttLoging() { ttLoging() {
var that = this; var that = this;
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
}) => { }) => {
app.globalData.userId = data.idcode; app.globalData.userId = data.idcode;
saveToken(data.token) saveToken(data.token)
saveActivity(data.activiteFlag)
// saveToken( // saveToken(
// 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997' // 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997'
// ) // )
......
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