diff --git a/README.md b/README.md index 5cece19..95e7e98 100644 --- a/README.md +++ b/README.md @@ -26,5 +26,28 @@ let pageContainer = ref(null); + +``` + +# 新文件2 +```vue + + + + ``` \ No newline at end of file diff --git a/common/server/user.js b/common/server/user.js index 5af898d..08e153c 100644 --- a/common/server/user.js +++ b/common/server/user.js @@ -57,9 +57,9 @@ export const mobileLogin = async (phone, code, pid = 0) => { * @returns {Promise} 是否成功 */ export const updateUserInfo = async (nickname, avatar, imagebase, gender = 3) => { - const res = await HttpRequest.post('/update_userinfo', { - nickname, - headimg: avatar, + const res = await HttpRequest.post('/update_userinfo', { + nickname, + headimg: avatar, imagebase, gender }); @@ -67,3 +67,20 @@ export const updateUserInfo = async (nickname, avatar, imagebase, gender = 3) => } +/** + * 获取用户优惠卷 + * @param {Number} status 状态(0-未使用 1-已使用 2-已过期) + * @param {Number} page 页码 + * @param {Number} pageSize 每页条数 + * @returns {Promise} 优惠卷列表 + */ +export const getUserCoupon = async (status, page, pageSize=10) => { + const res = await HttpRequest.get('/get_coupon_list', { + type: 1, + status: status, + page, + limit: pageSize, + }); + return res; +} + diff --git a/common/system/userInfo.js b/common/system/userInfo.js index 12a9acd..bb8cfa9 100644 --- a/common/system/userInfo.js +++ b/common/system/userInfo.js @@ -30,6 +30,13 @@ export const getAccountInfo = async () => { }); } +/** + * 清除用户信息 + */ +export const clearAccountInfo = async () => { + removeLocalStorage('user'); +} + /** * 判断用户是否登录,如果用户未登录,会跳转到登录页面 * @returns {Boolean} 是否登录 diff --git a/components/youdas-container/page-container.vue b/components/youdas-container/page-container.vue index ca26544..f6f2e7a 100644 --- a/components/youdas-container/page-container.vue +++ b/components/youdas-container/page-container.vue @@ -10,6 +10,9 @@ + + + @@ -38,6 +41,10 @@ const props = defineProps({ default: function (refresh) { refresh.complete(); } + }, + showLoading: { + type: Boolean, + default: false } }); let paging = ref(null); @@ -60,6 +67,9 @@ const onRefresh = () => { } const getPaging = () => { return paging.value; +} +const mengban = () => { + } defineExpose({ getPaging @@ -101,5 +111,17 @@ defineExpose({ justify-content: center; align-items: center; } + + &__loading { + width: 100%; + height: 100%; + position: fixed; + top: 0px; + left: 0; + z-index: 1000; + justify-content: center; + align-items: center; + // background-color: rgba(0, 0, 0, 0.5); + } } \ No newline at end of file diff --git a/pages.json b/pages.json index 763c570..d60e721 100644 --- a/pages.json +++ b/pages.json @@ -63,6 +63,12 @@ "style": { "navigationStyle": "custom" } + }, + { + "path": "pages/other/coupon", + "style": { + "navigationStyle": "custom" + } } ], // "globalStyle": { diff --git a/pages/me/account-info.vue b/pages/me/account-info.vue index eadd191..85180b9 100644 --- a/pages/me/account-info.vue +++ b/pages/me/account-info.vue @@ -1,57 +1,57 @@ + + \ No newline at end of file diff --git a/static/coupon.vue b/static/coupon.vue new file mode 100644 index 0000000..bbbafc8 --- /dev/null +++ b/static/coupon.vue @@ -0,0 +1,371 @@ + + + + + + \ No newline at end of file