| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526 |
- <template>
- <view class="container">
- <view class="searchbackground">
- <view class="backgroundimg">
- <image src="../../static/index/index05.png" mode=""></image>
- </view>
- </view>
- <view class="content flex">
- <view class="input-box flex" @click="clickSearch">
- <view class=" input-content flex">
- <view class="iconfont iconsearch"></view>
- <view class="input"><input type="text" disabled placeholder="请输入搜索内容" /></view>
- </view>
- </view>
- <!-- 轮播图 -->
- <swiper class="carousel" autoplay="true" :interval="5000" :duration="400">
- <swiper-item @click="swiperClick" class="carousel-item" v-for="(item,index) in carouselList"
- :key="index">
- <image :src="item.pic"></image>
- </swiper-item>
- <view class="swiper-dots">
- </view>
- </swiper>
- <view class="title-box">
- <view class="boxx" @click="navTo('/pages/category/category')">
- <view class="boxx-top">
- <image src="../../static/index/index06.png" mode=""></image>
- </view>
- <view class="boxx-bottom">
- 全部商品
- </view>
- </view>
- <view class="boxx" @click="navTo('/pages/index/jfgood')">
- <view class="boxx-top">
- <image src="../../static/index/index08.png" mode=""></image>
- </view>
- <view class="boxx-bottom">
- 积分商城
- </view>
- </view>
- <view class="boxx" @click="navTo('/pages/story/story')">
- <view class="boxx-top">
- <image src="../../static/index/index02.png" mode=""></image>
- </view>
- <view class="boxx-bottom">
- 公司介绍
- </view>
- </view>
- <view class="boxx" @click="navTo('/pages/user/shareQrCode')">
- <view class="boxx-top">
- <image src="../../static/index/index01.png" mode=""></image>
- </view>
- <view class="boxx-bottom">
- 邀请有礼
- </view>
- </view>
- </view>
- <view class="customs">
- <image src="../../static/index/index09.png" mode=""></image>
- <view class="vip">
- 会员专区
- </view>
- </view>
- <view class="jifen-content">
- <view class="jifen-box" v-for="(item,index) in bastList" :key="index"
- @click="navTo('/pages/product/product?id=' + item.id)">
- <view class="img">
- <image class="hlbg" src="../../static/index/index04.png" mode=""></image>
- <image class="image" :src="item.image" mode=""></image>
- </view>
- <view class="jifen-list">
- <view class="box-title">
- <view class="top clamp2">
- {{item.store_name}}
- </view>
- </view>
- <view class="box-price">
- <view class="huiyuan">
- 会员价
- </view>
- <view class="price">
- ¥
- </view>
- <view class="price-left">
- {{(item.price*1).toFixed(0)}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- loadIndexs
- } from '@/api/index.js';
- import {
- mapState
- } from 'vuex';
- export default {
- components: {
- },
- data() {
- return {
- carouselList: [], //轮播列表
- couponArray: '',
- bastList: [], //会员礼包
- fugou: '', //复购商品
- price: '', //复购价格
- }
- },
- onLoad() {
- this.loadData()
- },
- methods: {
- // 请求载入数据
- async loadData() {
- loadIndexs({})
- .then(({
- data
- }) => {
- let goods = data.info;
- this.carouselList = data.banner;
- this.swiperLength = this.carouselList.length;
- this.goodsList = goods.firstList; //最新商品
- this.bastList = goods.vipList; //精品推荐
- uni.stopPullDownRefresh();
- })
- .catch(e => {
- uni.stopPullDownRefresh();
- });
- },
- swiperClick() {
- },
- // 点击搜索框
- clickSearch() {
- console.log('点击')
- uni.navigateTo({
- url: '/pages/product/search'
- });
- },
- navTo(url) {
- uni.navigateTo({
- url,
- fail() {
- uni.switchTab({
- url
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- height: auto;
- background-color: #FFFFFF;
- ;
- }
- .title-box {
- display: flex;
- width: 100%;
- .boxx {
- margin: 40rpx 0 80rpx 0;
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- .boxx-top {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .boxx-bottom {
- margin-top: 15rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #333333;
- }
- }
- }
- .container {
- min-height: 100%;
- height: auto;
- }
- .searchbackground {
- position: relative;
- .backgroundimg {
- position: absolute;
- width: 750rpx;
- image {
- width: 100%;
- }
- }
- }
- // .fiexd {
- // position: fiexd;
- // bottom: 0;
- // width: 750rpx;
- // height: 750rpx;
- // image {
- // width: 100%;
- // height: 100%;
- // }
- // }
- .content {
- flex-direction: column;
- justify-content: center;
- height: 100%;
- .input-box {
- position: absolute;
- left: 0;
- top: 0;
- margin: 66rpx 25rpx;
- justify-content: center;
- background: #FFFFFF;
- box-shadow: 0rpx 1rpx 21rpx 0rpx rgba(255, 255, 255, 0.12);
- border-radius: 35rpx;
- width: 700rpx;
- height: 70rpx;
- .input {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #C4C4C4;
- line-height: 38rpx;
- }
- }
- .carousel {
- margin-top: 165rpx;
- width: 700rpx;
- height: 370rpx;
- .carousel-item {
- border-radius: 20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .customs {
- margin-left: 40rpx;
- width: 100%;
- display: flex;
- margin-top: 20rpx;
- align-items: center;
- image {
- width: 37rpx;
- height: 37rpx;
- }
- .vip {
- margin-left: 10rpx;
- font-size: 32rpx;
- font-weight: bold;
- color: #333333;
- }
- }
- .customs-content {
- position: relative;
- padding-top: 14rpx;
- .backgroundimg1 {
- width: 700rpx;
- height: 300rpx;
- image {
- height: 100%;
- width: 100%;
- }
- }
- .box {
- position: absolute;
- margin-top: -250rpx;
- padding: 0 38rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .customs-img {
- width: 200rpx;
- height: 200rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .customstext {
- margin-left: 14rpx;
- height: 200rpx;
- // display: flex;
- // flex-direction: column;
- // justify-content: space-around;
- position: relative;
- .customstext1 {
- .customstext-title {
- width: 350rpx;
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #3F7C1F;
- }
- .customstext-product {
- // margin-top: 25rpx;
- width: 400rpx;
- padding-top: 10rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ABD56F;
- }
- }
- .customsprice {
- position: absolute;
- bottom: 0;
- left: 0;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- width: 100%;
- .customsprice-left {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF0000;
- flex-shrink: 0;
- }
- .customsprice-between {
- font-size: 42rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF0000;
- flex-shrink: 0;
- }
- .customsprice-right {
-
- text-align: center;
- width: 137rpx;
- height: 52rpx;
- line-height: 52rpx;
- background: #3F7C1F;
- border-radius: 26rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #FFFFFF;
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- }
- }
- }
- .jifen-content {
- width: 700rpx;
- padding-bottom: 20rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .jifen-box {
- position: relative;
- margin: 20rpx 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 342rpx;
- height: 512rpx;
- padding-top: 20rpx;
- background: #FFFFFF;
- // box-shadow: 0px 7px 10px 1px #8BAFAB;
- .img {
- position: relative;
- .hlbg{
- border-radius: 10rpx;
- z-index: 9;
- position: absolute;
- width:312rpx ;
- height: 312rpx;
- top: 0;
- left: 0;
- }
- flex-shrink: 0;
- // margin-top: 20rpx;
- height: 312rpx;
- width: 312rpx;
- background-color: #eee;
- .image {
- height: 100%;
- width: 100%;
- }
- }
- .jifen-list {
- // margin-left: -80rpx;
- width: 312rpx;
- height: 100%;
- position: relative;
- .box-title {
- .top {
- margin: 20rpx 0 10rpx 0;
- // padding: 20rpx 0 10rpx 0;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #3F7C1F;
- line-height: 35rpx;
- }
- .button {
- padding-bottom: 20rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #3F7C1F;
- line-height: 35rpx;
- opacity: 0.8;
- }
- }
- .box-price {
- display: flex;
- align-items: center;
- position: absolute;
- bottom: 20rpx;
-
- .pricebox {
- height: 25rpx;
- width: 25rpx;
- image {
- height: 100%;
- width: 100%;
- }
- }
- .huiyuan{
- padding: 4rpx 8rpx;
- background: linear-gradient(90deg, #C79A4C, #F9DF7F);
- border-radius: 5rpx;
- font-size: 19rpx;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #FFFFFF;
- font-weight: 33rpx;
- text-align: center;
- }
- .price-left {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FF0000;
- line-height: 35rpx;
- }
- .price{
- margin: 0 5rpx;
- font-size: 19rpx;
- font-weight: bold;
- color: #FF4C4C;
- }
- .price-right {
- margin-left: 10rpx;
- font-size: 21rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-decoration: line-through;
- color: #999999;
- line-height: 35rpx;
- }
- }
- }
- }
- }
- }
- </style>
|