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%;
......@@ -530,4 +532,7 @@
height: 100%;
right: 0;
top: 0;
}
.btn_box_no_center{
align-items: flex-start;
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ Page({
/**格式化价格 */
formatMyPrice(price) {
if (price != null) {
price = wx.p.format.centsToyuan(price)
price = wx.p.format.centsToyuan(price)
if (price >= 10000) {
price = Number(price / 10000).toFixed(2)
}
......@@ -45,9 +45,9 @@ Page({
{
openId
} = await USERAPI.getWXUserInfo()
const {
merchantId
} = wx.p.storage.get('merchant_info')
const {
merchantId
} = wx.p.storage.get('merchant_info')
let data = {
open_id: openId || null,
create_time: this.firstEnter ? this.data.enter_time : new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间
......@@ -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)]
......@@ -91,8 +91,8 @@ Page({
posterUrl
} = this.data
wx.getImageInfo({
src: posterUrl
})
src: posterUrl
})
.then(res => {
wx.saveImageToPhotosAlbum({
filePath: res.path,
......@@ -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 {
......@@ -274,7 +274,7 @@ Page({
goodsName: goodsInfo.goodsName,
retailPrice: goodsInfo.retailPrice,
unit: goodsInfo.unit,
retainagePrice: wx.p.format.centsToyuan(goodsInfo.retainagePrice),
retainagePrice: wx.p.format.centsToyuan(goodsInfo.retainagePrice),
depositPrice: goodsInfo.depositPrice,
stock: goodsInfo.goodsStock,
id: goodsInfo.id,
......@@ -286,7 +286,7 @@ Page({
let list = isActivity ? goodsInfo.specificationExtraList : goodsInfo.specificationDetailList
list.map(e => {
if (e.specificationData == activeSku) {
goodsList.retailPrice = wx.p.format.centsToyuan(e.retailPrice)
goodsList.retailPrice = wx.p.format.centsToyuan(e.retailPrice)
stock ? (goodsList.stock = stock) : (goodsList.stock = e.stock)
}
})
......@@ -297,9 +297,9 @@ Page({
params.activityId = goodsInfo.id
orderGoodsList.goodsId = goodsInfo.goodsId
orderGoodsList.activityPrice = NP.times(goodsInfo.retailPrice, 100)
// goodsList.goodsImage = goodsInfo.activityImg
// goodsList.goodsName = goodsInfo.activityName
;
// goodsList.goodsImage = goodsInfo.activityImg
// goodsList.goodsName = goodsInfo.activityName
;
(goodsList.goodsId = goodsInfo.goodsId), (goodsList.stock = goodsInfo.goodsStock), (goodsList.id = goodsInfo.id)
}
params.orderGoodsList = [orderGoodsList]
......@@ -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
}
......@@ -355,8 +355,8 @@ Page({
wx.p.api.shopmallApi.addShoppingcart(params).then(data => {
wx.p.wxApi.showToast('添加成功!在购物车等亲~')
wx.p.$Track.setTrack({
...data
},
...data
},
7
)
})
......@@ -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,
......@@ -580,14 +584,14 @@ Page({
}
// wx.p.$Track.setTrack(trackobj, 6)
let activeSku = null
if (data.expressFee != null) data.expressFee = wx.p.format.centsToyuan(data.expressFee)
if (data.expressFee != null) data.expressFee = wx.p.format.centsToyuan(data.expressFee)
if (isActivity) {
if (data.specificationExtraList && data.specificationExtraList.length) {
activeSku = data.specificationExtraList[0].specificationData
data.skuPrice = wx.p.format.centsToyuan(data.specificationExtraList[0].retailPrice)
data.skuPrice = wx.p.format.centsToyuan(data.specificationExtraList[0].retailPrice)
}
if (data.priceReduce != null) {
data.priceReduce = wx.p.format.centsToyuan(data.priceReduce)
data.priceReduce = wx.p.format.centsToyuan(data.priceReduce)
let minus = data.priceReduce < 0 ? '-' : ''
if (Math.abs(data.priceReduce) >= 10000) {
let [one, two] = `${Math.abs(data.priceReduce) / 10000}`.split('.')
......@@ -610,12 +614,12 @@ Page({
} else {
if (data.goodsVideo)
data.goodsDetailImageList = [{
resType: 3,
content: data.goodsVideo
},
...data.goodsDetailImageList
resType: 3,
content: data.goodsVideo
},
...data.goodsDetailImageList
]
if (data.originalPrice != null) data.originalPrice = wx.p.format.centsToyuan(data.originalPrice)
if (data.originalPrice != null) data.originalPrice = wx.p.format.centsToyuan(data.originalPrice)
// for(let i=0; i<data.specificationList&&data.specificationList.length;i++ ){
// if(data.specificationDetailList[i].stock!=0){
// activeSku = data.specificationDetailList[i].specificationData
......@@ -624,11 +628,11 @@ Page({
// }
if (data.specificationList && data.specificationList.length) {
activeSku = data.specificationDetailList[0].specificationData
data.skuPrice = wx.p.format.centsToyuan(data.specificationDetailList[0].retailPrice)
data.skuPrice = wx.p.format.centsToyuan(data.specificationDetailList[0].retailPrice)
}
}
if (data.retailPrice != null) {
data.retailPrice = wx.p.format.centsToyuan(data.retailPrice)
data.retailPrice = wx.p.format.centsToyuan(data.retailPrice)
if (data.retailPrice >= 10000) {
data.retailPrice = Number(data.retailPrice / 10000).toFixed(2)
data.unit = '万'
......@@ -665,6 +669,8 @@ Page({
addressFlag: true
})
wx.hideLoading()
// 分享埋点设置
this.handlerShareQuery()
} else {
wx.hideLoading()
this.setData({
......@@ -731,9 +737,9 @@ Page({
})
})
},
async getUserAddressList() {
const authStatus = await wx.p.router.intercept(false)
if (authStatus) return
async getUserAddressList() {
const authStatus = await wx.p.router.intercept(false)
if (authStatus) return
wx.p.api.mineApi.getUserAddressList().then(data => {
if (!data.length) {
this.setData({
......@@ -748,9 +754,9 @@ Page({
}
})
},
async getUserAddressDefault() {
const authStatus = await wx.p.router.intercept(false)
if (authStatus) return
async getUserAddressDefault() {
const authStatus = await wx.p.router.intercept(false)
if (authStatus) return
wx.p.api.mineApi.getUserAddressDefault().then(({
code,
data
......@@ -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!