index.vue 27 KB

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