Commit 9830e908 by 前端

Merge branch 'v2.10.7' into 'master'

V2.10.7

See merge request !9
2 parents 418af06b cca4463b
...@@ -7,7 +7,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"]; ...@@ -7,7 +7,7 @@ const target = ["ip", "dev", "uat", "beta", "prod"];
3预发布 3预发布
4生产 4生产
*/ */
const index = 4; const index = 2;
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
......
...@@ -24,7 +24,7 @@ class Request { ...@@ -24,7 +24,7 @@ class Request {
let header = RequestMethods === 'POST' ? { let header = RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded' 'content-type': 'application/x-www-form-urlencoded'
} : {'Cache-Control': 'no-cache'} } : {'Cache-Control': 'no-cache'}
// const merchantId = wx.$util.getStorageSync('srcm_shopmall_merchant_id') // const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
// if (merchantId) header.merchantId = merchantId // if (merchantId) header.merchantId = merchantId
let projectName = this.getRopProject(params.method) let projectName = this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
...@@ -103,7 +103,8 @@ class Request { ...@@ -103,7 +103,8 @@ class Request {
appKey = secretKey[projectName].appKey appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret secret = secretKey[projectName].secret
} }
const sessionId = util.getSessionId() // const sessionId = util.getSessionId()
const sessionId = wx.$storage.get("aicard_info").sessionId
let noSignAttr = [] let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId if (!params.sessionId && sessionId) params.sessionId = sessionId
if (params.noSignAttr) { if (params.noSignAttr) {
......
...@@ -13,7 +13,6 @@ import util from './utils/util.js' ...@@ -13,7 +13,6 @@ import util from './utils/util.js'
import './utils/Track' import './utils/Track'
import { ssoApi, wechatApi } from './api/api' import { ssoApi, wechatApi } from './api/api'
import { trackData } from './utils/data' import { trackData } from './utils/data'
import eventbus from './utils/evenbus' import eventbus from './utils/evenbus'
// 实例化对象存储 // 实例化对象存储
import { Storage } from './utils/cache/storage' import { Storage } from './utils/cache/storage'
...@@ -30,18 +29,18 @@ App({ ...@@ -30,18 +29,18 @@ App({
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/'
wx.$appId = wx.getAccountInfoSync().miniProgram.appId wx.$appId = wx.getAccountInfoSync().miniProgram.appId
const systemInfo = wx.getStorageSync('aicard_system_info') const systemInfo = wx.$storage.get('aicard_system_info')
if (!systemInfo) if (!systemInfo)
wx.getSystemInfo({ wx.getSystemInfo({
success(res) { success(res) {
util.setStorageSync('aicard_system_info', res) wx.$storage.set('aicard_system_info', res)
} }
}) })
if (options.path != 'pages/tab/index/index') { if (options.path != 'pages/tab/index/index') {
this.login() this.login()
} }
// wx.showMeasure = false // wx.showMeasure = false
wx.showMeasure = !!options.query.scene wx.showMeasure = !!(options.query && options.query.scene)
}, },
login(returnResponse) { login(returnResponse) {
let _this = this let _this = this
...@@ -57,11 +56,9 @@ App({ ...@@ -57,11 +56,9 @@ App({
}) })
.then(res => { .then(res => {
wechatInfo = res.data wechatInfo = res.data
util.setStorageSync('aicard_info', wechatInfo) wx.$storage.set('aicard_info', wechatInfo)
wx.$authStatus = res.code != 0 wx.$authStatus = res.code != 0
util.setSessionId(wechatInfo.sessionId)
openId = wechatInfo.openId openId = wechatInfo.openId
// util.setStorageSync('openId', openId)
console.log(wx.$trackData) console.log(wx.$trackData)
wx.showMeasure = !!wx.$trackData.scene wx.showMeasure = !!wx.$trackData.scene
if (wx.$trackData.scene) { if (wx.$trackData.scene) {
...@@ -70,33 +67,33 @@ App({ ...@@ -70,33 +67,33 @@ App({
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) console.log('wx.$trackData.cardId', wx.$trackData.cardId)
util.setStorageSync('scene', res) wx.$storage.set('scene', {
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info')) merchant: res.merchantId,
wx.$trackData.type = systemInfo.environment ? 2 : 1 cardId: res.cardId
})
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo) wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
}) })
} else if (wx.$trackData.detailShare) { // } else if (wx.$trackData.isShare) {
// d+产品分享在这里设置埋点 // wx.$storage.set('scene', wx.$trackData)
const detailShare = wx.$trackData.detailShare // } else if (!wx.$trackData.detailShare && wx.$trackData.cardId) {
console.log(1211) // // 名片分享在这里设置埋点
for (let i in trackData) { // wx.$storage.set('scene', wx.$trackData)
console.log(i) // wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
if (trackData[i].pageName == detailShare) { } else if (wx.$trackData.shareType) {
console.log(trackData[i]) // 其他的分享进来的页面走这里,在进页面的onshow中需对wx.$trackData先赋值
wx.$Track.sendTrack(trackData[i], wechatInfo) const shareType = wx.$trackData.shareType
switch(shareType) {
case 'SHARE_HOME':
// 名片分享在这里设置埋点
wx.$storage.set('scene', wx.$trackData)
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
break break
} case 'SHARE_D':
wx.$storage.set('scene', wx.$trackData)
break
default:
wx.$storage.set('scene', wx.$trackData)
} }
} else if (wx.$trackData.isShare) {
util.setStorageSync('scene', wx.$trackData)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
} 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, wechatInfo)
} }
ssoApi ssoApi
.getUserInfo({ .getUserInfo({
...@@ -143,63 +140,26 @@ App({ ...@@ -143,63 +140,26 @@ App({
* 下载小程序新版本并重启应用 * 下载小程序新版本并重启应用
*/ */
autoUpdate: function () { autoUpdate: function () {
// console.log(new Date()) const updateManager = wx.getUpdateManager()
const self = this updateManager.onCheckForUpdate(function (res) {
// 获取小程序更新机制兼容 // 请求完新版本信息的回调
if (wx.canIUse('getUpdateManager')) { console.log(res.hasUpdate)
const updateManager = wx.getUpdateManager() })
//1. 检查小程序是否有新版本发布 updateManager.onUpdateReady(function () {
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({ wx.showModal({
title: '提示', title: '更新提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
}) })
} })
updateManager.onUpdateFailed(function () {
// 新版本下载失败
})
}, },
globalData: {} globalData: {}
}) })
...@@ -111,14 +111,14 @@ Component({ ...@@ -111,14 +111,14 @@ Component({
sessionId: '' sessionId: ''
}) })
wx.$util.setUserInfo(data) wx.$util.setUserInfo(data)
wx.$util.setSessionId(data.sessionId) // wx.$util.setSessionId(data.sessionId)
thisPage.onLoad() thisPage.onLoad()
thisPage.onShow() thisPage.onShow()
if (thisPage.init) thisPage.init() if (thisPage.init) thisPage.init()
if (thisPage.onRoute) thisPage.onRoute() if (thisPage.onRoute) thisPage.onRoute()
if (thisPage.loginCallBack) thisPage.loginCallBack(data) if (thisPage.loginCallBack) thisPage.loginCallBack(data)
let customerId = wx.$util.getStorageSync('srcm_shopmall_customer_id') let customerId = wx.$storage.get('srcm_shopmall_customer_id')
let merchantId = wx.$util.getStorageSync('srcm_shopmall_merchant_id') let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (customerId) { if (customerId) {
ssoApi.updataCustomerPhone({ ssoApi.updataCustomerPhone({
customerId, customerId,
......
...@@ -57,7 +57,7 @@ Component({ ...@@ -57,7 +57,7 @@ Component({
wx.hideLoading() wx.hideLoading()
if (code==0) { if (code==0) {
wx.$util.setUserInfo(data); wx.$util.setUserInfo(data);
wx.$util.setSessionId(data.sessionId); // wx.$util.setSessionId(data.sessionId);
// 其他操作 // 其他操作
this.triggerEvent("updatePhoneNumber", data.phone); this.triggerEvent("updatePhoneNumber", data.phone);
} else { } else {
......
...@@ -4,13 +4,17 @@ module.exports = Behavior({ ...@@ -4,13 +4,17 @@ module.exports = Behavior({
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"], menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
templateMethods: [{"tap": "selectIntroduce"}], templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0, curIntroduceIndex: 0,
menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE] menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE],
clueAutoplay: true
}, },
methods: { methods: {
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化 // 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) { selectIntroduce(e) {
const curIntroduceIndex = e.currentTarget.dataset.index; const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({
clueAutoplay: false
})
switch(curIntroduceIndex) { switch(curIntroduceIndex) {
case 3: case 3:
wx.$router.go('scene'); wx.$router.go('scene');
...@@ -21,6 +25,12 @@ module.exports = Behavior({ ...@@ -21,6 +25,12 @@ module.exports = Behavior({
// }) // })
wx.$Track.sendTrack(trackData.DIJIA) wx.$Track.sendTrack(trackData.DIJIA)
break break
case 2:
this.setData({
curIntroduceIndex: curIntroduceIndex,clueAutoplay: true
})
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
default: default:
this.setData({ this.setData({
curIntroduceIndex: curIntroduceIndex, curIntroduceIndex: curIntroduceIndex,
......
...@@ -2,8 +2,8 @@ import util from '../utils/util' ...@@ -2,8 +2,8 @@ import util from '../utils/util'
module.exports = Behavior({ module.exports = Behavior({
methods: { methods: {
shareTrack(name, type) { shareTrack(name, type) {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId let merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
let pathName = `pages/productDetail/${type}/${type}?cardId=`+util.getStorageSync('scene').cardId + "&merchant=" + merchant + '&detailShare=' + `trackData.${name}.pageName` let pathName = `pages/productDetail/${type}/${type}?cardId=`+wx.$storage.get('scene').cardId + "&merchant=" + merchant + '&detailShare=' + `trackData.${name}.pageName`
return { return {
title: trackData[name].pageName, title: trackData[name].pageName,
path: pathName path: pathName
......
...@@ -189,12 +189,12 @@ Page({ ...@@ -189,12 +189,12 @@ Page({
params.businessScenario = businessItem.title; params.businessScenario = businessItem.title;
params.productItems = productItems.join(","); params.productItems = productItems.join(",");
} }
params.cardId = wx.$util.getStorageSync("scene").cardId; params.cardId = wx.$storage.get("scene").cardId;
params.merchant = params.merchant =
wx.$util.getStorageSync("scene").merchant || wx.$storage.get("scene").merchant ||
wx.$util.getStorageSync("scene").merchantId; wx.$storage.get("scene").merchantId;
params.openId = wx.$util.getStorageSync("aicard_info").openId; params.openId = wx.$storage.get("aicard_info").openId;
params.unionId = wx.$util.getStorageSync("aicard_info").unionId; params.unionId = wx.$storage.get("aicard_info").unionId;
console.log(params); console.log(params);
entmicroApi.activityApply(params).then(({ data, code, message }) => { entmicroApi.activityApply(params).then(({ data, code, message }) => {
if (code == 0) { if (code == 0) {
...@@ -288,17 +288,6 @@ Page({ ...@@ -288,17 +288,6 @@ 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.ACTIVITYAPPLICATION);
// }
// });
}, },
/** /**
......
...@@ -588,13 +588,13 @@ Page({ ...@@ -588,13 +588,13 @@ Page({
onShareAppMessage() { onShareAppMessage() {
let {senceData,actNum,activeNavIdx,isShare} = this.data let {senceData,actNum,activeNavIdx,isShare} = this.data
let product = senceData[actNum]?.productList[activeNavIdx].proName let product = senceData[actNum]?.productList[activeNavIdx].proName
let merchant = utils.getStorageSync("scene").merchant || utils.getStorageSync("scene").merchantId let merchant = wx.$storage.get("scene").merchant
const cardId = utils.getStorageSync('scene').cardId const cardId = wx.$storage.get('scene').cardId
console.log('product: ', product); console.log('product: ', product);
return { return {
// title: `给你分享一个活动${product},戳我参与~`, // title: `给你分享一个活动${product},戳我参与~`,
title: `给你分享一个活动,戳我参与~`, title: `给你分享一个活动,戳我参与~`,
path:`/pages/checkProduct/checkProduct?actNum=${actNum}&activeNavIdx=${activeNavIdx}&isShare=${isShare}&cardId=${cardId}&merchant=${merchant}` path:`/pages/checkProduct/checkProduct?actNum=${actNum}&activeNavIdx=${activeNavIdx}&isShare=${isShare}&cardId=${cardId}&merchant=${merchant}&shareType=SHARE_D`
} }
}, },
/** /**
......
...@@ -47,10 +47,10 @@ Page({ ...@@ -47,10 +47,10 @@ Page({
let applyType = validFlag[1] let applyType = validFlag[1]
// 区分代理商和门店 // 区分代理商和门店
params.merchantName = applyType == 0 ? params.merchantName + '(新能源-门店)' : params.merchantName + '(新能源-代理商)' params.merchantName = applyType == 0 ? params.merchantName + '(新能源-门店)' : params.merchantName + '(新能源-代理商)'
params.cardId = wx.$util.getStorageSync("scene").cardId params.cardId = wx.$storage.get("scene").cardId
params.merchant = wx.$util.getStorageSync("scene").merchant || wx.$util.getStorageSync("scene").merchantId params.merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
params.openId = wx.$util.getStorageSync('aicard_info').openId params.openId = wx.$storage.get('aicard_info').openId
params.unionId = wx.$util.getStorageSync('aicard_info').unionId params.unionId = wx.$storage.get('aicard_info').unionId
console.log(params); console.log(params);
entmicroApi.activityApply(params).then(({ entmicroApi.activityApply(params).then(({
data, data,
......
...@@ -47,8 +47,6 @@ Page({ ...@@ -47,8 +47,6 @@ Page({
curTabIndex: 0, curTabIndex: 0,
// 0-员工,1-代理商 // 0-员工,1-代理商
customerType: 0, customerType: 0,
// 是否授权昵称
hasUserInfo: false,
// 是否授权手机号 // 是否授权手机号
hasPhoneNumber: false, hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE], curTab: [trackData.COMPANY, trackData.CUBE],
...@@ -67,13 +65,24 @@ Page({ ...@@ -67,13 +65,24 @@ Page({
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 shareDisabled: true,
autoplay: true
}, },
introduce(e) { introduce(e) {
const curTabIndex = e.currentTarget.dataset.index; const curTabIndex = e.currentTarget.dataset.index;
this.setData({
autoplay: false
})
// 视频直播和合作申请是跳转新页面,不需要设置激活样式 // 视频直播和合作申请是跳转新页面,不需要设置激活样式
// 0-公司介绍 1-方案介绍 2-视频直播 3-合作申请 // 0-公司介绍 1-方案介绍 2-视频直播 3-合作申请
switch (curTabIndex) { switch (curTabIndex) {
case 0:
this.setData({
curTabIndex: curTabIndex,
autoplay: true
})
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
break
case 2: case 2:
wx.openChannelsUserProfile({ wx.openChannelsUserProfile({
finderUserName: 'sphPIdcy0NVpuao', finderUserName: 'sphPIdcy0NVpuao',
...@@ -184,16 +193,6 @@ Page({ ...@@ -184,16 +193,6 @@ Page({
getApp() getApp()
.login() .login()
.then(({ data }) => { .then(({ data }) => {
if (data && data.nickName) {
this.setData({
hasUserInfo: true,
});
} else {
this.setData({
hasUserInfo: false
})
}
if (data && data.phone) { if (data && data.phone) {
this.setData({ this.setData({
hasPhoneNumber: true, hasPhoneNumber: true,
...@@ -249,14 +248,13 @@ Page({ ...@@ -249,14 +248,13 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const cardId = util.getStorageSync("scene").cardId const cardId = wx.$storage.get("scene").cardId
const merchant = util.getStorageSync("scene").merchantId || util.getStorageSync("scene").merchant const merchant = wx.$storage.get("scene").merchant
const shareType = 'SHARE_HOME'
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=${cardId}&merchant=${merchant}&shareType=${shareType}`
"pages/tab/index/index?cardId=" +
cardId + "&merchant="+merchant
}; };
}, },
setShareInfo(data = {}) { setShareInfo(data = {}) {
...@@ -387,35 +385,6 @@ Page({ ...@@ -387,35 +385,6 @@ Page({
}; };
drawCard(); drawCard();
}, },
// 获取用户昵称
getUserProfile(e) {
this.setData({
hasUserInfo: true,
});
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
ssoApi
.authUserInfo({
...res,
})
.then(({ code }) => {
if (code == "0") {
getApp()
.login()
.then(({ data }) => {
this.setData({
userInfo: data,
// hasUserInfo: true
});
});
}
});
},
});
},
// banner跳转 // banner跳转
jumpBanner(e) { jumpBanner(e) {
console.log(e) console.log(e)
...@@ -439,8 +408,8 @@ Page({ ...@@ -439,8 +408,8 @@ Page({
this.setData({ this.setData({
'tabList[3].isShow': wx.showMeasure 'tabList[3].isShow': wx.showMeasure
}) })
console.log(util.getStorageSync('scene'), wx.$trackData.cardId) console.log(wx.$storage.get('scene'), wx.$trackData.cardId)
const scene = util.getStorageSync('scene'); const scene = wx.$storage.get('scene');
let params = { let params = {
cardId: wx.$trackData.cardId || scene.cardId cardId: wx.$trackData.cardId || scene.cardId
}; };
......
...@@ -27,15 +27,14 @@ ...@@ -27,15 +27,14 @@
</view> </view>
<!-- 公司介绍 --> <!-- 公司介绍 -->
<block wx:if="{{curTabIndex === 0 }}"> <block wx:if="{{curTabIndex === 0 }}">
<template is="company" data="{{IMGURL, banner, current, img_version, awardBanner, awardCurrent}}"></template> <template is="company" data="{{IMGURL, banner, current, img_version, awardBanner, awardCurrent, autoplay}}"></template>
</block> </block>
<!-- 方案介绍 --> <!-- 方案介绍 -->
<block wx:if="{{curTabIndex === 1 }}"> <block wx:if="{{curTabIndex === 1 }}">
<template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType, hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList}}"></template> <template is="menu" data="{{menuList, curIntroduceIndex, templateMethods, customerType, hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList, autoplay, clueAutoplay}}"></template>
</block> </block>
</view> </view>
<view wx:if="{{!hasUserInfo}}" class="user-profile" bindtap="getUserProfile"></view>
<!-- 服务咨询 --> <!-- 服务咨询 -->
<view class="floating-box"> <view class="floating-box">
<image class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="handleOpen" data-name="store" src="{{IMGURL}}home/icon-store.png?v={{img_version}}"></image> <image class="floating-icon" style="margin-bottom: 10rpx;" webp bindtap="handleOpen" data-name="store" src="{{IMGURL}}home/icon-store.png?v={{img_version}}"></image>
......
...@@ -98,14 +98,6 @@ page { ...@@ -98,14 +98,6 @@ page {
} }
.application {
position: fixed;
bottom: 0;
width: 100%;
}
.main-box { .main-box {
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: 100%;
...@@ -120,37 +112,7 @@ page { ...@@ -120,37 +112,7 @@ page {
padding-top: 24rpx; padding-top: 24rpx;
flex: 1; flex: 1;
} }
/* 用户授权 */
.user-profile {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: transparent;
}
/* 手机号授权 */
.phone-number {
display: flex;
align-items: center;
justify-content: center;
margin: 16rpx 48rpx;
color: #fff;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
}
.icon-arrow {
width: 32rpx;
height: 32rpx;
}
.icon-arrow:first-child {
margin-right: 48rpx;
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
/* 了解更多 */ /* 了解更多 */
.more-box { .more-box {
position: relative; position: relative;
......
...@@ -7,13 +7,12 @@ ...@@ -7,13 +7,12 @@
<video poster="{{IMGURL}}image/clue/clue-img14.png?v={{img_version}}" src="{{IMGURL}}image/clue/clue.mp4?v={{img_version}}"></video> <video poster="{{IMGURL}}image/clue/clue-img14.png?v={{img_version}}" src="{{IMGURL}}image/clue/clue.mp4?v={{img_version}}"></video>
</view> </view>
</view> </view>
<view wx:if="{{hasPhoneNumber}}"> <view wx:if="{{hasPhoneNumber}}">
<view class="relative m-t-64"> <view class="relative m-t-64">
<image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/clue/clue-bg.webp?v={{img_version}}"></image> <image mode="widthFix" class="img" lazy-load webp src="{{IMGURL}}image/clue/clue-bg.webp?v={{img_version}}"></image>
<view class="clue"> <view class="clue">
<!-- <image mode="widthFix" class="img" lazy-load src="{{IMGURL}}image/clue/clue-img2.webp?v={{img_version}}"></image> --> <!-- <image mode="widthFix" class="img" lazy-load src="{{IMGURL}}image/clue/clue-img2.webp?v={{img_version}}"></image> -->
<swiper class="clue-swiper" autoplay bindchange="clueChange" current="{{clueCurrent}}" interval="5000" circular> <swiper class="clue-swiper" autoplay="{{clueAutoplay}}" bindchange="clueChange" current="{{clueCurrent}}" interval="5000" circular>
<block wx:for="{{clueList}}" wx:key="ind"> <block wx:for="{{clueList}}" wx:key="ind">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<image class="clue-img" lazy-load webp src="{{IMGURL}}image/clue/{{item}}?v={{img_version}}"></image> <image class="clue-img" lazy-load webp src="{{IMGURL}}image/clue/{{item}}?v={{img_version}}"></image>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="relative"> <view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image> <image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image>
<view class="box2"> <view class="box2">
<swiper class="swiper" autoplay duration="5000" interval="5000" circular> <swiper class="swiper" autoplay="{{autoplay}}" duration="5000" interval="5000" circular>
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<image class="box2-content" webp src="{{IMGURL}}image/company/company-img2.png?v={{img_version}}"></image> <image class="box2-content" webp src="{{IMGURL}}image/company/company-img2.png?v={{img_version}}"></image>
</swiper-item> </swiper-item>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<view class="relative"> <view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image> <image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image>
<view class="box3"> <view class="box3">
<swiper class="box3-swiper" autoplay bindchange="changePage" current="{{current}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular> <swiper class="box3-swiper" autoplay="{{autoplay}}" bindchange="changePage" current="{{current}}" indicator-dots="{{false}}" indicator-color="#E6E7EB" indicator-active-color="#5850FF" interval="5000" circular>
<block wx:for="{{banner}}" wx:key="ind"> <block wx:for="{{banner}}" wx:key="ind">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<image class="box3-img" webp src="{{IMGURL}}image/company/{{item}}?v={{img_version}}"></image> <image class="box3-img" webp src="{{IMGURL}}image/company/{{item}}?v={{img_version}}"></image>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<template is="equity" data="{{hasPhoneNumber, IMGURL, img_version}}"></template> <template is="equity" data="{{hasPhoneNumber, IMGURL, img_version}}"></template>
</block> </block>
<block wx:elif="{{curIntroduceIndex == 2}}"> <block wx:elif="{{curIntroduceIndex == 2}}">
<template is="clue" data="{{hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList}}"></template> <template is="clue" data="{{hasPhoneNumber, IMGURL, img_version, clueCurrent, clueList, clueAutoplay}}"></template>
</block> </block>
</view> </view>
</template> </template>
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,7 @@ class Draw { ...@@ -10,7 +10,7 @@ class Draw {
constructor(_this_, canvasObject) { constructor(_this_, canvasObject) {
let { let {
pixelRatio pixelRatio
} = JSON.parse(wx.getStorageSync('aicard_system_info')) } =wx.$storage.get('aicard_system_info')
this[_canvasObject_] = canvasObject this[_canvasObject_] = canvasObject
this[_pixelRatio_] = canvasObject.pixelRatio || pixelRatio || 2 this[_pixelRatio_] = canvasObject.pixelRatio || pixelRatio || 2
const height = this.toRpx(canvasObject.height), const height = this.toRpx(canvasObject.height),
......
...@@ -112,7 +112,7 @@ class TRACK { ...@@ -112,7 +112,7 @@ class TRACK {
// wx.setStorageSync('prepare_data', prepare_data) // wx.setStorageSync('prepare_data', prepare_data)
} }
getGuestNo() { getGuestNo() {
let guest_no = wx.getStorageSync('guest_no') let guest_no = wx.$storage.get('guest_no')
if (!guest_no) { if (!guest_no) {
guest_no = this.setGuestNo() guest_no = this.setGuestNo()
wx.setStorageSync('guest_no', guest_no) wx.setStorageSync('guest_no', guest_no)
...@@ -123,11 +123,12 @@ class TRACK { ...@@ -123,11 +123,12 @@ class TRACK {
sendTrack(p, info) { sendTrack(p, info) {
console.log(info) console.log(info)
console.log(wx.$trackData); console.log(wx.$trackData);
const systemInfo = wx.$storage.get('aicard_system_info')
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 || wx.$trackData.merchantId || wx.$util.getStorageSync("scene").merchant, merchant: wx.$trackData.merchant || wx.$trackData.merchantId || wx.$storage.get("scene").merchant,
type: wx.$trackData.type type: systemInfo.environment ? 2 : 1
} }
let userInfo = { } let userInfo = { }
...@@ -135,7 +136,7 @@ class TRACK { ...@@ -135,7 +136,7 @@ class TRACK {
const {nickName, openId, phone} = wx.$util.getUserInfo() || {} const {nickName, openId, phone} = wx.$util.getUserInfo() || {}
userInfo = { userInfo = {
nickName, nickName,
unionId: wx.$util.getStorageSync('aicard_info').unionId, unionId: wx.$storage.get('aicard_info').unionId,
openId, openId,
phone, phone,
} }
...@@ -143,11 +144,11 @@ class TRACK { ...@@ -143,11 +144,11 @@ class TRACK {
// if (info.openId) { // if (info.openId) {
// userInfo.openId = info.openId // userInfo.openId = info.openId
// } else { // } else {
// // userInfo.openId = wx.$util.getStorageSync('openId') // // userInfo.openId = wx.$storage.get('openId')
// userInfo.openId = wx.$util.getStorageSync('aicard_info').openId // userInfo.openId = wx.$storage.get('aicard_info').openId
// } // }
userInfo.openId = info && info.openId ? info.openId : wx.$util.getStorageSync('aicard_info').openId userInfo.openId = info && info.openId ? info.openId : wx.$storage.get('aicard_info').openId
userInfo.unionId = info && info.unionId ? info.unionId : wx.$util.getStorageSync('aicard_info').unionId userInfo.unionId = info && info.unionId ? info.unionId : wx.$storage.get('aicard_info').unionId
} }
params = Object.assign(params, userInfo, p) params = Object.assign(params, userInfo, p)
...@@ -192,7 +193,7 @@ class TRACK { ...@@ -192,7 +193,7 @@ class TRACK {
model, model,
system, system,
version version
} = JSON.parse(wx.getStorageSync('aicard_system_info')) } = JSON.parse(wx.$storage.get('aicard_system_info'))
return { return {
SDK_version: SDKVersion, SDK_version: SDKVersion,
brand, brand,
...@@ -205,14 +206,14 @@ class TRACK { ...@@ -205,14 +206,14 @@ class TRACK {
getMerchantInfo() { getMerchantInfo() {
let { let {
merchantId merchantId
} = wx.getStorageSync('merchant_info') } = wx.$storage.get('merchant_info')
return { return {
merchant_id: merchantId merchant_id: merchantId
} }
} }
/**获取用户位置信息 */ /**获取用户位置信息 */
// getAddressInfo() { // getAddressInfo() {
// let addressInfo = wx.getStorageSync('address_info') // let addressInfo = wx.$storage.get('address_info')
// return new Promise((resolve) => { // return new Promise((resolve) => {
// if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo) // if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo)
// else wx.getLocation({ // else wx.getLocation({
......
...@@ -14,7 +14,12 @@ export const STORAGE_OBJECTkEY = { ...@@ -14,7 +14,12 @@ export const STORAGE_OBJECTkEY = {
wx_user_info: 'wx_user_info', wx_user_info: 'wx_user_info',
userPhone: 'userPhone', userPhone: 'userPhone',
firstLogin:'firstLogin', firstLogin:'firstLogin',
authphone:'authphone' authphone:'authphone',
aicard_system_info: 'aicard_system_info',
aicard_info: 'aicard_info',
aicard_sessionId: 'aicard_sessionId',
scene: 'scene',
aicard_user_info: 'aicard_user_info'
} }
export const IMG_VERSION = () =>{ export const IMG_VERSION = () =>{
......
...@@ -303,12 +303,12 @@ const phoneCall = phoneNumber => { ...@@ -303,12 +303,12 @@ const phoneCall = phoneNumber => {
} }
/**获取用户信息 */ /**获取用户信息 */
const getUserInfo = () => { const getUserInfo = () => {
let user = wx.getStorageSync('aicard_user_info') || null let user = wx.$storage.get('aicard_user_info') || null
return JSON.parse(user) return user
} }
/**设置用户信息 */ /**设置用户信息 */
const setUserInfo = userInfo => { const setUserInfo = userInfo => {
wx.setStorageSync('aicard_user_info', JSON.stringify(userInfo)) wx.$storage.set('aicard_user_info', userInfo)
} }
/**IOS时间兼容 */ /**IOS时间兼容 */
const iosTimeFormat = time => { const iosTimeFormat = time => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!