feat(admin): complete full integration of kefu, finance, product and order modules with real RPC data streams

This commit is contained in:
comlibmb
2026-02-11 18:45:46 +08:00
parent ee5c0c446b
commit 48320b410c
25 changed files with 2060 additions and 538 deletions

View File

@@ -17,21 +17,21 @@
</view>
<view class="input-box flex-row">
<view class="radio-group">
<view class="radio-item" @click="configType = 'system'">
<view :class="['radio-circle', configType === 'system' ? 'checked' : '']">
<view v-if="configType === 'system'" class="radio-inner"></view>
<view class="radio-item" @click="form.type = 'system'">
<view :class="['radio-circle', form.type === 'system' ? 'checked' : '']">
<view v-if="form.type === 'system'" class="radio-inner"></view>
</view>
<text class="radio-label">系统客服</text>
</view>
<view class="radio-item" @click="configType = 'phone'">
<view :class="['radio-circle', configType === 'phone' ? 'checked' : '']">
<view v-if="configType === 'phone'" class="radio-inner"></view>
<view class="radio-item" @click="form.type = 'phone'">
<view :class="['radio-circle', form.type === 'phone' ? 'checked' : '']">
<view v-if="form.type === 'phone'" class="radio-inner"></view>
</view>
<text class="radio-label">拨打电话</text>
</view>
<view class="radio-item" @click="configType = 'link'">
<view :class="['radio-circle', configType === 'link' ? 'checked' : '']">
<view v-if="configType === 'link'" class="radio-inner"></view>
<view class="radio-item" @click="form.type = 'link'">
<view :class="['radio-circle', form.type === 'link' ? 'checked' : '']">
<view v-if="form.type === 'link'" class="radio-inner"></view>
</view>
<text class="radio-label">跳转链接</text>
</view>
@@ -47,7 +47,7 @@
</view>
<!-- 动态显示内容 -->
<template v-if="configType === 'system'">
<template v-if="form.type === 'system'">
<view class="form-item align-start">
<view class="label-box pt-10">
<text class="label-txt">客服反馈:</text>
@@ -55,34 +55,34 @@
<view class="input-box">
<textarea
class="textarea-base"
v-model="feedbackText"
v-model="form.feedback"
placeholder="请输入客服反馈内容"
/>
<text class="input-tip">暂无客服在线,联系客服跳转的客服反馈页面的显示文字</text>
<text class="input-tip">暂无客服在线,联系客服跳转的客服反馈页面的显示文字</text>
</view>
</view>
</template>
<template v-else-if="configType === 'phone'">
<template v-else-if="form.type === 'phone'">
<view class="form-item">
<view class="label-box">
<text class="label-txt">客服电话:</text>
</view>
<view class="input-box">
<input class="input-base" v-model="phoneNumber" placeholder="请输入客服电话" />
<text class="input-tip">客服类型选择不打电话是,用户点击联系客服的联系电话</text>
<input class="input-base" v-model="form.phone" placeholder="请输入客服电话" />
<text class="input-tip">用户点击联系客服时的拨打号码</text>
</view>
</view>
</template>
<template v-else-if="configType === 'link'">
<template v-else-if="form.type === 'link'">
<view class="form-item">
<view class="label-box">
<text class="label-txt">跳转链接:</text>
</view>
<view class="input-box">
<input class="input-base" v-model="linkUrl" placeholder="请输入外部链接地址" />
<text class="input-tip">客服类型选择跳转链接时,用户点击联系客服跳转的外部链接</text>
<input class="input-base" v-model="form.link" placeholder="请输入外部链接地址" />
<text class="input-tip">用户点击联系客服跳转的外部链接</text>
</view>
</view>
</template>
@@ -99,24 +99,44 @@
</template>
<script setup lang="uts">
import { ref } from 'vue'
import { ref, onMounted, reactive } from 'vue'
import { getKefuSettings, saveKefuSettings, type KefuConfig } from '@/services/admin/kefuService.uts'
const configType = ref('system') // system, phone, link
const feedbackText = ref('尊敬的用户,客服当前不在线,有问题请留言,我们会第一时间进行处理!!!')
const phoneNumber = ref('4008888794')
const linkUrl = ref('')
const form = reactive({
type: 'system',
feedback: '',
phone: '',
link: ''
})
const handleSubmit = () => {
console.log('提交配置', {
type: configType.value,
feedback: feedbackText.value,
phone: phoneNumber.value,
link: linkUrl.value
})
uni.showToast({
title: '保存成功',
icon: 'success'
})
onMounted(() => {
loadConfig()
})
async function loadConfig() {
const res = await getKefuSettings()
if (res != null) {
form.type = res.type
form.feedback = res.feedback
form.phone = res.phone
form.link = res.link
}
}
const handleSubmit = async () => {
uni.showLoading({ title: '正在保存...' })
try {
const ok = await saveKefuSettings(form as KefuConfig)
if (ok) {
uni.showToast({ title: '保存成功', icon: 'success' })
} else {
uni.showToast({ title: '保存失败', icon: 'none' })
}
} catch (e) {
uni.showToast({ title: '系统错误', icon: 'none' })
} finally {
uni.hideLoading()
}
}
</script>