This commit is contained in:
wwz
2025-01-15 13:44:01 +08:00
parent d883976066
commit a049ee6667
3 changed files with 128 additions and 76 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/node_modules/ /node_modules/
/unpackage/ /unpackage/
/uni_modules/

View File

@@ -15,5 +15,12 @@
"前端组件", "前端组件",
"通用组件" "通用组件"
] ]
},
"dependencies": {
"lodash": "^4.17.21",
"uview-plus": "^3.3.62"
},
"devDependencies": {
"pinia-plugin-unistorage": "^0.1.2"
} }
} }

View File

@@ -1,6 +1,19 @@
<template> <template>
<view class="container"> <view class="container">
<view class="card"> <view v-if="info.value == 4">
<web-view :src="info.url"></web-view>
</view>
<view class="" v-else>
<view class="card" v-if="info.value == 1">
<view class="title">
<view class="t1">添加客服微信咨询</view>
<view class="t2">{{ info.wx }}</view>
</view>
<view class="content">
<image class="img" :src="info.qrcode" mode="widthFix" @click="checkQrcode"></image>
</view>
</view>
<view class="card" v-if="info.value == 2">
<view class="title"> <view class="title">
<view class="t1">添加客服微信咨询</view> <view class="t1">添加客服微信咨询</view>
<view class="t2">{{ info.wx }}</view> <view class="t2">{{ info.wx }}</view>
@@ -10,65 +23,96 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script setup> <script setup>
import { ref, reactive } from 'vue'; import {
import { onLoad } from '@dcloudio/uni-app'; ref,
import { commonType } from '@/api/me/me.js'; reactive
} from 'vue';
const info = ref({}); import {
async function commonTypeAjax() { onLoad
} from '@dcloudio/uni-app';
import {
commonType
} from '@/api/me/me.js';
const info = ref({});
async function commonTypeAjax() {
try { try {
const Ttype = await commonType(202);
// "客服配置 1 二维码客服 2 微信公众号客服 3电话客服 4外链 ",
info.value.value = Ttype.value
switch (info.value.value) {
case '1':
const res1 = await commonType(205); const res1 = await commonType(205);
const res2 = await commonType(207); const res2 = await commonType(207);
info.value.wx = res2.value; info.value.wx = res2.value;
info.value.qrcode = res1.value; info.value.qrcode = res1.value;
break;
case '2':
console.log('wu')
break;
case '3':
uni.makePhoneCall({
phoneNumber: uni.getStorageSync('kefuPhone') //仅为示例
});
break;
case '4':
info.value.url = uni.getStorageSync('kefuPhone')
break;
}
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
} }
// 预览二维码 // 预览二维码
function checkQrcode() { function checkQrcode() {
uni.previewImage({ uni.previewImage({
urls: [info.value.qrcode] urls: [info.value.qrcode]
}); });
} }
onLoad(() => { onLoad(() => {
commonTypeAjax(); commonTypeAjax();
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page { page {
background: #f5f5f5; background: #f5f5f5;
} }
.container {
.container {
padding: 28upx; padding: 28upx;
} }
.card {
.card {
padding: 28upx; padding: 28upx;
border-radius: 20upx; border-radius: 20upx;
background-color: #fff; background-color: #fff;
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
.t1 { .t1 {
color: #555; color: #555;
} }
} }
.content { .content {
display: flex; display: flex;
justify-content: center; justify-content: center;
padding-top: 28upx; padding-top: 28upx;
.img { .img {
width: 100%; width: 100%;
display: block; display: block;
} }
} }
} }
</style> </style>