Commit 7b016cc0 by 前端

埋点

1 parent 542dc46f
......@@ -2,20 +2,20 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-18 17:59:32
* @LastEditTime: 2024-08-30 17:28:05
* @FilePath: \gl_tape\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script>
var wv
const PATH = ['/pages/common/caseDetail']
import { mapState } from 'vuex'
export default {
computed: {
...mapState('audio', ['isEnd', 'isStart'])
},
onLoad() {},
onLaunch: async function () {
// this.init()
this.setAPPVersion()
setTimeout(() => {
plus.screen.unlockOrientation() //解除锁定屏幕方向
......@@ -26,6 +26,46 @@ export default {
})
},
methods: {
init() {
uni.addInterceptor('navigateTo', {
//监听跳转
invoke(e) {
console.log('******** invoke-navigateTo ********', e.url.split('?').shift())
if (PATH.includes(e.url.split('?').shift())) {
console.log(888)
}
}
})
//2
uni.addInterceptor('redirectTo', {
//监听关闭本页面跳转
invoke(e) {
console.log('******** redirectTo ********', e.url)
}
})
uni.addInterceptor('switchTab', {
//监听tabBar跳转
invoke(e) {
console.log('******** switchTab ********', e.url)
}
})
//4
uni.addInterceptor('navigateBack', {
//监听返回
invoke(e) {
console.log('******** navigateBack ********', e)
}
})
},
setAPPVersion() {
let version = plus.runtime.version
let storageVersion = uni.$storage.get('storageVersion')
......@@ -60,6 +100,7 @@ export default {
body {
// overflow: hidden;
}
page {
font-size: 28rpx;
height: 100%;
......@@ -121,6 +162,7 @@ button::after {
.button-hover {
transform: translate(1rpx, 1rpx);
}
.webview-container {
position: absolute;
width: 100rpx;
......
import http from "../request/http";
import environment from "@/env";
import http from '../request/http'
import environment from '@/env'
module.exports = {
/**获取APP更新 */
getAPPVersion (data) {
getAPPVersion(data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.findVersion',
projectName: "boutique",
...data,
});
projectName: 'boutique',
...data
})
},
// 查询接待素材
findSoureList (data) {
findSoureList(data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
projectName: "boutique",
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
projectName: 'boutique',
...data
});
})
},
// 查询门店支付配置
findPayInfo (data) {
findPayInfo(data) {
return http.post({
method:
"dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId',
projectName: 'boutique',
...data
})
},
// 接待客户信息保存
saveRecCustomer (data) {
saveRecCustomer(data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.customer.saveRecCustomer",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.recepiton.customer.saveRecCustomer',
projectName: 'boutique',
...data
})
},
getToken (data) {
getToken(data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.customer.oss.getToken",
projectName: "boutique",
});
method: 'dj.api.smartcarlife.recepiton.customer.oss.getToken',
projectName: 'boutique'
})
},
// 历史订单列表
getQuotationList (data) {
getQuotationList(data) {
return http.post({
method: "dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
...data
})
},
/** 获取门店主营车品牌 */
getMerchantCarBrandList (merchantIdList) {
return http.post({
method: 'merchants.api.open.merchant.info',
projectName: 'merchants',
merchantIdList,
merchantInfoSwitch: {
brandFlag: true
}
}, false, 'merchant')
getMerchantCarBrandList(merchantIdList) {
return http.post(
{
method: 'merchants.api.open.merchant.info',
projectName: 'merchants',
merchantIdList,
merchantInfoSwitch: {
brandFlag: true
}
},
false,
'merchant'
)
},
/**
* 车型
*
*/
getCarBrandsList (data) {
getCarBrandsList(data) {
return http.post(
{
method: "scrm.api.carlife.common.getCarSeriesList",
...data,
method: 'scrm.api.carlife.common.getCarSeriesList',
...data
},
false,
"scrm"
);
'scrm'
)
},
/**
* 推荐人
*/
getEmployeeList (data) {
getEmployeeList(data) {
return http.post({
method: "dj.api.smartcarlife.employee.getByMerchantId",
projectName: "boutique",
method: 'dj.api.smartcarlife.employee.getByMerchantId',
projectName: 'boutique',
sceneList: [0],
...data,
});
...data
})
},
/** 查询接待记录列表 */
getReceptionList (data) {
getReceptionList(data) {
return http.post({
method: "dj.api.smartcarlife.reception.customer.page",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.reception.customer.page',
projectName: 'boutique',
...data
})
},
/** 接待统计 */
getReceptionStatistics (data) {
getReceptionStatistics(data) {
return http.post({
method: "dj.api.smartcarlife.reception.customer.statistics",
projectName: "boutique",
...data,
});
method: 'dj.api.smartcarlife.reception.customer.statistics',
projectName: 'boutique',
...data
})
},
/** 埋点进入 */
addRecord(data) {
return http.post({
method: 'dj.api.customer.dynamic.record.add',
projectName: 'boutique',
...data
})
},
/** 埋点离开 */
leaveRecord(data) {
return http.post({
method: 'dj.api.customer.dynamic.record.leave',
projectName: 'boutique',
...data
})
},
/**创建小程序码 */
createQrcode (data) {
createQrcode(data) {
const envVersion = {
0: 'develop',
1: 'develop',
......@@ -112,10 +131,15 @@ module.exports = {
3: 'release',
4: 'trial'
}[environment.index]
data.projectName = "wechat"
return http.fetch("scrm.api.wechat.miniprogram.createQrcode", {
envVersion,
...data
}, true, 'scrm');
},
};
data.projectName = 'wechat'
return http.fetch(
'scrm.api.wechat.miniprogram.createQrcode',
{
envVersion,
...data
},
true,
'scrm'
)
}
}
......@@ -2,41 +2,41 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-11 16:47:29
* @LastEditTime: 2024-08-30 14:49:02
* @FilePath: \gl_tape\main.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from "vue";
import App from "./App";
import config from "@/config.js";
import store from "@/store";
import api from "./api/index";
import { Storage } from "./utils/cache/index";
import GlsxImage from "./components/GlsxImage";
import MessageBox from "./components/MessageBox/index";
import wnCanvas from "./components/Canvas/wn-canvas";
import UpdateBox from "./components/UpdateBox";
import webView from "./components/WebView";
import utils from "./utils/utils";
Vue.use(webView);
Vue.component("GlsxImage", GlsxImage);
Vue.component("MessageBox", MessageBox);
Vue.component("wnCanvas", wnCanvas);
Vue.component("UpdateBox", UpdateBox);
import RecordManager from "@/utils/RecordManager";
const recordManager = RecordManager.getInstance();
recordManager.compatible();
uni.$recordManager = recordManager;
uni.$api = api;
uni.$lock = false;
uni.$storage = new Storage();
uni.$throttle = utils.throttle;
uni.$isNetWork = utils.isNetWork;
Vue.config.productionTip = false;
App.mpType = "app";
Vue.prototype.$ossDomain = config.OSS_DOMAIN;
import permision from "@/js_sdk/wa-permission/permission.js";
import { index } from "./env";
import Vue from 'vue'
import App from './App'
import config from '@/config.js'
import store from '@/store'
import api from './api/index'
import { Storage } from './utils/cache/index'
import GlsxImage from './components/GlsxImage'
import MessageBox from './components/MessageBox/index'
import wnCanvas from './components/Canvas/wn-canvas'
import UpdateBox from './components/UpdateBox'
import webView from './components/WebView'
import utils from './utils/utils'
Vue.use(webView)
Vue.component('GlsxImage', GlsxImage)
Vue.component('MessageBox', MessageBox)
Vue.component('wnCanvas', wnCanvas)
Vue.component('UpdateBox', UpdateBox)
import RecordManager from '@/utils/RecordManager'
const recordManager = RecordManager.getInstance()
recordManager.compatible()
uni.$recordManager = recordManager
uni.$api = api
uni.$lock = false
uni.$storage = new Storage()
uni.$throttle = utils.throttle
uni.$isNetWork = utils.isNetWork
Vue.config.productionTip = false
App.mpType = 'app'
Vue.prototype.$ossDomain = config.OSS_DOMAIN
import permision from '@/js_sdk/wa-permission/permission.js'
import { index } from './env'
// switch (uni.getSystemInfoSync().platform) {
// case "android":
// permision.requestAndroidPermission("android.permission.RECORD_AUDIO");
......@@ -47,19 +47,19 @@ import { index } from "./env";
// permision.judgeIosPermission("camera");
// break;
// }
Vue.prototype.$permision = permision;
import sentryInit from "@/utils/sentryConfig/sentryInit";
Vue.prototype.$permision = permision
import sentryInit from '@/utils/sentryConfig/sentryInit'
if (index == 3) {
const sentry = sentryInit();
const sentry = sentryInit()
Vue.prototype.$sendSentry = function (e) {
sentry.captureException(e);
};
sentry.captureException(e)
}
} else {
Vue.prototype.$sendSentry = function () {};
Vue.prototype.$sendSentry = function () {}
}
const app = new Vue({
store,
...App,
});
app.$mount();
...App
})
app.$mount()
<template>
<view class="case-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
{{caseObject.title}}
{{ caseObject.title }}
</view>
<view class="case-content">
<view class="left-menu">
<view class="title">方案目录</view>
<scroll-view
scroll-y
class="scroll"
:scroll-into-view="`menu-${currentId}`"
@scroll="menuScroll"
>
<view
class="scroll-content"
id="scroll-content"
>
<template v-for="(item,index) in detailInfo">
<view
class="item"
:key="index"
>
<view
:class="['name',isLast(index), isActive(item)]"
@click="menuClick(item)"
>
<view
class="text"
:id="`menu-${item.id}`"
>{{item.headings}}</view>
<scroll-view scroll-y class="scroll" :scroll-into-view="`menu-${currentId}`" @scroll="menuScroll">
<view class="scroll-content" id="scroll-content">
<template v-for="(item, index) in detailInfo">
<view class="item" :key="index">
<view :class="['name', isLast(index), isActive(item)]" @click="menuClick(item)">
<view class="text" :id="`menu-${item.id}`">{{ item.headings }}</view>
</view>
<template v-if="item.children && item.children.length">
<template v-for="(i,j) in item.children">
<view
:class="['name',isLast(index,j,item.children),isActive(i)]"
:key="j"
@click="menuClick(i)"
>
<view
class="text"
:id="`menu-${i.id}`"
>
<template v-for="(i, j) in item.children">
<view :class="['name', isLast(index, j, item.children), isActive(i)]" :key="j" @click="menuClick(i)">
<view class="text" :id="`menu-${i.id}`">
<view class="icon"></view>
{{i.headings}}
{{ i.headings }}
</view>
</view>
</template>
</template>
</view>
</template>
<template v-if="currentId">
<view
class="block"
:style="blockTop"
></view>
<view class="block" :style="blockTop"></view>
</template>
</view>
</scroll-view>
</view>
<scroll-view
class="right-content"
scroll-y
:scroll-into-view="`case-${contentId}`"
@scroll="contentScroll"
scroll-with-animation
>
<template v-for="(item,index) in detailInfo">
<view
class="detail-item"
:key="item.id"
>
<view
class="item-title"
:id="`case-${item.id}`"
>{{item.headings}}</view>
<scroll-view class="right-content" scroll-y :scroll-into-view="`case-${contentId}`" @scroll="contentScroll" scroll-with-animation>
<template v-for="(item, index) in detailInfo">
<view class="detail-item" :key="item.id">
<view class="item-title" :id="`case-${item.id}`">{{ item.headings }}</view>
<template v-if="item.audio">
<audio-component
:src="item.audio"
@onPlay="onPlay(item.id)"
:ref="`audio-${item.id}`"
/>
<audio-component :src="item.audio" @onPlay="onPlay(item.id)" :ref="`audio-${item.id}`" />
</template>
<view class="item-content">
<rich-text :nodes="item.content"></rich-text>
</view>
<template v-for="(i,ind) in item.pictureList">
<image
:key="`img-${index}-${ind}`"
:src="i"
class="item-img"
mode="widthFix"
@load="imgLoad"
></image>
<template v-for="(i, ind) in item.pictureList">
<image :key="`img-${index}-${ind}`" :src="i" class="item-img" mode="widthFix" @load="imgLoad"></image>
</template>
<template v-if="item.children && item.children.length">
<template v-for="(i,s) in item.children">
<view
class="sub-item-content"
:key="s"
>
<view
class="item-title sub-item-title flex"
:id="`case-${i.id}`"
>{{i.headings}}</view>
<template v-for="(i, s) in item.children">
<view class="sub-item-content" :key="s">
<view class="item-title sub-item-title flex" :id="`case-${i.id}`">{{ i.headings }}</view>
<template v-if="i.audio">
<audio-component
:src="i.audio"
@onPlay="onPlay(i.id)"
:ref="`audio-${i.id}`"
/>
<audio-component :src="i.audio" @onPlay="onPlay(i.id)" :ref="`audio-${i.id}`" />
</template>
<view class="item-content">
<rich-text :nodes="i.content"></rich-text>
</view>
<template v-for="(c,k) in i.pictureList">
<image
:key="k"
:src="c"
class="item-img"
mode="widthFix"
@load="imgLoad"
></image>
<template v-for="(c, k) in i.pictureList">
<image :key="k" :src="c" class="item-img" mode="widthFix" @load="imgLoad"></image>
</template>
</view>
</template>
......@@ -142,12 +68,11 @@
<view class="content-end">到底了!</view>
</scroll-view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import AudioComponent from './components/AudioComponent.vue'
const view_padding_top = 88,
menuHeight = 68
......@@ -280,7 +205,10 @@ export default {
}
},
onLoad (options) {
this.visitsId = options.visitsId
this.goodsId = options.id
this.getMaterialDetail(options.id)
this.addRecord()
},
watch: {
currentId (n) {
......@@ -294,9 +222,31 @@ export default {
},
computed: {
},
mounted () {
onUnload() {
const params = {
id: this.addId,
visitsId:this.visitsId
}
uni.$api.commonApi.leaveRecord(params).then(res=>{
console.log(res,888)
})
},
methods: {
addRecord() {
const { shopMerchantId:merchantId ,shopMerchantName:merchantName} = uni.$storage.get('userInfo')
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
visitsId:this.visitsId
}
uni.$api.commonApi.addRecord(params).then(res=>{
this.addId = res
console.log(this.addId,'this.addId')
})
},
async getMaterialDetail (id) {
const res = await uni.$api.customerApi.getMaterialDetail({
id
......@@ -381,7 +331,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.case-box {
position: relative;
width: 100vw;
......@@ -552,4 +502,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<view class="detail-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
车主详情
</view>
......@@ -17,54 +10,34 @@
<view class="title">车主信息</view>
<view class="customer-info">
<template v-for="(item, index) in customerForm">
<view
class="item flex"
:key="index"
>
<view class="label">{{item.label}}</view>
<view class="value text-hide">{{customerInfo[item.key]}}</view>
<view class="item flex" :key="index">
<view class="label">{{ item.label }}</view>
<view class="value text-hide">{{ customerInfo[item.key] }}</view>
</view>
</template>
</view>
</view>
<view class="case-box box">
<view class="title flex">
推荐套餐
</view>
<scroll-view
class="case-scroll-box"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="title flex">推荐套餐</view>
<scroll-view class="case-scroll-box" scroll-y @scrolltolower="pageonReachBottom">
<view class="case-list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template v-for="item in i">
<view
class="case-item"
:key="item.id"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover || ''"
></image>
<view class="case-item" :key="item.id" @click="jumpDetail(item)">
<image class="img" :src="item.cover || ''"></image>
<view class="case-info">
<view class="case-name text-hide">{{item.title}}</view>
<template v-for="(j,ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{j.label}}:</view>
<view :class="['case-value',j.class]">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view class="case-text flex" :key="ind">
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
{{j.format(item)}}
{{ j.format(item) }}
</template>
<template v-else>
{{item[j.key] || '--'}}
{{ item[j.key] || '--' }}
</template>
</view>
</view>
......@@ -76,10 +49,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="@/assets/images/home/nothing.webp"
/>
<image class="icon" src="@/assets/images/home/nothing.webp" />
暂无推荐套餐
</view>
</template>
......@@ -99,7 +69,7 @@
</view>
</template>
<script type='text/ecmascript-6'>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import PackagePopup from './components/PackagePopup.vue'
export default {
......@@ -170,7 +140,10 @@ export default {
}
},
onLoad (options) {
if (options.id) this.findVisitsInfo(options.id)
if (options.id) {
this.findVisitsInfo(options.id)
this.visitsId = options.id
}
else {
uni.showToast({
title: '客户id为空',
......@@ -260,7 +233,7 @@ export default {
jumpDetail (item) {
console.log(item.type)
// 类型:0-图片;1-视频;2-pdf;3-富文本
let url = `/pages/common/caseDetail?id=${item.id}`
let url = `/pages/common/caseDetail?id=${item.id}&visitsId=${this.visitsId}`
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) url = `/pages/common/webview?url=${fileUrl}&title=${item.title}`
......@@ -282,7 +255,7 @@ export default {
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
......@@ -441,4 +414,4 @@ export default {
padding: 50rpx 0;
font-size: 24rpx;
}
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!