wujingling0908 2 weeks ago
commit f3d893e321
  1. 2
      src/components/chat-content.vue
  2. 7
      src/components/footer-bar-btn.vue
  3. 354
      src/components/gmNetwork-address.vue

@ -413,7 +413,7 @@
</div> </div>
<div class="chat-items"> <div class="chat-items">
<div class="content-left-main computing-text-box" style="padding: 14rem"> <div class="content-left-main computing-text-box" style="padding: 14rem">
<gm-network-address :itemList="item"></gm-network-address> <gm-network-address :itemList="item" :disabled="isHistory"></gm-network-address>
</div> </div>
</div> </div>
</div> </div>

@ -103,6 +103,13 @@ onMounted(() => {
display: flex; display: flex;
padding: 0 16rem; padding: 0 16rem;
gap: 8rem; gap: 8rem;
scrollbar-width: none;
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
}
.qipaomain::-webkit-scrollbar {
display: none;
} }
.footer-bar-btn { .footer-bar-btn {

@ -30,9 +30,6 @@
> >
</van-field> </van-field>
</div> </div>
<!-- <div style="color:#fd7d45;font-size:11px">
*{{textInfo.tip||'若无可选区域选项则表示暂未设置网点'}}
</div> -->
<div class="van-address-edit-btn"> <div class="van-address-edit-btn">
<van-button <van-button
@ -41,7 +38,6 @@
color="#5A9CFF" color="#5A9CFF"
:disabled="submitDisabled" :disabled="submitDisabled"
:loading="submitLoad" :loading="submitLoad"
type="info"
loading-text="变更中..." loading-text="变更中..."
@click.stop="submitInfo" @click.stop="submitInfo"
>确 认</van-button >确 认</van-button
@ -54,60 +50,47 @@
<div <div
v-for="(item, index) in networkInfo" v-for="(item, index) in networkInfo"
:key="index" :key="index"
:style="{ 'border-top': index > 0 ? '1px dashed #666' : '' }" :style="{ 'border-top': index > 0 ? '1rem dashed #666' : '' }"
> >
<div <div
class="networkInfo-title displayleft" class="networkInfo-title displayleft"
style="margin: 10px 0; font-size: 16px; align-items: center" style="margin: 10rem 0; font-size: 16rem; align-items: center"
> >
<img <img
src="../assets/images/company.png" src="../assets/images/company.png"
style="width: 19px; height: 17px; margin-right: 8px" style="width: 19rem; height: 17rem; margin-right: 8rem"
alt="" alt=""
/> />
<div>{{ item.intorgName }}</div> <div>{{ item.intorgName }}</div>
</div> </div>
<div class="displayleft" style="margin: 10px 0"> <div class="displayleft" style="margin: 10rem 0">
<div style="width: 110px">地<span style="opacity: 0">地址</span>址:</div> <div style="width: 110rem">地<span style="opacity: 0">地址</span>址:</div>
<div style="color: #666; flex: 1; font-size: 12px"> <div style="color: #666; flex: 1; font-size: 12rem">
{{ item.address }} {{ item.address }}
</div> </div>
</div> </div>
<div class="displayleft" style="margin: 10px 0"> <div class="displayleft" style="margin: 10rem 0">
<div style="width: 110px">电<span style="opacity: 0">电话</span>话:</div> <div style="width: 110rem">电<span style="opacity: 0">电话</span>话:</div>
<div style="color: #666; flex: 1; font-size: 12px"> <div style="color: #666; flex: 1; font-size: 12rem">
<div v-if="item.tel" v-html="item.tel"></div> <div v-if="item.tel" v-html="item.tel"></div>
</div> </div>
</div> </div>
<div class="displayleft" style="margin: 10px 0"> <div class="displayleft" style="margin: 10rem 0">
<div style="width: 110px">营业时间:</div> <div style="width: 110rem">营业时间:</div>
<div style="color: #666; flex: 1; font-size: 12px"> <div style="color: #666; flex: 1; font-size: 12rem">
<div v-if="item.worktime" v-html="item.worktime"></div> <div v-if="item.worktime" v-html="item.worktime"></div>
</div> </div>
</div> </div>
<div class="displayleft" style="margin: 10px 0"> <div class="displayleft" style="margin: 10rem 0">
<div style="width: 110px">服务项目:</div> <div style="width: 110rem">服务项目:</div>
<div style="color: #666; flex: 1; font-size: 12px"> <div style="color: #666; flex: 1; font-size: 12rem">
<div v-if="item.shouliquanx" v-html="item.shouliquanx"></div> <div v-if="item.shouliquanx" v-html="item.shouliquanx"></div>
</div> </div>
</div> </div>
<!-- <div
class="displayleft"
style="margin: 10px 0"
v-if="item.worktime && item.worktime.remark"
>
<div style="width: 80px">
备<span style="opacity: 0">备注</span>注:
</div>
<div
style="color: #666; flex: 1; font-size: 12px"
v-html="item.worktime.remark"
></div>
</div> -->
</div> </div>
</template> </template>
<template v-else-if="networkInfo == 'noOne'"> <template v-else-if="networkInfo == 'noOne'">
<div style="text-align: left; font-size: 14px; color: #666"> <div style="text-align: left; font-size: 14rem; color: #666">
您好,您所选的区域未设立我司网点,请您选择其他区域 您好,您所选的区域未设立我司网点,请您选择其他区域
</div> </div>
</template> </template>
@ -115,16 +98,16 @@
<van-popup <van-popup
class="edit-address-popup-box" class="edit-address-popup-box"
v-model="isEditShow" v-model:show="isEditShow"
get-container="body" teleport="body"
position="bottom" position="bottom"
:duration="0.2" :duration="0.2"
> >
<!-- vant Picker 根据 绑定的columns数据,来渲染几级联动,这里我们使用的是二级联动 --> <!-- vant Picker 根据 绑定的columns数据,来渲染几级联动,这里我们使用的是二级联动 -->
<van-picker <van-picker
show-toolbar show-toolbar
value-key="name"
:columns="provinceCityColumns" :columns="provinceCityColumns"
:columns-field-names="{ text: 'name' }"
:item-height="40" :item-height="40"
@cancel="isEditShow = false" @cancel="isEditShow = false"
@confirm="onProvinceCityConfirm" @confirm="onProvinceCityConfirm"
@ -133,15 +116,15 @@
<van-popup <van-popup
class="edit-address-popup-box" class="edit-address-popup-box"
v-model="isEditShow1" v-model:show="isEditShow1"
get-container="body" teleport="body"
position="bottom" position="bottom"
:duration="0.2" :duration="0.2"
> >
<van-picker <van-picker
show-toolbar show-toolbar
value-key="name"
:columns="districtColumns" :columns="districtColumns"
:columns-field-names="{ text: 'name' }"
:item-height="40" :item-height="40"
@cancel="isEditShow1 = false" @cancel="isEditShow1 = false"
@confirm="onDistrictConfirm" @confirm="onDistrictConfirm"
@ -150,211 +133,171 @@
</div> </div>
</template> </template>
<script> <script setup>
import { pcaList } from '@/mock/network-code' import { ref, nextTick, onMounted } from 'vue'
import { mapState, mapActions } from 'pinia' import { storeToRefs } from 'pinia'
import { showNotify } from 'vant'
import _ from 'lodash'
import { useAppStore } from '@/store/app.js' import { useAppStore } from '@/store/app.js'
import { Toast, Loading, Dialog, Field, Notify, Button, Popup, Picker } from 'vant' import { Post } from '@/utils/https'
import { pcaList } from '@/mock/network-code'
export default { const props = defineProps({
name: 'editAddress1', disabled: { type: Boolean, default: false },
props: ['disabled', 'itemList'], itemList: { type: Object, default: () => ({}) },
components: {
[Loading.name]: Loading,
[Picker.name]: Picker,
[Popup.name]: Popup,
[Field.name]: Field,
[Button.name]: Button,
[Notify.name]: Notify,
},
data() {
return {
areaList: pcaList, //接口返回所有省市区数据
isEditShow: false, //vant Popup弹出框显示隐藏
isEditShow1: false,
columns: [],
provinceCityColumns: [],
districtColumns: [],
province: '',
city: '',
area: '',
selectedData: '', //选中的数据
selectedData1: '',
submitLoad: false,
submitDisabled: false,
networkInfo: null, // 具体营业网点信息
textInfo: { head: '', tips: '' }, // 提示信息
}
},
computed: {
...mapState(useAppStore, [
'userId',
'sendLoading',
'chatList',
'sessionId',
'source',
'mescrollContent',
'userInfo',
'pcaData',
]),
},
created() {
if (this.itemList.cmd != '$gmmdbdcx-da') {
if (this.itemList.msgText.split('||').length == 3) {
this.textInfo.head = this.itemList.msgText.split('||')[0]
this.textInfo.tips = this.itemList.msgText.split('||')[1].replace(/\\n/g, '<br>')
} else {
this.textInfo.head = this.itemList.msgText
}
}
this.provinceCityColumns = (
_.isNull(this.pcaData) || this.pcaData.length === 0 ? pcaList : this.pcaData
)
.filter(
(province) =>
!['西藏自治区', '香港特别行政区', '澳门特别行政区', '台湾省'].includes(
province.provinceName
)
)
.map((province) => ({
name: province.provinceName,
children: province.childrenList.map((city) => ({
name: city.provinceName,
})),
}))
this.submitDisabled = this.disabled
if (this.itemList.cmd == '$gmmdbdcx-da') {
// console.log("请求地址星系");
this.RequestInfo(this.itemList.msgText)
} else {
}
this.$nextTick(() => {
this.scrollTopBody()
})
if (!this.textInfo) {
this.$post('config/storeConfig')
.then((res) => {
console.log(res)
this.textInfo = res.data
})
.catch((error) => {
console.log(error)
}) })
const store = useAppStore()
const { sessionId, source, mescrollContent, pcaData } = storeToRefs(store)
const isEditShow = ref(false) // 省市选择弹窗
const isEditShow1 = ref(false) // 区选择弹窗
const provinceCityColumns = ref([])
const districtColumns = ref([])
const province = ref('')
const city = ref('')
const area = ref('')
const selectedData = ref('') // 选中的省市
const selectedData1 = ref('') // 选中的区
const submitLoad = ref(false)
const submitDisabled = ref(false)
const networkInfo = ref(null) // 具体营业网点信息
const textInfo = ref({ head: '', tips: '' }) // 提示信息
function sourcePcaList() {
return _.isNull(pcaData.value) || pcaData.value.length === 0 ? pcaList : pcaData.value
} }
},
mounted() {}, function scrollTopBody() {
methods: {
...mapActions(useAppStore, [
'set_chatList',
'del_chatList',
'set_sendLoading',
'set_manualService',
'set_pcaData',
]),
scrollTopBody() {
setTimeout(() => { setTimeout(() => {
// 滚动到底部 // 滚动到底部
try { try {
this.mescrollContent.scrollTop = this.mescrollContent.scrollHeight || 0 const el = mescrollContent.value
if (el) el.scrollTop = el.scrollHeight || 0
} catch (error) { } catch (error) {
console.log(error.message) console.log(error.message)
} }
}, 300) }, 300)
}, }
verification(type) {
if (!this.selectedData) { function verification() {
Notify('请选择省/市') if (!selectedData.value) {
showNotify('请选择省/市')
return false return false
} }
return true return true
}, }
//城市选择确认
onProvinceCityConfirm(value, itemIndex) { // 省市选择确认
const provinceIndex = itemIndex[0] function onProvinceCityConfirm({ selectedOptions }) {
const cityIndex = itemIndex[1] const prov = selectedOptions[0] || {}
const province = this.provinceCityColumns[provinceIndex] const cityOpt = selectedOptions[1] || {}
const city = province.children[cityIndex] province.value = prov.name || ''
this.province = province.name city.value = cityOpt.name || ''
this.city = city.name
// 关闭省市选择器 // 关闭省市选择器
this.isEditShow = false isEditShow.value = false
// 确保从正确的 `this.pcaList` 获取数据 // 从原始省市区数据里取该市下面的区
const originalProvince = ( const originalProvince = sourcePcaList().find((p) => p.provinceName === province.value)
_.isNull(this.pcaData) || this.pcaData.length === 0 ? pcaList : this.pcaData const originalCity = originalProvince?.childrenList?.find((c) => c.provinceName === city.value)
).find((p) => p.provinceName === this.province) districtColumns.value = (originalCity?.childrenList || []).map((district) => ({
const originalCity = originalProvince.childrenList.find((c) => c.provinceName === this.city)
// 准备市下面的区数据
this.districtColumns = originalCity.childrenList.map((district) => ({
name: district.provinceName, name: district.provinceName,
})) }))
this.selectedData = `${this.province + this.city}` selectedData.value = `${province.value}${city.value}`
this.selectedData1 = '' selectedData1.value = ''
}, }
onDistrictConfirm(value, itemIndex) { // 区选择确认
this.area = value.name function onDistrictConfirm({ selectedOptions }) {
area.value = selectedOptions[0]?.name || ''
// 关闭区选择器 // 关闭区选择器
this.isEditShow1 = false isEditShow1.value = false
// 更新选中的数据显示 // 更新选中的数据显示
this.selectedData1 = `${this.area}` selectedData1.value = `${area.value}`
}, }
submitInfo() { function submitInfo() {
console.log(this.chatList) if (!verification()) {
if (!this.verification()) {
return return
} }
let info = { const info = {
cmd: '$gmmdbdcx-da', cmd: '$gmmdbdcx-da',
// cmd: "YYWDBD",
customerServiceName: null, customerServiceName: null,
evaluation: null, evaluation: null,
fromFlag: 2, fromFlag: 2,
imgUrl: null, imgUrl: null,
intentId: '', intentId: '',
intents: Array(0), intents: [],
msgSource: 1, msgSource: 1,
msgText: this.province + ',' + this.city + ',' + this.area, msgText: `${province.value},${city.value},${area.value}`,
msgType: '01', msgType: '01',
qaId: this.itemList.qaId, qaId: props.itemList.qaId,
reason: null, reason: null,
reasonDesc: null, reasonDesc: null,
reqAndResType: '05', reqAndResType: '05',
seatNum: '洋洋机器人', seatNum: '洋洋机器人',
sessionId: this.sessionId, sessionId: sessionId.value,
source: this.source, source: source.value,
timestamp: new Date().getTime(), timestamp: Date.now(),
userId: 408, userId: 408,
userName: null, userName: null,
voiceData: null, voiceData: null,
voiceUrl: null, voiceUrl: null,
textInfo: this.textInfo, textInfo: textInfo.value,
}
store.setChatList(info)
scrollTopBody()
} }
this.set_chatList(info)
this.scrollTopBody() function RequestInfo(info) {
}, const infoArr = String(info || '').split(',')
RequestInfo(info) { const param = {
let infoArr = info.split(',')
let param = {
city: infoArr[1], city: infoArr[1],
town: infoArr[2], town: infoArr[2],
} }
this.$post('api/counterInfo', param) Post('api/counterInfo', param)
.then((res) => { .then((res) => {
console.log(res)
if (typeof res.data == 'object') { if (typeof res.data == 'object') {
this.networkInfo = res.data networkInfo.value = res.data
} else { } else {
this.networkInfo = 'noOne' networkInfo.value = 'noOne'
} }
this.scrollTopBody() scrollTopBody()
}) })
.catch((error) => { .catch((error) => {
console.log(error) console.log(error)
}) })
},
},
} }
onMounted(() => {
if (props.itemList.cmd != '$gmmdbdcx-da') {
const msgText = String(props.itemList.msgText ?? '')
const parts = msgText.split('||')
if (parts.length == 3) {
textInfo.value.head = parts[0]
textInfo.value.tips = parts[1].replace(/\\n/g, '<br>')
} else {
textInfo.value.head = msgText
}
}
provinceCityColumns.value = sourcePcaList()
.filter(
(prov) =>
!['西藏自治区', '香港特别行政区', '澳门特别行政区', '台湾省'].includes(prov.provinceName),
)
.map((prov) => ({
name: prov.provinceName,
children: prov.childrenList.map((cityItem) => ({
name: cityItem.provinceName,
})),
}))
submitDisabled.value = props.disabled
if (props.itemList.cmd == '$gmmdbdcx-da') {
RequestInfo(props.itemList.msgText)
}
nextTick(() => scrollTopBody())
})
</script> </script>
<style scoped> <style scoped>
@ -363,10 +306,11 @@ export default {
/* align-items: center; */ /* align-items: center; */
justify-content: flex-start; justify-content: flex-start;
} }
.edit-address-tips-hd { .edit-address-tips-hd {
font-family: NotoSansHans-Regular; font-family: NotoSansHans-Regular;
font-size: 12px; font-size: 12rem;
line-height: 15px; line-height: 15rem;
font-weight: 400; font-weight: 400;
color: #0047e1; color: #0047e1;
word-wrap: break-word; word-wrap: break-word;
@ -375,10 +319,11 @@ export default {
-webkit-user-select: text; -webkit-user-select: text;
user-select: text; user-select: text;
} }
.edit-address-title-hd { .edit-address-title-hd {
font-family: NotoSansHans-Regular; font-family: NotoSansHans-Regular;
font-size: 14px; font-size: 14rem;
line-height: 21px; line-height: 21rem;
font-weight: 700; font-weight: 700;
color: #333333; color: #333333;
word-wrap: break-word; word-wrap: break-word;
@ -386,19 +331,19 @@ export default {
overflow: hidden; overflow: hidden;
-webkit-user-select: text; -webkit-user-select: text;
user-select: text; user-select: text;
padding-bottom: 15px; padding-bottom: 15rem;
} }
.edit-address-edit-box .van-cell { .edit-address-edit-box .van-cell {
padding: 10px 0; padding: 10rem 0;
} }
.edit-address-edit-box .van-cell:not(:last-child)::after { .edit-address-edit-box .van-cell:not(:last-child)::after {
left: 0; left: 0;
} }
.edit-address-edit-box :deep() .van-field__label.edit-box-cell { .edit-address-edit-box :deep(.van-field__label.edit-box-cell) {
width: 75px; width: 75rem;
} }
.code-btn.code-btn-disabled { .code-btn.code-btn-disabled {
@ -409,18 +354,19 @@ export default {
} }
.edit-box-checkbox-item { .edit-box-checkbox-item {
padding: 20px 0 0 0; padding: 20rem 0 0 0;
display: inline-block; display: inline-block;
} }
.edit-box-checkbox-item :deep() .van-checkbox__label { .edit-box-checkbox-item :deep(.van-checkbox__label) {
margin-top: 2px; margin-top: 2rem;
} }
.edit-address-popup-box { .edit-address-popup-box {
width: 100%; width: 100%;
} }
.edit-address-box .van-address-edit-btn { .edit-address-box .van-address-edit-btn {
padding: 30px 0 10px 0; padding: 30rem 0 10rem 0;
} }
</style> </style>

Loading…
Cancel
Save