Commit 303626e8 by 杨北旺

修复bug

1 parent 0e91027e
...@@ -83,7 +83,10 @@ class UsersApi { ...@@ -83,7 +83,10 @@ class UsersApi {
/**更新客户手机号 */ /**更新客户手机号 */
updataCustomerPhone() { updataCustomerPhone() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id'), 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 api
.post({ .post({
method: 'scrm.api.sso.weapp.mark.phone', method: 'scrm.api.sso.weapp.mark.phone',
......
...@@ -43,7 +43,9 @@ Component({ ...@@ -43,7 +43,9 @@ Component({
*/ */
methods: { methods: {
getCoupon(e) { 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 let { item } = e.currentTarget.dataset
wx.p.wxApi.showLoading('领取中...') wx.p.wxApi.showLoading('领取中...')
wx.p.api.shopmallApi wx.p.api.shopmallApi
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
</block> </block>
<block wx:else> <block wx:else>
<view class="qr-box box" style="padding: 0;"> <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="flex">
<view class="title_text_X qrText">{{couponDetail.couponName}}</view> <view class="title_text_X qrText">{{couponDetail.couponName}}</view>
<image webp class="baseImage" src="{{IMGURL}}mine/coupon/{{couponDetail.discountType}}.png?v={{img_version}}"></image> <image webp class="baseImage" src="{{IMGURL}}mine/coupon/{{couponDetail.discountType}}.png?v={{img_version}}"></image>
......
...@@ -141,6 +141,8 @@ ...@@ -141,6 +141,8 @@
background: #FFF5F3; background: #FFF5F3;
border-radius: 8rpx; border-radius: 8rpx;
padding: 32rpx; padding: 32rpx;
display: flex;
flex-direction: column;
} }
.layout .qr-box .btn-box .text { .layout .qr-box .btn-box .text {
width: 100%; width: 100%;
...@@ -530,4 +532,7 @@ ...@@ -530,4 +532,7 @@
height: 100%; height: 100%;
right: 0; right: 0;
top: 0; top: 0;
}
.btn_box_no_center{
align-items: flex-start;
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ Page({ ...@@ -21,7 +21,7 @@ Page({
/**格式化价格 */ /**格式化价格 */
formatMyPrice(price) { formatMyPrice(price) {
if (price != null) { if (price != null) {
price = wx.p.format.centsToyuan(price) price = wx.p.format.centsToyuan(price)
if (price >= 10000) { if (price >= 10000) {
price = Number(price / 10000).toFixed(2) price = Number(price / 10000).toFixed(2)
} }
...@@ -45,9 +45,9 @@ Page({ ...@@ -45,9 +45,9 @@ Page({
{ {
openId openId
} = await USERAPI.getWXUserInfo() } = await USERAPI.getWXUserInfo()
const { const {
merchantId merchantId
} = wx.p.storage.get('merchant_info') } = wx.p.storage.get('merchant_info')
let data = { let data = {
open_id: openId || null, open_id: openId || null,
create_time: this.firstEnter ? this.data.enter_time : new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间 create_time: this.firstEnter ? this.data.enter_time : new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间
...@@ -61,7 +61,7 @@ Page({ ...@@ -61,7 +61,7 @@ Page({
add_way: 104, add_way: 104,
merchant_id: merchantId, merchant_id: merchantId,
guest_no: wx.p.$Track.getGuestNo(), //游客ID, guest_no: wx.p.$Track.getGuestNo(), //游客ID,
user_open_id:this.shareOpenId || '' user_open_id: this.shareOpenId || ''
} }
this.firstEnter = false this.firstEnter = false
const jsonList = [JSON.stringify(data)] const jsonList = [JSON.stringify(data)]
...@@ -91,8 +91,8 @@ Page({ ...@@ -91,8 +91,8 @@ Page({
posterUrl posterUrl
} = this.data } = this.data
wx.getImageInfo({ wx.getImageInfo({
src: posterUrl src: posterUrl
}) })
.then(res => { .then(res => {
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: res.path, filePath: res.path,
...@@ -235,7 +235,7 @@ Page({ ...@@ -235,7 +235,7 @@ Page({
hasCouponFlag hasCouponFlag
} = this.options } = this.options
if ((upgrade || isCarOwner) && hasCouponFlag) { 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 notIntercept: true
}); });
} else { } else {
...@@ -274,7 +274,7 @@ Page({ ...@@ -274,7 +274,7 @@ Page({
goodsName: goodsInfo.goodsName, goodsName: goodsInfo.goodsName,
retailPrice: goodsInfo.retailPrice, retailPrice: goodsInfo.retailPrice,
unit: goodsInfo.unit, unit: goodsInfo.unit,
retainagePrice: wx.p.format.centsToyuan(goodsInfo.retainagePrice), retainagePrice: wx.p.format.centsToyuan(goodsInfo.retainagePrice),
depositPrice: goodsInfo.depositPrice, depositPrice: goodsInfo.depositPrice,
stock: goodsInfo.goodsStock, stock: goodsInfo.goodsStock,
id: goodsInfo.id, id: goodsInfo.id,
...@@ -286,7 +286,7 @@ Page({ ...@@ -286,7 +286,7 @@ Page({
let list = isActivity ? goodsInfo.specificationExtraList : goodsInfo.specificationDetailList let list = isActivity ? goodsInfo.specificationExtraList : goodsInfo.specificationDetailList
list.map(e => { list.map(e => {
if (e.specificationData == activeSku) { 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) stock ? (goodsList.stock = stock) : (goodsList.stock = e.stock)
} }
}) })
...@@ -297,9 +297,9 @@ Page({ ...@@ -297,9 +297,9 @@ Page({
params.activityId = goodsInfo.id params.activityId = goodsInfo.id
orderGoodsList.goodsId = goodsInfo.goodsId orderGoodsList.goodsId = goodsInfo.goodsId
orderGoodsList.activityPrice = NP.times(goodsInfo.retailPrice, 100) orderGoodsList.activityPrice = NP.times(goodsInfo.retailPrice, 100)
// goodsList.goodsImage = goodsInfo.activityImg // goodsList.goodsImage = goodsInfo.activityImg
// goodsList.goodsName = goodsInfo.activityName // goodsList.goodsName = goodsInfo.activityName
; ;
(goodsList.goodsId = goodsInfo.goodsId), (goodsList.stock = goodsInfo.goodsStock), (goodsList.id = goodsInfo.id) (goodsList.goodsId = goodsInfo.goodsId), (goodsList.stock = goodsInfo.goodsStock), (goodsList.id = goodsInfo.id)
} }
params.orderGoodsList = [orderGoodsList] params.orderGoodsList = [orderGoodsList]
...@@ -314,13 +314,13 @@ Page({ ...@@ -314,13 +314,13 @@ Page({
} }
console.log(this.data.goodsInfo, 'goodsInfo') console.log(this.data.goodsInfo, 'goodsInfo')
wx.p.router.go('/packageDiscovery/pages/pay/index', { wx.p.router.go('/packageDiscovery/pages/pay/index', {
goodsList: upgrade ? goodsList : [goodsList] , goodsList: upgrade ? goodsList : [goodsList],
deliveryType: upgrade ? 1 : 0, deliveryType: upgrade ? 1 : 0,
showAddr: (isCarOwner && this.data.goodsInfo.deliveryType == 1) ? 0 : 1, showAddr: (isCarOwner && this.data.goodsInfo.deliveryType == 1) ? 0 : 1,
// deliveryType: upgrade || (isCarOwner && this.data.goodsInfo.deliveryType == 1) ? 1 : 0, // deliveryType: upgrade || (isCarOwner && this.data.goodsInfo.deliveryType == 1) ? 1 : 0,
buyType: 'pay', buyType: 'pay',
discoverGoodsSource:goodsInfo.discoverGoodsSource, discoverGoodsSource: goodsInfo.discoverGoodsSource,
pageForm:'goodsDetail' pageForm: 'goodsDetail'
}) })
return return
} }
...@@ -355,8 +355,8 @@ Page({ ...@@ -355,8 +355,8 @@ Page({
wx.p.api.shopmallApi.addShoppingcart(params).then(data => { wx.p.api.shopmallApi.addShoppingcart(params).then(data => {
wx.p.wxApi.showToast('添加成功!在购物车等亲~') wx.p.wxApi.showToast('添加成功!在购物车等亲~')
wx.p.$Track.setTrack({ wx.p.$Track.setTrack({
...data ...data
}, },
7 7
) )
}) })
...@@ -402,8 +402,8 @@ Page({ ...@@ -402,8 +402,8 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options,'options'); console.log(options, 'options');
if(options&&options.openId){ if (options && options.openId) {
this.shareOpenId = options.openId this.shareOpenId = options.openId
} }
this.data.enter_time = new Date().format('yyyy-MM-dd hh:mm:ss') this.data.enter_time = new Date().format('yyyy-MM-dd hh:mm:ss')
...@@ -498,7 +498,11 @@ Page({ ...@@ -498,7 +498,11 @@ Page({
const [key, val] = item.split('=') const [key, val] = item.split('=')
op[key] = val 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) { if (op.isActivity) {
this.setData({ this.setData({
isActivity: true isActivity: true
...@@ -561,7 +565,7 @@ Page({ ...@@ -561,7 +565,7 @@ Page({
code, code,
data, data,
message message
}) => {}) }) => { })
} else { } else {
wx.p.api.shopmallApi[target](id).then(({ wx.p.api.shopmallApi[target](id).then(({
code, code,
...@@ -580,14 +584,14 @@ Page({ ...@@ -580,14 +584,14 @@ Page({
} }
// wx.p.$Track.setTrack(trackobj, 6) // wx.p.$Track.setTrack(trackobj, 6)
let activeSku = null 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 (isActivity) {
if (data.specificationExtraList && data.specificationExtraList.length) { if (data.specificationExtraList && data.specificationExtraList.length) {
activeSku = data.specificationExtraList[0].specificationData 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) { 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 ? '-' : '' let minus = data.priceReduce < 0 ? '-' : ''
if (Math.abs(data.priceReduce) >= 10000) { if (Math.abs(data.priceReduce) >= 10000) {
let [one, two] = `${Math.abs(data.priceReduce) / 10000}`.split('.') let [one, two] = `${Math.abs(data.priceReduce) / 10000}`.split('.')
...@@ -610,12 +614,12 @@ Page({ ...@@ -610,12 +614,12 @@ Page({
} else { } else {
if (data.goodsVideo) if (data.goodsVideo)
data.goodsDetailImageList = [{ data.goodsDetailImageList = [{
resType: 3, resType: 3,
content: data.goodsVideo content: data.goodsVideo
}, },
...data.goodsDetailImageList ...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++ ){ // for(let i=0; i<data.specificationList&&data.specificationList.length;i++ ){
// if(data.specificationDetailList[i].stock!=0){ // if(data.specificationDetailList[i].stock!=0){
// activeSku = data.specificationDetailList[i].specificationData // activeSku = data.specificationDetailList[i].specificationData
...@@ -624,11 +628,11 @@ Page({ ...@@ -624,11 +628,11 @@ Page({
// } // }
if (data.specificationList && data.specificationList.length) { if (data.specificationList && data.specificationList.length) {
activeSku = data.specificationDetailList[0].specificationData 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) { if (data.retailPrice != null) {
data.retailPrice = wx.p.format.centsToyuan(data.retailPrice) data.retailPrice = wx.p.format.centsToyuan(data.retailPrice)
if (data.retailPrice >= 10000) { if (data.retailPrice >= 10000) {
data.retailPrice = Number(data.retailPrice / 10000).toFixed(2) data.retailPrice = Number(data.retailPrice / 10000).toFixed(2)
data.unit = '万' data.unit = '万'
...@@ -665,6 +669,8 @@ Page({ ...@@ -665,6 +669,8 @@ Page({
addressFlag: true addressFlag: true
}) })
wx.hideLoading() wx.hideLoading()
// 分享埋点设置
this.handlerShareQuery()
} else { } else {
wx.hideLoading() wx.hideLoading()
this.setData({ this.setData({
...@@ -731,9 +737,9 @@ Page({ ...@@ -731,9 +737,9 @@ Page({
}) })
}) })
}, },
async getUserAddressList() { async getUserAddressList() {
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.mineApi.getUserAddressList().then(data => { wx.p.api.mineApi.getUserAddressList().then(data => {
if (!data.length) { if (!data.length) {
this.setData({ this.setData({
...@@ -748,9 +754,9 @@ Page({ ...@@ -748,9 +754,9 @@ Page({
} }
}) })
}, },
async getUserAddressDefault() { async getUserAddressDefault() {
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.mineApi.getUserAddressDefault().then(({ wx.p.api.mineApi.getUserAddressDefault().then(({
code, code,
data data
...@@ -798,7 +804,7 @@ Page({ ...@@ -798,7 +804,7 @@ Page({
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () {}, onHide: function () { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
...@@ -813,27 +819,30 @@ Page({ ...@@ -813,27 +819,30 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {}, onPullDownRefresh: function () { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {}, onReachBottom: function () { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: 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() const userInfo = wx.p.cache.userInfo.getUserInfo()
let { let {
isActivity, isActivity,
isLive, isLive,
goodsInfo goodsInfo
} = this.data,open_id = '' } = this.data, open_id = ''
this.trackQuery.view = 4 if (userInfo) open_id = userInfo.openId
this.addTrack(this.trackQuery)
if(userInfo)open_id = userInfo.openId
let title = goodsInfo.goodsName let title = goodsInfo.goodsName
let path = `${this.route}?id=${goodsInfo.id}&openId=${open_id}` let path = `${this.route}?id=${goodsInfo.id}&openId=${open_id}`
let imageUrl = '' let imageUrl = ''
...@@ -846,11 +855,18 @@ Page({ ...@@ -846,11 +855,18 @@ Page({
} }
if (isLive) path = `${path}&isLive=true` if (isLive) path = `${path}&isLive=true`
if (merchantId) path = `${path}&merchantId=${merchantId}&isUpgrade=${this.isUpgrade || false}&isCarOwner=${this.isCarOwner || false}` if (merchantId) path = `${path}&merchantId=${merchantId}&isUpgrade=${this.isUpgrade || false}&isCarOwner=${this.isCarOwner || false}`
return { this.shareTitle = title;
imageUrl, this.shareImage = imageUrl
title, this.shareQuery = path
path this.trackQuery.view = 4
this.shareFun = () => {
this.addTrack(this.trackQuery)
} }
// return {
// imageUrl,
// title,
// path
// }
}, },
countDown(params) { countDown(params) {
let { let {
...@@ -888,7 +904,7 @@ Page({ ...@@ -888,7 +904,7 @@ Page({
let type = { let type = {
1: '距开始', 1: '距开始',
2: '距结束' 2: '距结束'
} [activityStatus] }[activityStatus]
if (this.time) clearTimeout(this.time) if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => { this.time = setTimeout(() => {
let dayList = [h, m, s] let dayList = [h, m, s]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// 获取应用实例 // 获取应用实例
Page({ Page({
data: { data: {
tabs: ['店铺优惠券', '权益优惠券'], tabs: ['甄选优惠券', '权益优惠券'],
curTabIndex: 0, curTabIndex: 0,
couponsList: [], couponsList: [],
imgBaseURL: 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/', 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!