2025-03-25 16:35:39 +08:00
|
|
|
<script setup>
|
2025-05-12 19:45:27 +08:00
|
|
|
import XNav from "../../components/XNav.vue";
|
|
|
|
|
import XFormItem from "../../components/XFormItem.vue";
|
|
|
|
|
import XForm from "../../components/XForm.vue";
|
|
|
|
|
import XSelect from "../../components/XSelect.vue";
|
|
|
|
|
import Api from "../../api/index.js";
|
|
|
|
|
import XInput from "../../components/XInput.vue";
|
|
|
|
|
import XUpload from "../../components/XUpload.vue";
|
|
|
|
|
import {reactive} from "vue";
|
|
|
|
|
import {backPage, showToast} from "../../utils/uils.js";
|
|
|
|
|
import {onLoad} from "@dcloudio/uni-app";
|
2025-05-13 10:45:51 +08:00
|
|
|
import XDateTime from "../../components/XDateTime.vue";
|
2025-05-21 15:45:10 +08:00
|
|
|
import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
|
|
|
|
|
|
|
|
|
const SystemStore = useSystemStore();
|
2025-03-25 16:35:39 +08:00
|
|
|
|
2025-05-12 19:45:27 +08:00
|
|
|
const form = reactive({
|
|
|
|
|
status: null,
|
|
|
|
|
qrcode: [],
|
|
|
|
|
abnormaltime: null,
|
|
|
|
|
nickname: null,
|
|
|
|
|
account: null,
|
|
|
|
|
pid: null,
|
|
|
|
|
homepage: [],
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const success = async () => {
|
|
|
|
|
if (!form.id) {
|
|
|
|
|
const {msg} = await Api.system.addAccount({
|
|
|
|
|
...form,
|
|
|
|
|
homepage: form.homepage[0],
|
|
|
|
|
qrcode: form.qrcode[0]
|
|
|
|
|
});
|
|
|
|
|
showToast(msg);
|
|
|
|
|
} else {
|
|
|
|
|
const {msg} = await Api.system.editAccount({
|
|
|
|
|
...form,
|
|
|
|
|
homepage: form.homepage[0],
|
|
|
|
|
qrcode: form.qrcode[0]
|
|
|
|
|
});
|
|
|
|
|
showToast(msg);
|
|
|
|
|
}
|
|
|
|
|
backPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
const {id} = options;
|
2025-05-21 15:45:10 +08:00
|
|
|
if (id) Api.system.getAccountInfo(id).then(({data}) => {
|
2025-05-12 19:45:27 +08:00
|
|
|
data.homepage = [data.homepage];
|
|
|
|
|
data.qrcode = [data.qrcode];
|
|
|
|
|
Object.assign(form, data);
|
|
|
|
|
});
|
2025-05-21 15:45:10 +08:00
|
|
|
if (SystemStore.accountManagementPo.pid) form.pid = Number(SystemStore.accountManagementPo.pid);
|
2025-05-12 19:45:27 +08:00
|
|
|
})
|
2025-07-14 16:58:46 +08:00
|
|
|
|
|
|
|
|
const getSelect = async () => {
|
|
|
|
|
const {data} = await Api.system.getPlatform();
|
|
|
|
|
data.shift();
|
|
|
|
|
return {
|
|
|
|
|
data: data,
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-03-25 16:35:39 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<!--添加账号-->
|
2025-05-12 19:45:27 +08:00
|
|
|
<x-nav></x-nav>
|
2025-03-25 16:35:39 +08:00
|
|
|
|
2025-05-12 19:45:27 +08:00
|
|
|
<view class="min-h-[calc(100vh-100rpx)] bg-[#fff] px-[30rpx] py-[25rpx]">
|
|
|
|
|
<x-form>
|
|
|
|
|
<x-form-item label="宣发平台">
|
2025-07-14 16:58:46 +08:00
|
|
|
<x-select v-model:model-value="form.pid" :api="getSelect"></x-select>
|
2025-05-12 19:45:27 +08:00
|
|
|
</x-form-item>
|
|
|
|
|
<x-form-item label="账号">
|
|
|
|
|
<x-input v-model:model-value="form.account" height="80rpx" placeholder="请输入帐号"></x-input>
|
|
|
|
|
</x-form-item>
|
|
|
|
|
<x-form-item label="昵称">
|
|
|
|
|
<x-input v-model:model-value="form.nickname" height="80rpx" placeholder="请输入昵称"></x-input>
|
|
|
|
|
</x-form-item>
|
2025-05-13 10:45:51 +08:00
|
|
|
<x-form-item label="恢复时间" v-if="form.status === 2">
|
|
|
|
|
<x-date-time :type="1" v-model:model-value="form.abnormaltime"></x-date-time>
|
|
|
|
|
</x-form-item>
|
2025-05-12 19:45:27 +08:00
|
|
|
<x-form-item label="主页截图">
|
2025-06-24 20:55:09 +08:00
|
|
|
<x-upload v-model:files="form.homepage" single></x-upload>
|
2025-05-12 19:45:27 +08:00
|
|
|
</x-form-item>
|
|
|
|
|
<x-form-item label="主页二维码">
|
2025-06-24 20:55:09 +08:00
|
|
|
<x-upload v-model:files="form.qrcode" single></x-upload>
|
2025-05-12 19:45:27 +08:00
|
|
|
</x-form-item>
|
|
|
|
|
</x-form>
|
|
|
|
|
|
|
|
|
|
<tui-button @click="success" class="!fixed bottom-[30rpx] left-0 !mx-[30rpx] !w-[calc(100vw-60rpx)]">确认提交
|
|
|
|
|
</tui-button>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
2025-03-25 16:35:39 +08:00
|
|
|
|
2025-05-12 19:45:27 +08:00
|
|
|
<style lang="scss">
|
|
|
|
|
.x-form-item-label {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #4E5969 !important;
|
|
|
|
|
}
|
2025-03-25 16:35:39 +08:00
|
|
|
</style>
|