index.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342
  1. <template>
  2. <view class="index-box">
  3. <!-- <image class="bg-img" src="@/static/img/index/index-bg.png" mode="scaleToFill"></image> -->
  4. <view class="nav-z">
  5. <Nav class="" :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
  6. <template>
  7. <view slot="custom" class="align-items-center" @click="toSelectSchool()">
  8. <!-- <uni-icons type="location-filled" size="20"></uni-icons> -->
  9. <image class="wh-40" src="@/static/img/index/dw.png" mode=""></image>
  10. <view class="fs-32 maxw-220 fw-600 ml-10 text-overflow-ellipsis-one">
  11. {{schoolData.school_name||''}}
  12. </view>
  13. <image class="nav-icon ml-10" src="@/static/img/index/index-right.png" mode="aspectFit"></image>
  14. </view>
  15. </template>
  16. </Nav>
  17. </view>
  18. <!-- 搜索 -->
  19. <view class="index-search box-border-box mt-20" @click="toUrl(1)"
  20. :style="[{'top': BarH + 'px','background':bgckgroundSearch}]">
  21. <view class="index-search-box box-border-box align-items-center bgc-f">
  22. <image class="wh27" src="@/static/img/index/ss.png" mode=""></image>
  23. <view class="fs-24 fc-a ml-10">搜索店铺名称或商品名称</view>
  24. <view class="fs-28 fc-f index-search-box-buttom">搜索</view>
  25. </view>
  26. </view>
  27. <view class="index-box-1">
  28. <!-- 轮播 -->
  29. <view class="box-border-box plr-24 mb-32">
  30. <uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle" :current="current">
  31. <swiper class="swiper" @change="change" :autoplay='true' :circular='true' interval="4000">
  32. <swiper-item v-for="(item,i) in bannerList" :key="i">
  33. <image class="swiper-item" :src="item.image" mode="aspectFill" @click="bannerClock(item)">
  34. </image>
  35. </swiper-item>
  36. </swiper>
  37. </uni-swiper-dot>
  38. </view>
  39. <!-- 导航 -->
  40. <view class="box-border-box mb-22 plr-24">
  41. <view class="nav-list align-items-flex-end flex-wrap-wrap box-border-box pt-33 bgc-f b-rad-20">
  42. <view class="nav-list-item" v-for="(item,i) in navList" :key="i" @click="toUrl(item.type)"
  43. v-show="item.appletAudit == 0">
  44. <view class="flex-direction align-items-center title-img-box">
  45. <image class="title-img mb-16" :src="item.img" mode="scaleToFill"></image>
  46. <view class="fs-24 fc-0 text-align-center">{{item.name}}</view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 通知 -->
  52. <view class="box-border-box plrb-24">
  53. <view class="msg-box align-items-center box-border-box">
  54. <image class="rb-bg" src="@/static/img/index/rb-bg.png" mode=""></image>
  55. <image class="xyrb-img mr-30 z-2" src="@/static/img/index/xyrb.png" mode=""></image>
  56. <view class="flex-direction flex-justify-space z-2 h-100">
  57. <view class="align-items-center" v-for="(item,i) in noticeList" :key="i"
  58. @click="toNoticeDet(item)">
  59. <view class="serial-num mr-10 fs-18 fc-f text-align-center"
  60. :class="i + 1 === 1?'bgc-F75C2B':i + 1 === 2?'bgc-FC8E17':'bgc-47B0F0'">
  61. {{ i + 1}}
  62. </view>
  63. <view class="fs-24 fc-0 text-overflow-ellipsis-one max-w-358">
  64. {{item.content}}
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 明星店铺 -->
  71. <view class="plr-30 box-border-box mb-20 align-items-center flex-justify-space">
  72. <view class="flex-1 mr-20 b-rad-20 mxdq-box box-border-box">
  73. <image class="tj-bg" src="@/static/img/index/tj-bg.png" mode=""></image>
  74. <image class="mxdp mb-24 z-2" src="@/static/img/index/mxdp.png" mode=""></image>
  75. <view class="align-items-center flex-wrap-wrap z-2">
  76. <image v-for="(item,index) in shopHomeData" class="tj-item mr-12 mb-12 b-rad-12"
  77. :src="item.shop_logo" mode="" @click="toShop(item)"></image>
  78. </view>
  79. </view>
  80. <image class="xzkn-img" src="@/static/img/index/xzkn.png" mode=""></image>
  81. </view>
  82. <!-- 限时秒杀 -->
  83. <view class="spike-box box-border-box" v-if="seckillGoodsList.length > 0">
  84. <view class="xsms-box box-border-box">
  85. <image class="tj-bg" src="@/static/img/index/tj-bg.png" mode=""></image>
  86. <image class="xsms-img mb-26 z-2" src="@/static/img/index/xsms.png" mode=""></image>
  87. <swiper class="ms-swiper" circular :indicator-dots="false" :autoplay="true">
  88. <swiper-item>
  89. <view class="flex-wrap-wrap">
  90. <view class="w-31" v-for="(item,index) in seckillGoodsList" :key="index"
  91. @click="toShop(item)">
  92. <view class="mr-14 mb-32" v-if="index + 1 < 7">
  93. <image class="xsms-item-img mb-18 b-rad-12" :src="item.goods_image"
  94. mode="aspectFill"></image>
  95. <view class="max-w-200 fs-24 fc-0 text-overflow-ellipsis-one">
  96. {{item.goods_name}}
  97. </view>
  98. <view class="display-flex flex-justify-space">
  99. <view class="align-items-center">
  100. <view class="fs-24 fc-F43D04 mr-8">
  101. ¥ <text class="fs-28 fc-F43D04">{{item.seckill_money}}</text>
  102. </view>
  103. <view class="fs-20 fc-a text-line-through">
  104. ¥{{item.line_price}}
  105. </view>
  106. </view>
  107. <image class="b-img" src="@/static/img/index/b.png" mode=""></image>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </swiper-item>
  113. <swiper-item>
  114. <view class="flex-wrap-wrap">
  115. <view class="w-31" v-for="(item,index) in seckillGoodsList" :key="index"
  116. @click="toShop(item)">
  117. <view class="mr-14 mb-32" v-if="index + 1 > 6">
  118. <image class="xsms-item-img mb-18 b-rad-12" :src="item.goods_image"
  119. mode="aspectFill"></image>
  120. <view class="max-w-200 fs-24 fc-0 text-overflow-ellipsis-one">
  121. {{item.goods_name}}
  122. </view>
  123. <view class="display-flex flex-justify-space">
  124. <view class="align-items-center">
  125. <view class="fs-24 fc-F43D04 mr-8">
  126. ¥ <text class="fs-28 fc-F43D04">{{item.seckill_money}}</text>
  127. </view>
  128. <view class="fs-20 fc-a text-line-through">
  129. ¥{{item.line_price}}
  130. </view>
  131. </view>
  132. <image class="b-img" src="@/static/img/index/b.png" mode=""></image>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. </swiper-item>
  138. </swiper>
  139. <!-- <view class="xsms-box-list-f box-border-box plr-12">
  140. <scroll-view class="xsms-box-list display-flex" scroll-x="true">
  141. <view class="xsms-box-list-item box-border-box p-8" v-for="(item,i) in seckillGoodsList"
  142. :key="i" @click="toShop(item)">
  143. <image class="xsms-box-list-item-img-1 mb-4" :src="item.goods_image" mode="aspectFill">
  144. </image>
  145. <view class="text-overflow-ellipsis-one fs-26 mb-32">{{item.goods_name}}</view>
  146. <view class="mb-4">
  147. <span class="fs-20 fw-b fc-FB3D03">¥</span><span
  148. class="fs-32 fw-b fc-FB3D03">{{item.seckill_money}}</span>
  149. </view>
  150. </view>
  151. </scroll-view>
  152. </view> -->
  153. </view>
  154. </view>
  155. <!-- 类型选择 -->
  156. <view class="type-list-box display-flex bgc-F5F4F9" :style="{'top': (BarH+indexSearchHeight) + 'px'}">
  157. <view class="type-item-box view-nowrap" :class="category_id==item.id?'s-type':'n-type'"
  158. v-for="(item,i) in typeList" :key="i" @click="selectType(item.id)">{{item.name}}</view>
  159. </view>
  160. <!-- 商品列表 -->
  161. <view class="" v-if="goodsList.length<=0">
  162. <enBlankVue></enBlankVue>
  163. </view>
  164. <view class="box-border-box plr-24" v-else>
  165. <view class="goos-list-box box-border-box p-24 display-flex" v-for="(item,i) in goodsList" :key="i"
  166. @click="toShop(item)">
  167. <view class="left-img-box">
  168. <image class="left-img" :src="item.shop_logo" mode="aspectFill"></image>
  169. <view class="status-box fc-f" v-if="item.status != 1">
  170. 休息中
  171. </view>
  172. </view>
  173. <view class="flex-1">
  174. <view class="align-items-center mb-8">
  175. <view class="right-box-title fs-32 fw-600 text-overflow-ellipsis-one">{{item.shop_name}}
  176. </view>
  177. <image class="right-box-title-img" src="@/static/img/toRight.png" mode=""></image>
  178. </view>
  179. <view class="align-items-center mb-12">
  180. <image class="img-x mr-12" src="@/static/img/index/index-x.png" mode=""></image>
  181. <view class="fs-26 fw-600 fc-FF7F00 mr-12">{{item.shop_score}}分</view>
  182. <view class="fc-6 fs-24 mr-12">| 预计{{item.delivery_time}}分钟 |</view>
  183. <view class="fc-6 fs-24 mr-12">{{item.shop_sales}}人购买</view>
  184. </view>
  185. <view class="align-items-center flex-wrap-wrap">
  186. <view class="quan-list align-items-center mr-12 mb-16" v-for="(info1,index1) in item.coupon"
  187. :key="index1">
  188. <view class="quan-list-1 fs-24 fc-f">券</view>
  189. <view class="quan-list-2 fs-24 fc-FB3D03">{{info1.money}}元</view>
  190. </view>
  191. </view>
  192. <view class="goods-items-list display-flex">
  193. <view class="goods-items-list-box" v-for="(info2,index2) in item.goods" :key="index2">
  194. <image class="mb-12" :src="info2.goods_image" mode="aspectFill"></image>
  195. <view class="mb-8 fw-600 text-overflow-ellipsis-one fs-26">{{info2.goods_name}}</view>
  196. <view class="">
  197. <span class="fs-24 fc-FB3D03">¥</span>
  198. <span class="fs-32 fc-FB3D03 fw-b">{{info2.price}}</span>
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. <uni-popup ref="popup" type="center" border-radius="10px 10px 10px 10px" :is-mask-click="false">
  207. <view class="roll-pop">
  208. <!-- <image class="lq-bg" src="@/static/img/index/lq-bg.png" mode=""></image> -->
  209. <image class="tc-top" src="@/static/img/index/tc-top.png" mode=""></image>
  210. <view class="coupon-box">
  211. <image class="tc-content" src="@/static/img/index/tc-content.png" mode=""></image>
  212. <view class="item-box display-flex" v-for="(item,index) in couponData" :key="index">
  213. <view class="item-right flex-direction flex-justify-center flex-1 bgc-FCE7E2">
  214. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
  215. {{item.name}}
  216. </view>
  217. <view class="fs-22 fc-6 mb-12">
  218. 有效时间:{{item.time_type_str}}
  219. </view>
  220. <view class="fs-22 fc-6">
  221. 券类型:{{item.scene == 1?'外卖卷':'代取卷'}}
  222. </view>
  223. </view>
  224. <view class="item-hr"></view>
  225. <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
  226. <view class="align-items-center">
  227. <view class="fs-24 fw-600 fc-FB3D03">¥</view>
  228. <view class="fs-48 fw-600 fc-FB3D03">{{item.money}}</view>
  229. </view>
  230. <view class="fs-22 fc-6 mb-4">
  231. 需满{{item.full_money}}元
  232. </view>
  233. <view class="but-box fs-26 fc-f" @click="receive(item,index)">立即领取</view>
  234. <view class="ball"></view>
  235. <view class="ball-two"></view>
  236. </view>
  237. </view>
  238. </view>
  239. <image class="tc-bot" src="@/static/img/index/tc-bot.png" mode=""></image>
  240. <uni-icons @click="gbPOp" class="pop-gb" color='#fff' type="close" size="30"></uni-icons>
  241. </view>
  242. </uni-popup>
  243. <uni-popup ref="popupNotice" type="center" border-radius="10px 10px 10px 10px" :is-mask-click="false">
  244. <view class="p-20 box-sizing-border bgc-f b-rad-20 w-80-vw h-60-vh flex-direction">
  245. <view class="text-align-center fw-600 fs-30 mb-20">
  246. 公告通知
  247. </view>
  248. <scroll-view :scroll-y="true" class="scroll-view-css mb-24" @scrolltolower="scrolltolower">
  249. <view class="fs-28" v-html="pop_notice.content"></view>
  250. </scroll-view>
  251. <view class="align-items-center">
  252. <view class="flex-1 but mr-24 fs-30 fc-f b-rad-200 text-align-center bgc-41ABF5"
  253. @click="goToNotice">
  254. 查看详情
  255. </view>
  256. <view class="flex-1 but fs-30 fc-3 b-rad-200 text-align-center b-r-ccc" @click="gbNoticePop">
  257. 我知道了
  258. </view>
  259. </view>
  260. </view>
  261. </uni-popup>
  262. </view>
  263. </template>
  264. <script>
  265. import {
  266. alumniHeatList
  267. } from '@/api/alumni.js'
  268. import enBlankVue from "@/components/en-utils/en-blank/en-blank.vue";
  269. import tools from "@/service/tools";
  270. import {
  271. getNotice,
  272. getBanner,
  273. commonApplet,
  274. commonPopNotice
  275. } from '@/api/common.js';
  276. import {
  277. getSeckillGoods
  278. } from '@/api/seckill.js'
  279. import {
  280. getTakeaway
  281. } from '@/api/category.js';
  282. import {
  283. getGoodsList
  284. } from '@/api/goods.js';
  285. import {
  286. couponHome,
  287. receiveCoupon
  288. } from '@/api/coupon.js'
  289. import {
  290. shopInfo,
  291. shopHome
  292. } from "@/api/shop.js"
  293. import {
  294. membeRmessage
  295. } from "@/api/member.js"
  296. export default {
  297. components: {
  298. enBlankVue
  299. },
  300. data() {
  301. return {
  302. BarH: 0,
  303. bgckgroundBox: 'transparent',
  304. bgckgroundSearch: '',
  305. bgckgroundType: '',
  306. navList: [{
  307. name: "外卖",
  308. img: require('@/static/img/index/index-wm.png'),
  309. type: 2
  310. },
  311. {
  312. name: "快递代取",
  313. img: require('@/static/img/index/index-dq.png'),
  314. type: 3
  315. },
  316. {
  317. name: "校友圈",
  318. img: require('@/static/img/index/index-xyq.png'),
  319. type: 7
  320. },
  321. {
  322. name: "特价团购",
  323. img: require('@/static/img/index/index-tg.png'),
  324. type: 5
  325. },
  326. {
  327. name: "领券中心",
  328. img: require('@/static/img/index/index-lqzx.png'),
  329. type: 6
  330. },
  331. {
  332. name: "跑腿代拿",
  333. img: require('@/static/img/index/index-ptdn.png'),
  334. type: 7
  335. },
  336. {
  337. name: "实习岗位",
  338. img: require('@/static/img/index/index-sxgw.png'),
  339. type: 8
  340. },
  341. {
  342. name: "平台客服",
  343. img: require('@/static/img/index/index-ptkf.png'),
  344. type: 9
  345. },
  346. ],
  347. schoolData: {
  348. school_name: '',
  349. },
  350. noticeList: [],
  351. bannerList: [],
  352. seckillGoodsList: [],
  353. typeList: [], //分类数组
  354. category_id: 0, //分类id
  355. goodsList: [],
  356. total: 0,
  357. page: 1,
  358. couponData: [],
  359. indexSearchHeight: '',
  360. dotStyle: {
  361. width: 6,
  362. bottom: 6,
  363. backgroundColor: 'rgba(51, 51, 51,0.3)',
  364. border: '1px rgba(0,0,0,0) solid',
  365. color: '#fff',
  366. selectedBackgroundColor: 'rgba(79, 179, 239,0.9)',
  367. selectedBorder: '1px rgba(0,0,0,0) solid'
  368. },
  369. current: 0,
  370. pop_notice: {
  371. content: '' // 公告通知
  372. },
  373. popType: true,
  374. shopHomeData: {}
  375. }
  376. },
  377. onShow() {
  378. let lon = uni.getStorageSync('lon');
  379. let lat = uni.getStorageSync('lat');
  380. if (!lon || !lat) {
  381. uni.getLocation({
  382. type: "gcj02",
  383. success: (res) => {
  384. if (res.errMsg === 'getLocation:ok') {
  385. uni.setStorageSync('lon', res.longitude);
  386. uni.setStorageSync('lat', res.latitude);
  387. } else {
  388. tools.error('位置授权失败,请检查是否开始授权')
  389. }
  390. },
  391. fail: (res) => {
  392. tools.error('位置授权失败,请检查是否开始授权')
  393. },
  394. })
  395. }
  396. let school_id = uni.getStorageSync('school_id');
  397. let operate_id = uni.getStorageSync('operate_id');
  398. let school_name = uni.getStorageSync('school_name');
  399. if (!school_id || !operate_id) {
  400. setTimeout(() => {
  401. uni.reLaunch({
  402. url: '/pages-address/select-school?type=1'
  403. })
  404. }, 1000)
  405. } else {
  406. this.schoolData.school_name = school_name;
  407. }
  408. this.commonApplet()
  409. this.getBanner();
  410. // this.getNotice();
  411. this.alumniHeatList()
  412. this.getSeckillGoods();
  413. this.getTakeaway();
  414. let userToken = uni.getStorageSync('token')
  415. if (userToken) {
  416. this.commonPopNotice()
  417. this.membeRmessage()
  418. // this.couponHome()
  419. }
  420. uni.removeStorageSync('orderInfoType')
  421. },
  422. onLoad(data) {
  423. if (data.inviteCode !== undefined) {
  424. uni.setStorageSync('inviteCode', data.inviteCode)
  425. }
  426. this.page = 1;
  427. this.goodsList = [];
  428. this.getGoodsList();
  429. this.shopHome()
  430. },
  431. mounted() {
  432. this.getHeight()
  433. },
  434. onPageScroll(e) {
  435. if (e.scrollTop > 1) {
  436. this.bgckgroundBox = '#fff';
  437. this.bgckgroundSearch = '#fff';
  438. if (e.scrollTop > 500) {
  439. this.bgckgroundType = '#fff';
  440. } else {
  441. this.bgckgroundType = '';
  442. }
  443. } else {
  444. this.bgckgroundBox = 'transparent';
  445. this.bgckgroundSearch = '';
  446. this.bgckgroundType = '';
  447. }
  448. },
  449. onReachBottom() {
  450. if (this.goodsList.length < this.total) {
  451. this.page += 1;
  452. this.getGoodsList();
  453. }
  454. },
  455. created() {
  456. uni.getSystemInfo({
  457. success: (e) => {
  458. let statusBarH = e.statusBarHeight + 10
  459. let custom = 0;
  460. custom = wx.getMenuButtonBoundingClientRect()
  461. let customBarH = custom.height;
  462. this.BarH = statusBarH + customBarH;
  463. }
  464. })
  465. },
  466. methods: {
  467. shopHome() {
  468. shopHome().then((res) => {
  469. if (res.code === 1) {
  470. this.shopHomeData = res.data
  471. }
  472. })
  473. },
  474. membeRmessage() {
  475. membeRmessage().then((res) => {
  476. if (res.code === 1) {
  477. if (res.data.msg_count > 0) {
  478. uni.showTabBarRedDot({
  479. index: 2
  480. })
  481. } else {
  482. uni.hideTabBarRedDot({
  483. index: 2
  484. })
  485. }
  486. setInterval(() => {
  487. membeRmessage()
  488. }, 60000)
  489. }
  490. })
  491. },
  492. commonPopNotice() {
  493. let operate_id = uni.getStorageSync('operate_id');
  494. let school_id = uni.getStorageSync('school_id');
  495. commonPopNotice({
  496. operate_id: operate_id,
  497. school_id: school_id
  498. }).then((res) => {
  499. const noticeId = uni.getStorageSync('notice_id');
  500. if (res.code === 1) {
  501. if (res.data.id) {
  502. if (noticeId === res.data.id) {
  503. this.popType = true
  504. this.couponHome()
  505. } else {
  506. uni.hideTabBar()
  507. this.pop_notice = res.data
  508. this.$refs.popupNotice.open()
  509. this.popType = false
  510. }
  511. } else {
  512. this.popType = true
  513. this.couponHome()
  514. }
  515. }
  516. })
  517. },
  518. gbNoticePop() {
  519. uni.showTabBar()
  520. this.$refs.popupNotice.close()
  521. this.popType = true
  522. this.couponHome()
  523. },
  524. goToNotice() {
  525. uni.setStorageSync('notice_id', this.pop_notice.id);
  526. uni.showTabBar()
  527. this.$refs.popupNotice.close()
  528. this.popType = true
  529. uni.navigateTo({
  530. url: '/pages-my/notice/info?id=' + this.pop_notice.id
  531. })
  532. },
  533. commonApplet() {
  534. commonApplet().then((res) => {
  535. if (res.code == 1) {
  536. this.navList.forEach((v, k) => {
  537. v.appletAudit = 0
  538. if (v.type == 8 || v.type == 9 || v.type == 10 || v.type == 11) {
  539. v.appletAudit = res.data
  540. }
  541. })
  542. }
  543. })
  544. },
  545. getHeight() {
  546. // 创建选择器对象
  547. const query = uni.createSelectorQuery().in(this);
  548. // 选择我们想要的元素
  549. query.select('.index-search').boundingClientRect(data => {
  550. // data是选中元素的大小及位置信息
  551. if (data) {
  552. // 元素的高度
  553. this.indexSearchHeight = data.height;
  554. console.log('元素的高度:', this.indexSearchHeight);
  555. }
  556. }).exec(); // 执行选择器查询
  557. },
  558. change(e) {
  559. this.current = e.detail.current
  560. },
  561. bannerClock(item) {
  562. if (item.type == 1) {
  563. // 外卖首页
  564. uni.navigateTo({
  565. url: '/pages-takeout/takeout'
  566. })
  567. } else if (item.type == 2) {
  568. if (item.to_id != 0) {
  569. // 外卖商家
  570. uni.navigateTo({
  571. url: '/pages-takeout/shop?shop_id=' + item.to_id
  572. })
  573. } else {
  574. // 外卖首页
  575. uni.navigateTo({
  576. url: '/pages-takeout/takeout'
  577. })
  578. }
  579. } else if (item.type == 3) {
  580. // 代取页
  581. uni.navigateTo({
  582. url: '/pages-takeout/replace-take'
  583. })
  584. } else if (item.type === 4) {
  585. // 团购页
  586. uni.navigateTo({
  587. url: '/pages-buy/group'
  588. })
  589. } else if (item.type === 5) {
  590. // 票务页
  591. uni.navigateTo({
  592. url: '/pages-buy/ticket'
  593. })
  594. } else if (item.type === 6) {
  595. // 干洗页
  596. uni.navigateTo({
  597. url: '/pages-buy/dry-clean'
  598. })
  599. } else if (item.type === 7) {
  600. // 校友圈
  601. uni.navigateTo({
  602. url: '/pages-school/school-circle'
  603. })
  604. } else if (item.type === 8) {
  605. // 骑手申请页
  606. uni.navigateTo({
  607. url: '/pages-my/rider-recruit'
  608. })
  609. }
  610. },
  611. goSchool() {
  612. uni.navigateTo({
  613. url: '/pages-school/school-circle'
  614. })
  615. },
  616. receive(item, index) {
  617. receiveCoupon({
  618. grant_id: item.grant_id,
  619. coupon_id: item.coupon_id
  620. }).then((res) => {
  621. if (res.code == 1) {
  622. tools.success(res.msg)
  623. this.couponData.splice(index, 1)
  624. if (this.couponData.length <= 0) {
  625. this.gbPOp()
  626. }
  627. } else {
  628. tools.error(res.msg)
  629. this.couponData.splice(index, 1)
  630. }
  631. })
  632. },
  633. couponHome() {
  634. let operate_id = uni.getStorageSync('operate_id');
  635. couponHome({
  636. operate_id: operate_id
  637. }).then((res) => {
  638. if (res.code == 1) {
  639. if (res.data.length > 0) {
  640. uni.hideTabBar()
  641. this.couponData = res.data
  642. this.$refs.popup.open()
  643. }
  644. }
  645. })
  646. },
  647. gbPOp() {
  648. uni.showTabBar()
  649. this.$refs.popup.close()
  650. },
  651. getBanner() {
  652. let operate_id = uni.getStorageSync('operate_id');
  653. let school_id = uni.getStorageSync('school_id');
  654. getBanner({
  655. operate_id: operate_id,
  656. school_id: school_id
  657. }).then((res) => {
  658. if (res.code === 1) {
  659. this.bannerList = res.data;
  660. }
  661. })
  662. },
  663. alumniHeatList() {
  664. let school_id = uni.getStorageSync('school_id');
  665. alumniHeatList({
  666. school_id: school_id
  667. }).then((res) => {
  668. if (res.code === 1) {
  669. this.noticeList = res.data;
  670. }
  671. })
  672. },
  673. getNotice() {
  674. let operate_id = uni.getStorageSync('operate_id');
  675. let school_id = uni.getStorageSync('school_id');
  676. getNotice({
  677. operate_id: operate_id,
  678. school_id: school_id
  679. }).then((res) => {
  680. if (res.code === 1) {
  681. this.noticeList = res.data;
  682. }
  683. })
  684. },
  685. getSeckillGoods() {
  686. let operate_id = uni.getStorageSync('operate_id');
  687. getSeckillGoods({
  688. operate_id: operate_id
  689. }).then((res) => {
  690. if (res.code === 1) {
  691. this.seckillGoodsList = res.data
  692. }
  693. })
  694. },
  695. getTakeaway() {
  696. getTakeaway().then((res) => {
  697. if (res.code === 1) {
  698. this.typeList = res.data;
  699. this.typeList.unshift({
  700. name: "全部",
  701. id: 0
  702. })
  703. }
  704. })
  705. },
  706. getGoodsList() {
  707. let operate_id = uni.getStorageSync('operate_id');
  708. getGoodsList({
  709. page: this.page,
  710. operate_id: operate_id,
  711. category_id: this.category_id
  712. }).then((res) => {
  713. if (res.code === 1) {
  714. this.goodsList = [...this.goodsList, ...res.data.items];
  715. this.total = res.data.total;
  716. }
  717. })
  718. },
  719. selectType(id) {
  720. if (this.category_id != id) {
  721. this.category_id = id;
  722. this.page = 1;
  723. this.goodsList = [];
  724. this.getGoodsList();
  725. }
  726. },
  727. toUrl(type) {
  728. if (type === 1) {
  729. // 去搜索
  730. uni.navigateTo({
  731. url: '/pages/index/search-record'
  732. })
  733. } else if (type === 2) {
  734. // 去外卖
  735. uni.navigateTo({
  736. url: '/pages-takeout/takeout'
  737. })
  738. } else if (type === 3) {
  739. // 去代取
  740. uni.navigateTo({
  741. url: '/pages-takeout/replace-take'
  742. })
  743. } else if (type === 4) {
  744. // 去票务
  745. uni.navigateTo({
  746. url: '/pages-buy/ticket'
  747. })
  748. } else if (type === 5) {
  749. // 去团购
  750. uni.navigateTo({
  751. url: '/pages-buy/group'
  752. })
  753. } else if (type === 6) {
  754. // 去干洗
  755. uni.navigateTo({
  756. url: '/pages-buy/dry-clean'
  757. })
  758. } else if (type === 7) {
  759. // 去校友圈
  760. uni.navigateTo({
  761. url: '/pages-school/school-circle'
  762. })
  763. } else if (type === 8) {
  764. // 去实习岗位
  765. uni.navigateTo({
  766. url: '/pages-position/Internship-position'
  767. })
  768. } else {
  769. tools.error('暂未开放')
  770. }
  771. },
  772. toSelectSchool() {
  773. uni.navigateTo({
  774. url: '/pages-address/select-school?type=1'
  775. })
  776. },
  777. toShop(item) {
  778. const operate_id = uni.getStorageSync('operate_id')
  779. shopInfo({
  780. operate_id: operate_id,
  781. shop_id: item.shop_id
  782. }).then((res) => {
  783. if (res.code == 1) {
  784. uni.navigateTo({
  785. url: '/pages-takeout/shop?shop_id=' + item.shop_id + '&category_id=' + item
  786. .category_id + '&goods_id=' + item.goods_id
  787. })
  788. } else {
  789. tools.error(res.msg)
  790. }
  791. })
  792. },
  793. toNoticeDet(item) {
  794. uni.navigateTo({
  795. url: '/pages-school/circle-info?news_id=' + item.news_id
  796. })
  797. },
  798. },
  799. }
  800. </script>
  801. <style lang="scss" scoped>
  802. .b-img{
  803. width: 39rpx;
  804. height: 41rpx;
  805. }
  806. .w-31 {
  807. width: 31%;
  808. }
  809. .max-w-200 {
  810. max-width: 200rpx;
  811. }
  812. .xsms-item-img {
  813. width: 200rpx;
  814. height: 200rpx;
  815. }
  816. .xsms-box {
  817. width: 100%;
  818. height: 706rpx;
  819. padding: 25rpx 0rpx 1rpx 30rpx;
  820. position: relative;
  821. }
  822. .ms-swiper {
  823. width: 100%;
  824. height: 100%;
  825. }
  826. .xsms-img {
  827. width: 139rpx;
  828. height: 31rpx;
  829. }
  830. .tj-item {
  831. width: 108rpx;
  832. height: 108rpx;
  833. }
  834. .mxdp {
  835. width: 317rpx;
  836. height: 31rpx;
  837. }
  838. .mxdq-box {
  839. min-height: 342rpx;
  840. position: relative;
  841. padding: 25rpx 17rpx 18rpx 30rpx;
  842. }
  843. .tj-bg {
  844. position: absolute;
  845. left: 0;
  846. top: 0;
  847. width: 100%;
  848. height: 100%;
  849. }
  850. .xzkn-img {
  851. width: 139rpx;
  852. height: 343rpx;
  853. border-radius: 20rpx;
  854. }
  855. .h-100 {
  856. height: 100%;
  857. }
  858. .max-w-358 {
  859. max-width: 358rpx;
  860. }
  861. .serial-num {
  862. width: 25rpx;
  863. height: 22rpx;
  864. line-height: 22rpx;
  865. border-radius: 10rpx 2rpx 10rpx 2rpx;
  866. }
  867. .z-2 {
  868. position: relative;
  869. z-index: 2;
  870. }
  871. .w-10 {
  872. width: 10rpx;
  873. }
  874. .rebang-box {
  875. width: 160rpx;
  876. height: 130rpx;
  877. background: #53C4FD;
  878. border-radius: 20rpx 0 0 20rpx;
  879. padding: 0 10rpx 0 0;
  880. position: relative;
  881. }
  882. .sj-box {
  883. width: 0;
  884. height: 0;
  885. border-top: 20rpx solid transparent;
  886. border-right: 20rpx solid #F3F3F3;
  887. border-left: 20rpx solid transparent;
  888. border-bottom: 20rpx solid transparent;
  889. position: absolute;
  890. right: -2rpx;
  891. top: calc(50% - 20rpx);
  892. }
  893. .rebang {
  894. width: 64rpx;
  895. }
  896. .h-60-vh {
  897. max-height: 60vh;
  898. }
  899. .w-80-vw {
  900. width: 80vw;
  901. }
  902. .plrb-24 {
  903. padding: 0 24rpx 24rpx;
  904. }
  905. .spike-box {
  906. padding: 0 24rpx;
  907. }
  908. .wh27 {
  909. width: 27rpx;
  910. height: 27rpx;
  911. }
  912. .nav-z {
  913. position: relative;
  914. z-index: 1 !important;
  915. background: linear-gradient(-90deg, #3BB5FE, #62C4FF);
  916. }
  917. .wh-40 {
  918. width: 40rpx;
  919. height: 40rpx;
  920. }
  921. .item-box {
  922. margin-bottom: 20rpx;
  923. }
  924. .item-box:last-child {
  925. margin: 0;
  926. }
  927. .roll-pop {
  928. position: relative;
  929. width: 100vw;
  930. // height: 1000rpx;
  931. .tc-top {
  932. width: 100%;
  933. height: 202rpx;
  934. }
  935. .tc-bot {
  936. width: 100%;
  937. height: 178rpx;
  938. }
  939. .pop-gb {
  940. width: 56rpx;
  941. height: 56rpx;
  942. position: absolute;
  943. bottom: -65rpx;
  944. left: calc((100% - 28rpx) / 2);
  945. }
  946. }
  947. .coupon-box {
  948. width: 100%;
  949. // min-height: 590rpx;
  950. padding: 0 82rpx 0 92rpx;
  951. box-sizing: border-box;
  952. position: relative;
  953. .tc-content {
  954. position: absolute;
  955. left: 0;
  956. top: 0;
  957. width: 100%;
  958. height: 100%;
  959. }
  960. }
  961. .index-box {
  962. .maxw-220 {
  963. max-width: 220rpx;
  964. }
  965. position: relative;
  966. .bg-img {
  967. width: 100%;
  968. height: 930rpx;
  969. position: absolute;
  970. top: 0;
  971. left: 0;
  972. z-index: -2;
  973. }
  974. .nav-icon {
  975. width: 32rpx;
  976. height: 32rpx;
  977. }
  978. .index-box-1 {
  979. width: 100%;
  980. // height: 3000rpx;
  981. .swiper {
  982. width: 702rpx;
  983. height: 280rpx;
  984. border-radius: 20rpx;
  985. .swiper-item {
  986. width: 702rpx;
  987. height: 280rpx;
  988. border-radius: 20rpx;
  989. }
  990. }
  991. .nav-list {
  992. // padding: 0 22rpx;
  993. .nav-list-item {
  994. width: 25%;
  995. margin-bottom: 35rpx;
  996. .title-img-box {
  997. .title-img {
  998. width: 80rpx;
  999. height: 76rpx;
  1000. }
  1001. }
  1002. }
  1003. .nav-list-item:nth-child(3) {
  1004. .title-img-box {
  1005. .title-img {
  1006. width: 92rpx;
  1007. height: 82rpx;
  1008. }
  1009. }
  1010. }
  1011. .nav-list-item:nth-child(4) {
  1012. .title-img-box {
  1013. .title-img {
  1014. width: 82rpx;
  1015. height: 73rpx;
  1016. }
  1017. }
  1018. }
  1019. .nav-list-item:nth-child(5) {
  1020. .title-img-box {
  1021. .title-img {
  1022. width: 79rpx;
  1023. height: 86rpx;
  1024. }
  1025. }
  1026. }
  1027. .nav-list-item:nth-child(6) {
  1028. .title-img-box {
  1029. .title-img {
  1030. width: 93rpx;
  1031. height: 99rpx;
  1032. }
  1033. }
  1034. }
  1035. .nav-list-item:nth-child(7) {
  1036. .title-img-box {
  1037. .title-img {
  1038. width: 106rpx;
  1039. height: 84rpx;
  1040. }
  1041. }
  1042. }
  1043. .nav-list-item:nth-child(8) {
  1044. .title-img-box {
  1045. .title-img {
  1046. width: 81rpx;
  1047. height: 88rpx;
  1048. }
  1049. }
  1050. }
  1051. }
  1052. .msg-box {
  1053. width: 100%;
  1054. height: 180rpx;
  1055. border-radius: 12rpx;
  1056. padding: 30rpx 40rpx;
  1057. position: relative;
  1058. }
  1059. .rb-bg {
  1060. position: absolute;
  1061. left: 0;
  1062. bottom: 0;
  1063. width: 100%;
  1064. height: 100%;
  1065. }
  1066. .xyrb-img {
  1067. width: 108rpx;
  1068. height: 123rpx;
  1069. }
  1070. .type-list-box {
  1071. position: sticky;
  1072. left: 0;
  1073. // top: calc(var(BarH)px + 93rpx);
  1074. // top: calc(86px + 93rpx);
  1075. padding: 24rpx;
  1076. overflow-x: scroll;
  1077. z-index: 50;
  1078. .type-item-box {
  1079. margin-right: 16rpx;
  1080. padding: 0 24rpx;
  1081. // min-width: 300rpx;
  1082. height: 56rpx;
  1083. line-height: 56rpx;
  1084. border-radius: 200rpx;
  1085. text-align: center;
  1086. font-size: 28rpx;
  1087. }
  1088. .type-item-box:last-child {
  1089. margin-right: 0;
  1090. }
  1091. .s-type {
  1092. color: #fff;
  1093. font-weight: 600;
  1094. background: linear-gradient(280deg, #44B1F7 0%, #96D6F4 100%);
  1095. }
  1096. .n-type {
  1097. color: #666;
  1098. background-color: #fff;
  1099. }
  1100. }
  1101. .goos-list-box {
  1102. width: 100%;
  1103. min-height: 100rpx;
  1104. background: #FFFFFF;
  1105. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51, 51, 51, 0.1);
  1106. border-radius: 20rpx;
  1107. margin-bottom: 20rpx;
  1108. .goods-items-list {
  1109. width: 530rpx;
  1110. overflow-y: scroll;
  1111. .goods-items-list-box {
  1112. width: 140rpx;
  1113. margin-right: 16rpx;
  1114. image {
  1115. width: 140rpx;
  1116. height: 140rpx;
  1117. border-radius: 12rpx
  1118. }
  1119. }
  1120. }
  1121. .left-img-box {
  1122. width: 100rpx;
  1123. height: 100rpx;
  1124. margin-right: 16rpx;
  1125. position: relative;
  1126. .left-img {
  1127. width: 100rpx;
  1128. height: 100rpx;
  1129. border-radius: 12rpx;
  1130. }
  1131. .status-box {
  1132. position: absolute;
  1133. bottom: 0;
  1134. left: 0;
  1135. width: 100%;
  1136. padding: 4rpx 0;
  1137. text-align: center;
  1138. background: rgba(0, 0, 0, 0.5);
  1139. font-size: 17rpx;
  1140. border-radius: 0 0 12rpx 12rpx;
  1141. }
  1142. }
  1143. .img-x {
  1144. width: 24rpx;
  1145. height: 24rpx;
  1146. }
  1147. .right-box-title {
  1148. width: 438rpx;
  1149. }
  1150. .right-box-title-img {
  1151. width: 32rpx;
  1152. height: 32rpx;
  1153. margin-left: auto;
  1154. }
  1155. .quan-list {
  1156. .quan-list-1 {
  1157. width: 32rpx;
  1158. height: 34rpx;
  1159. background: #FB3D03;
  1160. border-radius: 5rpx 0rpx 0rpx 5rpx;
  1161. text-align: center;
  1162. line-height: 34rpx;
  1163. }
  1164. .quan-list-2 {
  1165. box-sizing: border-box;
  1166. height: 34rpx;
  1167. line-height: 34rpx;
  1168. padding: 0 4rpx;
  1169. border-radius: 0 5rpx 5rpx 0;
  1170. border: 1rpx solid #FB3D03;
  1171. text-align: center;
  1172. }
  1173. }
  1174. }
  1175. }
  1176. .index-search {
  1177. position: sticky;
  1178. left: 0;
  1179. z-index: 10;
  1180. padding: 0 24rpx 20rpx 24rpx;
  1181. .index-search-box {
  1182. width: 100%;
  1183. height: 72rpx;
  1184. padding: 0 6rpx 0 24rpx;
  1185. border-radius: 200rpx;
  1186. .index-search-box-buttom {
  1187. width: 120rpx;
  1188. height: 60rpx;
  1189. background: linear-gradient(-90deg, #3BB5FE, #62C4FF);
  1190. border-radius: 200rpx;
  1191. margin-left: auto;
  1192. line-height: 60rpx;
  1193. text-align: center;
  1194. }
  1195. }
  1196. }
  1197. }
  1198. .item-hr {
  1199. width: 0px;
  1200. height: auto;
  1201. border-right: 1rpx dashed #FB7850;
  1202. }
  1203. .item-hr-two {
  1204. width: 0px;
  1205. height: auto;
  1206. border-right: 1rpx dashed #999;
  1207. }
  1208. .item-left {
  1209. width: 171rpx;
  1210. height: auto;
  1211. padding: 20rpx 18rpx;
  1212. box-sizing: border-box;
  1213. position: relative;
  1214. border-radius: 0 20rpx 20rpx 0;
  1215. }
  1216. .ball {
  1217. width: 24rpx;
  1218. height: 24rpx;
  1219. border-radius: 50%;
  1220. position: absolute;
  1221. top: -12rpx;
  1222. left: -12rpx;
  1223. background: #fff;
  1224. z-index: 2;
  1225. }
  1226. .ball-two {
  1227. width: 24rpx;
  1228. height: 24rpx;
  1229. border-radius: 50%;
  1230. position: absolute;
  1231. background: #fff;
  1232. z-index: 10;
  1233. bottom: -12rpx;
  1234. left: -12rpx;
  1235. }
  1236. .item-right {
  1237. padding: 24rpx;
  1238. box-sizing: border-box;
  1239. border-radius: 20rpx 0 0 20rpx;
  1240. position: relative;
  1241. }
  1242. .but-box {
  1243. width: 136rpx;
  1244. height: 48rpx;
  1245. line-height: 48rpx;
  1246. text-align: center;
  1247. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  1248. border-radius: 200rpx;
  1249. }
  1250. .but {
  1251. width: 100%;
  1252. height: 60rpx;
  1253. line-height: 60rpx;
  1254. }
  1255. .rd-img {
  1256. width: 40rpx;
  1257. height: 40rpx;
  1258. }
  1259. </style>