diff --git a/src/api/index.ts b/src/api/index.ts index 9a31fbb..9dbe7c5 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,7 +1,9 @@ +import merchant from './merchant.js'; import system from './system.js'; import admin from './admin.js'; const Api = { + merchant: {...merchant}, system: {...system}, admin: {...admin}, } diff --git a/src/api/merchant.js b/src/api/merchant.js new file mode 100644 index 0000000..2334119 --- /dev/null +++ b/src/api/merchant.js @@ -0,0 +1,157 @@ +import request from "../utils/request.js"; +import Method from "./Method.js"; + +const merchant = { + sendSms: async (mobile) => { + return request({ + url: '/index/login/sendSms', + method: Method.POST, + data: {mobile}, + }); + }, + register: async (data) => { + return request({ + url: '/index/login/register', + method: Method.POST, + data: data, + }); + }, + login: async (data) => { + return request({ + url: '/index/login/login', + method: Method.POST, + data: data, + }); + }, + getMenu: async (data) => { + return request({ + url: '/index/business/getMenu', + method: Method.POST, + data: data, + }); + }, + getPlatformList: async () => { + return request({ + url: '/index/task/getPlatformList', + method: Method.POST, + }); + }, + getMaterialType: async (data) => { + return request({ + url: '/index/task/getMaterialType', + method: Method.POST, + data: data, + }); + }, + getProvince: async () => { + return request({ + url: '/index/task/getProvince', + method: Method.POST, + }); + }, + getSettlementAfter: async () => { + return request({ + url: '/index/task/getSettlementAfter', + method: Method.POST, + }); + }, + getChooseContent: async (data) => { + return request({ + url: '/index/task/getChooseContent', + method: Method.POST, + data: data + }); + }, + getNumberOfReleases: async () => { + return Promise.resolve({ + data: [ + { + id: 1, + name: '一次' + }, + { + id: 2, + name: '两次' + }, + { + id: 3, + name: '三次' + }, + { + id: 4, + name: '四次' + }, + { + id: 5, + name: '五次' + }, + ] + }) + }, + getPublicationDuration: async () => { + return Promise.resolve({ + data: [ + { + id: 5, + name: '5分钟' + }, + { + id: 10, + name: '10分钟' + }, + { + id: 20, + name: '20分钟' + }, + { + id: 30, + name: '30分钟' + }, + ] + }) + }, + createTask: async (data) => { + return request({ + url: '/index/task/createTask', + method: Method.POST, + data: data, + }); + }, + getTaskPlatformList: async (data) => { + return request({ + url: '/index/task/getPlatformList', + method: Method.POST, + data: data + }); + }, + getTaskStatusList: async (data) => { + return request({ + url: '/index/task/getStatusList', + method: Method.POST, + data: data + }); + }, + getTaskList: async (data) => { + return request({ + url: '/index/task/getTaskList', + method: Method.POST, + data: data + }); + }, + addWithdrawal: async (data) => { + return request({ + url: '/index/business/addWithdrawal', + method: Method.POST, + data: data + }); + }, + getWithdrawalList: async (data) => { + return request({ + url: '/index/business/getWithdrawalList', + method: Method.POST, + data: data + }); + }, +} + +export default merchant; diff --git a/src/api/system.js b/src/api/system.js index edcd52a..23b5a6d 100644 --- a/src/api/system.js +++ b/src/api/system.js @@ -43,7 +43,20 @@ const system = { 'Content-Type': 'multipart/form-data; boundary=--------------------------611824495457697861278283' } }); - } + }, + uploadFile2: async (file) => { + const formData = new FormData(); + formData.append('file', file); + return request({ + UN_AES: true, + url: '/index/upload/upload', + method: Method.POST, + data: formData, + headers: { + 'Content-Type': 'multipart/form-data; boundary=--------------------------611824495457697861278283' + } + }); + }, } export default system; diff --git a/src/assets/images/yhk.png b/src/assets/images/yhk.png new file mode 100644 index 0000000..aada49d Binary files /dev/null and b/src/assets/images/yhk.png differ diff --git a/src/assets/images/zfb.png b/src/assets/images/zfb.png new file mode 100644 index 0000000..675a56b Binary files /dev/null and b/src/assets/images/zfb.png differ diff --git a/src/components/VerificationCode/index.vue b/src/components/VerificationCode/index.vue index 6aa0b1b..1ccaca4 100644 --- a/src/components/VerificationCode/index.vue +++ b/src/components/VerificationCode/index.vue @@ -4,10 +4,14 @@ import {Message, Notification} from "@arco-design/web-vue"; import Api from "../../api/index.js"; const verificationCode = defineModel('verificationCode', {type: String}); -const {mobile} = defineProps({ +const {mobile, api} = defineProps({ mobile: { type: String, default: null, + }, + api: { + type: Function, + default: Api.admin.sendSms } }); @@ -17,7 +21,7 @@ let timer = null; const verifyPhone = async () => { if (/^1[3-9]\d{9}$/.test(mobile)) { if (timer === null) { - const {msg, code} = await Api.admin.sendSms(mobile); + const {msg, code} = await api(mobile); if (code === 1) Message.success(msg); time.value = 10; timer = setInterval(() => { diff --git a/src/components/XSelect/index.vue b/src/components/XSelect/index.vue index 6983e86..79e61d3 100644 --- a/src/components/XSelect/index.vue +++ b/src/components/XSelect/index.vue @@ -1,5 +1,5 @@ diff --git a/src/components/XTimePicker/XTimePicker.vue b/src/components/XTimePicker/XTimePicker.vue new file mode 100644 index 0000000..b8cd6b7 --- /dev/null +++ b/src/components/XTimePicker/XTimePicker.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/components/upload/UploadOne.vue b/src/components/upload/UploadOne.vue index 2f5dc7a..c58f9d8 100644 --- a/src/components/upload/UploadOne.vue +++ b/src/components/upload/UploadOne.vue @@ -1,17 +1,21 @@ @@ -42,6 +53,7 @@ const from = reactive({ diff --git a/src/pages/merchant/pages/task-center/components/new-task-2.vue b/src/pages/merchant/pages/task-center/components/new-task-2.vue index 05e6b3f..9125b69 100644 --- a/src/pages/merchant/pages/task-center/components/new-task-2.vue +++ b/src/pages/merchant/pages/task-center/components/new-task-2.vue @@ -3,10 +3,17 @@ import Api from "../../../../../api/index.js"; import XSelect from "../../../../../components/XSelect/index.vue"; import FormTitle from "../../../../../components/FormTitle/index.vue"; import {reactive} from "vue"; +import UploadOne from "../../../../../components/upload/UploadOne.vue"; -const emits = defineEmits(['success']); +const emits = defineEmits(['success', 'prev']); const po = reactive({ - name: null, + fb_num: null, + is_identical: 1, + duration: null, + special_text: null, + special_images: null, + choose_area: null, + machine: 0, }); const success = () => { @@ -21,62 +28,55 @@ const success = () => { + v-model:model-value="po.fb_num" + :api="Api.merchant.getNumberOfReleases"> - - 相同 - 不同 + + 相同 + 不同 - + + v-model:model-value="po.duration" + placeholder="无要求" + :api="Api.merchant.getPublicationDuration"> - - - - + {{ po.special_images }} + + multiple + :max-tag-count="4" + v-model:model-value="po.choose_area" + :api="Api.merchant.getProvince"> - - + + 上一步 下一步 diff --git a/src/pages/merchant/pages/task-center/components/new-task-3.vue b/src/pages/merchant/pages/task-center/components/new-task-3.vue index 12a22b5..a2123e8 100644 --- a/src/pages/merchant/pages/task-center/components/new-task-3.vue +++ b/src/pages/merchant/pages/task-center/components/new-task-3.vue @@ -1,12 +1,11 @@