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"];
3预发布
4生产
*/
const index = 4;
const index = 2;
const secretKey = {
ip: {},
dev: {
......
......@@ -24,7 +24,7 @@ class Request {
let header = RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded'
} : {'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
let projectName = this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method)
......@@ -103,7 +103,8 @@ class Request {
appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret
}
const sessionId = util.getSessionId()
// const sessionId = util.getSessionId()
const sessionId = wx.$storage.get("aicard_info").sessionId
let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId
if (params.noSignAttr) {
......
......@@ -13,7 +13,6 @@ import util from './utils/util.js'
import './utils/Track'
import { ssoApi, wechatApi } from './api/api'
import { trackData } from './utils/data'
import eventbus from './utils/evenbus'
// 实例化对象存储
import { Storage } from './utils/cache/storage'
......@@ -30,18 +29,18 @@ App({
wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx.$appId = wx.getAccountInfoSync().miniProgram.appId
const systemInfo = wx.getStorageSync('aicard_system_info')
const systemInfo = wx.$storage.get('aicard_system_info')
if (!systemInfo)
wx.getSystemInfo({
success(res) {
util.setStorageSync('aicard_system_info', res)
wx.$storage.set('aicard_system_info', res)
}
})
if (options.path != 'pages/tab/index/index') {
this.login()
}
// wx.showMeasure = false
wx.showMeasure = !!options.query.scene
wx.showMeasure = !!(options.query && options.query.scene)
},
login(returnResponse) {
let _this = this
......@@ -57,11 +56,9 @@ App({
})
.then(res => {
wechatInfo = res.data
util.setStorageSync('aicard_info', wechatInfo)
wx.$storage.set('aicard_info', wechatInfo)
wx.$authStatus = res.code != 0
util.setSessionId(wechatInfo.sessionId)
openId = wechatInfo.openId
// util.setStorageSync('openId', openId)
console.log(wx.$trackData)
wx.showMeasure = !!wx.$trackData.scene
if (wx.$trackData.scene) {
......@@ -70,33 +67,33 @@ App({
wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId
console.log('wx.$trackData.cardId', wx.$trackData.cardId)
util.setStorageSync('scene', res)
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$storage.set('scene', {
merchant: res.merchantId,
cardId: res.cardId
})
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
})
} 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], wechatInfo)
// } else if (wx.$trackData.isShare) {
// wx.$storage.set('scene', wx.$trackData)
// } else if (!wx.$trackData.detailShare && wx.$trackData.cardId) {
// // 名片分享在这里设置埋点
// wx.$storage.set('scene', wx.$trackData)
// wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
} else if (wx.$trackData.shareType) {
// 其他的分享进来的页面走这里,在进页面的onshow中需对wx.$trackData先赋值
const shareType = wx.$trackData.shareType
switch(shareType) {
case 'SHARE_HOME':
// 名片分享在这里设置埋点
wx.$storage.set('scene', wx.$trackData)
wx.$Track.sendTrack(trackData.COMPANY, wechatInfo)
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
.getUserInfo({
......@@ -143,63 +140,26 @@ 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 {
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log(res.hasUpdate)
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
}
})
updateManager.onUpdateFailed(function () {
// 新版本下载失败
})
},
globalData: {}
})
......@@ -111,14 +111,14 @@ Component({
sessionId: ''
})
wx.$util.setUserInfo(data)
wx.$util.setSessionId(data.sessionId)
// wx.$util.setSessionId(data.sessionId)
thisPage.onLoad()
thisPage.onShow()
if (thisPage.init) thisPage.init()
if (thisPage.onRoute) thisPage.onRoute()
if (thisPage.loginCallBack) thisPage.loginCallBack(data)
let customerId = wx.$util.getStorageSync('srcm_shopmall_customer_id')
let merchantId = wx.$util.getStorageSync('srcm_shopmall_merchant_id')
let customerId = wx.$storage.get('srcm_shopmall_customer_id')
let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (customerId) {
ssoApi.updataCustomerPhone({
customerId,
......
......@@ -57,7 +57,7 @@ Component({
wx.hideLoading()
if (code==0) {
wx.$util.setUserInfo(data);
wx.$util.setSessionId(data.sessionId);
// wx.$util.setSessionId(data.sessionId);
// 其他操作
this.triggerEvent("updatePhoneNumber", data.phone);
} else {
......
......@@ -4,13 +4,17 @@ module.exports = Behavior({
menuList: ["企微魔方", "数字化权益", "智能线索", "D+增值转化"],
templateMethods: [{"tap": "selectIntroduce"}],
curIntroduceIndex: 0,
menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE]
menuTab: [trackData.CUBE,trackData.EQUITY,trackData.CLUE],
clueAutoplay: true
},
methods: {
// 0-企微魔方 1-数字化权益 2-智能线索 3-D+增值转化
selectIntroduce(e) {
const curIntroduceIndex = e.currentTarget.dataset.index;
this.setData({
clueAutoplay: false
})
switch(curIntroduceIndex) {
case 3:
wx.$router.go('scene');
......@@ -21,6 +25,12 @@ module.exports = Behavior({
// })
wx.$Track.sendTrack(trackData.DIJIA)
break
case 2:
this.setData({
curIntroduceIndex: curIntroduceIndex,clueAutoplay: true
})
wx.$Track.sendTrack(this.data.menuTab[this.data.curIntroduceIndex]);
break
default:
this.setData({
curIntroduceIndex: curIntroduceIndex,
......
......@@ -2,8 +2,8 @@ import util from '../utils/util'
module.exports = Behavior({
methods: {
shareTrack(name, type) {
let merchant = util.getStorageSync("scene").merchant || util.getStorageSync("scene").merchantId
let pathName = `pages/productDetail/${type}/${type}?cardId=`+util.getStorageSync('scene').cardId + "&merchant=" + merchant + '&detailShare=' + `trackData.${name}.pageName`
let merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
let pathName = `pages/productDetail/${type}/${type}?cardId=`+wx.$storage.get('scene').cardId + "&merchant=" + merchant + '&detailShare=' + `trackData.${name}.pageName`
return {
title: trackData[name].pageName,
path: pathName
......
......@@ -189,12 +189,12 @@ Page({
params.businessScenario = businessItem.title;
params.productItems = productItems.join(",");
}
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.openId = wx.$util.getStorageSync("aicard_info").openId;
params.unionId = wx.$util.getStorageSync("aicard_info").unionId;
wx.$storage.get("scene").merchant ||
wx.$storage.get("scene").merchantId;
params.openId = wx.$storage.get("aicard_info").openId;
params.unionId = wx.$storage.get("aicard_info").unionId;
console.log(params);
entmicroApi.activityApply(params).then(({ data, code, message }) => {
if (code == 0) {
......@@ -288,17 +288,6 @@ Page({
* 生命周期函数--监听页面显示
*/
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({
onShareAppMessage() {
let {senceData,actNum,activeNavIdx,isShare} = this.data
let product = senceData[actNum]?.productList[activeNavIdx].proName
let merchant = utils.getStorageSync("scene").merchant || utils.getStorageSync("scene").merchantId
const cardId = utils.getStorageSync('scene').cardId
let merchant = wx.$storage.get("scene").merchant
const cardId = wx.$storage.get('scene').cardId
console.log('product: ', product);
return {
// title: `给你分享一个活动${product},戳我参与~`,
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({
let applyType = validFlag[1]
// 区分代理商和门店
params.merchantName = applyType == 0 ? params.merchantName + '(新能源-门店)' : params.merchantName + '(新能源-代理商)'
params.cardId = wx.$util.getStorageSync("scene").cardId
params.merchant = wx.$util.getStorageSync("scene").merchant || wx.$util.getStorageSync("scene").merchantId
params.openId = wx.$util.getStorageSync('aicard_info').openId
params.unionId = wx.$util.getStorageSync('aicard_info').unionId
params.cardId = wx.$storage.get("scene").cardId
params.merchant = wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId
params.openId = wx.$storage.get('aicard_info').openId
params.unionId = wx.$storage.get('aicard_info').unionId
console.log(params);
entmicroApi.activityApply(params).then(({
data,
......
......@@ -47,8 +47,6 @@ Page({
curTabIndex: 0,
// 0-员工,1-代理商
customerType: 0,
// 是否授权昵称
hasUserInfo: false,
// 是否授权手机号
hasPhoneNumber: false,
curTab: [trackData.COMPANY, trackData.CUBE],
......@@ -67,13 +65,24 @@ Page({
clueCurrent: 0,
awardBanner: [{src: 'company-img7.png', name: '组织荣誉'}, {src: 'company-img71.png', name: '行业奖项'}],
awardCurrent: 0,
shareDisabled: true
shareDisabled: true,
autoplay: true
},
introduce(e) {
const curTabIndex = e.currentTarget.dataset.index;
this.setData({
autoplay: false
})
// 视频直播和合作申请是跳转新页面,不需要设置激活样式
// 0-公司介绍 1-方案介绍 2-视频直播 3-合作申请
switch (curTabIndex) {
case 0:
this.setData({
curTabIndex: curTabIndex,
autoplay: true
})
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex]);
break
case 2:
wx.openChannelsUserProfile({
finderUserName: 'sphPIdcy0NVpuao',
......@@ -184,16 +193,6 @@ Page({
getApp()
.login()
.then(({ data }) => {
if (data && data.nickName) {
this.setData({
hasUserInfo: true,
});
} else {
this.setData({
hasUserInfo: false
})
}
if (data && data.phone) {
this.setData({
hasPhoneNumber: true,
......@@ -249,14 +248,13 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
const cardId = util.getStorageSync("scene").cardId
const merchant = util.getStorageSync("scene").merchantId || util.getStorageSync("scene").merchant
const cardId = wx.$storage.get("scene").cardId
const merchant = wx.$storage.get("scene").merchant
const shareType = 'SHARE_HOME'
return {
title: `您好,我向你推荐了广联数科${this.data.cardInfo.staffName}的智能名片~`,
imageUrl: this.data.shareImg,
path:
"pages/tab/index/index?cardId=" +
cardId + "&merchant="+merchant
path: `pages/tab/index/index?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}`
};
},
setShareInfo(data = {}) {
......@@ -387,35 +385,6 @@ Page({
};
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跳转
jumpBanner(e) {
console.log(e)
......@@ -439,8 +408,8 @@ Page({
this.setData({
'tabList[3].isShow': wx.showMeasure
})
console.log(util.getStorageSync('scene'), wx.$trackData.cardId)
const scene = util.getStorageSync('scene');
console.log(wx.$storage.get('scene'), wx.$trackData.cardId)
const scene = wx.$storage.get('scene');
let params = {
cardId: wx.$trackData.cardId || scene.cardId
};
......
......@@ -27,15 +27,14 @@
</view>
<!-- 公司介绍 -->
<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 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>
</view>
<view wx:if="{{!hasUserInfo}}" class="user-profile" bindtap="getUserProfile"></view>
<!-- 服务咨询 -->
<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>
......
......@@ -98,14 +98,6 @@ page {
}
.application {
position: fixed;
bottom: 0;
width: 100%;
}
.main-box {
box-sizing: border-box;
height: 100%;
......@@ -120,37 +112,7 @@ page {
padding-top: 24rpx;
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 {
position: relative;
......
......@@ -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>
</view>
</view>
<view wx:if="{{hasPhoneNumber}}">
<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>
<view class="clue">
<!-- <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">
<swiper-item class="swiper-item">
<image class="clue-img" lazy-load webp src="{{IMGURL}}image/clue/{{item}}?v={{img_version}}"></image>
......
......@@ -6,7 +6,7 @@
<view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg1.png?v={{img_version}}"></image>
<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">
<image class="box2-content" webp src="{{IMGURL}}image/company/company-img2.png?v={{img_version}}"></image>
</swiper-item>
......@@ -20,7 +20,7 @@
<view class="relative">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/company/bg2.png?v={{img_version}}"></image>
<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">
<swiper-item class="swiper-item">
<image class="box3-img" webp src="{{IMGURL}}image/company/{{item}}?v={{img_version}}"></image>
......
......@@ -17,7 +17,7 @@
<template is="equity" data="{{hasPhoneNumber, IMGURL, img_version}}"></template>
</block>
<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>
</view>
</template>
\ No newline at end of file
......@@ -10,7 +10,7 @@ class Draw {
constructor(_this_, canvasObject) {
let {
pixelRatio
} = JSON.parse(wx.getStorageSync('aicard_system_info'))
} =wx.$storage.get('aicard_system_info')
this[_canvasObject_] = canvasObject
this[_pixelRatio_] = canvasObject.pixelRatio || pixelRatio || 2
const height = this.toRpx(canvasObject.height),
......
......@@ -112,7 +112,7 @@ class TRACK {
// wx.setStorageSync('prepare_data', prepare_data)
}
getGuestNo() {
let guest_no = wx.getStorageSync('guest_no')
let guest_no = wx.$storage.get('guest_no')
if (!guest_no) {
guest_no = this.setGuestNo()
wx.setStorageSync('guest_no', guest_no)
......@@ -123,11 +123,12 @@ class TRACK {
sendTrack(p, info) {
console.log(info)
console.log(wx.$trackData);
const systemInfo = wx.$storage.get('aicard_system_info')
let params = {
method: 'entmicro.api.business.card.cardRecord',
cardId: wx.$trackData.cardId,
merchant: wx.$trackData.merchant || wx.$trackData.merchantId || wx.$util.getStorageSync("scene").merchant,
type: wx.$trackData.type
merchant: wx.$trackData.merchant || wx.$trackData.merchantId || wx.$storage.get("scene").merchant,
type: systemInfo.environment ? 2 : 1
}
let userInfo = { }
......@@ -135,7 +136,7 @@ class TRACK {
const {nickName, openId, phone} = wx.$util.getUserInfo() || {}
userInfo = {
nickName,
unionId: wx.$util.getStorageSync('aicard_info').unionId,
unionId: wx.$storage.get('aicard_info').unionId,
openId,
phone,
}
......@@ -143,11 +144,11 @@ class TRACK {
// if (info.openId) {
// userInfo.openId = info.openId
// } else {
// // userInfo.openId = wx.$util.getStorageSync('openId')
// userInfo.openId = wx.$util.getStorageSync('aicard_info').openId
// // userInfo.openId = wx.$storage.get('openId')
// userInfo.openId = wx.$storage.get('aicard_info').openId
// }
userInfo.openId = info && info.openId ? info.openId : wx.$util.getStorageSync('aicard_info').openId
userInfo.unionId = info && info.unionId ? info.unionId : wx.$util.getStorageSync('aicard_info').unionId
userInfo.openId = info && info.openId ? info.openId : wx.$storage.get('aicard_info').openId
userInfo.unionId = info && info.unionId ? info.unionId : wx.$storage.get('aicard_info').unionId
}
params = Object.assign(params, userInfo, p)
......@@ -192,7 +193,7 @@ class TRACK {
model,
system,
version
} = JSON.parse(wx.getStorageSync('aicard_system_info'))
} = JSON.parse(wx.$storage.get('aicard_system_info'))
return {
SDK_version: SDKVersion,
brand,
......@@ -205,14 +206,14 @@ class TRACK {
getMerchantInfo() {
let {
merchantId
} = wx.getStorageSync('merchant_info')
} = wx.$storage.get('merchant_info')
return {
merchant_id: merchantId
}
}
/**获取用户位置信息 */
// getAddressInfo() {
// let addressInfo = wx.getStorageSync('address_info')
// let addressInfo = wx.$storage.get('address_info')
// return new Promise((resolve) => {
// if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo)
// else wx.getLocation({
......
......@@ -14,7 +14,12 @@ export const STORAGE_OBJECTkEY = {
wx_user_info: 'wx_user_info',
userPhone: 'userPhone',
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 = () =>{
......
......@@ -303,12 +303,12 @@ const phoneCall = phoneNumber => {
}
/**获取用户信息 */
const getUserInfo = () => {
let user = wx.getStorageSync('aicard_user_info') || null
return JSON.parse(user)
let user = wx.$storage.get('aicard_user_info') || null
return user
}
/**设置用户信息 */
const setUserInfo = userInfo => {
wx.setStorageSync('aicard_user_info', JSON.stringify(userInfo))
wx.$storage.set('aicard_user_info', userInfo)
}
/**IOS时间兼容 */
const iosTimeFormat = time => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!