【类 型】:feat

【主	题】:扫码获取 shop_id site_id
【描	述】:
	[原因]:扫码获取对应站点得信息
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-07-15 15:37:06 +08:00
parent 9869ca7fc2
commit 27102c451b
3 changed files with 17 additions and 7 deletions

View File

@ -1,7 +1,10 @@
<script> <script>
export default { export default {
// //
onLaunch: function() { onLaunch: function(options) {
//id id
this.$store.commit('setShopId', options.query.s);
this.$store.commit('setSiteId', options.query.z);
// //
this.$store.dispatch('fetchShopCon') this.$store.dispatch('fetchShopCon')
// //
@ -21,7 +24,9 @@
}) })
}, },
// //
onShow: function() {}, onShow: function() {
},
// //
onHide: function() {}, onHide: function() {},
methods: { methods: {

View File

@ -68,9 +68,6 @@
orderList() { orderList() {
return this.$store.state.orderList.filter(item => item.main_status === '已付款') return this.$store.state.orderList.filter(item => item.main_status === '已付款')
} }
},
onReady() {
}, },
onShow() { onShow() {
//token //token

View File

@ -19,8 +19,8 @@ const {
const store = new Vuex.Store({ const store = new Vuex.Store({
//全局状态 //全局状态
state: { state: {
shop_id: "2dc23dcfecc05fb1", //商铺id shop_id: null, //商铺id
site_id: 1, //当前站点id site_id: null, //当前站点id
userInfo: { userInfo: {
name: null, name: null,
photo: null, photo: null,
@ -44,6 +44,14 @@ const store = new Vuex.Store({
}, },
//修改状态 //修改状态
mutations: { mutations: {
//设置 二维码获取商铺id
setShopId(state, shop_id) {
state.shop_id = shop_id;
},
//设置 二维码获取站点id
setSiteId(state, site_id) {
state.site_id = site_id;
},
//设置 列表页 购物车折叠显隐 //设置 列表页 购物车折叠显隐
setCartShow(state, val) { setCartShow(state, val) {
Vue.set(state, 'cartShow', val) Vue.set(state, 'cartShow', val)