Commit 30defc06 by 前端

Merge branch 'SAAS+V4.55.0' into 'master'

上线合并

See merge request !26
2 parents cf0872c4 d27dee6e
Showing 160 changed files with 3180 additions and 262 deletions
...@@ -106,5 +106,13 @@ module.exports = { ...@@ -106,5 +106,13 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
},
// 案例视频中心埋点
caseVideoCenter(data) {
return http.post({
method: 'dj.api.boutique.reception.material.point.insert',
projectName: 'boutique',
...data
})
} }
} }
...@@ -369,5 +369,77 @@ module.exports = { ...@@ -369,5 +369,77 @@ module.exports = {
projectName: 'pad', projectName: 'pad',
...data ...data
}) })
},
// 服务中心-消息汇总
getMessageSummary(data) {
return http.post({
method: 'dj.pad.api.page.script.sop.message.summary.list',
projectName: 'pad',
...data
})
},
// 课程消息提醒列表
getCourseList(data) {
return http.post({
method: 'dj.pad.api.page.script.sop.message.course.list',
projectName: 'pad',
...data
})
},
// 学习中心-学习看板
getStudyBoard(data) {
return http.post({
method: 'dj.pad.api.staff.study.bulletin.board',
projectName: 'pad',
...data
})
},
// 学习中心-课程任务分页
getCourseTaskPage(data) {
return http.post({
method: 'dj.pad.api.staff.study.course.task.page',
projectName: 'pad',
...data
})
},
// 学习中心-短课程详情
getShortCourseDetail(data) {
return http.post({
method: 'dj.pad.api.staff.study.short.course.detail',
projectName: 'pad',
...data
})
},
// 学习中心-长课程详情
getLongCourseDetail(data) {
return http.post({
method: 'dj.pad.api.staff.study.long.course.detail',
projectName: 'pad',
...data
})
},
// 获取智能体
getAiAgentList(data) {
return http.post({
method: 'dj.pad.api.aiagent.get.special.agent',
projectName: 'pad',
...data
})
},
// 学习任务确认消息弹窗
getStudyTaskConfirm(data) {
return http.post({
method: 'dj.pad.api.staff.message.confirm',
projectName: 'pad',
...data
})
},
// 学习中心-员工学习中心权限授权校验
getStudyCenterPermission(data) {
return http.post({
method: 'dj.pad.api.staff.study.center.access.auth.verify',
projectName: 'pad',
...data
})
} }
} }
...@@ -5,6 +5,7 @@ import boutiqueApi from './boutique' ...@@ -5,6 +5,7 @@ import boutiqueApi from './boutique'
import customerApi from './customerApi' import customerApi from './customerApi'
import pointApi from './point' import pointApi from './point'
import receptionApi from './receptionApi' import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi'
module.exports = { module.exports = {
commonApi, commonApi,
systemApi, systemApi,
...@@ -12,5 +13,6 @@ module.exports = { ...@@ -12,5 +13,6 @@ module.exports = {
boutiqueApi, boutiqueApi,
customerApi, customerApi,
pointApi, pointApi,
receptionApi receptionApi,
sceneMarketApi
} }
...@@ -34,7 +34,16 @@ module.exports = { ...@@ -34,7 +34,16 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
} },
/**业绩看板 */
getMerchantPerformance(data){
return http.post({
method: 'dj.api.car.boutique.inspection.findMerchantPerformance',
projectName: 'boutique',
...data
})
},
} }
import http from '../request/http'
module.exports = {
/**查询所有业务场景 */
getSceneMarketMaterialMenu (data = {}) {
return http.post({
method: 'dj.api.carboutique.material.scenemarket.findAllLevel',
projectName: 'boutique',
...data
})
}, /**根据场景查询素材列表 */
getSceneMarketMaterialList (data = {}) {
return http.post({
method: 'dj.api.carboutique.material.scenemarket.findByOneCode',
projectName: 'boutique',
...data
})
},
/**获取智能体 */
getAiagent (data = {}) {
return http.post({
method: 'dj.pad.api.aiagent.get.special.agent',
projectName: 'pad',
...data
})
}
}
\ No newline at end of file \ No newline at end of file
...@@ -44,7 +44,6 @@ const getMockData = async (immediate = false) => { ...@@ -44,7 +44,6 @@ const getMockData = async (immediate = false) => {
} }
} }
} catch (error) { } catch (error) {
console.log(error)
if (serverConfig.mockTimer[key]) clearInterval(serverConfig.mockTimer[key]) if (serverConfig.mockTimer[key]) clearInterval(serverConfig.mockTimer[key])
serverConfig.mockRequestCount = null serverConfig.mockRequestCount = null
return Promise.reject(error) return Promise.reject(error)
...@@ -111,7 +110,6 @@ const getBoutiqueMockData = async (immediate = false) => { ...@@ -111,7 +110,6 @@ const getBoutiqueMockData = async (immediate = false) => {
} }
} }
} catch (error) { } catch (error) {
console.log(error)
if (boutiqueServerConfig.mockTimer[key]) clearInterval(boutiqueServerConfig.mockTimer[key]) if (boutiqueServerConfig.mockTimer[key]) clearInterval(boutiqueServerConfig.mockTimer[key])
boutiqueServerConfig.mockRequestCount = null boutiqueServerConfig.mockRequestCount = null
return Promise.reject(error) return Promise.reject(error)
...@@ -164,7 +162,9 @@ const getSoureData = async (shopMerchantId, sceneType, params = {}) => { ...@@ -164,7 +162,9 @@ const getSoureData = async (shopMerchantId, sceneType, params = {}) => {
showAlt: false, showAlt: false,
componentName: 'CaseCenter', componentName: 'CaseCenter',
receptionpriproCusCaseList: i.receptionpriproCusCaseList, receptionpriproCusCaseList: i.receptionpriproCusCaseList,
hide: true hide: true,
detailTitle: i.productName,
thumbnail: 'https://img02.glsx.com.cn/weapp/resource/app-tape/common/qsyw.webp'
} }
}) })
materialInfoList = materialInfoList.concat(moduleOtherList) materialInfoList = materialInfoList.concat(moduleOtherList)
...@@ -177,11 +177,11 @@ const getSoureData = async (shopMerchantId, sceneType, params = {}) => { ...@@ -177,11 +177,11 @@ const getSoureData = async (shopMerchantId, sceneType, params = {}) => {
id: res.id id: res.id
}) })
return Promise.resolve(data) return Promise.resolve(data)
} } else throw false
} } else throw false
} catch (error) { } catch (error) {
console.log(error) uni.hideLoading()
uni.showToast({ if (error) uni.showToast({
title: error, title: error,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type

2.45 MB | W: | H:

2.49 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin

120 KB | W: | H:

50.3 KB | W: | H:

assets/spritesmith/customer-1.png
assets/spritesmith/customer-1.png
assets/spritesmith/customer-1.png
assets/spritesmith/customer-1.png
  • 2-up
  • Swipe
  • Onion skin

165 KB | W: | H:

121 KB | W: | H:

assets/spritesmith/customer-2.png
assets/spritesmith/customer-2.png
assets/spritesmith/customer-2.png
assets/spritesmith/customer-2.png
  • 2-up
  • Swipe
  • Onion skin

15.8 KB | W: | H:

223 Bytes | W: | H:

assets/spritesmith/customer-add.png
assets/spritesmith/customer-add.png
assets/spritesmith/customer-add.png
assets/spritesmith/customer-add.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -123,6 +123,7 @@ export default { ...@@ -123,6 +123,7 @@ export default {
carBrandList = []; carBrandList = [];
list?.map((e) => { list?.map((e) => {
e.childs.map((i) => { e.childs.map((i) => {
i.brandName = e.name
i.brandId = e.id; i.brandId = e.id;
carBrandList.push(i); carBrandList.push(i);
}); });
...@@ -199,7 +200,12 @@ export default { ...@@ -199,7 +200,12 @@ export default {
handleSelect (item) { handleSelect (item) {
const customerInfo = this.$store.state.user.customerInfo, const customerInfo = this.$store.state.user.customerInfo,
{ selectItem, linkage } = this { selectItem, linkage } = this
customerInfo.carBrand = selectItem.carChildsBrandName Object.assign(customerInfo, {
carBrand: selectItem.carChildsBrandName,
carBrandId: selectItem.carChildsBrandId,
oneCarBrand: selectItem.carBrand,
oneCarBrandId: selectItem.carBrandId
})
if (linkage) { if (linkage) {
this.$store.dispatch('setCustomerInfo', customerInfo) this.$store.dispatch('setCustomerInfo', customerInfo)
this.$store.dispatch('updateViewKey') this.$store.dispatch('updateViewKey')
......
<template> <template>
<uni-popup <uni-popup
ref="customer" ref="centerPopupRef"
type="center" type="center"
:is-mask-click="false" :is-mask-click="false"
animation animation
class="customerPopup" class="center-popup"
> >
<view class="box"> <view class="box">
<view class="title flex"> <view class="title flex">
<view class="text">请选择当前洽谈的客户类型</view> <view class="text">{{title}}</view>
<view <view
class="icon-close-box flex" class="icon-close-box flex"
@click="close" @click="close"
...@@ -16,19 +16,25 @@ ...@@ -16,19 +16,25 @@
<uni-icons <uni-icons
class="icon-close" class="icon-close"
type="closeempty" type="closeempty"
:size="16" :size="20"
color="#1A1A1A" color="#1A1A1A"
></uni-icons> ></uni-icons>
</view> </view>
</view> </view>
<view class="content flex"> <view class="content flex">
<template v-for="(i,index) in typeList"> <template v-for="(i,index) in list">
<view <view
class="item flex" class="item flex"
:key="index" :key="index"
@click="choose(index)" @click="choose(index)"
> >
<view :class="['sprite-icon',i.icon]"></view> <template v-if="tag && i.id == id">
<view class="tag flex">{{tag}}</view>
</template>
<view
:class="['sprite-icon',i.icon]"
:style="{zoom: i.zoom || 1}"
></view>
<view class="item-title">{{i.title}}</view> <view class="item-title">{{i.title}}</view>
<text class="item-describe">{{i.describe}}</text> <text class="item-describe">{{i.describe}}</text>
</view> </view>
...@@ -41,35 +47,31 @@ ...@@ -41,35 +47,31 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: 'CustomerType', name: 'CenterPopup',
props: {
list: Array,
title: String,
tag: String,
id: [Number, String]
},
data () { data () {
return { return {
typeList: [
{
title: '回店客户',
describe: '客户已领精品券且已上牌完成\n交付安排客户当日回店提车',
icon: 'icon-customer-1'
}, {
title: '现场客户',
describe: '客户未领取精品券\n首次到店',
icon: 'icon-customer-2'
}
]
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
open () { open () {
this.$refs.customer.open(); this.$refs.centerPopupRef.open();
}, },
close () { close () {
this.$refs.customer.close(); this.$refs.centerPopupRef.close();
this.$emit('cancel') this.$emit('cancel')
}, },
choose: uni.$throttle(function (index) { choose: uni.$throttle(function (index) {
this.$emit('choose', index) this.$emit('choose', index)
this.$refs.customer.close(); this.$refs.centerPopupRef.close();
}, 200) }, 200)
} }
...@@ -77,18 +79,18 @@ export default { ...@@ -77,18 +79,18 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.customerPopup { .center-popup {
z-index: 99 !important; z-index: 99 !important;
} }
.box { .box {
width: toRpx(1920); width: toRpx(1400);
height: toRpx(1120); height: toRpx(928);
background: #ffffff; background: #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
.title { .title {
width: 100%; width: 100%;
height: toRpx(160); height: toRpx(160);
background-image: url("@/assets/images/boutique/customer-type-bg.webp"); background: url('@/assets/images/boutique/customer-type-bg.webp') no-repeat;
background-size: 100%; background-size: 100%;
position: relative; position: relative;
.text { .text {
...@@ -104,6 +106,7 @@ export default { ...@@ -104,6 +106,7 @@ export default {
height: 100%; height: 100%;
margin-left: auto; margin-left: auto;
padding: 0 toRpx(48); padding: 0 toRpx(48);
font-weight: 700;
} }
} }
.content { .content {
...@@ -119,25 +122,39 @@ export default { ...@@ -119,25 +122,39 @@ export default {
border-radius: toRpx(48); border-radius: toRpx(48);
flex-direction: column; flex-direction: column;
box-sizing: border-box; box-sizing: border-box;
padding-top: toRpx(112); // padding-top: toRpx(92);
justify-content: center;
position: relative; position: relative;
&::before, overflow: hidden;
&::after { .tag {
content: "";
position: absolute; position: absolute;
width: toRpx(192);
height: toRpx(72);
border-radius: 0 0 toRpx(48) 0;
background: #4673ff1a;
left: 0; left: 0;
width: 100%;
background: #edf5ff;
filter: blur(toRpx(40));
}
&::before {
top: 0; top: 0;
height: toRpx(62); color: #4673ff;
} font-size: toRpx(28);
&::after { justify-content: center;
bottom: 0;
height: toRpx(126);
} }
// &::before,
// &::after {
// content: '';
// position: absolute;
// left: 0;
// width: 100%;
// background: #edf5ff;
// filter: blur(toRpx(40));
// }
// &::before {
// top: 0;
// height: toRpx(62);
// }
// &::after {
// bottom: 0;
// height: toRpx(126);
// }
&-title { &-title {
font-weight: 500; font-weight: 500;
font-size: toRpx(40); font-size: toRpx(40);
......
...@@ -136,7 +136,6 @@ export default { ...@@ -136,7 +136,6 @@ export default {
} }
}, },
mounted(options) { mounted(options) {
console.log('Calendar.adsfads')
this.init() this.init()
}, },
methods: { methods: {
...@@ -185,9 +184,8 @@ export default { ...@@ -185,9 +184,8 @@ export default {
const params = this.getParams() const params = this.getParams()
const res = await uni.$api.pointApi.newCalendar(params) const res = await uni.$api.pointApi.newCalendar(params)
if (res) { if (res) {
console.log(this.dates, 'dates')
this.dates.forEach(item => { this.dates.forEach(item => {
const clockData = res.clockInDateList.find(i => i.day == item) const clockData = res?.clockInDateList?.find(i => i.day == item)
if (clockData && (this.currentInfo.month < this.defaultMonth || clockData.day < this.currentInfo.day)) { if (clockData && (this.currentInfo.month < this.defaultMonth || clockData.day < this.currentInfo.day)) {
if (clockData.dayState == 4) clockData.isDefault = true if (clockData.dayState == 4) clockData.isDefault = true
clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null
...@@ -202,7 +200,6 @@ export default { ...@@ -202,7 +200,6 @@ export default {
}) })
} }
}) })
console.log(this.clockInDateList)
} }
}, },
/** 申诉记录 */ /** 申诉记录 */
...@@ -210,7 +207,6 @@ export default { ...@@ -210,7 +207,6 @@ export default {
const params = this.getParams() const params = this.getParams()
params.pageSize = 40 params.pageSize = 40
const res = await uni.$api.pointApi.getAppealList(params) const res = await uni.$api.pointApi.getAppealList(params)
console.log(res)
this.recordList = res.list this.recordList = res.list
}, },
// 切换月份 // 切换月份
......
...@@ -63,7 +63,8 @@ ...@@ -63,7 +63,8 @@
</view> </view>
<view class="input-box num-second" v-if="form.goodsTypeList.length"> <view class="input-box num-second" v-if="form.goodsTypeList.length">
<template v-for="(item, index) in form.goodsTypeList"> <template v-for="(item, index) in form.goodsTypeList">
<view class="input-item" :key="index"> <block :key="index">
<view class="input-item" >
<view :class="{ 'label-mark': true, 'label-m': !item.showName }">{{ item.showName }}</view> <view :class="{ 'label-mark': true, 'label-m': !item.showName }">{{ item.showName }}</view>
<view class="input-label">订单数</view> <view class="input-label">订单数</view>
<input type="number" class="input" maxlength="3" @input="item.subOrderCount = item.subOrderCount.replace(/\D/g, '')" placeholder="请输入" v-model="item.subOrderCount" /> <input type="number" class="input" maxlength="3" @input="item.subOrderCount = item.subOrderCount.replace(/\D/g, '')" placeholder="请输入" v-model="item.subOrderCount" />
...@@ -72,6 +73,7 @@ ...@@ -72,6 +73,7 @@
<view class="input-label">产值</view> <view class="input-label">产值</view>
<input type="number" class="input" maxlength="7" @input="item.totalPrice = item.totalPrice.replace(/\D/g, '')" placeholder="请输入" v-model="item.totalPrice" /> <input type="number" class="input" maxlength="7" @input="item.totalPrice = item.totalPrice.replace(/\D/g, '')" placeholder="请输入" v-model="item.totalPrice" />
</view> </view>
</block>
</template> </template>
</view> </view>
</view> </view>
...@@ -117,7 +119,7 @@ ...@@ -117,7 +119,7 @@
</view> </view>
<view class="ratio-panel"> <view class="ratio-panel">
<view class="ratio-item flex-between" v-for="(output, i) in salaryDetail.goodsTypeList"> <view class="ratio-item flex-between" v-for="(output, i) in salaryDetail.goodsTypeList" :key="i">
<view class="ratio-label">{{ output.showName }}提成比例</view> <view class="ratio-label">{{ output.showName }}提成比例</view>
<view class="ratio-num">{{ output.outputCommissionRatio }}%</view> <view class="ratio-num">{{ output.outputCommissionRatio }}%</view>
</view> </view>
...@@ -147,7 +149,7 @@ ...@@ -147,7 +149,7 @@
</view> </view>
<view class="value-detail"> <view class="value-detail">
<template v-for="(output, i) in outputDetail"> <template v-for="(output, i) in outputDetail">
<view class="detail-item"> <view class="detail-item" :key="i">
<view class="detail-label">{{ output.label }}</view> <view class="detail-label">{{ output.label }}</view>
<view class="detail-num">{{ getOutput(output, item) }}{{ output.unit }}</view> <view class="detail-num">{{ getOutput(output, item) }}{{ output.unit }}</view>
</view> </view>
......
...@@ -140,9 +140,6 @@ export default { ...@@ -140,9 +140,6 @@ export default {
console.log(error) console.log(error)
this.back() this.back()
} }
// if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
}, },
back() { back() {
uni.navigateTo({ uni.navigateTo({
...@@ -175,22 +172,14 @@ export default { ...@@ -175,22 +172,14 @@ export default {
const res = await uni.$api.commonApi.updateMessageStatus({ const res = await uni.$api.commonApi.updateMessageStatus({
idList idList
}) })
// this.backPage()
// if (res) {
// this.backPage()
// } else {
// console.log('接口返回结果为空,可能存在问题')
// }
} catch (error) { } catch (error) {
// this.backPage()
console.error('更新消息状态时出现错误:', error) console.error('更新消息状态时出现错误:', error)
} finally { } finally {
this.isProcessing = false; // 处理完成,将标志位设为 false this.isProcessing = false; // 处理完成,将标志位设为 false
this.backPage() this.backPage()
} }
} }
}, }
} }
} }
</script> </script>
......
<template>
<view>
<ServiceList :messageList="messageList" :topListProp="topList" @handleClick="handleClick" />
</view>
</template>
<script>
import ServiceList from '../../../../pages/common/serviceDetail/components/ServiceList.vue';
import { getMessageSummary } from '../../../../api/module/common'
export default {
name: 'MessageIndex',
components: {
ServiceList
},
data() {
return {
topList: [],
messageList: []
}
},
created() {
uni.$on('messageBackHome', (topList) => {
this.topList = topList
this.getMessageSummary()
})
},
mounted() {
console.log('消息')
this.getMessageSummary()
},
methods: {
// 获取服务中心列表
async getMessageSummary() {
const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: userInfo.sceneType})
console.log(res, '===')
this.messageList = res
},
handleClick(item) {
const { moduleType } = item
uni.$track.add({eventCode: 'app_service_center'})
uni.navigateTo({
url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
})
}
}
}
</script>
<style scoped lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,11 @@ ...@@ -19,7 +19,11 @@
<template v-else-if="type=='system'"> <template v-else-if="type=='system'">
<image class="message-bg" :src="require('@//assets/images/common/system-bg.webp')"></image> <image class="message-bg" :src="require('@//assets/images/common/system-bg.webp')"></image>
<view class="text text-first study-title">系统消息</view> <view class="text text-first study-title">系统消息</view>
<view class="text study-text">您有新的消息【{{messageData.title}}】,请点击查看</view> <view class="text study-text">
您有新的消息【
{{ messageData.title && messageData.title.length > 8 ? messageData.title.slice(0, 8) + '...' : messageData.title }}
】,请点击查看
</view>
<view class="text study-text"></view> <view class="text study-text"></view>
<view class="btn study-btn" @click="jumpSystem">去查看</view> <view class="btn study-btn" @click="jumpSystem">去查看</view>
</template> </template>
...@@ -61,8 +65,16 @@ export default { ...@@ -61,8 +65,16 @@ export default {
this.close() this.close()
}, },
jumpSystem() { jumpSystem() {
this.getDetailById(this.messageData.ids[0]) try {
// this.getDetailById(51) this.getDetailById(this.messageData.businessIds[0])
} catch (e) {
uni.showToast({
title: '系统消息跳转失败',
icon: 'none'
})
this.close()
throw e
}
this.close() this.close()
}, },
async getDetailById(id) { async getDetailById(id) {
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</view> </view>
</template> </template>
<template v-if="nothing"> <template v-if="nothing">
<view class="end-text">到底了!</view> <view class="end-text">-已经到底了-</view>
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
......
<template>
<view class="customer-flow-box">
<view class="customer-flow-title">门店客流情况</view>
<view class="sprite-icon icon-customer-flow"></view>
<view class="deliveries flex">
累计交付数
<view class="num">{{formattedNumber('cumulativeDeliveryCount')}}</view>
</view>
<view class="touchpoints flex">
实际触客数
<view class="num">{{formattedNumber('actualContactCount')}}</view>
</view>
<view class="touchpoint-rate">
实际触客率
<view :class="['num',{'rate-color':dataShow && pageData.contactRate}]">{{formattedNumber('contactRate', '%')}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
pageData: {
type: Object,
default: () => { }
},
dataShow: {
type: Boolean,
default: true
}
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
formattedNumber (key, unit) {
let { dataShow, pageData } = this,
num = pageData[key]
if (unit && num) num += unit
if (!dataShow || !num) num = '--'
return num
}
}
}
</script>
<style scoped lang='scss'>
.customer-flow-box {
position: relative;
height: toRpx(422);
color: #333333;
.customer-flow-title {
font-size: toRpx(28);
font-weight: 500;
padding: toRpx(24) toRpx(32) 0;
}
.sprite-icon {
position: absolute;
top: 0;
left: 0;
zoom: 2;
}
.deliveries,
.touchpoints,
.touchpoint-rate {
position: absolute;
font-size: toRpx(20);
box-sizing: border-box;
flex-direction: column;
.num {
transition: all 0.15s;
}
}
.deliveries,
.touchpoints {
color: #ffffff;
width: toRpx(400);
height: toRpx(128);
left: toRpx(32);
.num {
font-size: toRpx(24);
font-weight: 500;
}
}
.deliveries {
top: toRpx(108);
padding-top: toRpx(54);
}
.touchpoints {
top: toRpx(236);
padding-top: toRpx(37);
}
.touchpoint-rate {
top: toRpx(208);
left: toRpx(424);
.num {
font-size: toRpx(28);
font-weight: 700;
}
.rate-color {
color: #4673ff;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -121,8 +121,8 @@ ...@@ -121,8 +121,8 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue' import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import CustomerTags from '../../CustomerTags.vue' import CustomerTags from './CustomerTags.vue'
import ReceptionSence from '../../ReceptionSence.vue' import ReceptionSence from './ReceptionSence.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/, const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{ default_customerForm = [{
label: '车主姓名', label: '车主姓名',
...@@ -374,7 +374,7 @@ export default { ...@@ -374,7 +374,7 @@ export default {
border-radius: toRpx(48); border-radius: toRpx(48);
backdrop-filter: blur(toRpx(8)); backdrop-filter: blur(toRpx(8));
pointer-events: auto; pointer-events: auto;
animation: show-info-box 0.25s forwards; animation: left-in 0.25s forwards;
.nav-bar { .nav-bar {
width: 100%; width: 100%;
height: toRpx(96); height: toRpx(96);
...@@ -476,27 +476,11 @@ export default { ...@@ -476,27 +476,11 @@ export default {
} }
} }
.backClass { .backClass {
animation: back 0.25s forwards; animation: left-out 0.25s forwards;
} }
.popup { .popup {
pointer-events: auto; pointer-events: auto;
} }
@keyframes show-info-box {
0% {
left: 100%;
}
100% {
left: toRpx(240);
}
}
@keyframes back {
0% {
left: toRpx(240);
}
100% {
left: 100%;
}
}
} }
.show-box { .show-box {
......
<template>
<view class="line-bar-box">
<view class="tabs">
<page-tabs
:list="tabList"
@changeTab="changeTab"
size="small"
/>
</view>
<view class="canvas">
<qiun-data-charts
type="bar"
:opts="opts"
:chartData="chartData"
:tooltipShow="false"
/>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import PageTabs from '@/components/PageTabs.vue'
const rateList = {
excellentStoreAvgDealRate: '优秀门店均值',
thisStoreDealRate: '本门店',
personalDealRate: '个人'
},
priceList = {
excellentStoreAvgDeal: '优秀门店均值',
thisStoreKdj: '本门店',
personalKdj: '个人'
}
export default {
components: {
PageTabs
},
props: {
pageData: {
type: Object,
default: () => { }
},
dataShow: {
type: Boolean,
default: true
},
sceneType: Number,
isHarmony: Boolean, // 是否为鸿蒙
bussinessType: Number
},
watch: {
dataShow: {
immediate: true,
handler (newval) {
this.getServerData()
}
}
},
name: '',
data () {
return {
tabIndex: 0,
tabList: ['本月交付成交率', '本月交付客单价'],
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['bar'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: Object.freeze({
fontColor: '#333',
fontSize: 12,
color: ["#2C66F7"],
padding: [20, 80, 0, 0],
enableScroll: false,
legend: {
show: false
},
xAxis: {
disabled: true,
gridColor: '#fff',
},
yAxis: {
axisLineColor: '#cfd4e3'
},
extra: {
bar: {
type: "group",
width: 6,
barColorList: [
['#389FFF', '#2C66F7'],
['#708DFF', '#6858F5'],
['#94CBFF', '#3283FB']
],
linearType: 'custom',
barBorderCircle: true,
}
}
})
}
},
mounted () {
},
methods: {
getServerData () {
let { dataShow, tabIndex, pageData, sceneType, isHarmony, bussinessType } = this
/**
* (sceneType 0: 2.1场景, 1:1.1场景) (bussinessType 1:延保, 3:权益)
* 2.1场景 鸿蒙---问界/鸿蒙 [本月交付客单价] 改成 [整车延保成交数]
* 2.1场景 非鸿蒙---选延保 [本月交付客单价] 改成 [整车延保成交数]
* 2.1场景 非鸿蒙---权益 [本月交付成交率] 改为 [广联权益渗透率]; [本月交付客单价] 改成 [广联权益成交数]
*/
if (sceneType == 0) {
if (isHarmony) {
this.tabList[1] = '整车延保成交数'
} else {
if (bussinessType == 1) this.tabList[1] = '整车延保成交数'
else this.tabList = ['广联权益渗透率', '广联权益成交数']
}
}
let list = [],
categories = [],
data = [],
defaultList = []
if (tabIndex == 0) Object.keys(rateList).map(key => {
list.push({
text: rateList[key],
value: pageData[key]
})
})
else Object.keys(priceList).map(key => {
list.push({
text: priceList[key],
value: pageData[key]
})
})
list.sort((a, b) => b.value - a.value)
list.map(e => {
categories.push(e.text)
data.push(e.value || 0)
defaultList.push(e.value == null)
})
let series = [{
defaultList,
hideData: !dataShow,
textSize: 14,
textColor: '#333',
data
}]
if (tabIndex == 0) series[0].afterUnit = '%'
if (sceneType == 1 && tabIndex == 1) series[0].beforeUnit = '¥' //轻改
this.chartData = {
categories,
series,
}
},
changeTab (index) {
this.tabIndex = index
this.getServerData()
}
}
}
</script>
<style scoped lang="scss">
.line-bar-box {
height: toRpx(388);
box-sizing: border-box;
padding: toRpx(24);
.tabs {
width: toRpx(544);
height: toRpx(64);
}
.canvas {
height: toRpx(260);
}
}
</style>
<template>
<view class="output-value-box">
<view class="output-value-title">本月产值</view>
<view class="output-value">
<view class="value">
{{formattedNumber('actualProduction')}}<view class="unit">万</view>
</view>
<view class="sub-value flex">
个人产值<view class="num">{{formattedNumber('personalProduction')}}万</view>
</view>
</view>
<view class="output-canvas">
<qiun-data-charts
type="arcbar"
:opts="opts"
:chartData="chartData"
:tooltipShow="false"
/>
</view>
<view class="output-view flex">
<view class="item flex">目标<view class="num">{{formattedNumber('targetProduction')}}万</view>
</view>
<view class="item flex">达成比例<view class="num">{{formattedNumber('achievementRatio','%')}}</view>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import NP from 'number-precision'
export default {
name: '',
props: {
pageData: {
type: Object,
default: () => { }
},
dataShow: {
type: Boolean,
default: true
}
},
watch: {
dataShow: {
immediate: true,
handler (newval) {
if (Object.keys(this.chartData).length) this.getServerData()
}
},
pageData: {
immediate: true,
handler (newval) {
this.getServerData()
}
}
},
data () {
return {
chartData: {},
opts: {
padding: undefined,
title: {
name: "产值贡献",
fontSize: 12,
color: "#333"
},
subtitle: {
fontSize: 14,
color: "#4673FF"
},
extra: {
arcbar: {
type: "circle",
width: 11,
backgroundColor: "#4673ff1a",
startAngle: 1.5,
endAngle: 0.25,
gap: 2,
linearType: 'custom',
customColor: ['#2C66F7', '#389FFF']
}
}
}
}
},
mounted () {
},
methods: {
getServerData () {
let { dataShow } = this,
data = this.pageData.productionContribution
this.opts.subtitle.name = data == null ? '--' : `${this.pageData.productionContribution}%`
this.chartData = {
series: [
{
hideData: !dataShow,
data: NP.divide(data || 0, 100)
}
]
}
},
formattedNumber (key, unit) {
let { dataShow, pageData } = this,
num = pageData[key]
if (unit && num) num += unit
if (!dataShow || num == null) num = '--'
return num
}
}
}
</script>
<style scoped lang='scss'>
.output-value-box {
height: toRpx(366);
position: relative;
.output-value-title {
font-size: toRpx(28);
font-weight: 500;
padding: toRpx(24) toRpx(32) 0;
}
.output-value {
padding: toRpx(54) 0 0 toRpx(52);
.value {
display: flex;
align-items: baseline;
color: #4673ff;
font-size: toRpx(40);
line-height: toRpx(48);
font-weight: 700;
margin-bottom: toRpx(14);
.unit {
color: #333333;
font-size: toRpx(26);
font-weight: 400;
margin-left: toRpx(4);
line-height: toRpx(36);
}
}
.sub-value {
color: #333333;
font-size: toRpx(24);
.num {
color: #4673ff;
font-size: toRpx(28);
font-weight: 700;
margin-left: toRpx(8);
}
}
}
.output-canvas {
position: absolute;
right: toRpx(40);
top: toRpx(60);
width: toRpx(200);
height: toRpx(200);
}
.output-view {
position: absolute;
left: 50%;
bottom: toRpx(32);
transform: translateX(-50%);
width: toRpx(528);
height: toRpx(58);
border-radius: toRpx(450);
background: #4673ff0d;
color: #333333;
font-size: toRpx(24);
&::after {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
content: '';
width: toRpx(2);
height: toRpx(28);
background: #cfd4e3;
}
.item {
justify-content: center;
width: 50%;
flex-shrink: 0;
.num {
margin-left: toRpx(8);
color: #4673ff;
font-size: toRpx(28);
font-weight: 700;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -43,7 +43,6 @@ export default { ...@@ -43,7 +43,6 @@ export default {
watchCustomerInfo: { watchCustomerInfo: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
console.log(newval)
this.id = newval.receptionScene this.id = newval.receptionScene
} }
}, },
......
...@@ -162,6 +162,10 @@ export default { ...@@ -162,6 +162,10 @@ export default {
} else { } else {
this.$refs.carBrandListVisible.close() this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName
this.customerInfo.carBrandId = item.carChildsBrandId
this.customerInfo.oneCarBrand = item.carBrand
this.customerInfo.oneCarBrandId = item.carBrandId
} }
this.resetFocusIndex() this.resetFocusIndex()
this.errorTip = false this.errorTip = false
......
<template>
<view
class="material-item flex"
@click="jump"
>
<!-- <view :class="['status', {'status-green':item.readStatus == 0}]">{{readStatusEnum[item.readStatus]}}</view> -->
<view class="icon">
<template v-if="item.cover">
<image
class="image"
:src="item.cover"
/>
</template>
<template v-else>
<image
class="image"
:src="imgUrl(item)"
/>
</template>
<view class="label">{{materialTypeEnum[item.type]}}</view>
</view>
<view class="text">
<view class="title">{{item.title}}</view>
<view class="tags">
<template v-for="i in item.sceneMarketTagsList">
<view
class="tag"
:key="i.id"
>{{i.tagName}}</view>
</template>
</view>
<view class="date">{{item.date||''}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
item: Object,
sceneMarketLevelTwoItem: Object
},
name: '',
data () {
return {
materialTypeEnum: Object.freeze({
0: '图片',
1: '视频',
2: 'PDF',
3: '富文本',
4: 'Excel',
5: 'Word'
}),
// readStatusEnum: Object.freeze({
// 0: '已查看',
// 1: '未查看'
// })
}
},
mounted () {
},
methods: {
imgUrl (item) {
return `https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/material-${item.type}.png`
},
async jump () {
let { item, sceneMarketLevelTwoItem } = this,
params = `id=${item.id}&specialFlag=${sceneMarketLevelTwoItem.specialFlag}&directoryName=${sceneMarketLevelTwoItem.directoryName}`
// 类型:0-图片;1-视频;2-pdf;3-富文本; 4-Excel; 5-Word
let url = `/pages/common/caseDetail?${params}`
uni.$track.add({ eventCode: 'scene_market', businessId: item.id })
if (item.type != 3) {
uni.showLoading({
mask: true
})
const data = await uni.$api.customerApi.getMaterialDetail({
id: item.id
})
uni.hideLoading()
let fileUrl = data?.detailInfos[0]?.image
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&${params}`
else url = `/pages/common/materialDetail/index?fileUrl=${fileUrl}&title=${item.title}&${params}`
}
uni.navigateTo({
url: `${url}`
})
}
}
}
</script>
<style scoped lang='scss'>
.material-item {
display: flex;
position: relative;
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 toRpx(16);
.status {
position: absolute;
right: 0;
top: 0;
height: toRpx(40);
line-height: toRpx(40);
width: fit-content;
padding: 0 toRpx(12);
font-size: toRpx(22);
color: #999999;
background: #9999991a;
border-radius: toRpx(4);
}
.status-green {
color: #35c376;
background: #35c3761a;
}
.icon {
width: toRpx(128);
height: toRpx(128);
margin-right: toRpx(16);
flex-shrink: 0;
position: relative;
.image {
width: 100%;
height: 100%;
border-radius: toRpx(8);
overflow: hidden;
}
.label {
display: flex;
align-items: center;
padding: 0 toRpx(6);
position: absolute;
width: fit-content;
color: #ffffff;
left: toRpx(8);
top: toRpx(8);
height: toRpx(28);
background: #00000066;
border-radius: toRpx(4);
font-size: toRpx(20);
}
}
.text {
width: calc(100% - #{toRpx(144)});
.title {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333333;
font-size: toRpx(30);
font-weight: 700;
}
.tags {
display: flex;
align-items: center;
gap: 0 toRpx(8);
margin: toRpx(8) 0;
.tag {
display: flex;
align-items: center;
height: toRpx(40);
background: #75bcff1a;
padding: 0 toRpx(12);
width: fit-content;
color: #2d66f7;
font-size: toRpx(22);
border-radius: toRpx(4);
}
}
.date {
color: #999999;
font-size: toRpx(24);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<scroll-view
class="scene-list-box"
scroll-y
>
<template v-if="requestComplete">
<view class="material-box">
<template v-if="materialList.length">
<template v-for="(item,index) in materialList">
<view
class="item"
:key="index"
>
<material
:item="item"
:sceneMarketLevelTwoItem="sceneMarketLevelTwoItem"
></material>
</view>
</template>
<view class="bottom flex">-已经到底了-</view>
</template>
<template v-else>
<view class="list-nothing flex">
<image
class="icon"
src="../../../../../assets/images/home/nothing.webp"
/>
暂无内容
</view>
</template>
</view>
</template>
</scroll-view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
import Material from './Material.vue'
export default {
props: {
requestParams: Object,
sceneMarketLevelTwoItem:Object
},
components: {
Material
},
name: '',
data () {
return {
requestComplete: false,
materialList: []
}
},
mounted () {
},
methods: {
async getSceneMarketMaterialList () {
try {
uni.showLoading({
title: '加载中',
mask: true
})
const {
requestParams
} = this,
data = await uni.$api.sceneMarketApi.getSceneMarketMaterialList(requestParams)
uni.hideLoading()
data?.map(e => {
e.date = dayjs(e.createdDate).format('YYYY-MM-DD')
})
this.materialList = data
this.requestComplete = true
} catch (error) {
uni.hideLoading()
uni.showToast({
title: error,
icon: "error",
})
}
},
}
}
</script>
<style scoped lang='scss'>
.scene-list-box {
width: 100%;
height: 100%;
.material-box {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
gap: toRpx(28) toRpx(48);
padding: 0 toRpx(44);
align-content: flex-start;
.item {
width: calc((100% - #{toRpx(96)}) / 3);
height: toRpx(164);
border-radius: toRpx(16);
background: #ffffff;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
}
.bottom {
margin-top: auto;
width: 100%;
justify-content: center;
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
}
.list-nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(260);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="scene-market-box">
<type-tab-component
:typeList="typeList"
:tabIndex="tabIndex"
@tabClick="tabBarClick"
nameKey="directoryName"
></type-tab-component>
<view class="scene-market-content">
<view class="tabs flex">
<template v-for="i in sceneMarketLevelTwoList">
<view
:class="['tab flex',{active: tagId == i.id}]"
:key="i.id"
@click="tabClick(i)"
>{{i.directoryName}}</view>
</template>
</view>
<scene-list
class="scene-list"
ref="sceneListRef"
:requestParams="requestParams"
:sceneMarketLevelTwoItem="sceneMarketLevelTwoItem"
/>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import TypeTabComponent from '../../../TypeTabComponent.vue'
import SceneList from './compontens/SceneList.vue'
export default {
components: {
TypeTabComponent,
SceneList
},
name: '',
data () {
return {
typeList: [],
tabIndex: -1,
tagId: '',
requestParams: {}
}
},
computed: {
sceneListRef () {
return this.$refs.sceneListRef
},
sceneMarketLevelTwoList () {
return this.typeList[this.tabIndex]?.sceneMarketLevelTwoList || []
},
sceneMarketLevelTwoItem () {
return this.sceneMarketLevelTwoList.find(e => e.id == this.tagId)
}
},
mounted () {
this.getSceneMarketMaterialMenu()
},
methods: {
async getSceneMarketMaterialMenu () {
const typeList = await uni.$api.sceneMarketApi.getSceneMarketMaterialMenu()
this.typeList = typeList
this.tabBarClick(0)
},
tabBarClick (index) {
if (this.tabIndex == index) return
const tabIndex = index,
{
typeList
} = this
this.tabIndex = tabIndex
let detail = typeList[tabIndex].code
if (typeList[tabIndex]?.sceneMarketLevelTwoList.length) detail = typeList[tabIndex].sceneMarketLevelTwoList[0]
this.tabClick(detail)
},
tabClick ({ code: businessCode, id }) {
this.tagId = id
if (this.requestParams.businessCode == businessCode) return
this.requestParams.businessCode = businessCode
this.sceneListRef.requestComplete = false
this.sceneListRef.getSceneMarketMaterialList()
},
}
}
</script>
<style scoped lang='scss'>
.scene-market-box {
height: calc(100vh - #{toRpx(144)});
margin: toRpx(64) toRpx(48) 0 0 ;
border-radius: toRpx(48);
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
overflow: hidden;
border: toRpx(2) solid #ffffff;
.scene-market-content {
width: 100%;
height: calc(100% - #{toRpx(128)});
background: #ffffff;
transform: translateY(toMinusRpx(32));
box-sizing: border-box;
border-radius: toRpx(48);
.tabs {
gap: toRpx(24);
padding: toRpx(40) toRpx(44);
.tab {
height: toRpx(80);
background: #f2f2f2;
padding: 0 toRpx(32);
color: #666666;
font-size: toRpx(28);
border-radius: toRpx(16);
}
.active {
background: #2d66f71a;
color: #2d66f7;
font-weight: 500;
}
}
.scene-list {
height: calc(100% - #{toRpx(160)});
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -123,6 +123,7 @@ export default { ...@@ -123,6 +123,7 @@ export default {
uni.$storage.rm("sessionId"); uni.$storage.rm("sessionId");
uni.$storage.rm("noSignInUuid"); uni.$storage.rm("noSignInUuid");
uni.$storage.rm("beisenToken"); uni.$storage.rm("beisenToken");
uni.$storage.rm("studyCenterPermission");
setTimeout(() => { setTimeout(() => {
uni.hideLoading() uni.hideLoading()
uni.reLaunch({ uni.reLaunch({
......
<!-- 累计学习 -->
<template>
<view :class="['learn-statistics', isBeisen ? 'big-height' : 'small-height']">
<!-- 北森帐号显示累计时长 -->
<view class="learn-statistics-title" v-if="isBeisen">累计学习</view>
<view class="statistics-content" v-if="isBeisen">
<view class="statistics-item ">
<view class="statistics-number blue-number">{{ dataInfo.learnDurationTotal || 0 }}</view>
<view class="statistics-unit blue-number">小时</view>
</view>
<view class="statistics-item">
<view class="text">排名</view>
<view class="statistics-rank">{{ dataInfo.learnDurationRank || '-' }}</view>
<view class="statistics-unit">名</view>
</view>
</view>
<view :class="['progress-box', progressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']">
<template v-for="(item, index) in progressList">
<view :class="['progress-item', isBeisen ? 'bg' : '']" :key="index" v-if="!item.hidden">
<view :class="['progress-item-title', isBeisen ? '' : 'title']">{{ item.title }}</view>
<view class="progress-item-value">
<view :class="['number', isBeisen ? '' : 'blue-number']">{{ dataInfo[item.key] || dataInfo[item.key] == 0 ?
dataInfo[item.key] : '-' }}</view>
<view :class="['unit', isBeisen ? '' : 'blue-unit']">{{
item.unit }}</view>
</view>
<view class="progress-bar-box" v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view :class="['progress-bar', isBeisen ? '' : 'big-margin']"></view>
<view :class="['progress-bar-value', isBeisen ? '' : 'big-top']"
:style="{ width: dataInfo[item.key] ? `${dataInfo[item.key]}%` : '0' }"></view>
</view>
<view v-else :class="['progress-bar-box2', isBeisen ? '' : 'big-height']"></view>
<view :class="['progress-item-finish', isBeisen ? '' : 'big-margin']">
<template v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view>本周已有</view>
<view class="progress-text">
<view class="number">{{ dataInfo[item.ratio] || dataInfo[item.ratio] == 0 ? dataInfo[item.ratio] : '-'
}}%</view>学员完成学习
</view>
</template>
<template v-else>
<template v-if="item.type == 3">
<view>你的表现很好</view>
<view class="progress-text">暂无需短课程学习</view>
</template>
<template v-else-if="item.type == 4">
<view class="no-finish-text">暂无长课程学习安排</view>
</template>
</template>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
name: 'LearnStatistics',
props: {
isBeisen: {
type: Boolean,
default: false
},
dataInfo: {
type: Object,
default: () => { }
},
isHmzx: {
type: Boolean,
default: false
},
isYb: {
type: Boolean,
default: false
}
},
data() {
return {
progressList: [
{
type: 3,
title: '短课程进度',
unit: '%',
key: 'shortCourseProgress',
ratio: 'shortCourseCompletedLearnRatio',
hidden: false
},
{
type: 4,
title: '长课程进度',
unit: '%',
key: 'longCourseProgress',
ratio: 'longCourseCompletedLearnRatio',
hidden: false
}
],
}
},
watch: {
isHmzx: {
handler(newVal) {
console.log(newVal, this.isYb, 'newVal, isYb')
if (!newVal || !this.isYb) {
this.progressList[0].hidden = true
} else {
this.progressList[0].hidden = false
}
},
immediate: true
},
isBeisen: {
handler(newVal) {
if (!newVal) {
this.progressList[1].hidden = true
} else {
this.progressList[1].hidden = false
}
},
immediate: true
}
},
mounted() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.learn-statistics {
width: calc(100% - #{toRpx(64)});
border-radius: toRpx(24);
background: #ffffff;
padding: toRpx(28) toRpx(24) toRpx(24);
margin: 0 toRpx(32) toRpx(20);
&.small-height {
height: toRpx(396);
}
&.big-height {
height: toRpx(480);
}
&-title {
font-size: toRpx(28);
color: #1A1A1A;
}
.statistics-content {
display: grid;
grid-template-columns: repeat(2, 1fr);
align-items: center;
margin-top: toRpx(12);
margin-bottom: toRpx(42);
.statistics-item {
display: flex;
align-items: baseline;
.blue-number {
color: #3B73FF;
}
.statistics-number {
color: #3B73FF;
font-size: toRpx(40);
font-weight: 700;
}
.statistics-unit {
font-size: toRpx(22);
font-weight: 500;
margin-left: toRpx(4);
}
.text {
color: #808080;
font-size: toRpx(24);
margin-right: toRpx(8);
}
.statistics-rank {
color: #000000;
font-size: toRpx(32);
font-weight: 500;
}
}
}
.progress-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: toRpx(24);
&.only-one {
grid-template-columns: repeat(1, 1fr);
}
.progress-item {
display: flex;
// justify-content: space-between;
flex-direction: column;
border-radius: toRpx(12);
&.bg {
background-color: #F5F9FF;
padding: toRpx(24) toRpx(20);
}
&-title {
font-size: toRpx(32);
color: #808080;
font-size: toRpx(24);
&.title {
color: #1A1A1A;
font-size: toRpx(28);
}
}
&-value {
display: flex;
align-items: baseline;
margin-top: toRpx(16);
.number {
color: #000;
font-size: toRpx(32);
font-weight: 500;
&.blue-number {
font-size: toRpx(40);
font-weight: 700;
color: #3B73FF;
}
}
.unit {
font-size: toRpx(20);
color: #000;
margin-left: toRpx(4);
&.blue-unit {
font-size: toRpx(22);
font-weight: 500;
color: #3B73FF;
}
}
}
.progress-bar-box {
position: relative;
width: calc(100% - #{toRpx(68)});
}
.progress-bar-box2 {
width: calc(100% - #{toRpx(68)});
height: toRpx(48);
&.big-height {
height: toRpx(80);
}
}
.progress-bar {
width: 100%;
height: toRpx(12);
border-radius: toRpx(8);
opacity: 0.35;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
margin-top: toRpx(36);
&.big-margin {
margin-top: toRpx(72);
}
&-value {
position: absolute;
left: 0;
top: toRpx(36);
height: toRpx(12);
border-radius: toRpx(8);
opacity: 1;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
&.big-top {
top: toRpx(72);
}
}
}
.progress-item-finish {
height: toRpx(72);
margin-top: toRpx(46);
font-size: toRpx(22);
color: #808080;
line-height: toRpx(36);
&.big-margin {
margin-top: toRpx(84);
}
.progress-text {
display: flex;
}
.number {
color: #3B73FF;
}
.no-finish-text {
margin-top: toRpx(30);
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="recommend-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="getScrollHeight">
<template v-if="recommendCourseList.length">
<view class="recommend-course-list">
<view class="recommend-course-item" v-for="(item, index) in recommendCourseList" :key="index" @click="startStudy(item, index)">
<image
class="recommend-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp"
mode="scaleToFill"
/>
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.courseName }}
</view>
<view class="recommend-course-item-text">{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'RecommendCourse',
data() {
return {
recommendCourseList: [],
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
}
},
computed: {
getScrollHeight() {
const list = this.recommendCourseList;
if (!list || list.length === 0) {
return '';
}
return 'scroll-view'
}
},
mounted() {
this.getCourseTaskPage()
this.asyncfindBeiSenSSOToken()
},
methods: {
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
recommendStatus: 1, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
if (pageNum == 1) {
this.recommendCourseList = res.list
} else {
this.recommendCourseList = this.recommendCourseList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
this.getCourseTaskPage()
} else {
this.nothing = true;
}
},
startStudy(item, index) {
let { pageNum, total, nothing = 'nothing', pageSize } = this;
uni.$track.add({eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/equity/index'})
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=recommendation&index=${index}&recommendCourseList=${encodeURIComponent(JSON.stringify(this.recommendCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}`
})
},
async asyncfindBeiSenSSOToken () {
const res = await uni.$api.commonApi.findBeiSenSSOToken({})
uni.$storage.set('beisenToken', res.data)
},
}
}
</script>
<style lang="scss" scoped>
.recommend-course {
height: calc(100% - #{toRpx(100)});
.scroll-view {
margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)});
.recommend-course-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
.recommend-course-item {
width: 100%;
height: toRpx(376);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
border-radius: toRpx(24);
.recommend-course-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.recommend-course-content {
padding: toRpx(32);
.recommend-course-item-title {
font-size: toRpx(30);
color: #292D33;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
margin-bottom: toRpx(16);
height: calc(2 * 1.2em); // 固定两行高度,1.4为行高倍数,可根据实际调整
line-height: 1.2;
}
.recommend-course-item-text {
font-size: toRpx(24);
color: #999EA8;
}
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(380);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view :class="[
'study-box2',
!isBeisen && (!isHmzx || !isYb) ? 'all-height' : '',
isBeisen && (!isHmzx || !isYb) ? 'big-height' : ''
]">
<view class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index">
<view class="tab-item-title">{{ item.title }}</view>
</view>
</view>
<view class="rank-title">周转化率排名</view>
<view class="rank-value">
<view class="rank-number">{{ currentConversionData.top || '-' }}</view>名
</view>
<view class="bar-box">
<view class="bar-item" v-for="(item, index) in barList" :key="index">
<view class="bar-label">{{ item.label }}</view>
<view class="bar-container">
<view
class="bar"
:class="item.class"
:style="{
width: `${Math.min(100, Math.max(2, Number(currentConversionData[item.key]) || 0))}%`
}"
></view>
<view
class="bar-text"
:style="{ left: `calc(${Number(currentConversionData[item.key]) > 100 ? 100 : currentConversionData[item.key]}%)` }"
>{{ (Number(currentConversionData[item.key]) || 0).toFixed(1) }}%</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'WeeklyConversionRate',
props: {
isFlag: {
type: Boolean,
default: false
},
dataInfo: {
type: Object,
default: () => {}
},
isHmzx: {
type: Boolean,
default: false
},
isYb: {
type: Boolean,
default: false
},
isBeisen: {
type: Boolean,
default: false
}
},
data() {
return {
barValue: 56,
barList: [
{
label: '我的',
value: '74.3',
key: 'myConversionRatio',
class: 'my'
},
{
label: 'Top1',
value: '94.5',
key: 'topOneConversionRatio',
class: 'top1'
}
],
tabIndex: 0,
}
},
computed: {
tabList() {
const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
if (!weekConversionRatio) return []
// 按顺序轻改、权益、延保生成tabList
const order = [0, 1, 2]
const tabArr = order
.filter(key => weekConversionRatio.hasOwnProperty(key))
.map(key => {
let title = '';
if (key == 0) title = '轻改';
else if (key == 1) title = '权益';
else if (key == 2) title = '延保';
else title = `类型${key}`;
return {
title,
value: key
}
});
// 有延保默认展示延保,没有延保默认展示第一个
this.$nextTick(() => {
if (tabArr.length > 0) {
const yanbaoIndex = tabArr.findIndex(item => item.value == 2);
if (yanbaoIndex !== -1) {
if (this.tabIndex !== yanbaoIndex) this.tabIndex = yanbaoIndex;
} else {
if (this.tabIndex !== 0) this.tabIndex = 0;
}
}
});
return tabArr;
},
currentConversionData() {
// 返回当前tabIndex对应的weekConversionRatio数据
const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
// const weekConversionRatio = {
// 0: {
// top: 1,
// myConversionRatio: '0',
// topOneConversionRatio: '94.5'
// },
// 1: {
// top: 2,
// myConversionRatio: '74.3',
// topOneConversionRatio: '94.5'
// },
// 2: {
// top: 3,
// myConversionRatio: '55.7',
// topOneConversionRatio: '84.5'
// },
// }
if (!weekConversionRatio) return {}
const key = this.tabList[this.tabIndex] && this.tabList[this.tabIndex].value
return weekConversionRatio[key] || {}
}
},
methods: {
handleTabClick(index) {
this.tabIndex = index
}
}
}
</script>
<style lang="scss" scoped>
.study-box2 {
width: calc(100% - #{toRpx(64)});
border-radius: toRpx(24);
background: #ffffff;
padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16);
&.big-height {
height: toRpx(764);
}
&.all-height {
height: calc(100% - #{toRpx(32)});
}
.tab-list {
display: flex;
width: 100%;
height: toRpx(64);
background-color: #F5F6F7;
border-radius: toRpx(12);
color: #666666;
font-size: toRpx(24);
.tab-item {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
margin: toRpx(4);
&.active {
background-color: #fff;
color: #1A1A1A;
border-radius: toRpx(10);
}
}
}
.rank-title {
font-size: toRpx(28);
color: #1A1A1A;
margin-top: toRpx(32);
margin-left: toRpx(8);
}
.rank-value {
display: flex;
align-items: baseline;
color: #3B73FF;
font-size: toRpx(22);
font-weight: 500;
margin-top: toRpx(16);
margin-left: toRpx(8);
.rank-number {
font-size: toRpx(40);
font-weight: 700;
margin-right: toRpx(4);
}
}
/* 进度条整体项样式 */
.bar-box {
margin-top: toRpx(44);
}
.bar-item {
display: flex;
align-items: center;
margin-bottom: toRpx(20);
padding-right: toRpx(120);
&:last-child {
margin-bottom: toRpx(22);
}
.bar-label {
display: inline-block;
width: toRpx(60);
text-align: right;
margin-right: toRpx(10);
font-size: toRpx(22);
}
}
/* 进度条容器样式 */
.bar-container {
position: relative;
flex: 1;
// width: toRpx(380);
height: toRpx(12);
// overflow: hidden;
}
/* 进度条填充样式 */
.bar {
height: 100%;
border-radius: 0 4px 4px 0;
&.top1 {
background: linear-gradient(90deg, #708dff 0%, #6858f5 100%);
}
&.my {
background: linear-gradient(90deg, #389fff 0%, #2c66f7 100%);
}
}
/* 进度百分比文字样式 */
.bar-text {
margin-left: toRpx(20);
position: absolute;
top: 50%;
transform: translateY(-50%);
white-space: nowrap;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<uni-popup
ref="learnPopup"
type="center"
:is-mask-click="false"
>
<view class="learn-box">
<view class="sprite-icon icon-learn-bg"></view>
<view class="learn-content">
<view class="learn-title">退出提醒</view>
<text class="learn-text">{{content}}</text>
</view>
<view class="learn-footer flex">
<view
class="learn-btn learn-confirm"
@click="confirm"
>确认退出</view>
<view
class="learn-btn learn-cancel"
@click="cancel"
>继续学习</view>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
content: {
type: String,
default: ''
}
},
name: '',
data () {
return {
}
},
computed: {
learnRef () {
return this.$refs.learnPopup
}
},
mounted () {
},
methods: {
open () {
this.learnRef.open()
},
cancel () {
this.close()
this.$emit('cancel')
},
close () {
this.learnRef.close()
},
confirm () {
this.close()
this.$emit('confirm')
}
}
}
</script>
<style scoped lang='scss'>
.learn-box {
width: toRpx(848);
height: toRpx(648);
border-radius: toRpx(48);
background: #ffffff;
position: relative;
overflow: hidden;
.sprite-icon{
position: absolute;
top: 0;
left: 0;
zoom: 2;
}
.learn-content {
padding: toRpx(296) toRpx(64) toRpx(32);
text-align: center;
.learn-title {
color: #333333;
font-size: toRpx(40);
font-weight: 500;
margin-bottom: toRpx(16);
}
.learn-text {
color: #666666;
font-size: toRpx(32);
}
}
.learn-footer {
height: toRpx(160);
padding: 0 toRpx(64);
justify-content: space-between;
.learn-btn {
width: toRpx(344);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
display: flex;
align-items: center;
justify-content: center;
color: #1a1a1a;
font-size: toRpx(28);
}
.learn-cancel {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="tabs-component flex">
<template>
<view
v-for="(i, index) in list"
:class="['tab flex',size, { active: activeIndex == index }]"
:key="index"
@click="changeTab(index)"
:style="{
width:blockWidth
}"
>
{{ i[tabKey] || i }}
<template v-if="i.dot && i.dot()">
<view class="dot"></view>
</template>
</view>
</template>
<view
class="active-btn"
:style="{
width:blockWidth,
left:activeBlockLeft
}"
></view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
list: Array,
defaultIndex: {
type: Number,
default: 0
},
tabKey: {
type: String,
default: 'text'
},
size: {
type: String,
default: 'normal'
}
},
name: '',
watch: {
defaultIndex: {
immediate: true,
handler (newval) {
this.activeIndex = newval || 0
}
}
},
data () {
return {
activeIndex: 0
}
},
computed: {
blockWidth () {
let { list } = this,
width = 1 / list.length * 100
return `calc(${width}% - 4rpx)`
},
activeBlockLeft () {
let { list, activeIndex } = this,
width = 1 / list.length * 100,
left = activeIndex == 0 ? '4rpx' : `${activeIndex * width}%`
return left
}
},
mounted () {
},
methods: {
changeTab (index) {
this.activeIndex = index
this.$emit('changeTab', index)
}
}
}
</script>
<style scoped lang='scss'>
.tabs-component {
display: flex;
justify-content: space-between;
width: 100%;
height: 100%;
background-color: #f2f2f2;
border-radius: toRpx(16);
position: relative;
box-sizing: border-box;
padding: toRpx(4);
&::after {
position: absolute;
z-index: -2;
background: #ffffff;
width: 100%;
height: 100%;
left: 0;
top: 0;
content: '';
}
.tab {
height: calc(100% - #{toRpx(8)});
justify-content: center;
color: #666666;
z-index: 10;
position: relative;
.dot {
position: absolute;
top: toRpx(4);
right: toRpx(28);
width: toRpx(12);
height: toRpx(12);
border-radius: 100%;
background: #f24724;
}
}
.normal {
font-size: toRpx(28);
}
.small{
font-size: toRpx(24);
}
.active {
color: #1a1a1a;
font-weight: 500;
}
.active-btn {
position: absolute;
height: calc(100% - #{toRpx(8)});
background: #ffffff;
top: 50%;
transform: translateY(-50%);
transition: all 0.15s;
border-radius: toRpx(16);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="select-box">
<view
class="select"
@click.stop="isSelect = !isSelect"
>
{{selectList[selectIndex].label}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view
class="pop-box"
v-if="isSelect"
>
<view
v-for="(i,index) in selectList"
:key="index"
class="type-item flex"
:class="index == selectIndex ? 'active' : ''"
@click="chooseType(index, i)"
>{{i[labelKey]}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
selectList: Array,
labelKey: {
type: String,
default: 'label'
}
},
name: '',
data () {
return {
selectIndex: 0,
isSelect: false
}
},
mounted () {
},
methods: {
hideSelect () {
this.isSelect = false
},
chooseType (index, item) {
this.selectIndex = index
this.isSelect = false
this.$emit('chooseType', { item, index })
},
}
}
</script>
<style scoped lang='scss'>
.select-box {
position: relative;
z-index: 5;
.select {
display: flex;
align-items: center;
justify-content: flex-end;
height: toRpx(84);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
padding: 0 toRpx(24) 0 toRpx(40);
}
.arrow-bottom {
width: toRpx(48);
height: toRpx(48);
}
.pop-box {
position: absolute;
top: toRpx(100);
left: 0;
width: 100%;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
text-align: center;
animation: show-view-opacity 0.15s forwards;
.type-item {
padding: 0 toRpx(28);
margin-bottom: toRpx(8);
height: toRpx(84);
justify-content: center;
&:last-child {
margin-bottom: 0;
}
&.active {
background-color: #ecf1ff;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="swiper-box">
<template v-if="loadComplete">
<template v-if="moduleList.length">
<movable-area
class="swiper-carousel"
@touchstart="starts"
@touchend="ends"
>
<template v-for="(item,index) in imagelist">
<movable-view
:key="index"
:class="['carousel-block',item.class]"
@click.stop="changeBlock(item)"
direction="horizontal"
@change="change"
:disabled="item.class != 'block-center'"
:x="item.class != 'block-center' ? 0 : viewX"
:data-index="item.isIndex"
>
<image
class="image-block"
:src="item.imgUrl"
@load="item.hide = true"
/>
<view
class="bg"
v-if="item.hide"
></view>
<!-- <view :class="['error-block',{hide:item.hide}]">
<uni-icons
:type="icon"
:size="size"
color="#909399"
></uni-icons>
</view> -->
</movable-view>
</template>
</movable-area>
<view class="module-title flex">
{{moduleTitle}}
</view>
<view class="module-dots flex">
<template v-for="(i,index) in moduleList">
<div
:class="['dot', {'active': index == currentIndex}]"
:key="index"
>
</div>
</template>
</view>
</template>
<template v-else>
<view class="nothing flex">
该场景尚未配置素材,请联系总部人员
</view>
</template>
</template>
<template v-else>
<view class="loading flex">
<image
class="gif"
src="../assets/images/common/loadding.gif"
/>
<!-- <uni-icons
class="icon"
type="refreshempty"
:size="120"
color="#3773f8"
></uni-icons> -->
</view>
</template>
</view>
</template>
<script>
import utils from "@/utils/utils.js";
export default {
name: 'SwiperComponent',
props: {
moduleList: {
type: Array,
default: () => []
},
imgKey: {
type: String,
default: 'thumbnail'
},
icon: {
type: String,
default: 'image'
},
size: {
type: [Number, String],
default: '40'
},
interval: {
type: [Number, String],
default: 5e3
},
autoplay: {
type: Boolean,
default: true
},
stopAutoPlay: {
type: Boolean,
default: false
},
loadComplete: Boolean
},
watch: {
moduleList: {
handler (val) {
if (val.length && !this.imagelist.length) this.getDatalist()
},
deep: true
},
stopAutoPlay: {
handler (val) {
if (this.autoplay && !val) this.autoPlayFunction()
},
deep: true
}
},
computed: {
moduleTitle () {
return this.moduleList[this.currentIndex]?.detailTitle
}
},
created () {
// this.getDatalist()
},
data () {
return {
datalist: [],
imagelist: [],
ismove: 0,
currentIndex: 0,
autoPlayTimer: null,
endTimer: null,
playStatus: true,
style_object: Object.freeze([
{ index: 0, class: 'block-left' },
{ index: 1, class: 'block-center' },
{ index: 2, class: 'block-right' }
]),
blockX: 0,
viewX: 0
}
},
beforeDestroy () {
// 组件销毁时清理自动播放定时器
if (this.autoPlayTimer) {
clearTimeout(this.autoPlayTimer);
this.autoPlayTimer = null;
}
},
methods: {
getDatalist () {
if (this.moduleList) {
this.datalist = JSON.parse(JSON.stringify(this.moduleList))
let num = 3
let diff = num - this.moduleList.length
if (diff > 0) {
for (let i = 0; i < diff; i++) {
let obj = {}
obj[this.imgKey] = ''
this.datalist.push(obj)
}
}
this.getImagelist()
}
},
getImagelist () {
let { datalist, autoplay } = this
this.imagelist = JSON.parse(JSON.stringify(this.style_object))
this.imagelist.forEach((item, index) => {
const dataIndex = index - 1 < 0 ? datalist.length - 1 : index - 1
item.isIndex = dataIndex
item.isToor = index
item.imgUrl = datalist[dataIndex]?.[this.imgKey] || ''
item.x = 0
})
if (autoplay) this.autoPlayFunction()
},
autoPlayFunction () {
if (this.stopAutoPlay || !this.playStatus) {
if (this.autoPlayTimer) {
clearTimeout(this.autoPlayTimer);
this.autoPlayTimer = null;
}
return;
}
// 设置新的自动播放定时器
this.autoPlayTimer = setTimeout(() => {
// 再次检查是否需要停止播放
if (this.stopAutoPlay || !this.playStatus) {
clearTimeout(this.autoPlayTimer);
this.autoPlayTimer = null;
return;
}
// 执行轮播动画并递归调用自身
this.updateCarouselPositions();
this.autoPlayFunction();
}, this.interval);
},
updateCarouselPositions (direction = 'left') {
let { imagelist, datalist } = this,
len = datalist.length - 1,
list = JSON.parse(JSON.stringify(this.style_object))
this.imagelist.forEach(item => {
let toor = direction == 'left' ?
(item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
if (direction == 'left' && item.class == 'block-right') {
if (isIndex == len) isIndex = 2
else if (isIndex == len - 1) isIndex = 1
else isIndex += 3
if (isIndex > len) isIndex = 0
}
if (direction == 'right' && item.class == 'block-left') {
if (isIndex == 1) isIndex = len - 1
else if (isIndex == 0) isIndex = len - 2
else isIndex -= 3
if (isIndex < 0) isIndex = len
}
item.isIndex = isIndex
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
})
let currentIndex = this.imagelist.findIndex(item => item.index == 1)
this.currentIndex = this.imagelist[currentIndex].isIndex
},
changeBlock (item) {
let toor = item.isToor
if (toor === 0) this.updateCarouselPositions('right')
if (toor == 2) this.updateCarouselPositions()
this.$emit('click', item.isIndex)
},
starts (e) {
this.ismove = e.touches[0].pageX
this.playStatus = false
if (this.endTimer) {
clearTimeout(this.endTimer);
this.endTimer = null;
return;
}
},
ends (e) {
let { blockX, ismove } = this
let pageX = e.changedTouches[0].pageX
let nums = ismove - pageX
if (!(nums > 50 || blockX < -30) || !(nums < -50 || blockX > 30)) {
this.viewX = -10
setTimeout(() => {
this.viewX = 0
}, 16)
}
if (nums > 50 || blockX < -30) this.updateCarouselPositions()
if (nums < -50 || blockX > 30) this.updateCarouselPositions('right')
this.endTimer = setTimeout(() => {
if (!this.playStatus) {
this.playStatus = true
this.autoPlayFunction()
}
}, this.interval)
},
change: utils.throttle(function (e, item) {
let { x } = e.detail
this.blockX = x
}, 16)
}
}
</script>
<style lang="scss" scoped>
.swiper-box {
height: 100%;
.loading {
width: 100%;
height: 100%;
justify-content: center;
.gif{
width: toRpx(64);
height: toRpx(64);
}
.icon {
animation: rotate 1s infinite;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
}
}
.swiper-carousel {
width: 100%;
height: toRpx(440);
position: relative;
overflow: hidden;
.carousel-block {
position: absolute;
border-radius: 10upx;
overflow: hidden;
box-shadow: 0 0 5px #0000001a;
transition: all 0.2s ease; /* 添加过渡 */
border: toRpx(2) solid #ffffffb3;
box-shadow: 0 toRpx(3) toRpx(12) 0 #5294ff33;
border-radius: toRpx(24);
.image-block {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-size: 100% 100%;
z-index: 5;
}
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(180deg, #e6edff 0%, #f0f4ff 100%);
z-index: 4;
}
.error-block {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #f5f7fa;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.hide {
opacity: 0;
}
}
.block-left,
.block-right {
top: toRpx(68);
height: toRpx(306);
width: toRpx(468);
transition: all 0.1s;
}
.block-left {
left: toRpx(150);
z-index: 10;
}
.block-right {
left: toRpx(592);
z-index: 15;
}
.block-center {
left: toRpx(294);
top: toRpx(16);
height: toRpx(408);
width: toRpx(624);
z-index: 20;
transition: all 0.3s;
}
}
.module-title {
color: #333333;
font-size: toRpx(24);
margin-top: toRpx(24);
justify-content: center;
position: relative;
}
.module-dots {
position: absolute;
bottom: toRpx(56);
right: toRpx(48);
gap: toRpx(12);
.dot {
width: toRpx(12);
height: toRpx(12);
opacity: 1;
background: #0007400d;
border-radius: 100%;
}
.active {
background: #fff;
}
}
.nothing {
width: 100%;
height: 100%;
justify-content: center;
color: #999;
font-size: toRpx(20);
}
</style>
<template>
<view class="type-tab">
<view class="type-box">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view
:class="['sprite-icon',tabClass(index)]"
:style="{
left:blockLeft
}"
></view>
<view
class="text"
:class="[tabIndex == index ? `active` : '']"
>
{{ i[nameKey] }}
</view>
</view>
</view>
<view class="mask-box"></view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
typeList: Array,
tabIndex: {
type: Number,
default: 0
},
nameKey: {
type: String,
default: 'tabName'
}
},
name: '',
data () {
return {
firstClass: Object.freeze(['first-nav', 'second-nav']),
}
},
computed: {
blockLeft () {
let { tabIndex } = this
return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx`
}
},
mounted () {
},
methods: {
tabClass (index) {
let className = ''
if (this.tabIndex == index) {
className = 'active icon-'
if (index == 0) className += 'first-nav'
else className += 'second-nav'
}
return className
},
tabClick (index) {
this.$emit('update:tabIndex', index)
this.$emit('tabClick',index)
}
}
}
</script>
<style scoped lang='scss'>
.type-tab {
position: relative;
.type-box {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: toRpx(160);
line-height: toRpx(128);
border-radius: toRpx(48) toRpx(48) 0 0;
overflow: hidden;
z-index: 0;
.tab-item {
width: toRpx(400);
text-align: center;
font-weight: 500;
font-size: toRpx(40);
color: #1f2133;
.text {
position: relative;
text-align: center;
width: toRpx(400);
}
.active {
position: absolute;
top: 0;
z-index: -1;
font-weight: 700;
font-size: toRpx(40);
color: #2c66f7;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: toRpx(48);
height: toRpx(8);
background-color: #2c66f7;
border-radius: toRpx(16);
}
}
.sprite-icon {
transition: left 0.15s;
}
}
}
.mask-box {
position: absolute;
height: 100vh;
width: 100%;
background: #fff;
left: 0;
top: toRpx(128);
border-radius: toRpx(48);
overflow: hidden;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,8 @@ import utils from './utils/utils' ...@@ -14,6 +14,8 @@ import utils from './utils/utils'
import logger from './utils/logger' import logger from './utils/logger'
import { Storage } from './utils/cache/index' import { Storage } from './utils/cache/index'
import api from './api/index' import api from './api/index'
import Track from './utils/Track'
uni.$api = api uni.$api = api
// uni.$lock = false // uni.$lock = false
uni.$storage = new Storage() uni.$storage = new Storage()
...@@ -23,6 +25,7 @@ uni.$logger = logger ...@@ -23,6 +25,7 @@ uni.$logger = logger
// uni.$recordManager = RecordManager.getInstance() // uni.$recordManager = RecordManager.getInstance()
uni.$dbTempRecord = new DBRecord() uni.$dbTempRecord = new DBRecord()
uni.$dbManager = new DBManager() uni.$dbManager = new DBManager()
uni.$track = new Track()
!(async _ => { !(async _ => {
await uni.$dbManager.init() await uni.$dbManager.init()
await uni.$dbTempRecord.init() await uni.$dbTempRecord.init()
......
...@@ -159,6 +159,40 @@ class SQLite { ...@@ -159,6 +159,40 @@ class SQLite {
formatValue(value) { formatValue(value) {
return typeof value === 'object' && value !== null ? `'${JSON.stringify(value)}'` : `'${value}'` return typeof value === 'object' && value !== null ? `'${JSON.stringify(value)}'` : `'${value}'`
} }
/**
* 检查指定字段是否存在于表中
* @param {string} tableName - 表名
* @param {string} columnName - 要检查的字段名
* @returns {Promise<boolean>} - 字段存在返回true,否则返回false
*/
async isColumnExists(tableName, columnName) {
try {
const columnInfo = await this.selectSql(`PRAGMA table_info(${tableName})`)
return columnInfo.some(col => col.name === columnName)
} catch (error) {
console.error(`检查字段是否存在失败 error - > ${error.message}`)
throw new Error(error.message)
}
}
/**
* 批量添加字段到表中
* @param {string} tableName - 表名
* @param {Array<{name: string, definition: string}>} columns - 要添加的字段数组
* @returns {Promise<void>}
*/
async addColumns(tableName, columns) {
try {
for (const column of columns) {
const { name, definition = 'TEXT DEFAULT ""' } = column
await this.executeSql(`ALTER TABLE ${tableName} ADD COLUMN ${name} ${definition}`)
}
} catch (error) {
console.error(`批量添加列失败 error - > ${error.message}`)
throw new Error(error.message)
}
}
} }
export default SQLite export default SQLite
// 使用示例 // 使用示例
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "展业助手", "name" : "展业助手",
"appid" : "__UNI__D3BD3DF", "appid" : "__UNI__D3BD3DF",
"description" : "", "description" : "",
"versionName" : "2.11.0", "versionName" : "2.12.0",
"versionCode" : "2110", "versionCode" : "2120",
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App特有相关 */ /* 5+App特有相关 */
......
export default {
data () {
return {
AIUrl: ''
}
},
mounted () {
},
methods: {
async getAiagent (options, agentCode = 'AI6') {
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode
})
if (data) {
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo'),
bussinessType = sceneType == 0 ? 1 : 2,// sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType]
let title = options.directoryName
if(options.title) title += `-${options.title}`
let { agentUrl, domainName } = data,
url = `${agentUrl}?no_header=1&business_type=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}`
if (options.id) url += `&enter_id=${options.id}`
this.AIUrl = url
this.setWebviewStyle()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
},
setWebviewStyle () {
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
let [wv1, wv2] = currentWebview.children()
let wv1Flag = false,
wv2Flag = false
if (wv2) {
if (wv1) {
wv1.setStyle({
left: '0',
top: '9.37%',
height: '90.63%',
width: '71.36%'
});
wv1Flag = true;
}
if (wv2) {
wv2.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv2Flag = true;
}
} else {
if (wv1) {
wv1.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv1Flag = true;
wv2Flag = true;
}
}
return wv1Flag && wv2Flag
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
}
}
}
import loginMixin from './loginMixin' import loginMixin from './loginMixin'
import receptionTrackMixin from './receptionTrackMixin' import receptionTrackMixin from './receptionTrackMixin'
import aiUrlMixin from './aiUrlMixin'
import report from './report'
module.exports = { module.exports = {
loginMixin, loginMixin,
receptionTrackMixin receptionTrackMixin,
aiUrlMixin,
report
} }
...@@ -13,6 +13,7 @@ export default { ...@@ -13,6 +13,7 @@ export default {
merchantId, merchantId,
staffUUID: uuid staffUUID: uuid
}).then(result => { }).then(result => {
console.log(result, 'result')
// 仅一家4s店 // 仅一家4s店
if (result?.length == 1) { if (result?.length == 1) {
let { merchantName, merchantId } = result[0] let { merchantName, merchantId } = result[0]
......
...@@ -12,12 +12,12 @@ import utils from '@/utils/utils.js' ...@@ -12,12 +12,12 @@ import utils from '@/utils/utils.js'
import { storageApi } from '@/utils/cache' import { storageApi } from '@/utils/cache'
import permision from '@/js_sdk/wa-permission/permission.js' import permision from '@/js_sdk/wa-permission/permission.js'
export default { export default {
provide() { provide () {
return { return {
getRecorder: () => this.record getRecorder: () => this.record
} }
}, },
async mounted() { async mounted () {
this.audioManager = new AudioManager(this.onAudioStart, this.onAudioStop, this.onError) this.audioManager = new AudioManager(this.onAudioStart, this.onAudioStop, this.onError)
this.initDto() this.initDto()
this.record = new TempRecord(this.tempRecord, this.triggleTempNumber) this.record = new TempRecord(this.tempRecord, this.triggleTempNumber)
...@@ -34,31 +34,31 @@ export default { ...@@ -34,31 +34,31 @@ export default {
// }, // },
// deep: true // deep: true
// }, // },
customerKey:{ customerKey: {
handler() { handler () {
this.handler(this.customerInfo, this.updateCustomerInfo) this.handler(this.customerInfo, this.updateCustomerInfo)
}, },
deep: true deep: true
}, },
booksList: { booksList: {
handler(val) { handler (val) {
this.handler(val, this.updateBookList) this.handler(val, this.updateBookList)
} }
}, },
receptionStatus: { receptionStatus: {
handler(val) { handler (val) {
this.handler(val, this.updateReceptionStatus) this.handler(val, this.updateReceptionStatus)
} }
}, },
receptionKey: { receptionKey: {
handler(val) { handler (val) {
this.handler(this.receptionTrack, this.updateMaterialPointList) this.handler(this.receptionTrack, this.updateMaterialPointList)
} }
} }
}, },
computed: { computed: {
...mapState(['user.customerInfo']), ...mapState(['user.customerInfo']),
...mapGetters(['customerInfo', 'receptionStatus', 'booksList', 'receptionTrack', 'receptionKey','customerKey']) ...mapGetters(['customerInfo', 'receptionStatus', 'booksList', 'receptionTrack', 'receptionKey', 'customerKey'])
}, },
methods: { methods: {
...mapMutations('audio', ['setReceptionStatus', 'setBooks', 'setPerRecordNumber']), ...mapMutations('audio', ['setReceptionStatus', 'setBooks', 'setPerRecordNumber']),
...@@ -72,20 +72,20 @@ export default { ...@@ -72,20 +72,20 @@ export default {
this.audioManager.start() this.audioManager.start()
}, 300), }, 300),
initReception() { initReception () {
this.setBooks([]) this.setBooks([])
this.clearCustomerInfo() this.clearCustomerInfo()
this.setReceptionStatus('') this.setReceptionStatus('')
this.initTime() this.initTime()
}, },
async onAudioStart() { async onAudioStart () {
if (this.audioManager.counter === 0) { if (this.audioManager.counter === 0) {
await this.record.add() await this.record.add()
} else { } else {
this.record.addAudio() this.record.addAudio()
} }
}, },
async onAudioStop() { async onAudioStop () {
if (this.audioManager.isRecording) { if (this.audioManager.isRecording) {
uni.$logger.local.info('〖接待管理Recorder〗 == 接待中,再次开启录音! ') uni.$logger.local.info('〖接待管理Recorder〗 == 接待中,再次开启录音! ')
this.audioManager.start() this.audioManager.start()
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
uni.$logger.local.info('〖接待管理Recorder〗 == 断开录音! ') uni.$logger.local.info('〖接待管理Recorder〗 == 断开录音! ')
} }
}, },
onAudioError(error) { onAudioError (error) {
const message = error.message const message = error.message
this.reportError(`录音异常: error: ${message}`, message) this.reportError(`录音异常: error: ${message}`, message)
}, },
...@@ -102,12 +102,12 @@ export default { ...@@ -102,12 +102,12 @@ export default {
* @params {boolean} status true 不保存记录/AUDIO_STATUS.ABNORMAL 只要断开录音 * @params {boolean} status true 不保存记录/AUDIO_STATUS.ABNORMAL 只要断开录音
* @returns {void} * @returns {void}
*/ */
async stopAudio(isNotSave = false) { async stopAudio (isNotSave = false) {
uni.$logger.local.info('〖接待管理Recorder〗 == 结束接待! ') uni.$logger.local.info('〖接待管理Recorder〗 == 结束接待! ')
this.stop() this.stop()
await this.saveAndClearRecord(isNotSave) await this.saveAndClearRecord(isNotSave)
}, },
async saveAndClearRecord(isNotSave = false) { async saveAndClearRecord (isNotSave = false) {
if (isNotSave) { if (isNotSave) {
uni.$logger.local.info('〖接待管理Recorder〗 == 不保存记录! ') uni.$logger.local.info('〖接待管理Recorder〗 == 不保存记录! ')
return this.record.clearLocalRecord() return this.record.clearLocalRecord()
...@@ -116,24 +116,24 @@ export default { ...@@ -116,24 +116,24 @@ export default {
//如果不需要保存记录 //如果不需要保存记录
await this.record.save() await this.record.save()
}, },
stop() { stop () {
this.endWatchClick() this.endWatchClick()
this.record.clearLoopTimer() this.record.clearLoopTimer()
if (this.audioManager.isRecording) { if (this.audioManager.isRecording) {
this.audioManager.stop() this.audioManager.stop()
} }
}, },
handler(params, fn) { handler (params, fn) {
if (this.audioManager.isRecording || this.record?.currentRecord?.endReasonType == 1) { if (this.audioManager.isRecording || this.record?.currentRecord?.endReasonType == 1) {
fn.call(this, params) fn.call(this, params)
} }
}, },
reset() { reset () {
this.audioManager = null this.audioManager = null
this.record = null this.record = null
this.tempRecord = null this.tempRecord = null
}, },
initDto() { initDto () {
const { shopMerchantId, phone, sceneType, uuid, name, merchantId, channelType, merchantName } = storageApi.getUserInfo() const { shopMerchantId, phone, sceneType, uuid, name, merchantId, channelType, merchantName } = storageApi.getUserInfo()
const { deviceId: appCode } = uni.getDeviceInfo() const { deviceId: appCode } = uni.getDeviceInfo()
const dto = new RecordDto({ const dto = new RecordDto({
...@@ -146,22 +146,26 @@ export default { ...@@ -146,22 +146,26 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName, merchantName,
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改 bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
channelType: channelType || 1 //1问界 2 比亚迪 3 其他 channelType: channelType || 1,//1问界 2 比亚迪 3 其他
}) })
this.sceneType = sceneType this.sceneType = sceneType
this.tempRecord = dto this.tempRecord = dto
}, },
updateCustomerInfo(customerInfo = {}) { updateCustomerInfo (customerInfo = {}) {
const { customerName, phoneNumber, salesUuid, carModel, staffName: salesName } = customerInfo const { customerName, phoneNumber, salesUuid, carModel, staffName: salesName, carBrand, carBrandId, oneCarBrand, oneCarBrandId } = customerInfo
this.record.updatePreRecords({ this.record.updatePreRecords({
customerName, customerName,
phoneNumber, phoneNumber,
carModel, carModel,
salesUuid, salesUuid,
salesName salesName,
carBrand,
carBrandId,
oneCarBrand,
oneCarBrandId
}) })
}, },
updateBookList(booksList) { updateBookList (booksList) {
const receptionCustomerPaySourceList = booksList.map(item => { const receptionCustomerPaySourceList = booksList.map(item => {
return { return {
id: item.id, id: item.id,
...@@ -171,7 +175,7 @@ export default { ...@@ -171,7 +175,7 @@ export default {
}) })
this.record.updatePreRecords({ receptionCustomerPaySourceList }) this.record.updatePreRecords({ receptionCustomerPaySourceList })
}, },
updateMaterialPointList(receptionTrack) { updateMaterialPointList (receptionTrack) {
const { merchantId, staffUuid, staffName } = this.tempRecord const { merchantId, staffUuid, staffName } = this.tempRecord
let receptionCustomerMaterialPointList = [] let receptionCustomerMaterialPointList = []
Object.keys(receptionTrack).map(key => { Object.keys(receptionTrack).map(key => {
...@@ -185,17 +189,17 @@ export default { ...@@ -185,17 +189,17 @@ export default {
}) })
this.record.updatePreRecords({ receptionCustomerMaterialPointList }) this.record.updatePreRecords({ receptionCustomerMaterialPointList })
}, },
updateReceptionStatus(status) { updateReceptionStatus (status) {
this.record.updatePreRecords({ receptionStatus: status }) this.record.updatePreRecords({ receptionStatus: status })
}, },
getRecorder() { getRecorder () {
return this.record return this.record
}, },
async triggleTempNumber() { async triggleTempNumber () {
const _records = await this.record.getRecords() const _records = await this.record.getRecords()
this.setPerRecordNumber(_records.length) this.setPerRecordNumber(_records.length)
}, },
async isPermission(hintText = '为了记录语音通话,请打开录音权限') { async isPermission (hintText = '为了记录语音通话,请打开录音权限') {
const result = await permision.requestAndroidPermission('android.permission.RECORD_AUDIO') const result = await permision.requestAndroidPermission('android.permission.RECORD_AUDIO')
await helpler.sleep(0) await helpler.sleep(0)
if (result !== 1) { if (result !== 1) {
...@@ -206,13 +210,13 @@ export default { ...@@ -206,13 +210,13 @@ export default {
} }
return result === 1 return result === 1
}, },
async checkBeforeStart() { async checkBeforeStart () {
const isPermission = await this.isPermission() const isPermission = await this.isPermission()
const isRecording = this.audioManager.isRecording const isRecording = this.audioManager.isRecording
return isPermission && !isRecording return isPermission && !isRecording
} }
}, },
beforeDestroy() { beforeDestroy () {
this.stop() this.stop()
this.reset() this.reset()
} }
......
...@@ -3,7 +3,7 @@ export default { ...@@ -3,7 +3,7 @@ export default {
return { return {
goodsId: '', goodsId: '',
visitsId: '', visitsId: '',
source: 1 source: ''
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -15,28 +15,27 @@ export default { ...@@ -15,28 +15,27 @@ export default {
methods: { methods: {
addRecord () { addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo') const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
if(!merchantId) return if (!merchantId || !this.goodsId) return
const params = { const params = {
goodsId: this.goodsId, goodsId: this.goodsId,
goodsType: 0, goodsType: 0,
merchantId, merchantId,
merchantName, merchantName,
searchSource: this.source
} }
if (this.visitsId) params.visitsId = this.visitsId if (this.visitsId) params.visitsId = this.visitsId
if (this.source) params.searchSource = this.source
uni.$api.commonApi.addRecord(params).then(res => { uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res this.addId = res
}) })
} }
}, },
onUnload () { onUnload () {
if(!this.addId) return if (!this.addId) return
const params = { const params = {
id: this.addId id: this.addId
} }
if (this.visitsId) params.visitsId = this.visitsId if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.leaveRecord(params).then(res => { uni.$api.commonApi.leaveRecord(params).then(res => {
console.log(res, 888)
}) })
} }
} }
{ {
"dependencies": { "dependencies": {
"@js-preview/docx": "^1.6.4",
"@js-preview/excel": "^1.7.14",
"@js-preview/pdf": "^2.0.10",
"core-js": "^3.44.0",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
......
...@@ -153,11 +153,41 @@ ...@@ -153,11 +153,41 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/common/studyDetail/longCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/shortCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/detail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/serviceDetail/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/materialDetail/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "生意助手", "navigationBarTitleText": "展业助手",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8",
"pageOrientation": "landscape", "pageOrientation": "landscape",
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import dayjs from 'dayjs'
export default { export default {
name: 'case', name: 'case',
data () { data () {
...@@ -161,7 +161,10 @@ export default { ...@@ -161,7 +161,10 @@ export default {
value: '全部' value: '全部'
}, },
], ],
scrollTop: 0 scrollTop: 0,
startDate: '',
endDate: '',
userInfo: {}
} }
}, },
props: { props: {
...@@ -187,18 +190,89 @@ export default { ...@@ -187,18 +190,89 @@ export default {
}, },
show: { show: {
handler (newValue) { handler (newValue) {
console.log('案例视频', newValue)
if (newValue) this.init() if (newValue) this.init()
if (!newValue) this.handleLeavePage()
}, },
immediate: true immediate: true
} }
}, },
mounted () { mounted () {
const userInfo = uni.$storage.get("userInfo")
this.userInfo = userInfo
this.init() this.init()
console.log('案例视频')
this.getCategory() this.getCategory()
}, },
methods: { methods: {
// 离开页面时上传埋点并清空缓存
async handleLeavePage() {
try {
const caseInfo = uni.$storage.get("caseInfo")
console.log(caseInfo, 'caseInfo')
if (caseInfo && caseInfo.length > 0) {
await this.uploadData(caseInfo)
uni.$storage.rm("caseInfo")
}
} catch (e) {
// 可选:错误处理
console.error('上传埋点失败', e)
} finally {
}
},
// 埋点
async sendData (params) {
const { shopMerchantId, sceneType, uuid, name } = this.userInfo
const { startDate, endDate } = this
const default_params = {
merchantId: shopMerchantId,
businessScene: sceneType,
staffUuid: uuid,
staffName: name,
materialType: 'case',
}
const _params = {
...default_params,
...params
}
// 获取本地缓存的caseInfo
let caseInfo = uni.$storage.get("caseInfo") || []
// 查找是否有相同素材(id相同)
const idx = caseInfo.findIndex(item => item.materialId === params.materialId)
console.log(idx, 'idx')
if (idx !== -1) {
// 已存在,openCount+1
caseInfo[idx].openCount = (caseInfo[idx].openCount || 1) + 1
} else {
// 不存在,push新对象
caseInfo.push({
..._params,
openCount: 1,
})
}
// 更新缓存
uni.$storage.set("caseInfo", caseInfo)
},
// 上传埋点
async uploadData (caseInfo) {
console.log(caseInfo, 'caseInfo')
// const caseInfo = uni.$storage.get("caseInfo")
if (caseInfo && caseInfo.length > 0) {
await uni.$api.boutiqueApi.caseVideoCenter({receptionCustomerMaterialPointList:caseInfo})
}
},
playVideo (item) { playVideo (item) {
console.log(item, 'item')
this.$emit('preview', item) this.$emit('preview', item)
const params = {
materialId: item.id,
materialName: item.name,
receptionDate: dayjs().format('YYYY-MM-DD HH:mm:ss')
}
this.sendData(params)
}, },
focus () { focus () {
this.isSearch = true this.isSearch = true
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</template> </template>
</view> </view>
<template v-if="nothing"> <template v-if="nothing">
<view class="end-text">到底了!</view> <view class="end-text">-已经到底了-</view>
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
......
...@@ -9,110 +9,12 @@ ...@@ -9,110 +9,12 @@
finishDoneText="下一步" finishDoneText="下一步"
finishContene="当前操作是为强制退出接待,若完成客户接待请点击「下一步」。" finishContene="当前操作是为强制退出接待,若完成客户接待请点击「下一步」。"
@previewCancel="cancel" @previewCancel="cancel"
@previewClose="previewOff = false"
class="container" class="container"
:moduleList="moduleList"
@swiperClick="toDetail"
bannerKey="bannerImg"
:loadComplete="loadComplete"
> >
<template slot="module">
<view class="module-box">
<view class="module-flex flex">
<template v-for="(i, index) in moduleList">
<view
class="item flex"
:key="index"
v-if="!i.hide"
@click="toDetail(i)"
>
<image
:src="i.thumbnail"
class="icon"
/>
{{ i.title }}
<template v-if="i.count">
<div class="count">
{{i.count}}
</div>
</template>
</view>
</template>
</view>
<view class="center-bg"></view>
<view class="banner-tab-scroll">
<scroll-view
class="banner-tab-box-content"
scroll-x
:scroll-into-view="bannerTabId"
scroll-with-animation
>
<view class="banner-tab-box flex">
<template v-for="(item, index) in carBannerList">
<view
:class="['banner-item',{'has-title':showCarBrand(item,index)},{'is-first':index == 0}]"
:key="index"
:id="`car-banner-${index}`"
>
<view class="banner-title">{{item.title}}</view>
<view
:class="['banner-tab', `${currentIndex == index ? 'active' : ''}`]"
@click="changeIndex(index)"
>
{{ item.name }}
</view>
</view>
</template>
<view class="block"></view>
</view>
</scroll-view>
<view class="banner-tab-mask"></view>
</view>
<swiper
class="swiper"
circular
interval="3000"
previous-margin="380rpx"
next-margin="448rpx"
@change="swiperChange"
:current="currentIndex"
:autoplay="bannerAutoplay && !previewOff"
>
<!-- :autoplay="bannerAutoplay && !previewOff" -->
<template v-for="(item, index) in carBannerList">
<swiper-item
:key="index"
:class="['swiper-item flex', carClass(index)]"
@click.prevent="clickCar(item, index)"
>
<image
:src="item.url"
class="car-item"
/>
<template v-if="currentIndex == index">
<view class="config-box">
<template v-for="(i, ind) in item.configList">
<view
:class="['config-item', i.class]"
:key="ind"
@click.stop="toDetail({ id: 1, tabId: i.tabId })"
>
<view class="config-dots"></view>
<view class="config-name flex">
<view :class="['sprite-icon', `icon-${i.icon}`]"></view>
{{ i.name }}
</view>
</view>
</template>
</view>
</template>
</swiper-item>
</template>
</swiper>
<view class="tips">
窗膜精品,更有整车搭配套餐火爆售卖。
<view>点击了解更多&gt;</view>
</view>
</view>
</template>
<template slot="detail"> <template slot="detail">
<detail <detail
:id.sync="id" :id.sync="id"
...@@ -129,9 +31,11 @@ ...@@ -129,9 +31,11 @@
/> />
</template> </template>
<template slot="content"> <template slot="content">
<customer-type <center-popup
:list="typeList"
ref="customerTypeRef" ref="customerTypeRef"
@choose="chooseCustomerType" @choose="chooseCustomerType"
title="请选择当前洽谈的客户类型"
/> />
</template> </template>
</home-frame> </home-frame>
...@@ -140,7 +44,7 @@ ...@@ -140,7 +44,7 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import HomeFrame from '@/components/HomeFrame/index.vue' import HomeFrame from '@/components/HomeFrame/index.vue'
import detail from './detail.vue' import detail from './detail.vue'
import CustomerType from './components/CustomerType.vue'; import CenterPopup from '@/components/CenterPopup.vue'
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
const defaultConfig = [ const defaultConfig = [
{ {
...@@ -166,7 +70,7 @@ const defaultConfig = [ ...@@ -166,7 +70,7 @@ const defaultConfig = [
} }
] ]
export default { export default {
components: { HomeFrame, detail, CustomerType }, components: { HomeFrame, detail, CenterPopup },
name: 'boutique', name: 'boutique',
data () { data () {
return { return {
...@@ -185,7 +89,19 @@ export default { ...@@ -185,7 +89,19 @@ export default {
previewOff: false, previewOff: false,
mediaConfigList: [], mediaConfigList: [],
bannerTabId: 'car-banner-0', bannerTabId: 'car-banner-0',
defaultCarId: '' defaultCarId: '',
typeList: Object.freeze([
{
title: '回店客户',
describe: '客户已领精品券且已上牌完成\n交付安排客户当日回店提车',
icon: 'icon-customer-1'
}, {
title: '现场客户',
describe: '客户未领取精品券\n首次到店',
icon: 'icon-customer-2'
}
]),
loadComplete:false
} }
}, },
onBackPress (options) { onBackPress (options) {
...@@ -200,9 +116,7 @@ export default { ...@@ -200,9 +116,7 @@ export default {
}, },
onLoad () { onLoad () {
this.init(); this.init();
uni.$api.systemApi.getMockData(true).then(res => { uni.$api.systemApi.getMockData(true)
console.log(res)
})
}, },
onShow () { onShow () {
const userInfo = uni.$storage.get("userInfo") const userInfo = uni.$storage.get("userInfo")
...@@ -308,16 +222,15 @@ export default { ...@@ -308,16 +222,15 @@ export default {
this.moduleList = moduleList this.moduleList = moduleList
this.toolList = toolList this.toolList = toolList
this.defaultCarId = defaultCarId this.defaultCarId = defaultCarId
this.getInviteRecordCount() this.loadComplete = true
}, },
toDetail (item) { toDetail (index) {
let item = this.moduleList[index]
this.chooseItem = item this.chooseItem = item
this.$refs.home.previewRef.open(); this.$refs.home.previewRef.open();
this.previewOff = true
}, },
cancel () { cancel () {
this.$refs.home.previewRef.close(); this.$refs.home.previewRef.close();
this.previewOff = false
}, },
preview () { preview () {
let { id, tabId } = this.chooseItem; let { id, tabId } = this.chooseItem;
...@@ -325,6 +238,8 @@ export default { ...@@ -325,6 +238,8 @@ export default {
this.id = id; this.id = id;
this.tabId = tabId this.tabId = tabId
this.currentCarId = this.carBannerList[this.currentIndex].carModelId this.currentCarId = this.carBannerList[this.currentIndex].carModelId
console.log(id)
}, },
back () { back () {
if (!this.id) return uni.navigateBack(); if (!this.id) return uni.navigateBack();
...@@ -346,7 +261,6 @@ export default { ...@@ -346,7 +261,6 @@ export default {
this.type = ""; this.type = "";
this.currentCarId = '' this.currentCarId = ''
this.bannerAutoplay = true this.bannerAutoplay = true
this.previewOff = false
this.customerType = -1 this.customerType = -1
this.clearHistory(); this.clearHistory();
this.recording = false this.recording = false
...@@ -463,17 +377,6 @@ export default { ...@@ -463,17 +377,6 @@ export default {
if (index != 0 && item.seriesId == carBannerList[index - 1].seriesId) result = false if (index != 0 && item.seriesId == carBannerList[index - 1].seriesId) result = false
return result return result
}, },
async getInviteRecordCount () {
const { moduleList } = this,
userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId: merchantId } = userInfo,
{notInvitedCount} = await uni.$api.boutiqueApi.getInviteRecordCount({
merchantIds: [merchantId]
})
moduleList.map(e => {
if (e.id == 3) e.count = notInvitedCount ? notInvitedCount > 99 ? 99 : notInvitedCount : 0
})
}
} }
} }
</script> </script>
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</template> </template>
</view> </view>
<template v-if="nothing"> <template v-if="nothing">
<view class="end-text">到底了!</view> <view class="end-text">-已经到底了-</view>
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!