【类 型】:fix

【原  因】:后端创建小程序码 改为单一参数 scene  一个参数内前16位记录店铺id 后面的记录站点id
【过  程】:取scene 分割出参数
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
air 2025-06-30 17:55:08 +08:00
parent f704e809e8
commit bf4598fe52

22
App.vue
View File

@ -2,15 +2,25 @@
export default {
//
onLaunch: function(options) {
//id id
// 使
const shopId = options?.query?.s || '2dc23dcfecc05fb1'
const siteId = options?.query?.z || '13'
/* 从二维码获取地块id 单位id 获取参数,如果不存在则使用默认值 */
// 1. scene
const scene = options.query.scene // : "9egr2wqjwy03ddcc20"16shop_id
// 2. scene
let shopId = '2dc23dcfecc05fb1' //
let siteId = '13' //
if (scene) {
shopId = scene.slice(0, 16)
siteId = scene.slice(16)
}
console.log(shopId)
console.log(siteId)
// 3. Vuex
this.$store.commit('setShopId', String(shopId))
this.$store.commit('setSiteId', String(siteId))
//
/*异步加载单位信息*/
this.$store.dispatch('fetchShopCon')
//
//
this.$store.dispatch('fetchSiteList')
//
this.$store.dispatch('fetchMenuList')