128 lines
2.8 KiB
Vue
128 lines
2.8 KiB
Vue
<template>
|
|
<view class="customer-service-page">
|
|
<TopSafe />
|
|
<view class="customer-service-nav">
|
|
<button class="nav-back" aria-label="返回" @click="goBack">
|
|
<u-icon name="arrow-left" size="25" color="#2f3037" />
|
|
</button>
|
|
<text class="nav-title">全媒体智能客服</text>
|
|
<view class="nav-placeholder" />
|
|
</view>
|
|
<button class="history-entry" @click="showHistory">点击查询聊天记录</button>
|
|
<view class="customer-service-body">
|
|
<hashmall-customer-service v-if="optionsReady" ref="customerService" :entry-options="entryOptions" />
|
|
</view>
|
|
<qiaobao-assistant page-key="pages/rwa_package/kefu/kefu" title="智能客服" />
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import TopSafe from '@/components/common/top-safe.nvue'
|
|
import HashmallCustomerService from '@/uni_modules/hashmall-customer-service/components/hashmall-customer-service/hashmall-customer-service.vue'
|
|
|
|
export default {
|
|
components: {
|
|
TopSafe,
|
|
HashmallCustomerService
|
|
},
|
|
data() {
|
|
return {
|
|
entryOptions: {},
|
|
optionsReady: false
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
this.entryOptions = options || {}
|
|
this.optionsReady = true
|
|
},
|
|
onShow() {
|
|
this.$nextTick(() => {
|
|
if (this.$refs.customerService) this.$refs.customerService.resume()
|
|
})
|
|
},
|
|
onHide() {
|
|
if (this.$refs.customerService) this.$refs.customerService.suspend()
|
|
},
|
|
onUnload() {
|
|
if (this.$refs.customerService) this.$refs.customerService.suspend()
|
|
},
|
|
methods: {
|
|
goBack() {
|
|
uni.navigateBack()
|
|
},
|
|
showHistory() {
|
|
if (this.$refs.customerService) this.$refs.customerService.showHistory()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.customer-service-page {
|
|
display: flex;
|
|
width: 100%;
|
|
height: 100vh;
|
|
height: 100dvh;
|
|
box-sizing: border-box;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
background: #f4f5fa;
|
|
}
|
|
|
|
.customer-service-nav {
|
|
display: flex;
|
|
height: 92rpx;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 28rpx;
|
|
background: #f4f5fa;
|
|
}
|
|
|
|
.nav-back,
|
|
.nav-placeholder {
|
|
width: 72rpx;
|
|
height: 72rpx;
|
|
flex: 0 0 72rpx;
|
|
}
|
|
|
|
.nav-back {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
margin: 0;
|
|
padding: 0;
|
|
background: transparent;
|
|
}
|
|
|
|
.nav-title {
|
|
color: #101116;
|
|
font-size: 38rpx;
|
|
font-weight: 500;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.history-entry {
|
|
width: 100%;
|
|
height: 72rpx;
|
|
margin: 0;
|
|
padding: 0;
|
|
background: transparent;
|
|
color: #a2a3aa;
|
|
font-size: 27rpx;
|
|
font-weight: 400;
|
|
line-height: 72rpx;
|
|
}
|
|
|
|
.nav-back::after,
|
|
.history-entry::after {
|
|
border: 0;
|
|
}
|
|
|
|
.customer-service-body {
|
|
width: 100%;
|
|
min-height: 0;
|
|
flex: 1;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|