123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739 |
- <template>
- <view class="center">
- <view class="top">
- <!-- <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image> -->
- <view class="top-main flex">
- <view class="search-box flex" @click="clickSearch()">
- <image class="search" src="../../static/img/search.png" mode=""></image>
- <view class="search-font">请输入关键词搜索</view>
- </view>
- </view>
- </view>
- <swiper class="carousel" 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="item.pic" />
- </swiper-item>
- </swiper>
- <view class="tongz flex">
- <view>
- <view class="tongz-bg">
- <image src="../../static/img/tongz-bg.png" mode=""></image>
- </view>
- <view class="tongz-left flex">
- <image class="image-left" src="../../static/img/ling.png" mode=""></image>
- <u-notice-bar style="width: 100%;" mode="vertical" type="none" :volume-icon="false"
- :more-icon="true" :list="text" @click="goDetails" @getMore="nav('/pages/index/message?type=1')">
- </u-notice-bar>
- </view>
- </view>
- </view>
- <view class="navbar flex">
- <!-- @click="nav('/pages/product/classify?type=4')" -->
- <view class="navbar-item" @click="nav('/pages/product/qudouShop')">
- <image class="nitem-image" src="../../static/img/index-inco1.png" mode=""></image>
- <view class="nitem-font">趣豆购物</view>
- </view>
- <view class="navbar-item" @click="nav('/pages/product/classify?type=5')">
- <image class="nitem-image" src="../../static/img/index-inco3.png" mode=""></image>
- <view class="nitem-font">购物券专区</view>
- </view>
- <view class="navbar-item" @click="nav('/pages/product/seckill')">
- <image class="nitem-image" src="../../static/img/index-inco5.png" mode=""></image>
- <view class="nitem-font">秒杀</view>
- </view>
- <!-- <view class="navbar-item" @click="nav('/pages/store/store')">
- <image class="nitem-image" src="../../static/img/index-inco7.png" mode=""></image>
- <view class="nitem-font">合作专区</view>
- </view> -->
- <!-- <view class="navbar-item" @click="nav('/pages/category/category')">
- <image class="nitem-image" src="../../static/img/index-inco8.png" mode=""></image>
- <view class="nitem-font">大品牌区</view>
- </view> -->
- <!-- <view class="navbar-item" @click="nav('/pages/index/message?type=2')">
- <image class="nitem-image" src="../../static/img/index-inco6.png" mode=""></image>
- <view class="nitem-font">拍卖品</view>
- </view> -->
- <!-- <view class="navbar-item" @click="nav('/pages/product/classify?type=1')">
- <image class="nitem-image" src="../../static/img/index-inco2.png" mode=""></image>
- <view class="nitem-font">医斯佳专区</view>
- </view>
- <view class="navbar-item" @click="nav('/pages/product/classify?type=3')">
- <image class="nitem-image" src="../../static/img/index-inco4.png" mode=""></image>
- <view class="nitem-font">CBB专区</view>
- </view> -->
- </view>
- <view class="shingle" v-if="list">
- <view class="shingle-top flex">
- <view class="shingle-title">商品认购体验馆</view>
- <view class="shingle-btn" @click="navTo(list)">
- 超值体验
- <text>></text>
- </view>
- </view>
- <view class="shingle-main" @click="navTo(list)">
- <view class="shingle-bg">
- <image :src="list.image" mode=""></image>
- </view>
- <view class="shinglem-title flex">
- <image class="tbg" src="../../static/img/tbg-left.png" mode=""></image>
- <view class="shinglemt-center">
- <image class="address" src="../../static/img/address.png" mode=""></image>
- <view class="shingle-font">{{ list.name || 'null' }}</view>
- </view>
- <image class="tbg" src="../../static/img/tbg-right.png" mode=""></image>
- </view>
- <view class="shingle-mmain flex">
- <view class="smmain-item">
- <view class="smitem-top">开放中</view>
- <view class="smitem-bottom">状态</view>
- </view>
- <view class="shu"></view>
- <view class="smmain-item">
- <view class="smitem-top clamp">{{ list.nickname }}</view>
- <view class="smitem-bottom">易趣商品</view>
- </view>
- <view class="shu"></view>
- <view class="smmain-item">
- <view class="people flex">
- <view class="peopleitem" v-for="item in 1">
- <image src="../../static/img/busy.png" mode=""></image>
- </view>
- <view class="peopleitem" v-for="item in 4">
- <image src="../../static/img/leisure.png" mode=""></image>
- </view>
- </view>
- <view class="smitem-bottom">流畅</view>
- </view>
- </view>
- <image class="right-bottom" src="../../static/img/right-bottom.png" mode=""></image>
- </view>
- </view>
- <!-- 秒杀楼层 -->
- <seckill></seckill>
- <seck></seck>
- <!-- <view>新品认购区加一张图,点进去跳转到新品认购区</view> -->
- <view class="ge" v-if="stop.length != 0"></view>
- <view class="serve" v-if="stop.length != 0">
- <view class="seckill-title flex">
- <view class="seckill-left flex">
- <image class="seckill-inco" src="../../static/img/serve.png" mode=""></image>
- <view class="seckill-font">联盟商家展示区</view>
- </view>
- <view class="seckill-right" @click="nav('/pages/store/store')">
- <view class="seckill-rfont">更多</view>
- <image class="seckill-back" src="../../static/img/back.png" mode=""></image>
- </view>
- </view>
- <view class="serve-main flex">
- <view class="serve-item" @click="nav('/pages/store/storeInfo?id=' + item.id)"
- v-for="(item, index) in stop" :key="index">
- <image class="serve-price" :src="item.image" mode=""></image>
- <view class="clamp serve-title">{{ item.name }}</view>
- <view class="serve-address flex" v-if="item.jl">
- <image class="saddress-inco" src="../../static/img/address.png" mode=""></image>
- <view class="saddress-font">距离{{ item.jl }}KM</view>
- </view>
- </view>
- </view>
- </view>
- <u-tabbar activeColor="#f42b4e" :list="tabbar"></u-tabbar>
- </view>
- </template>
- <script>
- import {
- tabbar1
- } from '@/utils/tabbar.js';
- import seckill from '../../components/seckill/seckill.vue';
- import seck from '../../components/seckill/seck.vue'
- import {
- article
- } from '@/api/user.js';
- import {
- loadIndexs,
- store_list
- } from '@/api/index.js';
- import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
- // #ifdef H5
- import {
- openMap
- } from '@/utils/rocessor.js';
- // #endif
-
- import {
- auction_gu
- } from '@/api/hall.js';
- export default {
- components: {
- seck,
- seckill,
- uniCountdowns
- },
- data() {
- return {
- current: 0,
- tabbar: tabbar1,
- titleNViewBackground: '',
- swiperCurrent: 0,
- swiperLength: 0,
- longitude: '', //经度
- latitude: '', //纬度
- dataList: '',
- carouselList: [], //轮播图列表
- text: [],
- article: [],
- list: {},
- stop: []
- };
- },
- onPullDownRefresh() {
- console.log('111');
- this.loadData();
- this.getaddress();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- onShow() {
- this.loadData();
- this.getaddress();
- console.log(this.$u.config.v,'vvvvv');
- },
- methods: {
- loadData() {
- article({}, 1).then(({
- data
- }) => {
- data.forEach(e => {
- this.text.push(e.synopsis);
- });
- this.article = data;
- });
- auction_gu({
- pages: 1,
- limit: 1
- })
- .then(({
- data
- }) => {
- this.list = data[0];
- console.log(data,'展示');
- })
- .catch(e => {
- console.log(e);
- });
- loadIndexs({})
- .then(({
- data
- }) => {
- let goods = data.info;
- this.dataList = goods.bastList; //精品推荐
- this.carouselList = data.banner;
- })
- .catch(e => {});
- },
- //根据经纬度计算距离
- getFlatternDistance(lat1, lng1, lat2, lng2) {
- let radLat1 = (lat1 * Math.PI) / 180.0;
- let radLat2 = (lat2 * Math.PI) / 180.0;
- let a = radLat1 - radLat2;
- let b = (lng1 * Math.PI) / 180.0 - (lng2 * Math.PI) / 180.0;
- let s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math
- .pow(Math.sin(b / 2), 2)));
- s = s * 6378.137;
- s = Math.round(s * 10000) / 10000;
- return s;
- },
- getaddress() {
- let obj = this;
- uni.getLocation({
- type: 'gcj02',
- success: res => {
- console.log('dizhi+++++++++++');
- obj.longitude = res.longitude; //经度
- obj.latitude = res.latitude; //纬度
- store_list({
- page: 1,
- limit: 3,
- latitude: res.latitude,
- longitude: res.longitude
- }).then(e => {
- if (e.data.length != 0) {
- e.data.list.forEach(e => {
- e.jl = obj.getFlatternDistance(obj.latitude, obj
- .longitude, e.latitude, e.longitude);
- });
- }
- obj.stop = e.data.list;
- console.log(e);
- });
- },
- fail: err => {
- console.log(err, '123456789');
- openMap().then(e => {
- obj.getaddress();
- });
- }
- });
- },
- goDetails(e) {
- uni.navigateTo({
- url: '/pages/index/messageInfo?id=' + this.article[e].id
- });
- },
- 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'
- });
- },
- navTo(item) {
- uni.navigateTo({
- url: '/pages/hall/halllist?id=' + item.id + '&name=' + item.name + '&peoplename=' + item
- .nickname
- });
- },
- //详情页
- navToDetailPage(item) {
- let id = item.id;
- uni.navigateTo({
- url: '/pages/product/product?id=' + id
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page,
- .center {
- min-height: 100%;
- height: auto;
- background: #ffffff;
- }
- .top {
- position: relative;
- width: 100%;
- height: 360rpx;
- .top-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 100%;
- height: 100%;
- }
- .top-main {
- position: relative;
- z-index: 2;
- padding: 30rpx;
- .search-box {
- justify-content: center;
- width: 698rpx;
- height: 60rpx;
- background: #f1f1f1;
-
- // 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: #a4a4a4;
- }
- }
- }
- }
- .carousel {
- width: 700rpx;
- height: 276rpx;
- margin: -240rpx auto 0;
-
- image {
- width: 700rpx;
- height: 276rpx;
- background-color: red;
- border-radius: 20rpx;
- }
- }
- .tongz {
- width: 690rpx;
- height: 70rpx;
- margin: 32rpx auto 0;
- padding: 18rpx 30rpx 18rpx 24rpx;
- align-items: center;
- position: relative;
- .tongz-bg {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- width: 690rpx;
- height: 70rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .tongz-left {
- width: 640rpx;
- .image-left {
- width: 28rpx;
- height: 34rpx;
- }
- .tongz-font {
- margin-left: 22rpx;
- font-size: 28rpx;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #0f253a;
- }
- }
- .tongz-right {
- position: relative;
- z-index: 11;
- width: 12rpx;
- height: 26rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .navbar {
- justify-content: flex-start;
- flex-wrap: wrap;
- justify-content: space-around;
- .navbar-item {
- margin-top: 42rpx;
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- .nitem-image {
- width: 90rpx;
- height: 90rpx;
- }
- .nitem-font {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #0c1732;
- }
- }
- }
- .product {
- width: 662rpx;
- height: 180rpx;
- margin: 44rpx auto;
- .product-image {
- width: 662rpx;
- height: 180rpx;
- }
- }
- .shingle {
- width: 750rpx;
- background: #f8f8f8;
- border-radius: 10rpx;
- margin: 60rpx auto 0rpx;
- padding: 44rpx 50rpx 40rpx;
- .shingle-top {
- padding-left: 2rpx;
- .shingle-title {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #dc262b;
- }
- .shingle-btn {
- text-align: center;
- width: 250rpx;
- height: 50rpx;
- border: 2rpx solid #dc262b;
- border-radius: 10rpx;
- padding: 0 16rpx;
- // text-align: left;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #dc262b;
- line-height: 50rpx;
- text {
- display: inline-block;
- padding-left: 6rpx;
- }
- }
- }
- .shingle-main {
- margin: 20rpx auto;
- width: 650rpx;
- height: 206rpx;
- position: relative;
- .shingle-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 650rpx;
- height: 206rpx;
- image {
- width: 650rpx;
- height: 206rpx;
- }
- }
- .shinglem-title {
- position: relative;
- z-index: 2;
- justify-content: center;
- height: 70rpx;
- .tbg {
- height: 70rpx;
- width: 40rpx;
- }
- .shinglemt-center {
- display: flex;
- align-items: center;
- background: rgba(220, 38, 43, 0.66);
- }
- .address {
- width: 28rpx;
- height: 30rpx;
- }
- .shingle-font {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- line-height: 70rpx;
- margin-left: 14rpx;
- }
- }
- .shingle-mmain {
- position: relative;
- z-index: 2;
- margin-top: 30rpx;
- .smmain-item {
- width: 33%;
- display: flex;
- flex-direction: column;
- align-items: center;
- .smitem-top {
- text-align: center;
- width: 90%;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- }
- .smitem-bottom {
- margin-top: 10rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- }
- .people {
- justify-content: center;
- .peopleitem {
- width: 24rpx;
- height: 34rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .shu {
- width: 2rpx;
- height: 70rpx;
- background: #ffffff;
- }
- }
- .right-bottom {
- position: absolute;
- z-index: 2;
- right: 0;
- bottom: 0;
- width: 94rpx;
- height: 92rpx;
- }
- }
- }
- .seckill-left {
- justify-content: flex-start;
- .seckill-inco {
- width: 36rpx;
- height: 36rpx;
- flex-shrink: 0;
- }
- .seckill-font {
- margin-left: 8rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .djs {
- margin-left: 12rpx;
- font-size: 20rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #dc262b;
- }
- }
- .seckill-right {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .seckill-rfont {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- margin-right: 8rpx;
- }
- .seckill-back {
- width: 10rpx;
- height: 20rpx;
- }
- }
- .ge {
- height: 20rpx;
- width: 750rpx;
- background: #f8f8f8;
- }
- .serve {
- padding: 32rpx 30rpx;
- background: #ffffff;
- .serve-main {
- margin-top: 24rpx;
- flex-wrap: wrap;
- justify-content: flex-start;
- .serve-item:first-child {
- margin-left: 0rpx;
- }
- .serve-item {
- width: 220rpx;
- background: #f6f6f6;
- border-radius: 10rpx;
- margin-left: 14rpx;
- padding-bottom: 22rpx;
- .serve-price {
- width: 220rpx;
- height: 220rpx;
- border-radius: 10rpx 10rpx 0px 0px;
- background: #03a9f4;
- }
- .serve-title {
- margin-top: 16rpx;
- padding: 0 14rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #0a122b;
- }
- .serve-address {
- justify-content: flex-start;
- margin-top: 10rpx;
- padding: 0 14rpx;
- .saddress-inco {
- width: 18rpx;
- height: 24rpx;
- }
- .saddress-font {
- margin-left: 4rpx;
- font-size: 20rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
- }
- }
- }
- </style>
|