123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 |
- <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')"
- ></u-notice-bar>
- </view>
- </view>
- </view>
- <view class="navbar flex">
- <view class="navbar-item" @click="nav('/pages/product/classify?type=4')">
- <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')">
- <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=1')">
- <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/classify')">
- <image class="nitem-image" src="../../static/img/index-inco4.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/product/zero')">
- <image class="nitem-image" src="../../static/img/index-inco6.png" mode=""></image>
- <view class="nitem-font">0元购</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/product/classify?type=3')">
- <image class="nitem-image" src="../../static/img/index-inco8.png" mode=""></image>
- <view class="nitem-font">大品牌区</view>
- </view>
- </view>
- <!-- <view class="product"><image class="product-image" src="../../static/img/index-product.png" mode=""></image></view> -->
- <view class="shingle">
- <view class="shingle-top flex">
- <view class="shingle-title">艺术品挂牌交易区</view>
- <view class="shingle-btn" @click="nav('/pages/hall/hall')">
- 查看更多趣豆会馆
- <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">{{ 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>
- <view class="ge"></view>
- <view class="serve">
- <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}}</view>
- </view>
- </view>
- </view>
- </view>
- <u-tabbar activeColor="#f42b4e" v-model="current" :list="tabbar"></u-tabbar>
- </view>
- </template>
- <script>
- import { tabbar1 } from '@/utils/tabbar.js';
- import seckill from '../../components/seckill/seckill.vue';
- import { article } from '@/api/user.js'
- import { loadIndexs,store_list } from '@/api/index.js';
- import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
- import { openMap } from '@/utils/rocessor.js';
- import { auction_gu } from '@/api/hall.js';
- export default {
- components: {
- seckill,
- uniCountdowns
- },
- data() {
- return {
- current: 0,
- tabbar: tabbar1,
- titleNViewBackground: '',
- swiperCurrent: 0,
- swiperLength: 0,
- longitude: '', //经度
- latitude: '', //纬度
- dataList: '',
- carouselList: [], //轮播图列表
- text: [],
- article:[],
- list:{},
- stop:[],
- };
- },
- onLoad() {
- this.loadData();
- this.getaddress();
- },
- 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]
- }).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 f = getRad((lat1 + lat2)/2);
- let g = getRad((lat1 - lat2)/2);
- let l = getRad((lat1 - lng2)/2);
- let sg = Math.sin(g);
- let sl = Math.sin(1);
- let sf = Math.sin(f);
- let s,C,W,r ,d,h1,h2;
- let a = EARTH_RADIUS ;
- let fl = 1/298.257;
- sg = sg*sg;
- s1 = s1*sl;
- sf = sf*sf;
- g*(1-s1) + (1-sf)*s1;
- C = (1-sg)*(1-s1) + sf*sl;
- N = Math.atan(Math.sqrt(s/c));
- r = Math.sqrt(s*c)/w;
- d = 2*w*a;
- h1 = (3*r -1)/2/c;
- h2 = (3*r +1)/2/s;
- return d*(1 + fl*(h1*sf*(1-sg) - h2*(1-sf)*sg));
- },
- getaddress() {
- let obj = this;
- store_list({
- page:1,
- limit:3,
- // latitude:res.latitude,
- // longitude: res.longitude,
- }).then(e =>{
- obj.stop = e.data.list
- console.log(e);
- })
- // uni.getLocation({
- // type: 'gcj02',
- // success: res => {
- // console.log('dizhi+++++++++++');
- // this.longitude = res.longitude //经度
- // this.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 = this.getFlatternDistance(this.latitude,this.longitude,e.latitude,e.longitude)
- // })
- // }
- // obj.stop = e.data.list
- // console.log(e);
- // })
- // },
- // fail: err => {
- // console.log(err);
- // openMap().then(e => {
- // this.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: 400rpx;
- .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: rgba(255, 240, 245, 0.4);
- 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: #ffffff;
- }
- }
- }
- }
- .carousel {
- width: 700rpx;
- height: 300rpx;
- margin: -260rpx auto 0;
- image {
- width: 700rpx;
- height: 300rpx;
- }
- }
- .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;
- .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 {
- 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 {
- 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: 500;
- 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>
|