index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. <!-- 首页 -->
  2. <template>
  3. <view class="wrap">
  4. <view class="header">
  5. <view class="header-top">
  6. <view class="header-left">
  7. <image src="../../static/logo.jpeg" mode="widthFix"></image>
  8. <view class="header-left-column">
  9. <text>药食同源</text>
  10. <text>康养食品</text>
  11. </view>
  12. </view>
  13. <view class="headr-title">
  14. <image src="../../static/index-title.png" mode="widthFix"></image>
  15. </view>
  16. <view class="header-right">
  17. <button type="default" @tap="videoColumn">
  18. <image src="../../static/head-icon1.png" mode="widthFix"></image>
  19. </button>
  20. <button type="default" @tap="show">
  21. <image src="../../static/head-icon2.png" mode="widthFix"></image>
  22. </button>
  23. </view>
  24. </view>
  25. <view class="header-bottom">
  26. <view class="location-row" @tap="city">
  27. <image src="../../static/location-1.png" class="location-icon" mode="widthFix"></image>
  28. 嘉兴
  29. </view>
  30. <view class="search-bar">
  31. <image src="../../static/search-icon.png" mode="" class="search-icon"></image>
  32. <input type="text" value="" placeholder="西藏冬虫夏草 大红袍" placeholder-class="placeholder"
  33. class="search-input" @tap="search" />
  34. <button type="default" class="search-btn">搜索</button>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="padding-box">
  39. <view class="swiper-box">
  40. <swiper class="swiper" indicator-dots="true" indicator-color="#F2F2F2" indicator-active-color="#F2501A"
  41. :circular="true" autoplay="true" interval="3000" duration="500">
  42. <swiper-item v-for="(item,index) in swiperList" :key="index">
  43. <view class="swiper-item">
  44. <image :src="item.cover" class="banner-img" mode="aspectFill" />
  45. </view>
  46. </swiper-item>
  47. </swiper>
  48. </view>
  49. <view class="notice-box">
  50. <uni-notice-bar class="my-notice-bar" :scrollable="true" :speed="50" :single="true" :text="message">
  51. </uni-notice-bar>
  52. <image src="../../static/message.png" class="notice-icon" mode=""></image>
  53. </view>
  54. <view class="menu-list">
  55. <view class="menu-item" v-for="(item, index) in menuList" @tap="raiseFiveInternalOrgans(item.id)">
  56. <image :src="item.logo" mode="heightFix"></image>
  57. {{item.name}}
  58. </view>
  59. <!-- <view class="menu-item" @tap="raiseFiveInternalOrgans">
  60. <image src="../../static/index-menu1.png" mode="heightFix"></image>
  61. 养五脏
  62. </view>
  63. <view class="menu-item" @tap="regulateSixBowels">
  64. <image src="../../static/index-menu2.png" mode="heightFix"></image>
  65. 调六腑
  66. </view>
  67. <view class="menu-item">
  68. <image src="../../static/index-menu3.png" mode="heightFix"></image>
  69. 健五官
  70. </view>
  71. <view class="menu-item">
  72. <image src="../../static/index-menu4.png" mode="heightFix"></image>
  73. 通经络
  74. </view>
  75. <view class="menu-item">
  76. <image src="../../static/index-menu5.png" mode="heightFix"></image>
  77. 强筋骨
  78. </view>
  79. <view class="menu-item">
  80. <image src="../../static/index-menu6.png" mode="heightFix"></image>
  81. 提免疫
  82. </view>
  83. <view class="menu-item">
  84. <image src="../../static/index-menu7.png" mode="heightFix"></image>
  85. 均营养
  86. </view>
  87. <view class="menu-item">
  88. <image src="../../static/index-menu8.png" mode="heightFix"></image>
  89. 促健康
  90. </view>
  91. <view class="menu-item">
  92. <image src="../../static/index-menu9.png" mode="heightFix"></image>
  93. 舒压力
  94. </view>
  95. <view class="menu-item">
  96. <image src="../../static/index-menu10.png" mode="heightFix"></image>
  97. 增颜值
  98. </view> -->
  99. </view>
  100. <scroll-view scroll-x="true" class="recommend-box">
  101. <view class="recommend-item" @tap="goodAualityWork">
  102. <view class="recommend-item-column">
  103. <text>品质良作</text>
  104. <text>区域环境</text>
  105. </view>
  106. <image src="../../static/img-1.png" class="recommend-item-img" mode="widthFix"></image>
  107. </view>
  108. <view class="recommend-item" @tap="goodAualityWork">
  109. <view class="recommend-item-column">
  110. <text>时令良作</text>
  111. <text>优质品种</text>
  112. </view>
  113. <image src="../../static/img-2.png" class="recommend-item-img" mode="widthFix"></image>
  114. </view>
  115. <view class="recommend-item" @tap="goodAualityWork">
  116. <view class="recommend-item-column">
  117. <text>膳食良作</text>
  118. <text>千年传承</text>
  119. </view>
  120. <image src="../../static/img-3.png" class="recommend-item-img" mode="widthFix"></image>
  121. </view>
  122. </scroll-view>
  123. <view class="swiper-box">
  124. <swiper class="swiper" indicator-dots="true" indicator-color="#F2F2F2" indicator-active-color="#F2501A"
  125. :circular="true" autoplay="true" interval="2500" duration="500">
  126. <swiper-item v-for="(item,index) in swiperList2" :key="index">
  127. <view class="swiper-item">
  128. <image :src="item.cover" class="banner-img" mode="aspectFill" />
  129. </view>
  130. </swiper-item>
  131. </swiper>
  132. </view>
  133. <view class="tag-box">
  134. <view class="tag-list">
  135. <view class="tag-item">
  136. # 经常熬夜该吃的食物
  137. </view>
  138. <view class="tag-item">
  139. # 经常熬夜该吃的食物
  140. </view>
  141. <view class="tag-item">
  142. # 经常熬夜该吃的食物
  143. </view>
  144. <view class="tag-item">
  145. # 经常熬夜该吃的食物
  146. </view>
  147. </view>
  148. <view class="refresh-row">
  149. <image src="../../static/refresh-icon.png" mode=""></image>
  150. 换一批
  151. </view>
  152. </view>
  153. <view class="classification-module-box">
  154. <view class="classification-module" @tap="subHealthPool">
  155. <view class="classification-module-top">
  156. <view class="classification-module-name">亚健康汇</view>
  157. </view>
  158. <view class="classification-module-msg">今日狂补·口碑爆款</view>
  159. <view class="classification-list">
  160. <view class="classification-item">
  161. <image src="../../static/index-menu1.png" class="classification-item-img" mode="heightFix">
  162. </image>
  163. 新鲜奶莓
  164. </view>
  165. <view class="classification-item">
  166. <image src="../../static/index-menu8.png" class="classification-item-img" mode="heightFix">
  167. </image>
  168. 烟台苹果
  169. </view>
  170. </view>
  171. </view>
  172. <view class="classification-module" @tap="giftChoice">
  173. <view class="classification-module-top">
  174. <view class="classification-module-name">礼品心选</view>
  175. <view class="classification-module-tag">
  176. <image src="../../static/tag-icon1.png" mode="widthFix"></image>
  177. 用心挑选
  178. </view>
  179. </view>
  180. <view class="classification-module-msg">送家人·送爸妈</view>
  181. <view class="classification-list">
  182. <view class="classification-item">
  183. <image src="../../static/index-menu10.png" class="classification-item-img" mode="heightFix">
  184. </image>
  185. 新鲜奶莓
  186. </view>
  187. <view class="classification-item">
  188. <image src="../../static/index-menu2.png" class="classification-item-img" mode="heightFix">
  189. </image>
  190. 烟台苹果
  191. </view>
  192. </view>
  193. </view>
  194. <view class="classification-module" @tap="promotionalPicks">
  195. <view class="classification-module-top">
  196. <view class="classification-module-name">促销精选</view>
  197. <view class="classification-module-tag">
  198. <image src="../../static/tag-icon2.png" mode="widthFix"></image>
  199. 限时折扣
  200. </view>
  201. </view>
  202. <view class="classification-module-msg">精品促销·优惠不断</view>
  203. <view class="classification-list">
  204. <view class="classification-item">
  205. <image src="../../static/index-menu6.png" class="classification-item-img" mode="heightFix">
  206. </image>
  207. <view class="classification-item-bottom">
  208. <text class="classification-item-price">¥34.00</text>
  209. <button type="default" class="add-btn">
  210. <image src="../../static/add-icon.png" mode=""></image>
  211. </button>
  212. </view>
  213. </view>
  214. <view class="classification-item">
  215. <image src="../../static/index-menu5.png" class="classification-item-img" mode="heightFix">
  216. </image>
  217. <view class="classification-item-bottom">
  218. <text class="classification-item-price">¥34.00</text>
  219. <button type="default" class="add-btn">
  220. <image src="../../static/add-icon.png" mode=""></image>
  221. </button>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. <view class="classification-module" @tap="limitedSourcePreSale">
  227. <view class="classification-module-top">
  228. <view class="classification-module-name">限源预售</view>
  229. </view>
  230. <view class="classification-module-msg">精彩预售·抢不停</view>
  231. <view class="classification-list">
  232. <view class="classification-item">
  233. <image src="../../static/index-menu4.png" class="classification-item-img" mode="heightFix">
  234. </image>
  235. <view class="classification-item-bottom">
  236. <text class="classification-item-price">¥34.00</text>
  237. <button type="default" class="add-btn">
  238. <image src="../../static/add-icon.png" mode=""></image>
  239. </button>
  240. </view>
  241. </view>
  242. <view class="classification-item">
  243. <image src="../../static/index-menu3.png" class="classification-item-img" mode="heightFix">
  244. </image>
  245. <view class="classification-item-bottom">
  246. <text class="classification-item-price">¥34.00</text>
  247. <button type="default" class="add-btn">
  248. <image src="../../static/add-icon.png" mode=""></image>
  249. </button>
  250. </view>
  251. </view>
  252. </view>
  253. </view>
  254. </view>
  255. <view class="seasonal-nutrition-box" @tap="seasonalNutrition">
  256. <view class="seasonal-nutrition-top">
  257. <view class="seasonal-nutrition-top-left">
  258. <view class="seasonal-nutrition-top-name">
  259. 时令营养
  260. </view>
  261. <view class="seasonal-nutrition-top-msg">
  262. 滋补免疫推荐
  263. </view>
  264. </view>
  265. <button type="default" class="all-btn">全部</button>
  266. </view>
  267. <view class="swiper-box-product">
  268. <swiper class="swiper-product" indicator-dots="true" indicator-color="#F2F2F2"
  269. indicator-active-color="#F2501A" :circular="true" interval="3000" duration="500">
  270. <swiper-item>
  271. <view class="swiper-item-product">
  272. <view class="swiper-item-product-item">
  273. <image src="../../static/img-4.png" class="swiper-item-product-item-img"
  274. mode="aspectFill"></image>
  275. <view class="swiper-item-product-item-name">
  276. 补气养阴
  277. </view>
  278. <view class="swiper-item-product-item-msg">
  279. 杞里香枸杞子宁夏特级500g
  280. </view>
  281. <view class="swiper-item-product-item-bottom">
  282. <view class="swiper-item-product-item-price">
  283. ¥394.00
  284. </view>
  285. <view class="swiper-item-product-item-delprice">
  286. ¥34.00
  287. </view>
  288. </view>
  289. </view>
  290. <view class="swiper-item-product-item">
  291. <image src="../../static/img-4.png" class="swiper-item-product-item-img"
  292. mode="aspectFill"></image>
  293. <view class="swiper-item-product-item-name">
  294. 补气养阴
  295. </view>
  296. <view class="swiper-item-product-item-msg">
  297. 杞里香枸杞子宁夏特级500g
  298. </view>
  299. <view class="swiper-item-product-item-bottom">
  300. <view class="swiper-item-product-item-price">
  301. ¥394.00
  302. </view>
  303. <view class="swiper-item-product-item-delprice">
  304. ¥34.00
  305. </view>
  306. </view>
  307. </view>
  308. <view class="swiper-item-product-item">
  309. <image src="../../static/img-4.png" class="swiper-item-product-item-img"
  310. mode="aspectFill"></image>
  311. <view class="swiper-item-product-item-name">
  312. 补气养阴
  313. </view>
  314. <view class="swiper-item-product-item-msg">
  315. 杞里香枸杞子宁夏特级500g
  316. </view>
  317. <view class="swiper-item-product-item-bottom">
  318. <view class="swiper-item-product-item-price">
  319. ¥394.00
  320. </view>
  321. <view class="swiper-item-product-item-delprice">
  322. ¥34.00
  323. </view>
  324. </view>
  325. </view>
  326. </view>
  327. </swiper-item>
  328. <swiper-item>
  329. <view class="swiper-item-product">
  330. <view class="swiper-item-product-item">
  331. <image src="../../static/img-4.png" class="swiper-item-product-item-img"
  332. mode="aspectFill"></image>
  333. <view class="swiper-item-product-item-name">
  334. 补气养阴
  335. </view>
  336. <view class="swiper-item-product-item-msg">
  337. 杞里香枸杞子宁夏特级500g
  338. </view>
  339. <view class="swiper-item-product-item-bottom">
  340. <view class="swiper-item-product-item-price">
  341. ¥394.00
  342. </view>
  343. <view class="swiper-item-product-item-delprice">
  344. ¥34.00
  345. </view>
  346. </view>
  347. </view>
  348. <view class="swiper-item-product-item">
  349. <image src="../../static/img-4.png" class="swiper-item-product-item-img"
  350. mode="aspectFill"></image>
  351. <view class="swiper-item-product-item-name">
  352. 补气养阴
  353. </view>
  354. <view class="swiper-item-product-item-msg">
  355. 杞里香枸杞子宁夏特级500g
  356. </view>
  357. <view class="swiper-item-product-item-bottom">
  358. <view class="swiper-item-product-item-price">
  359. ¥394.00
  360. </view>
  361. <view class="swiper-item-product-item-delprice">
  362. ¥34.00
  363. </view>
  364. </view>
  365. </view>
  366. <view class="swiper-item-product-item">
  367. <image src="../../static/img-4.png" class="swiper-item-product-item-img"
  368. mode="aspectFill"></image>
  369. <view class="swiper-item-product-item-name">
  370. 补气养阴
  371. </view>
  372. <view class="swiper-item-product-item-msg">
  373. 杞里香枸杞子宁夏特级500g
  374. </view>
  375. <view class="swiper-item-product-item-bottom">
  376. <view class="swiper-item-product-item-price">
  377. ¥394.00
  378. </view>
  379. <view class="swiper-item-product-item-delprice">
  380. ¥34.00
  381. </view>
  382. </view>
  383. </view>
  384. </view>
  385. </swiper-item>
  386. </swiper>
  387. </view>
  388. </view>
  389. <view class="seasonal-health-box" @tap="seasonalHealthyFood">
  390. <view class="seasonal-health-top">
  391. <view class="seasonal-health-top-left">
  392. <view class="seasonal-health-top-name">
  393. 时令健康
  394. </view>
  395. <view class="seasonal-health-top-msg">
  396. 养生食品推荐
  397. </view>
  398. </view>
  399. <image src="../../static/bg-4.png" class="seasonal-health-top-bg" mode="heightFix"></image>
  400. <button type="default" class="seasonal-health-all-btn" >全部</button>
  401. </view>
  402. <view class="seasonal-health-list">
  403. <view class="seasonal-health-item">
  404. <image src="../../static/img-4.png" class="seasonal-health-item-img" mode="aspectFill"></image>
  405. <view class="seasonal-health-item-name">
  406. 健脾除湿
  407. </view>
  408. </view>
  409. <view class="seasonal-health-item">
  410. <image src="../../static/img-4.png" class="seasonal-health-item-img" mode="aspectFill"></image>
  411. <view class="seasonal-health-item-name">
  412. 排寒利尿
  413. </view>
  414. </view>
  415. <view class="seasonal-health-item">
  416. <image src="../../static/img-4.png" class="seasonal-health-item-img" mode="aspectFill"></image>
  417. <view class="seasonal-health-item-name">
  418. 平肝和胃
  419. </view>
  420. </view>
  421. </view>
  422. </view>
  423. <view class="logo-box">
  424. <image src="../../static/banner-4.png" mode="widthFix"></image>
  425. </view>
  426. <view class="product-bottom">
  427. <scroll-view scroll-x="true" class="tab-list">
  428. <view :class="{ 'active' : isActive === index }" class="child" v-for="(item,index) in navList"
  429. :key="index" @click="checked(index)">
  430. <view class="child-column">
  431. <view class="child-column-name">{{item.title}}</view>
  432. <view class="child-column-msg">
  433. <text>{{item.msg}}</text>
  434. <image src="../../static/border.png" class="border-img" mode="widthFix"></image>
  435. </view>
  436. </view>
  437. </view>
  438. </scroll-view>
  439. <!-- <view class="product-list">
  440. <view class="product-item">
  441. <view class="product-item-column">
  442. <image src="../../static/img-4.png" class="product-item-column-img" mode="aspectFill"></image>
  443. <view class="product-item-column-bottom">
  444. <view class="product-item-column-name">产地直销</view>
  445. <view class="product-item-column-tag">
  446. <text>当日热卖榜</text>
  447. <text>好货闭眼抢</text>
  448. </view>
  449. <button type="default" class="product-item-column-btn">立即抢购<image src="../../static/back-icon.png" mode="widthFix"></image></button>
  450. </view>
  451. </view>
  452. </view>
  453. <view class="product-item" @tap="productDetails">
  454. <view class="product-item-column2">
  455. <image src="../../static/img-4.png" class="product-item-column2-img" mode="aspectFill"></image>
  456. <view class="product-item-column2-bottom">
  457. <view class="product-item-column-name2">冻干柠檬片 蜂蜜柠檬茶 保留鲜度96% 美白神器</view>
  458. <view class="product-item-column2-row-between">
  459. <view class="product-item-column2-price">
  460. ¥394.00
  461. <text>¥34.00</text>
  462. </view>
  463. <button type="default" class="product-item-column2-btn">
  464. <image src="../../static/add-icon.png" mode=""></image>
  465. </button>
  466. </view>
  467. </view>
  468. </view>
  469. </view>
  470. <view class="product-item">
  471. <view class="product-item-column">
  472. <image src="../../static/img-4.png" class="product-item-column-img" mode="aspectFill"></image>
  473. <view class="product-item-column-bottom">
  474. <view class="product-item-column-name">产地直销</view>
  475. <view class="product-item-column-tag">
  476. <text>当日热卖榜</text>
  477. <text>好货闭眼抢</text>
  478. </view>
  479. <button type="default" class="product-item-column-btn">立即抢购<image src="../../static/back-icon.png" mode="widthFix"></image></button>
  480. </view>
  481. </view>
  482. </view>
  483. <view class="product-item">
  484. <view class="product-item-column">
  485. <image src="../../static/img-4.png" class="product-item-column-img" mode="aspectFill"></image>
  486. <view class="product-item-column-bottom">
  487. <view class="product-item-column-name">产地直销</view>
  488. <view class="product-item-column-tag">
  489. <text>当日热卖榜</text>
  490. <text>好货闭眼抢</text>
  491. </view>
  492. <button type="default" class="product-item-column-btn">立即抢购<image src="../../static/back-icon.png" mode="widthFix"></image></button>
  493. </view>
  494. </view>
  495. </view>
  496. <view class="product-item" @tap="productDetails">
  497. <view class="product-item-column2">
  498. <image src="../../static/img-4.png" class="product-item-column2-img" mode="aspectFill"></image>
  499. <view class="product-item-column2-bottom">
  500. <view class="product-item-column-name2">冻干柠檬片 蜂蜜柠檬茶 保留鲜度96% 美白神器</view>
  501. <view class="product-item-column2-row-between">
  502. <view class="product-item-column2-price">
  503. ¥394.00
  504. <text>¥34.00</text>
  505. </view>
  506. <button type="default" class="product-item-column2-btn">
  507. <image src="../../static/add-icon.png" mode=""></image>
  508. </button>
  509. </view>
  510. </view>
  511. </view>
  512. </view>
  513. </view> -->
  514. <view class="product-list">
  515. <view class="product-item" v-for="(item,index) in list" @tap.stop="productDetails(item.id)">
  516. <view class="product-item-column2">
  517. <image :src="item.cover" class="product-item-column2-img" mode="aspectFill"></image>
  518. <view class="product-item-column2-bottom">
  519. <view class="product-item-column-name2">{{item.name}}</view>
  520. <view class="product-item-column2-row-between">
  521. <view class="product-item-column2-price">
  522. ¥{{item.low_price}}
  523. <text>¥{{item.low_original}}</text>
  524. </view>
  525. <!-- <button type="default" class="product-item-column2-btn" @tap.stop="addTrolley()">
  526. <image src="../../static/add-icon.png" mode=""></image>
  527. </button> -->
  528. </view>
  529. </view>
  530. </view>
  531. </view>
  532. </view>
  533. </view>
  534. </view>
  535. <!-- 顶部-弹窗 -->
  536. <view v-show="isShow">
  537. <view class="mask" @tap="close"></view>
  538. <view class="window">
  539. <view class="window-item">
  540. <image src="../../static/icon-20.png" mode="widthFix"></image>
  541. 扫一扫
  542. </view>
  543. <view class="window-item">
  544. <image src="../../static/icon-18.png" mode="widthFix"></image>
  545. 分享
  546. </view>
  547. <view class="window-item">
  548. <image src="../../static/icon-19.png" mode="widthFix"></image>
  549. 消息
  550. </view>
  551. </view>
  552. </view>
  553. <!-- 顶部-弹窗 -->
  554. <!-- 底部tabbar组件 -->
  555. <tab-bar :current="0"></tab-bar>
  556. </view>
  557. </template>
  558. <script>
  559. import {
  560. expediteGetBanner,
  561. expediteGetIndexMenu,
  562. expediteGetGoodsList,
  563. informationGetBanner,
  564. trolleyAddTrolley,
  565. } from '../../common/service.js';
  566. import UniNoticeBar from '../../components/uni-notice-bar/uni-notice-bar.vue';
  567. export default {
  568. components: {
  569. UniNoticeBar,
  570. },
  571. data() {
  572. return {
  573. //轮播
  574. swiperList: [],
  575. menuList: [],
  576. //轮播2
  577. swiperList2: [],
  578. //公告
  579. message: '最先上市:西藏冬虫夏草 云南白药 青海牦牛肉',
  580. //选项卡
  581. isActive: 3,
  582. navList: [{
  583. index: 0,
  584. title: '精选',
  585. msg: '为您推荐'
  586. }, {
  587. index: 1,
  588. title: "养生",
  589. msg: '推荐养生'
  590. }, {
  591. index: 2,
  592. title: "滋补",
  593. msg: '滋补清肝'
  594. }, {
  595. index: 3,
  596. title: "养颜",
  597. msg: '补气养颜'
  598. }],
  599. //顶部弹窗
  600. isShow:false,
  601. list: [],
  602. page: 1,
  603. page_num: 20,
  604. }
  605. },
  606. onLoad() {
  607. this.getBanner();
  608. this.getInformationBanner();
  609. this.getIndexMenu();
  610. // this.getGoodsList();
  611. },
  612. onReady() {
  613. let animation = uni.createAnimation({
  614. transformOrigin: "50% 50%",
  615. duration: 900,
  616. timingFunction: "linear",
  617. delay: 0
  618. })
  619. this.animation = animation;
  620. },
  621. methods: {
  622. addTrolley(id){
  623. trolleyAddTrolley();
  624. },
  625. getBanner(){
  626. expediteGetBanner({
  627. // data: { num: 5 },
  628. success: ({code, msg, data}) => {
  629. if (code == 1) {
  630. this.swiperList = data.list;
  631. } else {
  632. uni.showToast({
  633. icon: 'none',
  634. title: msg,
  635. });
  636. }
  637. }
  638. });
  639. },
  640. getInformationBanner(){
  641. informationGetBanner({
  642. // data: { num: 5 },
  643. success: ({code, msg, data}) => {
  644. if (code == 1) {
  645. this.swiperList2 = data.list;
  646. } else {
  647. uni.showToast({
  648. icon: 'none',
  649. title: msg,
  650. });
  651. }
  652. }
  653. });
  654. },
  655. getIndexMenu(){
  656. expediteGetIndexMenu({
  657. // data: { num: 5 },
  658. success: ({code, msg, data}) => {
  659. if (code == 1) {
  660. this.menuList = data;
  661. } else {
  662. uni.showToast({
  663. icon: 'none',
  664. title: msg,
  665. });
  666. }
  667. }
  668. });
  669. },
  670. // 获取列表
  671. getGoodsList() {
  672. const {page, page_num} = this;
  673. expediteGetGoodsList({
  674. data: {
  675. page,
  676. page_num,
  677. },
  678. success: res => {
  679. if (res.code === 1) {
  680. const list = res.data.list;
  681. this.list = page > 1 ? [...this.list, ...list] : list;
  682. if (list.length === 0) {
  683. uni.showToast({
  684. icon: 'none',
  685. title: '没有更多数据了'
  686. });
  687. } else {
  688. this.page = this.page + 1;
  689. }
  690. } else {
  691. uni.showToast({
  692. icon: 'none',
  693. title: res.msg
  694. });
  695. }
  696. },
  697. complete: () => {
  698. this.getDataLoading = false;
  699. uni.stopPullDownRefresh();
  700. }
  701. })
  702. },
  703. /**
  704. * 下拉刷新
  705. */
  706. onPullDownRefresh() {
  707. this.getGoodsList();
  708. },
  709. /**
  710. * 触底加载
  711. */
  712. onReachBottom() {
  713. this.getGoodsList();
  714. },
  715. checked(index) {
  716. this.isActive = index
  717. },
  718. //顶部-弹窗
  719. show() {
  720. this.isShow = true;
  721. },
  722. close() {
  723. this.isShow = false;
  724. },
  725. //跳转搜索页
  726. search(){
  727. uni.navigateTo({
  728. url:'search/search'
  729. })
  730. },
  731. //跳转养五脏
  732. raiseFiveInternalOrgans(){
  733. uni.navigateTo({
  734. url:'raise-five-internal-organs/raise-five-internal-organs'
  735. })
  736. },
  737. //跳转调六腑
  738. regulateSixBowels(){
  739. uni.navigateTo({
  740. url:'regulate-six-bowels/regulate-six-bowels'
  741. })
  742. },
  743. //跳转亚健康汇
  744. subHealthPool(){
  745. uni.navigateTo({
  746. url:'sub-health-pool/sub-health-pool'
  747. })
  748. },
  749. //跳转礼品心选
  750. giftChoice(){
  751. uni.navigateTo({
  752. url:'gift-choice/gift-choice'
  753. })
  754. },
  755. //跳转促销精选
  756. promotionalPicks(){
  757. uni.navigateTo({
  758. url:'promotional-picks/promotional-picks'
  759. })
  760. },
  761. //跳转限源预售
  762. limitedSourcePreSale(){
  763. uni.navigateTo({
  764. url:'limited-source-pre-sale/limited-source-pre-sale'
  765. })
  766. },
  767. //跳转时令健康养生食品
  768. seasonalHealthyFood(){
  769. uni.navigateTo({
  770. url:'seasonal-healthy-food/seasonal-healthy-food'
  771. })
  772. },
  773. //跳转时令营养
  774. seasonalNutrition(){
  775. uni.navigateTo({
  776. url:'seasonal-nutrition/seasonal-nutrition'
  777. })
  778. },
  779. //跳转品质良作
  780. goodAualityWork(){
  781. uni.navigateTo({
  782. url:'good-quality-work/good-quality-work'
  783. })
  784. },
  785. //跳转产品详情
  786. productDetails(id){
  787. uni.navigateTo({
  788. url:'product-details/product-details' + '?id=' + id,
  789. })
  790. },
  791. //跳转选择城市
  792. city(){
  793. uni.navigateTo({
  794. url:'city/city'
  795. })
  796. },
  797. //跳转视频专栏
  798. videoColumn(){
  799. uni.navigateTo({
  800. url:'video-column/video-column'
  801. })
  802. },
  803. }
  804. }
  805. </script>
  806. <style scoped lang="scss">
  807. @import "./index.css";
  808. </style>