【类 型】:feat
【主 题】:扫码获取 shop_id site_id 【描 述】: [原因]:扫码获取对应站点得信息 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
9869ca7fc2
commit
27102c451b
9
App.vue
9
App.vue
@ -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: {
|
||||||
|
@ -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 没有则进行无感登录
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user