Commit 90700245 by liimin

Merge branch 'feature_v1.1.0' of http://192.168.3.233:8090/glsx/gl_tape into feature_v1.1.0

2 parents 5d22652c 63d0b6d4
......@@ -13,10 +13,10 @@ module.exports = {
// 与后端约定的token字段名
TOKEN_NAME: 'glsk-oss',
// PROTOCAL: 'http',
// SERVER: 'app-admin-server.test.glsx.com.cn',
// SERVER: 'app-admin-server.test.glsx.com.cn',
// SOCKET_PORT: '9081',
// HTTP_PORT: '3000',
HTTP_SERVER:'app-admin-server.test.glsx.com.cn',
SOCKET_SERVER:'app-admin-server.test.glsx.com.cn',
FILE_UPLOAD_URL: 'file/upload',
HTTP_SERVER: 'http://app-admin-server.test.glsx.com.cn',
SOCKET_SERVER: 'http://app-admin-server.test.glsx.com.cn',
FILE_UPLOAD_URL: 'file/upload'
}
......@@ -2,7 +2,7 @@
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "1.9.1",
"versionName" : "2.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-10-31 15:00:45
* @LastEditTime: 2024-11-05 16:49:39
* @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -20,27 +20,28 @@ const AUDIO_STATUS = {
ABNORMAL: 'abnormal' //40分钟未触碰平板,断开录音,不提交记录
}
const audioTime = 10 * 60 * 1000
let timer_interval = null
import { mapMutations, mapState } from 'vuex'
import utils from '@/utils/utils.js'
export default {
data() {
return {
voicePath: '',
timer: null,
times: 0,
timeout: 240,
reaction: 1
}
},
async mounted() {
uni.$logger.local.info(`进入接待首页!`)
this.handleSave(false)
// 获取当前页面栈数组
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const route = currentPage.route
const url = ['pages/equity/index', 'pages/boutique/index']
if (url.includes(route)) return
this.initTime()
// const pages = getCurrentPages()
// const currentPage = pages[pages.length - 1]
// const route = currentPage.route
// const url = ['pages/equity/index', 'pages/boutique/index']
// if (url.includes(route)) return
// this.initTime()
},
watch: {
/**
......@@ -89,9 +90,7 @@ export default {
this.$refs.tipBox?.close()
},
closeAudio() {
this.times = 0
clearInterval(this.timer)
this.timer = null
this.endWatchClick()
this.stopAudio(AUDIO_STATUS.ABNORMAL)
this.setReceptionStatus(0)
this.setAudioInfo({ endReasonType: 1 })
......@@ -168,7 +167,7 @@ export default {
this.initTime()
this.setAudioInfo({ audioList: [], audioStatus: AUDIO_STATUS.START })
recorderManager.onStart(() => {
uni.$logger.local.info('开始录音')
uni.$logger.local.info('开启录音!')
//开始录音保持记录,1s延时是因为第一段录音结束时间的文件修改时间等于第二段开始的文件修改时间,加上1s延时,就不会这个问题
setTimeout(() => {
const params = this.getParams(this.$store.state.user.customerInfo, this.booksList, this.receptionStatus)
......@@ -181,14 +180,16 @@ export default {
numberOfChannels: 1
})
recorderManager.onStop(async res => {
uni.$logger.local.info('结束录音')
//第一段录音结束,还在接待中,则开启第二段录音
if (this.audioInfo.audioStatus == AUDIO_STATUS.START) {
uni.$logger.local.info('接待中,再次开启录音!')
uni.getRecorderManager().start({
duration: audioTime,
sampleRate: 16000,
numberOfChannels: 1
})
} else {
uni.$logger.local.info('断开录音!')
}
})
}, 300),
......@@ -263,7 +264,7 @@ export default {
* @returns {void}
*/
stopAudio: utils.throttle(async function (status) {
uni.$logger.local.info('结束接待')
uni.$logger.local.info('结束接待!')
// const result = await this.$permision.requestAndroidPermission(
// "android.permission.RECORD_AUDIO"
// );
......@@ -277,11 +278,13 @@ export default {
//如果是40分钟未触碰平板,只要断开录音即可
if (status == AUDIO_STATUS.ABNORMAL) {
this.setAudioInfo({ audioStatus: AUDIO_STATUS.ABNORMAL })
uni.$logger.local.info('40分钟未触碰平板,断开录音!')
recorderManager.stop()
return
}
//如果是40分钟未触碰平板后完成接待,需要保存记录
if (this.audioInfo.audioStatus == AUDIO_STATUS.ABNORMAL && status != true) {
uni.$logger.local.info('40分钟未触碰平板,保存记录!')
this.setAudioInfo({ audioStatus: AUDIO_STATUS.END })
this.handleSave()
return
......@@ -300,34 +303,38 @@ export default {
this.handleSave()
}
}, 3000)
this.times = 0
clearInterval(this.timer)
this.timer = null
this.endWatchClick()
if (status) {
uni.$logger.local.info('退出接待')
uni.$logger.local.info('退出接待,不保存记录!')
this.removeRecords()
}
recorderManager.stop()
}, 1500),
//监听点击事件
initTime() {
if (this.audioInfo.audioStatus != AUDIO_STATUS.START) return
this.timer = setInterval(() => {
// console.log(this.times);
if (timer_interval) {
this.endWatchClick()
}
timer_interval = setInterval(() => {
this.times++
console.log(this.times, 'this.times')
if (this.times >= this.timeout) {
//关闭录音
this.closeAudio()
clearInterval(this.timer)
}
}, 1000 * 10)
},
endWatchClick() {
console.log(timer_interval, 'endWatchClick')
if (timer_interval) clearInterval(timer_interval)
timer_interval = null
this.times = 0
},
handleTouchStart() {
this.times = 0
}
},
beforeCreate() {
clearInterval(this.timer)
this.timer = null
// this.endWatchClick && this.endWatchClick()
}
}
......@@ -8,7 +8,7 @@ export default {
return {
wv: null,
snapshot: null,
interval: 60 * 1,
interval: 60 * 5,
timer: null
}
},
......
......@@ -47,6 +47,7 @@ export default {
},
mounted () {
this.getListSelectAccount()
uni.$logger.local.info(`进入选择账号页面!`)
},
methods: {
getListSelectAccount (autoLogin = false) {
......@@ -89,10 +90,14 @@ export default {
},
async choiceAccountLogin () {
let { loginUserInfoList } = this,
id = null
id = null,
merchantName = null
console.log(loginUserInfoList,'loginUserInfoList')
loginUserInfoList.map(e => {
if (e.active) id = e.uuid
if (e.active) {
id = e.uuid
merchantName = e.merchantName
}
})
if (!id) {
......@@ -104,10 +109,10 @@ export default {
}
// 清空4s店数据
// app.globalData.storeListRange = []
this.selectAccountLogin(id)
this.selectAccountLogin(id,merchantName)
},
selectAccountLogin (id) {
uni.$logger.local.info(`选择账号登录`)
selectAccountLogin (id,merchantName) {
uni.$logger.local.info(`选择账号${merchantName}登录!`)
uni.showLoading({
mask: true
})
......@@ -119,7 +124,8 @@ export default {
title: '获取4S店列表失败',
icon: 'none',
})
}).catch(() => {
}).catch((err) => {
uni.$logger.local.error(`获取4S店列表失败${err}!`)
uni.hideLoading()
})
},
......
......@@ -44,6 +44,7 @@ export default {
},
methods: {
init (userInfo) {
uni.$logger.info(`进入选择4s店页面!`)
this.userInfo = userInfo
this.getSceneArr()
},
......@@ -87,7 +88,7 @@ export default {
})
},
chooseAccount (item) {
uni.$logger.info(`选择4s店`)
uni.$logger.info(`选择4s店${item.merchantName}!`)
uni.showLoading({
mask: true
})
......
......@@ -47,6 +47,7 @@ export default {
init (userInfo) {
this.userInfo = userInfo
this.getSceneArr()
uni.$logger.local.info(`进入选择场景页!`)
},
getSceneArr () {
uni.showLoading({
......@@ -68,7 +69,7 @@ export default {
},
// 选择场景
async selectScene ({ sceneType }, index) {
uni.$logger.local.info(`选择场景`)
uni.$logger.local.info(`选择场景${sceneType}!`)
let { sceneList, openSceneArr, userInfo } = this
try {
if (!openSceneArr.includes(sceneType) && !userInfo?.isSuper) return uni.showToast({
......@@ -105,6 +106,7 @@ export default {
}
},
async jump (userInfo, data) {
uni.$logger.local.info(`跳转进入首页!`)
try {
uni.hideLoading()
if (data) userInfo.loginRoleOnSelectMerchant = data?.loginRoleOnSelectMerchant
......@@ -128,7 +130,7 @@ export default {
url
})
} catch (error) {
uni.$logger.local.error(`选择场景后跳转异常:${error}`)
uni.$logger.local.error(`选择场景后跳转异常:${error}!`)
uni.hideLoading()
uni.showToast({
title: error,
......
......@@ -99,6 +99,7 @@ export default {
const { code, message } = await uni.$api.userApi.getSmsCode({ mobile });
uni.hideLoading();
if (code == '0') {
uni.$logger.local.info(`${mobile}发送验证码成功`)
uni.showToast({
title: '验证码已发送',
icon: 'none',
......@@ -106,6 +107,7 @@ export default {
this.countDown(60);
} else throw message || '发送验证码失败';
} catch (error) {
uni.$logger.local.info(`${mobile}发送验证码失败,失败原因:${error}`)
uni.hideLoading();
uni.showToast({
title: error,
......@@ -145,7 +147,7 @@ export default {
this.jump(data, noSignIn);
uni.$logger.local.info(`${mobile}登录`)
}
else
else {
uni.showModal({
title: '温馨提示',
content: message,
......@@ -153,7 +155,11 @@ export default {
confirmText: '知道了',
confirmColor: '#347BFF',
});
uni.$logger.local.info(`${mobile}登录失败,失败原因:${message}`)
}
} catch (error) {
uni.$logger.local.info(`${mobile}登录失败,失败原因:${error}`)
uni.hideLoading();
uni.showToast({
title: error,
......
......@@ -91,7 +91,7 @@ import FinishStep from '@/components/FinishStep.vue';
import { mapMutations } from "vuex";
import informationEntry from './components/informationEntry.vue'
import insurance from '@/components/Insurance/Insurance.vue'
import {receptionTrackMixin} from '@/mixin/index.js'
import { receptionTrackMixin } from '@/mixin/index.js'
export default {
components: {
ToolBox,
......@@ -152,10 +152,10 @@ export default {
const { channelType } = uni.$storage.get("userInfo")
return channelType == 2
},
isPreview(){
isPreview () {
return this.type == 'preview'
}
},
watch: {
watchStatus: {
......@@ -185,6 +185,7 @@ export default {
})
this.receptionTrackLeave()
this.$emit('update:id', e.id)
uni.$logger.local.info(`预览${e.title}`)
},
back () {
this.$refs?.toolRef?.hide()
......@@ -221,10 +222,11 @@ export default {
if (Math.abs(this.startY - touch.pageY) > 100) return
if (!scaleValueObject[id]) scaleValueObject[id] = 1
if (isDistanceSignificant && index != -1 && scaleValueObject[id] == 1 && !productModelStatus) {
const { nextId, modeName } = this.getNextId(index, toolList, startX, halfScreenWidth)
const { nextId, modeName, title } = this.getNextId(index, toolList, startX, halfScreenWidth)
this.modeName = modeName
this.receptionTrackLeave()
this.$emit('update:id', nextId)
uni.$logger.local.info(`预览${title}`)
setTimeout(() => {
this.modeName = ''
}, 500)
......@@ -234,25 +236,26 @@ export default {
}
},
getNextId (index, toolList, startX, halfScreenWidth) {
let nextId = '',
let nextItem = {},
modeName = ''
if (startX > halfScreenWidth) {
nextId = index === toolList.length - 1 ? toolList[0].id : toolList[index + 1].id;
nextItem = index === toolList.length - 1 ? toolList[0] : toolList[index + 1];
modeName = 'to-right'
} else {
nextId = index === 0 ? toolList[toolList.length - 1].id : toolList[index - 1].id;
nextItem = index === 0 ? toolList[toolList.length - 1] : toolList[index - 1];
modeName = 'to-left'
}
return {
nextId,
modeName
nextId: nextItem.id,
modeName,
title: nextItem.title
}
},
scale (e) {
let { id } = this
this.scaleValueObject[id] = e
},
},
};
......
<template>
<view>
<home-frame @preview="preview" @start="start" ref="home" :id="id" @openStep="openStep" @backHome="backHome" @changeTab="changeTab">
<view class="module-box" slot="module">
<home-frame
@preview="preview"
@start="start"
ref="home"
:id="id"
@openStep="openStep"
@backHome="backHome"
@changeTab="changeTab"
>
<view
class="module-box"
slot="module"
>
<template v-for="(i, index) in moduleList">
<view :key="index" :class="['item', i.class]" :style="i.style" @click="toDetail(i)" v-if="!i.hide">
<view
:key="index"
:class="['item', i.class]"
:style="i.style"
@click="toDetail(i)"
v-if="!i.hide"
>
<template v-if="i.showAlt">
<view class="item-text flex">{{ i.title }}</view>
</template>
<template v-else>
<image class="item-img" :src="i.thumbnail" mode="scaleToFill" @error="errorImg(index)" />
<image
class="item-img"
:src="i.thumbnail"
mode="scaleToFill"
@error="errorImg(index)"
/>
</template>
</view>
</template>
</view>
<template slot="detail">
<detail :id.sync="id" :media="moduleList" :type.sync="type" :toolList="toolList" @back="back" @done="done" ref="detail" />
<detail
:id.sync="id"
:media="moduleList"
:type.sync="type"
:toolList="toolList"
@back="back"
@done="done"
ref="detail"
/>
</template>
<template slot="content">
<!-- <novice-guide
......@@ -42,7 +72,7 @@ import HomeFrame from '@/components/HomeFrame/index.vue'
export default {
// mixins: [storge],
components: { HomeFrame, detail, NoviceGuide },
data() {
data () {
return {
moduleList: [],
toolList: [],
......@@ -54,12 +84,12 @@ export default {
}
},
computed: {
channelType() {
channelType () {
const { channelType } = uni.$storage.get('userInfo')
return channelType || 1 //默认问界
}
},
onBackPress(options) {
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
......@@ -69,12 +99,12 @@ export default {
// 其他情况允许正常返回
return false
},
onLoad() {
onLoad () {
this.setViewInfo()
this.getSoure()
this.get_Vehicle_Sales_Data()
},
onShow() {
onShow () {
const userInfo = uni.$storage.get('userInfo')
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm('userInfo')
......@@ -88,11 +118,11 @@ export default {
},
methods: {
...mapMutations('audio', ['setReceptionStatus']),
init() {
init () {
this.findPayInfo()
},
/**获取车型&销售数据 */
get_Vehicle_Sales_Data() {
get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get('userInfo'),
storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'),
......@@ -127,7 +157,7 @@ export default {
})
},
// 查询素材
async getSoure() {
async getSoure () {
/**比亚迪 */
if (this.channelType == 2) {
let { moduleList, toolList } = await uni.$api.systemApi.getBydMockData(true)
......@@ -184,11 +214,11 @@ export default {
}
}
},
errorImg(index) {
errorImg (index) {
this.moduleList[index].showAlt = true
},
async start() {
async start () {
if (this.recording) return
uni.showLoading({
mask: true
......@@ -211,22 +241,22 @@ export default {
uni.hideLoading()
}, 1e3)
},
toDetail(item) {
uni.$logger.local.info(`预览${item.title}`)
toDetail (item) {
this.chooseItem = item
this.$refs.home.previewRef.open()
},
cancel() {
cancel () {
this.$refs.home.previewRef.close()
},
preview() {
let { id } = this.chooseItem
preview () {
let { id, title } = this.chooseItem
this.type = 'preview'
this.id = id
uni.$logger.local.info(`预览${title}`)
this.cancel()
},
// 完成接待
done(e) {
done (e) {
this.$refs.home.finishRef.close()
if (this.recording) this.$refs.home.stopAudio()
this.recording = false
......@@ -238,14 +268,14 @@ export default {
this.$store.dispatch('clearReceptionTrack')
}, 1500)
},
back() {
back () {
const detailRef = this.$refs.detail
if (detailRef.showPayPage) return (detailRef.showPayPage = false)
if (!this.id) return uni.navigateBack()
if (this.type != 'preview') return this.$refs.home.finishRef.open()
this.backHome()
},
backHome() {
backHome () {
if (this.recording) this.$refs.home.stopAudio(true)
this.$refs.home.finishRef.close()
this.id = ''
......@@ -254,23 +284,23 @@ export default {
this.init()
this.recording = false
},
nextStep() {
nextStep () {
let { id } = this.moduleList[0]
this.type = 'preview'
this.id = id
},
clearHistory() {
clearHistory () {
this.$store.dispatch('clearCustomerInfo')
this.$store.dispatch('clearHistory')
this.$refs.home.setBooks([])
this.$store.dispatch('clearReceptionTrack')
},
openStep() {
openStep () {
this.$refs.home.finishRef.close()
this.$refs.detail.open()
},
// 查询门店支付配置
async findPayInfo() {
async findPayInfo () {
const { shopMerchantId } = uni.$storage.get('userInfo')
const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId
......@@ -294,13 +324,13 @@ export default {
})
this.$store.dispatch('setPaymentType', paymentType)
},
changeTab(index) {
changeTab (index) {
this.tabIndex = index
if (index == 0) this.init()
},
/**按序加载车型 */
async getCarBrandsList(carBrandList, index) {
async getCarBrandsList (carBrandList, index) {
const item = carBrandList[index]
if (!item) return
const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
......@@ -317,7 +347,7 @@ export default {
}
},
/**素材内容 */
setViewInfo(_moduleList, _toolList) {
setViewInfo (_moduleList, _toolList) {
if (_moduleList && _toolList) {
this.moduleList = _moduleList
this.toolList = _toolList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!