Commit 5dd0cc01 authored by Xuguangxing's avatar Xuguangxing

feat: 过滤金融组件

parent 2174cae3
...@@ -24,5 +24,11 @@ export default { ...@@ -24,5 +24,11 @@ export default {
appId: 'wx2f44c7fe7b08458d', appId: 'wx2f44c7fe7b08458d',
hideLoading: true hideLoading: true
}); });
},
getFinanceSetting() {
// return http.post(`http://yapi.quantgroups.com/mock/351/api/kdsp/api/kdsp/vcc_switch`, {
return http.post(`${config.kdspHost}/api/kdsp/vcc_switch`, {
areaType: 11
});
} }
}; };
\ No newline at end of file
...@@ -28,6 +28,7 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle ...@@ -28,6 +28,7 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
@State(state => state.activity.pageInfo.appLoginState) appLoginState; @State(state => state.activity.pageInfo.appLoginState) appLoginState;
@State(state => state.activity.pageInfo.tenantId) tenantId; @State(state => state.activity.pageInfo.tenantId) tenantId;
@State(state => state.activity.gridLayout.rowHeight) rowHeight; @State(state => state.activity.gridLayout.rowHeight) rowHeight;
@State(state => state.activity.showFinanceComponents) showFinanceComponents;
@Mutation('SET_PAGE_ELEMENTS') setPageElement; @Mutation('SET_PAGE_ELEMENTS') setPageElement;
@Mutation('UPDATE_APP_LOGIN_STATE') updateAppLoginState; @Mutation('UPDATE_APP_LOGIN_STATE') updateAppLoginState;
...@@ -115,6 +116,9 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle ...@@ -115,6 +116,9 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
if (!isApp && !isWxMp && !EASY_ENV_IS_NODE) { if (!isApp && !isWxMp && !EASY_ENV_IS_NODE) {
this.pageData.elements = this.pageData.elements.filter(v => v.name !== 'cs-search-bar' && v.name !== 'cs-snap-up'); this.pageData.elements = this.pageData.elements.filter(v => v.name !== 'cs-search-bar' && v.name !== 'cs-snap-up');
} }
if (this.showFinanceComponents == 0) {
this.pageData.elements = this.pageData.elements.filter(v => v.name !== 'freedom-container' || !v.props.isFinance);
}
this.targetEle = document.querySelector('body'); this.targetEle = document.querySelector('body');
if (EASY_ENV_IS_BROWSER) { this.showBackTop = true; } if (EASY_ENV_IS_BROWSER) { this.showBackTop = true; }
this.pageVisibilityChange(); this.pageVisibilityChange();
...@@ -151,6 +155,11 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle ...@@ -151,6 +155,11 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
async fetchApi(options) { async fetchApi(options) {
const { store, route } = options; const { store, route } = options;
const { pageId } = route.params; const { pageId } = route.params;
try {
await store.dispatch('getFinanceSetting');
} catch (err) {
console.log(err);
}
return store.dispatch('getPageDate', { pageId }); return store.dispatch('getPageDate', { pageId });
} }
updateShopCartCount() { updateShopCartCount() {
......
import api from '@/api/editor.api'; import api from '@/api/editor.api';
import { Module, GetterTree, ActionTree, MutationTree } from 'vuex'; import { Module, GetterTree, ActionTree, MutationTree } from 'vuex';
import Vue from 'vue'; import Vue from 'vue';
import { UPDATE_PAGE_INFO, SET_PAGE_INFO, SET_PAGE_DATA, SET_PAGE_ELEMENTS, SET_ELEMENT_POINT, UPDATE_APP_LOGIN_STATE, SET_EMPTY_PAGE } from './type'; import { UPDATE_PAGE_INFO, SET_PAGE_INFO, SET_PAGE_DATA, SET_PAGE_ELEMENTS, SET_ELEMENT_POINT, UPDATE_APP_LOGIN_STATE, SET_EMPTY_PAGE, SET_SHOW_FINANCE } from './type';
import RootState from '../../state'; import RootState from '../../state';
import EditorState, { PageInfo, defaultState, Page, PageElement } from './state'; import EditorState, { PageInfo, defaultState, Page, PageElement } from './state';
...@@ -29,6 +29,16 @@ export default class EditorModule implements Module<EditorState, RootState> { ...@@ -29,6 +29,16 @@ export default class EditorModule implements Module<EditorState, RootState> {
commit(SET_EMPTY_PAGE, true); commit(SET_EMPTY_PAGE, true);
} }
}, },
async getFinanceSetting({ commit }, condition) {
const [res] = await api.getFinanceSetting();
if (res && res.showFlag) {
// const { page, ...rest } = res as PageInfo;
commit(SET_SHOW_FINANCE, res.showFlag);
// commit(SET_EMPTY_PAGE, false);
} else {
commit(SET_SHOW_FINANCE, 0);
}
},
}; };
mutations: MutationTree<EditorState> = { mutations: MutationTree<EditorState> = {
...@@ -60,6 +70,9 @@ export default class EditorModule implements Module<EditorState, RootState> { ...@@ -60,6 +70,9 @@ export default class EditorModule implements Module<EditorState, RootState> {
const element = elements.find(ele => ele.id === id); const element = elements.find(ele => ele.id === id);
if (element && data) { element.point = data; } if (element && data) { element.point = data; }
}, },
[SET_SHOW_FINANCE](state, data) {
state.showFinanceComponents = data;
},
}; };
constructor(initState: EditorState = JSON.parse(JSON.stringify(defaultState))) { constructor(initState: EditorState = JSON.parse(JSON.stringify(defaultState))) {
......
...@@ -104,4 +104,5 @@ export default interface EditorState { ...@@ -104,4 +104,5 @@ export default interface EditorState {
gridLayout: GridLayout; gridLayout: GridLayout;
navigatorConfig: any; navigatorConfig: any;
navIndex: any; navIndex: any;
showFinanceComponents: number;
} }
\ No newline at end of file
...@@ -16,3 +16,4 @@ export const SET_PAGE_ELEMENTS = 'SET_PAGE_ELEMENTS'; ...@@ -16,3 +16,4 @@ export const SET_PAGE_ELEMENTS = 'SET_PAGE_ELEMENTS';
export const SET_ELEMENT_POINT = 'SET_ELEMENT_POINT'; export const SET_ELEMENT_POINT = 'SET_ELEMENT_POINT';
export const SET_EMPTY_PAGE = 'SET_EMPTY_PAGE'; export const SET_EMPTY_PAGE = 'SET_EMPTY_PAGE';
export const UPDATE_APP_LOGIN_STATE = 'UPDATE_APP_LOGIN_STATE'; export const UPDATE_APP_LOGIN_STATE = 'UPDATE_APP_LOGIN_STATE';
export const SET_SHOW_FINANCE = 'SET_SHOW_FINANCE';
{ {
"api": { "api": {
"apiHost": "https://quantum-blocks-undefined.liangkebang.net", "apiHost": "https://quantum-blocks-yxm.liangkebang.net",
"h5Host": "https://quantum-h5-undefined.liangkebang.net", "h5Host": "https://quantum-h5-yxm.liangkebang.net",
"opapiHost": "https://opapi-undefined.liangkebang.net", "opapiHost": "https://opapi-yxm.liangkebang.net",
"passportHost": "https://passportapi-undefined.liangkebang.net", "passportHost": "https://passportapi-yxm.liangkebang.net",
"talosHost": "https://talos-undefined.liangkebang.net", "talosHost": "https://talos-yxm.liangkebang.net",
"kdspHost": "https://kdsp-api-undefined.liangkebang.net", "kdspHost": "https://kdsp-api-yxm.liangkebang.net",
"loginUrl": "", "loginUrl": "",
"newApolloFlag": true, "newApolloFlag": true,
"h5ShopHost": "https://tenet-undefined.liangkebang.net/#", "h5ShopHost": "https://tenet-yxm.liangkebang.net/#",
"mallHost": "https://mall-undefined.liangkebang.net", "mallHost": "https://mall-yxm.liangkebang.net",
"xyqbH5Host": "https://mapi-undefined.liangkebang.net", "xyqbH5Host": "https://mapi-yxm.liangkebang.net",
"yxmTenantId": 560761, "yxmTenantId": 560761,
"appIdMap": { "appIdMap": {
"560761": "wxe16bf9293671506c", "560761": "wxe16bf9293671506c",
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
} }
}, },
"redis": { "redis": {
"port": "undefined", "port": "30835",
"host": "undefined", "host": "172.16.4.6",
"password": "", "password": "",
"db": 0 "db": 0
}, },
......
{"apiHost":"https://quantum-blocks-undefined.liangkebang.net","h5Host":"https://quantum-h5-undefined.liangkebang.net","opapiHost":"https://opapi-undefined.liangkebang.net","passportHost":"https://passportapi-undefined.liangkebang.net","talosHost":"https://talos-undefined.liangkebang.net","kdspHost":"https://kdsp-api-undefined.liangkebang.net","loginUrl":"","newApolloFlag":true,"h5ShopHost":"https://tenet-undefined.liangkebang.net/#","mallHost":"https://mall-undefined.liangkebang.net","xyqbH5Host":"https://mapi-undefined.liangkebang.net","yxmTenantId":560761,"appIdMap":{"560761":"wxe16bf9293671506c","560867":"wxccb8435d68e8c7d6"},"qiniuUpHost":"https://up-z0.qiniup.com","qiniuHost":"https://appsync.lkbang.net"} {"apiHost":"https://quantum-blocks-yxm.liangkebang.net","h5Host":"https://quantum-h5-yxm.liangkebang.net","opapiHost":"https://opapi-yxm.liangkebang.net","passportHost":"https://passportapi-yxm.liangkebang.net","talosHost":"https://talos-yxm.liangkebang.net","kdspHost":"https://kdsp-api-yxm.liangkebang.net","loginUrl":"","newApolloFlag":true,"h5ShopHost":"https://tenet-yxm.liangkebang.net/#","mallHost":"https://mall-yxm.liangkebang.net","xyqbH5Host":"https://mapi-yxm.liangkebang.net","yxmTenantId":560761,"appIdMap":{"560761":"wxe16bf9293671506c","560867":"wxccb8435d68e8c7d6"},"qiniuUpHost":"https://up-z0.qiniup.com","qiniuHost":"https://appsync.lkbang.net"}
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1", "test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1",
"stop": "egg-scripts stop", "stop": "egg-scripts stop",
"backend": "nohup egg-scripts start --port 7001 --workers 4", "backend": "nohup egg-scripts start --port 7001 --workers 4",
"dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=test1 npm run apollo && egg-bin dev -r egg-ts-helper/register", "dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=yxm npm run apollo && egg-bin dev -r egg-ts-helper/register",
"debug": "egg-bin debug -r egg-ts-helper/register", "debug": "egg-bin debug -r egg-ts-helper/register",
"apollo": "node bin/apollo.js", "apollo": "node bin/apollo.js",
"build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool", "build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment