Commit db75319e authored by 徐光星's avatar 徐光星

Merge branch 'feat/v1.8-batch-1' into 'master'

Feat/v1.8 batch 1

See merge request !96
parents b3a8cb90 1afb4387
import { Controller, Context } from 'egg';
import { off } from 'process';
export default class ActivityController extends Controller {
public async home(ctx: Context) {
......
......@@ -39,5 +39,8 @@ export default {
}, {
customHeader
});
}
},
getServerTime() {
return http.get(`${config.apiHost}/editor/getServerTime`);
},
};
\ 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-yxm.liangkebang.net`,
kdspHost: `${protocol}//kdsp-api-yxm.liangkebang.net`,
talosHost: `${protocol}//talos-ds.liangkebang.net`,
kdspHost: `${protocol}//kdsp-api-ds.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}//mall-yxm.liangkebang.net`,
xyqbH5Host: `${protocol}//mapi-yxm.liangkebang.net`,
mallHost: `${protocol}//mall-ds.liangkebang.net`,
xyqbH5Host: `${protocol}//mapi-ds.liangkebang.net`,
test: true,
yxmTenantId: 560761,
appIdMap: {
......
......@@ -158,7 +158,6 @@ export default {
},
initShareInfo() {
if (EASY_ENV_IS_NODE) return;
console.log(this.pageInfo, 'this.pageInfo')
let shareCoverImage = '';
try {
shareCoverImage = this.pageInfo.page.props.shareCoverImage;
......
<template>
<div class="invalidModal">
<cr-popup v-model="show" round :close-on-click-overlay="false">
<div class="content">
<img src="https://img.lkbang.net/activityInvalid.18ea3ddc.png" alt="">
<p class="title">活动已结束</p>
<p class="subtitle">请关注更多精彩活动</p>
<cr-button type="primary" shape="circle" @click="toOtherActivity">去看看其他活动</cr-button>
</div>
<!-- <cr-icon type="close" size="34px" color="#FFF" @click="close" /> -->
</cr-popup>
</div>
</template>
<script>
export default {
name: 'InvalidNotice',
props: {
value: Boolean,
},
data() {
return {
show: false,
}
},
methods: {
toOtherActivity() {
this.$emit('toOtherActivity')
}
},
watch: {
value(val) {
this.show = val;
}
},
}
</script>
<style lang="less" scoped>
@deep: ~'>>>';
.invalidModal{
/deep/ .cr-overlay{
z-index: 103;
}
}
.content{
width: 311px;
height: 360px;
background: #fff;
border-radius: 16px;
display: flex;
flex-direction: column;
align-items: center;
padding: 32px 0;
img{
display: block;
width: 162px;
}
.title{
font-size: 17px;
margin-top: 20px;
color:#333;
}
.subtitle{
margin: 12px auto 26px;
font-size: 12px;
color:#999;
}
button{
width: 236px;
}
}
.cr-popup {
z-index: 104;
background-color: transparent;
border-radius: 0;
}
.cr-icon {
display: block;
margin: 20px auto 0;
}
</style>
\ No newline at end of file
......@@ -2,6 +2,7 @@ import { Vue, Component, Watch, Provide, Mixins } from 'vue-property-decorator';
import { Getter, State, Mutation } from 'vuex-class';
import FreedomContainer from '../../component/FreedomContainer/index.vue';
import BackTop from '../../component/BackTop/index.vue';
import InvalidNotice from '../../component/invalidNotice/index.vue';
import EmptyState from '../../component/EmptyState/index.vue';
import PageBottomTip from '../../component/PageBottomTip/index.vue';
import GridLayout from '../../component/VueGridLayout/GridLayout.vue';
......@@ -20,10 +21,11 @@ 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'})
@Component({ components: { FreedomContainer, GridLayout, GridItem, PageBottomTip, BackTop, InvalidNotice, EmptyState }, name: 'Activity'})
export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyleMixin, SaMixin, DisableTouchMixin) {
@Getter('pageData') pageData;
@State(state => state.activity.pageInfo) pageInfo;
@State(state => state.activity.pageInfo.pageName) pageName;
@State(state => state.activity.noPageData) noPageData;
@State(state => state.activity.pageInfo.appLoginState) appLoginState;
......@@ -35,6 +37,7 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
@Provide() editor = this;
isEditor: boolean = false;
pageInvalid: boolean = false;
bottomInfo: object = {
x: 0,
y: 0,
......@@ -142,10 +145,59 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
}
async created() {
const [res, ] = await editorApi.getFinanceSetting();
console.log(res);
const [serverTime, ] = await editorApi.getServerTime();
console.log(res, 'finance result');
console.log(serverTime, 'time');
if (res && res.showFlag === 0) {
this.pageData.elements = this.pageData.elements.filter(v => v.name !== 'freedom-container' || !v.props.isFinance);
}
this.comparePageTime(serverTime); // 验证活动是否在设定的有效期范围内
}
comparePageTime(serverTime) {
const { validStartTime, validEndTime } = this.pageInfo;
// 获取服务器端当前时间,用于与页面有效期做对比
if (validStartTime && validEndTime) {
// 当设置了页面的有效时间起止,用当前服务器返回的时间作对比,判断页面是否在有效期内
// const startTime = new Date(validStartTime).getTime();
const endTime = new Date(validEndTime).getTime();
if (serverTime > endTime) {
this.pageInvalid = true;
}
}
}
toOtherActivity() {
const { redirectUrl } = this.pageInfo;
let nativeBridge;
let mpBridge;
if (isApp) {
nativeBridge = new Bridge();
nativeBridge.openNewUrl({
data: {
// 需要打开的新链接
newUrl: redirectUrl ? redirectUrl : home.app,
},
});
} else if (isWxMp) {
mpBridge = new MpBridge();
const jumpConfig: any = {
// 需要打开的新链接
newUrl: redirectUrl ? redirectUrl : home.wxmp,
};
if (!redirectUrl) { jumpConfig.type = 'switchTab'; }
mpBridge.openNewUrl(jumpConfig);
} else {
if (!redirectUrl) { return; }
let url = redirectUrl;
const token = localStorage.get('vccToken') || '';
const { vccChannel, fromHost } = this.$route.query;
if (!isApp && !isWxMp) {
if (vccChannel) { url = this.addOrEditUrlParams(url, 'vccChannel', vccChannel); }
if (fromHost) { url = this.addOrEditUrlParams(url, 'fromHost', fromHost); }
}
if (token) { url = this.addOrEditUrlParams(url, 'vccToken', token); }
window.location.href = url;
return;
}
}
async getNavigatorConfig(navId, index) {
// 获取导航配置
......@@ -427,7 +479,3 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
// if (fromHost) { url = this.addOrEditUrlParams(url, 'fromHost', fromHost); }
// window.location.href = url;
// }
}
}
}
......@@ -23,6 +23,7 @@
</div>
</div>
<back-top v-if="showBackTop" :show-back-top="showBackTop" ref="backTop" />
<invalid-notice v-model="pageInvalid" @toOtherActivity="toOtherActivity"/>
</template>
<empty-state v-else />
</div>
......
......@@ -14,6 +14,7 @@ import Loading from '@qg/cherry-ui/src/loading';
import Text from '@qg/cherry-ui/src/text';
import Tag from '@qg/cherry-ui/src/tag';
import Popover from '@qg/cherry-ui/src/popover';
import Popup from '@qg/cherry-ui/src/popup';
import Icon from '@qg/cherry-ui/src/icon';
import Empty from '@qg/cherry-ui/src/empty';
import NoticeBar from '@qg/cherry-ui/src/notice-bar';
......@@ -34,7 +35,7 @@ Vue.use(Tag);
Vue.use(Popover);
Vue.use(Icon);
Vue.use(Empty);
Vue.use(Popup);
Vue.use(citrusUi);
Vue.prototype.$notify = Notify;
......
{
"api": {
"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",
"apiHost": "https://quantum-blocks-toc.liangkebang.net",
"h5Host": "https://quantum-h5-toc.liangkebang.net",
"opapiHost": "https://opapi-toc.liangkebang.net",
"passportHost": "https://passportapi-toc.liangkebang.net",
"talosHost": "https://talos-toc.liangkebang.net",
"kdspHost": "https://kdsp-api-toc.liangkebang.net",
"loginUrl": "",
"newApolloFlag": true,
"h5ShopHost": "https://tenet-yxm.liangkebang.net/#",
"mallHost": "https://mall-yxm.liangkebang.net",
"xyqbH5Host": "https://mapi-yxm.liangkebang.net",
"h5ShopHost": "https://tenet-toc.liangkebang.net/#",
"mallHost": "https://mall-toc.liangkebang.net",
"xyqbH5Host": "https://mapi-toc.liangkebang.net",
"yxmTenantId": 560761,
"appIdMap": {
"560761": "wxe16bf9293671506c",
......@@ -18,7 +18,7 @@
}
},
"redis": {
"port": "30835",
"port": "30895",
"host": "172.16.4.89",
"password": "",
"db": 0
......
{"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
{"apiHost":"https://quantum-blocks-toc.liangkebang.net","h5Host":"https://quantum-h5-toc.liangkebang.net","opapiHost":"https://opapi-toc.liangkebang.net","passportHost":"https://passportapi-toc.liangkebang.net","talosHost":"https://talos-toc.liangkebang.net","kdspHost":"https://kdsp-api-toc.liangkebang.net","loginUrl":"","newApolloFlag":true,"h5ShopHost":"https://tenet-toc.liangkebang.net/#","mallHost":"https://mall-toc.liangkebang.net","xyqbH5Host":"https://mapi-toc.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
......@@ -2367,9 +2367,9 @@
}
},
"@qg/citrus-ui": {
"version": "0.3.55",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.55.tgz",
"integrity": "sha512-c/TnAe/oTURSk7jR+k9Ql/WFwO2/KmZ9pD9KwG2q/m2iWaecAf73u5lyBhtGyyqnJv0V/nyGtfYsC+/HiFcgHw==",
"version": "0.3.56",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.56.tgz",
"integrity": "sha512-BHwB5HNBOsP3z8qqLOGEceW+2ps0cfPYehZ+me1Y1lTcC9ap+8GZDExzO7FsV1MlYU2Y/E1R3+4ORFSs0PnE0g==",
"requires": {
"@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9",
......@@ -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=yxm npm run apollo && egg-bin dev -r egg-ts-helper/register",
"dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=toc 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",
......@@ -26,7 +26,7 @@
"@better-scroll/core": "^2.0.5",
"@qg/apollo-nodejs": "^2.1.2",
"@qg/cherry-ui": "2.23.10",
"@qg/citrus-ui": "0.3.55",
"@qg/citrus-ui": "0.3.56",
"@qg/js-bridge": "^1.1.12",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"cos-nodejs-sdk-v5": "^2.9.12",
......
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