Commit 463c202b authored by Xuguangxing's avatar Xuguangxing

Merge branch 'master' of http://git.quantgroup.cn/ui/quantum-block-h5 into feat/fix

parents 114e8beb d7b946f8
......@@ -24,5 +24,11 @@ export default {
appId: 'wx2f44c7fe7b08458d',
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/get-vcc-status`, {
areaType: 6
});
}
};
\ No newline at end of file
......@@ -3,11 +3,11 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https:';
const hostMap = {
apiHost: `${protocol}//localhost:7002`,
talosHost: `${protocol}//talos-test1.liangkebang.net`,
kdspHost: `${protocol}//kdsp-api-test1.liangkebang.net`,
talosHost: `${protocol}//talos-sc.liangkebang.net`,
kdspHost: `${protocol}//kdsp-api-sc.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}//mall-test1.liangkebang.net`,
xyqbH5Host: `${protocol}//mapi-test1.liangkebang.net`,
mallHost: `${protocol}//mall-sc.liangkebang.net`,
xyqbH5Host: `${protocol}//mapi-sc.liangkebang.net`,
test: true,
yxmTenantId: 560761,
appIdMap: {
......
......@@ -2,19 +2,40 @@ import { Component, Prop, Vue, Mixins } from 'vue-property-decorator';
import { Action, Mutation, State, Getter } from 'vuex-class';
import TransformStyleMixin from '@/page/mixins/transformStyle.mixin';
import SaMixin from '@/page/mixins/sa.mixin';
import { resizeDiv } from '@/service/utils.service';
// import { resizeDiv } from '@/service/utils.service';
import { locationHrefPatchDelay, getTokenFromApp } from '@qg/citrus-ui/src/helper/service/utils';
import saTrackMixins from '@qg/citrus-ui/src/helper/mixins/saTrack.mixins';
@Component({ name: 'FreedomContainer' })
export default class FreedomContainer extends Mixins(TransformStyleMixin, SaMixin) {
export default class FreedomContainer extends Mixins(TransformStyleMixin, SaMixin, saTrackMixins) {
@Getter('pageData') pageData;
@State(state => state.activity.curChildIndex) curChildIndex;
@Mutation('UPDATE_PAGE_INFO') updatePageInfo;
@Prop({type: Object, default: () => ({ child: [] })}) childItem;
@Prop({type: Object, default: () => ({})}) saInfo;
@Prop(String) link;
@Prop(String) backgroundImage;
clickEvent() {
console.log(this.childItem);
let needLogin = false;
try {
needLogin = this.childItem.props.needLogin;
} catch (err) {
console.log(err);
}
if (needLogin) {
getTokenFromApp().then(hasLogin => {
if (hasLogin) {
locationHrefPatchDelay(this.link);
}
});
} else {
console.log(this.link);
locationHrefPatchDelay(this.link);
}
}
mounted() {
// 根据背景图设置元素高度
// const index = this.pageData?.elements?.findIndex(v => v.point?.responsive);
......
<template>
<div class="freedom" v-track="{ link }">
<div class="freedom" v-track.banClick="{link}" @click="clickEvent">
<div class="freedom-body">
<component :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :is="item.name" :key="index" :sa-info="getSaInfo(item)" v-bind="item.props"></component>
</div>
......
......@@ -19,6 +19,7 @@ import { isWxMp, isApp } from '@/service/utils.service';
import Bridge from '@qg/js-bridge';
import MpBridge from '@qg/citrus-ui/src/helper/service/mp';
import navigatorApi from '@/api/navigator.api';
import editorApi from '@/api/editor.api';
@Component({ components: { FreedomContainer, GridLayout, GridItem, PageBottomTip, BackTop, EmptyState }, name: 'Activity'})
export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyleMixin, SaMixin, DisableTouchMixin) {
......@@ -28,6 +29,7 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
@State(state => state.activity.pageInfo.appLoginState) appLoginState;
@State(state => state.activity.pageInfo.tenantId) tenantId;
@State(state => state.activity.gridLayout.rowHeight) rowHeight;
@Mutation('SET_PAGE_ELEMENTS') setPageElement;
@Mutation('UPDATE_APP_LOGIN_STATE') updateAppLoginState;
......@@ -109,9 +111,6 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
}
}
mounted() {
// console.log(this.$route, 'navIndex');
// const { index } = this.$route.query();
// console.log(this.navigatorConfig, 999);
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');
}
......@@ -141,16 +140,27 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
}
this.layoutReadyEvent();
}
async created() {
const [res, ] = await editorApi.getFinanceSetting();
console.log(res);
if (res && res.showFlag === 0) {
this.pageData.elements = this.pageData.elements.filter(v => v.name !== 'freedom-container' || !v.props.isFinance);
}
}
async getNavigatorConfig(navId, index) {
// 获取导航配置
const [res] = await navigatorApi.getDetailById(navId);
this.navigatorConfig = res;
this.navIndex = index;
// console.log(res, 'a123');
}
async fetchApi(options) {
const { store, route } = options;
const { pageId } = route.params;
try {
await store.dispatch('getFinanceSetting');
} catch (err) {
console.log(err);
}
return store.dispatch('getPageDate', { pageId });
}
updateShopCartCount() {
......
......@@ -3,14 +3,17 @@
<div class="activity" :class="{hasBottomNav: navigatorConfig}" :style="transformStyle(pageData.commonStyle)">
<template v-if="!noPageData && tenantIdCorrect">
<div class="layout">
<div :style="transformStyle(item.commonStyle, item.point, item.name)" v-for="(item, index) in pageData.elements"
:key="fixGridKey(item)"
:id="`item_${item.id}`"
@click="dot(item.title)"
@touchend="disTouch"
>
<template v-for="(item, index) in pageData.elements">
<div :style="transformStyle(item.commonStyle, item.point, item.name)"
:key="fixGridKey(item)"
:id="`item_${item.id}`"
@click="dot(item.title)"
@touchend="disTouch"
>
<component :data-index="index" :id="item.id" :containerIndex="index" :component-data="item" :childItem="item" :is="item.name" :sa-info="getSaInfo(item)" v-bind="item.props"></component>
</div>
</template>
<div
v-if="pageData.props.showPageBottomTip"
:id="bottomInfo.i + pageData.elements.length"
......
{
"api": {
"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",
"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-undefined.liangkebang.net/#",
"mallHost": "https://mall-undefined.liangkebang.net",
"xyqbH5Host": "https://mapi-undefined.liangkebang.net",
"h5ShopHost": "https://tenet-yxm.liangkebang.net/#",
"mallHost": "https://mall-yxm.liangkebang.net",
"xyqbH5Host": "https://mapi-yxm.liangkebang.net",
"yxmTenantId": 560761,
"appIdMap": {
"560761": "wxe16bf9293671506c",
......@@ -18,8 +18,8 @@
}
},
"redis": {
"port": "undefined",
"host": "undefined",
"port": "30835",
"host": "172.16.4.6",
"password": "",
"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"}
\ No newline at end of file
{"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
......@@ -8,7 +8,7 @@
"test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1",
"stop": "egg-scripts stop",
"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",
"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",
......
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