Commit 44baa854 by 张立顺

方法修改

1 parent 00f48990
...@@ -60,7 +60,7 @@ class UsersApi { ...@@ -60,7 +60,7 @@ class UsersApi {
/**授权手机号 */ /**授权手机号 */
async authUserPhone(detail, sessionId) { async authUserPhone(detail, sessionId) {
if (!sessionId) { if (!sessionId) {
wx.$api.showToast('缺少sessionId') wx.p.wxApi.showToast('缺少sessionId')
Promise.reject({ Promise.reject({
errMsg: '缺少sessionId' errMsg: '缺少sessionId'
}) })
...@@ -134,7 +134,7 @@ class UsersApi { ...@@ -134,7 +134,7 @@ class UsersApi {
/**授权手机号登录 */ /**授权手机号登录 */
async authStorePhone(detail, loginToken) { async authStorePhone(detail, loginToken) {
if (!loginToken) { if (!loginToken) {
wx.$api.showToast('缺少loginToken') wx.p.wxApi.showToast('缺少loginToken')
Promise.reject({ Promise.reject({
errMsg: '缺少loginToken' errMsg: '缺少loginToken'
}) })
......
...@@ -106,7 +106,7 @@ Page({ ...@@ -106,7 +106,7 @@ Page({
let { merchantId, phone } = data let { merchantId, phone } = data
this.toPostFreeCard(merchantId, phone, data) this.toPostFreeCard(merchantId, phone, data)
this.handlerCustomerId() this.handlerCustomerId()
} else wx.$api.showToast(message) } else wx.p.wxApi.showToast(message)
}) })
}, },
onLoad(options) { onLoad(options) {
...@@ -189,7 +189,7 @@ Page({ ...@@ -189,7 +189,7 @@ Page({
// wx.$storage.set('bindInfo', temp) // wx.$storage.set('bindInfo', temp)
// wx.$router.reLaunch('/pages/tab/shopMall/index?tabIndex=1', { notIntercept: true }) // wx.$router.reLaunch('/pages/tab/shopMall/index?tabIndex=1', { notIntercept: true })
} else { } else {
wx.$api.showToast(message || '系统异常') wx.p.wxApi.showToast(message || '系统异常')
} }
}) })
}, },
......
...@@ -56,7 +56,7 @@ Page({ ...@@ -56,7 +56,7 @@ Page({
business_type: 1, business_type: 1,
add_way: 104, add_way: 104,
merchant_id: wx.p.storage.get('srcm_shopmall_merchant_id'), merchant_id: wx.p.storage.get('srcm_shopmall_merchant_id'),
guest_no: wx.$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
...@@ -93,7 +93,7 @@ Page({ ...@@ -93,7 +93,7 @@ Page({
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: res.path, filePath: res.path,
success() { success() {
wx.$api.showToast('保存成功') wx.p.wxApi.showToast('保存成功')
}, },
fail(err) { fail(err) {
if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') { if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
...@@ -127,7 +127,7 @@ Page({ ...@@ -127,7 +127,7 @@ Page({
}) })
.catch(() => { .catch(() => {
wx.hideLoading() wx.hideLoading()
wx.$api.showToast('图片保存失败,请重试') wx.p.wxApi.showToast('图片保存失败,请重试')
}) })
}, },
previewImage(e) { previewImage(e) {
...@@ -301,7 +301,7 @@ Page({ ...@@ -301,7 +301,7 @@ Page({
params.orderGoodsList = [orderGoodsList] params.orderGoodsList = [orderGoodsList]
goodsList.expressFee = goodsInfo.expressFee goodsList.expressFee = goodsInfo.expressFee
if (!contactInfo.contactAddress && goodsInfo.deliveryType != 1) { if (!contactInfo.contactAddress && goodsInfo.deliveryType != 1) {
wx.$api.showToast('请填写收货地址') wx.p.wxApi.showToast('请填写收货地址')
return return
} }
if (upgrade || isCarOwner) { if (upgrade || isCarOwner) {
...@@ -348,8 +348,8 @@ Page({ ...@@ -348,8 +348,8 @@ Page({
params.cartType = 4 params.cartType = 4
} }
wx.p.api.shopmallApi.addShoppingcart(params).then(data => { wx.p.api.shopmallApi.addShoppingcart(params).then(data => {
wx.$api.showToast('添加成功!在购物车等亲~') wx.p.wxApi.showToast('添加成功!在购物车等亲~')
wx.$Track.setTrack({ wx.p.$Track.setTrack({
...data ...data
}, },
7 7
...@@ -574,7 +574,7 @@ Page({ ...@@ -574,7 +574,7 @@ Page({
...data, ...data,
goodsId: data.id goodsId: data.id
} }
// wx.$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) {
......
...@@ -343,7 +343,7 @@ Page({ ...@@ -343,7 +343,7 @@ Page({
}) })
.then(({ needPay, payParams }) => { .then(({ needPay, payParams }) => {
wx.hideLoading() wx.hideLoading()
// wx.$Track.setTrack( // wx.p.$Track.setTrack(
// { // {
// goodsList // goodsList
// }, // },
......
...@@ -257,7 +257,7 @@ Page({ ...@@ -257,7 +257,7 @@ Page({
} }
wx.p.api.shopmallApi.delShoppingcart(para).then(res => { wx.p.api.shopmallApi.delShoppingcart(para).then(res => {
wx.p.wxApi.showToast('删除成功') wx.p.wxApi.showToast('删除成功')
wx.$Track.setTrack({ wx.p.$Track.setTrack({
id, id,
type: '购物车移除商品' type: '购物车移除商品'
}, },
......
...@@ -78,7 +78,7 @@ Page({ ...@@ -78,7 +78,7 @@ Page({
this.setData({ this.setData({
couponInfo couponInfo
}) })
// wx.$Track.setTrack( // wx.p.$Track.setTrack(
// { // {
// couponInfo // couponInfo
// }, // },
......
...@@ -40,12 +40,12 @@ Page({ ...@@ -40,12 +40,12 @@ Page({
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: res.path filePath: res.path
}).then(() => { }).then(() => {
wx.$api.showToast('保存成功') wx.p.wxApi.showToast('保存成功')
}) })
}) })
.catch(() => { .catch(() => {
wx.hideLoading() wx.hideLoading()
wx.$api.showToast('图片保存失败,请重试') wx.p.wxApi.showToast('图片保存失败,请重试')
}) })
}, },
authSuccess() { authSuccess() {
......
...@@ -10,7 +10,7 @@ Page({ ...@@ -10,7 +10,7 @@ Page({
setCopyData(e) { setCopyData(e) {
const text = e.currentTarget.dataset.title; const text = e.currentTarget.dataset.title;
wx.$api.setCopyData(text, () => { wx.$api.setCopyData(text, () => {
wx.$api.showToast('复制成功') wx.p.wxApi.showToast('复制成功')
}) })
}, },
/** /**
......
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
}) => { }) => {
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
if (code == '0') { if (code == '0') {
// wx.$Track.setTrack({}, 4) // wx.p.$Track.setTrack({}, 4)
wx.$LoginStatus = true wx.$LoginStatus = true
// wx.$util.removeSystemStorage() // wx.$util.removeSystemStorage()
wx.p.storage.rm('userInfo') wx.p.storage.rm('userInfo')
......
...@@ -27,7 +27,7 @@ Page({ ...@@ -27,7 +27,7 @@ Page({
) )
if (options.showToast) { if (options.showToast) {
setTimeout(()=>{ setTimeout(()=>{
wx.$api.showToast('原商品及品牌均已下架,您可查看其他权益商品') wx.p.wxApi.showToast('原商品及品牌均已下架,您可查看其他权益商品')
},500) },500)
} }
}, },
......
...@@ -160,7 +160,7 @@ Page({ ...@@ -160,7 +160,7 @@ Page({
return return
} }
if (!this.data.rechageNum) { if (!this.data.rechageNum) {
wx.$api.showToast('请输入充值账号') wx.p.wxApi.showToast('请输入充值账号')
return return
} }
if(this.data.isGameUse)return this.comfirmBuyItem() if(this.data.isGameUse)return this.comfirmBuyItem()
...@@ -224,7 +224,7 @@ Page({ ...@@ -224,7 +224,7 @@ Page({
paySign: paySign, paySign: paySign,
success() { success() {
//跳转商品详情 //跳转商品详情
// wx.$api.showToast('支付成功') // wx.p.wxApi.showToast('支付成功')
let { query, selectedItem, rechageNum } = self.data let { query, selectedItem, rechageNum } = self.data
let obj = { let obj = {
...query, ...query,
......
...@@ -316,7 +316,7 @@ Page({ ...@@ -316,7 +316,7 @@ Page({
}, },
// /**获取当前位置 */ // /**获取当前位置 */
getLocation(query) { getLocation(query) {
wx.$Track.getAddressInfo().then(({ location }) => { wx.p.$Track.getAddressInfo().then(({ location }) => {
query.lat = location.lat query.lat = location.lat
query.lng = location.lng query.lng = location.lng
this.toGetCommodity(query) this.toGetCommodity(query)
......
...@@ -25,7 +25,7 @@ Page({ ...@@ -25,7 +25,7 @@ Page({
}, },
setCopyData(e) { setCopyData(e) {
wx.$api.setCopyData(e.currentTarget.dataset.item, () => { wx.$api.setCopyData(e.currentTarget.dataset.item, () => {
wx.$api.showToast('复制成功') wx.p.wxApi.showToast('复制成功')
}) })
} }
}) })
...@@ -79,7 +79,7 @@ Page({ ...@@ -79,7 +79,7 @@ Page({
}, },
setCopyData(e) { setCopyData(e) {
wx.$api.setCopyData(e.currentTarget.dataset.item, () => { wx.$api.setCopyData(e.currentTarget.dataset.item, () => {
wx.$api.showToast("复制成功"); wx.p.wxApi.showToast("复制成功");
}); });
}, },
}); });
...@@ -21,7 +21,7 @@ Page({ ...@@ -21,7 +21,7 @@ Page({
this.setData({ this.setData({
memberInfo: res memberInfo: res
}) })
wx.$Track.setTrack( wx.p.$Track.setTrack(
{ {
memberInfo: res memberInfo: res
}, },
...@@ -67,7 +67,7 @@ Page({ ...@@ -67,7 +67,7 @@ Page({
orderCode: memberInfo.orderCode, orderCode: memberInfo.orderCode,
orderSource: 3 orderSource: 3
} }
wx.$Track.setTrack( wx.p.$Track.setTrack(
{ {
...para, ...para,
type: '购买权益卡' type: '购买权益卡'
......
...@@ -49,7 +49,7 @@ Page({ ...@@ -49,7 +49,7 @@ Page({
// 定位 // 定位
async getLocation() { async getLocation() {
try { try {
const res = await wx.$Track.getAddressInfo() const res = await wx.p.$Track.getAddressInfo()
this.toGetCommodity(res.location.lat, res.location.lng, 1) this.toGetCommodity(res.location.lat, res.location.lng, 1)
this.setData({ this.setData({
currentAddress: res, currentAddress: res,
......
...@@ -83,7 +83,7 @@ Component({ ...@@ -83,7 +83,7 @@ Component({
categoryStyle: res[0].categoryStyle || 0 categoryStyle: res[0].categoryStyle || 0
}) })
this.triggerEvent('showShoppingCar', res[0].categoryStyle) this.triggerEvent('showShoppingCar', res[0].categoryStyle)
console.log(res[0].id,'res[0].id'); // console.log(res[0].id,'res[0].id');
this.getCategoryGoodsList(res[0].id) this.getCategoryGoodsList(res[0].id)
} }
}) })
...@@ -97,7 +97,7 @@ Component({ ...@@ -97,7 +97,7 @@ Component({
categoryType: '2' categoryType: '2'
} }
const res = await discoveryApi.getDiscoverChannelCategoryGoods(_para) const res = await discoveryApi.getDiscoverChannelCategoryGoods(_para)
console.log(res) // console.log(res)
if (res && res.length) { if (res && res.length) {
res.forEach(el => { res.forEach(el => {
el.activityPrice = centsToyuan(el.activityPrice) el.activityPrice = centsToyuan(el.activityPrice)
...@@ -241,7 +241,7 @@ Component({ ...@@ -241,7 +241,7 @@ Component({
} }
const res = await shopmallApi.addShoppingcart(_para) const res = await shopmallApi.addShoppingcart(_para)
if (res) { if (res) {
wx.$api.showToast('添加成功') wx.p.wxApi.showToast('添加成功')
this.getBuyCarList() this.getBuyCarList()
} }
}, },
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
<view wx:if="{{categoryStyle>-1}}" class="{{ categoryStyle=='2' ? 'goods_ctnr_waterfall': categoryStyle=='3' ? 'goods_ctnr_grass_B' : categoryStyle=='1' ? 'goods_ctnr_row' : 'goods_ctnr_col' }}"> <view wx:if="{{categoryStyle>-1}}" class="{{ categoryStyle=='2' ? 'goods_ctnr_waterfall': categoryStyle=='3' ? 'goods_ctnr_grass_B' : categoryStyle=='1' ? 'goods_ctnr_row' : 'goods_ctnr_col' }}">
<view wx:if="{{categoryStyle==0 || categoryStyle==1}}" class="goods_wrap"> <view wx:if="{{categoryStyle==0 || categoryStyle==1}}" class="goods_wrap">
<view catch:tap="toGoodsDetail" data-item="{{item}}" class="goods_box" wx:for="{{goodsList}}" wx:key="{{index}}"> <view catch:tap="toGoodsDetail" data-item="{{item}}" class="goods_box" wx:for="{{goodsList}}" wx:key="index">
<image mode="aspectFill" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/> <image mode="aspectFill" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/>
<view class="info {{categoryStyle?'flex_cccb':''}}"> <view class="info {{categoryStyle?'flex_cccb':''}}">
<text class="name">{{item.goodsName}}</text> <text class="name">{{item.goodsName}}</text>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<view wx:elif="{{categoryStyle==3}}" class="goods_wrap"> <view wx:elif="{{categoryStyle==3}}" class="goods_wrap">
<view catch:tap="toGoodsDetail" data-item="{{item}}" wx:for="{{goodsList}}" wx:key="{{index}}"> <view catch:tap="toGoodsDetail" data-item="{{item}}" wx:for="{{goodsList}}" wx:key="index">
<image wx:if="{{item.styleBImg}}" mode="aspectFill" class="publicity-img" src="{{item.styleBImg}}"/> <image wx:if="{{item.styleBImg}}" mode="aspectFill" class="publicity-img" src="{{item.styleBImg}}"/>
<view class="goods_box"> <view class="goods_box">
<video show-fullscreen-btn="{{false}}" show-play-btn="{{false}}" wx:if="{{curPlayIdx==index && (item.commerceVideo || item.goodsVideo)}}" loop id="video{{index}}" muted="{{false}}" autoplay class="cover" src="{{item.commerceVideo || item.goodsVideo}}"></video> <video show-fullscreen-btn="{{false}}" show-play-btn="{{false}}" wx:if="{{curPlayIdx==index && (item.commerceVideo || item.goodsVideo)}}" loop id="video{{index}}" muted="{{false}}" autoplay class="cover" src="{{item.commerceVideo || item.goodsVideo}}"></video>
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
</view> </view>
</view> </view>
<block wx:else> <block wx:else>
<view class="{{parentIndex==0 ? 'left-box' : 'right-box'}}" wx:for-item="parentItem" wx:for-index="parentIndex" wx:for="{{['leftList','rightList']}}" wx:key="{{index}}"> <view class="{{parentIndex==0 ? 'left-box' : 'right-box'}}" wx:for-item="parentItem" wx:for-index="parentIndex" wx:for="{{['leftList','rightList']}}" wx:key="index">
<block wx:for="{{goodsList}}" wx:key="{{index}}"> <block wx:for="{{goodsList}}" wx:key="index">
<view catch:tap="toGoodsDetail" data-item="{{item}}" wx:if="{{index%2 == parentIndex}}" class="goods_box"> <view catch:tap="toGoodsDetail" data-item="{{item}}" wx:if="{{index%2 == parentIndex}}" class="goods_box">
<image mode="widthFix" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/> <image mode="widthFix" class="cover" src="{{item.commerceVideo ? item.coverUrl : item.goodsImage}}"/>
<view class="info"> <view class="info">
......
...@@ -12,7 +12,7 @@ Page({ ...@@ -12,7 +12,7 @@ Page({
} = this.data } = this.data
let newMerchantId = wx.$merchant_id let newMerchantId = wx.$merchant_id
// debugger // debugger
console.log(newMerchantId, 'wx.$merchant_id'); // console.log(newMerchantId, 'wx.$merchant_id');
if (newMerchantId != merchantId && newMerchantId ) { if (newMerchantId != merchantId && newMerchantId ) {
this.setData({ this.setData({
merchantId: newMerchantId merchantId: newMerchantId
......
...@@ -8,11 +8,19 @@ page{ ...@@ -8,11 +8,19 @@ page{
z-index: 2; z-index: 2;
background: #ffffff; background: #ffffff;
} }
.banner{
display: flex;
// align-items: center;
justify-content: center;
}
.bg { .bg {
box-sizing: border-box;
display: inline-block;
width: 690rpx; width: 690rpx;
height: 280rpx; height: 280rpx;
border-radius: 10rpx; border-radius: 10rpx;
margin: 24rpx auto 30rpx; margin: 24rpx auto 0;
text-align: center;
} }
.layout{ .layout{
padding-top: 84px; padding-top: 84px;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
</view> </view>
<!-- 优选 --> <!-- 优选 -->
<view class="layout"> <view class="layout">
<glsx-image webp class="bg" src="mall/bg.png"></glsx-image> <view class="banner">
<glsx-image webp custom-class="bg" src="mall/bg.png"></glsx-image>
</view>
<carOwner id="currentChannel_6" bindshowShoppingCar="showShoppingCarFn" merchantid="{{merchantId}}" channelID="{{currentChannel.id}}"></carOwner> <carOwner id="currentChannel_6" bindshowShoppingCar="showShoppingCarFn" merchantid="{{merchantId}}" channelID="{{currentChannel.id}}"></carOwner>
</view> </view>
\ 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!