diff --git a/pages/me/index.vue b/pages/me/index.vue
index 952d302..dc638fb 100644
--- a/pages/me/index.vue
+++ b/pages/me/index.vue
@@ -9,14 +9,12 @@
-
+
{{ userInfo.phone || '请登录' }}
@@ -31,7 +29,7 @@
我的追剧
{{ likeData.collectCount }}
-
+
我的红包
{{ amount || 0 }}
@@ -43,16 +41,18 @@
{{ gold }}
-
+
金币明细
-
+
+
-
+
观看历史
-
+
+
import { ref, reactive } from 'vue';
-import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
+import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js';
-import { useCommonStore } from '@/store/common.js';
-const $common = useCommonStore();
+import {
+ useCommonStore
+ } from '@/store/common.js'
+ const $common = useCommonStore()
const userInfo = ref({});
// 获取最近的三条观看历史
const recordThree = ref([]);
-onShow(() => {
+onShow(()=>{
// 判断ios是否审核
- $common.init();
-});
+ $common.init()
+})
async function selectByUserIdAjax() {
try {
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
@@ -177,11 +179,14 @@ onPullDownRefresh(async () => {
}, 500);
});
-onShow(() => {
- selectByUserIdAjax();
- collectVideoSummaryAjax();
- selectUserMoneyAjax();
- userInfo.value = uni.getStorageSync('userInfo');
+onLoad(() => {
+ if(uni.getStorageSync('token')){
+ selectByUserIdAjax();
+ collectVideoSummaryAjax();
+ selectUserMoneyAjax();
+ userInfo.value = uni.getStorageSync('userInfo');
+ }
+
});
diff --git a/pages/me/setting.vue b/pages/me/setting.vue
index 123fa2c..de153b8 100644
--- a/pages/me/setting.vue
+++ b/pages/me/setting.vue
@@ -1,7 +1,7 @@
-
+
修改手机号
@@ -9,7 +9,7 @@
帮助中心
-
+
意见反馈
@@ -21,7 +21,7 @@
隐私协议
-
+
退出登录
@@ -36,6 +36,7 @@ import { linkTo } from '@/utils/app.js';
import { onLoad } from '@dcloudio/uni-app';
const version = ref('');
+const token = ref('');
// 退出登录
function logout() {
@@ -54,6 +55,7 @@ function logout() {
}
onLoad(() => {
+ token.value = uni.getStorageSync('token');
const systemInfo = uni.getSystemInfoSync();
//#ifdef APP-PLUS
version.value = systemInfo.appWgtVersion;