feat:v1.4前端更新
This commit is contained in:
140
app/components/homeIndex/articleList.vue
Normal file
140
app/components/homeIndex/articleList.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<!-- 文章列表 -->
|
||||
<view>
|
||||
<view class="articleList" :style="[boxStyle]" v-if="articleList.length">
|
||||
<view v-if="listStyle">
|
||||
<navigator :url='"/pages/news/news_details/index?id="+item.id' hover-class='none' :style="[itemStyle]"
|
||||
v-for="(item,index) in articleList" :key='index'
|
||||
class="item acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.imageInput" :radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line2" :style="[titleColor]">{{item.title}}</view>
|
||||
<view class="time" :style="[timeColor]">{{item.updateTime}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view v-else>
|
||||
<navigator :url='"/pages/news/news_details/index?id="+item.id' hover-class='none'
|
||||
:style="[itemStyle]" v-for="(item,index) in articleList" :key='index'
|
||||
class="item acea-row row-between-wrapper">
|
||||
<view class="text">
|
||||
<view class="name line2" :style="[titleColor]">{{item.title}}</view>
|
||||
<view class="time" :style="[timeColor]">{{item.updateTime}}</view>
|
||||
</view>
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.imageInput" :radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
export default {
|
||||
name: 'homeArticle',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
components: {
|
||||
easyLoadimage
|
||||
},
|
||||
computed: {
|
||||
//布局样式
|
||||
listStyle() {
|
||||
return this.dataConfig.layoutConfig.tabVal === 0
|
||||
},
|
||||
//文章分类
|
||||
articleList() {
|
||||
return this.dataConfig.selectConfig.articleList
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + 0 + ' ' + this.dataConfig.downConfig.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//文章间距
|
||||
itemStyle() {
|
||||
return {
|
||||
'margin-bottom': this.dataConfig.contentConfig.val * 2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//时间颜色
|
||||
timeColor() {
|
||||
return {
|
||||
'color': this.dataConfig.timeColor.color[0].item
|
||||
}
|
||||
},
|
||||
//标题颜色
|
||||
titleColor() {
|
||||
return {
|
||||
'color': this.dataConfig.titleColor.color[0].item
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.articleList {
|
||||
|
||||
.item {
|
||||
padding: 0 20rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.text {
|
||||
width: 60%;
|
||||
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: #282828;
|
||||
height: 82rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.pictrue {
|
||||
width: 37%;
|
||||
height: 156rpx;
|
||||
border-radius: 6rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
864
app/components/homeIndex/bargain.vue
Normal file
864
app/components/homeIndex/bargain.vue
Normal file
@@ -0,0 +1,864 @@
|
||||
<template>
|
||||
<view class="groupBox" :style="[...boxPadding]" v-if="groupProductList.length">
|
||||
<view class="group" :style="[...boxStyle]">
|
||||
<view class="group-top acea-row row-middle row-between" :style="[bgImgStyle]">
|
||||
<view class="group-top-left acea-row">
|
||||
<image v-if="selectStyle == 0" :src="logoUrl" alt="" class="logo">
|
||||
<view v-else class="titleFont" :style="[...headerTitleConfig]">{{ titleConfig }}</view>
|
||||
<view class="interval" :style="[lineColor]"></view>
|
||||
<view class="num" :style="[titleColor]">低至0元免费拿</view>
|
||||
</view>
|
||||
<view class="group-top-right" :style="[headerBtnColor]" @click="toMore">
|
||||
更多
|
||||
<text class="iconfont icon-you" :style="[headerBtnColor]"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式一 -->
|
||||
<view v-if="listStyle == 0" :style="[...boxBgStyle]" class="group-bottom">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" :style="[contentConfig]">
|
||||
<view class=" acea-row row-between" @click="toGroupDetail(item.id,item.product)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle">
|
||||
<easy-loadimage :image-src="item.image" width="250rpx" height="250rpx"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-bottom-right acea-row row-column row-between">
|
||||
<view class="right-top">
|
||||
<view class="title line2" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="pink acea-row" v-if="typeShow.includes(1)">
|
||||
<view class="people-box acea-row" :style="[groupTitleColor]">
|
||||
<view class="people" :style="[groupTitleColor]">
|
||||
<text class="iconfont icon-kanjiahuohua"></text>
|
||||
<text>{{item.sales}}人砍价成功</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-bottom acea-row row-between">
|
||||
<view class="price">
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]"><text
|
||||
class="pinkNum-title"></text><text class="pinkNum-icon">¥</text><text
|
||||
class="pinkNum-num semiBold">{{item.minPrice}}</text>
|
||||
</view>
|
||||
<view class="num otNum regular" v-if="typeShow.includes(3)"
|
||||
:style="[originalColor]"><text class="num-title"></text><text
|
||||
class="icon-num ">¥{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox" v-if="groupBtnShow">
|
||||
<view class="btn" :style="[...btnColor]">参与砍价</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式二 -->
|
||||
<view class="group-bottom two acea-row row-between grid-list" v-if="listStyle == 1"
|
||||
:style="[...boxBgStyle]">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" @click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle big-img">
|
||||
<easy-loadimage :image-src="item.image" width="324rpx" height="324rpx"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="two-item">
|
||||
<view class="title acea-row">
|
||||
<text class="line1" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="two-item-bottom acea-row row-between">
|
||||
<view class="price">
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]">
|
||||
<text class="num-icon">¥</text><text class="num semiBold">{{item.minPrice}}</text>
|
||||
</view>
|
||||
<view class="otNum regular" v-if="typeShow.includes(3)" :style="[originalColor]">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox" v-if="groupBtnShow">
|
||||
<view class="btn" :style="[...btnColor]">去砍价</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式三 -->
|
||||
<view class="group-bottom three acea-row grid-three" v-if="listStyle == 2" :style="[...boxBgStyle]">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" class="three-box"
|
||||
@click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle three-img">
|
||||
<easy-loadimage class="loadimage" width="100%" height="100%" :image-src="item.image"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="two-item">
|
||||
<view class="title acea-row">
|
||||
<text class="line1" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="two-item-bottom">
|
||||
<view class="price">
|
||||
<view class="pinkNum line1" v-if="typeShow.includes(2)" :style="[priceColor]">
|
||||
<text class="num-icon"><text class="min-text">低至</text>¥</text><text
|
||||
:style="[{'font-size':item.minPrice.length>6?'30rpx':'36rpx'}]"
|
||||
class="num semiBold">{{item.minPrice}}</text>
|
||||
</view>
|
||||
<view class="otNum regular" v-if="typeShow.includes(3)" :style="[originalColor]">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式四 -->
|
||||
<view class="group-bottom four acea-row " v-if="listStyle == 3" :style="[...boxBgStyle]">
|
||||
<scroll-view scroll-x="true" class="scroll_view">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" class="four-item" :style="[fourStyle]"
|
||||
@click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle four-img">
|
||||
<easy-loadimage :image-src="item.image" width="214rpx" height="214rpx"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="two-item">
|
||||
<view class="title acea-row" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
<text class="line1">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="two-item-bottom">
|
||||
<view class="price">
|
||||
<view class="people-size-box" v-if="typeShow.includes(1)" :style="[...peopleStyle]">
|
||||
<view class="people-size">{{item.sales}}人已砍成功</view>
|
||||
</view>
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]">
|
||||
<text class="num-icon">¥</text><text
|
||||
class="num semiBold">{{item.minPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<emptyPage :mTop="'0'" v-if="groupProductList.length==0" title="暂无砍价商品,去看看其他商品吧~~"
|
||||
:imgSrc="urlDomain+'crmebimage/presets/noActivity.png'"></emptyPage>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
getBargainIndexApi
|
||||
} from '@/api/activity.js';
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
import emptyPage from '@/components/emptyPage.vue'
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'homeBargain',
|
||||
components: {
|
||||
easyLoadimage,
|
||||
emptyPage
|
||||
},
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlDomain: this.$Cache.get("imgHost"),
|
||||
listStyle: 0,
|
||||
logoUrl: null,
|
||||
typeShow: [0, 1, 2, 3],
|
||||
groupBtnShow: true,
|
||||
selectStyle: '',
|
||||
titleConfig: '',
|
||||
selectBgImg: '',
|
||||
bgImgUrl: '',
|
||||
headerTitleStyle: 0,
|
||||
old: {
|
||||
scrollTop: 0
|
||||
},
|
||||
groupInfo: {},
|
||||
groupProductList: [],
|
||||
themeColor: this.$options.filters.filterTheme(app.globalData.theme)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
'userData': 'userInfo',
|
||||
'uid': 'uid'
|
||||
}),
|
||||
//容器样式
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return [{
|
||||
'border-radius': this.dataConfig.bgStyle.val ? 2 * this.dataConfig.bgStyle.val + 'rpx' : '0'
|
||||
},
|
||||
{
|
||||
margin: 0 + ' ' + 2 * this.dataConfig.lrConfig.val + 'rpx' + ' ' + 0
|
||||
},
|
||||
{
|
||||
background: `linear-gradient(to right,${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
},
|
||||
];
|
||||
},
|
||||
//边距
|
||||
boxPadding() {
|
||||
return [{
|
||||
padding: 2 * this.dataConfig.upConfig.val + 'rpx' + ' ' + '0rpx' + ' ' + 2 * this.dataConfig
|
||||
.downConfig.val + 'rpx',
|
||||
},
|
||||
{
|
||||
margin: 2 * this.dataConfig.mbConfig.val + 'rpx' + ' ' + 0 + ' ' + 0
|
||||
},
|
||||
]
|
||||
},
|
||||
//背景颜色
|
||||
boxBgStyle() {
|
||||
return [{
|
||||
gap: this.listStyle != 3 ? `${2*this.dataConfig.contentConfig.val}rpx` : ''
|
||||
},
|
||||
{
|
||||
background: `linear-gradient(to right,${this.dataConfig.contentBgColor.color[0].item}, ${this.dataConfig.contentBgColor.color[1].item})`,
|
||||
},
|
||||
{
|
||||
'justify-content': 'space-between',
|
||||
},
|
||||
];
|
||||
},
|
||||
fourStyle() {
|
||||
return {
|
||||
'margin-right': this.listStyle == 3 ? `${2*this.dataConfig.contentConfig.val}rpx` : ''
|
||||
}
|
||||
},
|
||||
//标题颜色
|
||||
titleColor() {
|
||||
return {
|
||||
color: this.dataConfig.titleColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//头部按钮颜色
|
||||
headerBtnColor() {
|
||||
return {
|
||||
color: this.dataConfig.headerBtnColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//商品名称颜色
|
||||
nameColor() {
|
||||
return {
|
||||
color: this.dataConfig.nameColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//商品原价颜色
|
||||
originalColor() {
|
||||
return {
|
||||
color: this.dataConfig.originalColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//砍价价格颜色
|
||||
priceColor() {
|
||||
return {
|
||||
color: this.dataConfig.themeStyleConfig.tabVal ? this.dataConfig.priceColor.color[0].item : this
|
||||
.themeColor,
|
||||
};
|
||||
},
|
||||
//标签颜色
|
||||
groupTitleColor() {
|
||||
return {
|
||||
color: this.dataConfig.themeStyleConfig.tabVal ?this.dataConfig.groupTitleColor.color[0].item: this
|
||||
.themeColor,
|
||||
};
|
||||
},
|
||||
peopleStyle() {
|
||||
return [{
|
||||
color: '#fff',
|
||||
},
|
||||
{
|
||||
background: `linear-gradient(to right,${
|
||||
this.dataConfig.themeStyleConfig.tabVal ? this.dataConfig.btnColor.color[0].item : '#FF7931'
|
||||
}, ${this.dataConfig.themeStyleConfig.tabVal? this.dataConfig.btnColor.color[1].item : this.themeColor})`,
|
||||
},
|
||||
{
|
||||
'align-self': 'baseline',
|
||||
},
|
||||
{
|
||||
'border-radius': '14rpx',
|
||||
},
|
||||
];
|
||||
},
|
||||
//已拼颜色
|
||||
groupTitleFontColor() {
|
||||
return {
|
||||
color: this.dataConfig.groupTitleColor.color[0].item,
|
||||
}
|
||||
},
|
||||
//分割线颜色
|
||||
lineColor() {
|
||||
return {
|
||||
border: `1rpx solid ${this.dataConfig.lineColor.color[0].item}`,
|
||||
};
|
||||
},
|
||||
//按钮颜色
|
||||
btnColor() {
|
||||
return [{
|
||||
background: `linear-gradient(to right,${
|
||||
this.dataConfig.themeStyleConfig.tabVal ? this.dataConfig.btnColor.color[0].item : '#FF7931'
|
||||
}, ${this.dataConfig.themeStyleConfig.tabVal ? this.dataConfig.btnColor.color[1].item : this.themeColor})`,
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.btnFontColor.color[0].item,
|
||||
}
|
||||
];
|
||||
},
|
||||
//图片圆角
|
||||
contentStyle() {
|
||||
return {
|
||||
'border-radius': this.dataConfig.contentStyle.val ? 2 * this.dataConfig.contentStyle.val + 'rpx' : '0',
|
||||
};
|
||||
},
|
||||
//样式一内容边距
|
||||
contentConfig() {
|
||||
return {
|
||||
'paddingBottom': 2 * this.dataConfig.contentConfig.val + 'rpx',
|
||||
};
|
||||
},
|
||||
//背景图片
|
||||
bgImgStyle() {
|
||||
return {
|
||||
'background': this.selectBgImg == 0 ? `url(${this.bgImgUrl})` :
|
||||
`linear-gradient(to right,${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
};
|
||||
},
|
||||
//标题文字格式
|
||||
headerTitleConfig() {
|
||||
return [{
|
||||
'font-weight': this.headerTitleStyle == 0 ? 600 : ''
|
||||
},
|
||||
{
|
||||
'font-style': this.headerTitleStyle == 2 ? 'italic' : 'normal'
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.headerTitleColor.color[0].item,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.setConfig()
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//去砍价
|
||||
toGroupDetail(id) {
|
||||
if (this.uid) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/activity/goods_bargain_details/index?id=${id}&startBargainUid=${this.uid}`
|
||||
})
|
||||
} else {
|
||||
toLogin()
|
||||
}
|
||||
},
|
||||
getInfo() {
|
||||
let that = this;
|
||||
getBargainIndexApi().then(function(res) {
|
||||
that.groupProductList = res.data.productList;
|
||||
that.groupInfo = {
|
||||
totalPeople: res.data.totalPeople,
|
||||
avatarList: res.data.avatarList
|
||||
}
|
||||
}).catch((res) => {
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
})
|
||||
},
|
||||
scroll: function(e) {
|
||||
this.old.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
// 更多
|
||||
toMore() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/goods_bargain/index'
|
||||
})
|
||||
},
|
||||
setConfig() {
|
||||
this.listStyle = this.dataConfig.tabConfig.tabVal;
|
||||
this.logoUrl = this.dataConfig.logoConfig.url;
|
||||
this.typeShow = this.dataConfig.typeConfig.activeValue;
|
||||
this.groupBtnShow = this.dataConfig.groupBtnConfig.tabVal == 0 ? true : false;
|
||||
this.selectStyle = this.dataConfig.selectStyle.tabVal;
|
||||
this.titleConfig = this.dataConfig.titleConfig.val;
|
||||
this.selectBgImg = this.dataConfig.selectBgImg.tabVal;
|
||||
this.bgImgUrl = this.dataConfig.bgImg.url;
|
||||
this.headerTitleStyle = this.dataConfig.headerTitleStyle.tabVal;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.groupBox {
|
||||
overflow: hidden;
|
||||
|
||||
.group {
|
||||
overflow: hidden;
|
||||
|
||||
.group-top {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
padding: 0 24rpx;
|
||||
background-size: cover !important;
|
||||
|
||||
.group-top-left {
|
||||
align-items: center;
|
||||
|
||||
.ml10 {
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 154rpx;
|
||||
height: 32rpx;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.interval {
|
||||
width: 0rpx;
|
||||
height: 28rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 4rpx;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.pinkHead {
|
||||
width: 108rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
font-size: 26rpx;
|
||||
margin-left: 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.group-top-right {
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.icon-xiangyou {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom {
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
|
||||
.img {
|
||||
width: 240rpx;
|
||||
// height: 240rpx;
|
||||
// background: #F3F9FF;
|
||||
|
||||
}
|
||||
|
||||
.big-img.img {
|
||||
width: 100%;
|
||||
height: 324rpx;
|
||||
}
|
||||
|
||||
.three-img.img {
|
||||
width: 100%;
|
||||
height: 210rpx;
|
||||
}
|
||||
|
||||
.loadimage {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.four-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.group-bottom-right {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
|
||||
.right-top {
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.people-box {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.pink {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.people {
|
||||
color: #fff;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.groupNum {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
margin-left: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-bottom {
|
||||
|
||||
.price {
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.pinkNum-num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
// margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 20rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom.two {
|
||||
.two-item {
|
||||
width: 100%;
|
||||
|
||||
.title {
|
||||
margin-top: 20rpx;
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 4rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.two-item-bottom {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.otNum {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom.three {
|
||||
.three-box {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 32rpx;
|
||||
font-size: 22rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.two-item {
|
||||
width: 100%;
|
||||
|
||||
.title {
|
||||
margin-top: 20rpx;
|
||||
// width: 100%;
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 32rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
width: 180rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.two-item-bottom {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.num {
|
||||
width: 200rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.otNum {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom.four {
|
||||
overflow: hidden;
|
||||
flex-wrap: nowrap;
|
||||
position: relative;
|
||||
|
||||
.four-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 32rpx;
|
||||
font-size: 22rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
|
||||
.two-item {
|
||||
width: 210rpx;
|
||||
|
||||
.title {
|
||||
margin-top: 16rpx;
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 32rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
width: 210rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.two-item-bottom {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.pinkNum {
|
||||
margin-top: 12rpx;
|
||||
|
||||
.num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.otNum {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.grid-list {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid-three {
|
||||
width: 100%;
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.titleFont {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.scroll_view {
|
||||
white-space: nowrap;
|
||||
|
||||
.four-item {
|
||||
display: inline-block;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.num-icon {
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
|
||||
.numPink {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.numPink-box {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.numPink-box-special {
|
||||
position: absolute;
|
||||
left: 10rpx;
|
||||
top: 10rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
.avater-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
margin-top: 4rpx;
|
||||
|
||||
image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
|
||||
.avater1 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.avater2 {
|
||||
position: absolute;
|
||||
margin-left: 48rpx;
|
||||
}
|
||||
|
||||
.avater3 {
|
||||
position: absolute;
|
||||
left: 78rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.regular {
|
||||
line-height: 34rpx !important;
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
|
||||
.otNum {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.people-size {
|
||||
font-size: 20rpx;
|
||||
padding: 4rpx 10rpx;
|
||||
}
|
||||
|
||||
.huo {
|
||||
width: 16rpx;
|
||||
height: 20rpx;
|
||||
vertical-align: baseline;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.icon-kanjiahuohua {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.min-text {
|
||||
font-size: 22rpx !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.icon-you {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.regular {
|
||||
line-height: 17px !important;
|
||||
}
|
||||
</style>
|
||||
45
app/components/homeIndex/blankPage.vue
Normal file
45
app/components/homeIndex/blankPage.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<!-- 辅助空白-->
|
||||
<view>
|
||||
<view :style="[boxStyle]"></view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: 'blankPage',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
height: this.dataConfig.heightConfig.val + 'px',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.blankPage {
|
||||
.bankCon {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
197
app/components/homeIndex/cateNav.vue
Normal file
197
app/components/homeIndex/cateNav.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<!-- 商品分类 -->
|
||||
<view>
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<!-- <view style="visibility: hidden;" :style="{ height: navHeight + 'rpx' }"></view> -->
|
||||
<!-- #endif -->
|
||||
<view class="navTabBox" :class="{isFixed:isFixed}" :style="[boxStyle]">
|
||||
<view class="longTab">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation
|
||||
:scroll-left="tabLeft" show-scrollbar="true">
|
||||
<view class="longItem"
|
||||
:style="'color:' + (index == tabClick ? checkColor : fontColor)+';--color:'+checkColor"
|
||||
:data-index="index" :class="index===tabClick?'click':''" v-for="(item,index) in tabList"
|
||||
:key="index" :id="'id'+index" @click="longClick(index,item)">{{ item.title }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 70rpx"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'tabNav',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
//是否固定
|
||||
isFixed: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabClick: 0, //导航栏被点击
|
||||
isLeft: 0, //导航栏下划线位置
|
||||
isWidth: 0, //每个导航栏占位
|
||||
mainWidth: 0,
|
||||
tabLeft: 0,
|
||||
isTop: 0,
|
||||
navHeight: 35,
|
||||
tabItem: null ,//tab选中的对象
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//外部盒子
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: 0 + ' ' + 2*this.dataConfig.lrConfig.val + 'rpx' + ' ' + 0 ,
|
||||
// padding: 2*this.dataConfig.upConfig.val + 'rpx' + ' ' + '20rpx' + ' ' + 2*this.dataConfig.downConfig.val + 'rpx' ,
|
||||
}
|
||||
},
|
||||
//标签文字颜色
|
||||
fontColor() {
|
||||
return this.dataConfig.fontColor.color[0].item
|
||||
},
|
||||
//选中颜色
|
||||
checkColor() {
|
||||
return this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.checkColor.color[0].item:this.themeColor
|
||||
},
|
||||
tabList() {
|
||||
//type=0微页面,1分类,2首页
|
||||
let tabList = this.dataConfig.listConfig.list;
|
||||
tabList.unshift({
|
||||
title: '首页',
|
||||
type: 2,
|
||||
val: 0
|
||||
})
|
||||
return tabList
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let that = this
|
||||
// 获取设备宽度
|
||||
uni.getSystemInfo({
|
||||
success(e) {
|
||||
//that.mainWidth = e.windowWidth
|
||||
that.isWidth = (e.windowWidth) / 5
|
||||
}
|
||||
})
|
||||
setTimeout((e) => {
|
||||
let statusHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.navTabBox').boundingClientRect(data => {
|
||||
that.navHeight = (data.height + statusHeight) * 2;
|
||||
}).exec();
|
||||
}, 300)
|
||||
that.$nextTick(function() {
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
that.windowHeight = res.windowHeight;
|
||||
}
|
||||
});
|
||||
})
|
||||
// #ifdef MP || APP-PLUS
|
||||
this.isTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px'
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.isTop = 0
|
||||
// #endif
|
||||
},
|
||||
watch: {
|
||||
tabClick: {
|
||||
handler(newValue, oldValue) {
|
||||
if (this.tabItem) this.$emit('changeTab', newValue, this.tabItem);
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 导航栏点击
|
||||
longClick(index, item) {
|
||||
this.tabItem = item;
|
||||
this.tabClick = index; //设置导航点击了哪一个
|
||||
this.$nextTick(() => {
|
||||
let id = 'id' + index;
|
||||
this.tabLeft = (index - 2) * this.isWidth //设置下划线位置
|
||||
//this.$emit('changeTab', index,item);
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navTabBox {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
padding: 0 20rpx;
|
||||
&.isFixed {
|
||||
z-index: 10;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
/* #ifdef H5 */
|
||||
top: 0;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.click {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.longTab {
|
||||
.longItem {
|
||||
height: 70rpx;
|
||||
display: inline-block;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 30rpx;
|
||||
&.click {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
width: 40rpx;
|
||||
height: 4rpx;
|
||||
background: var(--color);
|
||||
// background-color: #E93323;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
172
app/components/homeIndex/countDown.vue
Normal file
172
app/components/homeIndex/countDown.vue
Normal file
@@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<!-- 时间倒计时 -->
|
||||
<view class="time" :style="justifyLeft">
|
||||
<text class="" v-if="tipText">{{ tipText }}</text>
|
||||
<text class="styleAll p6" v-if="isDay === true" :style="{background:bgColor.bgColor,color:bgColor.Color}">{{ day }}{{bgColor.isDay?'天':''}}</text>
|
||||
<text class="timeTxt" v-if="dayText" :style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ dayText }}</text>
|
||||
<text class="styleAll" :class='isCol?"timeCol":""' :style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ hour }}</text>
|
||||
<text class="timeTxt" v-if="hourText" :class='isCol?"whit":""' :style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ hourText }}</text>
|
||||
<text class="styleAll" :class='isCol?"timeCol":""' :style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ minute }}</text>
|
||||
<text class="timeTxt" v-if="minuteText" :class='isCol?"whit":""' :style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ minuteText }}</text>
|
||||
<text class="styleAll" :class='isCol?"timeCol":""' :style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ second }}</text>
|
||||
<text class="timeTxt" v-if="secondText">{{ secondText }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: "countDown",
|
||||
props: {
|
||||
justifyLeft: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
//距离开始提示文字
|
||||
tipText: {
|
||||
type: String,
|
||||
default: "倒计时"
|
||||
},
|
||||
dayText: {
|
||||
type: String,
|
||||
default: "天"
|
||||
},
|
||||
hourText: {
|
||||
type: String,
|
||||
default: "时"
|
||||
},
|
||||
minuteText: {
|
||||
type: String,
|
||||
default: "分"
|
||||
},
|
||||
secondText: {
|
||||
type: String,
|
||||
default: "秒"
|
||||
},
|
||||
datatime: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
isDay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
isCol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bgColor: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
day: "00",
|
||||
hour: "00",
|
||||
minute: "00",
|
||||
second: "00"
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
this.show_time();
|
||||
},
|
||||
mounted: function() {},
|
||||
methods: {
|
||||
show_time: function() {
|
||||
let that = this;
|
||||
|
||||
function runTime() {
|
||||
//时间函数
|
||||
let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
|
||||
let day = 0,
|
||||
hour = 0,
|
||||
minute = 0,
|
||||
second = 0;
|
||||
if (intDiff > 0) {
|
||||
//转换时间
|
||||
if (that.isDay === true) {
|
||||
day = Math.floor(intDiff / (60 * 60 * 24));
|
||||
} else {
|
||||
day = 0;
|
||||
}
|
||||
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
||||
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
||||
second =
|
||||
Math.floor(intDiff) -
|
||||
day * 24 * 60 * 60 -
|
||||
hour * 60 * 60 -
|
||||
minute * 60;
|
||||
if (hour <= 9) hour = "0" + hour;
|
||||
if (minute <= 9) minute = "0" + minute;
|
||||
if (second <= 9) second = "0" + second;
|
||||
that.day = day;
|
||||
that.hour = hour;
|
||||
that.minute = minute;
|
||||
that.second = second;
|
||||
} else {
|
||||
that.day = "00";
|
||||
that.hour = "00";
|
||||
that.minute = "00";
|
||||
that.second = "00";
|
||||
}
|
||||
}
|
||||
runTime();
|
||||
setInterval(runTime, 1000);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.p6{
|
||||
padding: 0 8rpx;
|
||||
}
|
||||
.styleAll{
|
||||
/* color: #fff; */
|
||||
font-size: 24rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 6rpx;
|
||||
text-align: center;
|
||||
/* padding: 0 6rpx; */
|
||||
}
|
||||
.timeTxt{
|
||||
text-align: center;
|
||||
/* width: 16rpx; */
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.whit{
|
||||
color: #fff !important;
|
||||
}
|
||||
.time {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #fc4141;
|
||||
margin: 0 4rpx;
|
||||
}
|
||||
|
||||
.timeCol {
|
||||
/* width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align:center;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
font-size: 24rpx; */
|
||||
color: #E93323;
|
||||
}
|
||||
</style>
|
||||
464
app/components/homeIndex/coupon.vue
Normal file
464
app/components/homeIndex/coupon.vue
Normal file
@@ -0,0 +1,464 @@
|
||||
<template>
|
||||
<!-- 优惠券 -->
|
||||
<view v-if="couponList.length">
|
||||
<view :style="[...boxStyle]">
|
||||
<template v-if="listStyle == 0">
|
||||
<view class="scroll_box">
|
||||
<scroll-view scroll-x="true" class="scroll_view acea-row">
|
||||
<view class="no-warp acea-row row-middle">
|
||||
<view class="couponBg acea-row row-middle style1" v-for="(item, index) in couponList" :key="index"
|
||||
:style="[...contentConfig]">
|
||||
<view class="left">
|
||||
<view :style="[...priceColorStyle]"><text class="price-icon">¥</text><text
|
||||
class="price"
|
||||
:class="item.money.length>6?'sizePrice':''">{{item.money}}</text></view>
|
||||
<view class="title" :class="item.minPrice.length>6?'sizeTitle':''">
|
||||
满{{item.minPrice}}元可用</view>
|
||||
</view>
|
||||
<view class="right" @click="getCoupon(item.isUse,item.id)">
|
||||
{{item.isUse?'已 领 取':'领 取'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="listStyle == 1">
|
||||
<view class="coupon1 acea-row row-middle">
|
||||
<scroll-view scroll-x="true" class="scroll_view">
|
||||
<view class="list acea-row row-middle">
|
||||
<view class="item" v-for="(item, index) in couponList" :key="index"
|
||||
:style="[...contentConfig]">
|
||||
<view class="money" :style="[...priceColorStyle]">
|
||||
<view :class="item.money.length>=6?'sizePrice-two':''"><text class="lable"
|
||||
:class="item.money.length>=6?'sizeLable-two':''">¥</text>{{item.money}}
|
||||
</view>
|
||||
<view class="tips">满{{item.minPrice}}可用</view>
|
||||
</view>
|
||||
<view class="sill" :style="[...btnColorStyle]" @click="getCoupon(item.isUse,item.id)">
|
||||
{{item.isUse?'已领取':'去领取'}}
|
||||
</view>
|
||||
<image src="../../static/images/newVip02.png" />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="listStyle == 2">
|
||||
<view class="scroll_box">
|
||||
<scroll-view scroll-x="true" class="scroll_view acea-row">
|
||||
<view class="no-warp acea-row row-middle">
|
||||
<view class="couponBg acea-row row-middle couponBg-new" v-for="(item, index) in couponList" :key="index"
|
||||
:style="[...contentConfig]">
|
||||
<view class="left">
|
||||
<view :style="[...priceColorStyle]"><text class="price-icon">¥</text><text
|
||||
class="price"
|
||||
:class="item.money.length>6?'sizePrice':''">{{item.money}}</text></view>
|
||||
<view class="title" :class="item.minPrice.length>6?'sizeTitle':''">
|
||||
满{{item.minPrice}}元可用</view>
|
||||
</view>
|
||||
<view class="right" @click="getCoupon(item.isUse,item.id)" v-if="!item.isUse">
|
||||
立即领取
|
||||
</view>
|
||||
<view class="right" @click="getCoupon(item.isUse,item.id)" v-else>
|
||||
立即使用
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="listStyle == 3">
|
||||
<view class="coupon5 acea-row row-middle" :style="[...boxBg]">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex">
|
||||
<view class="list acea-row row-middle">
|
||||
<view class="item acea-row row-middle" v-for="(item, index) in couponList" :key="index"
|
||||
:style="[...contentConfig]">
|
||||
<view class="left">
|
||||
<view :class="item.money.length>=6?'sizePrice-four':''"
|
||||
:style="[...priceColorStyle]" class="money"><text
|
||||
class="label">¥</text>{{item.money}}
|
||||
</view>
|
||||
<view class="tips">满{{item.minPrice}}可用</view>
|
||||
</view>
|
||||
<view class="right acea-row row-center">
|
||||
<view class="rightCon" @click="getCoupon(item.isUse,item.id)">
|
||||
{{item.isUse?'已 领 取':'领 取'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="roll" :style="[...boxBg]"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {
|
||||
getCoupons,
|
||||
setCouponReceive
|
||||
} from "@/api/api.js"
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'homeCoupon',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlDomain: this.$Cache.get("imgHost"),
|
||||
couponList: [],
|
||||
listStyle: 0,
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return [{
|
||||
'border-radius': 2 * this.dataConfig.bgStyle.val ? 2 * this.dataConfig.bgStyle.val + 'rpx' :
|
||||
'0'
|
||||
},
|
||||
{
|
||||
background: this.listStyle != 3 ?
|
||||
`linear-gradient(to right,${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})` :
|
||||
this.dataConfig.bgColorNew.color[0].item,
|
||||
},
|
||||
{
|
||||
'margin': 2 * this.dataConfig.mbConfig.val + 'rpx' + ' ' + 2 * this.dataConfig.lrConfig.val +
|
||||
'rpx' +
|
||||
' ' + 0
|
||||
},
|
||||
{
|
||||
'padding': 2 * this.dataConfig.upConfig.val + 'rpx' + ' ' + '20rpx' + ' ' + 2 * this.dataConfig
|
||||
.downConfig
|
||||
.val + 'rpx'
|
||||
},
|
||||
];
|
||||
},
|
||||
boxBg() {
|
||||
return [{
|
||||
background: this.dataConfig.bgColorNew.color[0].item,
|
||||
}, ];
|
||||
},
|
||||
//内容边距
|
||||
contentConfig() {
|
||||
return [{
|
||||
'margin-right': this.dataConfig.contentConfig.val ? 2 * this.dataConfig.contentConfig.val +
|
||||
'rpx' : '0'
|
||||
},
|
||||
{
|
||||
'background': this.listStyle == 1 ?
|
||||
(this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.itemBgColor.color[0].item:this.themeColor) : this.listStyle == 3 ?
|
||||
`linear-gradient(180deg,${this.dataConfig.btnColor.color[0].item}, ${this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.btnColor.color[1].item:this.themeColor})` :
|
||||
'',
|
||||
},
|
||||
];
|
||||
},
|
||||
//优惠金额颜色
|
||||
priceColorStyle() {
|
||||
return [{
|
||||
'color': this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.priceColor.color[0].item:this.themeColor
|
||||
}];
|
||||
},
|
||||
//领取按钮
|
||||
btnColorStyle() {
|
||||
return [{
|
||||
'background': `linear-gradient(90deg,${this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.btnColor.color[0].item:'#FF7931'}, ${this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.btnColor.color[1].item:this.themeColor})`,
|
||||
}, ];
|
||||
},
|
||||
//展示数量
|
||||
limit() {
|
||||
return this.dataConfig.numConfig.val
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.setConfig()
|
||||
},
|
||||
methods: {
|
||||
getCoupon(isUse, id) {
|
||||
let that = this
|
||||
if (!isUse) {
|
||||
setCouponReceive(id).then(res => {
|
||||
that.getList();
|
||||
})
|
||||
}
|
||||
},
|
||||
setConfig(data) {
|
||||
this.listStyle = this.dataConfig.tabConfig.tabVal;
|
||||
},
|
||||
//优惠券列表
|
||||
getList() {
|
||||
getCoupons({
|
||||
page: 1,
|
||||
limit: this.limit
|
||||
}).then(res => {
|
||||
this.couponList = res.data.list;
|
||||
})
|
||||
},
|
||||
//去更多
|
||||
goPage() {
|
||||
this.$util.navigateTo(this.dataConfig.linkConfig.val ? this.dataConfig.linkConfig.val :
|
||||
'/pages/activity/couponList/index')
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.scroll_box {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
.couponBg.style1{
|
||||
width: 254rpx;
|
||||
height: 144rpx;
|
||||
background: url('../../static/images/couponBg.png');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.couponBg {
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
flex-shrink: 0;
|
||||
color: #fff;
|
||||
.left {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
|
||||
.price-icon {
|
||||
font-weight: 500;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-weight: 500;
|
||||
font-size: 52rpx;
|
||||
}
|
||||
|
||||
.sizePrice {
|
||||
font-size: 38rpx !important;
|
||||
}
|
||||
|
||||
.sizeTitle {
|
||||
font-size: 20rpx !important;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
/* #ifdef H5 */
|
||||
margin-left: 10rpx;
|
||||
/* #endif */
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
}
|
||||
.couponBg-new.couponBg {
|
||||
width: 137px;
|
||||
height: 75px;
|
||||
background: url('../../static/images/couponBg2.png') !important;
|
||||
.right {
|
||||
width: 13%;
|
||||
color: #e93323;
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
}
|
||||
.title {
|
||||
color: #e93323;
|
||||
}
|
||||
.sizePrice {
|
||||
font-size: 36rpx !important;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
.coupon1 {
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.list {
|
||||
margin-top: 16rpx;
|
||||
display: inline-flex;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.item {
|
||||
width: 156rpx;
|
||||
height: 152rpx;
|
||||
background: #f12a13;
|
||||
position: relative;
|
||||
border-radius: 12rpx 12rpx 30rpx 30rpx;
|
||||
|
||||
.money {
|
||||
width: 140rpx;
|
||||
height: 106rpx;
|
||||
background: #ffffff;
|
||||
border: 2rpx solid #fceae9;
|
||||
position: absolute;
|
||||
left: 9rpx;
|
||||
top: -16rpx;
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
font-family: D-DIN-PRO, D-DIN-PRO;
|
||||
font-weight: 600;
|
||||
color: #e93323;
|
||||
padding-top: 6px;
|
||||
border-radius: 12rpx 12rpx 0 0;
|
||||
|
||||
.lable {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 18rpx;
|
||||
color: #999999;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.sizePrice {
|
||||
// font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.sill {
|
||||
position: absolute;
|
||||
bottom: -2rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 78rpx;
|
||||
// background: linear-gradient(90deg, #e93323 0%, #ff7931 100%);
|
||||
color: #fff;
|
||||
line-height: 92rpx;
|
||||
border-radius: 0 0 30rpx 30rpx;
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 156rpx;
|
||||
height: 20rpx;
|
||||
bottom: 58rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.coupon5 {
|
||||
flex-shrink: 0;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.list {
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.item {
|
||||
flex-shrink: 0;
|
||||
width: 228rpx;
|
||||
height: 108rpx;
|
||||
border-radius: 12rpx;
|
||||
position: relative;
|
||||
|
||||
.roll {
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
left: -8rpx;
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
|
||||
.rightCon {
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
width: 172rpx;
|
||||
height: 100%;
|
||||
background: linear-gradient(0deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
|
||||
border-radius: 12rpx;
|
||||
text-align: center;
|
||||
color: #e93323;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
.money {
|
||||
font-size: 42rpx;
|
||||
font-family: D-DIN-PRO, D-DIN-PRO;
|
||||
font-weight: 600;
|
||||
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-warp {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.scroll_view {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sizePrice-two {
|
||||
font-size: 24rpx;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.sizeLable-two {
|
||||
font-size: 18rpx !important;
|
||||
}
|
||||
|
||||
.sizePrice-three {
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
|
||||
.sizePrice-three-tips {
|
||||
font-size: 22rpx !important;
|
||||
margin-left: 6rpx !important;
|
||||
}
|
||||
|
||||
.sizePrice-four {
|
||||
font-size: 30rpx !important;
|
||||
}
|
||||
</style>
|
||||
543
app/components/homeIndex/goodList.vue
Normal file
543
app/components/homeIndex/goodList.vue
Normal file
@@ -0,0 +1,543 @@
|
||||
<template>
|
||||
<!-- 商品列表 -->
|
||||
<view>
|
||||
<view v-if="tempArr.length" :style="[boxStyle]">
|
||||
<!-- 单列 -->
|
||||
<block v-if="itemStyle == 0">
|
||||
<view class="listA" :style="[gridGap]">
|
||||
<view class="item" v-for="(item, index) in tempArr" :key="index" @click="goDetail(item)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }"
|
||||
class="border-picture"></view>
|
||||
</view>
|
||||
<view class="text-info text-add">
|
||||
<view>
|
||||
<view class="title line2" :style="[titleColor]" v-if="titleShow">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<view class="price acea-row row-middle" :style="[priceColor]">
|
||||
<view v-if="priceShow">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="old-price" :style="[soldColor]" v-if="soldShow">已售
|
||||
{{ item.sales|| 0 }} {{item.unitName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 两列 -->
|
||||
<block v-if="itemStyle == 1">
|
||||
<view class="listC" :style="[gridGap]">
|
||||
<view class="item" :style="[contentStyle]" v-for="(item, index) in tempArr" :key="index"
|
||||
@click="goDetail(item)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }"
|
||||
class="border-picture"></view>
|
||||
</view>
|
||||
<view class="text-info">
|
||||
<view class="title line2" :style="[titleColor]" v-if="titleShow">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</view>
|
||||
<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<view class="acea-row row-middle price" :style="[priceColor]">
|
||||
<view v-if="priceShow">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="old-price" :style="[soldColor]" v-if="soldShow">已售
|
||||
{{ item.sales|| 0 }} {{item.unitName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 三列 -->
|
||||
<block v-if="itemStyle == 2">
|
||||
<view class="listB" :style="[gridGap]">
|
||||
<view class="item" v-for="(item, index) in tempArr" :key="index" @click="goDetail(item)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }"
|
||||
class="border-picture"></view>
|
||||
</view>
|
||||
<view class="text-info">
|
||||
<view class="title line2" :style="[titleColor]" v-if="titleShow">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</view>
|
||||
<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<view class="price" :style="[priceColor]">
|
||||
<view v-if="priceShow">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="old-price" v-if="soldShow" :style="[soldColor]">
|
||||
已售 {{ item.sales|| 0 }} {{ item.unitName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 大图 -->
|
||||
<block v-if="itemStyle == 3 && tempArr.length">
|
||||
<view class="listBig" :style="[gridGap]">
|
||||
<view class="itemBig" v-for="(item,index) in tempArr" :key="index" @click="goDetail(item)">
|
||||
<view class="img-box">
|
||||
<easy-loadimage :image-src="item.image" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }"
|
||||
class="border-picture"></view>
|
||||
</view>
|
||||
<view class="name line2" :style="[titleColor]" v-if="titleShow">
|
||||
<span>{{item.storeName}}</span>
|
||||
</view>
|
||||
<view style="padding: 0 8px;"
|
||||
v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<slot name="center"></slot>
|
||||
<view class="acea-row row-middle price" :style="[priceColor]">
|
||||
<view v-if="priceShow">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="old-price mt20" :style="[soldColor]" v-if="soldShow">已售
|
||||
{{ item.sales || 0 }} {{item.unitName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class='loadingicon acea-row row-center-wrapper' :hidden='loading==false'>
|
||||
<text class='loading iconfont icon-jiazai'></text>
|
||||
</view>
|
||||
<!-- <view class="mores-txt" v-if="goodScroll">
|
||||
<text>我是有底线的</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {
|
||||
getProductslist,productByidsApi
|
||||
} from '@/api/store.js';
|
||||
let app = getApp();
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
export default {
|
||||
name: 'goodList',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
easyLoadimage,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//普通价格
|
||||
svipPriceStyle: {
|
||||
svipBox: {
|
||||
height: '26rpx',
|
||||
borderRadius: '60rpx 56rpx 56rpx 20rpx',
|
||||
},
|
||||
icon: {
|
||||
height: '26rpx',
|
||||
fontSize: '18rpx',
|
||||
borderRadius: '12rpx 0 12rpx 2rpx'
|
||||
},
|
||||
price: {
|
||||
fontSize: '38rpx'
|
||||
},
|
||||
svipPrice: {
|
||||
fontSize: '22rpx'
|
||||
}
|
||||
},
|
||||
//svip价格
|
||||
svipIconStyle: {
|
||||
svipBox: {
|
||||
height: '26rpx',
|
||||
borderRadius: '24rpx 40rpx 40rpx 0.4rpx',
|
||||
},
|
||||
price: {
|
||||
fontSize: '38rpx'
|
||||
},
|
||||
svipPrice: {
|
||||
fontSize: '18rpx'
|
||||
}
|
||||
},
|
||||
tempArr: [],
|
||||
numConfig: this.dataConfig.numConfig.val, //展示多少条
|
||||
itemStyle: this.dataConfig.itemStyle.tabVal, //商品列表展示方式 单列 两列 三列
|
||||
type: this.dataConfig.tabConfig.tabVal || 0, //商品类型 0指定商品,1指定品牌,2指定分类,3指定商户
|
||||
selectId: this.dataConfig.selectConfig ? this.dataConfig.selectConfig.activeValue : [], //分类
|
||||
productIds: this.dataConfig.goodsList.ids || [],
|
||||
params: { //精品推荐分页
|
||||
page: 1,
|
||||
limit: 10,
|
||||
cid: '',
|
||||
priceOrder: '',
|
||||
salesOrder: ''
|
||||
},
|
||||
goodScroll: false,
|
||||
loading: false,
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//商品名称颜色
|
||||
titleColor() {
|
||||
return {
|
||||
'color': this.dataConfig.titleColor.color[0].item,
|
||||
}
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + '16rpx' + ' ' + this.dataConfig.downConfig
|
||||
.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//图片展示样式
|
||||
gridGap() {
|
||||
return {
|
||||
'grid-gap': this.dataConfig.contentConfig.val * 2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//文章图片的圆角和高度
|
||||
imgStyle() {
|
||||
return {
|
||||
'border-radius': this.dataConfig.contentStyle.val * 2 + 'rpx',
|
||||
}
|
||||
},
|
||||
//价格颜色
|
||||
priceColor() {
|
||||
return {
|
||||
'color': this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.priceColor.color[0].item:this.themeColor,
|
||||
}
|
||||
},
|
||||
//已售数量
|
||||
soldColor() {
|
||||
return {
|
||||
'color': this.dataConfig.soldColor.color[0].item,
|
||||
}
|
||||
},
|
||||
//商品名称
|
||||
titleShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.includes(0)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//价格
|
||||
priceShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.includes(1)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//销量
|
||||
soldShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.includes(2)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//排序,0综合,1销量,2价格
|
||||
goodsSort() {
|
||||
return this.dataConfig.goodsSort.tabVal
|
||||
},
|
||||
//内容圆角
|
||||
contentStyle() {
|
||||
return {
|
||||
'border-radius': this.dataConfig.contentStyle.val ? 2*this.dataConfig.contentStyle.val + 'rpx' : '0'
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.params.page = 1;
|
||||
this.goodScroll = false;
|
||||
this.tempArr = [];
|
||||
//类型为0时,直接加载选中的商品,不为0时根据条件加载商品列表
|
||||
if (this.type > 0) {
|
||||
this.productslist();
|
||||
} else {
|
||||
this.getProList();
|
||||
}
|
||||
},
|
||||
//uniapp小程序用deep重写组件样式不生效
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
methods: {
|
||||
//根据商品id集合查询对应商品
|
||||
getProductByids(data) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
let ids = data.map((item) => item.id).join(',');
|
||||
productByidsApi(ids).then((res) => {
|
||||
this.tempArr = res.data;
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
getProList() {
|
||||
this.getProductByids(this.dataConfig.goodsList.list);
|
||||
},
|
||||
productslist() {
|
||||
if (this.goodScroll) return;
|
||||
this.loading = true
|
||||
this.params.limit = this.numConfig;
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
this.params.cid = this.selectId.join(',');
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.goodsSort === 0) {
|
||||
this.params.priceOrder = '';
|
||||
this.params.salesOrder = '';
|
||||
} else if (this.goodsSort === 1) {
|
||||
this.params.priceOrder = '';
|
||||
this.params.salesOrder = 'desc';
|
||||
} else {
|
||||
this.params.priceOrder = 'desc';
|
||||
this.params.salesOrder = '';
|
||||
}
|
||||
|
||||
getProductslist(this.params).then(res => {
|
||||
this.$set(this.params, 'page', this.params.page + 1);
|
||||
this.goodScroll = this.params.page > res.data.totalPage;
|
||||
this.tempArr = this.tempArr.concat(res.data.list || []);
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/goods_details/index?id=${item.id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mores-txt {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-add {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.listBig {
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
|
||||
.itemBig {
|
||||
width: 100%;
|
||||
|
||||
.img-box {
|
||||
width: 100%;
|
||||
height: 710rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 16rpx;
|
||||
// padding: 0 8px;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-top: 10rpx;
|
||||
// padding: 0 8px;
|
||||
|
||||
.num {
|
||||
font-size: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
color: #aaa;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listA {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
.pictrue {
|
||||
width: 220rpx;
|
||||
height: 220rpx;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
margin-left: 20rpx;
|
||||
flex: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listB {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
|
||||
.item {
|
||||
.pictrue {
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
padding-top: 14rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listC {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
|
||||
/deep/.origin-img,
|
||||
/deep/.easy-loadimage {
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
.item {
|
||||
background-color: #fff;
|
||||
|
||||
.pictrue {
|
||||
width: 100%;
|
||||
height: 345rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
padding: 14rpx 0 14rpx 14rpx;
|
||||
|
||||
.title {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 36rpx;
|
||||
font-weight: 550;
|
||||
|
||||
text {
|
||||
padding-bottom: 4rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mer_badge {
|
||||
padding: 0 4rpx;
|
||||
background-color: theme;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
display: inline-block;
|
||||
border-radius: 4rpx;
|
||||
line-height: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
</style>
|
||||
787
app/components/homeIndex/group.vue
Normal file
787
app/components/homeIndex/group.vue
Normal file
@@ -0,0 +1,787 @@
|
||||
<!-- 拼团 -->
|
||||
<template>
|
||||
<view class="groupBox" v-if="groupProductList.length" :style="[...boxPadding]">
|
||||
<view class="group" :style="[...boxStyle]">
|
||||
<view class="group-top acea-row row-middle row-between" :style="[bgImgStyle]">
|
||||
<view class="group-top-left acea-row">
|
||||
<image v-if="selectStyle == 0" :src="logoUrl" alt="" class="logo">
|
||||
<view v-else class="titleFont" :style="[...headerTitleConfig]">{{ titleConfig }}</view>
|
||||
<view v-if="groupInfo.totalPeople" class="interval" :style="[lineColor]"></view>
|
||||
<view class="avater-box" v-if="groupInfo.avatarList&&groupInfo.avatarList.length">
|
||||
<image class="avater1" :src="groupInfo.avatarList[0]"></image>
|
||||
<image class="avater2" v-if="groupInfo.avatarList.length>1" :src="groupInfo.avatarList[1]"></image>
|
||||
<image class="avater3" v-if="groupInfo.avatarList.length>2" :src="groupInfo.avatarList[2]"></image>
|
||||
</view>
|
||||
<view v-if="groupInfo.totalPeople" class="num ml-num" :class="groupInfo.avatarList.length==1?'num1':groupInfo.avatarList.length==2?'num2':groupInfo.avatarList.length==3?'num3':''" :style="[titleColor]">{{groupInfo.totalPeople}}人拼团成功</view>
|
||||
</view>
|
||||
<view class="group-top-right" :style="[headerBtnColor]" @click="toMore">
|
||||
更多
|
||||
<text class="iconfont icon-you" :style="[headerBtnColor]"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式一 -->
|
||||
<view v-if="listStyle == 0" :style="[...boxBgStyle]" class="group-bottom">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" :style="[contentConfig]" >
|
||||
<view class=" acea-row row-between" @click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle" >
|
||||
<easy-loadimage :image-src="item.image" width="250rpx"
|
||||
height="250rpx" :radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-bottom-right acea-row row-column row-between">
|
||||
<view class="right-top">
|
||||
<view class="title line2" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="pink acea-row" v-if="typeShow.includes(1)">
|
||||
<view class="people-box acea-row" :style="[groupTitleColor]">
|
||||
<view class="people" :style="[groupTitleColor]">{{item.people}}人团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-bottom acea-row row-between">
|
||||
<view class="price">
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]"><text
|
||||
class="pinkNum-title">拼团价</text><text class="pinkNum-icon">¥</text><text
|
||||
class="pinkNum-num semiBold">{{item.price}}</text>
|
||||
</view>
|
||||
<view class="num" v-if="typeShow.includes(3)" :style="[originalColor]"><text
|
||||
class="num-title">单买价</text><text class="num-icon">¥</text><text
|
||||
class="icon-num regular">{{item.otPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox" v-if="groupBtnShow">
|
||||
<view class="btn" :style="[...btnColor]">去拼团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式二 -->
|
||||
<view class="group-bottom two acea-row row-between grid-list" v-if="listStyle == 1"
|
||||
:style="[...boxBgStyle]">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" @click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle big-img">
|
||||
<easy-loadimage :image-src="item.image" width="324rpx"
|
||||
height="324rpx" :radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="two-item">
|
||||
<view class="title acea-row">
|
||||
<view :style="[groupTitleColor]" class="numPink-box">
|
||||
<view class="numPink" v-if="typeShow.includes(1)" :style="[groupTitleFontColor]">{{item.people}}人团</view>
|
||||
</view>
|
||||
<text class="line1" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="two-item-bottom acea-row row-between">
|
||||
<view class="price">
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]">
|
||||
<text class="num-icon">¥</text><text
|
||||
class="num semiBold" >{{item.price}}</text>
|
||||
</view>
|
||||
<view class="otNum regular" v-if="typeShow.includes(3)" :style="[originalColor]">
|
||||
¥{{item.otPrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnBox" v-if="groupBtnShow">
|
||||
<view class="btn" :style="[...btnColor]">去拼团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式三 -->
|
||||
<view class="group-bottom three acea-row grid-three" v-if="listStyle == 2" :style="[...boxBgStyle]">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" class="three-box" @click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle three-img">
|
||||
<easy-loadimage width="100%" class="loadimage"
|
||||
height="100%" :image-src="item.image" :radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="two-item">
|
||||
<view class="title acea-row">
|
||||
<view :style="[groupTitleColor]" class="numPink-box numPink-box-special">
|
||||
<view class="numPink" v-if="typeShow.includes(1)" :style="[groupTitleFontColor]">{{item.people}}人团</view>
|
||||
</view>
|
||||
<text class="line1" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="two-item-bottom">
|
||||
<view class="price">
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]">
|
||||
<text class="num-icon">¥</text><text
|
||||
class="num semiBold">{{item.price}}</text>
|
||||
</view>
|
||||
<view class="otNum regular" v-if="typeShow.includes(3)" :style="[originalColor]">
|
||||
¥{{item.otPrice}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 样式四 -->
|
||||
<view class="group-bottom four acea-row " v-if="listStyle == 3" :style="[...boxBgStyle]">
|
||||
<scroll-view scroll-x="true" class="scroll_view">
|
||||
<view v-for="(item, index) in groupProductList" :key="index" class="four-item" :style="[fourStyle]" @click="toGroupDetail(item.id)">
|
||||
<view class="group-bottom-left">
|
||||
<view class="img acea-row row-center row-middle four-img">
|
||||
<easy-loadimage :image-src="item.image" width="240rpx"
|
||||
height="240rpx" :radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
</view>
|
||||
</view>
|
||||
<view class="two-item">
|
||||
<view class="title acea-row" v-if="typeShow.includes(0)" :style="[nameColor]">
|
||||
<view :style="[groupTitleColor]" class="numPink-box numPink-box-special">
|
||||
<view class="numPink" v-if="typeShow.includes(1)" :style="[groupTitleFontColor]">{{item.people}}人团</view>
|
||||
</view>
|
||||
<text class="line1">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="two-item-bottom">
|
||||
<view class="price">
|
||||
<view class="pinkNum" v-if="typeShow.includes(2)" :style="[priceColor]">
|
||||
<text class="num-icon">¥</text><text
|
||||
class="num semiBold">{{item.price}}</text>
|
||||
</view>
|
||||
<view class="otNum regular" v-if="typeShow.includes(3)" :style="[originalColor]">
|
||||
¥{{item.otPrice}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<emptyPage :mTop="'0'" v-if="groupProductList.length==0" title="暂无拼团商品,去看看其他商品吧~~" :imgSrc="urlDomain+'crmebimage/presets/noActivity.png'"></emptyPage>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCombinationIndexApi} from '@/api/activity.js';
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
import emptyPage from '@/components/emptyPage.vue'
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'homeGroup',
|
||||
components: {
|
||||
easyLoadimage,
|
||||
emptyPage
|
||||
},
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlDomain: this.$Cache.get("imgHost"),
|
||||
listStyle: 0,
|
||||
logoUrl: null,
|
||||
typeShow: [0, 1, 2, 3],
|
||||
groupBtnShow: true,
|
||||
selectStyle: '',
|
||||
titleConfig: '',
|
||||
selectBgImg: '',
|
||||
bgImgUrl: '',
|
||||
headerTitleStyle: 0,
|
||||
old: {
|
||||
scrollTop: 0
|
||||
},
|
||||
groupInfo: {},
|
||||
groupProductList: [],
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//容器样式
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return [{
|
||||
'border-radius': this.dataConfig.bgStyle.val ? 2 * this.dataConfig.bgStyle.val + 'rpx' : '0'
|
||||
},
|
||||
{
|
||||
margin: 0 + ' ' + 2 * this.dataConfig.lrConfig.val + 'rpx' + ' ' + 0
|
||||
},
|
||||
{
|
||||
background: `linear-gradient(to right,${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
},
|
||||
];
|
||||
},
|
||||
//边距
|
||||
boxPadding() {
|
||||
return [{
|
||||
padding: 2 * this.dataConfig.upConfig.val + 'rpx' + ' ' + '0rpx' + ' ' + 2 * this.dataConfig
|
||||
.downConfig.val + 'rpx',
|
||||
},
|
||||
{
|
||||
margin: 2 * this.dataConfig.mbConfig.val + 'rpx' + ' ' + 0 + ' ' + 0
|
||||
},
|
||||
]
|
||||
},
|
||||
//背景颜色
|
||||
boxBgStyle() {
|
||||
return [{
|
||||
gap: this.listStyle != 3 ? `${2*this.dataConfig.contentConfig.val}rpx` : ''
|
||||
},
|
||||
{
|
||||
background: `linear-gradient(to right,${this.dataConfig.contentBgColor.color[0].item}, ${this.dataConfig.contentBgColor.color[1].item})`,
|
||||
},
|
||||
];
|
||||
},
|
||||
fourStyle() {
|
||||
return {
|
||||
'margin-right': this.listStyle == 3 ? `${2*this.dataConfig.contentConfig.val}rpx` : ''
|
||||
}
|
||||
},
|
||||
//标题颜色
|
||||
titleColor() {
|
||||
return {
|
||||
color: this.dataConfig.titleColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//头部按钮颜色
|
||||
headerBtnColor() {
|
||||
return {
|
||||
color: this.dataConfig.headerBtnColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//商品名称颜色
|
||||
nameColor() {
|
||||
return {
|
||||
color: this.dataConfig.nameColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//商品原价颜色
|
||||
originalColor() {
|
||||
return {
|
||||
color: this.dataConfig.originalColor.color[0].item,
|
||||
};
|
||||
},
|
||||
//拼团价格颜色
|
||||
priceColor() {
|
||||
return {
|
||||
color: this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.priceColor.color[0].item:this.themeColor,
|
||||
};
|
||||
},
|
||||
//标签颜色
|
||||
groupTitleColor() {
|
||||
return {
|
||||
background: this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.groupTitleColor.color[0].item:this.themeColor,
|
||||
};
|
||||
},
|
||||
//已拼颜色
|
||||
groupTitleFontColor() {
|
||||
return {
|
||||
color: this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.groupTitleColor.color[0].item:this.themeColor,
|
||||
}
|
||||
},
|
||||
//分割线颜色
|
||||
lineColor() {
|
||||
return {
|
||||
border: `1rpx solid ${this.dataConfig.lineColor.color[0].item}`,
|
||||
};
|
||||
},
|
||||
//按钮颜色
|
||||
btnColor() {
|
||||
return [{
|
||||
background: `linear-gradient(to right,${this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.btnColor.color[0].item:'#FF7931'}, ${this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.btnColor.color[1].item:this.themeColor})`,
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.btnFontColor.color[0].item,
|
||||
}
|
||||
];
|
||||
},
|
||||
//样式一内容边距
|
||||
contentConfig() {
|
||||
return {
|
||||
'paddingBottom': 2 * this.dataConfig.contentConfig.val + 'rpx',
|
||||
};
|
||||
},
|
||||
//背景图片
|
||||
bgImgStyle() {
|
||||
return {
|
||||
'background': this.selectBgImg == 0 ? `url(${this.bgImgUrl})` :
|
||||
`linear-gradient(to right,${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
};
|
||||
},
|
||||
//标题文字格式
|
||||
headerTitleConfig() {
|
||||
return [{
|
||||
'font-weight': this.headerTitleStyle == 0 ? 600 : ''
|
||||
},
|
||||
{
|
||||
'font-style': this.headerTitleStyle == 2 ? 'italic' : 'normal'
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.headerTitleColor.color[0].item,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.setConfig()
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//去拼团
|
||||
toGroupDetail(id){
|
||||
uni.navigateTo({
|
||||
url:`/pages/activity/goods_combination_details/index?id=${id}`
|
||||
})
|
||||
},
|
||||
getInfo() {
|
||||
let that = this;
|
||||
getCombinationIndexApi().then(function(res) {
|
||||
that.groupProductList = res.data.productList;
|
||||
that.groupInfo = {totalPeople:res.data.totalPeople,avatarList:res.data.avatarList}
|
||||
}).catch((res) => {
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
})
|
||||
},
|
||||
scroll: function(e) {
|
||||
this.old.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
// 更多
|
||||
toMore() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/goods_combination/index'
|
||||
})
|
||||
},
|
||||
setConfig() {
|
||||
this.listStyle = this.dataConfig.tabConfig.tabVal;
|
||||
this.logoUrl = this.dataConfig.logoConfig.url;
|
||||
this.typeShow = this.dataConfig.typeConfig.activeValue;
|
||||
this.groupBtnShow = this.dataConfig.groupBtnConfig.tabVal == 0 ? true : false;
|
||||
this.selectStyle = this.dataConfig.selectStyle.tabVal;
|
||||
this.titleConfig = this.dataConfig.titleConfig.val;
|
||||
this.selectBgImg = this.dataConfig.selectBgImg.tabVal;
|
||||
this.bgImgUrl = this.dataConfig.bgImg.url;
|
||||
this.headerTitleStyle = this.dataConfig.headerTitleStyle.tabVal;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.groupBox {
|
||||
overflow: hidden;
|
||||
|
||||
.group {
|
||||
overflow: hidden;
|
||||
|
||||
.group-top {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
padding: 0 24rpx;
|
||||
background-size: cover !important;
|
||||
.group-top-left {
|
||||
align-items: center;
|
||||
.ml10{
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
.logo {
|
||||
width: 154rpx;
|
||||
height: 32rpx;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.interval {
|
||||
width: 0rpx;
|
||||
height: 28rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 4rpx;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.pinkHead {
|
||||
width: 108rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
font-size: 26rpx;
|
||||
margin-left: 16rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
.num1{
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
.num2{
|
||||
margin-left: 41rpx;
|
||||
}
|
||||
.num3{
|
||||
margin-left: 76rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.group-top-right {
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.icon-xiangyou {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom {
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
|
||||
.img {
|
||||
width: 240rpx;
|
||||
// height: 240rpx;
|
||||
// background: #F3F9FF;
|
||||
|
||||
}
|
||||
|
||||
.big-img.img {
|
||||
width: 100%;
|
||||
height: 324rpx;
|
||||
}
|
||||
|
||||
.three-img.img {
|
||||
width: 100%;
|
||||
height: 210rpx;
|
||||
}
|
||||
.loadimage{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.four-img {
|
||||
width: 240rpx;
|
||||
height: 240rpx;
|
||||
}
|
||||
|
||||
.group-bottom-right {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
|
||||
.right-top {
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.people-box {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.pink {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.people {
|
||||
color: #fff;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.groupNum {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
margin-left: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-bottom {
|
||||
|
||||
.price {
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.pinkNum-num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
// margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
.btn {
|
||||
padding: 12rpx 20rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom.two {
|
||||
.two-item {
|
||||
width: 100%;
|
||||
|
||||
.title {
|
||||
margin-top: 20rpx;
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 4rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
width: 210rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.two-item-bottom {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.otNum {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom.three {
|
||||
.three-box{
|
||||
position: relative;
|
||||
}
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 16rpx;
|
||||
font-size: 22rpx;
|
||||
// z-index: 9;
|
||||
}
|
||||
|
||||
.two-item {
|
||||
width: 100%;
|
||||
|
||||
.title {
|
||||
margin-top: 18rpx;
|
||||
// width: 100%;
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
width: 180rpx;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.two-item-bottom {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.otNum {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-bottom.four {
|
||||
overflow: hidden;
|
||||
flex-wrap: nowrap;
|
||||
position: relative;
|
||||
.four-item{
|
||||
position: relative;
|
||||
}
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 32rpx;
|
||||
font-size: 22rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
|
||||
.two-item {
|
||||
width: 210rpx;
|
||||
|
||||
.title {
|
||||
margin-top: 18rpx;
|
||||
|
||||
.numPink {
|
||||
color: #ffffff;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 32rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
width: 210rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.two-item-bottom {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.pinkNum {
|
||||
|
||||
.num {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.otNum {
|
||||
font-size: 26rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
|
||||
.btn {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.grid-list {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.grid-three {
|
||||
width: 100%;
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.titleFont {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.scroll_view {
|
||||
white-space: nowrap;
|
||||
|
||||
.four-item {
|
||||
display: inline-block;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.num-icon {
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
.numPink {
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
.numPink-box {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.numPink-box-special {
|
||||
position: absolute;
|
||||
left: 10rpx;
|
||||
top: 10rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
.avater-box{
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: end;
|
||||
margin-top: 4rpx;
|
||||
image{
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.avater1{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.avater2{
|
||||
position: absolute;
|
||||
margin-left: 48rpx;
|
||||
}
|
||||
.avater3{
|
||||
position: absolute;
|
||||
left: 78rpx;
|
||||
}
|
||||
}
|
||||
.regular{
|
||||
line-height: 34rpx !important;
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
.icon-you{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
62
app/components/homeIndex/guide.vue
Normal file
62
app/components/homeIndex/guide.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<!-- 辅助线 -->
|
||||
<view>
|
||||
<view class="lines" :style="[boxStyle]">
|
||||
<view class="item" :style="[lineStyle]"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: 'guide',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
}
|
||||
},
|
||||
//线条样式
|
||||
lineStyle() {
|
||||
return {
|
||||
borderBottomWidth: 2*this.dataConfig.heightConfig.val + 'rpx',
|
||||
borderBottomColor: this.dataConfig.lineColor.color[0].item,
|
||||
borderBottomStyle: this.dataConfig.lineStyle.list[this.dataConfig.lineStyle.tabVal].style
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.lines {
|
||||
padding: 0 20rpx;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
border-bottom-color: #666;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: dotted;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
341
app/components/homeIndex/headerSearch.vue
Normal file
341
app/components/homeIndex/headerSearch.vue
Normal file
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<!-- 搜索框 -->
|
||||
<view>
|
||||
<view class="mp-header">
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="sys-head tui-skeleton" :style="{ height: `${isSmallPage?0:statusBarHeight}px` }"></view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP -->
|
||||
<view class="serch-box tui-skeleton" :style="[boxStyle]" style="height: 43px;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP -->
|
||||
<view class="serch-box tui-skeleton" :style="[boxStyle]">
|
||||
<!-- #endif -->
|
||||
<view class="serch-wrapper flex">
|
||||
<view v-if="logoConfig" class="logo skeleton-rect">
|
||||
<image :src="logoUrl" mode=""></image>
|
||||
</view>
|
||||
<navigator :style="[contentStyle]" v-if="hotWords.length > 0"
|
||||
:url="'/pages/goods/goods_search/index?searchVal='+searchVal"
|
||||
:class="logoConfig&&!isSmallPage ? 'input' : logoConfig&&isSmallPage?'uninput':!logoConfig&&!isSmallPage?'uninput':'maxInput'" hover-class="none" class=" input skeleton-rect">
|
||||
<view class='swiperTxt'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
|
||||
:duration="duration" vertical="true" circular="true" @change="textChange">
|
||||
<block v-for="(item,index) in hotWords" :key='index'>
|
||||
<swiper-item catchtouchmove='catchTouchMove'>
|
||||
<view class='acea-row row-between-wrapper'>
|
||||
<view class='text'>
|
||||
<view class='newsTitle line1'><text class="iconfont icon-sousuo"></text><text>{{item.val}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator :style="[contentStyle]" hover-class="none" v-else url="/pages/goods/goods_search/index"
|
||||
:class="logoConfig&&!isSmallPage ? 'input' : logoConfig&&isSmallPage?'uninput':!logoConfig&&!isSmallPage?'uninput':'maxInput'" class="skeleton-rect">
|
||||
<text class="line1">{{placeWords}}</text>
|
||||
<text class="iconfont icon-xiazai5"></text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view :style="'height:'+marTop+'px;'"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'headerSerch',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
//是否为微页面
|
||||
isSmallPage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//是否开始滚动
|
||||
isScrolled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight: app.globalData.statusBarHeight,
|
||||
indicatorDots: false,
|
||||
autoplay: true,
|
||||
duration: 500,
|
||||
marTop: 0,
|
||||
searchH: 0,
|
||||
searchVal: '',
|
||||
searchTop:0,
|
||||
searchRight:0,
|
||||
searchHeight:0,
|
||||
statusWidth:0,
|
||||
searchBoxHeight:0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//轮播切换时间
|
||||
interval(){
|
||||
return this.dataConfig.titleConfig.val * 1000
|
||||
},
|
||||
//判断logo图是否展示
|
||||
logoConfig() {
|
||||
return this.dataConfig.logoConfig.url && this.dataConfig.searConfig.tabVal === 1
|
||||
},
|
||||
//logo图
|
||||
logoUrl() {
|
||||
if(this.isScrolled&&this.dataConfig.logoFixConfig.url){
|
||||
return this.dataConfig.logoFixConfig.url
|
||||
}else{
|
||||
return this.dataConfig.logoConfig.url
|
||||
}
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: 0 + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
// #ifdef MP
|
||||
height:this.searchBoxHeight + 'px',
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//搜索热词
|
||||
hotWords() {
|
||||
return this.dataConfig.hotWords.list
|
||||
},
|
||||
//内容圆角
|
||||
contentStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.contentStyle.val ? this.dataConfig.contentStyle.val + 'px' : '0',
|
||||
background: this.dataConfig.borderColor.color[0].item,
|
||||
color: this.dataConfig.textColor.color[0].item,
|
||||
textAlign: this.dataConfig.textPosition.list[this.dataConfig.textPosition.tabVal].style,
|
||||
// #ifdef MP
|
||||
height:this.searchHeight + 'px',
|
||||
flex:!this.isSmallPage?1:'',
|
||||
marginRight:!this.isSmallPage?(this.statusWidth + this.searchRight+'px'):'',
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//搜索提示语
|
||||
placeWords(){
|
||||
return this.dataConfig.placeWords.val;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 使用nextTick,确保页面更新结束后,再请求高度
|
||||
// #ifdef MP || APP-PLUS
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
// 获取小程序头部高度
|
||||
let info = uni.createSelectorQuery().in(this).select(".serch-box");
|
||||
info.boundingClientRect((data)=> {
|
||||
this.marTop = this.isSmallPage ? data.height :data.height + this.statusBarHeight
|
||||
}).exec()
|
||||
}, 100)
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
const res = uni.getMenuButtonBoundingClientRect()
|
||||
const statusHeight = res.top //胶囊距离顶部
|
||||
const statusRight = res.right //胶囊右边界坐标
|
||||
const jnHeight = res.height //胶囊高度
|
||||
this.statusWidth= res.width
|
||||
this.searchTop=statusHeight-this.statusBarHeight
|
||||
this.searchHeight=jnHeight
|
||||
this.searchBoxHeight = this.searchTop*2 + jnHeight
|
||||
//搜索框宽度计算
|
||||
uni.getSystemInfo({
|
||||
success:res=>{
|
||||
this.searchRight=res.windowWidth-statusRight-this.dataConfig.lrConfig.val
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
this.marTop = 43
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
textChange(e) {
|
||||
let {
|
||||
current,
|
||||
source
|
||||
} = e.detail;
|
||||
if (source === 'autoplay' || source === 'touch') {
|
||||
this.searchVal = this.hotWords[e.detail.current]['val'];
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.ml40 {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
.sys-head{
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.header {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
|
||||
.btn {
|
||||
position: relative;
|
||||
|
||||
.iconfont {
|
||||
font-size: 45rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.iconnum {
|
||||
min-width: 6px;
|
||||
color: #fff;
|
||||
border-radius: 15rpx;
|
||||
position: absolute;
|
||||
right: -10rpx;
|
||||
top: -10rpx;
|
||||
font-size: 10px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.serch-wrapper {
|
||||
align-items: center;
|
||||
padding: 20rpx 24rpx 20rpx 24rpx;
|
||||
|
||||
.logo {
|
||||
width: 152rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.swiperTxt {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 58rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.swiperTxt .text {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.swiperTxt .text .label {
|
||||
font-size: 20rpx;
|
||||
color: #ff4c48;
|
||||
width: 64rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 28rpx;
|
||||
border: 2rpx solid #ff4947;
|
||||
}
|
||||
|
||||
.swiperTxt .text .newsTitle {
|
||||
// width: 300rpx;
|
||||
font-size: 24rpx;
|
||||
// text-align: center;
|
||||
/* #ifdef MP */
|
||||
// width: 260rpx !important;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.swiperTxt swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mp-header {
|
||||
z-index: 90;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
|
||||
.logo {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.serch-wrapper {
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
image {
|
||||
width: 152rpx;
|
||||
height: 60rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.input,
|
||||
.uninput {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* #ifdef MP*/
|
||||
width: 50%;
|
||||
/* #endif */
|
||||
/* #ifdef H5 || APP*/
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
/* #endif */
|
||||
height: 58rpx;
|
||||
line-height: 58rpx;
|
||||
padding: 0 20rpx 0 54rpx;
|
||||
background: rgba(0, 0, 0, 0.22);
|
||||
border: 1px solid #E4E4E4;
|
||||
border-radius: 29rpx;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
|
||||
.iconfont {
|
||||
// position: absolute;
|
||||
left: 14rpx;
|
||||
font-size: 26rpx;
|
||||
//top: 10rpx;
|
||||
}
|
||||
.line1{
|
||||
display: inline-block;
|
||||
width: 400rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.uninput {
|
||||
/* #ifdef MP */
|
||||
width: 75% ;
|
||||
/* #endif */
|
||||
/* #ifndef MP */
|
||||
width: 100%;
|
||||
/* #endif */
|
||||
}
|
||||
}
|
||||
}
|
||||
.maxInput{
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
937
app/components/homeIndex/homeComb.vue
Normal file
937
app/components/homeIndex/homeComb.vue
Normal file
@@ -0,0 +1,937 @@
|
||||
<template>
|
||||
<!-- 组合组件 -->
|
||||
<view class="page_count tui-skeleton" :data-theme="theme">
|
||||
<!--logo-->
|
||||
<view class="bg-img" :style="{'background-image': bgColor}">
|
||||
<img :src="bgColor" alt="">
|
||||
<view class="maskBg" :style="[maskBgStyle]"></view>
|
||||
</view>
|
||||
<!--头部-->
|
||||
<view :class="{scrolled:isScrolled, 'my-main': true}" :style="{ height: myMainHeight+'px' }">
|
||||
<!--搜索-->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="header">
|
||||
<view class="serch-wrapper acea-row">
|
||||
<view v-if="logoConfig" class="logo skeleton-rect">
|
||||
<image :src="logoUrl" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<navigator v-if="hotWords.length > 0" :url="'/pages/goods/goods_search/index?searchVal='+searchVal"
|
||||
:style="[searchBoxStyle]" :class="logoConfig ? 'input' : 'uninput'" hover-class="none"
|
||||
class="input">
|
||||
<view class='swiperTxt'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="true" :interval="interval"
|
||||
:duration="duration" vertical="true" circular="true" @change="textChange">
|
||||
<block v-for="(item,index) in hotWords" :key='index'>
|
||||
<swiper-item catchtouchmove='catchTouchMove'>
|
||||
<view class=''>
|
||||
<view class='text'>
|
||||
<view class='newsTitle line1'><text
|
||||
class="iconfont icon-sousuo"></text><text>{{item.val}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator v-else :style="[searchBoxStyle]" :class="logoConfig ? 'input' : 'uninput'"
|
||||
url="/pages/goods/goods_search/index" class="input" hover-class="none">
|
||||
<text class="iconfont icon-sousuo8"></text>
|
||||
<text class="line1">{{placeWords}}</text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP || APP-PLUS-->
|
||||
<view class="mp-header">
|
||||
<view class="sys-head" :style="{ height: `${isSmallPage?0:statusBarHeight}px`}"></view>
|
||||
<!-- #ifdef MP -->
|
||||
<view class="serch-box" :style="{ 'margin-top': `${searchTop}px`,'height': `${searchHeight}px`}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="serch-box" style="margin-top: 9px;margin-right: 2px;">
|
||||
<!-- #endif -->
|
||||
<view class="serch-wrapper acea-row">
|
||||
<view v-if="logoConfig" class="logo tui-skeleton-rect">
|
||||
<image :src="logoUrl" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<navigator v-if="hotWords.length > 0"
|
||||
:url="'/pages/goods/goods_search/index?searchVal='+searchVal" :style="[searchBoxStyle]"
|
||||
hover-class="none" class="input" :class="logoConfig&&!isSmallPage ? 'input' : 'uninput'">
|
||||
<view class='swiperTxt'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="true" :interval="interval"
|
||||
:duration="duration" vertical="true" circular="true" @change="textChange">
|
||||
<block v-for="(item,index) in hotWords" :key='index'>
|
||||
<swiper-item catchtouchmove='catchTouchMove'>
|
||||
<view class='acea-row row-between-wrapper text-box'>
|
||||
<view class='text'>
|
||||
<view class='newsTitle line1'><text
|
||||
class="iconfont icon-sousuo"></text><text>{{item.val}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</navigator>
|
||||
<navigator v-else :style="[searchBoxStyle]" :class="logoConfig ? 'input' : 'uninput'"
|
||||
url="/pages/goods/goods_search/index" class="input" hover-class="none">
|
||||
<text class="iconfont icon-sousuo8"></text>
|
||||
<text class="line1">{{placeWords}}</text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view v-if="tabShowConfig" class="navTabBox tabNav tui-skeletonpictrue acea-row" :style="'top:'+isTop">
|
||||
<view class="longTab">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation
|
||||
:scroll-left="tabLeft" show-scrollbar="true">
|
||||
<view class="longItem" :data-index="index" v-for="(item,index) in tabList" :key="index"
|
||||
:id="'id'+index" @click="longClick(index,item)"
|
||||
:class="tabClick === index? 'navChecked':''">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name tui-skeleton-rect">{{item.title}}</view>
|
||||
<view class="underlineBox" v-if="index===tabClick">
|
||||
<!-- <view class="underline"></view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="category">
|
||||
<text v-if="isShow" class="iconfont icon-xiangshang" @click="isShow=false"></text>
|
||||
<text v-if="!isShow" class="iconfont icon-xiangxia" @click="isShow=true"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isShow" class="navChangeBox" catchtouchmove="true" :style="'top:'+isTop">
|
||||
<view class="navChange">
|
||||
<block v-for="(item,index) in tabList" :key="index">
|
||||
<view class="titleBox">
|
||||
<text :class="tabClick === index ? 'checkColor' : 'textColor' " class="title line1"
|
||||
:id="'id'+index" @click="longClick(index,item)">{{item.title}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="!isShow" @click="isShow=false"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- banner -->
|
||||
<view class="swiperBg" :style="{ marginTop: swiperTop+'px'}">
|
||||
<view class="swiper page_swiper" v-if="navIndex === 0">
|
||||
<swiper :autoplay="true" :circular="circular" :interval="intervalBanner" :duration="duration"
|
||||
:previous-margin="swiperType==0?'30rpx':''" :next-margin="swiperType==0?'30rpx':''"
|
||||
:current="swiperCur" @change="swiperChange">
|
||||
<block v-for="(item,index) in banner" :key="index">
|
||||
<swiper-item :style="[contentStyleBanner]" :class="{ active: index == swiperCur }"
|
||||
class="scalex">
|
||||
<view @click="menusTap(item.info[1].value)"
|
||||
class='slide-navigator acea-row row-between-wrapper tui-skeleton-rect'
|
||||
:class="swiperType==0?'row-between-wrapper-1':'row-between-wrapper-2'">
|
||||
<image mode="aspectFill" :style="[contentStyleBanner]" :src="item.img"
|
||||
class="slide-image aa"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view v-if="docType === 0" class="dots" :style="[dotStyle]">
|
||||
<block v-for="(item,index) in banner" :key="index">
|
||||
<view class="dot-item"
|
||||
:style="{'background-color': swiperCur === index ? (dataConfig.themeStyleConfig.tabVal?dataConfig.docColor.color[0].item:themeColor) : ''}">
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="docType === 1" class="dots" :style="[dotStyle]">
|
||||
<block v-for="(item,index) in banner" :key="index">
|
||||
<view class="dot"
|
||||
:style="{'background-color': swiperCur === index ? (dataConfig.themeStyleConfig.tabVal?dataConfig.docColor.color[0].item:themeColor) : ''}">
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
let app = getApp();
|
||||
import {
|
||||
goPage
|
||||
} from '@/libs/iframe.js'
|
||||
import animationType from '@/utils/animationType.js'
|
||||
export default {
|
||||
name: 'homeComb',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
//判断首页显示内容,1显示分类页和商品,0首页
|
||||
navIndex: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
//是否开始滚动
|
||||
isScrolled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//是否为微页面
|
||||
isSmallPage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
//页面设置信息
|
||||
bgInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
myMainHeight: 0, //头部tab切换页和搜索按钮的高度和
|
||||
indicatorDots: false,
|
||||
circular: true,
|
||||
autoplay: false,
|
||||
duration: 500,
|
||||
searchH: 0,
|
||||
swiperTop: 0,
|
||||
statusBarHeight: app.globalData.statusBarHeight, //手机端头部显示时间位置的高度
|
||||
swiperCur: 0,
|
||||
showSkeleton: true,
|
||||
tabClick: 0, //导航栏被点击
|
||||
isLeft: 0, //导航栏下划线位置
|
||||
isWidth: 0, //每个导航栏占位
|
||||
mainWidth: app.globalData.mainWidth,
|
||||
theme: app.globalData.theme,
|
||||
tabLeft: 0,
|
||||
bgColor: '',
|
||||
isTop: 0,
|
||||
navHeight: 0,
|
||||
isShow: false,
|
||||
marTop: 0,
|
||||
searchVal: '',
|
||||
intervalBanner: 2500,
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme),
|
||||
searchTop:0,
|
||||
searchRight:0,
|
||||
searchHeight:0,
|
||||
statusWidth:0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
banner: {
|
||||
handler(val) {
|
||||
this.bgColor = val[0].img;
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
//分类是否展示,0展示,1不展示
|
||||
tabShowConfig() {
|
||||
return this.dataConfig.tabShowConfig.tabVal == 0;
|
||||
},
|
||||
//搜索提示语
|
||||
placeWords() {
|
||||
return this.dataConfig.placeWords.val;
|
||||
},
|
||||
//轮播切换时间
|
||||
interval() {
|
||||
return this.dataConfig.titleConfig.val * 1000
|
||||
},
|
||||
//指示器类型,0圆,1直,2无
|
||||
docType() {
|
||||
return this.dataConfig.docConfig.tabVal
|
||||
},
|
||||
//轮播图样式
|
||||
swiperType() {
|
||||
return this.dataConfig.swiperStyleConfig.tabVal
|
||||
},
|
||||
//搜索热词列表
|
||||
hotWords() {
|
||||
return this.dataConfig.hotWords.list
|
||||
},
|
||||
//分类选中颜色
|
||||
lineColor() {
|
||||
return {
|
||||
backgroundColor: this.dataConfig.checkColor.color[0].item
|
||||
}
|
||||
},
|
||||
maskBgStyle() {
|
||||
return {
|
||||
background: this.bgInfo.isBgColor=='1' ?
|
||||
`linear-gradient(180deg, rgba(245, 245, 245, 0) 0%, ${this.bgInfo.colorPicker} 100%)` :
|
||||
`linear-gradient(180deg, rgba(245, 245, 245, 0) 0%, #f5f5f5 100%)`,
|
||||
}
|
||||
},
|
||||
//判断logo图是否展示
|
||||
logoConfig() {
|
||||
return this.dataConfig.logoConfig.url && this.dataConfig.searConfig.tabVal === 1
|
||||
},
|
||||
//logo图
|
||||
logoUrl() {
|
||||
if (this.isScrolled && this.dataConfig.logoFixConfig.url) {
|
||||
return this.dataConfig.logoFixConfig.url
|
||||
} else {
|
||||
return this.dataConfig.logoConfig.url
|
||||
}
|
||||
},
|
||||
//标签文字颜色
|
||||
textColor() {
|
||||
return this.dataConfig.fontColor.color[0].item;
|
||||
},
|
||||
//分类列表
|
||||
tabList() {
|
||||
//type=0微页面,1分类,2首页
|
||||
let tabList = this.dataConfig.listConfig.list;
|
||||
tabList.unshift({
|
||||
title: '首页',
|
||||
type: 2,
|
||||
val: 0
|
||||
})
|
||||
return tabList
|
||||
},
|
||||
//轮播列表
|
||||
banner() {
|
||||
return this.dataConfig.swiperConfig.list
|
||||
},
|
||||
//搜索框样式
|
||||
searchBoxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.contentStyle.val ? this.dataConfig.contentStyle.val + 'px' : '0',
|
||||
backgroundColor: this.dataConfig.borderColor.color[0].item,
|
||||
color: this.dataConfig.textColor.color[0].item,
|
||||
textAlign: this.dataConfig.textPosition.list[this.dataConfig.textPosition.tabVal].style,
|
||||
// #ifdef MP
|
||||
height:this.searchHeight + 'px',
|
||||
flex:!this.isSmallPage?1:'',
|
||||
marginRight:!this.isSmallPage?(this.statusWidth + this.searchRight+'px'):'',
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//指示器样式
|
||||
dotStyle() {
|
||||
return {
|
||||
padding: '0 40rpx',
|
||||
justifyContent: this.dataConfig.txtStyle.tabVal === 1 ? 'center' : this.dataConfig.txtStyle
|
||||
.tabVal === 2 ? 'flex-end' : 'flex-start'
|
||||
}
|
||||
},
|
||||
//轮播图圆角
|
||||
contentStyleBanner() {
|
||||
return {
|
||||
'borderRadius': this.dataConfig.contentStyleBanner.val ? this.dataConfig.contentStyleBanner
|
||||
.val + 'px' : '0'
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// #ifdef MP || APP-PLUS
|
||||
this.isTop = (this.isSmallPage ? 0 : this.statusBarHeight) + 48 + 'px' //分类的top值
|
||||
// this.tabShowConfig,true有分类,false无分类
|
||||
if (!this.tabShowConfig) {
|
||||
this.myMainHeight = (this.isSmallPage ? 0 : this.statusBarHeight) + 40 + 10; //头部tab切换页和搜索按钮的高度和,10是下边距
|
||||
} else {
|
||||
this.myMainHeight = (this.isSmallPage ? 0 : this.statusBarHeight) + 40 + 42; //头部tab切换页和搜索按钮的高度和
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
const res = uni.getMenuButtonBoundingClientRect()
|
||||
const statusHeight = res.top //胶囊距离顶部
|
||||
const statusRight = res.right //胶囊右边界坐标
|
||||
const jnHeight = res.height //胶囊高度
|
||||
this.statusWidth= res.width
|
||||
this.searchTop=statusHeight-this.statusBarHeight
|
||||
this.searchHeight=jnHeight
|
||||
//搜索框宽度计算
|
||||
uni.getSystemInfo({
|
||||
success:res=>{
|
||||
this.searchRight=res.windowWidth-statusRight
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
this.isTop = 0
|
||||
this.myMainHeight = 'auto';
|
||||
|
||||
// #endif
|
||||
|
||||
this.isWidth = (this.mainWidth - 65) / 4;
|
||||
setTimeout((e) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.header').boundingClientRect(res => {
|
||||
if (res) this.marTop = res.height //头部的高度
|
||||
}).exec();
|
||||
|
||||
//展示与不展示分类的距离值判断
|
||||
if (!this.tabShowConfig) {
|
||||
// 不展示分类
|
||||
query.select('.swiperBg').boundingClientRect(res => {
|
||||
// #ifdef H5
|
||||
this.swiperTop = this.navHeight + this.marTop + this.statusBarHeight +
|
||||
4; //轮播图的top值
|
||||
//#endif
|
||||
// #ifndef H5
|
||||
if (this.isSmallPage) {
|
||||
this.swiperTop = this.statusBarHeight; //轮播图的top值
|
||||
} else {
|
||||
this.swiperTop = this.statusBarHeight + 48; //轮播图的top值
|
||||
}
|
||||
//#endif
|
||||
}).exec();
|
||||
} else {
|
||||
//展示分类
|
||||
query.select('.navTabBox').boundingClientRect(data => {
|
||||
this.navHeight = data.height //元素navHeight的高度
|
||||
// #ifdef H5
|
||||
this.swiperTop = this.navHeight + this.marTop + this.statusBarHeight +
|
||||
4; //轮播图的top值
|
||||
//#endif
|
||||
// #ifndef H5
|
||||
if (this.isSmallPage) {
|
||||
this.swiperTop = 85; //轮播图的top值
|
||||
} else {
|
||||
this.swiperTop = this.statusBarHeight + 85; //轮播图的top值
|
||||
}
|
||||
//#endif
|
||||
}).exec();
|
||||
}
|
||||
|
||||
}, 200)
|
||||
},
|
||||
methods: {
|
||||
//轮播图跳转
|
||||
menusTap(url) {
|
||||
this.$util.navigateTo(url);
|
||||
},
|
||||
swiperChange(e) {
|
||||
let {
|
||||
current,
|
||||
source
|
||||
} = e.detail;
|
||||
if (source === 'autoplay' || source === 'touch') {
|
||||
this.swiperCur = e.detail.current;
|
||||
this.bgColor = this.banner[e.detail.current]['img']
|
||||
}
|
||||
},
|
||||
textChange(e) {
|
||||
let {
|
||||
current,
|
||||
source
|
||||
} = e.detail;
|
||||
if (source === 'autoplay' || source === 'touch') {
|
||||
this.searchVal = this.hotWords[e.detail.current]['val']
|
||||
}
|
||||
},
|
||||
// 导航栏点击
|
||||
longClick(index, item) {
|
||||
this.tabClick = index; //设置导航点击了哪一个
|
||||
this.$nextTick(() => {
|
||||
let id = 'id' + index;
|
||||
this.tabLeft = (index - 2) * this.isWidth //设置下划线位置
|
||||
this.$emit('changeTab', index, item);
|
||||
})
|
||||
},
|
||||
parentEmit(id, index) {
|
||||
this.$emit('changeTab', id, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uninput {
|
||||
/* #ifdef MP */
|
||||
width: 510rpx !important;
|
||||
/* #endif */
|
||||
/* #ifndef MP */
|
||||
width: 100% !important;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.icon-sousuo8 {
|
||||
font-size: 15px;
|
||||
|
||||
}
|
||||
|
||||
.bgwhite {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.mask {
|
||||
z-index: 999;
|
||||
top: 260rpx;
|
||||
}
|
||||
|
||||
.navChangeBox {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.navChange {
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
z-index: 999999;
|
||||
width: 100%;
|
||||
border-radius: 0px 0px 16rpx 16rpx;
|
||||
padding: 24rpx 20rpx;
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
grid-column-gap: 10rpx;
|
||||
grid-row-gap: 20rpx;
|
||||
|
||||
.nobg {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.titleBox {
|
||||
height: 58rpx;
|
||||
background: #F2F2F2;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0 auto;
|
||||
display: inline-block;
|
||||
width: 118rpx;
|
||||
height: 58rpx;
|
||||
line-height: 58rpx;
|
||||
text-align: center;
|
||||
|
||||
opacity: 1;
|
||||
color: #333333;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.titleBox:nth-child(5n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.titleBox:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.changed {
|
||||
border-radius: 8rpx;
|
||||
@include cate-two-btn(theme);
|
||||
@include coupons_border_color(theme);
|
||||
|
||||
.title {
|
||||
@include main_color(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.row-middle {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.navTabBox {
|
||||
width: 100%;
|
||||
height: 66rpx;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
position: relative;
|
||||
padding: 0 24rpx 0 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
z-index: 9;
|
||||
|
||||
&.isFixed {
|
||||
z-index: 10;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
/* #ifdef H5 */
|
||||
top: 0;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.click {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.longTab {
|
||||
width: 94%;
|
||||
|
||||
.longItem {
|
||||
//height: 72rpx;
|
||||
display: inline-block;
|
||||
// line-height: 52rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 42rpx;
|
||||
|
||||
&.click {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.name {
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.underlineBox {
|
||||
margin-top: 8rpx;
|
||||
height: 3px;
|
||||
transition: .5s;
|
||||
|
||||
.underline {
|
||||
width: 33rpx;
|
||||
height: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.category {
|
||||
height: 66rpx;
|
||||
line-height: 46rpx;
|
||||
z-index: 3;
|
||||
|
||||
// padding: 0 15rpx 0 25rpx;
|
||||
.iconfont {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.swiperBg {
|
||||
z-index: 1;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.colorBg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 130rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page_swiper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
z-index: 8;
|
||||
padding: 0rpx 20rpx 0rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 310rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.acea-row.row-between-wrapper {
|
||||
height: 310rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.acea-row.row-between-wrapper-1 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.acea-row.row-between-wrapper-2 {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
swiper {
|
||||
width: 100%;
|
||||
display: block;
|
||||
height: 310rpx;
|
||||
|
||||
&.scalex {
|
||||
/deep/.uni-swiper-slide-frame {
|
||||
transform: translate(0, 0) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
image {
|
||||
transform: scale(0.96);
|
||||
transition: all 0.6s ease;
|
||||
}
|
||||
|
||||
/deep/ swiper-item.active {
|
||||
image {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
/*用来包裹所有的小圆点 */
|
||||
.dots {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: absolute;
|
||||
bottom: 40rpx;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dot-item {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
background-color: rgba(255, 255, 255, .4);
|
||||
border-radius: 50%;
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
|
||||
/*未选中时的小圆点样式 */
|
||||
.dot {
|
||||
width: 16rpx;
|
||||
height: 6rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 6rpx;
|
||||
background-color: rgba(255, 255, 255, .4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scrolled {
|
||||
z-index: 5000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
background-color: #fff !important;
|
||||
color: #000 !important;
|
||||
transition: background-color .5s ease;
|
||||
|
||||
.longItem,
|
||||
.click,
|
||||
.category text {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.btn .iconfont {
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
.iconnum {
|
||||
background: #333 !important;
|
||||
}
|
||||
|
||||
.underline {
|
||||
background: #000 !important;
|
||||
}
|
||||
|
||||
.click {
|
||||
&::after {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.input,
|
||||
.uninput {
|
||||
|
||||
background-color: #eee !important;
|
||||
}
|
||||
}
|
||||
|
||||
.page_count {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
|
||||
.bg-img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
z-index: -1;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
z-index: 0;
|
||||
/* #endif */
|
||||
z-index: 0;
|
||||
filter: blur(0);
|
||||
overflow: hidden;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
filter: blur(30rpx);
|
||||
transform: scale(1.5);
|
||||
}
|
||||
|
||||
.maskBg {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 136px;
|
||||
background: linear-gradient(180deg, rgba(245, 245, 245, 0) 0%, #f5f5f5 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.my-main {
|
||||
left: 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 30;
|
||||
transition: background-color .5s ease;
|
||||
}
|
||||
|
||||
.page_count {
|
||||
|
||||
.header {
|
||||
width: 100%;
|
||||
padding: 24rpx;
|
||||
|
||||
.serch-wrapper {
|
||||
align-items: center;
|
||||
|
||||
.logo {
|
||||
width: 118rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 118rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 546rpx;
|
||||
height: 55rpx;
|
||||
padding-left: 20rpx;
|
||||
font-size: 26rpx;
|
||||
padding-right: 4rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.iconfont {
|
||||
margin-right: 4rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabNav {
|
||||
padding-top: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
.mp-header {
|
||||
z-index: 999;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
/* #ifdef H5 */
|
||||
padding-bottom: 20rpx;
|
||||
/* #endif */
|
||||
|
||||
.serch-wrapper {
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
padding: 0 24rpx 0 24rpx;
|
||||
|
||||
image {
|
||||
width: 118rpx;
|
||||
height: 42rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* #ifdef MP */
|
||||
width: 365rpx;
|
||||
/* #endif */
|
||||
/* #ifndef MP */
|
||||
width: 546rpx;
|
||||
/* #endif */
|
||||
/* #ifdef APP-PLUS */
|
||||
flex: 1;
|
||||
/* #endif */
|
||||
height: 50rpx;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.iconfont {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.swiperTxt {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 52rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.swiperTxt .text {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.swiperTxt .text .label {
|
||||
font-size: 20rpx;
|
||||
color: #ff4c48;
|
||||
width: 64rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 28rpx;
|
||||
border: 2rpx solid #ff4947;
|
||||
}
|
||||
|
||||
.swiperTxt .text .newsTitle {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.swiperTxt swiper {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.navChecked {
|
||||
font-size: 32rpx !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.checkColor {
|
||||
@include main_color(theme);
|
||||
}
|
||||
.text-box{
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
660
app/components/homeIndex/homeTab.vue
Normal file
660
app/components/homeIndex/homeTab.vue
Normal file
@@ -0,0 +1,660 @@
|
||||
<template>
|
||||
<!-- tab选项卡 -->
|
||||
<view class="index-product-wrapper" :style="[mbConfig]">
|
||||
<view class="nav-bd longTab" :style="[tabBgColor]">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex" :scroll-left="tabLeft">
|
||||
<view class="longItem"
|
||||
:style="'color:' + (index == ProductNavindex ? checkColor : fontColor)+';--color:'+checkColor"
|
||||
:data-index="index" :class="index===ProductNavindex?'click':''" v-for="(item,index) in navList"
|
||||
:key="index" :id="'id'+index" @click="ProductNavTab(item, index)">{{ item.val }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view :style="[boxStyle]">
|
||||
<!-- 单列 -->
|
||||
<block v-if="itemStyle == 0">
|
||||
<view class="listA" :style="[gridGap]">
|
||||
<view class="item" v-for="(item, index) in tempArr" :key="index" @click="goDetail(item)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
|
||||
</view>
|
||||
<view class="text-info text-add">
|
||||
<view>
|
||||
<view class="title line2" :style="[titleColor]" v-if="showArr.includes(0)">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<view class="price acea-row row-middle" :style="[priceColor]">
|
||||
<view v-if="showArr.includes(1)">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="old-price" v-if="showArr.includes(2)" :style="[soldColor]">
|
||||
已售 {{ item.sales || 0 }} {{ item.unitName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 两列 -->
|
||||
<block v-if="itemStyle == 1">
|
||||
<view class="listC" :style="[gridGap]">
|
||||
<view class="item" :style="[contentStyle]" v-for="(item, index) in tempArr" :key="index"
|
||||
@click="goDetail(item)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
|
||||
</view>
|
||||
<view class="text-info">
|
||||
<view class="title line2" :style="[titleColor]" v-if="showArr.includes(0)">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</view>
|
||||
<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<view class="row-middle price" :style="[priceColor]">
|
||||
<view v-if="showArr.includes(1)">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
<view class="old-price ml10 " v-if="showArr.includes(2)" :style="[soldColor]">
|
||||
已售 {{ item.sales || 0 }} {{ item.unitName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 三列 -->
|
||||
<block v-if="itemStyle == 2">
|
||||
<view class="listB" :style="[gridGap]">
|
||||
<view class="item" v-for="(item, index) in tempArr" :key="index" @click="goDetail(item)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
|
||||
</view>
|
||||
<view class="text-info">
|
||||
<view class="title line2" :style="[titleColor]" v-if="showArr.includes(0)">
|
||||
<span>{{ item.storeName }}</span>
|
||||
</view>
|
||||
<view v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<view class="price" :style="[priceColor]">
|
||||
<view v-if="showArr.includes(1)">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="old-price " v-if="showArr.includes(2)" :style="[soldColor]">
|
||||
已售 {{ item.sales || 0 }} {{ item.unitName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 大图 -->
|
||||
<block v-if="itemStyle == 3 && tempArr.length">
|
||||
<view class="listBig" :style="[gridGap]">
|
||||
<view class="itemBig" v-for="(item,index) in tempArr" :key="index" @click="goDetail(item)">
|
||||
<view class="img-box">
|
||||
<easy-loadimage :image-src="item.image"
|
||||
:radius="dataConfig.contentStyle.val"></easy-loadimage>
|
||||
<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
|
||||
</view>
|
||||
<view class="name line2" :style="[titleColor]" v-if="showArr.includes(0)">
|
||||
<span>{{item.storeName}}</span>
|
||||
</view>
|
||||
<view style="padding: 0 8px;"
|
||||
v-if="item.productTags && item.productTags.locationUnderTitle.length">
|
||||
<text
|
||||
v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
|
||||
:key="items.id" class="mr10 tagSolid">{{items.tagName}}</text>
|
||||
</view>
|
||||
<slot name="center"></slot>
|
||||
<view class="row-middle price" :style="[priceColor]">
|
||||
<span v-if="showArr.includes(1)">
|
||||
¥<span class="num semiBold">{{item.price}}</span>
|
||||
</span>
|
||||
<view class="old-price" v-if="showArr.includes(2)" :style="[soldColor]">
|
||||
已售 {{ item.sales || 0 }} {{ item.unitName }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {
|
||||
getProductslist,productByidsApi
|
||||
} from '@/api/store.js';
|
||||
let app = getApp();
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
export default {
|
||||
name: 'homeTab',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//普通价格
|
||||
svipPriceStyle: {
|
||||
svipBox: {
|
||||
height: '26rpx',
|
||||
borderRadius: '60rpx 56rpx 56rpx 20rpx',
|
||||
},
|
||||
icon: {
|
||||
height: '26rpx',
|
||||
fontSize: '18rpx',
|
||||
borderRadius: '12rpx 0 12rpx 2rpx'
|
||||
},
|
||||
price: {
|
||||
fontSize: '38rpx'
|
||||
},
|
||||
svipPrice: {
|
||||
fontSize: '22rpx'
|
||||
}
|
||||
},
|
||||
//svip价格
|
||||
svipIconStyle: {
|
||||
svipBox: {
|
||||
height: '26rpx',
|
||||
borderRadius: '24rpx 40rpx 40rpx 0.4rpx',
|
||||
},
|
||||
price: {
|
||||
fontSize: '38rpx'
|
||||
},
|
||||
svipPrice: {
|
||||
fontSize: '18rpx'
|
||||
}
|
||||
},
|
||||
tempArr: [],
|
||||
iSshowH: false,
|
||||
ProductNavindex: 0,
|
||||
itemStyle: 0, //样式类型
|
||||
themeColor: '#f00',
|
||||
titleConfig: 1, //标题位置
|
||||
infoColor: '#999',
|
||||
goodType: 3,
|
||||
loadend: false,
|
||||
loading: false,
|
||||
page: 1,
|
||||
isWidth: 0, //每个导航栏占位
|
||||
tabLeft: 0,
|
||||
limit: 0 ,//分页条数
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
};
|
||||
},
|
||||
components: {
|
||||
easyLoadimage,
|
||||
},
|
||||
created() {
|
||||
let that = this
|
||||
uni.getSystemInfo({
|
||||
success(e) {
|
||||
that.isWidth = (e.windowWidth) / 5;
|
||||
}
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
//标签文字颜色
|
||||
fontColor() {
|
||||
return this.dataConfig.fontColor.color[0].item
|
||||
},
|
||||
//选中颜色
|
||||
checkColor() {
|
||||
return this.dataConfig.checkThemeStyleConfig.tabVal?this.dataConfig.checkColor.color[0].item:this.themeColor
|
||||
},
|
||||
//选项卡背景颜色
|
||||
tabBgColor() {
|
||||
return {
|
||||
background: `linear-gradient(${this.dataConfig.tabBgColor.color[0].item}, ${this.dataConfig.tabBgColor.color[1].item})`,
|
||||
};
|
||||
},
|
||||
//页面间距
|
||||
mbConfig() {
|
||||
return {
|
||||
marginTop: this.dataConfig.mbConfig.val ? this.dataConfig.mbConfig.val + 'px' : 0
|
||||
}
|
||||
},
|
||||
//分类列表
|
||||
navList() {
|
||||
return this.dataConfig.tabItemConfig.list;
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.topConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + 0 + ' ' + this.dataConfig.downConfig.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//商品间距
|
||||
gridGap() {
|
||||
return {
|
||||
'grid-gap': this.dataConfig.contentConfig.val * 2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//图片的圆角和高度
|
||||
imgStyle() {
|
||||
return {
|
||||
'border-radius': this.dataConfig.contentStyle.val * 2 + 'rpx',
|
||||
}
|
||||
},
|
||||
//价格颜色
|
||||
priceColor() {
|
||||
return {
|
||||
'color': this.dataConfig.priceThemeStyleConfig.tabVal?this.dataConfig.priceColor.color[0].item:this.themeColor,
|
||||
}
|
||||
},
|
||||
//商品名称颜色
|
||||
titleColor() {
|
||||
return {
|
||||
'color': this.dataConfig.titleColor.color[0].item,
|
||||
}
|
||||
},
|
||||
//已售数量
|
||||
soldColor() {
|
||||
return {
|
||||
'color': this.dataConfig.soldColor.color[0].item,
|
||||
}
|
||||
},
|
||||
showArr(){
|
||||
return this.dataConfig.tabItemConfig.list[this.ProductNavindex].activeList.showContent
|
||||
},
|
||||
//商品名称
|
||||
titleShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.includes(0)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//价格
|
||||
priceShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.includes(1)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//销量
|
||||
soldShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.includes(2)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//内容圆角
|
||||
contentStyle() {
|
||||
return {
|
||||
'border-radius': this.dataConfig.contentStyle.val ? this.dataConfig.contentStyle.val + 'px' : '0'
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
//默认加载第一项的商品数据
|
||||
if (this.navList) {
|
||||
this.itemStyle = this.navList[0].activeList ? this.navList[0].activeList.styleType : 0;
|
||||
if (this.navList[0].activeList && this.navList[0].activeList.activeProTabIndex == 0) {
|
||||
this.getProductByids(this.navList[0].activeList.goods);
|
||||
} else {
|
||||
this.limit = this.navList[0].activeList ? this.navList[0].activeList.num : 3;
|
||||
if (this.navList[0].activeList) {
|
||||
this.getGroomList(this.navList[0].activeList);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//uniapp小程序用deep重写组件样式不生效
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
methods: {
|
||||
//根据商品id集合查询对应商品
|
||||
getProductByids(data) {
|
||||
if(!data.length) return;
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
let ids = data.map((item) => item.id).join(',');
|
||||
productByidsApi(ids).then((res) => {
|
||||
this.tempArr = res.data;
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
// 选项卡切换点击事件;商品类型选择除第一个指定商品,加载商品从平台端获取数据,其余选项均请求接口加载
|
||||
changeTab(item, index) {
|
||||
this.tempArr = [];
|
||||
if (item.activeList.activeProTabIndex == 0) {
|
||||
this.getProductByids(item.activeList.goods);
|
||||
} else {
|
||||
this.page = 1;
|
||||
this.loadend = false;
|
||||
this.getGroomList(item.activeList);
|
||||
}
|
||||
},
|
||||
// 商品列表
|
||||
getGroomList(item) {
|
||||
let cid = item.activeValue; //分类id
|
||||
let goodsSort = item.goodsSort // 商品排序,0综合,1按销量,2按价格
|
||||
let priceOrder = '';
|
||||
let salesOrder = '';
|
||||
if (this.loadend) return false;
|
||||
if (this.loading) return false;
|
||||
if (goodsSort === 0) {
|
||||
priceOrder = '';
|
||||
salesOrder = '';
|
||||
} else if (goodsSort === 1) {
|
||||
priceOrder = '';
|
||||
salesOrder = 'desc';
|
||||
} else {
|
||||
priceOrder = 'desc';
|
||||
salesOrder = '';
|
||||
}
|
||||
getProductslist({
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
cid: cid,
|
||||
priceOrder: priceOrder,
|
||||
salesOrder: salesOrder
|
||||
}).then((res) => {
|
||||
let list = res.data.list;
|
||||
this.tempArr = this.$util.SplitArray(list, this.tempArr);
|
||||
let loadend = list.length < this.limit;
|
||||
this.loadend = loadend;
|
||||
this.loading = false;
|
||||
this.page = this.page + 1;
|
||||
})
|
||||
.catch(res => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 选项卡切换
|
||||
ProductNavTab(item, index) {
|
||||
this.ProductNavindex = index;
|
||||
this.itemStyle = this.navList[index].activeList.styleType;
|
||||
this.$nextTick(() => {
|
||||
let id = 'id' + index;
|
||||
this.tabLeft = (index - 2) * this.isWidth //设置下划线位置
|
||||
})
|
||||
this.limit = item.activeList.num;
|
||||
this.changeTab(item, index);
|
||||
},
|
||||
goDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/goods_details/index?id=${item.id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.longTab {
|
||||
.longItem {
|
||||
height: 70rpx;
|
||||
display: inline-block;
|
||||
line-height: 70rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 46rpx;
|
||||
&.click {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
width: 40rpx;
|
||||
height: 4rpx;
|
||||
background: var(--color);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.index-product-wrapper {
|
||||
|
||||
&.on {
|
||||
min-height: 1500rpx;
|
||||
}
|
||||
|
||||
.nav-bd {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding-left: 20rpx;
|
||||
background: #fff;
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
padding-right: 48rpx;
|
||||
|
||||
&.on {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-add {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.listBig {
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
padding: 0 20rpx;
|
||||
|
||||
.itemBig {
|
||||
width: 100%;
|
||||
|
||||
.img-box {
|
||||
width: 100%;
|
||||
height: 710rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
margin-top: 16rpx;
|
||||
// padding: 0 8px;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-top: 10rpx;
|
||||
// padding: 0 8px;
|
||||
|
||||
.num {
|
||||
font-size: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
color: #aaa;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listA {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
.pictrue {
|
||||
width: 220rpx;
|
||||
height: 220rpx;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
margin-left: 14rpx;
|
||||
flex: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listB {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.item {
|
||||
.pictrue {
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listC {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
|
||||
/deep/.origin-img,
|
||||
/deep/.easy-loadimage {
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
.item {
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
|
||||
.pictrue {
|
||||
width: 100%;
|
||||
height: 345rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
padding: 16rpx 0 16rpx 16rpx;
|
||||
|
||||
.title {
|
||||
width: 300rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 36rpx;
|
||||
font-weight: 550;
|
||||
|
||||
text {
|
||||
padding-bottom: 4rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mer_badge {
|
||||
padding: 0 4rpx;
|
||||
background-color: theme;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
display: inline-block;
|
||||
border-radius: 4rpx;
|
||||
line-height: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
</style>
|
||||
225
app/components/homeIndex/hotSpot.vue
Normal file
225
app/components/homeIndex/hotSpot.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<!-- 热区+图片魔方 -->
|
||||
<view class="mobile-page" v-if="dataConfig" :style="[boxStyle]">
|
||||
<view class="advert">
|
||||
<!-- 单图/热区布局 -->
|
||||
<template v-if="style === 0">
|
||||
<view class="advertItem01 acea-row hotspot" v-for="(item, index) in picList" :key="index">
|
||||
<image :src="item.image" mode="widthFix" v-if="item.image" :style="[contentStyle]"
|
||||
@click="dataConfig.checkoutConfig.hotspot.length?'':goDetail(item)"></image>
|
||||
<view v-for="(item, index) in dataConfig.checkoutConfig.hotspot" :key="index" :style="{
|
||||
top: `${Number(spotIndex*item.starY)}rpx`,
|
||||
left: `${Number(spotIndex*item.starX)}rpx`,
|
||||
width: `${Number(spotIndex*item.areaWidth)}rpx`,
|
||||
height: `${Number(spotIndex*item.areaHeight)}rpx`,
|
||||
}" class="area" @click="goDetail(item)"></view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: 'hotSpot',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
picList: this.dataConfig.picStyle.picList,
|
||||
style: this.dataConfig.tabConfig.tabVal,
|
||||
prConfig: this.dataConfig.lrConfig.val,
|
||||
igConfig: this.dataConfig.igConfig.val
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
backgroundImage: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + '0' + ' ' + this.dataConfig.downConfig.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
contentStyle(){
|
||||
return{
|
||||
borderRadius: this.dataConfig.contentStyle.val * 2 + 'rpx',
|
||||
}
|
||||
},
|
||||
//伸缩系数
|
||||
spotIndex(){
|
||||
return (750-4*this.dataConfig.lrConfig.val)/456
|
||||
},
|
||||
// 两张图片 图片间距样式
|
||||
twoImgStyle() {
|
||||
return {
|
||||
width: (750 - 2 * this.igConfig - 4 * this.prConfig) / 2 + 'rpx',
|
||||
height: (750 - 2 * this.igConfig - 4 * this.prConfig) / 2 + 'rpx',
|
||||
}
|
||||
},
|
||||
// 第一种 三张图片间距样式
|
||||
thrOneImgStyle() {
|
||||
return {
|
||||
width: (750 - 4 * this.igConfig - 4 * this.prConfig) / 3 + 'rpx',
|
||||
height: (750 - 4 * this.igConfig - 4 * this.prConfig) / 3 + 'rpx',
|
||||
}
|
||||
},
|
||||
// 第一种四张图片布局
|
||||
forOneImgStyle() {
|
||||
return {
|
||||
width: (750 - 6 * this.igConfig - 4 * this.prConfig) / 4 + 'rpx',
|
||||
}
|
||||
},
|
||||
// 第二种四张图片布局
|
||||
forTwoImgStyle() {
|
||||
return {
|
||||
width: (750 - 2 * this.igConfig - 4 * this.prConfig) / 2 + 'rpx',
|
||||
height: (750 - 2 * this.igConfig - 4 * this.prConfig) / 2 + 'rpx',
|
||||
}
|
||||
},
|
||||
imgBoxStyle() {
|
||||
return {
|
||||
display: this.igConfig ? 'flex' : '',
|
||||
'justify-content': this.igConfig ? 'space-between' : ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//替换安全域名
|
||||
setDomain: function(url) {
|
||||
url = url ? url.toString() : '';
|
||||
//本地调试打开,生产请注销
|
||||
if (url.indexOf("https://") > -1) return url;
|
||||
else return url.replace('http://', 'https://');
|
||||
},
|
||||
goDetail(item) {
|
||||
this.$util.navigateTo(item.link);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mobile-page {
|
||||
.advert {
|
||||
.advertItem01 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.advertItem02 {
|
||||
width: 100%;
|
||||
|
||||
.item {
|
||||
width: 50%;
|
||||
height: auto;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.advertItem03 {
|
||||
.item {
|
||||
width: 33.3333%;
|
||||
height: auto;
|
||||
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.advertItem04 {
|
||||
.item {
|
||||
width: 50%;
|
||||
height: auto;
|
||||
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.pic {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.advertItem05 {
|
||||
.item {
|
||||
width: 25%;
|
||||
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.advertItem06 {
|
||||
.item {
|
||||
width: 50%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hotspot {
|
||||
position: relative;
|
||||
|
||||
.area {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
302
app/components/homeIndex/menus.vue
Normal file
302
app/components/homeIndex/menus.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<!-- 导航组 -->
|
||||
<view v-show="menus.length" :style="[boxStyle]">
|
||||
<view v-if="isMany === 1">
|
||||
<view class="swiper">
|
||||
<swiper :interval="interval" :duration="duration" :style="'height:'+ navHigh +'px;'"
|
||||
@change='bannerfun'>
|
||||
<block>
|
||||
<swiper-item v-for="(item,indexw) in menuList" :key="indexw">
|
||||
<view class="menu acea-row" :id="'nav' + indexw" :style="[gridColumns]">
|
||||
<view :style="[titleColor]" class="item" :class="number===1?'four':number===2?'five':''"
|
||||
v-for="(itemn,indexn) in item.list" :key="indexn"
|
||||
@click="menusTap(itemn.info[1].value)">
|
||||
<view class="pictrue skeleton-radius">
|
||||
<easy-loadimage :image-src="itemn.img" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
</view>
|
||||
<view class="menu-txt">{{ itemn.info[0].value }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="dot acea-row row-center-wrapper" v-if="docConfig<2 && menuList.length>1">
|
||||
<view class="dot-item line_dot-item" :style="active==index?'background:'+ dotColor:''"
|
||||
v-for="(item,index) in menuList"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nav oneNav" v-else>
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
|
||||
<block v-for="(item, index) in menus" :key="index">
|
||||
<view class="item" v-show="item.status" :style="[titleColor]" @click="menusTap(item.info[1].value)">
|
||||
<view class="pictrue skeleton-radius">
|
||||
<easy-loadimage :image-src="item.img" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
</view>
|
||||
<view class="menu-txt">{{ item.info[0].value }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
export default {
|
||||
name: 'menus',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
easyLoadimage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
interval: 3000,
|
||||
duration: 500,
|
||||
menus: this.dataConfig.menuConfig.list || [],
|
||||
rowsNum: this.dataConfig.rowsNum.tabVal,
|
||||
number: this.dataConfig.number.tabVal,
|
||||
isMany: this.dataConfig.tabConfig.tabVal,
|
||||
docConfig: 0,
|
||||
dotColor: '#E93323',
|
||||
menuList: [],
|
||||
active: 0,
|
||||
navHigh: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + 0 + ' ' + this.dataConfig.downConfig.val *2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//分几行展示,一行展示多少个
|
||||
gridColumns() {
|
||||
if (this.dataConfig.number.tabVal == 0) {
|
||||
return {
|
||||
gridRowGap: this.dataConfig.contentConfig.val * 2 + 'rpx',
|
||||
gridTemplateColumns: 'repeat(3, 1fr)'
|
||||
}
|
||||
} else if (this.dataConfig.number.tabVal == 1) {
|
||||
return {
|
||||
gridRowGap: this.dataConfig.contentConfig.val * 2 + 'rpx',
|
||||
gridTemplateColumns: 'repeat(4, 1fr)'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
gridRowGap: this.dataConfig.contentConfig.val * 2 + 'rpx',
|
||||
gridTemplateColumns: 'repeat(5, 1fr)'
|
||||
}
|
||||
}
|
||||
},
|
||||
//标题颜色
|
||||
titleColor() {
|
||||
return {
|
||||
'color': this.dataConfig.titleColor.color[0].item,
|
||||
}
|
||||
},
|
||||
//内容圆角
|
||||
menuStyle() {
|
||||
return {
|
||||
'border-radius': this.dataConfig.contentStyle.val + 'px'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.rowsNum === 0) {
|
||||
if (this.number === 0) {
|
||||
this.pageNum(6)
|
||||
} else if (this.number === 1) {
|
||||
this.pageNum(8)
|
||||
} else {
|
||||
this.pageNum(10)
|
||||
}
|
||||
} else if (this.rowsNum === 1) {
|
||||
if (this.number === 0) {
|
||||
this.pageNum(9)
|
||||
} else if (this.number === 1) {
|
||||
this.pageNum(12)
|
||||
} else {
|
||||
this.pageNum(15)
|
||||
}
|
||||
} else {
|
||||
if (this.number === 0) {
|
||||
this.pageNum(12)
|
||||
} else if (this.number === 1) {
|
||||
this.pageNum(16)
|
||||
} else {
|
||||
this.pageNum(20)
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
if (this.menuList.length && this.isMany===1) {
|
||||
let that = this
|
||||
// #ifdef H5
|
||||
that.menuHeight()
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
setTimeout(() => {
|
||||
that.menuHeight()
|
||||
}, 150)
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
bannerfun(e) {
|
||||
this.active = e.detail.current;
|
||||
},
|
||||
menuHeight() {
|
||||
let that = this;
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('#nav0').boundingClientRect(data => {
|
||||
that.navHigh = data.height;
|
||||
}).exec();
|
||||
},
|
||||
pageNum(num) {
|
||||
let menus = this.menus.filter(item=>item.status);
|
||||
let count = Math.ceil(menus.length / num);
|
||||
let goodArray = new Array();
|
||||
for (let i = 0; i < count; i++) {
|
||||
let list = menus.slice(i * num, i * num + num);
|
||||
if (list.length)
|
||||
goodArray.push({
|
||||
list: list
|
||||
});
|
||||
}
|
||||
this.$set(this, 'menuList', goodArray);
|
||||
},
|
||||
menusTap(url) {
|
||||
this.$util.navigateTo(url);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dot {
|
||||
width: 100%;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.instruct {
|
||||
width: 50rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
color: #fff;
|
||||
border-radius: 16rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dot-item {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
background: rgba(0, 0, 0, .4);
|
||||
border-radius: 50%;
|
||||
margin: 0 4px;
|
||||
|
||||
&.line_dot-item {
|
||||
width: 20rpx;
|
||||
height: 5rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav {
|
||||
.item {
|
||||
width: 160rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
display: inline-block;
|
||||
|
||||
.pictrue {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin: 0 auto;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
&.on {
|
||||
image {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-txt {
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.swiper {
|
||||
z-index: 20;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.menu {
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.item {
|
||||
.pictrue {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin: 0 auto;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
&.on {
|
||||
image {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-txt {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
swiper,
|
||||
.swiper-item {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
187
app/components/homeIndex/news.vue
Normal file
187
app/components/homeIndex/news.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<!-- 新闻播报 -->
|
||||
<view>
|
||||
<view v-if="itemNew.length" class='news acea-row row-middle' :style="[boxStyle]">
|
||||
<view class='pictrue skeleton-rect'>
|
||||
<image :src='logoConfig'></image>
|
||||
</view>
|
||||
<view class='swiperTxt skeleton-rect'>
|
||||
<view class="acea-row row-between-wrapper" v-if="direction" @click="moreTab(itemNew[0].chiild[1].val)">
|
||||
<uniNoticeBar scrollable="true" showGetMore="true" background-color="rgba(255,255,255,0)" :color="textColor"
|
||||
moreColor="#888" :speed='50' single="true" :text="itemNew[0].chiild[0].val"></uniNoticeBar>
|
||||
<view class="iconfont icon-xiangyou"></view>
|
||||
</view>
|
||||
<swiper v-else :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" :duration="duration"
|
||||
vertical="true" circular="true">
|
||||
<block v-for="(item,index) in itemNew" :key='index'>
|
||||
<swiper-item catchtouchmove='catchTouchMove'>
|
||||
<view @click="moreTab(item.chiild[1].val)" class='acea-row row-between-wrapper'
|
||||
hover-class='none'>
|
||||
<view class='text acea-row row-between-wrapper' :style="[txtStyle]">
|
||||
<view class='newsTitle line1' :style="{color:textColor}">
|
||||
{{item.chiild[0].val}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view v-if="!direction" class='iconfont icon-xiangyou'></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import uniNoticeBar from '@/components/uniNoticeBar/uni-notice-bar.vue';
|
||||
export default {
|
||||
components: {
|
||||
uniNoticeBar
|
||||
},
|
||||
name: 'news',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
isSortType: {
|
||||
type: String | Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
indicatorDots: false,
|
||||
autoplay: true,
|
||||
duration: 500,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//文本列表
|
||||
itemNew() {
|
||||
return this.dataConfig.listConfig.list
|
||||
},
|
||||
//图标设置
|
||||
logoConfig() {
|
||||
return this.dataConfig.logoConfig.url
|
||||
},
|
||||
//文本滚动方向
|
||||
direction() {
|
||||
return this.dataConfig.directionConfig.tabVal
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + '20rpx' + ' ' + this.dataConfig.downConfig
|
||||
.val * 2 + 'rpx',
|
||||
color: this.dataConfig.textColor.color[0].item
|
||||
}
|
||||
},
|
||||
//文字位置
|
||||
txtStyle() {
|
||||
let txtStyle = this.dataConfig.textPosition.tabVal;
|
||||
if (txtStyle == 0) {
|
||||
return {
|
||||
'text-align': 'left'
|
||||
}
|
||||
} else if (txtStyle == 1) {
|
||||
return {
|
||||
'text-align': 'center'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
'text-align': 'right'
|
||||
}
|
||||
}
|
||||
},
|
||||
//文字颜色
|
||||
textColor() {
|
||||
return this.dataConfig.textColor.color[0].item
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
moreTab(url) {
|
||||
this.$util.navigateTo(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.news {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
box-shadow: 0 10rpx 30rpx #f5f5f5;
|
||||
}
|
||||
|
||||
.news .pictrue {
|
||||
width: 130rpx;
|
||||
height: 36rpx;
|
||||
border-right: 1rpx solid #ddd;
|
||||
padding-right: 23rpx;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.news .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.news .swiperTxt {
|
||||
width: 536rpx;
|
||||
height: 78rpx;
|
||||
line-height: 78rpx;
|
||||
overflow: hidden;
|
||||
margin-left: 22rpx;
|
||||
position: relative;
|
||||
.icon-xiangyou{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.news .swiperTxt .text {
|
||||
width: 89%;
|
||||
}
|
||||
|
||||
.news .swiperTxt .text .label {
|
||||
font-size: 20rpx;
|
||||
color: #ff4c48;
|
||||
width: 64rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 28rpx;
|
||||
border: 2rpx solid #ff4947;
|
||||
}
|
||||
|
||||
.news .swiperTxt .text .newsTitle {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.news .swiperTxt .iconfont {
|
||||
font-size: 28rpx;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.news .swiperTxt swiper {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
214
app/components/homeIndex/pageFoot.vue
Normal file
214
app/components/homeIndex/pageFoot.vue
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<!-- 底部导航 -->
|
||||
<view :data-theme="theme">
|
||||
<view v-if="bottomNavigationList.length">
|
||||
<view class="page-footer" id="target" :style="[isSmallPage?boxStyle:'']">
|
||||
<view :style="[bgColor]" class="acea-row row-middle row-around bg-box">
|
||||
<view class="foot-item" v-for="(item,index) in bottomNavigationList" :key="index"
|
||||
@click="goRouter(item)">
|
||||
<block v-if="item.link.split('?')[0] == activeRouter">
|
||||
<image :src="item.checked"></image>
|
||||
<view v-if="isSmallPage" class="txtchecked" :style="[checkColor]">{{item.name}}</view>
|
||||
<view v-else class="txt">{{item.name}}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image :src="item.unchecked"></image>
|
||||
<view class="unchecked" :style="[isSmallPage?fontColor:'']">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapGetters
|
||||
} from "vuex"
|
||||
import {
|
||||
getBottomNavigationApi
|
||||
} from '@/api/api.js';
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'pageFooter',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
isSmallPage: {
|
||||
type: Boolean,
|
||||
default: () => false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//外部盒子
|
||||
boxStyle() {
|
||||
if (this.dataConfig) {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val ? this.dataConfig.bgStyle.val + 'px' : '0',
|
||||
padding: '0' + ' ' + this.dataConfig.lrConfig.val + 'px' + ' ' + 0
|
||||
}
|
||||
}
|
||||
},
|
||||
bgColor() {
|
||||
return {
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
}
|
||||
},
|
||||
//标签文字颜色
|
||||
fontColor() {
|
||||
if (this.dataConfig) {
|
||||
return {
|
||||
color: this.dataConfig.fontColor.color[0].item
|
||||
};
|
||||
}
|
||||
|
||||
},
|
||||
//选中颜色
|
||||
checkColor() {
|
||||
if (this.dataConfig) {
|
||||
return {
|
||||
color: this.dataConfig.themeStyleConfig.tabVal ? this.dataConfig.checkColor.color[0].item : this
|
||||
.themeColor
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let routes = getCurrentPages(); //获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
||||
this.activeRouter = '/' + curRoute;
|
||||
},
|
||||
mounted() {
|
||||
if (this.activeRouter === '/pages/activity/small_page/index') {
|
||||
this.bottomNavigationList = this.dataConfig.menuList.list;
|
||||
} else {
|
||||
this.navigationInfo();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
theme: app.globalData.theme,
|
||||
isCustom: '',
|
||||
bottomNavigationList: [],
|
||||
activeRouter: '',
|
||||
themeColor: this.$options.filters.filterTheme(app.globalData.theme)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
navigationInfo() {
|
||||
getBottomNavigationApi().then(res => {
|
||||
let data = res.data;
|
||||
this.isCustom = data.isCustom; //是否使用自定义导航,1使用,0不使用
|
||||
this.$store.commit('BottomNavigationIsCustom', this.isCustom == 1 ? true : false);
|
||||
if (data.isCustom == 1) {
|
||||
uni.hideTabBar()
|
||||
this.bottomNavigationList = data.bottomNavigationList;
|
||||
} else {
|
||||
uni.showTabBar();
|
||||
}
|
||||
})
|
||||
},
|
||||
goRouter(item) {
|
||||
var pages = getCurrentPages();
|
||||
var page = (pages[pages.length - 1]).$page.fullPath;
|
||||
if (item.link == page) return
|
||||
if (['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||
'/pages/user/index', '/pages/discover_index/index', '/pages/goods_cate/goods_cate'
|
||||
].indexOf(item.link) > -1) {
|
||||
uni.switchTab({
|
||||
url: item.link,
|
||||
fail(err) {
|
||||
uni.redirectTo({
|
||||
url: item.link
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: item.link
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
||||
height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||
}
|
||||
|
||||
.unchecked {
|
||||
color: #333;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.page-footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
z-index: 999999;
|
||||
width: 100%;
|
||||
height: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
||||
height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||
box-sizing: border-box;
|
||||
border-top: solid 1rpx #F3F3F3;
|
||||
background-color: #fff;
|
||||
box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
|
||||
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
||||
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
||||
|
||||
.foot-item {
|
||||
display: flex;
|
||||
width: max-content;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
.count-num {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
top: 0rpx;
|
||||
right: -15rpx;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
background-color: #FD502F;
|
||||
border-radius: 50%;
|
||||
padding: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bg-box {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.foot-item image {
|
||||
height: 50rpx;
|
||||
width: 50rpx;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.txtchecked {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.foot-item .txt {
|
||||
font-size: 24rpx;
|
||||
@include main-color(theme);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
194
app/components/homeIndex/pictureCube.vue
Normal file
194
app/components/homeIndex/pictureCube.vue
Normal file
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<!-- 图片魔方 -->
|
||||
<view class="pictureCube skeleton-rect" :style="[boxStyle]" v-if="picList.length&&(imageH>0||style==3)">
|
||||
<view class="grid_box" :style="[gridColumns]" v-if="[0,1,2,4,5].includes(style)">
|
||||
<image class="center" v-for="(item,index) in picList" :key="index" @click="goDetail(item)" :src="item.image"
|
||||
:mode="item.radioVal === '0' ? 'scaleToFill' : item.radioVal === '1' ? 'aspectFit' : 'aspectFill'"
|
||||
:style="[imageStyle]"></image>
|
||||
</view>
|
||||
<view class="advertItem04" v-if="style==3" :style="[widthStyle]">
|
||||
<view class="item" @click="goDetail(picList[0])">
|
||||
<image class="img-left center" :src="picList[0].image" :style="[radiusStyle]"
|
||||
:mode="picList[0].radioVal === '0' ? 'scaleToFill' : picList[0].radioVal === '1' ? 'aspectFit' : 'aspectFill'">
|
||||
</image>
|
||||
</view>
|
||||
<view class="item item-right" :style="[gapStyle]">
|
||||
<view class="pic" @click="goDetail(picList[1])">
|
||||
<image class="img-right center" :src="picList[1].image" :style="[radiusStyle]"
|
||||
:mode="picList[1].radioVal === '0' ? 'scaleToFill' : picList[1].radioVal === '1' ? 'aspectFit' : 'aspectFill'">
|
||||
</image>
|
||||
</view>
|
||||
<view class="pic" @click="goDetail(picList[2])">
|
||||
<image class="img-right center" :src="picList[2].image" :style="[radiusStyle]"
|
||||
:mode="picList[2].radioVal === '0' ? 'scaleToFill' : picList[2].radioVal === '1' ? 'aspectFit' : 'aspectFill'">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: 'pictureCube',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
picList: this.dataConfig.picStyle.picList,
|
||||
style: this.dataConfig.tabConfig.tabVal,
|
||||
prConfig: this.dataConfig.lrConfig.val,
|
||||
widthC: '',
|
||||
imageH: 0,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + '0' + ' ' + this.dataConfig.downConfig.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
imageStyle() {
|
||||
return {
|
||||
height: this.imageH + 'rpx',
|
||||
'border-radius': this.dataConfig.contantStyle.val ? this.dataConfig.contantStyle.val + 'px' :
|
||||
'0'
|
||||
}
|
||||
},
|
||||
widthStyle(){
|
||||
return {width :750-this.dataConfig.lrConfig.val * 4 + 'rpx',gap: 2 * this.dataConfig.spaceConfig.val + 'rpx'}
|
||||
},
|
||||
radiusStyle(){
|
||||
return {'border-radius': this.dataConfig.contantStyle.val ? this.dataConfig.contantStyle.val + 'px' :
|
||||
'0'}
|
||||
},
|
||||
gapStyle(){
|
||||
return{gap: 2 * this.dataConfig.spaceConfig.val + 'rpx',}
|
||||
},
|
||||
//图片魔方排版
|
||||
gridColumns() {
|
||||
if ([1, 5].includes(this.dataConfig.tabConfig.tabVal)) {
|
||||
return {
|
||||
gridTemplateColumns: 'repeat(2, 1fr)',
|
||||
gap: 2 * this.dataConfig.spaceConfig.val + 'rpx',
|
||||
}
|
||||
} else if (this.dataConfig.tabConfig.tabVal == 0) {
|
||||
return {
|
||||
gridTemplateColumns: 'repeat(1, 1fr)',
|
||||
gap: 2 * this.dataConfig.spaceConfig.val + 'rpx',
|
||||
}
|
||||
} else if (this.dataConfig.tabConfig.tabVal == 2) {
|
||||
return {
|
||||
gridTemplateColumns: 'repeat(3, 1fr)',
|
||||
gap: 2 * this.dataConfig.spaceConfig.val + 'rpx',
|
||||
}
|
||||
} else if (this.dataConfig.tabConfig.tabVal == 4) {
|
||||
return {
|
||||
gridTemplateColumns: 'repeat(4, 1fr)',
|
||||
gap: 2 * this.dataConfig.spaceConfig.val + 'rpx',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.picList.length) {
|
||||
let that = this;
|
||||
this.$nextTick((e) => {
|
||||
// 宽度
|
||||
if (this.style == 0) {
|
||||
this.widthC = 750
|
||||
} else if (this.style == 1) {
|
||||
this.widthC = 375
|
||||
} else if (this.style == 2) {
|
||||
this.widthC = 250
|
||||
} else if (this.style == 4) {
|
||||
this.widthC = 187.5
|
||||
}
|
||||
//高度计算
|
||||
if (this.style == 5) {
|
||||
that.$set(that, 'imageH', 187.5);
|
||||
} else {
|
||||
let maxHeight = 0
|
||||
this.picList.forEach((val, index) => {
|
||||
let height = val.height * ((that.widthC - that.prConfig *
|
||||
2) / val
|
||||
.width)
|
||||
if (height > maxHeight) {
|
||||
maxHeight = height
|
||||
}
|
||||
})
|
||||
that.$set(that, 'imageH', maxHeight);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goDetail(item) {
|
||||
this.$util.navigateTo(item.link);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.grid_box {
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.pictureCube {
|
||||
uni-image {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.advertItem04 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
.item-right{
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
height: 375rpx;
|
||||
}
|
||||
.item{
|
||||
height: 375rpx;
|
||||
}
|
||||
.img-left{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.img-right{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.center {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
73
app/components/homeIndex/richTextEditor.vue
Normal file
73
app/components/homeIndex/richTextEditor.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<!-- 富文本 -->
|
||||
<view v-if="description" :style="[boxStyle]">
|
||||
<view class="rich_text">
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<mp-html :content="description" :tag-style="tagStyle" selectable="true" show-img-menu="true"/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-html="description"></view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue";
|
||||
export default {
|
||||
name: 'richText',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
tagStyle: {
|
||||
img: 'width:100%;display:block;',
|
||||
table: 'width:100%',
|
||||
video: 'width:100%'
|
||||
},
|
||||
}
|
||||
},
|
||||
components:{
|
||||
mpHtml
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
}
|
||||
},
|
||||
//富文本内容
|
||||
description() {
|
||||
return this.dataConfig.richText.val.replace(/<video/g, "<video style='width:100%'").replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
|
||||
.replace(/style="text-wrap: wrap;"/gi, '');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rich_text {
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
372
app/components/homeIndex/seckill.vue
Normal file
372
app/components/homeIndex/seckill.vue
Normal file
@@ -0,0 +1,372 @@
|
||||
<template>
|
||||
<!-- 秒杀 -->
|
||||
<view v-if="spikeList.length">
|
||||
<view class="seckill" :style="[boxStyle]" >
|
||||
<view class="bg_box" :style="[boxBgStyle]"></view>
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="pictrue skeleton-rect">
|
||||
<image :src="logoUrl"></image>
|
||||
</view>
|
||||
<view class="lines"></view>
|
||||
<view class="point skeleton-rect" :style="[titleColor]">{{titleText}}</view>
|
||||
</view>
|
||||
<view class="more acea-row row-center-wrapper skeleton-rect" @click="toSeckillList()">
|
||||
GO<text class="iconfont icon-you"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="conter" v-if="listStyle == 0">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;"
|
||||
show-scrollbar="false">
|
||||
<view class="itemCon" :style="[{'margin-right':itemStyle}]" v-for="(item, index) in spikeList"
|
||||
:key="index" @click="toSeckillDetail(item.id)">
|
||||
<view class="item">
|
||||
<view class="pictrue skeleton-rect">
|
||||
<easy-loadimage :image-src="item.image" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
</view>
|
||||
<view v-show="nameShow" :style="[nameColor]" class="name line1 skeleton-rect">{{item.title}}</view>
|
||||
<view v-show="priceShow" :style="[priceColor]" class="x_money semiBold line1 skeleton-rect">¥<text
|
||||
class="num semiBold">{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="conter_y" :style="[{'grid-gap':itemStyle}]" v-if="listStyle == 1">
|
||||
<view class="item" v-for="(item, index) in spikeList" :key="index" @click="toSeckillDetail(item.id)">
|
||||
<view class="pictrue">
|
||||
<easy-loadimage :image-src="item.image" :radius="dataConfig.contentStyle.val">
|
||||
</easy-loadimage>
|
||||
</view>
|
||||
<view class="text-info acea-row row-column row-between">
|
||||
<view v-show="nameShow">
|
||||
<view :style="[nameColor]" class="title line2">{{ item.title }}</view>
|
||||
</view>
|
||||
<view v-show="priceShow" :style="[priceColor]" class="price semiBold">
|
||||
<view>
|
||||
<text class="semiBold">¥</text>
|
||||
<text class="semiBold">{{ item.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
let app = getApp();
|
||||
import {
|
||||
getSeckillIndexApi
|
||||
} from '@/api/activity.js';
|
||||
import easyLoadimage from '@/components/base/easy-loadimage.vue';
|
||||
export default {
|
||||
name: 'homeSeckill',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
easyLoadimage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlDomain: this.$Cache.get("imgHost"),
|
||||
spikeList: [], // 秒杀
|
||||
datatime: 0,
|
||||
status: 0,
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//秒杀样式
|
||||
listStyle() {
|
||||
return this.dataConfig.tabConfig.tabVal
|
||||
},
|
||||
//最外层盒子的背景图片
|
||||
boxBgStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx' + ' ' + this.dataConfig.bgStyle.val * 2 + 'rpx' +
|
||||
' ' + 0 + ' ' + 0,
|
||||
backgroundImage: `url(${this.urlDomain}crmebimage/presets/seckill_bg_pic.png),linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`
|
||||
}
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + '24rpx' + ' ' + this.dataConfig.downConfig
|
||||
.val * 2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//图片圆角
|
||||
itemStyle() {
|
||||
return this.dataConfig.contentConfig.val * 2 + 'rpx'
|
||||
},
|
||||
//标题图片
|
||||
logoUrl() {
|
||||
return this.dataConfig.logoConfig.url
|
||||
},
|
||||
//标题
|
||||
titleText() {
|
||||
return this.dataConfig.titleConfig.val
|
||||
},
|
||||
//标题颜色
|
||||
titleColor() {
|
||||
return {
|
||||
color: this.dataConfig.titleColor.color[0].item
|
||||
}
|
||||
},
|
||||
//名称颜色
|
||||
nameColor() {
|
||||
return {
|
||||
color: this.dataConfig.nameColor.color[0].item
|
||||
};
|
||||
},
|
||||
//价格颜色
|
||||
priceColor() {
|
||||
return {
|
||||
color: this.dataConfig.themeStyleConfig.tabVal?this.dataConfig.priceColor.color[0].item:this.themeColor
|
||||
};
|
||||
},
|
||||
//商品名称
|
||||
nameShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.indexOf(0) !== -1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
//商品价格
|
||||
priceShow() {
|
||||
if (this.dataConfig.typeConfig.activeValue.indexOf(1) !== -1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getSeckillIndex();
|
||||
},
|
||||
methods: {
|
||||
getSeckillIndex() {
|
||||
getSeckillIndexApi().then(({
|
||||
data
|
||||
}) => {
|
||||
this.spikeList = [];
|
||||
this.spikeList = data ? data.productList : [];
|
||||
})
|
||||
},
|
||||
toSeckillList() {
|
||||
this.$util.navigateTo(this.dataConfig.linkConfig.val)
|
||||
},
|
||||
toSeckillDetail(id){
|
||||
uni.navigateTo({
|
||||
url:`/pages/activity/goods_seckill_details/index?id=${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.seckill {
|
||||
width: auto;
|
||||
background: #fff;
|
||||
border-radius: 14rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.bg_box {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 256rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
border-radius: 14rpx 14rpx 0 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
.pictrue {
|
||||
width: 124rpx;
|
||||
height: 32rpx;
|
||||
z-index: 9;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.lines {
|
||||
width: 1rpx;
|
||||
height: 24rpx;
|
||||
background-color: #fff;
|
||||
opacity: 0.6;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.point {
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
margin-left: 21rpx;
|
||||
margin-right: 4rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.styleAll {
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
background-color: #2F2F2F;
|
||||
border-radius: 6rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.more {
|
||||
width: 86rpx;
|
||||
height: 40rpx;
|
||||
background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
|
||||
opacity: 1;
|
||||
border-radius: 18px;
|
||||
font-size: 22rpx;
|
||||
color: #FE960F;
|
||||
padding-left: 8rpx;
|
||||
font-weight: 800;
|
||||
z-index: 9;
|
||||
|
||||
.iconfont {
|
||||
font-size: 21rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.conter {
|
||||
border-radius: 12px;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.itemCon {
|
||||
display: inline-block;
|
||||
width: 186rpx;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
|
||||
.pictrue {
|
||||
width: 100%;
|
||||
height: 186rpx;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.y_money {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.x_money {
|
||||
font-size: 28rpx;
|
||||
height: 100%;
|
||||
font-weight: bold;
|
||||
margin-top: 4rpx;
|
||||
|
||||
.num {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.money {
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.conter_y {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
grid-template-rows: auto;
|
||||
width: 100%;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
z-index: 9;
|
||||
|
||||
.pictrue {
|
||||
width: 108px;
|
||||
height: 108px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.text-info {
|
||||
z-index: 9;
|
||||
margin-left: 20rpx;
|
||||
flex: 1;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 40rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 36rpx;
|
||||
font-weight: 550;
|
||||
|
||||
text {
|
||||
padding-bottom: 4rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.semiBold{
|
||||
font-size: 36rpx !important;
|
||||
}
|
||||
</style>
|
||||
289
app/components/homeIndex/swiperBg.vue
Normal file
289
app/components/homeIndex/swiperBg.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<!-- 轮播图 -->
|
||||
<view class="swiperBg" :style="[boxStyle]">
|
||||
<view class="swiper page_swiper" :class="docConfig" v-if="imgUrls.length">
|
||||
<swiper :autoplay="true" :circular="true" :interval="3000" :duration="500"
|
||||
:indicator-active-color="docColor" :current="swiperCur" :previous-margin="swiperType==0?'40rpx':''" :next-margin="swiperType==0?'40rpx':''"
|
||||
@change="swiperChange">
|
||||
<block v-for="(item,index) in imgUrls" :key="index">
|
||||
<swiper-item :class="{ active: index == swiperCur }">
|
||||
<view @click="goDetail(item)" class='slide-navigator acea-row row-between-wrapper tui-skeleton-rect'>
|
||||
<image :src="item.img" mode="aspectFill" :style="[imgStyle]" class="slide-image aa"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view v-if="docType === 0" class="dots" :style="[dotStyle]">
|
||||
<block v-for="(item,index) in imgUrls" :key="index">
|
||||
<view class="dot-item"
|
||||
:style="{'background-color': swiperCur === index ? (dataConfig.themeStyleConfig.tabVal?dataConfig.docColor.color[0].item:themeColor) : ''}">
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="docType === 1" class="dots" :style="[dotStyle]">
|
||||
<block v-for="(item,index) in imgUrls" :key="index">
|
||||
<view class="dot"
|
||||
:style="{'background-color': swiperCur === index ? (dataConfig.themeStyleConfig.tabVal?dataConfig.docColor.color[0].item:themeColor) : ''}">
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {
|
||||
navigatoPage
|
||||
} from "@/utils/index"
|
||||
let app = getApp();
|
||||
export default {
|
||||
name: 'swiperBg',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
merId: {}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
indicatorDots: false,
|
||||
imgUrls: [], //图片轮播数据
|
||||
txtStyle: this.dataConfig.txtStyle.type, //指示器位置
|
||||
imageH: 310,
|
||||
swiperCur: 0,
|
||||
themeColor:this.$options.filters.filterTheme(app.globalData.theme)
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
imageH(nVal, oVal) {
|
||||
let self = this
|
||||
this.imageH = nVal
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//指示器样式
|
||||
dotStyle() {
|
||||
return {
|
||||
padding: '0 50rpx',
|
||||
justifyContent: this.dataConfig.txtStyle.tabVal === 1 ? 'center' : this.dataConfig.txtStyle
|
||||
.tabVal === 2 ? 'flex-end' : 'flex-start'
|
||||
}
|
||||
},
|
||||
//指示器类型,0圆,1直,2无
|
||||
docType() {
|
||||
return this.dataConfig.docConfig.tabVal
|
||||
},
|
||||
//轮播图样式
|
||||
swiperType(){
|
||||
return this.dataConfig.swiperStyleConfig.tabVal
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + '20rpx' + ' ' + this.dataConfig.downConfig.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
//指示器颜色
|
||||
docColor() {
|
||||
return this.dataConfig.docColor.color[0].item + '!important'
|
||||
},
|
||||
//指示器样式
|
||||
docConfig() {
|
||||
if (this.dataConfig.docConfig.tabVal == 1) {
|
||||
return 'square'
|
||||
} else if (this.dataConfig.docConfig.tabVal == 2) {
|
||||
return 'nodoc'
|
||||
} else {
|
||||
return 'circular'
|
||||
}
|
||||
},
|
||||
//内容圆角
|
||||
imgStyle() {
|
||||
return {
|
||||
"border-radius": this.dataConfig.contentStyle.val * 2 + 'rpx'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.imgUrls = this.dataConfig.swiperConfig.list
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
this.$nextTick(function() {
|
||||
uni.getImageInfo({
|
||||
src: that.setDomain(that.imgUrls[0].img),
|
||||
success: function(res) {
|
||||
that.$set(that, 'imageH', res.height);
|
||||
},
|
||||
fail: function(error) {
|
||||
that.$set(that, 'imageH', 310);
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//替换安全域名
|
||||
setDomain: function(url) {
|
||||
url = url ? url.toString() : '';
|
||||
//本地调试打开,生产请注销
|
||||
if (url.indexOf("https://") > -1) return url;
|
||||
else return url.replace('http://', 'https://');
|
||||
},
|
||||
swiperChange(e) {
|
||||
let {
|
||||
current,
|
||||
source
|
||||
} = e.detail;
|
||||
if (source === 'autoplay' || source === 'touch') {
|
||||
this.swiperCur = e.detail.current;
|
||||
}
|
||||
},
|
||||
goDetail(url) {
|
||||
let path = url.info[1].value
|
||||
this.$util.navigateTo(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/*用来包裹所有的小圆点 */
|
||||
.dots {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: absolute;
|
||||
bottom: 24rpx;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.dot-item {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
background-color: rgba(255, 255, 255, .4);
|
||||
border-radius: 50%;
|
||||
margin: 0 6rpx;
|
||||
}
|
||||
|
||||
/*未选中时的小圆点样式 */
|
||||
.dot {
|
||||
width: 16rpx;
|
||||
height: 6rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 6rpx;
|
||||
background-color: rgba(255, 255, 255, .4);
|
||||
}
|
||||
.swiperBg {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
z-index: 1;
|
||||
|
||||
.colorBg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 130rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page_swiper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
overflow-x: hidden;
|
||||
/* #ifdef MP */
|
||||
z-index: 20;
|
||||
|
||||
/* #endif */
|
||||
/* 设置圆角 */
|
||||
&.fillet {
|
||||
|
||||
.swiper-item,
|
||||
image,
|
||||
.acea-row.row-between-wrapper {
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-item,
|
||||
image,
|
||||
.acea-row.row-between-wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
swiper {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
image {
|
||||
transform: scale(0.93);
|
||||
transition: all 0.6s ease;
|
||||
}
|
||||
|
||||
swiper-item.active {
|
||||
image {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 圆形指示点
|
||||
&.circular {
|
||||
/deep/.uni-swiper-dot {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 方形指示点
|
||||
&.square {
|
||||
/deep/.uni-swiper-dot {
|
||||
width: 20rpx;
|
||||
height: 5rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&.nodoc {
|
||||
/deep/.uni-swiper-dot {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/.dot0 .uni-swiper-dots-horizontal {
|
||||
left: 10%;
|
||||
}
|
||||
|
||||
/deep/.dot1 .uni-swiper-dots-horizontal {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
/deep/.dot2 .uni-swiper-dots-horizontal {
|
||||
left: 90%;
|
||||
}
|
||||
|
||||
.item-img image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
166
app/components/homeIndex/title.vue
Normal file
166
app/components/homeIndex/title.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<!-- 标题 -->
|
||||
<view class="title-box acea-row row-between row-middle" :style="[...boxStyle]" @click="goPage">
|
||||
<view class="acea-row row-middle" >
|
||||
<view :style="[...titleStyle]">{{ titleTxt }}</view>
|
||||
<view class="ml6" :style="[...titleFuStyle]">{{ titleFuTxt }}</view>
|
||||
</view>
|
||||
<view v-if="!selectShow" :style="[...titleRightStyle]">{{ titleRightTxt }}<text :style="[...titleRightStyle]" class="iconfont icon-xiangyou"></text></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: 'titles',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return [{
|
||||
'border-radius': 2*this.dataConfig.bgTopStyle.val +
|
||||
'rpx' +
|
||||
' ' +
|
||||
2*this.dataConfig.bgTopStyle.val +
|
||||
'rpx' +
|
||||
' ' +
|
||||
2*this.dataConfig.bgDownStyle.val +
|
||||
'rpx' +
|
||||
' ' +
|
||||
2*this.dataConfig.bgDownStyle.val +
|
||||
'rpx',
|
||||
},
|
||||
{
|
||||
'background-image': this.selectStyle ?
|
||||
`linear-gradient(to right,${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})` :
|
||||
`url(${this.bgImgUrl})`,
|
||||
},
|
||||
{
|
||||
margin: 2*this.dataConfig.mbConfig.val + 'rpx' + ' ' + 2*this.dataConfig.lrConfig.val + 'rpx' + ' ' +
|
||||
0
|
||||
},
|
||||
{
|
||||
padding: 2*this.dataConfig.upConfig.val + 'rpx' + ' ' + '20rpx' + ' ' + 2*this.dataConfig.downConfig
|
||||
.val + 'rpx'
|
||||
},
|
||||
];
|
||||
},
|
||||
titleStyle() {
|
||||
return [{
|
||||
'font-weight': this.dataConfig.textStyle.list[this.dataConfig.textStyle.tabVal].style,
|
||||
},
|
||||
{
|
||||
'font-style': this.dataConfig.textStyle.list[this.dataConfig.textStyle.tabVal].style
|
||||
},
|
||||
{
|
||||
fontSize: 2*this.dataConfig.fontSize.val + 'rpx',
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.fontColor.color[0].item
|
||||
},
|
||||
];
|
||||
},
|
||||
titleFuStyle() {
|
||||
return [{
|
||||
fontSize: 2*this.dataConfig.fontFuSize.val + 'rpx',
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.fontFuColor.color[0].item
|
||||
},
|
||||
];
|
||||
},
|
||||
titleRightStyle() {
|
||||
return [{
|
||||
fontSize: 2*this.dataConfig.fontRightSize.val + 'rpx',
|
||||
},
|
||||
{
|
||||
color: this.dataConfig.fontRightColor.color[0].item
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
configObj: null,
|
||||
titleTxt: '',
|
||||
titleFuTxt: '',
|
||||
titleRightTxt: '',
|
||||
link: '',
|
||||
txtPosition: '',
|
||||
txtStyle: '',
|
||||
fontSize: 0,
|
||||
mTOP: 0,
|
||||
titleColor: '',
|
||||
themeColor: '',
|
||||
prConfig: 0,
|
||||
bgStyle: 0,
|
||||
pageData: {},
|
||||
selectShow: '',
|
||||
selectStyle: '',
|
||||
bgImgUrl: '',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.setConfig()
|
||||
},
|
||||
methods: {
|
||||
setConfig(data) {
|
||||
this.configObj = this.data;
|
||||
this.titleTxt = this.dataConfig.titleConfig.val;
|
||||
this.titleFuTxt = this.dataConfig.titleFuConfig.val;
|
||||
this.titleRightTxt = this.dataConfig.titleRightConfig.val;
|
||||
this.link = this.dataConfig.linkConfig.val;
|
||||
this.bgImgUrl = this.dataConfig.bgImg.url;
|
||||
this.selectShow = this.dataConfig.selectShow.tabVal;
|
||||
this.selectStyle = this.dataConfig.selectStyle.tabVal;
|
||||
},
|
||||
goPage() {
|
||||
this.$util.navigateTo(this.dataConfig.linkConfig.val)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.title-box{
|
||||
background-repeat: no-repeat;
|
||||
object-fit: contain;
|
||||
}
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
|
||||
&.left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&.blod {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&.italics {
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
.ml6 {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
</style>
|
||||
86
app/components/homeIndex/video.vue
Normal file
86
app/components/homeIndex/video.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="diy_video acea-row row-center-wrapper" :style="[boxStyle]">
|
||||
<video :style="[contantRadius]" :src="link" :show-mute-btn="pageGesture" :poster="cover" controls :autoplay="false" loop
|
||||
objectFit="cover"></video>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
export default {
|
||||
name: 'pictureCube',
|
||||
props: {
|
||||
dataConfig: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageGesture: true,
|
||||
onloadCode: ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// #ifdef APP
|
||||
this.onloadCode =
|
||||
`this.contentWindow.document.body.innerHTML = '<video style="width: 100%;height: 100%" objectFit="cover" controls="controls" loop show-mute-btn="${this.pageGesture}" poster="${this.cover}" src="${this.link}"></video>';`
|
||||
// #endif
|
||||
},
|
||||
computed: {
|
||||
//视频封面
|
||||
cover() {
|
||||
return this.dataConfig.cover.url
|
||||
},
|
||||
//视频地址
|
||||
link() {
|
||||
if (this.dataConfig.tabConfig.tabVal === 0) {
|
||||
return this.dataConfig.uploadVideo.url
|
||||
} else {
|
||||
return this.dataConfig.link.val
|
||||
}
|
||||
|
||||
},
|
||||
//最外层盒子的样式
|
||||
boxStyle() {
|
||||
return {
|
||||
borderRadius: this.dataConfig.bgStyle.val * 2 + 'rpx',
|
||||
background: `linear-gradient(${this.dataConfig.bgColor.color[0].item}, ${this.dataConfig.bgColor.color[1].item})`,
|
||||
margin: this.dataConfig.mbConfig.val * 2 + 'rpx' + ' ' + this.dataConfig.lrConfig.val * 2 + 'rpx' +
|
||||
' ' + 0,
|
||||
padding: this.dataConfig.upConfig.val * 2 + 'rpx' + ' ' + 0 + ' ' + this.dataConfig.downConfig.val *
|
||||
2 + 'rpx'
|
||||
}
|
||||
},
|
||||
contantRadius() {
|
||||
return { 'border-radius': this.dataConfig.contantStyle.val ? this.dataConfig.contantStyle.val + 'px' : '0' };
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.diy_video {
|
||||
iframe {
|
||||
border: none;
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
video {
|
||||
width: 100%;
|
||||
height: 340rpx;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user