1.增加商品列表样式 增加首页广告

yj-dev
杨杰 3 years ago
parent 1a7f6c16f2
commit 8e43227fdf
  1. 2
      components/wyb-popup/iconfont.css
  2. 22
      pages.json
  3. 137
      pages/goods/goods-list/goods-list.vue
  4. 22
      pages/tabBar/home/home.vue

@ -4,7 +4,7 @@
.iconfont { .iconfont {
font-family: "iconfont" !important; font-family: "iconfont" !important;
font-size: 20px; font-size: 30px;
font-style: normal; font-style: normal;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;

@ -1,6 +1,16 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/goods/goods-list/goods-list",
"style": {
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"app-plus": {
"bounce": "none"
}
}
},{
"path": "pages/tabBar/home/home", "path": "pages/tabBar/home/home",
"style": { "style": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
@ -134,18 +144,6 @@
} }
} }
}, },
{
"path": "pages/goods/goods-list/goods-list",
"style": {
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"app-plus": {
"bounce": "none"
}
}
},
{ {
"path": "pages/goods/HM-search/HM-search", "path": "pages/goods/HM-search/HM-search",
"style": { "style": {

@ -1,6 +1,27 @@
<template> <template>
<view> <view>
<view class="input-box">
<view class="icon search"></view>
<input placeholder="搜索卡券" placeholder-style="color:#c0c0c0;" @tap="toSearch()" />
</view>
<view class="swiper">
<view class="swiper-box">
<swiper circular="true" autoplay="true" @change="swiperChange">
<swiper-item v-for="swiper in swiperList" :key="swiper.id">
<image :src="swiper.img" @tap="toSwiper(swiper)"></image>
</swiper-item>
</swiper>
<view class="indicator">
<view class="dots" v-for="(swiper, index) in swiperList"
:class="[currentSwiper >= index ? 'on' : '']" :key="index"></view>
</view>
</view>
</view>
<view class="width90 height120">
<image class="goodsimg" src="../../../static/img/tc.png"></image>
</view>
</view> </view>
</template> </template>
@ -9,6 +30,19 @@
data() { data() {
return { return {
goodsList: [], goodsList: [],
//
swiperList: [{
id: 1,
src: 'url1',
img: '/static/img/banner2.png'
},
{
id: 2,
src: 'url2',
img: '/static/img/banner3.png'
}
],
currentSwiper: 0,
}; };
}, },
onLoad: function(option) { //optionobject onLoad: function(option) { //optionobject
@ -22,26 +56,111 @@
title: '金币列表' title: '金币列表'
}); });
} }
}, },
onPageScroll(e) { onPageScroll(e) {
},
//page.json "enablePullDownRefresh": true
onPullDownRefresh() {
}, },
//page.json"onReachBottomDistance" //page.json"onReachBottomDistance"
onReachBottom() { onReachBottom() {
}, },
methods: { methods: {
//
swiperChange(event) {
this.currentSwiper = event.detail.current;
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.input-box {
width: 90%;
margin-left: 5%;
margin-top: 15px;
height: 70rpx;
background-color: #f5f5f5;
border-radius: 10rpx;
position: relative;
display: flex;
align-items: center;
.icon {
display: flex;
align-items: center;
position: absolute;
top: 2px;
left: 5px;
width: 60upx;
height: 60upx;
font-size: 34upx;
color: #c0c0c0;
}
input {
padding-left: 50upx;
height: 28upx;
font-size: 28upx;
width: 100%;
}
}
.swiper {
width: 100%;
display: flex;
justify-content: center;
margin-top: 20px;
.swiper-box {
width: 92%;
height: 150px;
overflow: hidden;
border-radius: 15upx;
box-shadow: 0upx 8upx 25upx rgba(0, 0, 0, 0.2);
//ios
position: relative;
z-index: 1;
swiper {
width: 100%;
height: 150px;
swiper-item {
image {
width: 100%;
height: 150px;
}
}
}
.indicator {
position: absolute;
bottom: 20upx;
left: 20upx;
background-color: rgba(255, 255, 255, 0.4);
width: 150upx;
height: 5upx;
border-radius: 3upx;
overflow: hidden;
display: flex;
.dots {
width: 0upx;
background-color: rgba(255, 255, 255, 1);
transition: all 0.3s ease-out;
&.on {
width: (100%/3);
}
}
}
}
}
.goodsimg {
width: 80px;
height: 80px;
}
</style> </style>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save