Commit 4f7af0b1 authored by beisir's avatar beisir

feat:生成海报loading

parent 6c4a8e2c
......@@ -8,7 +8,7 @@
</keep-alive>
<router-view v-if="!$route.meta.keepLive" />
</div>
<div v-if="loading" class="loading-container">
<div v-if="loading || loadingPic" class="loading-container">
<cr-loading class="loading" size="24px">加载中...</cr-loading>
</div>
<net-error />
......@@ -37,6 +37,7 @@ export default {
title: state => state.pay.title,
header: state => state.pay.header,
loading: state => state.pay.loading,
loadingPic: state => state.pay.loadingPic,
isPrimordialBrowser: state => state.pay.isPrimordialBrowser,
isWeixinBrowser: state => state.pay.isWeixinBrowser
})
......
......@@ -175,6 +175,7 @@ export default {
return n;
},
async createAndUploadPic(sharePicData) {
this.$store.dispatch('change_loading_pic', true);
this.sharePicData = sharePicData;
const endTimeYMD = sharePicData.endTime ? sharePicData.endTime.split(' ')[0] : '';
const endTimeHMS = sharePicData.endTime ? sharePicData.endTime.split(' ')[1] : '';
......@@ -204,12 +205,13 @@ export default {
const observer = {
error(err) {
console.log(err);
_this.$store.dispatch('change_loading', false);
_this.$store.dispatch('change_loading_pic', false);
},
complete({ hash }) {
const fileLink = config.qiniuHost + hash;
console.log('pic create success', fileLink);
_this.$emit('outputPicUrl', fileLink);
_this.$store.dispatch('change_loading_pic', false);
}
};
observable.subscribe(observer);
......
......@@ -5,6 +5,7 @@ const state = {
header: true,
title: '支付中心',
loading: false,
loadingPic: false,
meta: {},
keepAliveMap: [],
isPrimordialBrowser: false, // 是否是原生浏览器
......@@ -32,6 +33,9 @@ const actions = {
change_loading({ commit }, loading) {
commit(types.CHANGE_LOADING, loading);
},
change_loading_pic({ commit }, loading) {
commit(types.CHANGE_LOADING_PIC, loading);
},
add_keep_alive({ commit }, name) {
commit(types.ADD_KEEP_ALIVE, name);
},
......@@ -121,6 +125,9 @@ const mutations = {
},
[types.SAVE_LINK_HOST](state, host) {
state.openLink = host;
},
[types.CHANGE_LOADING_PIC](state, loading) {
state.loadingPic = loading;
}
};
......
......@@ -2,6 +2,7 @@ export const CHANGE_HEADER = 'CHANGE_HEADER';
export const CHANGE_TITLE = 'CHANGE_TITLE';
export const CHANGE_META = 'CHANGE_META';
export const CHANGE_LOADING = 'CHANGE_LOADING';
export const CHANGE_LOADING_PIC = 'CHANGE_LOADING_PIC';
export const CHANGE_SHOW_MINI_APP_GUIDE = 'CHANGE_SHOW_MINI_APP_GUIDE';
export const CHANGE_IS_WEIXIN_BROWSER = 'CHANGE_IS_WEIXIN_BROWSER';
export const ADD_KEEP_ALIVE = 'ADD_KEEP_ALIVE';
......
<template>
<!-- 配置活动背景色 -->
<div class="group" :style="{ backgroundColor: goodsTemp.bgcolor }">
<!-- v-if="!isShowShare" -->
<div class="group-puzzle" @click="goToMyorder">我的拼团</div>
<div v-if="!isShowShare" class="group-puzzle" @click="goToMyorder">我的拼团</div>
<!-- 配置头部动态信息 start -->
<div class="group-top">
<!-- 动态活动背景图 -->
......
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