index.vue 29 KB

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