feat(admin): complete integration of auth, delivery, and system infrastructure modules
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
<template>
|
||||
<view class="admin-page">
|
||||
<view class="admin-card content-card">
|
||||
@@ -25,7 +24,7 @@
|
||||
<view class="form-item row">
|
||||
<text class="label">联系电话:</text>
|
||||
<view class="form-content">
|
||||
<input class="form-input" v-model="config.phone" placeholder="400-8888-794" />
|
||||
<input class="form-input" v-model="config.phone" placeholder="请输入联系电话" />
|
||||
<text class="tip">PC底部显示的联系电话</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -33,7 +32,7 @@
|
||||
<view class="form-item row">
|
||||
<text class="label">公司地址:</text>
|
||||
<view class="form-content">
|
||||
<input class="form-input" v-model="config.address" placeholder="陕西省西安市..." />
|
||||
<input class="form-input" v-model="config.address" placeholder="请输入公司地址" />
|
||||
<text class="tip">PC底部显示的公司地址</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -96,12 +95,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import { getSystemConfig, saveSystemConfig } from "@/services/admin/systemConfigService.uts"
|
||||
|
||||
const config = ref({
|
||||
logo: 'https://v5.crmeb.net/uploads/attach/2022/05/20220516/6198f7e6f8a8b.png',
|
||||
phone: '400-8888-794',
|
||||
address: '陕西省西安市西咸新区洋东新城能源金融贸易区金湾大厦3层',
|
||||
const config = reactive({
|
||||
logo: '',
|
||||
phone: '',
|
||||
address: '',
|
||||
keywords: '',
|
||||
description: '',
|
||||
qrCodeType: 'routine',
|
||||
@@ -109,17 +109,40 @@ const config = ref({
|
||||
newProductCount: 5
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadConfig()
|
||||
})
|
||||
|
||||
async function loadConfig() {
|
||||
const res = await getSystemConfig('pc_site_config')
|
||||
if (res != null) {
|
||||
Object.assign(config, res as any)
|
||||
}
|
||||
}
|
||||
|
||||
const handleUploadLogo = () => {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
config.value.logo = res.tempFilePaths[0]
|
||||
config.logo = res.tempFilePaths[0]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleSubmit = () => {
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
const handleSubmit = async () => {
|
||||
uni.showLoading({ title: '正在保存...' })
|
||||
try {
|
||||
const ok = await saveSystemConfig('pc_site_config', config as UTSJSONObject, 'PC站点配置')
|
||||
if (ok) {
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
} else {
|
||||
uni.showToast({ title: '保存失败', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '系统错误', icon: 'none' })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -308,4 +331,3 @@ const handleSubmit = () => {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user