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