Commit a544abb0 authored by 郭志伟's avatar 郭志伟

feat(refresh): 刷新功能

parent 90c3fa3c
...@@ -2,20 +2,20 @@ import { Controller, Context } from 'egg'; ...@@ -2,20 +2,20 @@ import { Controller, Context } from 'egg';
export default class ActivityController extends Controller { export default class ActivityController extends Controller {
public async home(ctx: Context) { public async home(ctx: Context) {
const redisKey = `quantum-blocks:page:${ctx.params.id}`; // const redisKey = `quantum-blocks:page:${ctx.params.id}`;
let body = await ctx.service.redis.get(redisKey); // let body = await ctx.service.redis.get(redisKey);
if (body) { // if (body) {
ctx.logger.info('请求redis成功 key: %j', redisKey); // ctx.logger.info('请求redis成功 key: %j', redisKey);
} // }
if (!body) { // if (!body) {
let apollo = {}; // let apollo = {};
if (process.env.NODE_ENV === 'production' && process.env.EGG_SERVER_ENV === 'sit') { // if (process.env.NODE_ENV === 'production' && process.env.EGG_SERVER_ENV === 'sit') {
apollo = ctx.app.config.apollo || {}; // apollo = ctx.app.config.apollo || {};
} // }
body = await ctx.renderView('activity.js', { url: ctx.url, apollo }); // body = await ctx.renderView('activity.js', { url: ctx.url, apollo });
await ctx.service.redis.set(redisKey, body); // await ctx.service.redis.set(redisKey, body);
} // }
ctx.body = body; // ctx.body = body;
// ctx.body = await ctx.renderView('activity.js', { url: ctx.url }); ctx.body = await ctx.renderView('activity.js', { url: ctx.url });
} }
} }
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
import Bridge from '@qg/js-bridge'; import Bridge from '@qg/js-bridge';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { isApp, isWxMp } from '@/service/utils.service'; import { isApp, isWxMp } from '@/service/utils.service';
import { registeredEvents } from '@/service/sa.service';
export default { export default {
name: 'BackTop', name: 'BackTop',
props: { props: {
...@@ -48,6 +49,11 @@ export default { ...@@ -48,6 +49,11 @@ export default {
}, },
methods: { methods: {
handleBackTopClick(e) { handleBackTopClick(e) {
registeredEvents('PD_WUXIEC_H5ActivityPageSuspendedBtnClick', {
activity_id: this.pageInfo.uuid,
jump_url: e.url,
navigation_name: e.name,
});
if (e && e.persets === '分享') { if (e && e.persets === '分享') {
if (this.tipTimer) { if (this.tipTimer) {
clearTimeout(this.tipTimer); clearTimeout(this.tipTimer);
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
left: 0; left: 0;
right: auto; right: auto;
} }
.vue-grid-item.no-transforms {
transform: none !important;
z-index: 3 !important;
}
.vue-grid-item.cssTransforms.render-rtl { .vue-grid-item.cssTransforms.render-rtl {
left: auto; left: auto;
...@@ -133,6 +137,9 @@ ...@@ -133,6 +137,9 @@
required: false, required: false,
default: null default: null
}, },
noTransforms: {
type: Boolean
},
/*useCssTransforms: { /*useCssTransforms: {
type: Boolean, type: Boolean,
required: true required: true
...@@ -412,7 +419,8 @@ ...@@ -412,7 +419,8 @@
'cssTransforms' : this.useCssTransforms, 'cssTransforms' : this.useCssTransforms,
'render-rtl' : this.renderRtl, 'render-rtl' : this.renderRtl,
'disable-userselect': this.isDragging, 'disable-userselect': this.isDragging,
'no-touch': this.isAndroid && this.draggableOrResizableAndNotStatic 'no-touch': this.isAndroid && this.draggableOrResizableAndNotStatic,
'no-transforms': this.noTransforms
} }
}, },
resizableAndNotStatic(){ resizableAndNotStatic(){
......
...@@ -41,7 +41,7 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) { ...@@ -41,7 +41,7 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
@Watch('pageData', { deep: true }) @Watch('pageData', { deep: true })
onPageDataChange(val) { onPageDataChange(val) {
const lastGridItem = val.elements[val.elements.length - 1]; const lastGridItem = val.elements[val.elements.length - 1];
const lastGridItemPoint = lastGridItem.point; const lastGridItemPoint = lastGridItem?.point;
if (lastGridItemPoint && lastGridItemPoint.w) { if (lastGridItemPoint && lastGridItemPoint.w) {
this.bottomInfo = { this.bottomInfo = {
x: 0, x: 0,
...@@ -73,7 +73,6 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) { ...@@ -73,7 +73,6 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
this.modifyPoints(); this.modifyPoints();
} }
} }
mounted() { mounted() {
this.targetEle = document.querySelector('body'); this.targetEle = document.querySelector('body');
this.showBackTop = true; this.showBackTop = true;
...@@ -113,7 +112,13 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) { ...@@ -113,7 +112,13 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
} }
}); });
} }
getPageElements(ids = []) {
return ids.length === 0 ? this.pageData.elements : ids.map(item => {
const targetEl =
this.pageData.elements.find(it => it.id === (item.componentId || item));
return targetEl;
});
}
layoutUpdatedEvent() { layoutUpdatedEvent() {
console.log('layoutUpdatedEvent'); console.log('layoutUpdatedEvent');
// 高度更新时重新计算导航组件样式 // 高度更新时重新计算导航组件样式
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
:h="item.point.h" :h="item.point.h"
:i="item.point.i" :i="item.point.i"
:key="item.point.i" :key="item.point.i"
:no-transforms="item.name === 'cs-floor-nav'"
@click.native="dot(item.title)" @click.native="dot(item.title)"
> >
<component :data-index="index" :id="item.id" :containerIndex="index" :childItem="item" :is="item.name" :key="item.id" :sa-info="getSaInfo(item)" v-bind="item.props"></component> <component :data-index="index" :id="item.id" :containerIndex="index" :childItem="item" :is="item.name" :key="item.id" :sa-info="getSaInfo(item)" v-bind="item.props"></component>
......
...@@ -6,8 +6,7 @@ import { Mutation } from 'vuex-class'; ...@@ -6,8 +6,7 @@ import { Mutation } from 'vuex-class';
export default class TransformStyleMixin extends Vue { export default class TransformStyleMixin extends Vue {
@Mutation('SET_ELEMENT_POINT') setElementPoint; @Mutation('SET_ELEMENT_POINT') setElementPoint;
transformStyle(styleObj, element) { transformStyle(styleObj, element = {}) {
// console.log('transformStyle', styleObj, element);
const style = { const style = {
backgroundRepeat: 'no-repeat', backgroundRepeat: 'no-repeat',
backgroundSize: 'cover' backgroundSize: 'cover'
......
...@@ -1658,9 +1658,9 @@ ...@@ -1658,9 +1658,9 @@
} }
}, },
"@qg/citrus-ui": { "@qg/citrus-ui": {
"version": "0.2.24", "version": "0.3.0-beta3",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.2.24.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.0-beta3.tgz",
"integrity": "sha512-gKcZu7HzieRmA63GVfXzy/yoiIrdq3ryr/Y+HlqQnGeJXIdE+baxqwAk2vVeQ6n0x4XkT9GElTKkgd6R6MnIng==", "integrity": "sha512-5SqxTrs2pq21Te11tFr46K7qQScR1xavWrjLHESMR4ZxlXxObfH0Zy/G2Y1Yfs5uf8iiA/h2eBg2T3mYGTQt2w==",
"requires": { "requires": {
"@better-scroll/core": "^2.1.1", "@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.21.1", "@qg/cherry-ui": "^2.21.1",
......
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