Commit 7bf48276 authored by Morson's avatar Morson

1、登录页接入易观埋点

2、入驻-在线考试页面搭建
3、入驻-培训视频页面搭建
4、入驻-培训视频接口对接
parent 0487b6ba
...@@ -21,3 +21,4 @@ yarn-error.log* ...@@ -21,3 +21,4 @@ yarn-error.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw* *.sw*
.history/
<script> <script>
import './../.env.js' import './../.env.js'
import {
AnalysysAgent
} from '@/utils/analysys_paas.js'
import util from '@/utils/util.js' import util from '@/utils/util.js'
export default { export default {
globalData:{ globalData:{
// 开发环境
uniEnv:process.uniEnv, uniEnv:process.uniEnv,
token: '', // 登录凭证
//lyf的token:RTOKENf7d46ea33a7923515abfa779e04eccba77f98604 token: '',
//RTOKEN45f41a3053238cb72b3b72fe14df8d7040c9f502
// 授权用户信息 //授权提示 图标
icon_auth_notice: 'https://qn-static.banshouhui.com/auth_notice.png',
//授权提示新 图标
icon_auth_notice_new: 'https://qn-static.banshouhui.com/auth_notice_new.png',
// 服务规范教程视频
service_standard: {
"Course1": {
url: "https://xy-hybrid.kakalili.com/web/vivaVideo/home/static/img/videoen.mp4",
title: "第一节 接单服务标准",
desc: "1.不同车企品牌结算价格不一,675元-1890元不等;",
},
"Course2": {
url: "https://xy-hybrid.kakalili.com/web/vivaVideo/home/static/img/videoen.mp4",
title: "第二节 完工服务标准",
desc: "2.结算价格为包工包料价,安装材料根据车企品牌规格自行采购(电缆、空开、漏保);",
},
"Course3": {
url: "https://xy-hybrid.kakalili.com/web/vivaVideo/home/static/img/videoen.mp4",
title: "第二节 结算服务标准",
desc: "3.需具备一定的作业工具:如液压压线钳、冲击钻、电锤、登高安全带、电锤、绝缘电阻仪(摇表)、交流充电模拟器等;",
},
},
// 授权用户信息
authUserInfo: '', authUserInfo: '',
}, },
onLaunch: function() { onLaunch: function() {
// 应用初始化(全局只触发一次) // 应用初始化(全局只触发一次)
let that = this let that = this
that.globalData.token = util.getToken() that.globalData.token = util.getToken()
AnalysysAgent.registerSuperProperty("platform", "self-support");
}, },
onShow: function() { onShow: function() {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
...@@ -96,6 +125,76 @@ ...@@ -96,6 +125,76 @@
util.setToken('') util.setToken('')
} }
}, },
/* ------------------------- 数据埋点begin ------------------------------ */
track(event, properties) {
if (AnalysysAgent) {
// 易观添加事件
let AnalysysAgent = wx.AnalysysAgent;
AnalysysAgent.track("take_order_" + event, properties);
}
},
identify(userInfo, openid, unionid = null) {
// 设备身份表示
if (AnalysysAgent) {
let setProfile = {
'openid': openid,
'unionid': unionid,
}
setProfile = Object.assign(setProfile, userInfo)
AnalysysAgent.profileSet(setProfile);
}
},
setUserId(userId) {
// 用户id设置
if (AnalysysAgent) {
AnalysysAgent.alias(userId + '')
}
},
setUser(user) {
// 用户附加属性
if (AnalysysAgent) {
let userInfo = {
'mobile': user.mobile,
'userfrom_id': user.uid,
'userfrom': '家维广场',
'avatar': user.avatar,
'nickname': user.nickname,
'username': user.username,
'wxhuid': user.wxhuid,
'id': user.id,
'money': user.money,
'score': user.score
};
Object.keys(userInfo).map(key => {
if (key && userInfo[key]) {
AnalysysAgent.profileAppend(key, userInfo[key])
}
})
}
},
share(toShareProperties, trackProperties) {
if (AnalysysAgent) {
AnalysysAgent.share(toShareProperties, trackProperties);
}
},
trackPage(pageName, properties) {
if (AnalysysAgent) {
AnalysysAgent.pageView(pageName, properties);
}
},
initShare(option) {
console.log(option, 'option-initShare')
option = option || {}
if (AnalysysAgent && option.user_id) {
let shareUserInfo = {
'share_from_id': option.user_id || '',
'share_from_nickname': option.user_name || '',
}
AnalysysAgent.registerSuperProperties(shareUserInfo);
}
},
/* ------------------------- 数据埋点end ------------------------------ */
} }
} }
</script> </script>
...@@ -106,4 +205,5 @@ ...@@ -106,4 +205,5 @@
<style lang="scss"> <style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */ /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
@import '@/common/index.scss';
</style> </style>
\ No newline at end of file
...@@ -32,6 +32,12 @@ let settledApiFun = function(vm){ ...@@ -32,6 +32,12 @@ let settledApiFun = function(vm){
/* 提交认证资料 */ /* 提交认证资料 */
let checkSettleSignInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/check-sign-info', params,{'content-type': 'application/x-www-form-urlencoded'}); let checkSettleSignInfo = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/check-sign-info', params,{'content-type': 'application/x-www-form-urlencoded'});
/* 获取接单教程列表 */
let listOrderingTutorials = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/get-course-rate', params);
/* 更新接单教程状态 */
let saveCourseRate = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/settled/save-course-rate', params);
const settledApi = { const settledApi = {
getSettleBaseInfo, getSettleBaseInfo,
getSettleArea, getSettleArea,
...@@ -43,7 +49,9 @@ let settledApiFun = function(vm){ ...@@ -43,7 +49,9 @@ let settledApiFun = function(vm){
getSettleDepositResult, getSettleDepositResult,
// checkSettleBank, // checkSettleBank,
// checkSettleAlipay, // checkSettleAlipay,
checkSettleSignInfo checkSettleSignInfo,
listOrderingTutorials,
saveCourseRate,
} }
return settledApi return settledApi
} }
......
page{ page {
background-color: #FAFAFA; background-color: #fafafa;
} }
.btn-share { .btn-share {
background-color: transparent; background-color: transparent;
...@@ -13,4 +13,17 @@ page{ ...@@ -13,4 +13,17 @@ page{
width: 48rpx; width: 48rpx;
height: 39rpx; height: 39rpx;
} }
} }
\ No newline at end of file .bottom-fix-btn {
position: fixed;
z-index: 2;
bottom: 0rpx;
padding-bottom: 40rpx;
width: 100%;
display: flex;
justify-content: center;
.btn-block {
width: 460rpx;
}
}
//易观方舟
let argo ={
appkey: "5f2ac5996f36c714",
open: true,
/*
0 关闭调试模式(默认)。类型:Number。
1 开启调试模式,数据不入库。类型:Number。
2 开启调试模式,数据入库。类型:Number。
*/
debugMode:0,
autoTrack:true,
uploadURL: 'https://argo.banshouhui.com/'
}
export {
argo,
}
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</OrderCell> </OrderCell>
</view> </view>
<u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore> <u-loadmore :status="currentLoadStatus" bgColor="#f2f2f2"></u-loadmore>
</view> </view>
<!-- 入驻成功之后无推荐订单 --> <!-- 入驻成功之后无推荐订单 -->
<view v-else-if="status == 7 && orderList.length <= 0"> <view v-else-if="status == 7 && orderList.length <= 0">
暂无订单 暂无订单
...@@ -115,18 +115,18 @@ ...@@ -115,18 +115,18 @@
}, },
onShow() { onShow() {
// 每次进入页面都刷新入驻状态 // 每次进入页面都刷新入驻状态
if (app.globalData.token) { if (app.globalData.token) {
// 获取是否显示入驻按钮 // 获取是否显示入驻按钮
this.initSettleInfo() this.initSettleInfo()
} }
}, },
methods: { methods: {
async initSettleInfo() { async initSettleInfo() {
if (this.status == 7) return if (this.status == 7) return
const callBack = (vm, result) => { const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态 // 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) { if (result && result.record) {
// vm.status = result.record.status // vm.status = result.record.status
vm.status = 0 vm.status = 0
} }
} }
...@@ -137,9 +137,9 @@ ...@@ -137,9 +137,9 @@
this._freshing = true; this._freshing = true;
// 获取入驻状态 // 获取入驻状态
this.initSettleInfo() this.initSettleInfo()
// 获取推荐订单及数量 // 获取推荐订单及数量
// .... // ....
setTimeout(() => { setTimeout(() => {
// 数据加载完成更新入驻状态和推荐列表 // 数据加载完成更新入驻状态和推荐列表
...@@ -178,9 +178,9 @@ ...@@ -178,9 +178,9 @@
console.log('-----scroll-------') console.log('-----scroll-------')
}, },
immediatelyIn() { immediatelyIn() {
if (util.getToken()) { if (util.getToken()) {
uni.navigateTo({ uni.navigateTo({
url: this.status > 0 ? '/pages/settle/prompt' : '/pages/settle/index' url: this.status > 0 ? '/pages/settle/prompt' : '/pages/settle/index'
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
...@@ -224,4 +224,4 @@ ...@@ -224,4 +224,4 @@
.order-view { .order-view {
text-align: center; text-align: center;
} }
</style> </style>
<template>
<view>
<view class="uni-padding-wrap uni-common-mt">
<view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc" @error="videoErrorCallback" controls></video></view>
<uni-group>
<view class="course-title">{{ courseTitle }}</view>
<view class="course-desc">{{ courseDesc }}</view>
</uni-group>
</view>
</view>
</template>
<script>
let app = getApp();
export default {
data() {
return {
courseId: '',
courseStatus: 0,
courseSrc: '',
courseTitle: '',
courseDesc: '',
};
},
onLoad(e) {
if (e) {
if(e.courseId) {
this.courseId = e.courseId;
}
if(e.id) {
this.courseId = e.courseId;
this.courseSrc = app.globalData.service_standard[e.id].url;
this.courseTitle = app.globalData.service_standard[e.id].title;
this.courseDesc = app.globalData.service_standard[e.id].desc;
this.changeCourseStatus();
}
if(e.status) {
this.courseStatus = e.status;
}
}
},
onReady: function(res) {
// #ifndef MP-ALIPAY
this.videoContext = uni.createVideoContext('courseVideo');
// #endif
},
methods: {
videoErrorCallback: function(e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false
});
},
getRandomColor: function() {
const rgb = [];
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16);
color = color.length == 1 ? '0' + color : color;
rgb.push(color);
}
return '#' + rgb.join('');
},
changeCourseStatus() {
let that = this
if(that.courseId) {
that.$u.api.saveCourseRate({courseId: that.courseId}).then(res => {
debugger
if(res.code == 200) {
// uni.navigateBack({delta: 1})
uni.navigateTo({
url: "/pages/learn/exam"
})
} else {
uni.showToast({
icon: "none",
title: "更新课程状态失败"
})
}
}).catch(e=> {
})
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程"
})
}
},
}
};
</script>
<style lang="scss">
.course-video {
width: 750rpx;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.course-desc {
margin-left: 60rpx;
}
</style>
<template>
<view class="exam-wrap">
<Settle :index="3">
<view class="exam-tips"><u-alert-tips :show-icon="true" class="exam-tips" type="warning" :title="tipsTitle" :description="tipsDescription"></u-alert-tips></view>
<view class="exam-course">
<u-card margin="20rpx 0rpx 30rpx 0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单教程</view>
<view class="exam-body" slot="body">
<u-cell-group :border="false">
<u-cell-item
v-for="(item, key) in tutorials"
:key="key"
icon="play-circle"
:border-bottom="false"
:title="item.title"
:value="item.value"
:value-style="item.courseActive"
@click="viewCourse(item)"
></u-cell-item>
</u-cell-group>
</view>
</u-card>
</view>
<view class="exam-course">
<u-card margin="0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单考试</view>
<uni-group slot="body">
<view>总共20题,每题5分,答题时间不超过40分钟</view>
<view>请认真对待,预祝顺利通过考试!</view>
</uni-group>
</u-card>
</view>
<view class="content-gap"></view>
</Settle>
<view class="bottom-fix-btn">
<view class="btn-block"><u-button type="primary" shape="circle">去考试</u-button></view>
</view>
</view>
</template>
<script>
import Settle from '@/components/settle/index.vue';
let app = getApp()
export default {
components: {
Settle
},
data() {
return {
cardRadius: 12,
tipsTitle: '提示:',
// 简单使用固定培训视频
tutorials: [
{ id: 'Course1', courseId: 1, title: '', value: '已查看', courseActive: {}, status: 1, url: ''},
{ id: 'Course2', courseId: 2, title: '', value: '未查看', courseActive: {}, status: 0, url: ''},
{ id: 'Course3', courseId: 3, title: '', value: '未查看', courseActive: {}, status: 0, url: ''}
],
tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程'
};
},
computed: {
},
onLoad() {
this.tutorials.map((item, key) => {
item['url'] = app.globalData.service_standard[item.id].url
item['title'] = app.globalData.service_standard[item.id].title
item['value'] = item['status'] ? '已查看' : '未查看';
item['courseActive'] = item['status'] ? {"color": "#2979ff"} : {"color": "#ff0000"}
})
this.loadLearnData();
},
methods: {
loadLearnData() {
let that = this;
that.$u.api
.listOrderingTutorials()
.then(res => {
const results = res.data;
if (res.status == 200 && results && results.length > 0) {
that.tutorials.forEach((data, i) => {
if (results.hasOwnProperty(data.id)) {
data.status = results[data.id];
data.value = data.status ? '已查看' : '未查看';
data.courseActive = data.status ? {"color": "#2979ff"} : {"color": "red"}
that.tutorials[i] = data;
}
});
}
})
.catch(e => {
debugger;
console.log(e, 'loadLearnData');
});
},
viewCourse(e) {
let that = this;
let params = `id=${e.id}&courseId=${e.courseId}&status=${e.status}`
uni.navigateTo({
url: `/pages/learn/course-detail?${params}`
})
},
}
};
</script>
<style lang="scss">
.exam-tips .u-alert-tips {
border-radius: 12rpx !important;
border: none !important;
.u-alert-title {
font-size: 28rpx !important;
font-weight: bold;
}
}
.exam-wrap {
background: #f4f5f7;
}
.exam-head {
font-size: 36rpx;
font-weight: bold;
}
.content-gap {
height: 1rpx;
margin-bottom: 200rpx;
}
</style>
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<image class="noticeImage" :src="icon_auth_notice_new" mode=""></image> <image class="noticeImage" :src="icon_auth_notice_new" mode=""></image>
</view> </view>
<view class="noticeTitleView"> <view class="noticeTitleView">
<text class="noticeTitle">{{ noticeTitle }}</text> <text class="noticeTitle" v-if="needAuth">{{ authNoticeTitle }}</text>
<text class="noticeTitle" v-else>{{ suginNoticeTitle }}</text>
</view> </view>
<button class="loginBtn" v-if="needAuth" lang="zh_CN" @tap="getUserProfile"> <button class="loginBtn" v-if="needAuth" lang="zh_CN" @tap="getUserProfile">
<text class="u-font-32 white">立即登录</text> <text class="u-font-32 white">立即登录</text>
...@@ -35,13 +36,14 @@ export default { ...@@ -35,13 +36,14 @@ export default {
icon_notice: '', icon_notice: '',
TimeID: -1, TimeID: -1,
icon_auth_notice_new: '', icon_auth_notice_new: '',
noticeTitle: '申请获得您的公开信息(昵称,头像等)以便于为您提供更好的服务', authNoticeTitle: '申请获得您的公开信息(昵称,头像等)以便于为您提供更好的服务',
suginNoticeTitle: '申请获得您的公开信息(昵称,头像等)以便于为您提供更好的服务',
} }
}, },
onLoad() { onLoad() {
// getApp().trackPage('授权登录页') app.trackPage('授权登录页')
// this.icon_notice = getApp().globalData.icon_auth_notice this.icon_notice = app.globalData.icon_auth_notice
// this.icon_auth_notice_new = getApp().globalData.icon_auth_notice_new this.icon_auth_notice_new = app.globalData.icon_auth_notice_new
}, },
onShow() { onShow() {
app.globalData.jumpLoginStatus = true app.globalData.jumpLoginStatus = true
...@@ -101,6 +103,10 @@ export default { ...@@ -101,6 +103,10 @@ export default {
signupLogin(e) { signupLogin(e) {
var that = this var that = this
debugger
console.log(e.detail.errMsg)
console.log(e.detail.iv)
console.log(e.detail.encryptedData)
if (!e || !e.detail || e.detail.errMsg.indexOf('user deny') > -1) { if (!e || !e.detail || e.detail.errMsg.indexOf('user deny') > -1) {
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
...@@ -143,13 +149,20 @@ export default { ...@@ -143,13 +149,20 @@ export default {
goBackPage() { goBackPage() {
let pages = getCurrentPages(); let pages = getCurrentPages();
if(pages.length) { if(pages.length) {
let prevPage = pages[pages.length - 1]; //上一个页面 let index = pages.length - 1;
if (prevPage && prevPage.$vm) { if(index) {
prevPage.$vm.isRefresh = true; let prevPage = pages[pages.length - 1]; //上一个页面
if (prevPage && prevPage.$vm) {
prevPage.$vm.isRefresh = true;
}
uni.navigateBack({
delta: 1
})
} else {
uni.navigateTo({
url:'pages/index/index'
})
} }
uni.navigateBack({
delta: 1
})
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: "pages/mine/index" url: "pages/mine/index"
......
...@@ -11,7 +11,7 @@ if (AnalysysAgent) { ...@@ -11,7 +11,7 @@ if (AnalysysAgent) {
// AnalysysAgent.autoShare = true // AnalysysAgent.autoShare = true
AnalysysAgent.allowTimeCheck = true AnalysysAgent.allowTimeCheck = true
AnalysysAgent.autoTrack = true AnalysysAgent.autoTrack = true
AnalysysAgent.registerSuperProperty("platform","take-order"); AnalysysAgent.registerSuperProperty("platform","self-support");
} }
// #endif // #endif
export { export {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment