Commit f3660b39 by 李伟康

修改loading

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