index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326
  1. <template>
  2. <view class="index">
  3. <navbar :config="config" @searchClick="searchClick">
  4. <view
  5. slot="right"
  6. style="
  7. font-size: 36rpx;
  8. font-weight: 500;
  9. color: #ffffff;
  10. margin-right: 30rpx;
  11. "
  12. >
  13. <text class="iconfont" style="font-size: 40rpx;" @click="goToMsg()">
  14. &#xe66d;
  15. <view class="num" v-if="msgCenter==0?false:msgCenter">{{msgCenter}}</view>
  16. </text>
  17. </view>
  18. </navbar>
  19. <view class="top"></view>
  20. <view class="swiper">
  21. <view class="uni-margin-wrap">
  22. <swiper
  23. class="swiper"
  24. :indicator-dots="true"
  25. :autoplay="true"
  26. :interval="3000"
  27. :duration="1000"
  28. circular=ture
  29. >
  30. <swiper-item v-for="item in shopBanner" :key="item.id"
  31. ><view
  32. class="swiper-item"
  33. @click="
  34. imgLink(item.model_type, item.model_id, item.url, item.shop_id)
  35. ">
  36. <image
  37. class="bannersize"
  38. :src="item.cover"
  39. mode="aspectFill"
  40. ></image> </view
  41. ></swiper-item>
  42. </swiper>
  43. </view>
  44. </view>
  45. <view class="list">
  46. <view class="item" @click="goDetail('/pages/research/nearby/timeLimit')">
  47. <image :src="imgUrl+'/index/alarmClock.png'" mode=""></image>
  48. <view class="font">限时秒杀</view>
  49. </view>
  50. <view
  51. class="item"
  52. @click="goDetail('/pages/research/homepage/groupList')"
  53. >
  54. <image :src="imgUrl+'/index/spell.png'" mode=""></image>
  55. <view class="font">拼团</view>
  56. </view>
  57. <view class="item" @click="goDetail('/pages/pointsMall/index')">
  58. <image :src="imgUrl+'/index/integral.png'" mode=""></image>
  59. <view class="font">积分商城</view>
  60. </view>
  61. <!-- <view class="item" @click="goDetail('/pages/user/wallet/cardBag', true)">
  62. <image :src="imgUrl+'/index/oneCardSolution.png'" mode=""></image>
  63. <view class="font">一卡通</view>
  64. </view> -->
  65. <view class="item" @click="goDetail('/pages/research/nearby/facade')">
  66. <image :src="imgUrl+'/index/nearby.png'" mode=""></image>
  67. <view class="font">附近门店</view>
  68. </view>
  69. </view>
  70. <!-- 广告 -->
  71. <view class="advertisement" v-for='item in shopBanner2' :key="item.id"
  72. @click="
  73. imgLink(item.model_type, item.model_id, item.url)
  74. "
  75. ><image :src="item.cover" mode=""></image
  76. ></view>
  77. <!-- 限时秒杀 -->
  78. <view class="seckill" v-if="currSeckill && currSeckill.length > 0">
  79. <view class="seckill-item">
  80. <view
  81. class="seckill-top"
  82. @click="goDetail('/pages/research/nearby/timeLimit')"
  83. >
  84. <view class="left">限时秒杀</view>
  85. <view class="line" v-if="currTime"></view>
  86. <view class="time" v-if="currTime">{{ currTime }}点场 剩余</view>
  87. <view class="reciprocal" v-if="currTime">
  88. <uni-countdown
  89. :backgroundColor="'none'"
  90. @timeup="overDown2"
  91. :color="'#fff'"
  92. :splitorColor="'#fff'"
  93. :show-day="time2[0] > 0"
  94. :day="time2[0]"
  95. :hour="time2[1]"
  96. :minute="time2[2]"
  97. :second="time2[3]"
  98. ></uni-countdown
  99. ></view>
  100. </view>
  101. <view class="option" v-if="currSeckill && currSeckill.length > 0">
  102. <swiper
  103. :indicator-dots="false"
  104. :autoplay="false"
  105. :display-multiple-items="itemsDis2"
  106. @change="imgActiveFun2"
  107. style="height: 220rpx"
  108. circular="true"
  109. >
  110. <swiper-item
  111. class="option-item"
  112. @click="
  113. goProductDetails(
  114. '/pages/product/goods/seckillGoods?id=' + item.id
  115. )
  116. "
  117. v-for="item in currSeckill"
  118. :key="item.id"
  119. >
  120. <!-- <view class="option-item" v-for="item in currSeckill" :key="item.id"> -->
  121. <image
  122. v-if="item && item.cover"
  123. :src="item.cover"
  124. mode=""
  125. ></image>
  126. <view class="number">
  127. <rich-text
  128. :nodes="$mUtil.priceBigSmall(item.min_price)"
  129. ></rich-text>
  130. </view>
  131. <!-- </view> -->
  132. </swiper-item></swiper
  133. >
  134. <view class="slide-box">
  135. <view
  136. class="dotBox"
  137. :style="{ marginLeft: ml2 + 'rpx' }"
  138. v-if="currSeckill.length > 0"
  139. >
  140. <view
  141. class="dotBox_item"
  142. v-for="(v, i) in keyList2"
  143. :key="i"
  144. :class="{ active_dotBox: activeBannerIndex2 == i }"
  145. ></view>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- <view class="scroll" v-if="currSeckill && currSeckill.length > 0"
  150. ><view class="scroll-red"></view
  151. ></view> -->
  152. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  153. </view>
  154. </view>
  155. <!-- 拼团购 -->
  156. <view class="group-work" v-if="groupList && groupList.length > 0">
  157. <view
  158. class="work-top"
  159. @click="goDetail('/pages/research/homepage/groupList')"
  160. >
  161. <view class="top-left">拼团购</view>
  162. <view class="top-right">
  163. 查看更多
  164. <text class="iconfont u-font24 u-999">&#xe6c7;</text>
  165. </view>
  166. </view>
  167. <view v-if="groupList && groupList.length > 0">
  168. <view
  169. class="middle"
  170. v-for="item in groupList"
  171. :key="item.id"
  172. @click="
  173. goProductDetails('/pages/product/goods/puzzleGoods?id=' + item.id)
  174. "
  175. >
  176. <view class="middle-left"
  177. ><image v-if="item && item.cover" :src="item.cover" mode=""></image
  178. ></view>
  179. <view class="middle-right">
  180. <view class="middle-title">{{ item.title }}</view>
  181. <view class="division">
  182. <view class="middle-num">
  183. <view class="contain">
  184. <view class="large">
  185. <rich-text
  186. :nodes="$mUtil.priceBigSmall(item.min_price)"
  187. ></rich-text>
  188. </view>
  189. <view class="small">¥ {{ item.min_sale_price }}</view>
  190. </view>
  191. <view class="three"
  192. >{{ item.group_people_num }}人团,已拼 <text style="color: #FF0000;">
  193. {{item.result_sale_num}}</text> 件</view
  194. >
  195. </view>
  196. <view class="button">去拼团</view>
  197. </view>
  198. </view>
  199. </view>
  200. </view>
  201. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  202. </view>
  203. <!-- 热门推荐 -->
  204. <view class="hot">
  205. <view class="hot-top">
  206. <view class="hot-left">热门推荐</view>
  207. <view class="hot-body"></view>
  208. <view class="hot-right">精选好物推荐</view>
  209. </view>
  210. <view class="hot-item" v-if="recommendList && recommendList.length > 0">
  211. <view
  212. class="item"
  213. v-for="item in recommendList"
  214. :key="item.id"
  215. @click="goProductDetails('/pages/product/goods/goods?id=' + item.id)"
  216. >
  217. <image v-if="item && item.cover" :src="item.cover" mode=""></image>
  218. <view class="hot-introduce" v-if="item && item.title">{{
  219. item.title
  220. }}</view>
  221. <view class="hot-number">
  222. <view class="hot-large">
  223. <rich-text
  224. :nodes="$mUtil.priceBigSmall(item.min_sale_price)"
  225. ></rich-text>
  226. </view>
  227. <view class="hot-small">¥{{ item.max_market_price }}</view>
  228. </view>
  229. </view>
  230. </view>
  231. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  232. </view>
  233. <!-- 每周上新 -->
  234. <view class="new-products">
  235. <view class="new-top">
  236. <view class="new-left">每周上新</view>
  237. <view class="new-line"></view>
  238. <view class="new-right">新品上市优惠热销</view>
  239. </view>
  240. <view class="new-list" v-if="newsList && newsList.length > 0">
  241. <view
  242. class="item"
  243. v-for="item in newsList"
  244. :key="item.id"
  245. @click="goProductDetails('/pages/product/goods/goods?id=' + item.id)"
  246. >
  247. <image v-if="item && item.cover" :src="item.cover" mode=""></image>
  248. <view class="list-num">
  249. <rich-text
  250. :nodes="$mUtil.priceBigSmall(item.min_sale_price)"
  251. ></rich-text>
  252. </view>
  253. </view>
  254. </view>
  255. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  256. </view>
  257. <!-- 本月热销 -->
  258. <view class="new-products">
  259. <view class="new-top">
  260. <view class="new-left">本月热销</view>
  261. <view class="new-line"></view>
  262. <view class="new-right">爆品热卖中</view>
  263. </view>
  264. <view v-if="hotList && hotList.length > 0">
  265. <swiper
  266. class="month-list"
  267. :indicator-dots="false"
  268. :autoplay="false"
  269. :display-multiple-items="itemsDis"
  270. @change="imgActiveFun"
  271. circular="true"
  272. >
  273. <swiper-item
  274. class="item"
  275. @click="
  276. goProductDetails('/pages/product/goods/goods?id=' + item.id)
  277. "
  278. v-for="item in hotList"
  279. :key="item.id"
  280. >
  281. <image v-if="item && item.cover" :src="item.cover" mode=""></image>
  282. <view class="list-num">
  283. <rich-text
  284. :nodes="$mUtil.priceBigSmall(item.min_sale_price)"
  285. ></rich-text>
  286. </view>
  287. <view class="sold">已售{{ item.result_sale_num }}件</view>
  288. </swiper-item>
  289. </swiper>
  290. <view class="slide-box">
  291. <view
  292. class="dotBox"
  293. v-if="hotList.length > 0"
  294. >
  295. <!-- 上面给的动态样式 :style="{ marginLeft: ml + 'rpx' }" -->
  296. <!-- v-for="(v, i) in hotList.slice(0,hotList.length-2)" -->
  297. <view
  298. class="dotBox_item"
  299. v-for="(v, i) in hotList"
  300. :key="i"
  301. :class="{ active_dotBox: activeBannerIndex == i }"
  302. ></view>
  303. </view>
  304. </view>
  305. </view>
  306. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  307. </view>
  308. <!-- 本月热销 -->
  309. <!-- 猜你喜欢 -->
  310. <view class="guess">
  311. <view class="guess-top">
  312. <view class="guess-left">猜你喜欢</view>
  313. <view class="guess-line"></view>
  314. <view class="guess-right">智能推荐你感兴趣的优品</view>
  315. </view>
  316. <view class="guess-item" v-if="goodsList && goodsList.length > 0">
  317. <view
  318. class="item"
  319. @click="goProductDetails('/pages/product/goods/goods?id=' + item.id)"
  320. v-for="item in goodsList"
  321. :key="item.id"
  322. >
  323. <image v-if="item && item.cover" :src="item.cover" mode=""></image>
  324. <view style=" padding-bottom: 40rpx;">
  325. <view class="name" style="flex: 1;">{{ item.title }}</view>
  326. <view class="number">
  327. <view class="number-red">
  328. <rich-text
  329. :nodes="$mUtil.priceBigSmall(item.min_sale_price)"
  330. ></rich-text>
  331. </view>
  332. <view class="number-grey">¥{{ item.max_market_price }}</view>
  333. </view>
  334. </view>
  335. </view>
  336. </view>
  337. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  338. <loadMore v-if="goodsList.length > 0" :status="status"></loadMore>
  339. </view>
  340. <!-- 猜你喜欢 -->
  341. </view>
  342. </template>
  343. <script>
  344. export default {
  345. data() {
  346. return {
  347. background: ["color1", "color2", "color3"],
  348. indicatorDots: true,
  349. autoplay: true,
  350. interval: 2000,
  351. duration: 500,
  352. config: {
  353. back: false, //false是tolbar页面 是则不写
  354. title: "商品列表",
  355. color: "#FFFFFF",
  356. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  357. backgroundColor: [1, "#0B844A"],
  358. // rightButton:[{
  359. // key:'btn1',
  360. // position:"left",
  361. // icon:'&#xe6eb;'
  362. // }],
  363. rightSlot: true,
  364. search: {
  365. value: "",
  366. placeholder: "请输入搜索关键字",
  367. disabled: false,
  368. },
  369. },
  370. keyWord: "",
  371. groupList: [], //团购
  372. hotList: [], //本月热销
  373. newsList: [], //每周上新
  374. recommendList: [], //推荐
  375. shopBanner: [], //轮播图
  376. currSeckill: [], //秒杀
  377. time2: [0, 0, 0, 0], //秒杀倒计时
  378. goodsList: [], //猜你喜欢
  379. currTime: null,
  380. keyList: 0,
  381. ml: -22,
  382. itemsDis: 1,
  383. activeBannerIndex: 0,
  384. keyList2: 0,
  385. ml2: -22,
  386. itemsDis2: 1,
  387. activeBannerIndex2: 0,
  388. page: 1,
  389. status: "more",
  390. isOver2: false,
  391. msgCenter:null,
  392. shopBanner2:[],
  393. imgUrl: this.$mConfig.staticUrl
  394. };
  395. },
  396. onLoad(){
  397. this.page = 1;
  398. this.getAll();
  399. },
  400. onShow() {
  401. this.getmessageNum()
  402. },
  403. onPullDownRefresh() {
  404. this.page = 1;
  405. // uni.showModal({
  406. // title:'onPullDownRefresh'
  407. // })
  408. this.getAll();
  409. // uni.stopPullDownRefresh();
  410. },
  411. onReachBottom() {
  412. this.status = "loading";
  413. this.page++;
  414. this.guessLike();
  415. },
  416. methods: {
  417. //跳转消息页面
  418. goToMsg(){
  419. let token = uni.getStorageSync("apiToken")
  420. if(!token){
  421. uni.navigateTo({
  422. url:"../register/login"
  423. })
  424. }else{
  425. uni.navigateTo({
  426. url:"../setup/myMsg"
  427. })
  428. }
  429. },
  430. searchClick() {
  431. // console.log("dian");
  432. uni.navigateTo({
  433. url: "/pages/research/homepage/search",
  434. });
  435. },
  436. goProductDetails(url) {
  437. uni.navigateTo({
  438. url: url,
  439. });
  440. },
  441. changeIndicatorDots(e) {
  442. this.indicatorDots = !this.indicatorDots;
  443. },
  444. changeAutoplay(e) {
  445. this.autoplay = !this.autoplay;
  446. },
  447. intervalChange(e) {
  448. this.interval = e.detail.value;
  449. },
  450. durationChange(e) {
  451. this.duration = e.detail.value;
  452. },
  453. getAll() {
  454. this.rest();
  455. this.getmessageNum();
  456. this.getBanner();
  457. this.seckillList();
  458. this.getgroupList();
  459. this.recommend();
  460. this.newWeek();
  461. this.hotSale();
  462. this.guessLike();
  463. },
  464. /**获得消息数量 */
  465. getmessageNum() {
  466. this.$http.get("/private/message/unread-num").then(res=>{
  467. if(res&&res.code==200){
  468. this.msgCenter = res.data
  469. }
  470. })
  471. },
  472. /**轮播图 */
  473. getBanner() {
  474. this.$http
  475. .get(`/ad/ad/getShopAdByAdL/0/pt-banner`, {}, false)
  476. .then((res) => {
  477. uni.stopPullDownRefresh();
  478. this.loading = false;
  479. if (res && res.code == 200) {
  480. this.shopBanner = res.list;
  481. }
  482. });
  483. this.$http
  484. .get(`/ad/ad/getShopAdByAdL/0/pt-banner2`, {}, false)
  485. .then((res) => {
  486. uni.stopPullDownRefresh();
  487. this.loading = false;
  488. if (res && res.code == 200) {
  489. this.shopBanner2 = res.list;
  490. }
  491. });
  492. },
  493. imgActiveFun(e) {
  494. this.activeBannerIndex = e.detail.current ;
  495. },
  496. imgActiveFun2(e) {
  497. this.activeBannerIndex2 = e.detail.current;
  498. },
  499. overDown2() {
  500. this.isOver2 = true;
  501. },
  502. /**限时秒杀 */
  503. seckillList() {
  504. this.$http
  505. .get(
  506. `/marketing/seckillActivityGoods/flash-sale`,
  507. { limit: 10, page: 1 },
  508. false
  509. )
  510. .then((res) => {
  511. if (res && res.code == 200) {
  512. this.currTime = res.data.start_hour;
  513. this.currSeckill = res.data.list;
  514. if (this.currSeckill && res.data.list.length <= 4) {
  515. this.keyList2 = 1;
  516. this.itemsDis2 = res.data.list.length;
  517. }
  518. if (
  519. this.currSeckill &&
  520. res.data.list.length > 4 &&
  521. res.data.list.length <= 8
  522. ) {
  523. this.keyList2 = 2;
  524. this.ml2 = -45;
  525. this.itemsDis2 = 3;
  526. }
  527. if (
  528. this.currSeckill &&
  529. res.data.list.length > 8 &&
  530. res.data.list.length <= 12
  531. ) {
  532. this.keyList2 = 3;
  533. this.ml2 = -68;
  534. this.itemsDis2 = 3;
  535. }
  536. if (
  537. this.currSeckill &&
  538. res.data.list.length > 12 &&
  539. res.data.list.length <= 16
  540. ) {
  541. this.keyList2 = 4;
  542. this.ml2 = -90;
  543. this.itemsDis2 = 3;
  544. }
  545. if (res.data.finish_time) {
  546. this.time2 = this.$mUtil
  547. .countDown(Math.floor(res.data.finish_time / 1000))
  548. .split(":")
  549. .map((val) => Number(val));
  550. }
  551. }
  552. });
  553. },
  554. /**团购 */
  555. getgroupList() {
  556. this.$http
  557. .get(
  558. `/groupbuy/activitygoods/will-you-spell`,
  559. { limit: 10, page: 1 },
  560. false
  561. )
  562. .then((res) => {
  563. if (res && res.code == 200) {
  564. this.groupList = res.list;
  565. }
  566. });
  567. },
  568. /**热门推荐 */
  569. recommend() {
  570. this.$http
  571. .get(`/goods/new`, { limit: 6, type: "hot" }, false)
  572. .then((res) => {
  573. if (res && res.code == 200) {
  574. this.recommendList = res.list;
  575. }
  576. });
  577. },
  578. /**每周上新 */
  579. newWeek() {
  580. this.$http.get(`/goods/new`, { limit: 16 }, false).then((res) => {
  581. if (res && res.code == 200) {
  582. this.newsList = res.list;
  583. }
  584. });
  585. },
  586. /**本月热销 */
  587. hotSale() {
  588. this.$http
  589. .get(`/goods/month`, { limit: 12, mix_num: 3 }, false)
  590. .then((res) => {
  591. if (res && res.code == 200) {
  592. this.hotList = res.list;
  593. if (res.list.length <= 3) {
  594. this.keyList = 1;
  595. this.itemsDis = res.list.length;
  596. }
  597. if (res.list.length > 3 && res.list.length <= 6) {
  598. this.keyList = 2;
  599. this.ml = -45;
  600. this.itemsDis = 3;
  601. }
  602. if (res.list.length > 6 && res.list.length <= 9) {
  603. this.keyList = 3;
  604. this.ml = -68;
  605. this.itemsDis = 3;
  606. }
  607. if (res.list.length > 9 && res.list.length <= 12) {
  608. this.keyList = 4;
  609. this.ml = -90;
  610. this.itemsDis = 3;
  611. }
  612. }
  613. });
  614. },
  615. /**猜你喜欢 */
  616. guessLike() {
  617. this.keyWord=uni.getStorageSync("history")?uni.getStorageSync("history").join(","):''
  618. // console.log( this.keyWord)
  619. this.$http
  620. .get(
  621. `/goods/smart`,
  622. {
  623. page: this.page,
  624. limit: 6,
  625. keywords: this.keyWord,
  626. },
  627. false
  628. )
  629. .then((res) => {
  630. if (res && res.code == 200) {
  631. this.goodsList =this.page==1?res.page.list: this.goodsList.concat(res.page.list);
  632. if (res.page.totalPage <= res.page.currPage) {
  633. this.status = "noMore";
  634. } else {
  635. this.status = "more";
  636. }
  637. }
  638. });
  639. },
  640. /**轮播图跳转 */
  641. imgLink(type, id, url, shopid) {
  642. if (type == "goods") {
  643. uni.navigateTo({
  644. url: "/pages/product/goods/goods?id=" + id + "&shopid=" + shopid,
  645. });
  646. }
  647. else if (type == "service") {
  648. uni.navigateTo({
  649. url: "/pages/product/goods/serviceGood?id=" + id
  650. });
  651. }
  652. else if (type == "url") {
  653. uni.navigateTo({
  654. url: "/pages/index/webView?linkUrl=" + url,
  655. });
  656. }
  657. },
  658. goDetail(url, isNeedLogin) {
  659. if ((isNeedLogin && uni.getStorageSync("apiToken") == "") || null) {
  660. this.$mUtil.toast("请先登录");
  661. return false;
  662. }
  663. uni.navigateTo({
  664. url: url,
  665. });
  666. },
  667. /**重置数据*/
  668. rest() {
  669. this.goodsList = [];
  670. this.currSeckill = [];
  671. this.shopBanner = [];
  672. this.recommendList = [];
  673. this.newsList = [];
  674. this.hotList = [];
  675. this.groupList = [];
  676. },
  677. },
  678. };
  679. </script>
  680. <style scoped lang="scss">
  681. .swiper{
  682. /deep/ .uni-swiper-dot{
  683. width: 40rpx !important;
  684. height: 8rpx;
  685. border-radius: 5rpx !important;
  686. background-color: #ffffff !important;
  687. opacity: 0.5;
  688. }
  689. /deep/ .uni-swiper-dot-active{
  690. background-color: #ffffff !important;
  691. opacity: 1;
  692. }
  693. }
  694. /deep/.hx-navbar__content__main_search_hxicon{
  695. span{
  696. font-size: 30rpx;
  697. }
  698. }
  699. /deep/.uni-input-placeholder{
  700. background-color: #4A705D;
  701. color: #193E2C !important;
  702. font-size: 22rpx;
  703. }
  704. /deep/.hx-navbar__content__main_search_input{
  705. background-color: #4A705E;
  706. }
  707. .bannersize {
  708. display: block;
  709. border-radius: 20rpx;
  710. overflow: hidden;
  711. width: 100%;
  712. height: 340rpx;
  713. }
  714. .guess {
  715. margin: 0 30rpx;
  716. .guess-item {
  717. display: flex;
  718. justify-content: space-around;
  719. flex-wrap: wrap;
  720. .item {
  721. margin-bottom: 36rpx;
  722. border-radius: 18rpx;
  723. background-color: #ffffff;
  724. border-radius: 18rpx;
  725. overflow: hidden;
  726. image {
  727. width: 336rpx;
  728. height: 336rpx;
  729. }
  730. .name {
  731. margin: 6rpx 20rpx;
  732. width: 296rpx;
  733. height: 80rpx;
  734. overflow: hidden;
  735. text-overflow: ellipsis;
  736. display: -webkit-box;
  737. -webkit-line-clamp: 2;
  738. -webkit-box-orient: vertical;
  739. word-wrap: break-word;
  740. word-break: break-all;
  741. white-space: normal !important;
  742. }
  743. .number {
  744. display: flex;
  745. align-items: flex-end;
  746. // padding-bottom: 40rpx;
  747. margin: 0 20rpx;
  748. .number-red {
  749. color: #ed3d07;
  750. font-size: 36rpx;
  751. font-weight: 500;
  752. text {
  753. font-size: 36rpx;
  754. font-weight: Bold;
  755. }
  756. }
  757. .number-grey {
  758. color: #999999;
  759. font-size: 22rpx;
  760. font-weight: 400;
  761. text-decoration: line-through;
  762. margin-left: 16rpx;
  763. }
  764. }
  765. }
  766. }
  767. .guess-top {
  768. display: flex;
  769. align-items: center;
  770. margin-bottom: 24rpx;
  771. .guess-left {
  772. font-size: 36rpx;
  773. color: #1a1a1a;
  774. font-weight: Bold;
  775. line-height: 30rpx;
  776. }
  777. .guess-line {
  778. width: 1rpx;
  779. height: 32rpx;
  780. background-color: #707070;
  781. margin: 0 16rpx;
  782. }
  783. .guess-right {
  784. font-size: 24rpx;
  785. color: #666666;
  786. font-weight: Regular;
  787. line-height: 24rpx;
  788. }
  789. }
  790. }
  791. .new-products {
  792. margin: 50rpx 30rpx;
  793. .new-list {
  794. display: flex;
  795. overflow: scroll;
  796. white-space: nowrap;
  797. .item {
  798. margin-right: 20rpx;
  799. margin-top: 28rpx;
  800. margin-bottom: 28rpx;
  801. text-align: center;
  802. image {
  803. border: 1rpx solid #e6e6e6;
  804. width: 172rpx;
  805. height: 172rpx;
  806. }
  807. .list-num {
  808. margin-top: 16rpx;
  809. font-size: 36rpx;
  810. line-height: 24rpx;
  811. color: #ff0000;
  812. font-weight: Bold;
  813. text {
  814. font-size: 32rpx;
  815. }
  816. }
  817. }
  818. }
  819. .montn-scroll {
  820. margin: 0 auto;
  821. border-radius: 6rpx;
  822. width: 124rpx;
  823. height: 14rpx;
  824. background-color: #dddddd;
  825. border-radius: 7rpx;
  826. text-align: center;
  827. .montn-red {
  828. width: 50rpx;
  829. border-radius: 6rpx;
  830. height: 14rpx;
  831. background-color: #ff0000;
  832. }
  833. }
  834. .month-list {
  835. // display: flex;
  836. // overflow: scroll;
  837. // white-space: nowrap;
  838. position: relative;
  839. padding-bottom: 20rpx;
  840. height:350rpx;
  841. /deep/ uni-swiper{
  842. height: 350rpx;
  843. }
  844. .item {
  845. margin: 28rpx 20rpx 28rpx 0;
  846. text-align: center; height: 350rpx;
  847. image {
  848. width: 216rpx;
  849. height: 216rpx;
  850. border-radius: 16rpx;
  851. }
  852. .list-num {
  853. margin-top: 16rpx;
  854. font-size: 36rpx;
  855. line-height: 24rpx;
  856. color: #ff0000;
  857. font-weight: bold;
  858. text {
  859. font-size: 32rpx;
  860. }
  861. }
  862. .sold {
  863. font-size: 22rpx;
  864. font-weight: Medium;
  865. line-height: 24rpx;
  866. color: #999999;
  867. margin-top: 8rpx;
  868. }
  869. }
  870. }
  871. .new-top {
  872. display: flex;
  873. align-items: center;
  874. .new-left {
  875. font-size: 36rpx;
  876. color: #1a1a1a;
  877. font-weight: Bold;
  878. line-height: 30rpx;
  879. }
  880. .new-line {
  881. width: 1rpx;
  882. height: 33rpx;
  883. background-color: #707070;
  884. margin: 0 16rpx;
  885. }
  886. .new-right {
  887. font-size: 24rpx;
  888. color: #666666;
  889. font-weight: Regular;
  890. line-height: 24rpx;
  891. }
  892. }
  893. }
  894. .slide-box{
  895. display: flex;
  896. justify-content: center;
  897. }
  898. .dotBox {
  899. // position: absolute;
  900. // bottom: 0rpx;
  901. // left: 50%;
  902. // margin: 0 auto;
  903. height: 14rpx;
  904. overflow: hidden;
  905. border-radius: 14rpx;
  906. background-color: #ccc;
  907. display: flex;
  908. justify-content: center;
  909. .dotBox_item {
  910. width: 45rpx;
  911. height: 14rpx;
  912. border-radius: 2rpx;
  913. background-color: #ccc;
  914. transition: all 0.5s;
  915. }
  916. .active_dotBox {
  917. width: 45rpx;
  918. background: rgba(254, 70, 3, 1);
  919. transition: all 0.5s;
  920. }
  921. }
  922. .hot {
  923. margin: 0 30rpx;
  924. .hot-item {
  925. display: flex;
  926. overflow: scroll;
  927. white-space: nowrap;
  928. .hot-number {
  929. display: flex;
  930. align-items: flex-end;
  931. margin-top: 10rpx;
  932. }
  933. .hot-large {
  934. color: #ff0000;
  935. font-size: 36rpx;
  936. font-weight: Bold;
  937. line-height: 24rpx;
  938. text {
  939. font-size: 36rpx;
  940. margin-left: 10rpx;
  941. }
  942. }
  943. .hot-small {
  944. font-size: 22rpx;
  945. font-weight: Medium;
  946. line-height: 24rpx;
  947. color: #cccccc;
  948. margin-left: 16rpx;
  949. }
  950. .hot-introduce {
  951. overflow: hidden;
  952. white-space: normal;
  953. word-break: break-all;
  954. margin-top: 24rpx;
  955. // width: 240rpx;
  956. font-size: 24rpx;
  957. height: 74rpx;
  958. font-weight: Regular;
  959. line-height: 34rpx;
  960. color: #333333; overflow: hidden;
  961. text-overflow: ellipsis;
  962. display: -webkit-box;
  963. -webkit-line-clamp: 2;
  964. -webkit-box-orient: vertical;
  965. word-wrap: break-word;
  966. word-break: break-all;
  967. white-space: normal !important;
  968. }
  969. .item {
  970. padding: 20rpx;
  971. background-color: #ffffff;
  972. border-radius: 16rpx;
  973. margin-right: 20rpx;
  974. }
  975. display: flex;
  976. margin-top: 27rpx;
  977. image {
  978. width: 252rpx;
  979. height: 252rpx;
  980. border-radius: 16rpx;
  981. }
  982. }
  983. .hot-top {
  984. display: flex;
  985. align-items: center;
  986. .hot-left {
  987. font-size: 36rpx;
  988. font-weight: Bold;
  989. color: #1a1a1a;
  990. line-height: 30rpx;
  991. }
  992. .hot-body {
  993. width: 1rpx;
  994. height: 32rpx;
  995. background-color: #707070;
  996. margin: 0 16rpx 0 14rpx;
  997. }
  998. .hot-right {
  999. font-size: 24rpx;
  1000. font-weight: Regular;
  1001. line-height: 24rpx;
  1002. color: #666666;
  1003. }
  1004. }
  1005. }
  1006. .middle:last-child {
  1007. border: none;
  1008. }
  1009. .middle {
  1010. display: flex;
  1011. border-bottom: 1rpx solid #e6e6e6;
  1012. padding-bottom: 40rpx;
  1013. padding-top: 42rpx;
  1014. .middle-left {
  1015. margin-right: 20rpx;
  1016. image {
  1017. width: 226rpx;
  1018. height: 226rpx;
  1019. border-radius: 10rpx;
  1020. }
  1021. }
  1022. .middle-right {
  1023. width: 100%;
  1024. display: flex;
  1025. flex-direction: column;
  1026. justify-content: space-between;
  1027. margin-top: 10rpx;
  1028. .middle-title {
  1029. font-size: 28rpx;
  1030. margin-top: 10rpx;
  1031. color: #181818;
  1032. font-weight: 400;
  1033. line-height: 36rpx;
  1034. }
  1035. .division {
  1036. display: flex;
  1037. // margin-top: 60rpx;
  1038. width: 100%;
  1039. padding-bottom: 10rpx;
  1040. justify-content: space-between;
  1041. }
  1042. .middle-num {
  1043. flex: 1;
  1044. .contain {
  1045. display: flex;
  1046. align-items: flex-end;
  1047. }
  1048. .three {
  1049. font-size: 24rpx;
  1050. font-weight: Regular;
  1051. color: #333333;
  1052. line-height: 24rpx;
  1053. margin-top: 8rpx;
  1054. }
  1055. .large {
  1056. color: #ff0000;
  1057. font-size: 36rpx;
  1058. font-weight: Bold;
  1059. line-height: 24rpx;
  1060. text {
  1061. font-size: 36rpx;
  1062. }
  1063. }
  1064. .small {
  1065. margin-left: 16rpx;
  1066. font-size: 22rpx;
  1067. font-weight: 500;
  1068. color: #cccccc;
  1069. line-height: 24rpx;
  1070. text-decoration: line-through;
  1071. }
  1072. }
  1073. .button {
  1074. padding: 10rpx 25rpx;
  1075. color: #d5c49b;
  1076. font-size: 28rpx;
  1077. font-weight: Medium;
  1078. background-color: #0B844A;
  1079. border-radius: 32rpx;
  1080. }
  1081. }
  1082. }
  1083. .group-work {
  1084. margin: 50rpx 30rpx;
  1085. border-radius: 16rpx;
  1086. background-color: #ffffff;
  1087. padding: 30rpx;
  1088. .work-top {
  1089. padding-bottom: 20rpx;
  1090. margin-bottom: 10rpx;
  1091. display: flex;
  1092. justify-content: space-between;
  1093. align-items: center;
  1094. border-bottom: 1rpx solid #e6e6e6;
  1095. .top-left {
  1096. font-size: 36rpx;
  1097. font-weight: Bold;
  1098. color: #1a1a1a;
  1099. line-height: 30rpx;
  1100. }
  1101. .top-right {
  1102. color: #333333;
  1103. font-size: 24rpx;
  1104. font-weight: Regular;
  1105. .iconfont {
  1106. color: #666666;
  1107. }
  1108. }
  1109. }
  1110. }
  1111. .seckill {
  1112. margin: 50rpx 30rpx;
  1113. .seckill-item {
  1114. border-radius: 16rpx;
  1115. .scroll {
  1116. margin: 26rpx auto 26rpx auto;
  1117. width: 124rpx;
  1118. height: 14rpx;
  1119. background-color: #ededed;
  1120. border-radius: 8rpx;
  1121. .scroll-red {
  1122. width: 50rpx;
  1123. height: 14rpx;
  1124. background-color: red;
  1125. border-radius: 8rpx;
  1126. }
  1127. }
  1128. background-color: #ffffff;
  1129. padding: 0 28rpx 26rpx 28rpx;
  1130. .option {
  1131. // display: flex;
  1132. position: relative;
  1133. // padding: 12rpx 20rpx;
  1134. margin-top: 20rpx;
  1135. /deep/ .uni-swiper-slide-frame {
  1136. width: 26% !important;
  1137. }
  1138. .option-item {
  1139. margin-right: 22rpx;
  1140. image {
  1141. width: 140rpx;
  1142. height: 140rpx;
  1143. }
  1144. .number {
  1145. margin-top: 4rpx;
  1146. text-align: center;
  1147. font-size: 36rpx;
  1148. font-weight: Bold;
  1149. line-height: 24rpx;
  1150. color: #333333;
  1151. text {
  1152. font-size: 28rpx;
  1153. font-weight: Medium;
  1154. }
  1155. }
  1156. }
  1157. }
  1158. .seckill-top {
  1159. padding: 24rpx 0;
  1160. display: flex;
  1161. align-items: center;
  1162. border-bottom: 1rpx solid #e6e6e6;
  1163. .left {
  1164. font-size: 36rpx;
  1165. font-weight: Bold;
  1166. color: #1a1a1a;
  1167. margin-right: 14rpx;
  1168. }
  1169. .line {
  1170. width: 1rpx;
  1171. height: 32rpx;
  1172. background-color: #707070;
  1173. }
  1174. .time {
  1175. margin-left: 16rpx;
  1176. color: #666666;
  1177. font-size: 24rpx;
  1178. font-weight: Regular;
  1179. }
  1180. .reciprocal {
  1181. color: #ffffff;
  1182. padding: 0 14rpx;
  1183. background-color: #ff0000;
  1184. font-size: 24rpx;
  1185. font-weight: Bold;
  1186. border-radius: 16rpx;
  1187. margin-left: 30rpx;
  1188. }
  1189. }
  1190. }
  1191. }
  1192. .advertisement {
  1193. margin: 50rpx 30rpx;
  1194. image {
  1195. width: 690rpx;
  1196. height: 156rpx;
  1197. border-radius: 28rpx;
  1198. }
  1199. }
  1200. .list {
  1201. margin: 44rpx 30rpx;
  1202. display: flex;
  1203. justify-content: space-between;
  1204. .item {
  1205. text-align: center;
  1206. image {
  1207. width: 100rpx;
  1208. height: 100rpx;
  1209. }
  1210. }
  1211. }
  1212. .item-red {
  1213. background: #f76260;
  1214. color: #fff;
  1215. }
  1216. .item-green {
  1217. background: #09bb07;
  1218. color: #fff;
  1219. }
  1220. .item-blue {
  1221. background: #007aff;
  1222. color: #fff;
  1223. }
  1224. .swiper {
  1225. margin: 30rpx;
  1226. }
  1227. .index {
  1228. position: relative;
  1229. background-color: #eeeeee;
  1230. overflow-x: hidden;
  1231. .top {
  1232. position: absolute;
  1233. top: 0;
  1234. left: -13%;
  1235. width: 126%;
  1236. overflow-x: hidden;
  1237. height: 400rpx;
  1238. border-radius: 0 0 50% 50%;
  1239. background-color: rgba(0, 50, 30, 1);
  1240. }
  1241. }
  1242. .iconfont {
  1243. position: relative;
  1244. }
  1245. .num {
  1246. position: absolute;
  1247. top: -20rpx;
  1248. left: -20rpx;
  1249. background-color: #ff0000;
  1250. padding: 2rpx 10rpx;
  1251. border-radius: 14rpx;
  1252. font-size: 20rpx;
  1253. font-weight: 400;
  1254. color: #ffffff;
  1255. }
  1256. .uni-margin-wrap {
  1257. width: 690rpx;
  1258. }
  1259. .swiper {
  1260. height: 340rpx;
  1261. }
  1262. .swiper-item {
  1263. display: block;
  1264. height: 300rpx;
  1265. line-height: 300rpx;
  1266. text-align: center;
  1267. border-radius: 20rpx;
  1268. }
  1269. .swiper-list {
  1270. margin-top: 40rpx;
  1271. margin-bottom: 0;
  1272. }
  1273. .uni-common-mt {
  1274. margin-top: 60rpx;
  1275. position: relative;
  1276. }
  1277. .info {
  1278. position: absolute;
  1279. right: 20rpx;
  1280. }
  1281. .uni-padding-wrap {
  1282. width: 550rpx;
  1283. padding: 0 100rpx;
  1284. }
  1285. </style>