| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497 |
- <template>
- <view class="index-box">
- <!-- <image class="bg-img" src="@/static/img/index/index-bg.png" mode="scaleToFill"></image> -->
- <view class="nav-z">
- <Nav class="" :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
- <template>
- <view slot="custom" class="align-items-center" @click="toSelectSchool()">
- <!-- <uni-icons type="location-filled" size="20"></uni-icons> -->
- <image class="wh-40" src="@/static/img/index/dw.png" mode=""></image>
- <view class="fs-32 maxw-220 fw-600 ml-10 text-overflow-ellipsis-one">
- {{schoolData.school_name||''}}
- </view>
- <image class="nav-icon ml-10" src="@/static/img/index/index-right.png" mode="aspectFit"></image>
- </view>
- </template>
- </Nav>
- </view>
- <!-- 搜索 -->
- <view class="index-search box-border-box mt-20" @click="toUrl(1)"
- :style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
- <view class="index-search-box box-border-box align-items-center bgc-f">
- <image class="wh27" src="@/static/img/index/ss.png" mode=""></image>
- <view class="fs-24 fc-a ml-10">搜索店铺名称或商品名称</view>
- <view class="fs-28 fc-f index-search-box-buttom">搜索</view>
- </view>
- </view>
- <view class="index-box-1">
- <!-- 轮播 -->
- <view class="box-border-box plr-24 mb-32">
- <uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle" :current="current">
- <swiper class="swiper" @change="change" :autoplay='true' :circular='true' interval="4000">
- <swiper-item v-for="(item,i) in bannerList" :key="i">
- <image class="swiper-item" :src="item.image" mode="aspectFill" @click="bannerClock(item)">
- </image>
- </swiper-item>
- </swiper>
- </uni-swiper-dot>
- </view>
- <!-- 导航 -->
- <view class="box-border-box mb-22 plr-24">
- <view class="nav-list align-items-flex-end flex-wrap-wrap box-border-box pt-33 bgc-f b-rad-20">
- <view class="nav-list-item" v-for="(item,i) in navList" :key="i" @click="toUrl(item.type)"
- v-show="item.appletAudit == 0">
- <view class="flex-direction align-items-center title-img-box">
- <image class="title-img mb-16" :src="item.img" mode="scaleToFill"></image>
- <view class="fs-24 fc-0 text-align-center">{{item.name}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 通知 -->
- <view class="box-border-box plrb-24">
- <view class="msg-box align-items-center box-border-box">
- <image class="rb-bg" src="@/static/img/index/rb-bg.png" mode=""></image>
- <image class="xyrb-img mr-30 z-2" src="@/static/img/index/xyrb.png" mode=""></image>
- <view class="flex-direction flex-justify-space z-2 h-100">
- <view class="align-items-center" v-for="(item,i) in noticeList" :key="i"
- @click="toNoticeDet(item)">
- <view class="serial-num mr-10 fs-18 fc-f text-align-center"
- :class="i + 1 === 1?'bgc-F5541E':i + 1 === 2?'bgc-FF5555':'bgc-4db8ff'">
- {{ i + 1}}
- </view>
- <view class="fs-24 fc-0 text-overflow-ellipsis-one max-w-358">
- {{item.content}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 明星店铺 -->
- <view class="plr-30 box-border-box mb-20 align-items-center flex-justify-space">
- <view class="flex-1 mr-20 b-rad-20 mxdq-box box-border-box">
- <image class="tj-bg" src="@/static/img/index/tj-bg.png" mode=""></image>
- <image class="mxdp mb-24 z-2" src="@/static/img/index/mxdp.png" mode=""></image>
- <view class="align-items-center flex-wrap-wrap z-2">
- <image v-for="(item,index) in shopHomeData" class="tj-item mr-12 mb-12 b-rad-12"
- :src="item.shop_logo" mode="" @click="toShop(item)"></image>
- </view>
- </view>
- <image class="xzkn-img" src="@/static/img/index/xzkn.png" mode="" @click="toUrl(4)"></image>
- </view>
- <!-- 限时秒杀 -->
- <view class="spike-box box-border-box mb-20" v-if="seckillGoodsList.length > 0">
- <view class="xsms-box box-border-box">
- <image class="tj-bg" src="@/static/img/index/tj-bg.png" mode=""></image>
- <view class="align-items-center flex-justify-space z-2 mb-26 pr-24 box-border-box">
- <image class="xsms-img" src="@/static/img/index/xsms.png" mode=""></image>
- <view class="align-items-center" @click="goAllSeckill">
- <view class="fs-24 fc-9 mr-6">
- 更多
- </view>
- <uni-icons type="right" size="17" color="#999"></uni-icons>
- </view>
- </view>
- <swiper class="ms-swiper" circular :indicator-dots="false" :autoplay="true">
- <swiper-item>
- <view class="flex-wrap-wrap">
- <view class="w-31 mr-14 mb-32" v-for="(item,index) in seckillGoodsList" :key="index"
- @click="toShop(item)" v-show="index + 1 < 7">
- <view class="" v-if="index + 1 < 7">
- <image class="xsms-item-img mb-18 b-rad-12" :src="item.goods_image"
- mode="aspectFill"></image>
- <view class="max-w-200 fs-24 fc-0 text-overflow-ellipsis-one">
- {{item.goods_name}}
- </view>
- <view class="display-flex flex-justify-space">
- <view class="align-items-center">
- <view class="fs-24 fc-F43D04 mr-8">
- ¥ <text class="fs-28 fc-F43D04">{{item.seckill_money}}</text>
- </view>
- <view class="fs-20 fc-a text-line-through">
- ¥{{item.line_price}}
- </view>
- </view>
- <image class="b-img" src="@/static/img/index/b.png" mode=""></image>
- </view>
- </view>
- </view>
- </view>
- </swiper-item>
- <swiper-item>
- <view class="flex-wrap-wrap">
- <view class="w-31 mr-14 mb-32" v-for="(item,index) in seckillGoodsList" :key="index"
- @click="toShop(item)" v-show="index + 1 > 6">
- <view class="" v-if="index + 1 > 6">
- <image class="xsms-item-img mb-18 b-rad-12" :src="item.goods_image"
- mode="aspectFill"></image>
- <view class="max-w-200 fs-24 fc-0 text-overflow-ellipsis-one">
- {{item.goods_name}}
- </view>
- <view class="display-flex flex-justify-space">
- <view class="align-items-center">
- <view class="fs-24 fc-F43D04 mr-8">
- ¥ <text class="fs-28 fc-F43D04">{{item.seckill_money}}</text>
- </view>
- <view class="fs-20 fc-a text-line-through">
- ¥{{item.line_price}}
- </view>
- </view>
- <image class="b-img" src="@/static/img/index/b.png" mode=""></image>
- </view>
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- <!-- 全网最低/优质团购 -->
- <view class="spike-box box-border-box b-rad-20">
- <view class="yztg-box p-30 box-border-box">
- <image class="tj-bg" src="@/static/img/index/tj-bg.png" mode=""></image>
- <image class="qwzd-img z-2" src="@/static/img/index/qwzd.png" mode=""></image>
- <view class="z-2 ptp-24 b-b-F0 align-items-center flex-justify-space mb-12" v-for="(item,index) in group_goods_List" :key="index" @click="goGroup(item)">
- <view class="align-items-center">
- <image v-show="index === 0" class="pm-img mr-20" src="@/static/img/index/1.png" mode="">
- </image>
- <image v-show="index === 1" class="pm-img mr-20" src="@/static/img/index/2.png" mode="">
- </image>
- <image v-show="index === 2" class="pm-img mr-20" src="@/static/img/index/3.png" mode="">
- </image>
- <view class="zk-box text-align-center mr-10">
- <image class="zk-img" src="@/static/img/index/zk-img.png" mode=""></image>
- <view class="fs-20 fc-f z-2">
- {{((Number(item.seckill_money)/Number(item.line_price))*10).toFixed(1)}}折
- </view>
- </view>
- <view class="fs-24 fc-0 max-w-252 text-overflow-ellipsis-one">
- {{item.title}}
- </view>
- </view>
- <view class="align-items-center">
- <view class="fs-24 fc-F43D04 fw-b mr-10">
- ¥ <text class="fs-28 fc-F43D04 fw-b">{{item.seckill_money}}</text>
- </view>
- <view class="fs-20 fc-a text-line-through">
- ¥{{item.line_price}}
- </view>
- </view>
- </view>
- <view class="text-align-center fs-24 fc-9 z-2" @click="goTogrup">
- 查看更多
- </view>
- </view>
- </view>
- <!-- 类型选择 -->
- <view class="type-list-box box-border-box display-flex" :style="{'top': (BarH+indexSearchHeight) + 'px'}">
- <view class="type-item-box view-nowrap" v-for="(item,i) in typeList" :key="i"
- @click="selectType(item.id)">
- <view class="" :class="category_id==item.id?'fs-32 fc-3BB5FE fw-b':'fc-94969A fs-28'">
- {{item.name}}
- </view>
- <view class="type-list-hr" v-show="category_id==item.id"></view>
- </view>
- </view>
- <!-- 商品列表 -->
- <view class="" v-if="goodsList.length<=0">
- <enBlankVue></enBlankVue>
- </view>
- <view class="bot-list-box box-border-box" v-else>
- <view class="goos-list-box box-border-box" v-for="(item,i) in goodsList" :key="i" @click="toShop(item)">
- <view class="display-flex p-b-20 mb-26 b-b-EFF2F5">
- <view class="left-img-box mr-24">
- <image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
- <view class="status-box fc-f" v-if="item.status != 1">
- 休息中
- </view>
- </view>
- <view class="flex-1">
- <view class="align-items-center mb-8">
- <view class="right-box-title fs-28 fw-b text-overflow-ellipsis-one">{{item.shop_name}}
- </view>
- <image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
- </view>
- <view class="align-items-center mb-12">
- <image class="img-x mr-8" src="@/static/img/index/index-x.png" mode=""></image>
- <view class="fs-24 fw-600 fc-FD5D05 mr-18">{{item.shop_score}}</view>
- <view class="fc-0 fs-24 mr-12">预计{{item.delivery_time}}分钟 | </view>
- <view class="fc-0 fs-24 mr-12">{{item.shop_sales}}人购买</view>
- </view>
- <view class="align-items-center flex-wrap-wrap">
- <view class="quan-list b-F5541E box-border-box bgc-f align-items-center b-rad-5 mr-10"
- v-for="(info1,index1) in item.coupon" :key="index1">
- <image class="quan-list-1" src="@/static/img/index/q.png" mode=""></image>
- <view class="quan-list-2 fs-24 fc-F5531E">{{info1.money}}元</view>
- </view>
- </view>
- </view>
- </view>
- <view class="goods-items-list display-flex">
- <view class="goods-items-list-box" v-for="(info2,index2) in item.goods" :key="index2">
- <view v-show="info2.label === 3" class="label-box text-align-center bgc-F5811E fs-24 fc-f">
- 推荐</view>
- <view v-show="info2.label === 2" class="label-box text-align-center bgc-FF5555 fs-24 fc-f">
- 新品</view>
- <view v-show="info2.label === 1" class="label-box text-align-center bgc-48D3C5 fs-24 fc-f">
- 折扣</view>
- <view v-show="info2.label === 4" class="label-box text-align-center bgc-4db8ff fs-24 fc-f">
- 招牌</view>
- <image class="mb-18" :src="info2.goods_image" mode="aspectFill"></image>
- <view class="mb-12 fw-600 text-overflow-ellipsis-one fs-24">{{info2.goods_name}}</view>
- <view class="">
- <span class="fs-24 fc-FD5D05 fw-b">¥</span>
- <span class="fs-32 fc-FD5D05 fw-b">{{info2.price}}</span>
- </view>
- </view>
- </view>
- </view>
- <view class="pt-40 flex-direction align-items-center" v-if="goodsList.length === total">
- <view class="fs-32 fc-0 fw-b">
- 小主都到这里了
- </view>
- <view class="fs-32 fc-0 fw-b mb-26">
- 还没有找到满意的店铺吗?
- </view>
- <view class="fs-24 fc-0 mb-32">
- 可以提交你意见与反馈哟。我们一定尽快努力达成!
- </view>
- <view class="list-but align-items-center flex-justify-center bgc-5CC2FF" @click="goFeedback">
- <view class="fs-28 fc-f mr-10">
- 去提交
- </view>
- <view class="sj-fff"></view>
- </view>
- </view>
- </view>
- </view>
- <uni-popup ref="popup" type="center" border-radius="10px 10px 10px 10px" :is-mask-click="false">
- <view class="roll-pop">
- <!-- <image class="lq-bg" src="@/static/img/index/lq-bg.png" mode=""></image> -->
- <image class="tc-top" src="@/static/img/index/tc-top.png" mode=""></image>
- <view class="coupon-box">
- <image class="tc-content" src="@/static/img/index/tc-content.png" mode=""></image>
- <view class="item-box display-flex" v-for="(item,index) in couponData" :key="index">
- <view class="item-right flex-direction flex-justify-center flex-1 bgc-FCE7E2">
- <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
- {{item.name}}
- </view>
- <view class="fs-22 fc-6 mb-12">
- 有效时间:{{item.time_type_str}}
- </view>
- <view class="fs-22 fc-6">
- 券类型:{{item.scene == 1?'外卖卷':'代取卷'}}
- </view>
- </view>
- <view class="item-hr"></view>
- <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
- <view class="align-items-center">
- <view class="fs-24 fw-600 fc-FB3D03">¥</view>
- <view class="fs-48 fw-600 fc-FB3D03">{{item.money}}</view>
- </view>
- <view class="fs-22 fc-6 mb-4">
- 需满{{item.full_money}}元
- </view>
- <view class="but-box fs-26 fc-f" @click="receive(item,index)">立即领取</view>
- <view class="ball"></view>
- <view class="ball-two"></view>
- </view>
- </view>
- </view>
- <image class="tc-bot" src="@/static/img/index/tc-bot.png" mode=""></image>
- <uni-icons @click="gbPOp" class="pop-gb" color='#fff' type="close" size="30"></uni-icons>
- </view>
- </uni-popup>
- <uni-popup ref="popupNotice" type="center" border-radius="10px 10px 10px 10px" :is-mask-click="false">
- <view class="p-20 box-sizing-border bgc-f b-rad-20 w-80-vw h-60-vh flex-direction">
- <view class="text-align-center fw-600 fs-30 mb-20">
- 公告通知
- </view>
- <scroll-view :scroll-y="true" class="scroll-view-css mb-24" @scrolltolower="scrolltolower">
- <view class="fs-28" v-html="pop_notice.content"></view>
- </scroll-view>
- <view class="align-items-center">
- <view class="flex-1 but mr-24 fs-30 fc-f b-rad-200 text-align-center bgc-41ABF5"
- @click="goToNotice">
- 查看详情
- </view>
- <view class="flex-1 but fs-30 fc-3 b-rad-200 text-align-center b-r-ccc" @click="gbNoticePop">
- 我知道了
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- alumniHeatList
- } from '@/api/alumni.js'
- import enBlankVue from "@/components/en-utils/en-blank/en-blank.vue";
- import tools from "@/service/tools";
- import {
- getNotice,
- getBanner,
- commonApplet,
- commonPopNotice
- } from '@/api/common.js';
- import {
- getSeckillGoods,
- seckillGroupGoods
- } from '@/api/seckill.js'
- import {
- getTakeaway
- } from '@/api/category.js';
- import {
- getGoodsList
- } from '@/api/goods.js';
- import {
- couponHome,
- receiveCoupon
- } from '@/api/coupon.js'
- import {
- shopInfo,
- shopHome
- } from "@/api/shop.js"
- import {
- membeRmessage
- } from "@/api/member.js"
- export default {
- components: {
- enBlankVue
- },
- data() {
- return {
- BarH: 0,
- bgckgroundBox: 'transparent',
- bgckgroundSearch: '',
- bgckgroundType: '',
- navList: [{
- name: "外卖",
- img: require('@/static/img/index/index-wm.png'),
- type: 2
- },
- {
- name: "快递代取",
- img: require('@/static/img/index/index-dq.png'),
- type: 3
- },
- {
- name: "校友圈",
- img: require('@/static/img/index/index-xyq.png'),
- type: 7
- },
- {
- name: "特价团购",
- img: require('@/static/img/index/index-tg.png'),
- type: 5
- },
- {
- name: "领券中心",
- img: require('@/static/img/index/index-lqzx.png'),
- type: 6
- },
- {
- name: "跑腿代拿",
- img: require('@/static/img/index/index-ptdn.png'),
- type: 7
- },
- {
- name: "实习岗位",
- img: require('@/static/img/index/index-sxgw.png'),
- type: 8
- },
- {
- name: "平台客服",
- img: require('@/static/img/index/index-ptkf.png'),
- type: 9
- },
- ],
- schoolData: {
- school_name: '',
- },
- noticeList: [],
- bannerList: [],
- seckillGoodsList: [], // 秒杀商品
- group_goods_List: [], //团购秒杀
- typeList: [], //分类数组
- category_id: 0, //分类id
- goodsList: [],
- total: 0,
- page: 1,
- couponData: [],
- indexSearchHeight: '',
- dotStyle: {
- width: 6,
- bottom: 6,
- backgroundColor: 'rgba(51, 51, 51,0.3)',
- border: '1px rgba(0,0,0,0) solid',
- color: '#fff',
- selectedBackgroundColor: 'rgba(79, 179, 239,0.9)',
- selectedBorder: '1px rgba(0,0,0,0) solid'
- },
- current: 0,
- pop_notice: {
- content: '' // 公告通知
- },
- popType: true,
- shopHomeData: {}
- }
- },
- onShow() {
- let lon = uni.getStorageSync('lon');
- let lat = uni.getStorageSync('lat');
- if (!lon || !lat) {
- uni.getLocation({
- type: "gcj02",
- success: (res) => {
- if (res.errMsg === 'getLocation:ok') {
- uni.setStorageSync('lon', res.longitude);
- uni.setStorageSync('lat', res.latitude);
- } else {
- tools.error('位置授权失败,请检查是否开始授权')
- }
- },
- fail: (res) => {
- tools.error('位置授权失败,请检查是否开始授权')
- },
- })
- }
- let school_id = uni.getStorageSync('school_id');
- let operate_id = uni.getStorageSync('operate_id');
- let school_name = uni.getStorageSync('school_name');
- if (!school_id || !operate_id) {
- setTimeout(() => {
- uni.reLaunch({
- url: '/pages-address/select-school?type=1'
- })
- }, 1000)
- } else {
- this.schoolData.school_name = school_name;
- }
- this.commonApplet()
- this.getBanner();
- // this.getNotice();
- this.alumniHeatList()
- this.getSeckillGoods();
- this.seckillGroupGoods()
- this.getTakeaway();
- let userToken = uni.getStorageSync('token')
- if (userToken) {
- this.commonPopNotice()
- this.membeRmessage()
- // this.couponHome()
- }
- uni.removeStorageSync('orderInfoType')
- },
- onLoad(data) {
- // scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
- let scene = decodeURIComponent(data.scene)
- scene = scene.split('&')
- scene.forEach(item => {
- let arr = item.split('=')
- if (arr.length === 2) {
- uni.setStorageSync(arr[0], arr[1])
- }
- })
- this.page = 1;
- this.goodsList = [];
- this.getGoodsList();
- this.shopHome()
- },
- mounted() {
- this.getHeight()
- },
- onPageScroll(e) {
- if (e.scrollTop > 1) {
- this.bgckgroundBox = '#fff';
- this.bgckgroundSearch = '#fff';
- if (e.scrollTop > 500) {
- this.bgckgroundType = '#fff';
- } else {
- this.bgckgroundType = '';
- }
- } else {
- this.bgckgroundBox = 'transparent';
- this.bgckgroundSearch = '';
- this.bgckgroundType = '';
- }
- },
- onReachBottom() {
- if (this.goodsList.length < this.total) {
- this.page += 1;
- this.getGoodsList();
- }
- },
- created() {
- uni.getSystemInfo({
- success: (e) => {
- let statusBarH = e.statusBarHeight + 10
- let custom = 0;
- custom = wx.getMenuButtonBoundingClientRect()
- let customBarH = custom.height;
- this.BarH = statusBarH + customBarH;
- }
- })
- },
- methods: {
- goGroup(item) {
- uni.navigateTo({
- url: '/pages-buy/group-goods-info?shop_id=' + item.shop_id + '&goods_id=' + item.goods_id +
- '&shop_name=' + item.shop_name
- });
- },
- goFeedback() {
- // 问题反馈
- uni.navigateTo({
- url: '/pages-my/feedback'
- })
- },
- shopHome() {
- shopHome().then((res) => {
- if (res.code === 1) {
- this.shopHomeData = res.data
- }
- })
- },
- membeRmessage() {
- membeRmessage().then((res) => {
- if (res.code === 1) {
- if (res.data.msg_count > 0) {
- uni.showTabBarRedDot({
- index: 2
- })
- } else {
- uni.hideTabBarRedDot({
- index: 2
- })
- }
- setInterval(() => {
- membeRmessage()
- }, 60000)
- }
- })
- },
- commonPopNotice() {
- let operate_id = uni.getStorageSync('operate_id');
- let school_id = uni.getStorageSync('school_id');
- commonPopNotice({
- operate_id: operate_id,
- school_id: school_id
- }).then((res) => {
- const noticeId = uni.getStorageSync('notice_id');
- if (res.code === 1) {
- if (res.data.id) {
- if (noticeId === res.data.id) {
- this.popType = true
- this.couponHome()
- } else {
- uni.hideTabBar()
- this.pop_notice = res.data
- this.$refs.popupNotice.open()
- this.popType = false
- }
- } else {
- this.popType = true
- this.couponHome()
- }
- }
- })
- },
- gbNoticePop() {
- uni.showTabBar()
- this.$refs.popupNotice.close()
- this.popType = true
- this.couponHome()
- },
- goToNotice() {
- uni.setStorageSync('notice_id', this.pop_notice.id);
- uni.showTabBar()
- this.$refs.popupNotice.close()
- this.popType = true
- uni.navigateTo({
- url: '/pages-my/notice/info?id=' + this.pop_notice.id
- })
- },
- commonApplet() {
- commonApplet().then((res) => {
- if (res.code == 1) {
- this.navList.forEach((v, k) => {
- v.appletAudit = 0
- if (v.type == 8 || v.type == 9 || v.type == 10 || v.type == 11) {
- v.appletAudit = res.data
- }
- })
- }
- })
- },
- getHeight() {
- // 创建选择器对象
- const query = uni.createSelectorQuery().in(this);
- // 选择我们想要的元素
- query.select('.index-search').boundingClientRect(data => {
- // data是选中元素的大小及位置信息
- if (data) {
- // 元素的高度
- this.indexSearchHeight = data.height;
- console.log('元素的高度:', this.indexSearchHeight);
- }
- }).exec(); // 执行选择器查询
- },
- change(e) {
- this.current = e.detail.current
- },
- bannerClock(item) {
- if (item.type == 1) {
- // 外卖首页
- uni.navigateTo({
- url: '/pages-takeout/takeout'
- })
- } else if (item.type == 2) {
- if (item.to_id != 0) {
- // 外卖商家
- uni.navigateTo({
- url: '/pages-takeout/shop?shop_id=' + item.to_id
- })
- } else {
- // 外卖首页
- uni.navigateTo({
- url: '/pages-takeout/takeout'
- })
- }
- } else if (item.type == 3) {
- // 代取页
- uni.navigateTo({
- url: '/pages-takeout/replace-take'
- })
- } else if (item.type === 4) {
- // 团购页
- uni.navigateTo({
- url: '/pages-buy/group'
- })
- } else if (item.type === 5) {
- // 票务页
- uni.navigateTo({
- url: '/pages-buy/ticket'
- })
- } else if (item.type === 6) {
- // 干洗页
- uni.navigateTo({
- url: '/pages-buy/dry-clean'
- })
- } else if (item.type === 7) {
- // 校友圈
- uni.navigateTo({
- url: '/pages-school/school-circle'
- })
- } else if (item.type === 8) {
- // 骑手申请页
- uni.navigateTo({
- url: '/pages-my/rider-recruit'
- })
- }
- },
- goSchool() {
- uni.navigateTo({
- url: '/pages-school/school-circle'
- })
- },
- receive(item, index) {
- receiveCoupon({
- grant_id: item.grant_id,
- coupon_id: item.coupon_id
- }).then((res) => {
- if (res.code == 1) {
- tools.success(res.msg)
- this.couponData.splice(index, 1)
- if (this.couponData.length <= 0) {
- this.gbPOp()
- }
- } else {
- tools.error(res.msg)
- this.couponData.splice(index, 1)
- }
- })
- },
- couponHome() {
- let operate_id = uni.getStorageSync('operate_id');
- couponHome({
- operate_id: operate_id
- }).then((res) => {
- if (res.code == 1) {
- if (res.data.length > 0) {
- uni.hideTabBar()
- this.couponData = res.data
- this.$refs.popup.open()
- }
- }
- })
- },
- gbPOp() {
- uni.showTabBar()
- this.$refs.popup.close()
- },
- getBanner() {
- let operate_id = uni.getStorageSync('operate_id');
- let school_id = uni.getStorageSync('school_id');
- getBanner({
- operate_id: operate_id,
- school_id: school_id
- }).then((res) => {
- if (res.code === 1) {
- this.bannerList = res.data;
- }
- })
- },
- alumniHeatList() {
- let school_id = uni.getStorageSync('school_id');
- alumniHeatList({
- school_id: school_id
- }).then((res) => {
- if (res.code === 1) {
- this.noticeList = res.data;
- }
- })
- },
- getNotice() {
- let operate_id = uni.getStorageSync('operate_id');
- let school_id = uni.getStorageSync('school_id');
- getNotice({
- operate_id: operate_id,
- school_id: school_id
- }).then((res) => {
- if (res.code === 1) {
- this.noticeList = res.data;
- }
- })
- },
- getSeckillGoods() {
- let operate_id = uni.getStorageSync('operate_id');
- getSeckillGoods({
- operate_id: operate_id
- }).then((res) => {
- if (res.code === 1) {
- this.seckillGoodsList = res.data
- }
- })
- },
- seckillGroupGoods() {
- seckillGroupGoods().then((res) => {
- if (res.code === 1) {
- if (res.code === 1) {
- this.group_goods_List = res.data
- }
- }
- })
- },
- getTakeaway() {
- getTakeaway().then((res) => {
- if (res.code === 1) {
- this.typeList = res.data;
- this.typeList.unshift({
- name: "全部",
- id: 0
- })
- }
- })
- },
- getGoodsList() {
- let operate_id = uni.getStorageSync('operate_id');
- getGoodsList({
- page: this.page,
- operate_id: operate_id,
- category_id: this.category_id
- }).then((res) => {
- if (res.code === 1) {
- this.goodsList = [...this.goodsList, ...res.data.items];
- this.total = res.data.total;
- console.log(this.total, 'this.total');
- }
- })
- },
- selectType(id) {
- if (this.category_id != id) {
- this.category_id = id;
- this.page = 1;
- this.goodsList = [];
- this.getGoodsList();
- }
- },
- toUrl(type) {
- if (type === 1) {
- // 去搜索
- uni.navigateTo({
- url: '/pages/index/search-record'
- })
- } else if (type === 2) {
- // 去外卖
- uni.navigateTo({
- url: '/pages-takeout/takeout'
- })
- } else if (type === 3) {
- // 去代取
- uni.navigateTo({
- url: '/pages-takeout/replace-take'
- })
- } else if (type === 4) {
- // 君子帮选
- uni.navigateTo({
- // url: '/pages-takeout/help-choose'
- url: '/pages-takeout/1212'
- })
- } else if (type === 5) {
- // 去团购
- uni.navigateTo({
- url: '/pages-buy/group'
- })
- } else if (type === 6) {
- // 领券中心
- uni.navigateTo({
- url: '/pages-my/ticket-centre'
- })
- } else if (type === 7) {
- // 去校友圈
- uni.navigateTo({
- url: '/pages-school/school-circle'
- })
- } else if (type === 8) {
- // 去实习岗位
- uni.navigateTo({
- url: '/pages-position/Internship-position'
- })
- } else if (type === 9) {
- // 平台客服
- } else {
- tools.error('暂未开放')
- }
- },
- toSelectSchool() {
- uni.navigateTo({
- url: '/pages-address/select-school?type=1'
- })
- },
- goTogrup() {
- uni.navigateTo({
- url: '/pages-takeout/group-goods'
- })
- },
- goAllSeckill() {
- uni.navigateTo({
- url: '/pages-takeout/seckill'
- })
- },
- toShop(item) {
- const operate_id = uni.getStorageSync('operate_id')
- shopInfo({
- operate_id: operate_id,
- shop_id: item.shop_id
- }).then((res) => {
- if (res.code == 1) {
- uni.navigateTo({
- url: '/pages-takeout/shop?shop_id=' + item.shop_id + '&category_id=' + item
- .category_id + '&goods_id=' + item.goods_id
- })
- } else {
- tools.error(res.msg)
- }
- })
- },
- toNoticeDet(item) {
- uni.navigateTo({
- url: '/pages-school/circle-info?news_id=' + item.news_id
- })
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .list-but {
- width: 140rpx;
- height: 48rpx;
- line-height: 48rpx;
- border-radius: 24rpx;
- }
- .sj-fff {
- width: 0;
- height: 0;
- border-top: 8rpx solid transparent;
- border-right: 8rpx solid transparent;
- border-left: 8rpx solid #fff;
- border-bottom: 8rpx solid transparent;
- }
- .bot-list-box {
- padding: 0 24rpx 24rpx;
- }
- .zk-box {
- width: 67rpx;
- height: 31rpx;
- line-height: 28rpx;
- position: relative;
- }
- .zk-img {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0;
- top: 0;
- }
- .pm-img {
- width: 31rpx;
- height: 43rpx;
- }
- .qwzd-img {
- width: 295rpx;
- height: 28rpx;
- }
- .yztg-box {
- width: 100%;
- height: auto;
- position: relative;
- }
- .b-img {
- width: 39rpx;
- height: 41rpx;
- }
- .w-31 {
- width: 31%;
- }
- .max-w-200 {
- max-width: 200rpx;
- }
- .xsms-item-img {
- width: 200rpx;
- height: 200rpx;
- }
- .xsms-box {
- width: 100%;
- height: 730rpx;
- padding: 25rpx 0rpx 1rpx 30rpx;
- position: relative;
- }
- .ms-swiper {
- width: 100%;
- height: 100%;
- }
- .xsms-img {
- width: 139rpx;
- height: 31rpx;
- }
- .tj-item {
- width: 108rpx;
- height: 108rpx;
- }
- .mxdp {
- width: 317rpx;
- height: 31rpx;
- }
- .mxdq-box {
- min-height: 342rpx;
- position: relative;
- padding: 25rpx 17rpx 18rpx 30rpx;
- }
- .tj-bg {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- }
- .xzkn-img {
- width: 139rpx;
- height: 343rpx;
- border-radius: 20rpx;
- }
- .h-100 {
- height: 100%;
- }
- .max-w-358 {
- max-width: 358rpx;
- }
- .serial-num {
- width: 25rpx;
- height: 22rpx;
- line-height: 22rpx;
- border-radius: 10rpx 2rpx 10rpx 2rpx;
- }
- .z-2 {
- position: relative;
- z-index: 2;
- }
- .w-10 {
- width: 10rpx;
- }
- .rebang-box {
- width: 160rpx;
- height: 130rpx;
- background: #53C4FD;
- border-radius: 20rpx 0 0 20rpx;
- padding: 0 10rpx 0 0;
- position: relative;
- }
- .sj-box {
- width: 0;
- height: 0;
- border-top: 20rpx solid transparent;
- border-right: 20rpx solid #F3F3F3;
- border-left: 20rpx solid transparent;
- border-bottom: 20rpx solid transparent;
- position: absolute;
- right: -2rpx;
- top: calc(50% - 20rpx);
- }
- .rebang {
- width: 64rpx;
- }
- .h-60-vh {
- max-height: 60vh;
- }
- .w-80-vw {
- width: 80vw;
- }
- .plrb-24 {
- padding: 0 24rpx 24rpx;
- }
- .spike-box {
- padding: 0 24rpx;
- }
- .wh27 {
- width: 27rpx;
- height: 27rpx;
- }
- .nav-z {
- position: relative;
- z-index: 3 !important;
- background: linear-gradient(-90deg, #3BB5FE, #62C4FF);
- }
- .wh-40 {
- width: 40rpx;
- height: 40rpx;
- }
- .item-box {
- margin-bottom: 20rpx;
- }
- .item-box:last-child {
- margin: 0;
- }
- .roll-pop {
- position: relative;
- width: 100vw;
- // height: 1000rpx;
- .tc-top {
- width: 100%;
- height: 202rpx;
- }
- .tc-bot {
- width: 100%;
- height: 178rpx;
- }
- .pop-gb {
- width: 56rpx;
- height: 56rpx;
- position: absolute;
- bottom: -65rpx;
- left: calc((100% - 28rpx) / 2);
- }
- }
- .coupon-box {
- width: 100%;
- // min-height: 590rpx;
- padding: 0 82rpx 0 92rpx;
- box-sizing: border-box;
- position: relative;
- .tc-content {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- }
- }
- .index-box {
- .maxw-220 {
- max-width: 220rpx;
- }
- position: relative;
- .bg-img {
- width: 100%;
- height: 930rpx;
- position: absolute;
- top: 0;
- left: 0;
- z-index: -2;
- }
- .nav-icon {
- width: 32rpx;
- height: 32rpx;
- }
- .index-box-1 {
- width: 100%;
- // height: 3000rpx;
- .swiper {
- width: 702rpx;
- height: 280rpx;
- border-radius: 20rpx;
- .swiper-item {
- width: 702rpx;
- height: 280rpx;
- border-radius: 20rpx;
- }
- }
- .nav-list {
- // padding: 0 22rpx;
- .nav-list-item {
- width: 25%;
- margin-bottom: 35rpx;
- .title-img-box {
- .title-img {
- width: 80rpx;
- height: 76rpx;
- }
- }
- }
- .nav-list-item:nth-child(3) {
- .title-img-box {
- .title-img {
- width: 92rpx;
- height: 82rpx;
- }
- }
- }
- .nav-list-item:nth-child(4) {
- .title-img-box {
- .title-img {
- width: 82rpx;
- height: 73rpx;
- }
- }
- }
- .nav-list-item:nth-child(5) {
- .title-img-box {
- .title-img {
- width: 79rpx;
- height: 86rpx;
- }
- }
- }
- .nav-list-item:nth-child(6) {
- .title-img-box {
- .title-img {
- width: 93rpx;
- height: 99rpx;
- }
- }
- }
- .nav-list-item:nth-child(7) {
- .title-img-box {
- .title-img {
- width: 106rpx;
- height: 84rpx;
- }
- }
- }
- .nav-list-item:nth-child(8) {
- .title-img-box {
- .title-img {
- width: 81rpx;
- height: 88rpx;
- }
- }
- }
- }
- .msg-box {
- width: 100%;
- height: 180rpx;
- border-radius: 12rpx;
- padding: 30rpx 40rpx;
- position: relative;
- }
- .rb-bg {
- position: absolute;
- left: 0;
- bottom: 0;
- width: 100%;
- height: 100%;
- }
- .xyrb-img {
- width: 108rpx;
- height: 123rpx;
- }
- .type-list-box {
- width: calc(100% - 24rpx);
- position: sticky;
- left: 0;
- // top: calc(var(BarH)px + 93rpx);
- // top: calc(86px + 93rpx);
- padding: 24rpx;
- overflow-x: scroll;
- z-index: 50;
- .type-item-box {
- margin-right: 16rpx;
- padding: 0 24rpx;
- position: relative;
- }
- .type-item-box:last-child {
- margin-right: 0;
- }
- .type-list-hr {
- position: absolute;
- left: 15%;
- bottom: 0;
- width: 70%;
- height: 6rpx;
- background: linear-gradient(-90deg, #ffffff, #3BB5FE);
- border-radius: 3rpx;
- }
- }
- .goos-list-box {
- width: 100%;
- min-height: 100rpx;
- padding: 28rpx 30rpx 35rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51, 51, 51, 0.1);
- border-radius: 20rpx;
- margin-bottom: 20rpx;
- .goods-items-list {
- width: 100%;
- overflow-y: scroll;
- .goods-items-list-box {
- width: 33.3%;
- margin-right: 13rpx;
- position: relative;
- .label-box {
- position: absolute;
- left: 0;
- top: 0;
- width: 66rpx;
- height: 31rpx;
- line-height: 31rpx;
- border-radius: 10rpx 2rpx 10rpx 2rpx;
- }
- image {
- width: 201rpx;
- height: 200rpx;
- border-radius: 10rpx
- }
- }
- }
- .left-img-box {
- width: 120rpx;
- height: 120rpx;
- position: relative;
- .left-img {
- width: 120rpx;
- height: 120rpx;
- border-radius: 12rpx;
- }
- .status-box {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- padding: 4rpx 0;
- text-align: center;
- background: rgba(0, 0, 0, 0.5);
- font-size: 17rpx;
- border-radius: 0 0 12rpx 12rpx;
- }
- }
- .img-x {
- width: 16rpx;
- height: 16rpx;
- }
- .right-box-title {
- width: 438rpx;
- }
- .right-box-title-img {
- width: 32rpx;
- height: 32rpx;
- margin-left: auto;
- }
- .quan-list {
- min-width: 88rpx;
- height: 28rpx;
- line-height: 28rpx;
- .quan-list-1 {
- width: 38rpx;
- height: 28rpx;
- }
- }
- }
- }
- .index-search {
- position: sticky;
- left: 0;
- z-index: 10;
- padding: 0 24rpx 20rpx 24rpx;
- .index-search-box {
- width: 100%;
- height: 72rpx;
- padding: 0 6rpx 0 24rpx;
- border-radius: 200rpx;
- .index-search-box-buttom {
- width: 120rpx;
- height: 60rpx;
- background: linear-gradient(-90deg, #3BB5FE, #62C4FF);
- border-radius: 200rpx;
- margin-left: auto;
- line-height: 60rpx;
- text-align: center;
- }
- }
- }
- }
- .item-hr {
- width: 0px;
- height: auto;
- border-right: 1rpx dashed #FB7850;
- }
- .item-hr-two {
- width: 0px;
- height: auto;
- border-right: 1rpx dashed #999;
- }
- .item-left {
- width: 171rpx;
- height: auto;
- padding: 20rpx 18rpx;
- box-sizing: border-box;
- position: relative;
- border-radius: 0 20rpx 20rpx 0;
- }
- .ball {
- width: 24rpx;
- height: 24rpx;
- border-radius: 50%;
- position: absolute;
- top: -12rpx;
- left: -12rpx;
- background: #fff;
- z-index: 2;
- }
- .ball-two {
- width: 24rpx;
- height: 24rpx;
- border-radius: 50%;
- position: absolute;
- background: #fff;
- z-index: 10;
- bottom: -12rpx;
- left: -12rpx;
- }
- .item-right {
- padding: 24rpx;
- box-sizing: border-box;
- border-radius: 20rpx 0 0 20rpx;
- position: relative;
- }
- .but-box {
- width: 136rpx;
- height: 48rpx;
- line-height: 48rpx;
- text-align: center;
- background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
- border-radius: 200rpx;
- }
- .but {
- width: 100%;
- height: 60rpx;
- line-height: 60rpx;
- }
- .rd-img {
- width: 40rpx;
- height: 40rpx;
- }
- </style>
|