index.vue 27 KB

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