Commit b3614ef9 by 前端

Merge branch 'dev_v4.12.0' into 'develop'

最新版本

See merge request !6
2 parents 6072c281 0216f166
......@@ -60,7 +60,7 @@ Page(filter.identityFilter({
'https://dj.glsx.com.cn': 'prod'
}
let path = {
uat:'http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/',
uat:'https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/',
prod:`https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/`
}[environment[restapi.domain]]
let rex = /^[1]([3-9])[0-9]{9}$/
......
......@@ -52,7 +52,7 @@ Page({
// scene: 'sceneId%3D4'
// }
// console.log(options.scene)
console.log(decodeURIComponent(options.scene))
let id = decodeURIComponent(options.scene).split('=')[1]
// console.log(id)
//获取门店信息
......@@ -115,7 +115,10 @@ Page({
this.setData({
...op
})
this.getwxQrcode()
// 先取消获取质保卡
// this.getwxQrcode()
//util.showLoading('加载中...')
console.log(op)
// this.getInfo(op)
......@@ -140,7 +143,16 @@ Page({
})
},
// 获取企微二维码
navWarrantyCard() {
// moduleH5Url: {
// uat: 'http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/',
// prod: 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/'
// },
let path = 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/'
wx.navigateTo({
url: `/pages/webpage/webpage?path=${encodeURIComponent(path)}`
})
},
getwxQrcode() {
// let { merchantId: yqMerchantId } = this.data
let { merchantId: yqMerchantId } = this.data
......
......@@ -25,7 +25,11 @@
</view>
<view class="userCollaborationContainer" wx:if="{{userCollaborationName}}">
<!-- <label class="radio"> value="{{userCollaborationCheck}}" -->
<radio class="radio" style="transform:scale(0.6)" checked="{{userCollaborationCheck}}" catchtap="handleRadio" />
<radio
class="radio"
style="transform:scale(0.6)"
checked="{{userCollaborationCheck}}"
catchtap="handleRadio" />
<view catchtap="handleRadio" class="label">我已阅读并同意</view>
<!-- </label> -->
<view class="linkText" catchtap="navToUserCollaboration">《{{userCollaborationName}}》</view>
......@@ -94,9 +98,11 @@
</view>
</block> -->
<view class="footerCon">
<block wx:if="{{workWechatQrcode}}">
<view class="wxTips">长按识别扫码领取质保卡</view>
<image show-menu-by-longpress="true" class="wxqrCon" src="{{workWechatQrcode}}" />
<!-- wx:if="{{workWechatQrcode}}" -->
<block>
<view bindtap="navWarrantyCard" class="wxTips">长按识别扫码领取质保卡</view>
<!-- src="{{workWechatQrcode}}" -->
<image show-menu-by-longpress="true" class="wxqrCon" src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/minizhibaoka.png" />
</block>
<image class="logoIcon" src="../../../images/djLogin.png" />
</view>
......
......@@ -74,7 +74,7 @@ Page(filter.identityFilter({
moduleIcon: './images/warrantyCard.png',
moduleType: 'h5',
moduleH5Url: {
uat: 'http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/',
uat: 'https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/',
prod: 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/'
},
},
......
......@@ -2,9 +2,8 @@
const util = require('../../utils/util.js')
const restapi = require('../../utils/restapi.js')
var app = getApp();
var app = getApp()
Page({
/**
* 页面的初始数据
*/
......@@ -15,7 +14,7 @@ Page({
lng: '',
shareTime: '',
nickName: '',
shareUrl:'',
shareUrl: '',
currentPage: '',
//车辆信息浏览开始时间
vehicleStartTime: 0,
......@@ -28,46 +27,51 @@ Page({
*/
onLoad: function (options) {
console.log(options)
var self = this;
var decodePath = decodeURIComponent(options.path);
var self = this
if (options.scene) {
let id = decodeURIComponent(options.scene).split('=')[1]
return this.getSceneInfo(id)
}
var decodePath = decodeURIComponent(options.path)
self.setData({
currentPage: decodePath
})
var shareLink = decodeURIComponent(options.shareLink);
if (decodePath.indexOf('ddh-smartcar/czn/aczj') > -1){
var shareLink = decodeURIComponent(options.shareLink)
if (decodePath.indexOf('ddh-smartcar/czn/aczj') > -1) {
self.setData({
shareUrl: shareLink
});
})
}
// 链接如果包含sessionId则进行替换
var flag = decodePath.indexOf("sessionId=") > 0;
if(flag){
if (decodePath.indexOf("{sessionId}") > 0){
decodePath = decodePath.format({ sessionId: restapi.getSessionId() });
}else{
decodePath = decodePath.format( restapi.getSessionId() );
var flag = decodePath.indexOf('sessionId=') > 0
if (flag) {
if (decodePath.indexOf('{sessionId}') > 0) {
decodePath = decodePath.format({ sessionId: restapi.getSessionId() })
} else {
decodePath = decodePath.format(restapi.getSessionId())
}
}
// 链接是否要求登录才能访问
var needLogin = decodePath.endsWith('#need_login');
if(needLogin){
decodePath = decodePath.replace('#need_login', '');
wx.setStorageSync('WebPagePath', decodePath);
restapi.checkLogin(function (response){
if (response){
wx.removeStorageSync('WebPagePath');
var needLogin = decodePath.endsWith('#need_login')
if (needLogin) {
decodePath = decodePath.replace('#need_login', '')
wx.setStorageSync('WebPagePath', decodePath)
restapi.checkLogin(function (response) {
if (response) {
wx.removeStorageSync('WebPagePath')
self.setData({
jumpLink: decodePath + '#miniProgram_redirect'
});
})
}
});
}else{
})
} else {
self.setData({
jumpLink: decodePath + '#miniProgram_redirect'
});
})
}
//如果是爱车追踪则要设置分享的微信昵称
var indexNum = decodePath.indexOf('ddh-smartcar/czn/aczj/vehicleIndex');
var indexNum = decodePath.indexOf('ddh-smartcar/czn/aczj/vehicleIndex')
if (indexNum > -1) {
if (!app.globalData.userInfo) {
app.userInfoReadyCallback = userInfo => {
......@@ -84,74 +88,97 @@ Page({
}
}
},
/**
* 接收H5传过来的参数
*/
onMessage: function (e) {
console.log("onMessage");
console.log(e);
var obj = e.detail.data[0];
console.log('onMessage')
console.log(e)
var obj = e.detail.data[0]
console.log(obj)
if (obj.source && obj.source === 'renew'){
var userId = obj.userId;
if (obj.source && obj.source === 'renew') {
var userId = obj.userId
app.globalData.renewDevice = userId
}else{
var lat = obj.lat;
var lng = obj.lng;
var shareTime = obj.startTime;
} else {
var lat = obj.lat
var lng = obj.lng
var shareTime = obj.startTime
this.setData({
lat: lat,
lng: lng,
shareTime: shareTime
});
})
}
},
getSceneInfo(id) {
restapi.qrCodeScene(
{
id
},
res => {
console.log(res)
let { returnCode, data } = res
let op = {}
if (returnCode == '0') {
if (data) {
data.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
this.setData({
...op
})
onShow: function(){
console.log(op)
}
wx.hideHomeButton()
}
}
)
},
onShow: function () {
//不同页面埋点
var alias = this.data.currentPage;
if (alias.indexOf("vehicle/toEdit") > 0){
var vehicleStartTime = Date.now();
var alias = this.data.currentPage
if (alias.indexOf('vehicle/toEdit') > 0) {
var vehicleStartTime = Date.now()
this.setData({
vehicleStartTime: vehicleStartTime
});
var timeStr = util.dateToStr(new Date(), "hh:mm");
})
var timeStr = util.dateToStr(new Date(), 'hh:mm')
app.recordClickEvent('车智能使用行为', {
"车辆信息访问时间点": timeStr
车辆信息访问时间点: timeStr
})
} else if (alias.indexOf("gd/home") > 0){
var driverStartTime = Date.now();
} else if (alias.indexOf('gd/home') > 0) {
var driverStartTime = Date.now()
this.setData({
driverStartTime: driverStartTime
});
} else if (alias.indexOf("shop/toCommodityDetail") > 0){
var gascardStartTime = Date.now();
})
} else if (alias.indexOf('shop/toCommodityDetail') > 0) {
var gascardStartTime = Date.now()
this.setData({
gascardStartTime: gascardStartTime
});
})
}
},
onUnload: function(){
var path = this.data.currentPage;
if (path.indexOf("vehicle/toEdit") > 0) {
var vehicle = this.data.vehicleStartTime;
onUnload: function () {
var path = this.data.currentPage
if (path.indexOf('vehicle/toEdit') > 0) {
var vehicle = this.data.vehicleStartTime
if (vehicle > 0) {
app.globalData.myViehicleDuration += Date.now() - vehicle
}
} else if (path.indexOf("gd/home") > 0){
var driver = this.data.driverStartTime;
} else if (path.indexOf('gd/home') > 0) {
var driver = this.data.driverStartTime
if (driver > 0) {
app.globalData.goodDriverDuration += Date.now() - driver
}
} else if (path.indexOf("shop/toCommodityDetail") > 0) {
var gas = this.data.gascardStartTime;
} else if (path.indexOf('shop/toCommodityDetail') > 0) {
var gas = this.data.gascardStartTime
if (gas > 0) {
app.globalData.buyRefuelCardDuration += Date.now() - gas
}
}
}
})
\ No newline at end of file
})
<!--packagePersonal/pages/webpage/webpage.wxml-->
<web-view src="{{jumpLink}}" bindmessage="onMessage"></web-view>
<!-- packagePersonal/pages/webpage/webpage.wxml -->
<web-view src="{{jumpLink}}" bindmessage="onMessage" />
<!-- <web-view src="https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/#miniProgram_redirect" bindmessage="onMessage"></web-view> -->
<!-- <web-view src="https://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/" bindmessage="onMessage"></web-view> -->
{
"setting": {
"compileHotReLoad": true
"compileHotReLoad": true,
"urlCheck": true
},
"condition": {
"miniprogram": {
......@@ -258,6 +259,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/webpage/webpage",
"query": "scene=sceneId%3D9952",
"launchMode": "default",
"scene": null
}
]
}
......
......@@ -2,9 +2,9 @@
// const domain = 'http://192.168.3.181:9182'
// const domain = 'https://dj.dev.glsx.com.cn'
// env:uat
const domain = 'https://dj.test.glsx.com.cn'
// const domain = 'https://dj.test.glsx.com.cn'
// env:prod
// const domain = 'https://dj.glsx.com.cn'
const domain = 'https://dj.glsx.com.cn'
const app = getApp()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!