Commit 3e892000 authored by 郑秀明's avatar 郑秀明

Merge branch 'develop' of http://39.96.27.29/zhengxiuming/shop_mobile_uni into develop

parents 4e0f64e3 8bd5f8d4
......@@ -48,6 +48,7 @@
left: 0;
bottom: 0;
background: #fff;
z-index: 100;
i {
display: block;
width: 44rpx;
......
<template>
<view class="uni-countdown">
<view>
<view class="uni-countdown" v-if="s > 0">
<text v-if="showDay" :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ d }}</text>
<text v-if="showDay" :style="{ color: splitorColor }" class="uni-countdown__splitor">天</text>
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ h }}</text>
......@@ -9,6 +10,10 @@
<text :style="{ borderColor: borderColor, color: color, backgroundColor: backgroundColor }" class="uni-countdown__number">{{ s }}</text>
<text v-if="!showColon" :style="{ color: splitorColor }" class="uni-countdown__splitor">秒</text>
</view>
<view v-else>
<text class="uni-countdown__number"></text>
</view>
</view>
</template>
<script>
/**
......@@ -115,8 +120,8 @@
let seconds = this.seconds
let [day, hour, minute, second] = [0, 0, 0, 0]
if (seconds > 0) {
day = Math.floor(seconds / (60 * 60 * 24))
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
// day = Math.floor(seconds / (60 * 60 * 24))
hour = Math.floor(seconds / (60 * 60))
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
} else {
......@@ -141,7 +146,6 @@
},
startData() {
this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
console.log(this.seconds)
if (this.seconds <= 0) {
return
}
......@@ -173,6 +177,7 @@
flex-direction: row;
justify-content: flex-start;
padding: 2rpx 0;
align-items: center;
}
.uni-countdown__splitor {
......@@ -191,9 +196,9 @@
/* #endif */
justify-content: center;
align-items: center;
width: 52rpx;
height: 48rpx;
line-height: 48rpx;
padding: 0 6rpx;
height: 32rpx;
line-height: 32rpx;
margin: 5rpx;
text-align: center;
font-size: 24rpx;
......
<template>
<view class="uni-swiper__warp">
<slot />
<view v-if="mode === 'default'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='default'>
<view v-for="(item,index) in info" :style="{
'width': (index === current? dots.width*2:dots.width ) + 'px','height':dots.width/2 +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border-radius':'0px'}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-bar" />
</view>
<view v-if="mode === 'dot'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='dot'>
<view v-for="(item,index) in info" :style="{
'width': dots.width + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item" />
</view>
<view v-if="mode === 'round'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='round'>
<view v-for="(item,index) in info" :class="[index === current&&'uni-swiper__dots-long']" :style="{
'width':(index === current? dots.width*3:dots.width ) + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item " />
</view>
<view v-if="mode === 'nav'" key='nav' :style="{'background-color':dotsStyles.backgroundColor,'bottom':'0'}" class="uni-swiper__dots-box uni-swiper__dots-nav">
<text :style="{'color':dotsStyles.color}" class="uni-swiper__dots-nav-item">{{ (current+1)+"/"+info.length +' ' +info[current][field] }}</text>
</view>
<view v-if="mode === 'indexes'" key='indexes' :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box">
<view v-for="(item,index) in info" :style="{
'width':dots.width + 'px','height':dots.height +'px' ,'color':index === current?dots.selectedColor:dots.color,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
:key="index" class="uni-swiper__dots-item uni-swiper__dots-indexes"><text class="uni-swiper__dots-indexes-text">{{ index+1 }}</text></view>
</view>
</view>
</template>
<script>
export default {
name: 'UniSwiperDot',
props: {
info: {
type: Array,
default () {
return []
}
},
current: {
type: Number,
default: 0
},
dotsStyles: {
type: Object,
default () {
return {}
}
},
// 类型 :default(默认) indexes long nav
mode: {
type: String,
default: 'default'
},
// 只在 nav 模式下生效,变量名称
field: {
type: String,
default: ''
}
},
data() {
return {
dots: {
width: 8,
height: 8,
bottom: 10,
color: '#fff',
backgroundColor: 'rgba(0, 0, 0, .3)',
border: '1px rgba(0, 0, 0, .3) solid',
selectedBackgroundColor: '#333',
selectedBorder: '1px rgba(0, 0, 0, .9) solid'
}
}
},
watch: {
dotsStyles(newVal) {
this.dots = Object.assign(this.dots, this.dotsStyles)
},
mode(newVal) {
if (newVal === 'indexes') {
this.dots.width = 20
this.dots.height = 20
} else {
this.dots.width = 8
this.dots.height = 8
}
}
},
created() {
if (this.mode === 'indexes') {
this.dots.width = 20
this.dots.height = 20
}
this.dots = Object.assign(this.dots, this.dotsStyles)
}
}
</script>
<style lang="scss" scoped>
.uni-swiper__warp {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: column;
position: relative;
overflow: hidden;
}
.uni-swiper__dots-box {
position: absolute;
bottom: 10px;
left: 0;
right: 0;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-swiper__dots-item {
width: 8px;
border-radius: 100px;
margin-left: 6px;
background-color: $uni-bg-color-mask;
// transition: width 0.2s linear; 不要取消注释,不然会不能变色
}
.uni-swiper__dots-item:first-child {
margin: 0;
}
.uni-swiper__dots-default {
border-radius: 100px;
}
.uni-swiper__dots-long {
border-radius: 50px;
}
.uni-swiper__dots-bar {
border-radius: 50px;
}
.uni-swiper__dots-nav {
bottom: 0px;
height: 40px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: flex-start;
align-items: center;
background-color: rgba(0, 0, 0, 0.2);
}
.uni-swiper__dots-nav-item {
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; */
font-size: $uni-font-size-base;
color: #fff;
margin: 0 15px;
}
.uni-swiper__dots-indexes {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
// flex: 1;
justify-content: center;
align-items: center;
}
.uni-swiper__dots-indexes-text {
color: #fff;
font-size: $uni-font-size-sm;
}
</style>
This diff is collapsed.
......@@ -25,6 +25,7 @@
"minimist": "^1.2.0"
},
"dependencies": {
"jweixin-module": "^1.6.0"
"jweixin-module": "^1.6.0",
"moment": "^2.24.0"
}
}
<template>
<view class="goods_content">
<view v-if="style_setting.arrange == 1" class="goods_box" :class="dataList.length % style_setting.listType !== 0 ? 'needAfter' : ''" :style="{'background-color': style_setting.bg_color}">
<view v-if="style_setting.arrange == 1" class="goods_box" :style="{'background-color': style_setting.bg_color}">
<view v-for="(item, key) in dataList" :key="key" class="goods_item" :style="width ? {'width':width} : ''">
<view :class="style_setting.listType === 2 ? 'image_box2' : 'image_box'">
<image v-if="style_setting.sign_show" class="logo" :style="{'width': style_setting.sign_size*2+'rpx','height': style_setting.sign_size*2+'rpx'}" :src="style_setting.sign_url"></image>
......@@ -8,15 +8,17 @@
</view>
<text class="goods_name" v-if="style_setting.title_show">{{item.goods_name}}</text>
<text class="goods_sub_name" v-if="style_setting.sub_title_show">{{item.goods_subname || ' '}}</text>
<view class="goods_price">
<view class="goods_price" v-if="isLogin">
<text v-if="style_setting.price_show">{{item.price}}</text>
<i v-if="style_setting.cart_show" @click="$addCart(item.spec_id)"></i>
<i v-if="style_setting.cart_show" @click="$addCart(item.spec_id,1,isLogin)"></i>
</view>
<view v-else class="unshow_price">登录显示价格</view>
</view>
<view v-if="spaceArray.length" v-for="(item, key) in spaceArray" :key="key+65535" :style="width ? {'width':width} : ''"></view>
</view>
<swiper v-else indicator-dots="true" class="swiper_content">
<swiper-item v-for="(val, index) in dataList" :key="index" class="goods_box2" :class="val.length < style_setting.listType ? 'needAfter' : ''">
<uni-swiper-dot v-else :info="dataList" :dotsStyles="{'width': 4,'height':4, 'bottom':5,'border':'none','selectedBorder':'none'}" mode="dot" :current="current">
<swiper class="swiper_content" @change="change" :autoplay="true" :style="style_setting.listType === 2 ? {'height': '536rpx'} : {'height': '346rpx'}">
<swiper-item v-for="(val, index) in dataList" :key="index" class="goods_box2">
<view v-for="(item, key) in val" :key="key" class="goods_item" :style="width ? {'width':width} : ''">
<view :class="style_setting.listType === 2 ? 'image_box2' : 'image_box'">
<image v-if="style_setting.sign_show" class="logo" :style="{'width': style_setting.sign_size*2+'rpx','height': style_setting.sign_size*2+'rpx'}" :src="style_setting.sign_url"></image>
......@@ -24,28 +26,43 @@
</view>
<text class="goods_name" v-if="style_setting.title_show">{{item.goods_name}}</text>
<text class="goods_sub_name" v-if="style_setting.sub_title_show">{{item.goods_subname || ' '}}</text>
<view class="goods_price">
<view class="goods_price" v-if="isLogin">
<text v-if="style_setting.price_show">{{item.price}}</text>
<i v-if="style_setting.cart_show" @click="$addCart(item.spec_id)"></i>
<i v-if="style_setting.cart_show" @click="$addCart(item.spec_id,1,isLogin)"></i>
</view>
<view v-else class="unshow_price">登录显示价格</view>
</view>
<view v-if="spaceArray.length" v-for="(item, key) in spaceArray" :key="key+65535" :style="width ? {'width':width} : ''"></view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
</template>
<script>
import uniSwiperDot from "@/components/uni-swiper-dot/uni-swiper-dot.vue"
export default {
props: {
wrapper_props: {
type: Object
},
isLogin: {
type: Number,
default: 0
}
},
data() {
return {
dataList: [],
style_setting: this.wrapper_props.style_setting,
width: ''
width: '',
spaceArray: [],// 商品不足补足空余部分
current: 0
}
},
methods: {
change(e) {
this.current = e.detail.current;
}
},
mounted() {
......@@ -64,6 +81,10 @@
} else {
list = cate_goods_list.concat(goods_list)
}
const space = listType - list.length % listType;
if(space !== listType) {
this.spaceArray = new Array(space);
}
this.dataList = list;
if(arrange == 2) {
let array = [];
......@@ -72,17 +93,19 @@
}
this.dataList = array;
}
},
components: {
uniSwiperDot
}
}
</script>
<style lang="less" scoped>
.swiper_content {
height: 320rpx;
width: 702rpx;
margin: 0 auto;
padding: 24rpx;
box-sizing: border-box;
background: #fff;
}
.goods_box, .goods_box2 {
display: flex;
......@@ -99,6 +122,11 @@
align-items: center;
}
}
.unshow_price {
font-size: 28rpx;
width: 90%;
text-align: left;
}
.needAfter::after {
// content: '';
flex: auto;
......
......@@ -22,10 +22,11 @@
<text class="hot_goods_subname" v-if="style_setting.sub_title_show">{{item.sub_title}}</text>
<view class="between_price">
<view class="between_left" v-if="style_setting.price_show">
<text class="hot_pro_price">{{item.price}}</text>
<text class="hot_pro_price" v-if="isLogin">{{item.price}}</text>
<!-- <text class="hot_price">{{item.price}}</text> -->
<text class="hot_pro_price" v-else>登录显示价格</text>
</view>
<i class="hot_cart_icon" v-if="style_setting.cart_show" @click="$addCart(item.spec_id)"></i>
<i class="hot_cart_icon" v-if="style_setting.cart_show" @click="$addCart(item.spec_id, 1,isLogin)"></i>
</view>
</view>
</view>
......@@ -37,6 +38,10 @@
props:{
wrapper_props: {
type: Object
},
isLogin: {
type: Number,
default: 0
}
},
data() {
......
......@@ -76,4 +76,7 @@
background-size: 100% 100%;
background-repeat: no-repeat;
}
.main_title {
font-family: PingFangSC-Medium,PingFang SC;
}
</style>
<template>
<view class="mult_content">
<view class="mult_item" v-for="(item, key) in list" :key="key" :style="{'left':item.left*rate+'rpx','top':item.top*rate+'rpx','right':item.right*rate+'rpx','bottom':item.bottom*rate+'rpx','width':item.width*rate+'rpx','height':item.height*rate+'rpx'}" @click="jumpPage(item.link)">
<view class="mult_item" v-for="(item, key) in list" :key="key" :style="{'left':item.left*rate+'rpx','top':item.top*rate+'rpx','right':item.right*rate+'rpx','bottom':item.bottom*rate+'rpx','width':item.width*rate+'rpx','height':item.height*rate+'rpx'}" @click="item.link ? $jump(item.link) : null">
<image :src="item.img_url"></image>
</view>
</view>
......
<template>
<view class="navigation" :style="[{'height': style_setting.height*2+'rpx', 'height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : {'background-color': style_setting.bg_color}]">
<view>
<view class="navigation" :style="[{'height': style_setting.height*2+'rpx', 'line-height': style_setting.height*2+'rpx'}, style_setting.bg_show ? {'background-image': 'url('+style_setting.bg_url+')'} : {'background-color': style_setting.bg_color}]">
<text class="navigation_text" v-for="(item, key) in list" :key="key" v-if="item.title_show" :style="[{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']">
<text class="navigation_item" v-for="(item, key) in list" :key="key" v-if="item.title_show">
<text class="navigation_text" :style="[{'color': item.title_color}, item.title_bg_show ? {'background-image': 'url('+item.title_bg_url+')'} : '']" @click="$jump(item.link)">
<i v-if="style_setting.title_icon_show" class="navigation_icon" :style="{'background-image': 'url('+item.title_icon_url+')'}"></i>
<text>{{item.title}}</text>
</text>
</text>
</view>
</view>
</template>
......@@ -27,17 +29,27 @@
<style lang="less" scoped>
.navigation {
display: flex;
align-items: center;
white-space: nowrap;
overflow: scroll;
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 0 24rpx;
box-sizing: border-box;
.navigation_item {
width: 177.5rpx;
display: inline-block;
text-align: center;
}
.navigation_text {
background-size: 100% 100%;
background-repeat: no-repeat;
width: 25%;
min-width: 120rpx;
height: 48rpx;
text-align: center;
display: inline-block;
font-size: 32rpx;
font-size: 28rpx;
text {
vertical-align: middle;
}
......
......@@ -4,47 +4,63 @@
<view>
<i v-if="style_setting.icon_show" class="promo_icon" :style="{'background-image': 'url('+style_setting.icon_url+')'}"></i>
<text class="promo_title" :style="{'color': style_setting.title_color, 'font-size': style_setting.title_font*2+'rpx'}">{{style_setting.title}}</text>
<!-- <text class="countdown">
<uni-countdown :timer="style_setting.count_down_time"></uni-countdown>
</text> -->
<text class="countdown">
<uni-countdown :hour="hour" :minute="minute" :second="second" :showDay="false" backgroundColor="#000" color="#fff"></uni-countdown>
</text>
</view>
<text class="check_more" @click="jumpPage(style_setting.more_link)">{{style_setting.more_title}}
<svg viewBox="64 64 896 896" class="" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg>
</text>
</view>
<view class="promo_goods_content" :class="flexAutoFlag ? 'promo_goods_content_after' : ''">
<view class="promo_goods_content">
<view class="promo_goods_item" v-for="(item,key) in list" :key="key" @click="$jumpGoodDetail(item.goods_id)">
<image :src="item.default_image || $noGoodsImg"></image>
<view v-if="isLogin">
<text class="pro_price">{{item.pro_price}}</text>
<text class="price">{{item.price}}</text>
</view>
<view v-else class="unshow_price">登录显示价格</view>
</view>
<view v-if="spaceArray.length" v-for="(item, key) in spaceArray" :key="key+65535" class="promo_goods_item"></view>
</view>
</view>
</template>
<script>
import uniCountdown from "@/components/uni-countdown/uni-countdown.vue"
import uniCountdown from "@/components/uni-countdown/uni-countdown.vue";
import moment from 'moment';
export default {
props: {
wrapper_props: {
type: Object
},
isLogin: {
type: Number,
default: 0
}
},
data() {
return {
style_setting: this.wrapper_props.style_setting,
list: this.wrapper_props.goods_list,
flexAutoFlag: false
hour:0,
minute: 0,
second: 0,
spaceArray: []
}
},
mounted() {
const num = this.list.length % 4;
if(num !== 0) {
this.flexAutoFlag = true;
const t = this.style_setting.count_down_type === 1 ? this.wrapper_props.first_end_time : this.style_setting.count_down_time;
const now = moment(new Date()).format('x')-0,
end = moment(t).format('x')-0,
du = moment.duration(end-now);
this.hour = du.days()*24+du.hours();
this.minute = du.hours();
this.seconds = du.seconds();
const space = 4 - this.list.length % 4;
if(space !== 4) {
this.spaceArray = new Array(space)
}
},
methods: {
},
components:{
uniCountdown
......@@ -68,6 +84,10 @@
align-items: center;
height: 88rpx;
}
.countdown {
display: inline-block;
vertical-align: middle;
}
.promo_icon {
display: inline-block;
width: 48rpx;
......@@ -116,5 +136,8 @@
width: 140rpx;
display: block;
}
.unshow_price {
font-size: 20rpx;
}
}
</style>
......@@ -2,8 +2,8 @@
<view class="flex_searchbar" :style="{'background':wrapper_props.bg_color}">
<i class="logo" :style="{'background-image': 'url('+wrapper_props.logo_url+')'}"></i>
<view class="search_view flex">
<i class="search_icon" @click="search"></i>
<input type="text" class="search_input" v-model="keyword" :placeholder="wrapper_props.placeholder">
<icon type="search" class="search_icon" size="16" @click="search"></icon>
<input type="text" @click="search" class="search_input" v-model="keyword" :placeholder="wrapper_props.placeholder">
</view>
<text class="login_btn" @click="jumpPhpPage('app=member&act=login')" v-if="!isLogin">登录</text>
<uni-icons v-else type="person" size="30" @click="jumpPhpPage('app=member')"></uni-icons>
......@@ -18,11 +18,14 @@
wrapper_props: {
type: Object,
required: true
},
isLogin: {
type: Number,
default: 0
}
},
data() {
return {
isLogin: 0,
keyword: ''
}
},
......@@ -30,6 +33,11 @@
jumpPhpPage(url) {
let link = url ? `${php}${url}` : php;
window.location.href = link;
},
search() {
uni.navigateTo({
url: `/pages/searchhistory/searchhistory?keyword=`
});
}
},
components: {
......@@ -42,7 +50,13 @@
.flex_searchbar {
display: flex;
justify-content: space-between;
padding: 24rpx;
padding: 20rpx 24rpx;
position: fixed;
width: 100%;
top: 0;
left: 0;
box-sizing: border-box;
z-index: 100;
.flex {
display: flex;
}
......@@ -59,14 +73,15 @@
border-radius: 30rpx;
}
.search_icon {
display: inline-block;
display: flex;
justify-content: center;
align-items: center;
width: 56rpx;
height: 56rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAAAAAA5AE8dAAACh0lEQVRYw83ZMW/aQBTAcb7K3xaGDcQUIUWtEFKmMKRbVT5AEBOV+gFgZmEh6tatH4HIK8qUISGIFgllyFQhaqlyLjRpIR1I0jTCl9p5r81t9sk/2Xe+u3fvUtdryvLH3DylpNaQV08j16DLqwtjhNHF3BhhdHFpjDT688JIoxKt+RBdfjdGGl3OjTi6EDRvUVHzBl2KmitU2DQp2X7/jV4ZeVRqHN1HF+KmSV1fGnl0YRTQuQZq/hc6nYyGJ8PRZCqGBvudWimX9bK5Uq2zH0igYbecd7ktbr7cDZ+KBv2Kw5/FqfQfe9svVvS05d1Z7p3utU7t6AcbelZNr5hi0x8MBn6zuLpMV8+s6HsLelYCoFAf390a1wsAlKzqx2j0tArgNfz7PRP6DQ+gamuBb5Fo0EoDmfbswf1ZOwOkW0GS3u97QGZvTc1eBvD6CdCwAnjttXVtD6iE8dGuAzRma+tmDcDpxkaDMlDwIx7yC0A5iIv28kA96gvDOpDvxUU7LjCOfGoMuJ2Y6HQXKFr6twjUpvHQSQloWtAmUJrEQ0c5wLegPpAbxUOHWXAGFnTgQHYYDz3xwLWiLngnz+BNVdpUpfenNYX/VGVE/dXY338Ws5TKfKoz86usUY+sprxLtJra1312hskCNEuEAs6LSbKoLyqWWpXNo/NEoWRE1Pd2C4DtQ8n49OvBxuoDjkUj6eNVQ2wchElj/l5n9ybm3+30bv6kw20Atg4kdyfnR5sAvJTdR01eOIAjvDkbvnLgjTB6/mnHef35H24jVTa8KltzlSSCTrpDJTGjk0LSSXappOV0Eog6qU6dpKxO+lgn0a2Tktc5PFA65tA5kFE6OtI55JI4jvsF01XE0L1M7eEAAAAASUVORK5CYII=) no-repeat;
background-size: 100% 100%;
}
.search_input {
height: 60rpx;
font-size: 28rpx;
}
.login_btn {
width: 92rpx;
......
<template>
<view>
<swiper :autoplay="slide_setting.autoplay" :style="{'background-color': slide_setting.bg_color, 'height': slide_setting.slideHeight*2+'rpx'}" circular="true" interval="3000" :indicator-dots="slide_setting.dots">
<uni-swiper-dot :info="slide_list" :dotsStyles="{'width': 4,'height':4, 'bottom':5, 'selectedBackgroundColor':'#fff', 'backgroundColor': '#ccc', 'border':'none','selectedBorder':'none'}" :mode="slide_setting.tipsStyle === 1 ? 'dot' : 'default'" :current="current">
<swiper :autoplay="slide_setting.autoplay" :style="{'background-color': slide_setting.bg_color, 'height': slide_setting.slideHeight*2+'rpx'}" circular="true" interval="3000" @change="change">
<swiper-item v-for="(item, key) in slide_list" :key="key">
<view :style="{'height': slide_setting.slideHeight*2+'rpx'}">
<image class="slide_img" :src="item.img_url" @click="jumpPage(item.img_href)"></image>
<image class="slide_img" :src="item.img_url" @click="$jump(item.img_href)"></image>
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
</template>
<script>
import uniSwiperDot from "@/components/uni-swiper-dot/uni-swiper-dot.vue"
export default {
props: {
wrapper_props: {
......@@ -20,13 +23,17 @@
data() {
return {
slide_setting: this.wrapper_props.slide_setting,
slide_list: this.wrapper_props.slide_list
slide_list: this.wrapper_props.slide_list,
current: 0,
}
},
methods: {
jumpPage(url) {
change(e) {
this.current = e.detail.current;
}
},
components: {
uniSwiperDot
}
}
</script>
......
<template>
<view class="homeContent">
<component v-for="(item, index) in data" :key="index" :is="item.name" :wrapper_props="item.wrapper_props"></component>
<component v-for="(item, index) in data" :key="index" :is="item.name" :wrapper_props="item.wrapper_props" :isLogin="isLogin"></component>
<BottomBar />
</view>
</template>
......@@ -20,7 +20,8 @@
export default {
data() {
return {
data: []
data: [],
isLogin: 0
}
},
onLoad() {
......@@ -34,6 +35,7 @@
dataType: 'json',
success: (res) => {
this.data = res.data.data;
this.isLogin = res.data.login_flg;
}
});
}
......@@ -56,7 +58,7 @@
<style lang="less" scoped>
.homeContent {
padding-bottom: 110rpx;
padding: 100rpx 0 110rpx;
background-color: #f8f8f8;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment