Commit 6ee9c043 by 杨北旺

提交紧急版本内容

1 parent 82cb11bd
import { preReleaseAppId } from '~/config' import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 3 let index = 1
/** /**
* *
...@@ -108,7 +108,7 @@ const defaultMerchantId = { ...@@ -108,7 +108,7 @@ const defaultMerchantId = {
ip: '44211227', ip: '44211227',
dev: '44211227', dev: '44211227',
uat: '44211651', uat: '44211651',
prod: '44208317', prod: '44209566',
preRelease: '44209566' preRelease: '44209566'
}[target[index]] }[target[index]]
......
...@@ -229,4 +229,11 @@ module.exports = { ...@@ -229,4 +229,11 @@ module.exports = {
true true
) )
}, },
// 获取门店列表
getStoreList(data) {
return api.post({
method: `scrm.api.shopmall.weapp.merchant.detail.list`,
...data
})
},
}; };
...@@ -170,7 +170,8 @@ ...@@ -170,7 +170,8 @@
"authorize": "/components/Authorize/Authorize", "authorize": "/components/Authorize/Authorize",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"goods-action": "/components/GoodsAction/GoodsAction", "goods-action": "/components/GoodsAction/GoodsAction",
"stepper": "/components/Stepper/Stepper" "stepper": "/components/Stepper/Stepper",
"store-select":"/components/Store/index"
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
......
import { IMG_URL } from '~/config';
import { env } from '~/api/env/index'
import { MERCHANT_STATIC_LIST} from '~/utils/constants'
Component({
properties: {
show:{
type:Boolean,
observer(n) {
if (n) this.getMerchantList()
}
}
},
data: {
storeList: []
},
methods: {
closeModal() {
this.setData({
show: false
})
},
// 检查是否是首次
checkFirst() {
const FIRST = wx.p.storage.get('first_enter_miniprograme')
if (FIRST) {
this.setData({
show: false
})
return true
}
},
// 获取门店信息
async getMerchantList() {
const have_enter = this.checkFirst()
if(have_enter)return
// 获取mock配置门店
const MOCKDATA = wx.p.storage.get("mock_data");
let MerchantList = MERCHANT_STATIC_LIST[env]
if (MOCKDATA && MOCKDATA.add_wuye_merchant) {
const ADD_MERCHANT_LIST = MOCKDATA.add_wuye_merchant[env]
if (ADD_MERCHANT_LIST && ADD_MERCHANT_LIST.length) {
MerchantList = [...MerchantList, ...ADD_MERCHANT_LIST]
}
}
let storeList = [], index = 0
storeList = await this.getMerchantListData(MerchantList)
storeList.forEach((ele, i) => {
ele.merchantId = ele.merchantNo
if (this.defaultMerchant == ele.merchantId) {
index = i
}
})
this.setData({
storeList,
show:true
})
},
// 选择门店
toSelect(e) {
const { item } = e.currentTarget.dataset
wx.p.storage.set('merchant_info', {
merchantId: item.merchantNo,
})
wx.$merchant_id = item.merchantNo
wx.p.storage.set('first_enter_merchantId', item.merchantNo)
wx.p.storage.set('first_enter_miniprograme', true)
this.triggerEvent('freshMerchant')
wx.p.eventbus.emit('STORE')
this.setData({
show: false
})
},
// 获取门店列表
async getMerchantListData(merchantIdList) {
const res = await wx.p.api.shopmallApi.getStoreList({ merchantIdList })
return res || []
},
},
lifetimes: {
attached() {
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.modal {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba($color: #000000, $alpha: 0.6);
z-index: 9999;
}
.pannel {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 638rpx;
background: #FFFFFF;
border-radius: 8rpx;
padding-bottom: 30rpx;
.color-bg {
padding: 30rpx;
border-radius: 8rpx;
background-image: linear-gradient(180deg, #E3E8FC 0%, #FFFFFF 100%);
font-weight: 400;
font-size: 32rpx;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.close {
width: 32rpx;
height: 32rpx;
position: absolute;
right: 15rpx;
top: 50%;
transform: translateY(-50%);
}
}
.list_wrap {
.store_item {
padding: 20rpx 30rpx;
display: flex;
.cover {
width: 104rpx;
height: 104rpx;
transform: translateY(4rpx);
}
.info-wrap {
padding-left: 20rpx;
.title {
font-weight: 600;
font-size: 30rpx;
color: #333333;
margin-bottom: 8rpx;
}
.cell {
display: flex;
align-items: center;
margin-bottom: 4rpx;
.icon {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
}
.text {
font-weight: 400;
font-size: 24rpx;
color: #666666;
line-height: 36rpx;
width: 400rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
<view wx:if="{{show}}" class="modal">
<view wx:if="{{storeList.length}}" class="pannel">
<view class="color-bg">
选择您所在的小区
<!-- <glsx-image class="close" bind:tap="closeModal" webp src="login/close.png"></glsx-image> -->
</view>
<view class="list_wrap">
<block wx:for="{{storeList}}" wx:key="index">
<view bind:tap="toSelect" data-item="{{item}}" class="store_item">
<glsx-image class="cover" webp src="login/banner{{index?'1':'2'}}.png"></glsx-image>
<view class="info-wrap">
<view class="title">{{item.merchantName}}</view>
<view class="cell">
<glsx-image class="icon" webp src="login/phone.png"></glsx-image>
<view class="text">{{item.merchantLegalPersonPhone || '--'}}</view>
</view>
<view class="cell">
<glsx-image class="icon" webp src="login/address.png"></glsx-image>
<view class="text">{{item.merchantAddress || '--'}}</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -36,6 +36,7 @@ Page({ ...@@ -36,6 +36,7 @@ Page({
buyType, buyType,
discoverGoodsSource discoverGoodsSource
} = obj } = obj
console.log(obj);
let ids = [], expressFee = 0, goodsNumber = 0 let ids = [], expressFee = 0, goodsNumber = 0
if (obj.deliveryType == 1) { if (obj.deliveryType == 1) {
this.getLocation() this.getLocation()
...@@ -365,7 +366,7 @@ Page({ ...@@ -365,7 +366,7 @@ Page({
} else { } else {
if (!contactInfo.contactName) { if (!contactInfo.contactName) {
contactInfo.contactAddress = ' ' contactInfo.contactAddress = ' '
contactInfo.contactName = this.data.userInfo.nickName contactInfo.contactName = this.data.userInfo.nickName || ' '
contactInfo.contactPhone = this.data.userInfo.phone contactInfo.contactPhone = this.data.userInfo.phone
// wx.p.wxApi.showToast('请选择收货地址') // wx.p.wxApi.showToast('请选择收货地址')
// return // return
...@@ -395,13 +396,13 @@ Page({ ...@@ -395,13 +396,13 @@ Page({
orderSource, orderSource,
orderCouponDTO, orderCouponDTO,
contactAddress:contactInfo.contactAddress || ' ', contactAddress:contactInfo.contactAddress || ' ',
contactName: contactInfo.contactName, contactName: contactInfo.contactName || ' ',
contactPhone: contactInfo.contactPhone, contactPhone: contactInfo.contactPhone,
userName: contactInfo.contactName, userName: contactInfo.contactName || ' ',
userPhone: contactInfo.contactPhone userPhone: contactInfo.contactPhone
} }
if(deliveryType==0){ if(deliveryType==0){
query.userName = this.data.userInfo.nickName query.userName = this.data.userInfo.nickName || this.data.userInfo.phone
query.userPhone = this.data.userInfo.phone query.userPhone = this.data.userInfo.phone
} }
wx.p.api.shopmallApi wx.p.api.shopmallApi
......
...@@ -14,7 +14,6 @@ Page({ ...@@ -14,7 +14,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.routerApi.decodeUrlLink(options)
if (!options.id) { if (!options.id) {
return return
} }
...@@ -48,8 +47,8 @@ Page({ ...@@ -48,8 +47,8 @@ Page({
showAuthBtn: res.data.phone ? false : true showAuthBtn: res.data.phone ? false : true
}) })
if (res.data.isLogin) { if (res.data.isLogin) {
wx.p.util.setUserInfo(res.data) wx.p.cache.userInfo.setUserInfo(res.data)
wx.p.util.setSessionId(res.data.sessionId) wx.p.cache.storageApi.setSessionId(res.data.sessionId)
this.handlerCustomerId() this.handlerCustomerId()
} }
} }
...@@ -68,8 +67,8 @@ Page({ ...@@ -68,8 +67,8 @@ Page({
wx.hideLoading() wx.hideLoading()
if (code == '0') { if (code == '0') {
wx.p.authStatus = false wx.p.authStatus = false
wx.p.util.setUserInfo(data) wx.p.cache.userInfo.setUserInfo(data)
wx.p.util.setSessionId(data.sessionId) wx.p.cache.storageApi.setSessionId(data.sessionId)
this.toCreatePackageNum() this.toCreatePackageNum()
this.handlerCustomerId() this.handlerCustomerId()
} else wx.p.wxApi.showToast(message) } else wx.p.wxApi.showToast(message)
...@@ -152,8 +151,8 @@ Page({ ...@@ -152,8 +151,8 @@ Page({
}, },
// 客户id // 客户id
handlerCustomerId() { handlerCustomerId() {
let customerId = wx.p.storage.get('srcm_shopmall_customer_id') // let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
if (customerId) USERAPI.updataCustomerPhone() // if (customerId) USERAPI.updataCustomerPhone()
}, },
// 价格格式化 // 价格格式化
// priceFormat(num, point = 2) { // priceFormat(num, point = 2) {
...@@ -173,6 +172,6 @@ Page({ ...@@ -173,6 +172,6 @@ Page({
// } // }
// }, // },
onUnload: function () { onUnload: function () {
wx.$util.customerbehavior(2) // wx.$util.customerbehavior(2)
} }
}) })
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
.button-item { .button-item {
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
background: #fc5b32; background: #3772EC;
border-radius: 8rpx; border-radius: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
...@@ -472,11 +472,11 @@ Page({ ...@@ -472,11 +472,11 @@ Page({
} }
// 配置升级 // 配置升级
if (options && options.isUpgrade) { if (options && options.isUpgrade) {
this.isUpgrade = options.isUpgrade this.isUpgrade = JSON.parse(options.isUpgrade)
} }
// 车主优选 // 车主优选
if (options && options.isCarOwner) { if (options && options.isCarOwner) {
this.isCarOwner = options.isCarOwner this.isCarOwner = JSON.parse(options.isCarOwner)
} }
this.appHide() this.appHide()
}, },
......
...@@ -218,7 +218,7 @@ Page({ ...@@ -218,7 +218,7 @@ Page({
} }
let list = [] let list = []
wx.p.api.mineApi.getOrderList(obj).then((data) => { wx.p.api.mineApi.getOrderList(obj).then((data) => {
wx.hideLoading() // wx.hideLoading()
data?.list?.map((e) => { data?.list?.map((e) => {
let { let {
orderGoods, orderGoods,
......
...@@ -31,6 +31,8 @@ Page({ ...@@ -31,6 +31,8 @@ Page({
wx.p.storage.set('merchant_info', { wx.p.storage.set('merchant_info', {
merchantId: options.merchantId, merchantId: options.merchantId,
}) })
wx.p.storage.set('first_enter_merchantId', options.merchantId)
wx.p.storage.set('first_enter_miniprograme', true)
} }
try { try {
const { code, data, message } = await wx.p.api.userApi.login() const { code, data, message } = await wx.p.api.userApi.login()
......
...@@ -43,6 +43,10 @@ Page({ ...@@ -43,6 +43,10 @@ Page({
onShow() { onShow() {
let authComponent = this.selectComponent('#authorize') let authComponent = this.selectComponent('#authorize')
if (authComponent) authComponent.check() if (authComponent) authComponent.check()
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
}, },
goMorePage() { goMorePage() {
......
...@@ -41,4 +41,4 @@ ...@@ -41,4 +41,4 @@
</view> </view>
<!-- </view> --> <!-- </view> -->
<authorize id="authorize" scopeType="userLocation" isShowCheck="{{false}}" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize> <authorize id="authorize" scopeType="userLocation" isShowCheck="{{false}}" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}"></store-select>
\ No newline at end of file \ No newline at end of file
const navStyle = "background-color: transparent;"; const navStyle = "background-color: transparent;";
import { IMG_URL } from '~/config'; import { IMG_URL } from '~/config';
import { env } from '~/api/env/index' import { env } from '~/api/env/index'
import { MERCHANT_STATIC_LIST} from '~/utils/constants'
Page({ Page({
data: { data: {
IMG_URL, IMG_URL,
...@@ -29,7 +30,7 @@ Page({ ...@@ -29,7 +30,7 @@ Page({
let { height } = e.detail; let { height } = e.detail;
this.setData({ this.setData({
navBarHeight: height, navBarHeight: height,
user_box_style: `padding-top:${height+10}px`, user_box_style: `padding-top:${height + 10}px`,
}); });
}, },
// 处理滚动事件 // 处理滚动事件
...@@ -41,7 +42,14 @@ Page({ ...@@ -41,7 +42,14 @@ Page({
}, },
onLoad(options) { onLoad(options) {
this.defaultMerchant = wx.$merchant_id this.defaultMerchant = wx.$merchant_id
this.getMerchantList() const FIRST = wx.p.storage.get('first_enter_miniprograme')
if (FIRST) {
this.getMerchantList()
} else {
wx.p.eventbus.on('STORE', () => {
this.getMerchantList()
})
}
this.getStrategyList(); this.getStrategyList();
if (options?.jumpH5Url) { if (options?.jumpH5Url) {
this.setData({ this.setData({
...@@ -54,6 +62,7 @@ Page({ ...@@ -54,6 +62,7 @@ Page({
}) })
}, 1600) }, 1600)
} }
}, },
// 获取省钱攻略 // 获取省钱攻略
...@@ -81,7 +90,7 @@ Page({ ...@@ -81,7 +90,7 @@ Page({
toShowQrCode(e) { toShowQrCode(e) {
const { url } = e.currentTarget.dataset; const { url } = e.currentTarget.dataset;
const {currentStore} = this.data const { currentStore } = this.data
const Name = `${currentStore.merchantId}_${url}` const Name = `${currentStore.merchantId}_${url}`
this.setData({ this.setData({
urlName: Name, urlName: Name,
...@@ -112,76 +121,85 @@ Page({ ...@@ -112,76 +121,85 @@ Page({
}) })
this.setData({ this.setData({
currentStore currentStore
},()=>{
this.getMerchantIdDetail(currentStore.merchantId)
}) })
}, },
// 获取门店列表 // 获取门店列表
getMerchantList() { async getMerchantList() {
const merchantObj = { const HAVE_ENTER = wx.p.storage.get('first_enter_miniprograme')
'develop': [44211227, 44209845], if (HAVE_ENTER && !this.fresh) {
'test': [44212577, 44210895, 44212578, 44210956], this.defaultMerchant = wx.p.storage.get('first_enter_merchantId')
'beta': [44211427,44211428],
'production': [44209566, 44209565],
} }
// 获取mock配置门店 // 获取mock配置门店
const MOCKDATA = wx.p.storage.get("mock_data"); const MOCKDATA = wx.p.storage.get("mock_data");
let MerchantList = merchantObj[env] let MerchantList = MERCHANT_STATIC_LIST[env]
if(MOCKDATA&&MOCKDATA.add_wuye_merchant){ if (MOCKDATA && MOCKDATA.add_wuye_merchant) {
const ADD_MERCHANT_LIST = MOCKDATA.add_wuye_merchant[env] const ADD_MERCHANT_LIST = MOCKDATA.add_wuye_merchant[env]
if(ADD_MERCHANT_LIST&&ADD_MERCHANT_LIST.length){ if (ADD_MERCHANT_LIST && ADD_MERCHANT_LIST.length) {
MerchantList = [...MerchantList,...ADD_MERCHANT_LIST] MerchantList = [...MerchantList, ...ADD_MERCHANT_LIST]
} }
} }
let storeList = [], index = 0 let storeList = [], index = 0
MerchantList.forEach((el, i) => { storeList = await this.getMerchantListData(MerchantList)
wx.$merchant_id = el storeList.forEach((ele, i) => {
wx.p.storage.set('merchant_info', { ele.merchantId = ele.merchantNo
merchantId: el, if (this.defaultMerchant == ele.merchantId) {
}) index = i
wx.p.api.homeApi.getHomeConfig({ merchantId: el }).then(data => { }
let { })
merchantName, const currentStore = storeList[index]
noticeContent wx.$merchant_id = currentStore.merchantId
} = data wx.p.storage.set('merchant_info', {
let bannerList = [] merchantId: currentStore.merchantId,
if (data.bannerList && data.bannerList.length) bannerList = data.bannerList })
storeList.push({ this.setData({
merchantName, storeList,
noticeContent, currentStore
bannerList, }, () => {
merchantId: el this.getMerchantIdDetail(currentStore.merchantId)
})
if (storeList.length > 1) {
storeList.forEach((ele, i) => {
if (this.defaultMerchant == ele.merchantId) {
index = i
}
})
const currentStore = storeList[index]
wx.$merchant_id = currentStore.merchantId
wx.p.storage.set('merchant_info', {
merchantId: currentStore.merchantId,
})
this.setData({
storeList,
currentStore
})
if( this.fresh){
wx.stopPullDownRefresh()
}
}
})
}) })
}, },
onPullDownRefresh(){ onPullDownRefresh() {
this.fresh = true this.fresh = true
this.defaultMerchant = this.getStorageMerchantId()
this.getMerchantList()
this.getStrategyList();
},
onShow() {
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore: !FIRST
})
},
// 获取门店id
getStorageMerchantId() {
const { const {
merchantId merchantId
} = wx.p.storage.get('merchant_info') } = wx.p.storage.get('merchant_info')
this.defaultMerchant = merchantId return merchantId
this.getMerchantList() },
this.getStrategyList(); // 获取门店列表
async getMerchantListData(merchantIdList) {
const res = await wx.p.api.shopmallApi.getStoreList({ merchantIdList })
return res || []
},
// 获取选择门店的信息
getMerchantIdDetail(merchantId) {
wx.$merchant_id = merchantId
wx.p.api.homeApi.getHomeConfig({ merchantId }).then(data => {
let {
noticeContent
} = data
let bannerList = [], { currentStore } = this.data
if (data.bannerList && data.bannerList.length) bannerList = data.bannerList
currentStore.noticeContent = noticeContent
currentStore.bannerList = bannerList
this.setData({
currentStore
})
})
} }
}); });
...@@ -61,4 +61,4 @@ ...@@ -61,4 +61,4 @@
<image bind:tap="closeModal" class="close_icon" src="{{IMG_URL}}home/close_modal.png" /> <image bind:tap="closeModal" class="close_icon" src="{{IMG_URL}}home/close_modal.png" />
</view> </view>
</view> </view>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -14,23 +14,23 @@ Component({ ...@@ -14,23 +14,23 @@ Component({
*/ */
properties: { properties: {
height: null, height: null,
channelID: { // channelID: {
type: Number, // type: Number,
observer: function (val) { // observer: function (val) {
if (val) { // if (val) {
// this.setList(val); // // this.setList(val);
} // }
}, // },
}, // },
merchantid: { // merchantid: {
type: [String, Number], // type: [String, Number],
observer: function (val) { // observer: function (val) {
if (val) { // if (val) {
this.init() // this.init()
// this.setList(val); // // this.setList(val);
} // }
}, // },
}, // },
}, },
/** /**
...@@ -66,8 +66,11 @@ Component({ ...@@ -66,8 +66,11 @@ Component({
toSeri: `toCategory-${index}`, toSeri: `toCategory-${index}`,
categoryStyle: item.categoryStyle || 0 categoryStyle: item.categoryStyle || 0
}) })
this.triggerEvent('showShoppingCar', item.categoryStyle) // this.triggerEvent('showShoppingCar', item.categoryStyle)
this.getCategoryGoodsList(item.id) const {
merchantId
} = wx.p.storage.get('merchant_info')
this.getCategoryGoodsList(item.id,merchantId)
}, },
//获取分类 //获取分类
getCategoryList() { getCategoryList() {
...@@ -84,17 +87,18 @@ Component({ ...@@ -84,17 +87,18 @@ Component({
categoryList: res, categoryList: res,
categoryStyle: res[0].categoryStyle || 0 categoryStyle: res[0].categoryStyle || 0
}) })
this.triggerEvent('showShoppingCar', res[0].categoryStyle) this.getCategoryGoodsList(res[0].id,merchantId)
// console.log(res[0].id,'res[0].id'); }else{
this.getCategoryGoodsList(res[0].id) this.setData({
categoryList:[],
categoryStyle: 0,
goodsList:[]
})
} }
}) })
}, },
//获取商品列表 //获取商品列表
async getCategoryGoodsList(categoryId) { async getCategoryGoodsList(categoryId,merchantId) {
const {
merchantId
} = wx.p.storage.get('merchant_info')
let _para = { let _para = {
merchantId, merchantId,
categoryId, categoryId,
...@@ -157,6 +161,7 @@ Component({ ...@@ -157,6 +161,7 @@ Component({
item item
} = e.currentTarget.dataset } = e.currentTarget.dataset
const B_userInfo = wx.p.storage.get('userInfo') const B_userInfo = wx.p.storage.get('userInfo')
this.jumpEvent = true
if (B_userInfo && B_userInfo.userType) { if (B_userInfo && B_userInfo.userType) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/Login/Login' url: '/pages/Login/Login'
...@@ -212,20 +217,20 @@ Component({ ...@@ -212,20 +217,20 @@ Component({
// }); // });
// }, // },
// 获取购物车列表 // 获取购物车列表
async getBuyCarList() { // async getBuyCarList() {
const authStatus = await wx.p.router.intercept(false) // const authStatus = await wx.p.router.intercept(false)
if (authStatus) return // if (authStatus) return
const B_userInfo = wx.p.storage.get('userInfo') // const B_userInfo = wx.p.storage.get('userInfo')
if (B_userInfo && B_userInfo.userType) return; // if (B_userInfo && B_userInfo.userType) return;
const { // const {
merchantId // merchantId
} = wx.p.storage.get('merchant_info') // } = wx.p.storage.get('merchant_info')
const res = await shopmallApi.getShoppingcartList({ // const res = await shopmallApi.getShoppingcartList({
cartType: 4, // cartType: 4,
merchantId // merchantId
}) // })
eventbus.emit('getBuyCarList', res) // eventbus.emit('getBuyCarList', res)
}, // },
// 加入购物车 // 加入购物车
async toAddBuuCar(e) { async toAddBuuCar(e) {
const { const {
...@@ -233,6 +238,7 @@ Component({ ...@@ -233,6 +238,7 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
const authStatus = await wx.p.router.intercept() const authStatus = await wx.p.router.intercept()
if (authStatus) return if (authStatus) return
this.jumpEvent = true
if (this.data.hasCarOwnerCouponFlag) { if (this.data.hasCarOwnerCouponFlag) {
wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept: true }); wx.p.router.go(`/packageMall/pages/getCoupon/getCoupon?discoverGoodsType=2&from=2`, { notIntercept: true });
return return
...@@ -244,12 +250,12 @@ Component({ ...@@ -244,12 +250,12 @@ Component({
goodsId: item.id, goodsId: item.id,
} }
let _para = { let _para = {
goodsList:deliveryType==1? goodsListItem:[goodsListItem], goodsList:[goodsListItem],
isCarOwner: true, isCarOwner: true,
showAddr: deliveryType==0?1:0, showAddr: deliveryType==0?1:0,
buyType: 'pay', buyType: 'pay',
discoverGoodsSource: item.discoverGoodsSource, discoverGoodsSource: item.discoverGoodsSource,
deliveryType:deliveryType deliveryType:0
} }
wx.p.router.go('/packageDiscovery/pages/pay/index', _para) wx.p.router.go('/packageDiscovery/pages/pay/index', _para)
// const res = await shopmallApi.addShoppingcart(_para) // const res = await shopmallApi.addShoppingcart(_para)
...@@ -275,7 +281,9 @@ Component({ ...@@ -275,7 +281,9 @@ Component({
this.init() this.init()
}, },
init() { init() {
this.getCategoryList() if(!this.jumpEvent){
this.getCategoryList()
}
// const B_userInfo = wx.p.storage.get('userInfo') // const B_userInfo = wx.p.storage.get('userInfo')
// if (B_userInfo && B_userInfo.userType) return // if (B_userInfo && B_userInfo.userType) return
// this.getBuyCarList() // this.getBuyCarList()
......
...@@ -82,7 +82,7 @@ page { ...@@ -82,7 +82,7 @@ page {
.titleBg { .titleBg {
box-sizing: border-box; box-sizing: border-box;
width: 750rpx; width: 722rpx;
height: 160rpx; height: 160rpx;
margin-left: -20rpx; margin-left: -20rpx;
background-image: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/mall/goodsBg.png); background-image: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/mall/goodsBg.png);
......
...@@ -7,90 +7,92 @@ Page({ ...@@ -7,90 +7,92 @@ Page({
} }
}, },
onShow() { onShow() {
let { // let {
merchantId // merchantId
} = this.data // } = this.data
const merchantInfo = wx.p.storage.get('merchant_info') // const merchantInfo = wx.p.storage.get('merchant_info')
let newMerchantId = merchantInfo.merchantId // let newMerchantId = merchantInfo.merchantId
if (newMerchantId != merchantId && newMerchantId ) { // if (newMerchantId != merchantId && newMerchantId ) {
this.setData({ // this.setData({
merchantId: newMerchantId // merchantId: newMerchantId
}) // })
this.getDiscoverInfo(newMerchantId, 6) // this.getDiscoverInfo(newMerchantId, 6)
} // }
// this.getDiscoverInfo(merchantInfo.merchantId, 6)
this.getComponentPage().onShow && this.getComponentPage().onShow() this.getComponentPage().onShow && this.getComponentPage().onShow()
}, const FIRST = wx.p.storage.get('first_enter_miniprograme')
getDiscoverInfo(merchantId, channel) {
discoveryApi.getDiscoverConfig({
merchantId
}).then(res => {
if (res && res.length) {
// console.log(JSON.stringify(res), channel);
this.handlerDiscoverSetting(JSON.stringify(res), channel)
}
})
},
// 处理发现配置数据
handlerDiscoverSetting(query, channel) {
const list = JSON.parse(query)
let {
currentChannel,
curTabIndex
} = this.data
if (list && list.length) {
if (channel) {
list.forEach((el, index) => {
if (el.channelType == channel) {
curTabIndex = index
currentChannel = el
}
})
} else {
currentChannel = list[0]
}
// this.computeBannerHeight(list.length)
}
this.setData({ this.setData({
discoverSettingList: list, showStore:!FIRST
showPage: true,
currentChannel,
curTabIndex
}) })
}, },
// getDiscoverInfo(merchantId, channel) {
// discoveryApi.getDiscoverConfig({
// merchantId
// }).then(res => {
// if (res && res.length) {
// // console.log(JSON.stringify(res), channel);
// this.handlerDiscoverSetting(JSON.stringify(res), channel)
// }
// })
// },
// 处理发现配置数据
// handlerDiscoverSetting(query, channel) {
// const list = JSON.parse(query)
// let {
// currentChannel,
// curTabIndex
// } = this.data
// if (list && list.length) {
// if (channel) {
// list.forEach((el, index) => {
// if (el.channelType == channel) {
// curTabIndex = index
// currentChannel = el
// }
// })
// } else {
// currentChannel = list[0]
// }
// // this.computeBannerHeight(list.length)
// }
// this.setData({
// currentChannel,
// })
// },
// 计算高度 // 计算高度
computeBannerHeight(len) { // computeBannerHeight(len) {
let query = wx.createSelectorQuery().in(this) // let query = wx.createSelectorQuery().in(this)
query // query
.select('.banner_wrapper') // .select('.banner_wrapper')
.boundingClientRect(res => { // .boundingClientRect(res => {
this.setData({ // this.setData({
'heightInfo.bannerH': res.height // 'heightInfo.bannerH': res.height
}) // })
}) // })
.exec() // .exec()
query // query
.select('.tab_wrapper') // .select('.tab_wrapper')
.boundingClientRect(react => { // .boundingClientRect(react => {
if (len == 1) { // if (len == 1) {
this.setData({ // this.setData({
'heightInfo.tabH': 20 // 'heightInfo.tabH': 20
}) // })
} else { // } else {
this.setData({ // this.setData({
'heightInfo.tabH': react.height // 'heightInfo.tabH': react.height
}) // })
} // }
}) // })
.exec() // .exec()
}, // },
//隐藏购物车 //隐藏购物车
showShoppingCarFn(e) { // showShoppingCarFn(e) {
this.setData({ // this.setData({
showCarFlag: e.detail != 2 // showCarFlag: e.detail != 2
}) // })
}, // },
navbarReady(e) { navbarReady(e) {
let { height } = e.detail; let { height } = e.detail;
this.setData({ this.setData({
...@@ -101,5 +103,8 @@ Page({ ...@@ -101,5 +103,8 @@ Page({
getComponentPage() { getComponentPage() {
return this.selectComponent(`#currentChannel_6`) return this.selectComponent(`#currentChannel_6`)
}, },
freshMerchant(){
this.onShow()
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
</view> </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>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -179,7 +179,13 @@ Page({ ...@@ -179,7 +179,13 @@ Page({
this.toCheckMember() this.toCheckMember()
this.getUserCarList() this.getUserCarList()
this.getMemberCardData() this.getMemberCardData()
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
},
freshMerchant(){
this.getMemberCardData()
}, },
}) })
\ No newline at end of file \ No newline at end of file
...@@ -159,4 +159,4 @@ ...@@ -159,4 +159,4 @@
<glsx-image bindtap="handleChangeVal" data-attr="isMemberShow" data-val="{{false}}" class="member-close" src="mine/icon-member-close.png"></glsx-image> <glsx-image bindtap="handleChangeVal" data-attr="isMemberShow" data-val="{{false}}" class="member-close" src="mine/icon-member-close.png"></glsx-image>
</view> </view>
</view> </view>
<!-- <glsx-privacy appletName="业主甄选"></glsx-privacy> -->
\ No newline at end of file \ No newline at end of file
<store-select show="{{showStore}}" bind:freshMerchant="freshMerchant"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -40,5 +40,11 @@ Page({ ...@@ -40,5 +40,11 @@ Page({
id, id,
notIntercept: true notIntercept: true
}) })
},
onShow(){
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
} }
}); });
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
</view> </view>
</view> </view>
</view> </view>
<store-select show="{{showStore}}"></store-select>
\ No newline at end of file \ No newline at end of file
...@@ -18,10 +18,21 @@ export const STORAGE_OBJECTkEY = { ...@@ -18,10 +18,21 @@ export const STORAGE_OBJECTkEY = {
guest_no: 'guest_no', guest_no: 'guest_no',
scrm_shopmall_car_brand_list:"scrm_shopmall_car_brand_list", scrm_shopmall_car_brand_list:"scrm_shopmall_car_brand_list",
shareStaff:"shareStaff", shareStaff:"shareStaff",
miaoshatrack:'miaoshatrack' miaoshatrack:'miaoshatrack',
first_enter_miniprograme:"first_enter_miniprograme",
first_enter_merchantId:"first_enter_merchantId"
}
// 设置默认门店信息
export const MERCHANT_STATIC_LIST = {
'develop': [44211227, 44209845],
'test': [44212577, 44210895, 44212578, 44210956],
'beta': [44211427, 44211428],
'production': [44209566, 44209565],
} }
export default{ export default{
DEFAULT_GET_STORAGEKEY, DEFAULT_GET_STORAGEKEY,
STORAGE_OBJECTkEY STORAGE_OBJECTkEY,
MERCHANT_STATIC_LIST
} }
\ 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!