Commit 303626e8 by 杨北旺

修复bug

1 parent 0e91027e
......@@ -83,7 +83,10 @@ class UsersApi {
/**更新客户手机号 */
updataCustomerPhone() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id'),
merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
// merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
{
merchantId
} = wx.p.storage.get('merchant_info')
api
.post({
method: 'scrm.api.sso.weapp.mark.phone',
......
......@@ -43,7 +43,9 @@ Component({
*/
methods: {
getCoupon(e) {
let merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
const {
merchantId
} = wx.p.storage.get('merchant_info')
let { item } = e.currentTarget.dataset
wx.p.wxApi.showLoading('领取中...')
wx.p.api.shopmallApi
......
......@@ -127,7 +127,7 @@
</block>
<block wx:else>
<view class="qr-box box" style="padding: 0;">
<view class="btn-box">
<view class="btn-box btn_box_no_center">
<view class="flex">
<view class="title_text_X qrText">{{couponDetail.couponName}}</view>
<image webp class="baseImage" src="{{IMGURL}}mine/coupon/{{couponDetail.discountType}}.png?v={{img_version}}"></image>
......
......@@ -141,6 +141,8 @@
background: #FFF5F3;
border-radius: 8rpx;
padding: 32rpx;
display: flex;
flex-direction: column;
}
.layout .qr-box .btn-box .text {
width: 100%;
......@@ -531,3 +533,6 @@
right: 0;
top: 0;
}
.btn_box_no_center{
align-items: flex-start;
}
\ No newline at end of file
......@@ -61,7 +61,7 @@ Page({
add_way: 104,
merchant_id: merchantId,
guest_no: wx.p.$Track.getGuestNo(), //游客ID,
user_open_id:this.shareOpenId || ''
user_open_id: this.shareOpenId || ''
}
this.firstEnter = false
const jsonList = [JSON.stringify(data)]
......@@ -235,7 +235,7 @@ Page({
hasCouponFlag
} = this.options
if ((upgrade || isCarOwner) && hasCouponFlag) {
wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=${upgrade? 1: 2}&from=${upgrade? 1: 2}`, {
wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=${upgrade ? 1 : 2}&from=${upgrade ? 1 : 2}`, {
notIntercept: true
});
} else {
......@@ -314,13 +314,13 @@ Page({
}
console.log(this.data.goodsInfo, 'goodsInfo')
wx.p.router.go('/packageDiscovery/pages/pay/index', {
goodsList: upgrade ? goodsList : [goodsList] ,
goodsList: upgrade ? goodsList : [goodsList],
deliveryType: upgrade ? 1 : 0,
showAddr: (isCarOwner && this.data.goodsInfo.deliveryType == 1) ? 0 : 1,
// deliveryType: upgrade || (isCarOwner && this.data.goodsInfo.deliveryType == 1) ? 1 : 0,
buyType: 'pay',
discoverGoodsSource:goodsInfo.discoverGoodsSource,
pageForm:'goodsDetail'
discoverGoodsSource: goodsInfo.discoverGoodsSource,
pageForm: 'goodsDetail'
})
return
}
......@@ -402,8 +402,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options,'options');
if(options&&options.openId){
console.log(options, 'options');
if (options && options.openId) {
this.shareOpenId = options.openId
}
this.data.enter_time = new Date().format('yyyy-MM-dd hh:mm:ss')
......@@ -498,7 +498,11 @@ Page({
const [key, val] = item.split('=')
op[key] = val
})
if (op.merchantId) wx.p.storage.set('srcm_shopmall_merchant_id', op.merchantId)
if (op.merchantId) {
wx.p.storage.set('merchant_info', {
merchantId: op.merchantId,
})
}
if (op.isActivity) {
this.setData({
isActivity: true
......@@ -561,7 +565,7 @@ Page({
code,
data,
message
}) => {})
}) => { })
} else {
wx.p.api.shopmallApi[target](id).then(({
code,
......@@ -665,6 +669,8 @@ Page({
addressFlag: true
})
wx.hideLoading()
// 分享埋点设置
this.handlerShareQuery()
} else {
wx.hideLoading()
this.setData({
......@@ -798,7 +804,7 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
onHide: function () { },
/**
* 生命周期函数--监听页面卸载
......@@ -813,27 +819,30 @@ Page({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
onPullDownRefresh: function () { },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
onReachBottom: function () { },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
},
handlerShareQuery() {
const {
merchantId
} = wx.p.storage.get('merchant_info')
const userInfo = wx.p.cache.userInfo.getUserInfo()
let {
isActivity,
isLive,
goodsInfo
} = this.data,open_id = ''
this.trackQuery.view = 4
this.addTrack(this.trackQuery)
if(userInfo)open_id = userInfo.openId
} = this.data, open_id = ''
if (userInfo) open_id = userInfo.openId
let title = goodsInfo.goodsName
let path = `${this.route}?id=${goodsInfo.id}&openId=${open_id}`
let imageUrl = ''
......@@ -846,11 +855,18 @@ Page({
}
if (isLive) path = `${path}&isLive=true`
if (merchantId) path = `${path}&merchantId=${merchantId}&isUpgrade=${this.isUpgrade || false}&isCarOwner=${this.isCarOwner || false}`
return {
imageUrl,
title,
path
this.shareTitle = title;
this.shareImage = imageUrl
this.shareQuery = path
this.trackQuery.view = 4
this.shareFun = () => {
this.addTrack(this.trackQuery)
}
// return {
// imageUrl,
// title,
// path
// }
},
countDown(params) {
let {
......@@ -888,7 +904,7 @@ Page({
let type = {
1: '距开始',
2: '距结束'
} [activityStatus]
}[activityStatus]
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
let dayList = [h, m, s]
......
......@@ -2,7 +2,7 @@
// 获取应用实例
Page({
data: {
tabs: ['店铺优惠券', '权益优惠券'],
tabs: ['甄选优惠券', '权益优惠券'],
curTabIndex: 0,
couponsList: [],
imgBaseURL: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!