index.vue 29 KB

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