diff --git a/src/api/system/index.js b/src/api/system/index.js
index f660691..878cbe6 100644
--- a/src/api/system/index.js
+++ b/src/api/system/index.js
@@ -50,6 +50,192 @@ const system = {
data: data,
});
},
+ getTaskType: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/task/getTaskType",
+ data: data,
+ });
+ },
+ getPlatform: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/task/getPlatform",
+ data: data,
+ });
+ },
+ getAccountStatus: async (data) => {
+ return Promise.resolve({
+ data: [
+ {
+ id: 0,
+ name: '审核中',
+ hidden: true,
+ },
+ {
+ id: 1,
+ name: '正常',
+ },
+ {
+ id: 2,
+ name: '异常',
+ },
+ {
+ id: 3,
+ name: '隐藏',
+ },
+ {
+ id: -1,
+ name: '未通过',
+ hidden: true,
+ },
+ {
+ id: -2,
+ name: '禁用',
+ hidden: true,
+ },
+ ]
+ });
+ },
+ getTask: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/task/getTask",
+ data: data,
+ });
+ },
+ getTaskinfo: async (id) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/task/getTaskinfo",
+ data: {id},
+ });
+ },
+ getArticleCategory: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/article/getArticleCategory",
+ data: data,
+ });
+ },
+ getArticle: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/article/getArticle",
+ data: data,
+ });
+ },
+ getTopArticle: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/article/getTopArticle",
+ data: data,
+ });
+ },
+ getSingle: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/article/getSingle",
+ data: data,
+ });
+ },
+ getAdvList: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/index/getAdvList",
+ data: data,
+ });
+ },
+ getQrcode: async (position) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/index/getQrcode",
+ data: {position},
+ });
+ },
+ getMessageCenter: async (data) => {
+ if (data.type === 1) {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/notice/getNotice",
+ data: data,
+ });
+ } else {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/notice/getNotice",
+ data: data,
+ });
+ }
+ },
+ getInfo: async () => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/getInfo",
+ });
+ },
+ saveInfo: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/saveInfo",
+ data: data,
+ });
+ },
+ saveMobile: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/saveMobile",
+ data: data,
+ });
+ },
+ savePassword: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/savePassword",
+ data: data,
+ });
+ },
+ myTeamInfo: async () => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/myTeamInfo",
+ });
+ },
+ addAccount: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/addAccount",
+ data: data
+ });
+ },
+ myAccount: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/myAccount",
+ data: data
+ });
+ },
+ getAccountInfo: async (id) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/getAccountInfo",
+ data: {id}
+ });
+ },
+ editAccount: async (data) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/editAccount",
+ data: data
+ });
+ },
+ delAccount: async (id) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/user/delAccount",
+ data: {id}
+ });
+ },
}
export default system;
diff --git a/src/components/AddCustomerServiceModal.vue b/src/components/AddCustomerServiceModal.vue
index a792559..88c0000 100644
--- a/src/components/AddCustomerServiceModal.vue
+++ b/src/components/AddCustomerServiceModal.vue
@@ -1,12 +1,16 @@
@@ -14,11 +18,12 @@ onMounted(() => {
-
+
微信扫码添加
-
+
请发送 [我的] 页面截图给客服
再描述您的问题
diff --git a/src/components/CreditScore.vue b/src/components/CreditScore.vue
index 06a0851..d8024a3 100644
--- a/src/components/CreditScore.vue
+++ b/src/components/CreditScore.vue
@@ -3,6 +3,9 @@ import ICON1 from '../static/icons/path1.png';
import ICON2 from '../static/icons/path2.png';
import ICON3 from '../static/icons/path3.png';
import ICON4 from '../static/icons/path4.png';
+import {useUserStore} from "../pinia/UserStore/index.js";
+
+const UserStore = useUserStore();
@@ -14,7 +17,7 @@ import ICON4 from '../static/icons/path4.png';
- 90
+ {{ UserStore?.userInfo?.score }}
信用分
diff --git a/src/components/MessageCard.vue b/src/components/MessageCard.vue
index a6e02a5..83729c7 100644
--- a/src/components/MessageCard.vue
+++ b/src/components/MessageCard.vue
@@ -2,6 +2,7 @@
import {computed} from 'vue';
import messageIcon from "../static/icons/messageIcon.png";
import XActionsheet from "./XActionsheet.vue";
+import OpenTypeFun from "./OpenTypeFun.js";
const itemList = computed(() => {
const item = [];
@@ -10,10 +11,18 @@ const itemList = computed(() => {
item.push({text: '标记已读', type: 1});
return item;
})
-const {contextRow} = defineProps({
+const {contextRow, type, data} = defineProps({
contextRow: {
type: String,
default: 'ellipsis-1'
+ },
+ type: {
+ type: Number,
+ default: 0
+ },
+ data: {
+ type: Object,
+ default: null
}
});
@@ -27,19 +36,20 @@ const selectActionsheet = (e) => {
@success="selectActionsheet"
:itemList="itemList">
- 任务编号: DF12122
+ {{ type === 0 ? '任务编号: DF12122' : data.title }}
2024-01-26 14:00
- 商家:您的回填数据1由于***未通过,请按照文档文档文档文档文档文档文档文档文档文档文档文档文档文档文档文档文档文档中操作
+ {{ data.content }}
- 置顶
+ 置顶
diff --git a/src/components/OpenTypeFun.js b/src/components/OpenTypeFun.js
new file mode 100644
index 0000000..bf1c666
--- /dev/null
+++ b/src/components/OpenTypeFun.js
@@ -0,0 +1,32 @@
+import {toPage} from "../utils/uils.js";
+
+const OpenTypeFun = async (options) => {
+ console.log('OpenTypeFun打开', options);
+ const {type, url, single_id} = options;
+ switch (type) {
+ case 0: { // 空
+ break;
+ }
+ case 1: { // 站内url
+ await toPage(url);
+ break;
+ }
+ case 2: { // 站内富文本
+ await toPage(`/pages/richPage/index?id=${single_id}`);
+ break;
+ }
+ case 3: { // 微信连接
+ break;
+ }
+ case 4: { // 外部连接
+ window.open(url);
+ break;
+ }
+ case 5: { // 弹窗
+ console.log('弹窗');
+ break;
+ }
+ }
+}
+
+export default OpenTypeFun;
diff --git a/src/components/TaskItem.vue b/src/components/TaskItem.vue
index bb71301..1bf72f7 100644
--- a/src/components/TaskItem.vue
+++ b/src/components/TaskItem.vue
@@ -1,30 +1,39 @@
-
+
- 美白祛斑洗面奶
+ {{ data.goods_name }}
- 抖音
- 三连发
+ {{ data.platform }}
+ {{ numberToCharacter(data.fb_num - 1) }}连发
¥
- 8.56
+ {{ data.real_price.toFixed(2) }}
- 剩余3个名额
+ 剩余{{ data.children_num }}个名额
- 截止时间:08月23日 14:00
+ 截止时间:{{ dayjs(data.end_time).format('MM月DD日 HH:mm') }}
diff --git a/src/components/XConfirmModal.vue b/src/components/XConfirmModal.vue
index 9c4d907..1489175 100644
--- a/src/components/XConfirmModal.vue
+++ b/src/components/XConfirmModal.vue
@@ -37,7 +37,8 @@ const success = () => {
{{ title }}
- {{ info }}
+ {{ info }}
+
diff --git a/src/components/XDropdownItem.vue b/src/components/XDropdownItem.vue
index 65f0513..b44a227 100644
--- a/src/components/XDropdownItem.vue
+++ b/src/components/XDropdownItem.vue
@@ -1,9 +1,14 @@
-
+
@@ -16,5 +21,11 @@
line-height: 140%;
letter-spacing: 0;
text-align: left;
+ background-color: #fff;
+ transition: 500ms;
+}
+
+.active {
+ background-color: rgba(106, 161, 255, 0.2);
}
diff --git a/src/components/XDropdownList.vue b/src/components/XDropdownList.vue
index ae27606..7a77a03 100644
--- a/src/components/XDropdownList.vue
+++ b/src/components/XDropdownList.vue
@@ -1,13 +1,29 @@
-
+
-
+
+ {{ option.find(v => v.id === modelValue)?.name }}
+
-
-
+
+
+ {{ v.name }}
+
diff --git a/src/components/XForm.vue b/src/components/XForm.vue
index 47ab83d..fa0d49a 100644
--- a/src/components/XForm.vue
+++ b/src/components/XForm.vue
@@ -14,6 +14,7 @@ const {model, rules} = defineProps({
const verify = () => {
Object.entries(model).forEach(([key, value]) => {
+ console.log(rules[key], key)
if (!rules[key].reg.test(value)) {
showToast({
icon: 'error',
diff --git a/src/components/XFormItem.vue b/src/components/XFormItem.vue
index 46d17f9..57d6384 100644
--- a/src/components/XFormItem.vue
+++ b/src/components/XFormItem.vue
@@ -9,7 +9,7 @@ const {label} = defineProps({
- {{ label }}
+ {{ label }}
diff --git a/src/components/XInput.vue b/src/components/XInput.vue
index 522fb53..fdfa15b 100644
--- a/src/components/XInput.vue
+++ b/src/components/XInput.vue
@@ -16,7 +16,7 @@ const modelValue = defineModel();
-
+
diff --git a/src/components/XPrompt.vue b/src/components/XPrompt.vue
new file mode 100644
index 0000000..5316c63
--- /dev/null
+++ b/src/components/XPrompt.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/XSelect.vue b/src/components/XSelect.vue
new file mode 100644
index 0000000..01290ac
--- /dev/null
+++ b/src/components/XSelect.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+ {{ placeholder }}
+
+
+ {{ list.find(v => v.id === modelValue)?.name }}
+
+
+
+
+
+
+
+
diff --git a/src/components/XUpload.vue b/src/components/XUpload.vue
new file mode 100644
index 0000000..67a5e40
--- /dev/null
+++ b/src/components/XUpload.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ 上传图片
+
+
+
+
+
+
+
+
diff --git a/src/hooks/useTableQuery.js b/src/hooks/useTableQuery.js
index a671112..7f41732 100644
--- a/src/hooks/useTableQuery.js
+++ b/src/hooks/useTableQuery.js
@@ -16,9 +16,14 @@ function useTableQuery({
watchParameter = false,
}) {
const loading = ref(false);
+ const vo = reactive({
+ rows: [],
+ page: 0,
+ total: 0,
+ });
const pagination = reactive({
- current: 1,
+ page: 1,
pageSize: 20,
total: 0
});
@@ -29,7 +34,7 @@ function useTableQuery({
const params = {
...parameter,
- current: pagination.current,
+ page: pagination.page,
pageSize: pagination.pageSize
}
@@ -38,34 +43,39 @@ function useTableQuery({
pagination.pageSize = data.page;
pagination.total = data.total;
- callback && callback({
+ const _vo = {
...data,
- rows: data.rows.map(v => ({...v, key: v.id})),
- current: pagination.current
- });
+ rows: data.list.map(v => ({...v, key: v.id})),
+ };
+
+ vo.page = _vo.page;
+ vo.total = _vo.total;
+ vo.rows = [...vo.rows, ..._vo.rows];
+
+ callback && callback(vo);
} finally {
loading.value = false;
}
}
const initFetchData = async () => {
- if (pagination.current === 1) {
- fetchData().then();
- } else {
- pagination.current = 1;
- pagination.total = 0;
- }
+ pagination.page = 1;
+ pagination.total = 0;
+ vo.page = 0;
+ vo.total = 0;
+ vo.rows.length = 0;
+ await fetchData();
}
watch(
- () => [pagination.current, pagination.pageSize],
+ () => [pagination.page, pagination.pageSize],
() => fetchData(),
{deep: true, immediate: immediate}
)
if (watchParameter) watch(
() => parameter,
- () => initFetchData(),
+ () => fetchData(),
{deep: true}
);
diff --git a/src/pages.json b/src/pages.json
index 2a8dbf5..411a3b6 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -156,6 +156,20 @@
"navigationBarTitleText": "收益记录",
"navigationStyle": "custom"
}
+ },
+ {
+ "path": "pages/accountManagement/index",
+ "style": {
+ "navigationBarTitleText": "帐号管理",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/addAccount/index",
+ "style": {
+ "navigationBarTitleText": "新增帐号",
+ "navigationStyle": "custom"
+ }
}
// #endif
],
diff --git a/src/pages/accountManagement/index.vue b/src/pages/accountManagement/index.vue
index 4eed695..73b395e 100644
--- a/src/pages/accountManagement/index.vue
+++ b/src/pages/accountManagement/index.vue
@@ -1,11 +1,172 @@
+
+
+
+
+
+
+
+
+ {{
+ item.name
+ }}
+
+
+
+
+
+
+
+
+
+ 新增帐号
+
+
+
+
+
+ {{ v.nickname }}
+ {{ v.account }}
+
+
+ {{ v.status_text }}
+
+
+ {{ v.status_text }}
+
+
+ {{ v.status_text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/src/pages/addAccount/index.vue b/src/pages/addAccount/index.vue
index 3af4618..055cef6 100644
--- a/src/pages/addAccount/index.vue
+++ b/src/pages/addAccount/index.vue
@@ -1,11 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认提交
+
+
-
diff --git a/src/pages/beginnerTutorial/index.vue b/src/pages/beginnerTutorial/index.vue
index 847467b..a1b1af9 100644
--- a/src/pages/beginnerTutorial/index.vue
+++ b/src/pages/beginnerTutorial/index.vue
@@ -1,45 +1,71 @@
@@ -48,42 +74,42 @@ const dataList = reactive([
-
-
+
+
-
+
常见问题
-
+
基础教学
-
+
+ @click="changeMinCategory(item.value)"
+ :class="['rounded-full bg-[#F2F3F5] text-center !py-[8rpx] !text-[13px] duration-500', po.category_id===item.value ? 'current' : '']">
{{ item.name }}
-
-
+
+
collapseCur=index">
- {{ item.name }}
+ {{ item.title }}
- {{ item.intro }}
+ {{ item.content }}
@@ -94,28 +120,30 @@ const dataList = reactive([
+ @click="changeMinCategory(item.value)"
+ :class="['rounded-full bg-[#F2F3F5] text-center !py-[8rpx] !text-[13px] duration-500', po.category_id===item.value ? 'current' : '']">
{{ item.name }}
-
-
-
-
-
+
+
+
+
+
-
- 掘金壁纸详细挂载教程,新手必看
-
- 掘金壁纸详细挂载教程,新手必看掘金壁纸详细挂载教程,新手必看
-
+
+ {{ item.title }}
+
+ {{ item.content }}
-
+
diff --git a/src/pages/home/index.vue b/src/pages/home/index.vue
index 76d9b93..b540499 100644
--- a/src/pages/home/index.vue
+++ b/src/pages/home/index.vue
@@ -6,15 +6,16 @@ import nav3 from '../../static/icons/icon-邀请好友.png';
import nav4 from '../../static/icons/icon-添加客服.png';
import nav5 from '../../static/icons/icon-重要消息.png';
import XDropdownList from "../../components/XDropdownList.vue";
-import XDropdownItem from "../../components/XDropdownItem.vue";
import TaskItem from "../../components/TaskItem.vue";
import useTableQuery from "../../hooks/useTableQuery.js";
import Api from "../../api/index.js";
-import {reactive, ref} from "vue";
+import {reactive, ref, onMounted} from "vue";
import {toPage} from "../../utils/uils.js";
import AddCustomerServiceModal from "../../components/AddCustomerServiceModal.vue";
+import OpenTypeFun from "../../components/OpenTypeFun.js";
const showAddCustomer = ref(false);
+const advList = reactive([]);
const nav = [
{
title: '新手教学',
@@ -46,7 +47,30 @@ const nav = [
},
];
+const taskType = reactive([]);
+const platformType = reactive([]);
+const sortType = reactive([
+ {id: 0, name: '默认排序'},
+ {id: 1, name: '价格最高'},
+ {id: 2, name: '极速打款'},
+ {id: 3, name: '素材安全'},
+ {id: 4, name: '简单上手'},
+ {id: 5, name: '最新发布'},
+]);
+
+Api.system.getTaskType().then(({data}) => {
+ taskType.length = 0;
+ taskType.push(...data);
+});
+Api.system.getPlatform().then(({data}) => {
+ platformType.length = 0;
+ platformType.push(...data);
+});
+
const po = reactive({
+ type: 0,
+ pid: 0,
+ order: 0,
});
const vo = reactive({
page: '',
@@ -55,14 +79,21 @@ const vo = reactive({
});
const {loading, pagination, initFetchData} = useTableQuery({
- api: Api.system.getData,
+ api: Api.system.getTask,
parameter: po,
callback: (data) => {
- vo.page = data.page;
- vo.total = data.total;
- vo.rows =[...vo.rows, ... data.rows];
+ Object.assign(vo, data);
}
});
+
+onMounted(() => {
+ Api.system.getAdvList({
+ position: 1,
+ }).then(({data}) => {
+ advList.length = 0;
+ advList.push(...data);
+ });
+})
@@ -73,7 +104,7 @@ const {loading, pagination, initFetchData} = useTableQuery({
@@ -83,8 +114,8 @@ const {loading, pagination, initFetchData} = useTableQuery({
-
-
+
+
@@ -109,49 +140,25 @@ const {loading, pagination, initFetchData} = useTableQuery({
-
-
- 全部任务
-
-
- 全部任务
- 宣发任务
- 评论任务
- 点赞任务
- 助力任务
- 其他任务
-
+
-
-
- 全部平台
-
-
- 全部平台
- 抖音
- 快手
- 小红书
- 今日头条
- 其他
-
+
-
-
- 默认排序
-
-
- 默认排序
- 价格最高
- 极速打款
- 素材安全
- 简单上手
- 最新发布
-
+
-
+
diff --git a/src/pages/login/AccountLogin.vue b/src/pages/login/AccountLogin.vue
index 7d09682..ea1780b 100644
--- a/src/pages/login/AccountLogin.vue
+++ b/src/pages/login/AccountLogin.vue
@@ -9,8 +9,8 @@ import {useUserStore} from "../../pinia/UserStore/index.js";
const UserStore = useUserStore();
const form = reactive({
- mobile: null,
- password: null,
+ mobile: '15709267061',
+ password: '123456',
});
const success = async () => {
diff --git a/src/pages/messageCenter/index.vue b/src/pages/messageCenter/index.vue
index d112253..4e78663 100644
--- a/src/pages/messageCenter/index.vue
+++ b/src/pages/messageCenter/index.vue
@@ -1,11 +1,12 @@
@@ -21,31 +45,43 @@ const tabs = [
- currentTab=index" height="90">
+
-
+
- 搜索
+ 搜索
-
- 只看未读
+
+ 只看未读
-
-
-
-
+ {
+ console.log('进来了???')
+ pagination.page++;
+ }"
+ class="h-[calc(100vh-500rpx)]"
+ scroll-y>
+
+
+
+
+
diff --git a/src/pages/userInfo/components/EditPassWord.vue b/src/pages/userInfo/components/EditPassWord.vue
index 1397dd2..33a0d84 100644
--- a/src/pages/userInfo/components/EditPassWord.vue
+++ b/src/pages/userInfo/components/EditPassWord.vue
@@ -1,22 +1,43 @@
@@ -26,10 +47,10 @@ const success = () => {
-
+
-
+
diff --git a/src/pages/userInfo/components/EditPhone.vue b/src/pages/userInfo/components/EditPhone.vue
index c20c2f2..4b4c11b 100644
--- a/src/pages/userInfo/components/EditPhone.vue
+++ b/src/pages/userInfo/components/EditPhone.vue
@@ -5,36 +5,44 @@ import XForm from "../../../components/XForm.vue";
import XFormItem from "../../../components/XFormItem.vue";
import XInput from "../../../components/XInput.vue";
import SendMsg from "../../../components/SendMsg.vue";
+import {useUserStore} from "../../../pinia/UserStore/index.js";
+import Api from "../../../api/index.js";
+import {showToast} from "../../../utils/uils.js";
const XFormRef = ref();
+const UserStore = useUserStore();
const show = defineModel('show');
const rules = {
- oldPhone: {
- reg: /^\[1][3-9]\d{9}$/,
+ old_mobile: {
+ reg: /^1[3-9]\d{9}$/,
msg: '请输入正确的手机号',
},
- oldVerificationCode: {
+ old_captcha: {
reg: /.+/,
+ msg: '请输入正确验证码',
+ },
+ new_mobile: {
+ reg: /^1[3-9]\d{9}$/,
msg: '请输入正确的手机号',
},
- newPhone: {
- reg: /^\[1][3-9]\d{9}$/,
- msg: '请输入正确的手机号',
- },
- newVerificationCode: {
+ new_captcha: {
reg: /.+/,
- msg: '请输入正确的手机号',
+ msg: '请输入正确验证码',
},
};
const form = reactive({
- oldPhone: null,
- oldVerificationCode: null,
- newPhone: null,
- newVerificationCode: null,
+ old_mobile: null,
+ old_captcha: null,
+ new_mobile: null,
+ new_captcha: null,
});
-const success = () => {
+const success = async () => {
XFormRef.value.verify();
+ const {msg} = await Api.system.saveMobile(form);
+ showToast(msg);
+ show.value = false;
+ await UserStore.getUserInfo();
}
@@ -44,16 +52,26 @@ const success = () => {
-
+
-
+
+
-
-
+
+
-
+
+
diff --git a/src/pages/userInfo/components/EditWxCode.vue b/src/pages/userInfo/components/EditWxCode.vue
index 6c22b60..f9c4add 100644
--- a/src/pages/userInfo/components/EditWxCode.vue
+++ b/src/pages/userInfo/components/EditWxCode.vue
@@ -1,25 +1,37 @@
@@ -28,7 +40,7 @@ const success = () => {
-
+
diff --git a/src/pages/userInfo/index.vue b/src/pages/userInfo/index.vue
index 05fabf8..e595ab8 100644
--- a/src/pages/userInfo/index.vue
+++ b/src/pages/userInfo/index.vue
@@ -3,23 +3,32 @@ import {defineAsyncComponent, ref} from "vue";
import Right from "../../static/icons/right.png";
import Avatar from "../../static/images/Avatar.png";
import XNav from "../../components/XNav.vue";
+import {useUserStore} from "../../pinia/UserStore/index.js";
+import {onShow} from "@dcloudio/uni-app";
// #ifdef APP-PLUS
+import EditNickName from './components/EditNickName.vue';
import EditWxCode from './components/EditWxCode.vue';
import EditPhone from './components/EditPhone.vue';
import EditPassWord from './components/EditPassWord.vue';
// #endif
// #ifndef APP-PLUS
+const EditNickName = defineAsyncComponent(() => import('./components/EditNickName.vue'));
const EditWxCode = defineAsyncComponent(() => import('./components/EditWxCode.vue'));
const EditPhone = defineAsyncComponent(() => import('./components/EditPhone.vue'));
const EditPassWord = defineAsyncComponent(() => import('./components/EditPassWord.vue'));
// #endif
+const UserStore = useUserStore();
const showTool = ref(false);
const tool = ref('EditWxCode');
const tools = [
+ {
+ key: 'EditNickName',
+ component: EditNickName,
+ },
{
key: 'EditWxCode',
component: EditWxCode,
@@ -38,6 +47,10 @@ const openTools = (key) => {
tool.value = key;
showTool.value = true;
}
+
+onShow(() => {
+ UserStore.getUserInfo();
+})
@@ -52,9 +65,9 @@ const openTools = (key) => {
-
+
昵称
- 酷酷猛吃
+ {{ UserStore?.userInfo?.nickname }}
@@ -63,21 +76,14 @@ const openTools = (key) => {
手机号
- 178****0214
+ {{ UserStore?.userInfo?.mobile }}
微信号
- za395739
-
-
-
-
-
- 昵称
- 酷酷猛吃
+ {{ UserStore?.userInfo?.wechat }}
diff --git a/src/pages/webview/index.vue b/src/pages/webview/index.vue
new file mode 100644
index 0000000..63cf316
--- /dev/null
+++ b/src/pages/webview/index.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/src/pinia/UserStore/index.js b/src/pinia/UserStore/index.js
index 3d9b870..d7f07cc 100644
--- a/src/pinia/UserStore/index.js
+++ b/src/pinia/UserStore/index.js
@@ -1,15 +1,31 @@
import {defineStore} from "pinia";
import {ref, reactive} from "vue";
+import {clearObject, toPage} from "../../utils/uils.js";
+import Api from "../../api/index.js";
export const useUserStore = defineStore('UserStore', () => {
const isLogin = ref(false);
const token = ref(null);
const userInfo = reactive({});
+ const logout = async () => {
+ isLogin.value = false;
+ token.value = null;
+ clearObject(userInfo);
+ await toPage("/pages/login/index");
+ }
+
+ const getUserInfo = async () => {
+ const {data} = await Api.system.getInfo();
+ Object.assign(userInfo, data);
+ }
+
return {
isLogin,
userInfo,
token,
+ logout,
+ getUserInfo,
}
}, {
persist: {
diff --git a/src/static/icons/Delete.png b/src/static/icons/Delete.png
new file mode 100644
index 0000000..3156080
Binary files /dev/null and b/src/static/icons/Delete.png differ
diff --git a/src/static/icons/Edit.png b/src/static/icons/Edit.png
new file mode 100644
index 0000000..8d31d42
Binary files /dev/null and b/src/static/icons/Edit.png differ
diff --git a/src/static/icons/add.png b/src/static/icons/add.png
new file mode 100644
index 0000000..ace6e68
Binary files /dev/null and b/src/static/icons/add.png differ
diff --git a/src/static/icons/down.png b/src/static/icons/down.png
new file mode 100644
index 0000000..8fad31c
Binary files /dev/null and b/src/static/icons/down.png differ
diff --git a/src/static/icons/dy.png b/src/static/icons/dy.png
new file mode 100644
index 0000000..fade6c7
Binary files /dev/null and b/src/static/icons/dy.png differ
diff --git a/src/static/icons/ks.png b/src/static/icons/ks.png
new file mode 100644
index 0000000..aa59faf
Binary files /dev/null and b/src/static/icons/ks.png differ
diff --git a/src/static/icons/plus.png b/src/static/icons/plus.png
new file mode 100644
index 0000000..24e2b85
Binary files /dev/null and b/src/static/icons/plus.png differ
diff --git a/src/static/icons/prompt.png b/src/static/icons/prompt.png
new file mode 100644
index 0000000..bb8f6e7
Binary files /dev/null and b/src/static/icons/prompt.png differ
diff --git a/src/static/icons/sph.png b/src/static/icons/sph.png
new file mode 100644
index 0000000..1cdb149
Binary files /dev/null and b/src/static/icons/sph.png differ
diff --git a/src/static/icons/tt.png b/src/static/icons/tt.png
new file mode 100644
index 0000000..e0536f9
Binary files /dev/null and b/src/static/icons/tt.png differ
diff --git a/src/static/icons/xhs.png b/src/static/icons/xhs.png
new file mode 100644
index 0000000..e3c4cef
Binary files /dev/null and b/src/static/icons/xhs.png differ
diff --git a/src/utils/uils.js b/src/utils/uils.js
index b0e4106..1f67067 100644
--- a/src/utils/uils.js
+++ b/src/utils/uils.js
@@ -1,3 +1,6 @@
+import {BASEURL} from "./request.js";
+import {useUserStore} from "../pinia/UserStore/index.js";
+
export const showToast = (options) => {
if (typeof options === 'string') {
uni.showToast({
@@ -25,6 +28,12 @@ export const toPage = async (url) => {
}
}
+export const clearObject = (obj) => {
+ Object.keys(obj).forEach(key => {
+ delete obj[key];
+ });
+};
+
export const backPage = () => {
uni.navigateBack().then();
}
@@ -117,3 +126,38 @@ export const download = (urls) => {
});
// #endif
}
+
+export const numberToCharacter = (number) => {
+ return ['一', '二', '三', '四', '五'][number];
+}
+
+export const uploadFile = ({count}) => {
+ const UserStore = useUserStore();
+ return new Promise((resolve, reject) => {
+ uni.chooseImage({
+ count: count,
+ success: ({tempFilePaths}) => {
+ const file = tempFilePaths[0];
+ uni.uploadFile({
+ url: BASEURL + '/upload/upload',
+ filePath: file,
+ name: "file",
+ header: {
+ token: UserStore.token
+ },
+ success: ({data}) => {
+ resolve(JSON.parse(data));
+ },
+ fail: (err) => {
+ showToast(err.errMsg);
+ reject(err);
+ }
+ });
+ },
+ fail: (err) => {
+ showToast(err.errMsg);
+ reject(err);
+ }
+ });
+ });
+}