Commit 7a9bba5c by 李伟康

Merge branch 'master' into 'SAAS+v4.33.0'

合并3.22.1

See merge request !9
2 parents d8a59eb1 9507f9c8
...@@ -16,7 +16,10 @@ Page({ ...@@ -16,7 +16,10 @@ Page({
isOpenMember: false isOpenMember: false
}, },
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail let {
height,
statusBarHeight
} = e.detail
this.setData({ this.setData({
tabBarStyle: height / 2 + statusBarHeight, tabBarStyle: height / 2 + statusBarHeight,
tabBoxStyle: `height: ${height}px`, tabBoxStyle: `height: ${height}px`,
...@@ -57,7 +60,11 @@ Page({ ...@@ -57,7 +60,11 @@ Page({
wx.$LoginStatus = false wx.$LoginStatus = false
wx.p.storage.set('userInfo', data) wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId) wx.p.storage.set('sessionId', data.sessionId)
let { nickName, headImgUrl, phone } = data let {
nickName,
headImgUrl,
phone
} = data
this.setData({ this.setData({
userInfo: data, userInfo: data,
nickName: nickName, nickName: nickName,
...@@ -80,7 +87,9 @@ Page({ ...@@ -80,7 +87,9 @@ Page({
} }
let json = JSON.stringify(item) let json = JSON.stringify(item)
// 数据上报 // 数据上报
wx.p.api.common.trackHttp({ json }).then(response => { }) wx.p.api.common.trackHttp({
json
}).then(response => {})
if (nickName || headImgUrl) { if (nickName || headImgUrl) {
this.setData({ this.setData({
hasUserInfo: true hasUserInfo: true
...@@ -95,8 +104,8 @@ Page({ ...@@ -95,8 +104,8 @@ Page({
domain, domain,
index index
} = environment, } = environment,
// redirectUrl = `${domain}/wx-oauth`, // redirectUrl = `${domain}/wx-oauth`,
redirectUrl = `https://scrm.glsx.com.cn/wy-wx-oauth`, redirectUrl = `https://scrm.glsx.com.cn/wy-wx-oauth`,
// redirectUrl = 'http://scrm.dev.glsx.com.cn/wx-oauth', // redirectUrl = 'http://scrm.dev.glsx.com.cn/wx-oauth',
// 云商/业主生活社开发者 wx1cf40dc91c28a7fd ,glsxtest02 wx56bed167ad463f70 // 云商/业主生活社开发者 wx1cf40dc91c28a7fd ,glsxtest02 wx56bed167ad463f70
appid = 'wx1cf40dc91c28a7fd', appid = 'wx1cf40dc91c28a7fd',
...@@ -109,8 +118,12 @@ Page({ ...@@ -109,8 +118,12 @@ Page({
async tofreeReceive() { async tofreeReceive() {
const userInfo = wx.p.storage.get('userInfo') const userInfo = wx.p.storage.get('userInfo')
const { merchantId } = this.data const {
let { phone } = userInfo merchantId
} = this.data
let {
phone
} = userInfo
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
this.toPostFreeCard(merchantId, phone, userInfo) this.toPostFreeCard(merchantId, phone, userInfo)
}, },
...@@ -122,7 +135,12 @@ Page({ ...@@ -122,7 +135,12 @@ Page({
} }
wx.p.api.couponsApi.tolqFreecard(para).then(res => { wx.p.api.couponsApi.tolqFreecard(para).then(res => {
wx.hideLoading() wx.hideLoading()
const { errId, code, message, data } = res const {
errId,
code,
message,
data
} = res
if ((code == -1 && errId == 20313) || (code == -1 && errId == 20322)) { if ((code == -1 && errId == 20313) || (code == -1 && errId == 20322)) {
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
...@@ -135,7 +153,9 @@ Page({ ...@@ -135,7 +153,9 @@ Page({
} }
if (code == 0) { if (code == 0) {
// 获取会员卡信息 // 获取会员卡信息
wx.p.api.equityApi.checkOpenMember({ isTrialCardFlag: 1 }).then(res => { wx.p.api.equityApi.checkOpenMember({
isTrialCardFlag: 1
}).then(res => {
if (res.code == -1 && res.errId == 2008) { if (res.code == -1 && res.errId == 2008) {
this.showTips(message || '服务不可用') this.showTips(message || '服务不可用')
return return
...@@ -148,14 +168,20 @@ Page({ ...@@ -148,14 +168,20 @@ Page({
}) })
}, },
jumpMine() { jumpMine() {
let { isOpenMember } = this.data let {
isOpenMember
} = this.data
wx.p.router.switchTab('/pages/tab/mine/index', { wx.p.router.switchTab('/pages/tab/mine/index', {
isMemberShow: true, isMemberShow: true,
isOpenMember isOpenMember
}) })
}, },
receiveRed(equityFreeCardId) { receiveRed(equityFreeCardId) {
let { isOpenMember, nickName, bindingSource } = this.data let {
isOpenMember,
nickName,
bindingSource
} = this.data
let params = { let params = {
equityFreeCardId, equityFreeCardId,
nickName: nickName nickName: nickName
...@@ -163,7 +189,11 @@ Page({ ...@@ -163,7 +189,11 @@ Page({
if (bindingSource) params.bindingSource = bindingSource if (bindingSource) params.bindingSource = bindingSource
wx.p.api.equityApi.checkReceiveRed(params).then(res => { wx.p.api.equityApi.checkReceiveRed(params).then(res => {
console.log(res, 'checkReceiveRed---') console.log(res, 'checkReceiveRed---')
let { code, message, data } = res let {
code,
message,
data
} = res
if (code != 0) { if (code != 0) {
this.showTips(message || '服务不可用') this.showTips(message || '服务不可用')
return return
...@@ -172,10 +202,19 @@ Page({ ...@@ -172,10 +202,19 @@ Page({
this.jumpMine() this.jumpMine()
} else { } else {
if (!data.isReceiveFlag) { if (!data.isReceiveFlag) {
wx.p.router.go('/packageEquity/pages/receiveRed/receiveRed', { /**用户是否已添加福利官 true:是;false:否; */
isOpenMember: isOpenMember, if (!data.isAddWelfareOfficerFlag) {
activityRedEnvelopeLink: data.activityRedEnvelopeLink wx.p.router.switchTab('/pages/tab/mine/index', {
}) isMemberShow: true,
isOpenMember: true,
addWelfareOfficer: 'bg-member-welfare'
})
} else {
wx.p.router.go('/packageEquity/pages/receiveRed/receiveRed', {
isOpenMember: isOpenMember,
activityRedEnvelopeLink: data.activityRedEnvelopeLink
})
}
} else { } else {
this.jumpMine() this.jumpMine()
} }
...@@ -187,7 +226,9 @@ Page({ ...@@ -187,7 +226,9 @@ Page({
// 先判断登录 // 先判断登录
const authStatus = await wx.p.router.intercept(false) const authStatus = await wx.p.router.intercept(false)
if (authStatus) return if (authStatus) return
wx.p.api.equityApi.checkOpenMember({ isTrialCardFlag: 1 }).then(res => { wx.p.api.equityApi.checkOpenMember({
isTrialCardFlag: 1
}).then(res => {
if (res.code == -1 && res.errId == 2008) { if (res.code == -1 && res.errId == 2008) {
this.showTips(res.message || '服务不可用') this.showTips(res.message || '服务不可用')
return return
...@@ -211,8 +252,14 @@ Page({ ...@@ -211,8 +252,14 @@ Page({
}, },
sceneGetId(id) { sceneGetId(id) {
wx.p.api.equityApi.sceneGetId({ id }).then(res => { wx.p.api.equityApi.sceneGetId({
let { code, data, message } = res id
}).then(res => {
let {
code,
data,
message
} = res
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
merchantId: data?.scene.split('=')[1] merchantId: data?.scene.split('=')[1]
...@@ -228,7 +275,9 @@ Page({ ...@@ -228,7 +275,9 @@ Page({
let system = wx.getSystemInfoSync(), let system = wx.getSystemInfoSync(),
bindingSource = '' bindingSource = ''
const authStatus = await wx.p.router.intercept(false) const authStatus = await wx.p.router.intercept(false)
const { merchantId } = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
if (options.bindingSource) bindingSource = options.bindingSource if (options.bindingSource) bindingSource = options.bindingSource
this.setData({ this.setData({
merchantId, merchantId,
...@@ -248,6 +297,5 @@ Page({ ...@@ -248,6 +297,5 @@ Page({
authStatus authStatus
}) })
}, },
onUnload: function () { onUnload: function () {}
} })
})
\ No newline at end of file \ No newline at end of file
import { IMG_URL } from '../../../config' import {
import { devMixin } from '~/mixins/index' IMG_URL
} from '../../../config'
import {
devMixin
} from '~/mixins/index'
Page({ Page({
behaviors: [devMixin], behaviors: [devMixin],
data: { data: {
IMGURL: IMG_URL, IMGURL: IMG_URL,
memberUrl: 'bg-member', memberUrl: 'bg-member',
toolList: [{ toolList: [{
text: '购物车', text: '购物车',
icon: 'myShopping', icon: 'myShopping',
url: '/packageMall/pages/shoppingCart/shoppingCart' url: '/packageMall/pages/shoppingCart/shoppingCart'
}, },
{ {
text: '地址管理', text: '地址管理',
icon: 'myAddress', icon: 'myAddress',
url: '/packageMine/pages/address/index/index' url: '/packageMine/pages/address/index/index'
}, },
], ],
vipType: { vipType: {
1: 'gold_vip_bg', 1: 'gold_vip_bg',
...@@ -34,7 +38,10 @@ Page({ ...@@ -34,7 +38,10 @@ Page({
isMemberShow: false isMemberShow: false
}, },
handleChangeVal(e) { handleChangeVal(e) {
const { attr, val } = e.currentTarget.dataset const {
attr,
val
} = e.currentTarget.dataset
this.setData({ this.setData({
[attr]: val [attr]: val
}) })
...@@ -65,9 +72,13 @@ Page({ ...@@ -65,9 +72,13 @@ Page({
}, },
onLoad(options) { onLoad(options) {
if (options?.isMemberShow) { if (options?.isMemberShow) {
const {
addWelfareOfficer,
isOpenMember
} = options
this.setData({ this.setData({
isMemberShow: true, isMemberShow: true,
memberUrl: options.isOpenMember ? 'bg-member' : 'bg-member-first' memberUrl: addWelfareOfficer ? addWelfareOfficer : isOpenMember ? 'bg-member' : 'bg-member-first'
}) })
} }
this.shareTitle = "我的" this.shareTitle = "我的"
...@@ -216,6 +227,6 @@ Page({ ...@@ -216,6 +227,6 @@ Page({
freshMerchant() { freshMerchant() {
this.getMemberCardData() this.getMemberCardData()
}, },
onShareAppMessage() { } onShareAppMessage() {}
}) })
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!