Commit bcc825c7 by 前端

Merge branch 'fix_v2.10.3' into 'master'

Fix v2.10.3

See merge request !4
2 parents fe950f7e a2c48ff8
Showing 37 changed files with 284 additions and 65 deletions
...@@ -9,7 +9,9 @@ import { ...@@ -9,7 +9,9 @@ import {
import {trackData} from './utils/data' import {trackData} from './utils/data'
App({ App({
onLaunch: function (options) { onLaunch: function (options) {
console.log(options)
/**挂载到wx对象 */ /**挂载到wx对象 */
this.autoUpdate()
wx.$util = util wx.$util = util
wx.$router = router wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/' wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
...@@ -41,15 +43,36 @@ App({ ...@@ -41,15 +43,36 @@ App({
util.setSessionId(res.data.sessionId) util.setSessionId(res.data.sessionId)
openId = res.data.openId openId = res.data.openId
util.setStorageSync('openId', openId) util.setStorageSync('openId', openId)
console.log(wx.$trackData)
if (wx.$trackData.scene) { if (wx.$trackData.scene) {
// 初次进入小程序默认埋首页
_this.getScene(wx.$trackData.scene).then(res => { _this.getScene(wx.$trackData.scene).then(res => {
wx.$trackData.merchant = res.merchantId wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId wx.$trackData.cardId = res.cardId
console.log('wx.$trackData.cardId', wx.$trackData.cardId)
util.setStorageSync('scene', res) util.setStorageSync('scene', res)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info')) const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1 wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, openId) wx.$Track.sendTrack(trackData.COMPANY, openId)
}) })
} else if(wx.$trackData.detailShare) {
// d+产品分享在这里设置埋点
const detailShare = wx.$trackData.detailShare
console.log(1211)
for(let i in trackData) {
console.log(i)
if (trackData[i].pageName == detailShare) {
console.log(trackData[i])
wx.$Track.sendTrack(trackData[i], openId)
break
}
}
} else if (!wx.$trackData.detailShare && wx.$trackData.cardId) {
// 名片分享在这里设置埋点
util.setStorageSync('scene', wx.$trackData)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, openId)
} }
ssoApi.getUserInfo({ ssoApi.getUserInfo({
openId openId
...@@ -88,6 +111,68 @@ App({ ...@@ -88,6 +111,68 @@ App({
}) })
}) })
}, },
/**
* 下载小程序新版本并重启应用
*/
autoUpdate: function () {
// console.log(new Date())
const self = this
// 获取小程序更新机制兼容
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
//1. 检查小程序是否有新版本发布
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
if (res.hasUpdate) {
//2. 小程序有新版本,则静默下载新版本,做好更新准备
updateManager.onUpdateReady(function () {
console.log(new Date())
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
//3. 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
} else if (res.cancel) {
//如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
// wx.showModal({
// title: '温馨提示~',
// content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
// success: function (res) {
// self.autoUpdate()
// return;
// //第二次提示后,强制更新
// if (res.confirm) {
// // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
// updateManager.applyUpdate()
// } else if (res.cancel) {
// //重新回到版本更新提示
// self.autoUpdate()
// }
// }
// })
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
})
})
}
})
} else {
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
},
globalData: { globalData: {
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -15,6 +15,15 @@ Component({ ...@@ -15,6 +15,15 @@ Component({
}); });
}, },
}, },
shareDisabled: {
type: Boolean,
defalut: true,
observer(n) {
this.setData({
shareDisabled: n
})
}
}
}, },
/** /**
...@@ -22,6 +31,7 @@ Component({ ...@@ -22,6 +31,7 @@ Component({
*/ */
data: { data: {
showWechant: false, showWechant: false,
// shareDisabled: true
}, },
/** /**
...@@ -88,5 +98,14 @@ Component({ ...@@ -88,5 +98,14 @@ Component({
phoneNumber: staffPhone, phoneNumber: staffPhone,
}); });
}, },
shareClick() {
if (this.data.shareDisabled) {
wx.showToast({
title: '正在生成名片缩略图,请稍后分享',
icon: 'none',
duration: 2000
})
}
}
}, },
}); });
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
<view class="phone-text">拨打电话</view> <view class="phone-text">拨打电话</view>
</view> </view>
<button class="btn-plain btn" bindtap="addPhone">保存名片</button> <button class="btn-plain btn" bindtap="addPhone">保存名片</button>
<button class="btn-primary btn" open-type="share">分享名片</button> <button wx:if="{{shareDisabled}}" class="btn-primary btn" bindtap="shareClick">分享名片</button>
<button wx:else class="btn-primary btn" open-type="share">分享名片</button>
</view> </view>
</view> </view>
<authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}"></authorize> <authorize buttonType="openSetting" show="{{showAuth}}" isShowCheck="{{false}}"></authorize>
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ module.exports = Behavior({ ...@@ -19,7 +19,7 @@ module.exports = Behavior({
// title: '敬请期待', // title: '敬请期待',
// icon: 'none' // icon: 'none'
// }) // })
// wx.$Track.sendTrack(trackData.DIJIA) wx.$Track.sendTrack(trackData.DIJIA)
break break
default: default:
this.setData({ this.setData({
......
...@@ -29,14 +29,14 @@ Page({ ...@@ -29,14 +29,14 @@ Page({
}, },
formData: { formData: {
sales: 100, sales: 100,
flow: 100, flow: 10000,
}, },
productList: [], productList: [],
isReset: false, isReset: false,
hasPhoneNumber: false, hasPhoneNumber: false,
lastFormData: { lastFormData: {
sales: 100, sales: 100,
flow: 100, flow: 10000,
}, },
isFirst: true isFirst: true
}, },
...@@ -161,7 +161,7 @@ Page({ ...@@ -161,7 +161,7 @@ Page({
isReset: false, isReset: false,
formData: { formData: {
sales: 100, sales: 100,
flow: 100, flow: 10000,
}, },
}); });
}, },
......
// pages/productDetail/ambientLighting/ambientLighting.js // pages/productDetail/ambientLighting/ambientLighting.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.LIGHT) wx.$Track.sendTrack(trackData.LIGHT)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.LIGHT.pageName, title: trackData.LIGHT.pageName,
path: 'pages/productDetail/ambientLighting/ambientLighting?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/ambientLighting/ambientLighting?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.LIGHT.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
<video poster="{{IMGURL}}video/light_bitmap.png?v={{img_version}}" title="单品类氛围灯" custom-cache="{{false}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> <video poster="{{IMGURL}}video/light_bitmap.png?v={{img_version}}" title="单品类氛围灯" custom-cache="{{false}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video>
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/ambientLighting/light_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
top: 1204rpx; top: 1204rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
// pages/productDetail/arNavigation/arNavigation.js // pages/productDetail/arNavigation/arNavigation.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.ARNAVIGATION) wx.$Track.sendTrack(trackData.ARNAVIGATION)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.ARNAVIGATION.pageName, title: trackData.ARNAVIGATION.pageName,
path: 'pages/productDetail/arNavigation/arNavigation?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/arNavigation/arNavigation?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.ARNAVIGATION.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
<video poster="{{IMGURL}}video/AR_bitmap.png?v={{img_version}}" title="单品AR导航" custom-cache="{{false}}" src="{{IMGURL}}video/AR.mp4?v={{img_version}}"></video> <video poster="{{IMGURL}}video/AR_bitmap.png?v={{img_version}}" title="单品AR导航" custom-cache="{{false}}" src="{{IMGURL}}video/AR.mp4?v={{img_version}}"></video>
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/AR-navigation/AR_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
width: 702rpx; width: 702rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
...@@ -21,7 +21,17 @@ Page({ ...@@ -21,7 +21,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.CARBEAUTY); wx.$Track.sendTrack(trackData.CARBEAUTY);
}
});
}, },
/** /**
...@@ -52,7 +62,7 @@ Page({ ...@@ -52,7 +62,7 @@ Page({
title: trackData.CARBEAUTY.pageName, title: trackData.CARBEAUTY.pageName,
path: path:
"pages/productDetail/carBeauty/carBeauty?cardId=" + "pages/productDetail/carBeauty/carBeauty?cardId=" +
util.getStorageSync("scene").cardId, util.getStorageSync("scene").cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.CARBEAUTY.pageName
}; };
}, },
}); });
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
<!-- <video poster="{{IMGURL}}image/productDetail/carBeauty/beauty_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> --> <!-- <video poster="{{IMGURL}}image/productDetail/carBeauty/beauty_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/carBeauty/beauty_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
height: 1672rpx; height: 1672rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
// pages/productDetail/changingFilm/changingFilm.js // pages/productDetail/changingFilm/changingFilm.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.CHANGEFILM) wx.$Track.sendTrack(trackData.CHANGEFILM)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.CHANGEFILM.pageName, title: trackData.CHANGEFILM.pageName,
path: 'pages/productDetail/changingFilm/changingFilm?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/changingFilm/changingFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.CHANGEFILM.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -18,16 +18,13 @@ ...@@ -18,16 +18,13 @@
</view> </view>
</view> </view>
<!-- 产品介绍 --> <!-- 产品介绍 -->
<image mode="widthFix" style="margin-top: 66rpx;" class="img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_product.png?v={{img_version}}"></image> <view>
<!-- <view style="margin-top: 56rpx;">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_product.png?v={{img_version}}"></image> <image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_product.png?v={{img_version}}"></image>
<view class="box-video beauty-video1"> <view class="box-video beauty-video1">
<image mode="widthFix" class="video_img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_bitmap.png?v={{img_version}}"></image> <!-- <image mode="widthFix" class="video_img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_bitmap.png?v={{img_version}}"></image>
<video poster="{{IMGURL}}image/productDetail/changingFilm/changing_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> <video poster="{{IMGURL}}image/productDetail/changingFilm/changing_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view>
</view> </view>
</view> -->
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/changingFilm/changing_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
height: 1672rpx; height: 1672rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { import {
trackData trackData
} from "../../../utils/data"; } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -14,7 +15,6 @@ Page({ ...@@ -14,7 +15,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
}, },
/** /**
...@@ -28,7 +28,19 @@ Page({ ...@@ -28,7 +28,19 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
console.log(options, 'onshow')
getApp()
.login()
.then(({ data }) => {
console.log(data)
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.EQUITYCARD) wx.$Track.sendTrack(trackData.EQUITYCARD)
}
});
}, },
/** /**
...@@ -65,7 +77,7 @@ Page({ ...@@ -65,7 +77,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.EQUITYCARD.pageName, title: trackData.EQUITYCARD.pageName,
path: 'pages/productDetail/equity/equity?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/equity/equity?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.EQUITYCARD.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
// pages/productDetail/lossPhase/lossPhase.js // pages/productDetail/lossPhase/lossPhase.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.LOSSPGASE) wx.$Track.sendTrack(trackData.LOSSPGASE)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.LOSSPGASE.pageName, title: trackData.LOSSPGASE.pageName,
path: 'pages/productDetail/lossPhase/lossPhase?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/lossPhase/lossPhase?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.LOSSPGASE.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
<!-- <video poster="{{IMGURL}}image/productDetail/lossPhase/loss_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> --> <!-- <video poster="{{IMGURL}}image/productDetail/lossPhase/loss_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/lossPhase/loss_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
height: 1672rpx; height: 1672rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
// pages/productDetail/navigationArround/navigationArround.js // pages/productDetail/navigationArround/navigationArround.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.NAVIGATIONARROUND) wx.$Track.sendTrack(trackData.NAVIGATIONARROUND)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.NAVIGATIONARROUND.pageName, title: trackData.NAVIGATIONARROUND.pageName,
path: 'pages/productDetail/navigationArround/navigationArround?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/navigationArround/navigationArround?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.NAVIGATIONARROUND.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
<video poster="{{IMGURL}}video/360_AR_bitmap.png?v={{img_version}}" title="360全景导航" custom-cache="{{false}}" src="{{IMGURL}}video/360_AR.mp4?v={{img_version}}"></video> <video poster="{{IMGURL}}video/360_AR_bitmap.png?v={{img_version}}" title="360全景导航" custom-cache="{{false}}" src="{{IMGURL}}video/360_AR.mp4?v={{img_version}}"></video>
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/navigation-360/income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
height: 1632rpx; height: 1632rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
// pages/productDetail/paintProtect/paintProtect.js // pages/productDetail/paintProtect/paintProtect.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.PAINTPROTECT) wx.$Track.sendTrack(trackData.PAINTPROTECT)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.PAINTPROTECT.pageName, title: trackData.PAINTPROTECT.pageName,
path: 'pages/productDetail/paintProtect/paintProtect?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/paintProtect/paintProtect?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.PAINTPROTECT.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
<!-- <video poster="{{IMGURL}}image/productDetail/paintProtect/paint_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> --> <!-- <video poster="{{IMGURL}}image/productDetail/paintProtect/paint_bitmap.png?v={{img_version}}" src="{{IMGURL}}video/light.mp4?v={{img_version}}"></video> -->
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/paintProtect/paint_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
height: 1672rpx; height: 1672rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
// pages/productDetail/seatVentilate/seatVentilate.js // pages/productDetail/seatVentilate/seatVentilate.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,17 @@ Page({ ...@@ -27,7 +28,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
getApp()
.login()
.then(({ data }) => {
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.SEATVENTILATE) wx.$Track.sendTrack(trackData.SEATVENTILATE)
}
});
}, },
/** /**
...@@ -64,7 +75,7 @@ Page({ ...@@ -64,7 +75,7 @@ Page({
onShareAppMessage() { onShareAppMessage() {
return { return {
title: trackData.SEATVENTILATE.pageName, title: trackData.SEATVENTILATE.pageName,
path: 'pages/productDetail/seatVentilate/seatVentilate?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/seatVentilate/seatVentilate?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.SEATVENTILATE.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
<video poster="{{IMGURL}}video/seat_bitmap.png?v={{img_version}}" title="座椅通风系统" custom-cache="{{false}}" src="{{IMGURL}}video/seat.mp4?v={{img_version}}"></video> <video poster="{{IMGURL}}video/seat_bitmap.png?v={{img_version}}" title="座椅通风系统" custom-cache="{{false}}" src="{{IMGURL}}video/seat.mp4?v={{img_version}}"></video>
</view> </view>
</view> </view>
<!-- 收益测算 -->
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/productDetail/seatVentilate/seat_income.png?v={{img_version}}"></image>
</view> </view>
</view> </view>
<view class="btn-bottm"> <view class="btn-bottm">
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
height: 1632rpx; height: 1632rpx;
} }
.box-content image { .box-content view {
margin-bottom: 56rpx; margin-bottom: 56rpx;
} }
.box-content image:last-child { .box-content view:last-child {
margin-bottom: 110rpx; margin-bottom: 110rpx;
} }
......
// pages/productDetail/solarFilm/solarFilm.js // pages/productDetail/solarFilm/solarFilm.js
import { trackData } from "../../../utils/data"; import { trackData } from "../../../utils/data";
import util from '../../../utils/util'
Page({ Page({
/** /**
...@@ -27,7 +28,19 @@ Page({ ...@@ -27,7 +28,19 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.cardId) {
wx.$trackData = options.query
}
console.log(options, 'onshow')
getApp()
.login()
.then(({ data }) => {
console.log(data)
if (!wx.$trackData.detailShare) {
wx.$Track.sendTrack(trackData.SOLARFILM) wx.$Track.sendTrack(trackData.SOLARFILM)
}
});
}, },
/** /**
...@@ -62,9 +75,10 @@ Page({ ...@@ -62,9 +75,10 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
console.log(util.getStorageSync('scene'))
return { return {
title: trackData.SOLARFILM.pageName, title: trackData.SOLARFILM.pageName,
path: 'pages/productDetail/solarFilm/solarFilm?cardId=' + util.getStorageSync('scene').cardId path: 'pages/productDetail/solarFilm/solarFilm?cardId=' + util.getStorageSync('scene').cardId+"&merchant="+util.getStorageSync("scene").merchantId+'&detailShare=' +trackData.SOLARFILM.pageName
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -62,7 +62,8 @@ Page({ ...@@ -62,7 +62,8 @@ Page({
clueList: ['clue-img2.webp', 'clue-img3.webp', 'clue-img4.webp', 'clue-img5.webp', 'clue-img6.webp', 'clue-img7.webp', 'clue-img8.webp', 'clue-img9.webp', 'clue-img10.webp', 'clue-img11.webp', 'clue-img12.webp', 'clue-img13.webp'], clueList: ['clue-img2.webp', 'clue-img3.webp', 'clue-img4.webp', 'clue-img5.webp', 'clue-img6.webp', 'clue-img7.webp', 'clue-img8.webp', 'clue-img9.webp', 'clue-img10.webp', 'clue-img11.webp', 'clue-img12.webp', 'clue-img13.webp'],
clueCurrent: 0, clueCurrent: 0,
awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}], awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}],
awardCurrent: 0 awardCurrent: 0,
shareDisabled: true
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
...@@ -142,7 +143,6 @@ Page({ ...@@ -142,7 +143,6 @@ Page({
getApp() getApp()
.login() .login()
.then(({ data }) => { .then(({ data }) => {
wx.hideLoading()
if (data && data.nickName) { if (data && data.nickName) {
this.setData({ this.setData({
hasUserInfo: true, hasUserInfo: true,
...@@ -160,6 +160,9 @@ Page({ ...@@ -160,6 +160,9 @@ Page({
} }
this.getCardDetail(); this.getCardDetail();
}); });
wx.hideShareMenu({
menus: ['shareAppMessage']
})
}, },
/** /**
...@@ -202,12 +205,14 @@ Page({ ...@@ -202,12 +205,14 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const cardId = util.getStorageSync("scene").cardId
const merchant = util.getStorageSync("scene").merchantId || util.getStorageSync("scene").merchant
return { return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`, title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg, imageUrl: this.data.shareImg,
path: path:
"pages/tab/index/index?cardId=" + "pages/tab/index/index?cardId=" +
util.getStorageSync("scene").cardId, cardId + "&merchant="+merchant
}; };
}, },
setShareInfo(data = {}) { setShareInfo(data = {}) {
...@@ -325,8 +330,14 @@ Page({ ...@@ -325,8 +330,14 @@ Page({
draw_function.toDataURL(({ path }) => { draw_function.toDataURL(({ path }) => {
this.setData({ this.setData({
shareImg: path, shareImg: path,
shareDisabled: false
}, () => {
wx.showShareMenu({
menus: ['shareAppMessage']
})
})
}); });
});
} }
}); });
}; };
...@@ -369,6 +380,7 @@ Page({ ...@@ -369,6 +380,7 @@ Page({
cardId: wx.$trackData.cardId || scene.cardId cardId: wx.$trackData.cardId || scene.cardId
}; };
entmicroApi.getCardDetail(params).then(({data, code, message}) => { entmicroApi.getCardDetail(params).then(({data, code, message}) => {
wx.hideLoading()
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
title: message, title: message,
...@@ -376,10 +388,12 @@ Page({ ...@@ -376,10 +388,12 @@ Page({
duration: 2000 duration: 2000
}) })
} }
const cardInfo = data || this.data.defaultInfo
this.setData({ this.setData({
cardInfo: data || this.data.defaultInfo cardInfo
},()=>{
this.setShareInfo(cardInfo);
}) })
this.setShareInfo(this.data.cardInfo);
}); });
}, },
}); });
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<import src="index.skeleton.wxml"/> <import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="true" /> <template is="skeleton" wx:if="true" />
<view class="main-box" wx:if="{{cardInfo}}" > <view class="main-box" wx:if="{{cardInfo}}" >
<user-info data-skeleton-hide="cardInfo" cardInfo="{{cardInfo}}"></user-info> <user-info data-skeleton-hide="cardInfo" shareDisabled="{{shareDisabled}}" cardInfo="{{cardInfo}}"></user-info>
<view class="main-bottom"> <view class="main-bottom">
<!-- 面向渠道 --> <!-- 面向渠道 -->
<template is="channel"></template> <template is="channel"></template>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true "ignoreUploadUnusedFiles": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.25.4", "libVersion": "2.25.4",
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
{ {
"name": "", "name": "",
"pathName": "pages/tab/index/index", "pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3102", "query": "scene=sceneId%3D3233",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
...@@ -129,5 +129,6 @@ ...@@ -129,5 +129,6 @@
}, },
"setting": { "setting": {
"urlCheck": false "urlCheck": false
} },
"libVersion": "2.26.1"
} }
\ No newline at end of file \ No newline at end of file
...@@ -62,7 +62,7 @@ class Draw { ...@@ -62,7 +62,7 @@ class Draw {
let image = this[_canvas_].createImage() let image = this[_canvas_].createImage()
new Promise(resolve => { new Promise(resolve => {
image.onload = resolve image.onload = resolve
image.src = url image.src = `${url}?v=${Date.now()}`
}).then(() => { }).then(() => {
this[_ctx_].drawImage(image, x, y, width, height) this[_ctx_].drawImage(image, x, y, width, height)
this[_ctx_].restore() this[_ctx_].restore()
...@@ -394,6 +394,7 @@ class Draw { ...@@ -394,6 +394,7 @@ class Draw {
}) })
} }
base64src(url).then(img => { base64src(url).then(img => {
console.log('img', img)
createLocalImg(img, callBack) createLocalImg(img, callBack)
}) })
} }
......
...@@ -124,7 +124,7 @@ class TRACK { ...@@ -124,7 +124,7 @@ class TRACK {
let params = { let params = {
method: 'entmicro.api.business.card.cardRecord', method: 'entmicro.api.business.card.cardRecord',
cardId: wx.$trackData.cardId, cardId: wx.$trackData.cardId,
merchant: wx.$trackData.merchant, merchant: wx.$trackData.merchant || wx.$trackData.merchantId,
type: wx.$trackData.type type: wx.$trackData.type
} }
let userInfo = { } let userInfo = { }
...@@ -152,7 +152,9 @@ class TRACK { ...@@ -152,7 +152,9 @@ class TRACK {
data, data,
message message
}) => { }) => {
if (code == 0) {
console.log('埋点设置成功') console.log('埋点设置成功')
}
}) })
} }
/**获取页面对象实例 */ /**获取页面对象实例 */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!