Commit d0551243 by zhangxw

超管账号 进入小程序 默认开通所有场景

1 parent 3aaa20c9
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* 2测试 * 2测试
* 3生产环境 * 3生产环境
*/ */
export let env = 3 export let env = 2
// 配置预发布的小程序aapId // 配置预发布的小程序aapId
// export const preReleaseAppId = 'wx24ebae5768e74138' // export const preReleaseAppId = 'wx24ebae5768e74138'
......
...@@ -3,6 +3,7 @@ import api from '../../api/api.js' ...@@ -3,6 +3,7 @@ import api from '../../api/api.js'
const app = getApp() const app = getApp()
import { getYQorderInfo } from '~/store/index' import { getYQorderInfo } from '~/store/index'
import { checkYqdSuper } from '~/store/index' import { checkYqdSuper } from '~/store/index'
import constantData from '../constant/data'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -139,10 +140,12 @@ Page({ ...@@ -139,10 +140,12 @@ Page({
let { loginUserInfoList } = this.data let { loginUserInfoList } = this.data
let id = null let id = null
let yqMerchantId = null let yqMerchantId = null
let isSuper = null
loginUserInfoList.map(e => { loginUserInfoList.map(e => {
if (e.active) { if (e.active) {
yqMerchantId = e.merchantId yqMerchantId = e.merchantId
id = e.uuid id = e.uuid
isSuper = e.isSuper
} }
}) })
if (!id) { if (!id) {
...@@ -174,6 +177,14 @@ Page({ ...@@ -174,6 +177,14 @@ Page({
wx.$router.reLaunch(`${target}.${name}`, query) wx.$router.reLaunch(`${target}.${name}`, query)
wx.$SCENE = null wx.$SCENE = null
} else { } else {
// 超管默认开通所有场景
if (isSuper) {
// 0 会员权益/升级 1 精品升级
let openSceneArr = constantData.sceneList.map(val => {return val?.sceneType})
wx.$util.setUserInfo({ ...wx.$util.getUserInfo(), openSceneArr })
wx.$router.reLaunch('pages.sceneIndex')
return
}
// 获取开通的业务场景 // 获取开通的业务场景
api.getYqMerchantSceneConfigAPI({ yqMerchantId: yqMerchantId }).then(res => { api.getYqMerchantSceneConfigAPI({ yqMerchantId: yqMerchantId }).then(res => {
let { data, message, code } = res let { data, message, code } = res
......
const sceneList = [
{
sceneName: '精品升级',
sceneDesc: '太阳膜升级转化下单',
sceneType: 1,
actived: false
},
{
sceneName: '会员权益/升级',
sceneDesc: '新车车损险下单',
sceneType: 0,
actived: false
}
]
export default {
sceneList
}
\ No newline at end of file \ No newline at end of file
// pages/sceneIndex/sceneIndex.js // pages/sceneIndex/sceneIndex.js
import logOutAPI from '../../tabMine/api' import logOutAPI from '../../tabMine/api'
import constantData from '../constant/data'
const app = getApp() const app = getApp()
Page({ Page({
/** /**
...@@ -7,20 +8,7 @@ Page({ ...@@ -7,20 +8,7 @@ Page({
*/ */
data: { data: {
timeState: '', timeState: '',
sceneList: [ sceneList: constantData.sceneList,
{
sceneName: '精品升级',
sceneDesc: '太阳膜升级转化下单',
sceneType: 1,
actived: false
},
{
sceneName: '会员权益/升级',
sceneDesc: '新车车损险下单',
sceneType: 0,
actived: false
}
],
isShow: false isShow: false
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!