Commit 913d5343 authored by beisir's avatar beisir

feat:样式修改

parent aa37e415
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
</div> </div>
<net-error /> <net-error />
<goods-share ref="gdShare" /> <goods-share ref="gdShare" />
<div v-if="groupLoading" class="group-list-loading">
<!-- <img src="@/assets/images/group-list.png" /> -->
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -38,6 +41,7 @@ export default { ...@@ -38,6 +41,7 @@ export default {
header: state => state.pay.header, header: state => state.pay.header,
loading: state => state.pay.loading, loading: state => state.pay.loading,
loadingPic: state => state.pay.loadingPic, loadingPic: state => state.pay.loadingPic,
groupLoading: state => state.pay.groupLoading,
isPrimordialBrowser: state => state.pay.isPrimordialBrowser, isPrimordialBrowser: state => state.pay.isPrimordialBrowser,
isWeixinBrowser: state => state.pay.isWeixinBrowser isWeixinBrowser: state => state.pay.isWeixinBrowser
}) })
...@@ -98,4 +102,14 @@ export default { ...@@ -98,4 +102,14 @@ export default {
} }
} }
} }
.group-list-loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url(~@/assets/images/group-list.png) no-repeat center;
background-size: 100%;
z-index: 10;
}
</style> </style>
src/assets/images/share-icon.png

1.63 KB | W: | H:

src/assets/images/share-icon.png

2.34 KB | W: | H:

src/assets/images/share-icon.png
src/assets/images/share-icon.png
src/assets/images/share-icon.png
src/assets/images/share-icon.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -48,8 +48,14 @@ export default { ...@@ -48,8 +48,14 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.cr-count-down {
display: flex;
align-items: center;
justify-content: center;
}
.colon { .colon {
display: inline-block; display: inline-block;
line-height: 18px;
margin: 0 @padding-unit; margin: 0 @padding-unit;
color: @red-dark; color: @red-dark;
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<div v-if="isLoop" class="avator_right avator-swiper_item"> <div v-if="isLoop" class="avator_right avator-swiper_item">
<img :src="rightImgPath" /> <img :src="rightImgPath" />
</div> </div>
<span class="avator-swiper-bg" :style="{ backgroundColor: bgColor }">&nbsp;</span>
</div> </div>
</template> </template>
<script> <script>
...@@ -29,6 +30,11 @@ export default { ...@@ -29,6 +30,11 @@ export default {
swiperSlide swiperSlide
}, },
props: { props: {
bgColor: {
required: true,
type: String,
default: ''
},
avatorData: { avatorData: {
type: Array, type: Array,
default() { default() {
...@@ -41,18 +47,20 @@ export default { ...@@ -41,18 +47,20 @@ export default {
const isLoop = vm.avatorData.length < 7 ? false : true; const isLoop = vm.avatorData.length < 7 ? false : true;
const autoplay = isLoop ? { delay: 1500, reverseDirection: true } : false; const autoplay = isLoop ? { delay: 1500, reverseDirection: true } : false;
return { return {
timer: null,
isLoop, isLoop,
isAnimate: false, isAnimate: false,
leftImgPath: '', leftImgPath: '',
rightImgPath: '', rightImgPath: '',
avatorItem: null, avatorItem: null,
swiperOptions: { swiperOptions: {
loop: true, loop: isLoop,
initialSlide: 0, initialSlide: 0,
slidesPerView: 7, slidesPerView: 7,
spaceBetween: 6, // spaceBetween: 8,
speed: 600, speed: 600,
centeredSlides: true, centeredSlides: true,
centeredSlidesBounds: true,
allowTouchMove: false, allowTouchMove: false,
autoplay, autoplay,
on: { on: {
...@@ -69,10 +77,11 @@ export default { ...@@ -69,10 +77,11 @@ export default {
vm.leftImgPath = slideLeft.data('src'); vm.leftImgPath = slideLeft.data('src');
slideLeft.addClass('ani-opt'); slideLeft.addClass('ani-opt');
slideRight.addClass('ani-opt'); slideRight.addClass('ani-opt');
const timer = setTimeout(() => { clearTimeout(vm.timer);
vm.timer = setTimeout(() => {
vm.$emit('animation-event-end', vm.avatorItem); vm.$emit('animation-event-end', vm.avatorItem);
clearTimeout(timer); clearTimeout(vm.timer);
}, 600); }, 800);
}, },
transitionEnd: function() { transitionEnd: function() {
vm.isAnimate = false; vm.isAnimate = false;
...@@ -96,6 +105,9 @@ export default { ...@@ -96,6 +105,9 @@ export default {
this.$emit('animation-event-end', { src: fristItem.avatar, name: fristItem.name }); this.$emit('animation-event-end', { src: fristItem.avatar, name: fristItem.name });
} }
}, },
destroyed() {
clearTimeout(this.timer);
},
methods: { methods: {
getAvatorItem(ele) { getAvatorItem(ele) {
return { return {
...@@ -109,16 +121,16 @@ export default { ...@@ -109,16 +121,16 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
@keyframes leftToRight { @keyframes leftToRight {
from { from {
transform: scale(0.3, 0.3); transform: scale(0.3);
opacity: 0; opacity: 0;
} }
to { to {
transform: scale(1, 1); transform: scale(1);
opacity: 1; opacity: 1;
} }
} }
.anileft { .anileft {
transform-origin: center; transform-origin: right;
animation: leftToRight 0.6s linear; animation: leftToRight 0.6s linear;
} }
...@@ -131,24 +143,35 @@ export default { ...@@ -131,24 +143,35 @@ export default {
top: 0px; top: 0px;
} }
.avator_right { .avator_right {
right: 2px; right: 8px;
} }
.avator_left { .avator_left {
left: 0px; left: 0px;
} }
.avator-swiper-bg {
width: 4px;
height: 24px;
position: absolute;
top: 0;
right: -2px;
background-color: #000;
z-index: 2;
}
.avator-swiper { .avator-swiper {
width: 100%;
margin: 0 auto !important;
position: relative; position: relative;
width: 100%;
height: 24px;
&_container { &_container {
transition-timing-function: linear; transition-timing-function: linear;
} }
&_item { &_item {
height: 24px; height: 24px;
width: 24px; width: 24px;
box-sizing: border-box;
transition: transform 0 0.2s linear; transition: transform 0 0.2s linear;
box-sizing: border-box;
img { img {
display: block;
height: 24px; height: 24px;
width: 24px; width: 24px;
border-radius: 50%; border-radius: 50%;
......
...@@ -15,7 +15,8 @@ module.exports = [ ...@@ -15,7 +15,8 @@ module.exports = [
path: '/groupBuy/list', path: '/groupBuy/list',
name: 'groupBuyList', name: 'groupBuyList',
component: () => import('../views/goodsList/index.vue'), component: () => import('../views/goodsList/index.vue'),
meta: { title: '0元购大牌', keepLive: true } // , keepLive: true
meta: { title: '0元购大牌' }
}, },
{ {
path: '/orderList/:status', path: '/orderList/:status',
......
...@@ -6,6 +6,7 @@ const state = { ...@@ -6,6 +6,7 @@ const state = {
title: '支付中心', title: '支付中心',
loading: false, loading: false,
loadingPic: false, loadingPic: false,
groupLoading: false,
meta: {}, meta: {},
keepAliveMap: [], keepAliveMap: [],
isPrimordialBrowser: false, // 是否是原生浏览器 isPrimordialBrowser: false, // 是否是原生浏览器
...@@ -50,6 +51,9 @@ const actions = { ...@@ -50,6 +51,9 @@ const actions = {
}, },
save_openlink_host({ commit }, host) { save_openlink_host({ commit }, host) {
commit(types.SAVE_LINK_HOST, host); commit(types.SAVE_LINK_HOST, host);
},
change_group_loading({ commit }, loading) {
commit(types.GGROUP_LOADING, loading);
} }
}; };
...@@ -128,6 +132,9 @@ const mutations = { ...@@ -128,6 +132,9 @@ const mutations = {
}, },
[types.CHANGE_LOADING_PIC](state, loading) { [types.CHANGE_LOADING_PIC](state, loading) {
state.loadingPic = loading; state.loadingPic = loading;
},
[types.GGROUP_LOADING](state, loading) {
state.groupLoading = loading;
} }
}; };
......
...@@ -10,3 +10,4 @@ export const DEL_KEEP_ALIVE = 'DEL_KEEP_ALIVE'; ...@@ -10,3 +10,4 @@ export const DEL_KEEP_ALIVE = 'DEL_KEEP_ALIVE';
export const CLEAR_KEEP_ALIVE = 'CLEAR_KEEP_ALIVE'; export const CLEAR_KEEP_ALIVE = 'CLEAR_KEEP_ALIVE';
export const GOODS_AVATOR_INFO = 'GOODS_AVATOR_INFO'; export const GOODS_AVATOR_INFO = 'GOODS_AVATOR_INFO';
export const SAVE_LINK_HOST = 'SAVE_LINK_HOST'; export const SAVE_LINK_HOST = 'SAVE_LINK_HOST';
export const GGROUP_LOADING = 'GGROUP_LOADING';
...@@ -22,15 +22,11 @@ ...@@ -22,15 +22,11 @@
<!-- 已抢光 --> <!-- 已抢光 -->
<!-- 未开始 --> <!-- 未开始 -->
<!-- 已结束 --> <!-- 已结束 -->
<cr-button <div class="group-item-button">
size="small" <cr-button size="small" shape="circle" type="primary" :class="btnByStatus.cls">{{
shape="circle" btnByStatus.t
type="primary" }}</cr-button>
:class="{ </div>
btnabled: btnByStatus.d
}"
>{{ btnByStatus.t }}</cr-button
>
</dd> </dd>
</dl> </dl>
</template> </template>
...@@ -64,22 +60,15 @@ export default { ...@@ -64,22 +60,15 @@ export default {
const { hasStop, hasStart } = this.topicCfg; const { hasStop, hasStart } = this.topicCfg;
const { goodsCount } = this.goodsItem; const { goodsCount } = this.goodsItem;
if (!hasStart) { if (!hasStart) {
return { t: '未开始', d: true, s: 0 }; return { t: '未开始', d: true, s: 0, cls: 'not-start' };
} }
if (hasStop) { if (hasStop) {
return { t: '已结束', d: true, s: 1 }; return { t: '已结束', d: true, s: 1, cls: 'btnabled' };
} }
if (goodsCount !== 0) { if (goodsCount !== 0) {
return { t: '立即开团', d: false, s: 2 }; return { t: '立即开团', d: false, s: 2, cls: '' };
} }
return { t: '已抢光', d: true, s: 3 }; return { t: '已抢光', d: true, s: 3, cls: 'btnabled' };
// return !hasStart
// ? { t: '未开始', d: true, s: 0 }
// : hasStop
// ? { t: '已结束', d: true, s: 1 }
// : goodsCount !== 0
// ? { t: '立即开团', d: false, s: 2 }
// : { t: '已抢光', d: true, s: 3 };
} }
}, },
methods: { methods: {
...@@ -227,21 +216,37 @@ export default { ...@@ -227,21 +216,37 @@ export default {
color: #999999; color: #999999;
font-size: @font-size-12; font-size: @font-size-12;
} }
&-button {
position: absolute;
bottom: 12px;
right: 0;
}
.cr-button { .cr-button {
position: relative;
width: 90px; width: 90px;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
border-radius: 15px; border-radius: 15px;
position: absolute;
bottom: 12px;
right: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&::after {
content: '';
position: absolute;
width: 110%;
height: 110%;
left: 0;
top: 0;
margin-left: -2%;
margin-top: -2%;
z-index: 1;
background-color: rgba(255, 255, 255, 0.6);
}
} }
.btnabled { .btnabled {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.7; opacity: 0.6;
} }
&.disabled { &.disabled {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
right: 12px; right: 12px;
bottom: 60px; bottom: 60px;
z-index: 1; z-index: 1;
background: #fff url(~@/assets/images/share.png) no-repeat center; background: #fff url(~@/assets/images/share-icon.png) no-repeat center;
background-size: 100%; background-size: 100%;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
...@@ -60,8 +60,11 @@ ...@@ -60,8 +60,11 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
&-label { &-label {
font-size: 12px;
color: #333333; color: #333333;
font-size: 12px;
display: block;
height: 18px;
line-height: 18px;
} }
} }
.cr-list { .cr-list {
...@@ -91,11 +94,11 @@ ...@@ -91,11 +94,11 @@
} }
&-ul { &-ul {
margin-left: 5px; // width: 216px;
flex: 1; width: 224px;
height: 24px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
overflow: hidden;
} }
&-image { &-image {
height: 23px; height: 23px;
...@@ -123,24 +126,5 @@ ...@@ -123,24 +126,5 @@
animation-fill-mode: forwards; animation-fill-mode: forwards;
} }
} }
.loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #fff;
z-index: 999;
font-size: 18px;
padding: 16px 12px 0;
text-align: center;
box-sizing: border-box;
@{deep} .cr-skeleton {
margin-bottom: 12px;
&__content {
width: 100% !important;
}
}
}
} }
} }
<template> <template>
<!-- 配置活动背景色 --> <!-- 配置活动背景色 -->
<div class="group" :style="{ backgroundColor: goodsTemp.bgcolor }"> <div class="group" :style="{ backgroundColor: goodsTemp.bgcolor }">
<!-- <cr-skeleton v-if="showLoading" class="loading" /> -->
<div v-if="!isShowShare" class="group-puzzle" @click="goToMyorder">我的拼团</div> <div v-if="!isShowShare" class="group-puzzle" @click="goToMyorder">我的拼团</div>
<!-- 配置头部动态信息 start --> <!-- 配置头部动态信息 start -->
<div class="group-top"> <div class="group-top">
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
<groupSwiper <groupSwiper
v-if="showLoops && goodsTemp.groupBuyUserInfoList.length" v-if="showLoops && goodsTemp.groupBuyUserInfoList.length"
ref="swipeRota" ref="swipeRota"
:bg-color="goodsTemp.bgcolor"
:avator-data="goodsTemp.groupBuyUserInfoList" :avator-data="goodsTemp.groupBuyUserInfoList"
@animation-event-start="animationEventStart" @animation-event-start="animationEventStart"
@animation-event-end="animationEventEnd" @animation-event-end="animationEventEnd"
...@@ -57,20 +59,9 @@ ...@@ -57,20 +59,9 @@
/> />
</cr-list> </cr-list>
</div> </div>
<div v-if="showLoading" class="loading">
<cr-skeleton title :row="5" />
<cr-skeleton title :row="5" />
<cr-skeleton title :row="5" />
<cr-skeleton title :row="5" />
</div>
<!-- 下方列表展示信息 end --> <!-- 下方列表展示信息 end -->
</div> </div>
<div v-if="!isShowShare" class="group-share" @click="openShareEvent"> <div v-if="!isShowShare" class="group-share" @click="openShareEvent">&nbsp;</div>
<!-- <dt class="group-share-icon">
<cr-image src="@/assets/images/share.png" />
</dt>
<dd class="group-share-text">分享</dd> -->
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -85,8 +76,8 @@ import localStorage from '@/service/localStorage.service'; ...@@ -85,8 +76,8 @@ import localStorage from '@/service/localStorage.service';
import goodsCheckMixin from '@/mixins/goodsCheck.mixin'; import goodsCheckMixin from '@/mixins/goodsCheck.mixin';
import { setAppTitleColor, EventBus } from '@/service/utils.service'; import { setAppTitleColor, EventBus } from '@/service/utils.service';
import { saTrackEvent } from '@/service/sa.service'; import { saTrackEvent } from '@/service/sa.service';
import { isNull } from '@/service/validation.service'; // import { isNull } from '@/service/validation.service';
let topicIndex; // let topicIndex;
export default { export default {
// eslint-disable-next-line vue/name-property-casing // eslint-disable-next-line vue/name-property-casing
name: 'groupBuyList', name: 'groupBuyList',
...@@ -140,14 +131,15 @@ export default { ...@@ -140,14 +131,15 @@ export default {
} }
}, },
created() { created() {
this.reload = true;
},
deactivated() {
this.showLoops = false;
},
activated() {
this.showLoops = true; this.showLoops = true;
this.reload = true;
}, },
// deactivated() {
// this.showLoops = false;
// },
// activated() {
// this.showLoops = true;
// },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
const { activityId } = to.query; const { activityId } = to.query;
if (!activityId || isNaN(activityId)) { if (!activityId || isNaN(activityId)) {
...@@ -157,17 +149,18 @@ export default { ...@@ -157,17 +149,18 @@ export default {
}); });
return; return;
} else { } else {
if (isNull(topicIndex)) { getActivityList(to.query, next);
getActivityList(to.query, next); // if (isNull(topicIndex)) {
} else { // getActivityList(to.query, next);
if (localStorage.get('activityId') !== +activityId) { // } else {
getActivityList(to.query, next); // if (localStorage.get('activityId') !== +activityId) {
return; // getActivityList(to.query, next);
} // return;
next(vm => { // }
store.commit('CHANGE_TITLE', vm.goodsTemp.title || '活动页'); // next(vm => {
}); // store.commit('CHANGE_TITLE', vm.goodsTemp.title || '活动页');
} // });
// }
} }
}, },
methods: { methods: {
...@@ -300,12 +293,13 @@ async function getActivityList(urlQuery, next) { ...@@ -300,12 +293,13 @@ async function getActivityList(urlQuery, next) {
if (typeof next === 'function') { if (typeof next === 'function') {
nextFns = next; nextFns = next;
} }
store.dispatch('change_group_loading', true);
const [result] = await groupBuyApi.getTemplateList(activityId); const [result] = await groupBuyApi.getTemplateList(activityId);
if (result?.templateInfo) { if (result?.templateInfo) {
let t = result.templateInfo; let t = result.templateInfo;
// 即将开始 // 即将开始
// t.startTime = '2021-09-29 20:00:00'; // t.startTime = '2021-10-01 20:00:00';
// t.endTime = '2021-09-30 20:02:00'; // t.endTime = '2021-10-02 20:02:00';
// 正在活动中 // 正在活动中
// t.startTime = '2021-09-23 00:00:00'; // t.startTime = '2021-09-23 00:00:00';
// t.endTime = '2021-09-25 00:00:00'; // t.endTime = '2021-09-25 00:00:00';
...@@ -324,7 +318,7 @@ async function getActivityList(urlQuery, next) { ...@@ -324,7 +318,7 @@ async function getActivityList(urlQuery, next) {
// store.dispatch('save_openlink_host', t.openLink); // store.dispatch('save_openlink_host', t.openLink);
store.commit('CHANGE_TITLE', t.title || '活动页'); store.commit('CHANGE_TITLE', t.title || '活动页');
nextFns(vm => { nextFns(vm => {
topicIndex = 0; // topicIndex = 0;
vm.activityId = activityId; vm.activityId = activityId;
vm.goodsTemp = t; vm.goodsTemp = t;
localStorage.set('activityId', activityId); localStorage.set('activityId', activityId);
...@@ -332,6 +326,7 @@ async function getActivityList(urlQuery, next) { ...@@ -332,6 +326,7 @@ async function getActivityList(urlQuery, next) {
vm.pageNo = 1; vm.pageNo = 1;
vm.getGoodsList(true); vm.getGoodsList(true);
vm.reload = false; vm.reload = false;
store.dispatch('change_group_loading', false);
}); });
} else { } else {
nextFns(vm => { nextFns(vm => {
......
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