| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457 |
- <template>
- <view class="center">
- <!-- 顶部logo and 搜索 start-->
- <view class="top-search flex">
- <view class="top-logo">
- <image src="../../static/icon/logo.png" mode="widthFix"></image>
- </view>
- <view class="search-box flex" @click="clickSearch()">
- <image class="search" src="../../static/icon/search-h.png" mode=""></image>
- <view class="search-font">输入关键词搜索</view>
- </view>
- </view>
- <!-- 顶部logo and 搜索 end-->
- <view class="jg"></view>
- <!-- 轮播图 start -->
- <swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
- <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
- @click="bannerNavToUrl(item)">
- <image src="../../static/img/bargainBg.jpg" />
- </swiper-item>
- </swiper>
- <!-- 轮播图 end -->
- <view class="swiper-btm flex">
- <view class="btm-item flex">
- <image src="../../static/icon/index-gou.png" mode=""></image>
- <view class="">自用购物返利</view>
- </view>
- <view class="btm-item flex">
- <image src="../../static/icon/index-gou.png" mode=""></image>
- <view class="">分享好友赚钱</view>
- </view>
- <view class="btm-item flex">
- <image src="../../static/icon/index-gou.png" mode=""></image>
- <view class="">超值正品优惠</view>
- </view>
- </view>
- <!-- 预约 start-->
- <view class="yuyue-wrap">
- <view class="yuyue-top flex">
- <image src="../../static/img/yuyue-top.png" mode="heightFix"></image>
- </view>
- <view class="yuyue-item" v-for="item in 3">
- <view class="item-top">
- <image src="../../static/img/yuyue.png" mode=""></image>
- <view class="item-top-info flex">
- <view class="">
- 早上场<text>/大家都在买</text>
- </view>
- <view class="goto">
- GO>
- </view>
- </view>
- </view>
- <view class="item-info flex">
- <view class="item-img">
- <image src="../../static/img/zaoshang.png" mode=""></image>
- </view>
- <view class="item-val flex">
- <view class="item-status">
- 距离本场开始
- </view>
- <view class="item-djs">
- <uni-countdown
- color="#C6914E"
- background-color="#F6EFDF"
- :show-day="false"
- :day="0"
- :hour="10"
- :minute="10"
- :second="10"
- ></uni-countdown>
- </view>
- <view class="item-base">
- 开始时间 16:00:00 结束时间 16:30:00
- </view>
- <view class="item-btn" @click="yuyue()">
- 已预约
- </view>
- </view>
-
- </view>
- </view>
- </view>
- <!-- 预约 end-->
- <!-- 预约弹窗 start-->
- <uni-popup ref="popupyy" type="bottom">
- <view class="popupyy-wrap">
- <view class="popupyy-top">
- 预约活动
- </view>
- <view class="popupyy-tit">
- 本次预约冻结广告值
- </view>
- <view class="popupyy-val">
- 330
- </view>
- <view class="" style="margin-top: 50rpx;">
- 消费积分不低于100
- </view>
- <view class="" style="color: #FF4C4C;margin-top: 15rpx;">
- 可用广告值700
- </view>
- <view class="popupyy-btn" @click="yuyueOk()">
- 确认预约
- </view>
- </view>
- </uni-popup>
- <!-- 预约弹窗 end-->
- </view>
- </template>
- <script>
- import {
- tabbar1
- } from '@/utils/tabbar.js';
- import {
- loadIndexs
- } from '@/api/index.js';
- import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
- export default {
- components: {
- uniCountdown
- },
- data() {
- return {
- current: 0,
- tabbar: tabbar1,
- titleNViewBackground: '',
- swiperCurrent: 0,
- swiperLength: 0,
- dataList: '',
- carouselList: [], //轮播图列表
- text: ['恭喜黑白灰用户拼团成功¥353元!', '恭喜黑白灰用户拼团成功¥353元!'],
- stopTime: {
- stopTimeH: 0,
- stopTimeM: 24,
- stopTimeS: 59
- },
- bzb: 30
- };
- },
- onLoad() {
- this.loadData();
- },
- methods: {
- loadData() {
- loadIndexs({})
- .then(({
- data
- }) => {
- let goods = data.info;
- this.dataList = goods.bastList; //精品推荐
- this.carouselList = data.banner;
- })
- .catch(e => {});
- },
- goDetails(e) {
- console.log(e, '123456');
- uni.navigateTo({
- url: '/pages/index/messageInfo'
- });
- },
- nav(url) {
- uni.navigateTo({
- url,
- fail() {
- uni.switchTab({
- url
- });
- }
- });
- },
- //轮播图切换修改背景色
- swiperChange(e) {
- const index = e.detail.current;
- this.swiperCurrent = index;
- this.titleNViewBackground = this.carouselList[index].background;
- },
- // 點擊搜索框
- clickSearch() {
- uni.navigateTo({
- url: '/pages/product/search'
- });
- },
- //详情页
- navToDetailPage(item) {
- let id = item.id;
- uni.navigateTo({
- url: '/pages/product/product?id=' + id
- });
- },
- // 打开预约弹窗
- yuyue() {
- this.$refs.popupyy.open()
- },
- // 确定预约
- yuyueOk() {
- this.$refs.popupyy.close()
- }
- }
- };
- </script>
- <style lang="scss">
- page,
- .center {
- min-height: 100%;
- height: auto;
- background: #ededed;
- }
- // 顶部搜索
- .top-search {
- height: 80rpx;
- padding: 0 20rpx;
- background-color: #fff;
- .top-logo {
- width: 50rpx;
- // height: 50rpx;
- margin-right: 10rpx;
- image {
- width: 48rpx;
- }
- }
- .search-box {
- justify-content: center;
- width: 698rpx;
- height: 60rpx;
- background: #EEEEEE;
- // box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
- border-radius: 30rpx;
- .search {
- width: 34rpx;
- height: 34rpx;
- }
- .search-font {
- margin-left: 14rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #CBCBCB;
- }
- }
- }
- // 顶部轮播图
- .top-swiper {
- width: 750rpx;
- height: 360rpx;
- // margin: 20rpx 0 0;
- image {
- width: 750rpx;
- height: 360rpx;
- }
- }
- .swiper-btm {
- height: 60rpx;
- width: 750rpx;
- background-color: #fff;
- margin-bottom: 20rpx;
- font-size: 21rpx;
- font-weight: 500;
- color: #333333;
- .btm-item {
- flex-grow: 1;
- justify-content: center;
- image {
- width: 25rpx;
- height: 25rpx;
- margin-right: 14rpx;
- }
- }
- }
- .jg {
- height: 20rpx;
- background-color: #fff;
- }
- .yuyue-wrap {
- background-color: #fff;
- .yuyue-top {
- height: 117rpx;
- justify-content: center;
- image {
- display: inline-block;
- height: 31rpx;
- margin: auto;
- }
- }
- .yuyue-item {
- width: 690rpx;
- margin: auto;
-
- .item-top {
- width: 690rpx;
- height: 80rpx;
- border-radius: 18rpx;
- // background-color: #bfa;
- position: relative;
- image {
- width: 690rpx;
- height: 80rpx;
- // position: relative;
- }
- .item-top-info {
- width: 690rpx;
- height: 80rpx;
- position: absolute;
- top: 0;
- left: 0;
- font-size: 33rpx;
- font-weight: bold;
- color: #C6914E;
- padding-left: 35rpx;
- padding-right: 25rpx;
- text {
- font-size: 22rpx;
- font-weight: 500;
- color: #C6914E;
- }
- .goto {
- width: 60rpx;
- line-height: 26rpx;
- background: #C6914E;
- border-radius: 12rpx;
- font-size: 18rpx;
- font-weight: 500;
- color: #FFFFFF;
- text-align: center;
- }
- }
- }
- .item-info {
- width: 690rpx;
- height: 252rpx;
- margin-top: -20rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 0px 0px 20rpx 20rpx;
- padding: 0 25rpx;
- margin-bottom: 20rpx;
- .item-img {
- width: 134rpx;
- height: 133rpx;
- background-color: red;
- flex-shrink: 0;
- image {
- width: 134rpx;
- height: 133rpx;
- }
- }
- .item-val {
- flex-grow: 1;
- height: 100%;
- // background-color: #009688;
- position: relative;
- flex-direction: column;
- align-items: flex-start;
- padding-left: 25rpx;
- justify-content: center;
- .item-djs {
- margin: 20rpx 0;
- height: 42rpx;
- }
- .item-status {
- font-size: 26rpx;
- font-weight: bold;
- color: #333333;
- }
- .item-base {
- font-size: 25rpx;
- font-weight: 500;
- color: #666666;
- }
- .item-btn {
- width: 159rpx;
- height: 59rpx;
- line-height: 59rpx;
- background: #CCCCCC;
- border-radius: 10rpx;
- position: absolute;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
- text-align: center;
- }
- }
-
- }
- }
- }
- .popupyy-wrap {
- width: 750rpx;
- height: 745rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 0px 0px;
- text-align: center;
- font-size: 32rpx;
- color: #999999;
- font-weight: 500;
- padding-top: 60rpx;
- .popupyy-top {
- font-size: 36rpx;
- font-weight: 500;
- color: #333333;
- position: relative;
- &::before {
- content: '';
- width: 138rpx;
- height: 1rpx;
- background: #CBCBCB;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 124rpx;
- margin: auto;
- }
- &::after {
- content: '';
- width: 138rpx;
- height: 1rpx;
- background: #CBCBCB;
- position: absolute;
- top: 0;
- bottom: 0;
- right: 124rpx;
- margin: auto;
- }
- }
- .popupyy-tit {
- font-size: 32rpx;
- font-weight: 500;
- color: #999999;
- margin-top: 70rpx;
- }
- .popupyy-val {
- font-size: 67rpx;
- font-weight: bold;
- color: #333333;
- margin-top: 60rpx;
- }
- .popupyy-btn {
- width: 680rpx;
- line-height: 100rpx;
- background: #303030;
- border-radius: 10rpx;
- font-size: 34rpx;
- font-weight: 500;
- color: #F8DABA;
- margin: 20rpx auto 0;
- }
- }
- </style>
|