update
This commit is contained in:
@@ -2,11 +2,14 @@ import request from "../utils/request.js";
|
||||
import Method from "./Method.js";
|
||||
|
||||
const merchant = {
|
||||
sendSms: async (mobile) => {
|
||||
sendSms: async (mobile, type) => {
|
||||
return request({
|
||||
url: '/index/login/sendSms',
|
||||
method: Method.POST,
|
||||
data: {mobile},
|
||||
data: {
|
||||
mobile,
|
||||
type
|
||||
},
|
||||
});
|
||||
},
|
||||
register: async (data) => {
|
||||
@@ -166,6 +169,48 @@ const merchant = {
|
||||
data: data
|
||||
});
|
||||
},
|
||||
saveNickname: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/saveNickname',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
saveMobile: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/saveMobile',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
saveWechat: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/saveWechat',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
savePassword: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/savePassword',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
saveAvatar: async (data) => {
|
||||
return request({
|
||||
url: '/index/business/saveAvatar',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
getTaskChildrenList: async (data) => {
|
||||
return request({
|
||||
url: '/index/task/getTaskChildrenList',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
export default merchant;
|
||||
|
||||
BIN
src/assets/images/avatar.png
Normal file
BIN
src/assets/images/avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@@ -3,7 +3,7 @@ import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
||||
import {useUserStore} from "../../pinia/UserStore/index.js";
|
||||
|
||||
const SystemStore = useSystemStore();
|
||||
const {logout} = useUserStore();
|
||||
const UserStore = useUserStore();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -16,11 +16,11 @@ const {logout} = useUserStore();
|
||||
<a-dropdown>
|
||||
<a-link
|
||||
:hoverable="false">
|
||||
15709267061
|
||||
{{ UserStore.userInfo.nickname || UserStore.userInfo.mobile }}
|
||||
<icon-down/>
|
||||
</a-link>
|
||||
<template #content>
|
||||
<a-doption @click="logout">退出登陆</a-doption>
|
||||
<a-doption @click="UserStore.logout">退出登陆</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
|
||||
@@ -4,11 +4,15 @@ import {Message, Notification} from "@arco-design/web-vue";
|
||||
import Api from "../../api/index.js";
|
||||
|
||||
const verificationCode = defineModel('verificationCode', {type: String});
|
||||
const {mobile, api} = defineProps({
|
||||
const {mobile, api, type} = defineProps({
|
||||
mobile: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
api: {
|
||||
type: Function,
|
||||
default: Api.admin.sendSms
|
||||
@@ -21,7 +25,7 @@ let timer = null;
|
||||
const verifyPhone = async () => {
|
||||
if (/^1[3-9]\d{9}$/.test(mobile)) {
|
||||
if (timer === null) {
|
||||
const {msg, code} = await api(mobile);
|
||||
const {msg, code} = await api(mobile, type);
|
||||
if (code === 1) Message.success(msg);
|
||||
time.value = 10;
|
||||
timer = setInterval(() => {
|
||||
|
||||
31
src/components/upload/UploadSlot.vue
Normal file
31
src/components/upload/UploadSlot.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script setup>
|
||||
import Api from "../../api/index.js";
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
|
||||
const upload = (e) => {
|
||||
const file = e.target.files[0];
|
||||
Api.system.uploadFile2(file).then(({data}) => {
|
||||
emits('success', data);
|
||||
});
|
||||
}
|
||||
|
||||
const createInput = () => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.onchange = upload;
|
||||
input.style.display = 'none';
|
||||
document.body.append(input);
|
||||
input.click();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div @click="createInput">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import {ref, reactive} from 'vue';
|
||||
import {reactive} from 'vue';
|
||||
import VerificationCode from "../../components/VerificationCode/index.vue";
|
||||
import Api from "../../api/index.js";
|
||||
|
||||
const from = reactive({
|
||||
phone: null,
|
||||
@@ -19,6 +20,8 @@ const from = reactive({
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<VerificationCode
|
||||
:type="3"
|
||||
:api="Api.merchant.sendSms"
|
||||
:phone="from.phone"
|
||||
v-model:verification-code="from.verificationCode">
|
||||
</VerificationCode>
|
||||
@@ -37,6 +40,7 @@ const from = reactive({
|
||||
<style scoped>
|
||||
.card {
|
||||
box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1);
|
||||
|
||||
:deep(.arco-form-item-label-col) {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ const mode = ref(MODE.PHONE);
|
||||
<div class="mt-[38px] flex flex-col gap-[20px]">
|
||||
<a-input v-model:model-value="from.mobile" placeholder="手机号"></a-input>
|
||||
<VerificationCode
|
||||
:type="2"
|
||||
v-if="mode === MODE.PHONE"
|
||||
:mobile="from.mobile"
|
||||
v-model:verification-code="from.code">
|
||||
|
||||
@@ -31,6 +31,7 @@ const register = async () => {
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码">
|
||||
<VerificationCode
|
||||
:type="1"
|
||||
:api="Api.merchant.sendSms"
|
||||
:mobile="from.mobile"
|
||||
v-model:verification-code="from.captcha">
|
||||
|
||||
@@ -63,6 +63,7 @@ const success = async () => {
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码">
|
||||
<VerificationCode
|
||||
:type="6"
|
||||
:api="Api.merchant.sendSms"
|
||||
:mobile="form.mobile"
|
||||
v-model:verification-code="form.captcha">
|
||||
|
||||
@@ -1,10 +1,104 @@
|
||||
<script setup>
|
||||
import {reactive, ref} from "vue";
|
||||
import ICON from "../../../../assets/images/avatar.png";
|
||||
import {onMounted, reactive, ref} from "vue";
|
||||
import Api from "../../../../api/index.js";
|
||||
import {baseImage} from "../../../../utils/index.js";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
import {useUserStore} from "../../../../pinia/UserStore/index.js";
|
||||
import VerificationCode from "../../../../components/VerificationCode/index.vue";
|
||||
import UploadSlot from "../../../../components/upload/UploadSlot.vue";
|
||||
|
||||
const UserStore = useUserStore();
|
||||
const activeKey = ref('1');
|
||||
const form = reactive({
|
||||
name: null
|
||||
const vo = reactive({
|
||||
avatar: null,
|
||||
nickname: null,
|
||||
wechat: null,
|
||||
mobile: null,
|
||||
uid: null,
|
||||
invite: null,
|
||||
password: null,
|
||||
});
|
||||
const form = reactive({
|
||||
avatar: null,
|
||||
nickname: null,
|
||||
wechat: null,
|
||||
mobile: null,
|
||||
uid: null,
|
||||
invite: null,
|
||||
captcha: null,
|
||||
password: null,
|
||||
old_mobile: null,
|
||||
new_mobile: null,
|
||||
old_captcha: null,
|
||||
new_captcha: null,
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
const {data} = await Api.merchant.getBusinessInfo();
|
||||
Object.assign(vo, data);
|
||||
Object.assign(UserStore.userInfo, vo);
|
||||
form.old_mobile = vo.mobile;
|
||||
vo.password = '********';
|
||||
}
|
||||
|
||||
const saveNickname = async () => {
|
||||
const {msg} = await Api.merchant.saveNickname({
|
||||
nickname: form.nickname,
|
||||
});
|
||||
form.nickname = null;
|
||||
Message.success(msg);
|
||||
await getData();
|
||||
}
|
||||
|
||||
const saveMobile = async () => {
|
||||
const {msg} = await Api.merchant.saveMobile({
|
||||
old_mobile: form.old_mobile,
|
||||
new_mobile: form.new_mobile,
|
||||
old_captcha: form.old_captcha,
|
||||
new_captcha: form.new_captcha,
|
||||
});
|
||||
form.old_mobile = null;
|
||||
form.new_mobile = null;
|
||||
form.old_captcha = null;
|
||||
form.new_captcha = null;
|
||||
Message.success(msg);
|
||||
await getData();
|
||||
}
|
||||
|
||||
const savePassword = async () => {
|
||||
const {msg} = await Api.merchant.savePassword({
|
||||
mobile: form.mobile,
|
||||
captcha: form.captcha,
|
||||
password: form.password,
|
||||
});
|
||||
form.mobile = null;
|
||||
form.captcha = null;
|
||||
form.password = null;
|
||||
Message.success(msg);
|
||||
await getData();
|
||||
}
|
||||
|
||||
const saveWechat = async () => {
|
||||
const {msg} = await Api.merchant.saveWechat({
|
||||
wechat: form.wechat
|
||||
});
|
||||
form.wechat = null;
|
||||
Message.success(msg);
|
||||
await getData();
|
||||
}
|
||||
|
||||
const updateAvatar = async (url) => {
|
||||
const {msg} = await Api.merchant.saveAvatar({
|
||||
avatar: url,
|
||||
});
|
||||
Message.success(msg);
|
||||
await getData();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -16,33 +110,38 @@ const form = reactive({
|
||||
</div>
|
||||
|
||||
<div class="mock-card mb-[20px] py-[30px] flex items-center gap-[60px]">
|
||||
<div class="w-[100px] h-[100px] test rounded-[50%]">
|
||||
<img class="w-full h-full rounded-[50%] object-cover" src="" alt=""/>
|
||||
<div class="w-[100px] h-[100px] rounded-[50%] relative">
|
||||
<div class="!size-full rounded-[50%] overflow-hidden cursor-pointer">
|
||||
<a-image width="100%" height="100%" :src="baseImage(vo.avatar)"></a-image>
|
||||
</div>
|
||||
<UploadSlot @success="updateAvatar">
|
||||
<img class="!size-[30px] absolute right-0 bottom-0 cursor-pointer" :src="ICON" alt=""/>
|
||||
</UploadSlot>
|
||||
</div>
|
||||
|
||||
<a-descriptions align="right">
|
||||
<a-descriptions-item label="昵称" :span="2">
|
||||
王力群ABCabc
|
||||
<a-descriptions align="right" id="descriptions">
|
||||
<a-descriptions-item label="昵称" :span="1">
|
||||
{{ vo.nickname }}
|
||||
<a-link :hoverable="false" class="ml-[20px]" @click="activeKey='1'">更改</a-link>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="微信号" :span="2">
|
||||
luoluo347
|
||||
{{ vo.wechat }}
|
||||
<a-link :hoverable="false" class="ml-[20px]" @click="activeKey='4'">更改</a-link>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="手机绑定" :span="2">
|
||||
15012312300
|
||||
<a-descriptions-item label="手机绑定" :span="1">
|
||||
{{ vo.mobile }}
|
||||
<a-link :hoverable="false" class="ml-[20px]" @click="activeKey='2'">更改</a-link>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="ID" :span="2">
|
||||
S1560
|
||||
{{ vo.uid }}
|
||||
<a-link :hoverable="false" class="ml-[20px]">复制</a-link>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="账号密码" :span="2">
|
||||
********
|
||||
<a-descriptions-item label="账号密码" :span="1">
|
||||
{{ vo.password }}
|
||||
<a-link :hoverable="false" class="ml-[20px]" @click="activeKey='3'">更改</a-link>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="邀请码" :span="2">
|
||||
734783
|
||||
{{ vo.invite }}
|
||||
<a-link :hoverable="false" class="ml-[20px]">复制</a-link>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
@@ -57,52 +156,67 @@ const form = reactive({
|
||||
type="rounded">
|
||||
<a-tab-pane title="更改昵称" key="1">
|
||||
<a-form-item label="新昵称">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入新昵称"></a-input>
|
||||
<a-input v-model:model-value="form.nickname" placeholder="请输入新昵称"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item class="mt-[40px]">
|
||||
<a-button type="primary">确认更改</a-button>
|
||||
<a-button type="primary" @click="saveNickname">确认更改</a-button>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
|
||||
<a-tab-pane title="手机绑定" key="2">
|
||||
<a-form-item label="原手机号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入原手机号"></a-input>
|
||||
<a-input v-model:model-value="form.old_mobile" placeholder="请输入原手机号" disabled></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入验证码"></a-input>
|
||||
<VerificationCode
|
||||
:type="4"
|
||||
:api="Api.merchant.sendSms"
|
||||
:mobile="form.old_mobile"
|
||||
v-model:verification-code="form.old_captcha">
|
||||
</VerificationCode>
|
||||
</a-form-item>
|
||||
<a-form-item label="新手机号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入新手机号"></a-input>
|
||||
<a-input v-model:model-value="form.new_mobile" placeholder="请输入新手机号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入验证码"></a-input>
|
||||
<VerificationCode
|
||||
:type="5"
|
||||
:api="Api.merchant.sendSms"
|
||||
:mobile="form.new_mobile"
|
||||
v-model:verification-code="form.new_captcha">
|
||||
</VerificationCode>
|
||||
</a-form-item>
|
||||
<a-form-item class="mt-[40px]">
|
||||
<a-button type="primary">确认更改</a-button>
|
||||
<a-button type="primary" @click="saveMobile">确认更改</a-button>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
|
||||
<a-tab-pane title="账号密码" key="3">
|
||||
<a-form-item label="手机号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入手机号"></a-input>
|
||||
<a-input v-model:model-value="form.mobile" placeholder="请输入手机号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入验证码"></a-input>
|
||||
<VerificationCode
|
||||
:type="3"
|
||||
:api="Api.merchant.sendSms"
|
||||
:mobile="form.mobile"
|
||||
v-model:verification-code="form.captcha">
|
||||
</VerificationCode>
|
||||
</a-form-item>
|
||||
<a-form-item label="新密码">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入新密码"></a-input>
|
||||
<a-input v-model:model-value="form.password" placeholder="请输入新密码"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item class="mt-[40px]">
|
||||
<a-button type="primary">确认更改</a-button>
|
||||
<a-button type="primary" @click="savePassword">确认更改</a-button>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
|
||||
<a-tab-pane title="微信号" key="4">
|
||||
<a-form-item label="微信号">
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入微信号"></a-input>
|
||||
<a-input v-model:model-value="form.wechat" placeholder="请输入微信号"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item class="mt-[40px]">
|
||||
<a-button type="primary">确认更改</a-button>
|
||||
<a-button type="primary" @click="saveWechat">确认更改</a-button>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
@@ -110,6 +224,12 @@ const form = reactive({
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#descriptions {
|
||||
:deep(.arco-descriptions-row) {
|
||||
td:nth-child(3) {
|
||||
padding-left: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,7 +41,7 @@ const po = reactive({
|
||||
wd: null,
|
||||
});
|
||||
|
||||
const {loading, pagination, initFetchData} = useTableQuery({
|
||||
const {loading, pagination, fetchData} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
callback: (data) => {
|
||||
@@ -60,7 +60,7 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
</div>
|
||||
|
||||
<a-card>
|
||||
<div class="title">动账明细</div>
|
||||
<div class="title">分值变动记录</div>
|
||||
|
||||
<a-table
|
||||
@page-change="(e) => pagination.current = e"
|
||||
|
||||
@@ -6,11 +6,13 @@ import Api from "../../../../api/index.js";
|
||||
import RefuseModal from "./components/RefuseModal.vue";
|
||||
import openTerminateTask from "../../../../components/TerminateTask/TerminateTask.js";
|
||||
import BlackjackExpertModal from "../../components/BlackjackExpertModal.vue";
|
||||
import {useRoute} from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
const columns = [
|
||||
{
|
||||
title: '子任务号',
|
||||
dataIndex: 'key',
|
||||
dataIndex: 'uid',
|
||||
},
|
||||
{
|
||||
title: '子任务状态',
|
||||
@@ -69,12 +71,13 @@ const vo = reactive({
|
||||
total: 0,
|
||||
});
|
||||
const po = reactive({
|
||||
id: route.query.id,
|
||||
wd: null,
|
||||
});
|
||||
|
||||
const {loading, pagination, initFetchData} = useTableQuery({
|
||||
const {loading, pagination} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
api: Api.merchant.getTaskChildrenList,
|
||||
callback: (data) => {
|
||||
Object.assign(vo, data);
|
||||
console.log(vo);
|
||||
@@ -107,12 +110,14 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
class="w-full mt-[20px]">
|
||||
<template v-slot:status>
|
||||
<a-tag color="green">已领取</a-tag>
|
||||
<a-tag color="red">请重新上传素材</a-tag>
|
||||
<a-tag color="orangered">素材审核中</a-tag>
|
||||
<a-tag color="gray">待领取</a-tag>
|
||||
<a-tag color="arcoblue">已终止</a-tag>
|
||||
<template v-slot:status="{record}">
|
||||
<a-tag v-if="record.status === 0" color="red">待上传素材</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="orangered">素材审核中</a-tag>
|
||||
<a-tag v-if="record.status === 2" color="orangered">重新上传素材</a-tag>
|
||||
<a-tag v-if="record.status === 3" color="gray">待领取</a-tag>
|
||||
<a-tag v-if="record.status === 4" color="green">已领取</a-tag>
|
||||
<a-tag v-if="record.status === 5" color="green">已结算</a-tag>
|
||||
<a-tag v-if="record.status === 6" color="arcoblue">已终止</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-slot:action>
|
||||
|
||||
@@ -5,6 +5,7 @@ import TooltipTag from "../../../../components/TooltipTag/index.vue";
|
||||
import useTableQuery from "../../../../hooks/useTableQuery.js";
|
||||
import Api from "../../../../api/index.js";
|
||||
import {toPath} from "../../../../utils/index.js";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -162,10 +163,12 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
</a-progress>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:action>
|
||||
<template v-slot:action="{record}">
|
||||
<div class="flex gap-[16px]">
|
||||
<a-link :hoverable="false">编辑</a-link>
|
||||
<a-link :hoverable="false" @click="toPath('/home/task-center/look-min-task')">查看子任务
|
||||
<a-link :hoverable="false"
|
||||
@click="record.status >= 2 ? toPath('/home/task-center/look-min-task', {id: record.id}) : Message.warning('审核未通过')">
|
||||
查看子任务
|
||||
</a-link>
|
||||
<a-link :hoverable="false" status="danger">终止</a-link>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import router from "../router/index.js";
|
||||
|
||||
export const toPath = (path) => {
|
||||
router.push(path).then();
|
||||
export const toPath = (path, query = {}) => {
|
||||
router.push({
|
||||
path: path,
|
||||
query: query
|
||||
}).then();
|
||||
}
|
||||
|
||||
export const VITE_TINYMCE_KEY = () => {
|
||||
@@ -13,3 +16,8 @@ export const deleteObjectFields = (obj) => {
|
||||
delete obj[key];
|
||||
});
|
||||
}
|
||||
|
||||
export const baseImage = (url) => {
|
||||
if (!url) url = '';
|
||||
return url.startsWith('http') ? url : import.meta.env.VITE_API_URL + url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user