Commit f3660b39 by 李伟康

修改loading

1 parent 35a65de2
...@@ -107,8 +107,8 @@ const pathEnum = { ...@@ -107,8 +107,8 @@ const pathEnum = {
} }
const defaultMerchantId = { const defaultMerchantId = {
ip: '44210895', ip: '44210895',
dev: '44210895', dev: '44211227',
uat: '44210895', uat: '44209846',
prod: '44189923' prod: '44189923'
}[target[index]] }[target[index]]
......
...@@ -19,10 +19,6 @@ module.exports = { ...@@ -19,10 +19,6 @@ module.exports = {
noSignAttr: ["file"], noSignAttr: ["file"],
}); });
}, },
// /**根据sceneId 查参数 */
// getSceneById(data) {
// return http.post('dj.api.smartcarlife.common.getSceneById', data)
// },
/** 首页、发现列表 搜索接口 */ /** 首页、发现列表 搜索接口 */
search(data) { search(data) {
return http.post({ return http.post({
......
...@@ -54,7 +54,7 @@ class Request { ...@@ -54,7 +54,7 @@ class Request {
} : { } : {
'Cache-Control': 'no-cache' 'Cache-Control': 'no-cache'
} }
header.merchantId = defaultMerchantId header.merchantId = wx.$merchant_id || defaultMerchantId
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)
const path = pathEnum[projectName] const path = pathEnum[projectName]
......
...@@ -6,12 +6,14 @@ Page({ ...@@ -6,12 +6,14 @@ Page({
data: { data: {
isOpen: false, isOpen: false,
openingStatus: false, openingStatus: false,
IMGURKBASE:'equity/version/1_0_0/', IMGURKBASE: 'equity/version/1_0_0/',
}, },
// 获取门店会员卡信息 // 获取门店会员卡信息
getMemberCardData() { getMemberCardData() {
const {merchantId} = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
let newMerchantId = merchantId || defaultMerchantId let newMerchantId = merchantId || defaultMerchantId
let para = { let para = {
merchantId: newMerchantId merchantId: newMerchantId
...@@ -56,15 +58,12 @@ Page({ ...@@ -56,15 +58,12 @@ Page({
}, },
// 去购买会员 // 去购买会员
async openMemberFn() { async openMemberFn() {
let sid = wx.$util.getSessionId() const loginStatu = await wx.p.router.intercept()
if (!sid) { if (loginStatu) return
this.setData({ const {
showLogin: true memberInfo
}) } = this.data
return wx.p.wxApi.showLoading()
}
const { memberInfo } = this.data
wx.$api.showLoading()
let para = { let para = {
equityClassId: memberInfo.equityClassId, equityClassId: memberInfo.equityClassId,
orderCode: memberInfo.orderCode, orderCode: memberInfo.orderCode,
...@@ -84,7 +83,13 @@ Page({ ...@@ -84,7 +83,13 @@ Page({
}, },
// 处理购买参数拉起支付 // 处理购买参数拉起支付
handlePay(payData) { handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = payData
let self = this let self = this
wx.requestPayment({ wx.requestPayment({
timeStamp: timeStamp, timeStamp: timeStamp,
......
...@@ -35,4 +35,3 @@ ...@@ -35,4 +35,3 @@
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<login show="{{showLogin}}"></login>
\ No newline at end of file \ No newline at end of file
...@@ -12,8 +12,19 @@ Page({ ...@@ -12,8 +12,19 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
console.log(options, '===')
this.tabList = __wxConfig.tabBar.list this.tabList = __wxConfig.tabBar.list
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
//scenc获取页面参数并跳转
if (options.scene) {
return this.getSceneById(options.scene)
}
if (options.url) {
return this.login(options)
}
},
async login(options) {
if (options.merchantId) wx.$merchant_id = options.merchantId
try { try {
const { const {
code, code,
...@@ -34,10 +45,6 @@ Page({ ...@@ -34,10 +45,6 @@ Page({
wx.p.storage.rm('sessionId') wx.p.storage.rm('sessionId')
} }
console.log(data, '=============') console.log(data, '=============')
//scenc获取页面参数并跳转
if (options.scene) {
return this.getSceneById(options.scene)
}
if (options.url) { if (options.url) {
return this.jumpPage(options.url) return this.jumpPage(options.url)
} }
...@@ -46,8 +53,8 @@ Page({ ...@@ -46,8 +53,8 @@ Page({
} catch (error) { } catch (error) {
console.log(error) console.log(error)
wx.p.wxApi.showToast(String(error)) wx.p.wxApi.showToast(String(error))
wx.p.router.goHome()
} }
}, },
async getSceneById(scene) { async getSceneById(scene) {
const id = decodeURIComponent(scene).split('=').at(-1) const id = decodeURIComponent(scene).split('=').at(-1)
...@@ -58,7 +65,7 @@ Page({ ...@@ -58,7 +65,7 @@ Page({
} = await wx.p.api.wechatApi.getSceneById({ } = await wx.p.api.wechatApi.getSceneById({
id id
}) })
if (code == 0) this.jumpPage(data.scene) if (code == 0) this.login(data.scene)
else throw {} else throw {}
} catch (error) { } catch (error) {
wx.p.wxApi.showToast(error || '获取scene失败') wx.p.wxApi.showToast(error || '获取scene失败')
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<view class="btn text-center" bindtap="jump" data-url="activity.index"> <view class="btn text-center" bindtap="jump" data-url="activity.index">
查看更多 查看更多
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}index/more.png"></image> <glsx-image webp src="home/more.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<block wx:else> <block wx:else>
<view class="nothing flex"> <view class="nothing flex">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}index/index-activity-nothing.png"></image> <glsx-image webp src="home/index-activity-nothing.png"></glsx-image>
</view> </view>
暂无优惠活动,敬请期待 暂无优惠活动,敬请期待
</view> </view>
......
...@@ -60,17 +60,25 @@ Page({ ...@@ -60,17 +60,25 @@ Page({
}) })
} else { } else {
wx.p.api.equityApi.checkOpenMember().then(res => { wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false console.log(res,'----------')
res.data = {
}
let flag = false,
identity = 0 // 普通会员3 银卡2 金卡1 非会员 0
if (res.data && res.data.validitDate) { if (res.data && res.data.validitDate) {
res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd') res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd')
} }
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
flag = true flag = true
identity = 3
if (res.data && res.data.cardTypeSpecial) identity = res.data.cardTypeSpecial
} }
wx.p.storage.set('isVIP', flag) wx.p.storage.set('isVIP', flag)
this.setData({ this.setData({
isMember: flag, isMember: flag,
vipInfo: res.data vipInfo: res.data,
identity
}) })
}) })
} }
......
...@@ -57,6 +57,6 @@ ...@@ -57,6 +57,6 @@
], ],
"include": [] "include": []
}, },
"appid": "wx6e40cfb83ce4ffb1", "appid": "wxe10067a63c1856ac",
"projectname": "hmd" "projectname": "hmd"
} }
\ 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!