Commit e82a6752 by 胡悦

修复bug

1 parent 771fc72d
{
"pages": [
"pages/tab/index/index"
"pages/tab/index/index",
"pages/webView/webView"
],
"window": {
"backgroundTextStyle": "light",
......
......@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component": {
"version": "1.0.35",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.35.tgz",
"integrity": "sha512-DwdJ/wpD6T9onCiMTJZrBsD9nkxZBn0aM8C/ySXZdhuSri0WAyMW51eTp1CnQhg40Ke5zDgV0AsHwg5si0beaw=="
"version": "1.0.37",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.37.tgz",
"integrity": "sha512-Imu/2+0R9Vru6o73rwzTPqB+hNh5dXeWHj78SV15C0QcK6RhLry5tcrjvv1+B2M16/ajeljEBSFY5WXppD9gCg=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.0.35"
"glsx-applet-component": "^1.0.37"
},
"devDependencies": {},
"scripts": {
......
......@@ -41,12 +41,14 @@ Page({
cardInfo: {},
hasPhoneNumber: false, // 是否有授权手机号码
pageName: '',
leftMenuIndex: 0,
proName: '',
trackList: [
[trackData.EQUITYCARD],
[trackData.SOLARFILM],
[trackData.PAINTPROTECT, trackData.CHANGEFILM],
[trackData.CARBEAUTY, trackData.SEATVENTILATE, trackData.ARNAVIGATION, trackData.LIGHT, trackData.NAVIGATIONARROUND, trackData.LOSSPGASE],
[]
[trackData.EXPANGOLD]
],
systemTrackList: [
[trackData.SYSUSER, trackData.SYSNUMBER],
......@@ -83,7 +85,7 @@ Page({
console.log( options);
if (!options || utils.isEmptyObj(options)) return
let {
actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, leftMenuIndex = 0
actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, leftMenuIndex = 0, proName
} = options
console.log(options)
this.setData({
......@@ -91,14 +93,18 @@ Page({
activeNavIdx, //选中的产品
sharephone: phone, //联系电话 (登陆的用户)
hasPhoneNumber:hasPhoneNumber,
pageName: name
pageName: name,
leftMenuIndex,
proName
})
if (name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
} else if (name == '系统订阅') {
wx.$Track.sendTrack(this.data.systemTrackList[leftMenuIndex][activeNavIdx])
}
setTimeout(() => {
utils.setNavigationBarTitle(proName)
},100)
},
onPageScroll: (function () {
let timer = null;
......@@ -146,6 +152,7 @@ Page({
*/
onLoad(options) {
console.log(options)
this.getActiveApiFn()
if (options && options.cardId) {
wx.$trackData = options
// wx.$trackData.cardId = options.cardId
......@@ -154,13 +161,25 @@ Page({
actNum: options.actNum,
activeNavIdx: options.activeNavIdx
})
const {name, actNum, activeNavIdx} = options
getApp()
.login()
.then(({ data }) => {
if (data && data.phone) {
this.setData({
hasPhoneNumber: true
})
}
})
const {name, actNum, activeNavIdx, leftMenuIndex, proName} = options
this.getCardDetail()
if (name == '增值转化') {
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
} else if (name == '系统订阅') {
wx.$Track.sendTrack(this.data.systemTrackList[leftMenuIndex][activeNavIdx])
}
setTimeout(() => {
utils.setNavigationBarTitle(proName)
},100)
} else {
this.getCardDetail()
}
......@@ -217,11 +236,11 @@ Page({
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_PRO'
console.log('cardId', cardId, 'merchant', merchant)
const {actNum, activeNavIdx, pageName} = this.data
const {actNum, activeNavIdx, pageName, leftMenuIndex, proName} = this.data
return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg,
path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}`
path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&leftMenuIndex=${leftMenuIndex}&proName=${proName}`
}
},
......
......@@ -100,20 +100,6 @@ Page({
setTimeout(() => {
utils.setNavigationBarTitle(this.data.scenarList[actNum])
},100)
//分享人openId
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
this.shareQuery = `sceneCode=${senceData[actNum].sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}`
this.shareTrackData = {
sceneCode: senceData[actNum]?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
}
},
onPageScroll: (function () {
let timer = null;
......@@ -134,13 +120,17 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
if (options && options.cardId) {
// const options = wx.getEnterOptionsSync()
wx.$trackData = options.query
wx.$trackData = options
wx.$storage.set('scene', options)
this.getCardDetail()
} else {
this.getCardDetail()
this.setData({
actNum: options.actNum
})
wx.$Track.sendTrack(this.data.trackList[options.actNum])
setTimeout(() => {
utils.setNavigationBarTitle(this.data.scenarList[options.actNum])
},100)
}
},
......@@ -194,170 +184,11 @@ Page({
// merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId
const shareType = 'SHARE_SCEN'
const {actNum} = this.data
console.log('cardId', cardId, 'merchant', merchant)
return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg,
path: `packagesList/pages/scenarioDetail/scenarioDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}`
}
},
setShareInfo(data = {}) {
const canvasWidth = 208,
canvasHeight = 166,
textBaseline = 'top'
const draw_function = new Draw(this, {
width: canvasWidth,
height: canvasHeight
// pixelRatio: 2,
// backgroundColor: '#096'
})
const drawCard = callBack => {
let index = 0
const iconWidth = 9,
iconHeight = 9,
iconX = 18,
iconY = 79,
imgList = [
{
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/bg.png',
x: 0,
y: 0,
width: canvasWidth,
height: 124
},
{
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/logo.png',
x: 15,
y: 18,
width: 152,
height: 10
},
// 头像的
{
// url: "https://img.zcool.cn/community/01e47e60ab5b4011013eaf70962e3f.jpg@520w_390h_1c_1e_2o_100sh.jpg",
url: data.image,
x: 154,
y: 36,
width: 36,
height: 36
},
{
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-phone.png',
x: iconX,
y: iconY,
width: iconWidth,
height: iconHeight
},
{
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/icon-address.png',
x: iconX,
y: iconY + 13,
width: iconWidth,
height: iconHeight
},
{
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/share/btn.png',
x: 64,
y: 138,
width: 80,
height: 24
}
],
textList = [
{
text: data.staffName,
x: 18,
y: 40,
color: '#2D2D33',
fontWeight: 600,
fontSize: 14
},
{
text: data.operation,
x: 22 + draw_function.getTextWidth(data.staffName, 14),
y: 44,
color: '#6E6E7A',
fontWeight: 400,
fontSize: 8
},
{
text: data.staffPhone,
x: 30,
y: 80,
color: '#6E6E7A',
fontSize: 7
},
{
text: '深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层',
x: 30,
y: 94,
color: '#6E6E7A',
fontSize: 7,
lineNum: 2,
width: 185,
lineHeight: 9
}
]
const drawImages = callBack => {
draw_function.drawImages(imgList[index], () => {
index += 1
if (index != imgList.length) drawImages(callBack)
else callBack()
})
}
drawImages(() => {
try {
textList.map((e, ind) => {
e.textBaseline = textBaseline
draw_function.drawText(e)
if (ind == textList.length - 1) throw true
})
} catch (error) {
draw_function.toDataURL(({ path }) => {
this.setData(
{
shareImg: path,
shareDisabled: false
},
() => {
wx.showShareMenu({
menus: ['shareAppMessage']
})
}
)
})
}
})
}
drawCard()
},
// 获取员工名片信息
getCardDetail() {
const scene = wx.$storage.get('scene')
let params = {
cardId: scene.cardId
title: `给你分享一个合作场景介绍,戳我了解~`,
path: `packagesList/pages/scenarioDetail/scenarioDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}`
}
console.log(params)
entmicroApi.getCardDetail(params).then(({ data, code, message }) => {
wx.hideLoading()
if (code == -1) {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
const cardInfo = data || this.data.defaultInfo
console.log(data, cardInfo)
this.setData(
{
cardInfo
},
() => {
this.setShareInfo(cardInfo)
}
)
})
}
})
\ No newline at end of file
......@@ -114,8 +114,8 @@ Page({
checkCooperate() {
const userInfo = wx.$storage.get('aicard_user_info')
if (userInfo) {
const {phone} = userInfo
entmicroApi.checkCooperate({phone}).then(res => {
const {openId} = userInfo
entmicroApi.checkCooperate({openId}).then(res => {
this.setData({
showCooperate: res
})
......@@ -136,11 +136,13 @@ Page({
proClick(e) {
const { name } = e.target.dataset
let { detail } = e
console.log(detail)
let obj = {
name,
actNum: isNaN(detail.scenIndex) ? 99 : detail.scenIndex, //选中的场景 没有就是订阅系统的
activeNavIdx: detail.id, //选中的产品,
hasPhoneNumber: this.data.hasPhoneNumber
hasPhoneNumber: this.data.hasPhoneNumber,
proName: detail.proName
}
if (name == '系统订阅') {
obj.menuIndex = this.data.leftMenuIndex
......
......@@ -174,8 +174,11 @@ const trackData = {
SYSCAR: {
pageKey: 44,
pageName: "事故车救援服务"
},
EXPANGOLD: {
pageKey: 45,
pageName: "膨胀金"
}
};
const productTrack = [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!