diff --git a/api/index/index.js b/api/index/index.js index 519b041..4891f2a 100644 --- a/api/index/index.js +++ b/api/index/index.js @@ -56,6 +56,7 @@ export const discSpinningdraw = (data) => { }) } + export const selectUserMoney = (data) => { return http.request({ url: '/moneyDetails/selectUserMoney', diff --git a/api/task/index.js b/api/task/index.js index 562bab5..2bb9820 100644 --- a/api/task/index.js +++ b/api/task/index.js @@ -7,6 +7,14 @@ export const selectTaskCenter = (data) => { data }) } +// 兑换列表 +export const selectTaskCenterUserReward = (data) => { + return http.request({ + url: '/taskCenterReward/selectTaskCenterUserReward', + data, + isreturm:true + }) +} // 获取签到 export const getUserSignData = (data) => { return http.request({ @@ -14,6 +22,12 @@ export const getUserSignData = (data) => { data }) } +export const receiveGoods = (data) => { + return http.request({ + url: 'taskCenter/receiveGoods', + data + }) +} // 任务-签到 export const taskReceive = (data) => { return http.request({ diff --git a/http/http.js b/http/http.js index 7278af6..61be1ca 100644 --- a/http/http.js +++ b/http/http.js @@ -58,7 +58,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) { // 避免混淆重新命名 let bodyData = data; if (isreturm) { - return Promise.resolve(bodyData.data || bodyData.page || bodyData); + return Promise.resolve(bodyData); } if (statusCode == 500) { isShowErrorToast = true; 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 @@ \ No newline at end of file diff --git a/static/task/receive1.png b/static/task/receive1.png new file mode 100644 index 0000000..888d1f4 Binary files /dev/null and b/static/task/receive1.png differ diff --git a/static/task/receive2.png b/static/task/receive2.png new file mode 100644 index 0000000..e152e87 Binary files /dev/null and b/static/task/receive2.png differ