gardenItem.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <template>
  2. <view class="garden-item-page">
  3. <view class="report-content">
  4. <view class="home-search">
  5. <view class="search-wrap">
  6. <up-search placeholder="搜索品种" v-model="typeSearch"></up-search>
  7. </view>
  8. </view>
  9. <view class="tips" v-show="panelHeight!==50">
  10. <view class="tips-content">
  11. <view class="line-l"></view>
  12. <image class="down-icon" src="/static/home/down-icon.png" mode=""></image>
  13. 下拉查看溯源报告
  14. <view class="line-r"></view>
  15. </view>
  16. </view>
  17. <view class="swipe-item">
  18. <video class="video-wrap" src="https://birdseye-img.sysuimars.com/temp/5-25lby.mp4" controls></video>
  19. </view>
  20. </view>
  21. <l-floating-panel v-model:height="panelHeight" :anchors="anchors" :defaultAnchor="2" :content-draggable="false">
  22. <view class="panel-content" ref="scrollViewRef">
  23. <view class="panel-title">
  24. <view class="title-l">
  25. <image class="garden-img" :src="`${config.BASIC_IMG}home/garden.png`" mode=""></image>
  26. <view class="title-info">
  27. <view class="title-garden">
  28. 从化荔枝博览园
  29. </view>
  30. <view class="btn-second">
  31. 有味指数
  32. <text>4.5分</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="title-r">
  37. +
  38. <text class="add-text">关注</text>
  39. </view>
  40. </view>
  41. <view class="garden-home" v-show="activeMenu === 0">
  42. <view class="panel-video">
  43. <video class="video-dom" src="https://birdseye-img.sysuimars.com/temp/5-25lby.mp4" controls></video>
  44. </view>
  45. <!-- 果园热卖 -->
  46. <hot-component-vue :isGardeItem="true"></hot-component-vue>
  47. <view class="garden-detail">
  48. <view class="detial-item">
  49. <view class="sub-title">
  50. <view class="line-l"></view>
  51. <view class="title-text">
  52. 果园生态
  53. </view>
  54. <view class="line-r"></view>
  55. </view>
  56. <view class="detail-img">
  57. <up-image class="img-dom" radius="8" src="/static/home/fruit-3.png" mode="widthFix"></up-image>
  58. </view>
  59. </view>
  60. <view class="detial-item">
  61. <view class="sub-title">
  62. <view class="line-l"></view>
  63. <view class="title-text">
  64. 果园生态
  65. </view>
  66. <view class="line-r"></view>
  67. </view>
  68. <view class="detail-img">
  69. <up-image class="img-dom" radius="8" src="/static/home/fruit.png" mode="widthFix"></up-image>
  70. </view>
  71. </view>
  72. <view class="detial-item">
  73. <view class="sub-title">
  74. <view class="line-l"></view>
  75. <view class="title-text">
  76. 果园生态
  77. </view>
  78. <view class="line-r"></view>
  79. </view>
  80. <view class="detail-img">
  81. <up-image class="img-dom" radius="8" src="/static/home/fruit-2.png" mode="widthFix"></up-image>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 好味 -->
  87. <!-- 列表 -->
  88. <view class="discover-content" v-show="activeMenu === 1">
  89. <view class="discover-filter">
  90. <view class="filter-item" :class="{'active': filterIndex === 0}" @click="selectFilter(0)">
  91. 综合
  92. </view>
  93. <view class="filter-item" :class="{'active': filterIndex === 1}" @click="selectFilter(1)">
  94. 价格
  95. </view>
  96. <view class="filter-item" :class="{'active': filterIndex === 2}" @click="selectFilter(2)">
  97. 销量
  98. </view>
  99. </view>
  100. <view class="discover-list">
  101. <view class="list-line">
  102. <view class="list-item" v-for="(item, index) in discoverData" :key="index">
  103. <image class="item-img" :src="item.img" mode=""></image>
  104. <view class="item-desc">
  105. <view class="item-text">
  106. {{item.name}}
  107. </view>
  108. <view class="item-subtext">
  109. <text class="subtext-text">坏单包退</text>
  110. <text class="subtext-text">包邮</text>
  111. </view>
  112. <view class="info-price">
  113. <view class="price-text">
  114. <text class="price-unit">¥</text>{{item.price}}
  115. </view>
  116. <view class="info-sold">
  117. 已售{{item.sold}}
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="bottom-menu">
  127. <view class="menu-item" :class="{'active': activeMenu === 0}" @click="changeMenu(0)">
  128. 首页
  129. </view>
  130. <view class="menu-item" :class="{'active': activeMenu === 1}" @click="changeMenu(1)">
  131. 好味
  132. </view>
  133. </view>
  134. </l-floating-panel>
  135. </view>
  136. </template>
  137. <script setup>
  138. import {
  139. nextTick,
  140. ref
  141. } from 'vue'
  142. import config from "@/api/config.js"
  143. import hotComponentVue from '../hotComponent.vue'
  144. const typeSearch = ref(null)
  145. const {
  146. windowHeight
  147. } = uni.getSystemInfoSync()
  148. const anchors = [
  149. 50,
  150. Math.round(0.5 * windowHeight),
  151. Math.round(0.86 * windowHeight),
  152. ];
  153. const panelHeight = ref(anchors[2]);
  154. const myVideo = ref(null);
  155. const onVideoReady = () => {
  156. myVideo.value.play();
  157. };
  158. const activeMenu = ref(0)
  159. const scrollViewRef = ref(null)
  160. function changeMenu(i) {
  161. activeMenu.value = i
  162. nextTick(() => {
  163. scrollViewRef.value.scrollTo({
  164. top: 0,
  165. duration: 300 // 动画时间(ms)
  166. });
  167. });
  168. }
  169. // 好味
  170. const filterIndex = ref(0)
  171. const activeType = ref(0)
  172. const discoverData = ref([
  173. {
  174. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  175. img: "/static/home/fruit.png",
  176. text: "",
  177. price: '107',
  178. sold: "1250"
  179. },
  180. {
  181. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  182. img: "/static/home/fruit.png",
  183. text: "",
  184. price: '107',
  185. sold: "1250"
  186. },
  187. {
  188. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  189. img: "/static/home/fruit.png",
  190. text: "",
  191. price: '107',
  192. sold: "1250"
  193. },
  194. {
  195. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  196. img: "/static/home/fruit.png",
  197. text: "",
  198. price: '107',
  199. sold: "1250"
  200. }
  201. ])
  202. function selectFilter(i) {
  203. filterIndex.value = i
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .garden-item-page {
  208. width: 100%;
  209. height: 100vh;
  210. .report-content {
  211. width: 100%;
  212. height: calc(100% - 140rpx);
  213. position: relative;
  214. .home-search {
  215. position: absolute;
  216. z-index: 2;
  217. top: 20rpx;
  218. left: 24rpx;
  219. display: flex;
  220. align-items: center;
  221. width: calc(100% - 48rpx);
  222. border: 2rpx solid rgba(255, 255, 255, 0.39);
  223. border-radius: 40rpx;
  224. margin-bottom: 40rpx;
  225. background-color: rgba(0, 0, 0, 0.31);
  226. .search-wrap {
  227. flex: 1;
  228. // padding-left: 22rpx;
  229. ::v-deep {
  230. .u-search {
  231. .u-search__content {
  232. background-color: transparent !important;
  233. .u-search__content__input {
  234. background-color: transparent !important;
  235. }
  236. }
  237. .uni-input-input {
  238. color: rgba(255, 255, 255, 0.8);
  239. }
  240. .u-search__action {
  241. text-align: center;
  242. line-height: 52rpx;
  243. border-radius: 40rpx;
  244. font-size: 28rpx;
  245. background-color: rgba(255, 255, 255, 0.3);
  246. color: rgba(255, 255, 255, 0.3);
  247. margin: 6rpx 8rpx;
  248. width: 112rpx;
  249. height: 52rpx;
  250. }
  251. }
  252. }
  253. }
  254. }
  255. .tips {
  256. position: absolute;
  257. z-index: 2;
  258. top: 110rpx;
  259. left: 0;
  260. color: #FFFFFF;
  261. font-size: 24rpx;
  262. width: 100%;
  263. text-align: center;
  264. .tips-content {
  265. position: relative;
  266. display: flex;
  267. align-items: center;
  268. justify-content: center;
  269. .down-icon {
  270. width: 14rpx;
  271. height: 14rpx;
  272. padding-right: 20rpx;
  273. }
  274. .line-l {
  275. width: 208rpx;
  276. height: 2rpx;
  277. background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2));
  278. margin-right: 20rpx;
  279. }
  280. .line-r {
  281. margin-left: 20rpx;
  282. width: 208rpx;
  283. height: 2rpx;
  284. background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  285. }
  286. }
  287. }
  288. .swipe-item {
  289. width: 100%;
  290. height: 100%;
  291. .video-wrap {
  292. width: 100%;
  293. height: 100%;
  294. object-fit: cover;
  295. }
  296. ::v-deep {
  297. .uni-video-video {
  298. object-fit: cover !important;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. .panel-content {
  305. padding: 0 24rpx 24rpx;
  306. height: calc(100vh - 420rpx);
  307. overflow: auto;
  308. .panel-title {
  309. display: flex;
  310. align-items: center;
  311. justify-content: space-between;
  312. .title-l {
  313. flex: 1;
  314. display: flex;
  315. align-items: center;
  316. .garden-img {
  317. width: 100rpx;
  318. height: 100rpx;
  319. border-radius: 10rpx;
  320. }
  321. .title-info {
  322. padding-left: 20rpx;
  323. .title-garden {
  324. color: #000000;
  325. font-size: 28rpx;
  326. font-weight: 600;
  327. padding-bottom: 10rpx;
  328. }
  329. .btn-second {
  330. padding: 0 30rpx;
  331. border-radius: 40rpx;
  332. font-size: 24rpx;
  333. color: #C49600;
  334. background: rgba(255, 217, 94, 0.2);
  335. height: 56rpx;
  336. line-height: 56rpx;
  337. }
  338. }
  339. }
  340. .title-r {
  341. display: flex;
  342. font-size: 24rpx;
  343. padding: 8rpx 22rpx;
  344. background: #FFD95E;
  345. border-radius: 30rpx;
  346. .add-text {
  347. padding-left: 6rpx;
  348. font-weight: 600;
  349. }
  350. }
  351. }
  352. .panel-video {
  353. padding: 20rpx 0;
  354. height: 300rpx;
  355. width: 100%;
  356. .video-dom {
  357. width: 100%;
  358. height: 100%;
  359. object-fit: cover;
  360. border-radius: 10rpx;
  361. }
  362. }
  363. .discover-content {
  364. .discover-filter {
  365. color: #A6A6A6;
  366. font-size: 28rpx;
  367. display: flex;
  368. align-items: center;
  369. .filter-item {
  370. padding: 12rpx 20rpx;
  371. &.active {
  372. color: #000000;
  373. }
  374. }
  375. }
  376. .discover-list {
  377. padding-top: 20rpx;
  378. .list-line {
  379. padding-bottom: 20rpx;
  380. display: flex;
  381. flex-wrap: wrap;
  382. .list-item {
  383. background-color: #FFFFFF;
  384. border-radius: 10rpx;
  385. width: calc(50% - 16rpx);
  386. margin-bottom: 20rpx;
  387. border: 2rpx solid rgba(0, 0, 0, 0.1);
  388. .item-img {
  389. width: 100%;
  390. height: 340rpx;
  391. object-fit: cover;
  392. border-radius: 10rpx 10rpx 0 0;
  393. }
  394. .item-desc {
  395. padding: 0 10rpx 10rpx;
  396. .item-text {
  397. width: calc(100% - 22rpx);
  398. overflow: hidden;
  399. text-overflow: ellipsis;
  400. color: #000000;
  401. font-size: 28rpx;
  402. line-height: 42rpx;
  403. font-weight: 600;
  404. white-space: nowrap;
  405. }
  406. .item-subtext {
  407. color: #AFAFAF;
  408. font-size: 24rpx;
  409. line-height: 36rpx;
  410. .subtext-text + .subtext-text {
  411. padding-left: 10rpx;
  412. }
  413. }
  414. .info-price {
  415. display: flex;
  416. align-items: baseline;
  417. justify-content: space-between;
  418. .price-text {
  419. color: #FF7700;
  420. font-size: 36rpx;
  421. .price-unit {
  422. font-size: 23rpx;
  423. }
  424. }
  425. .info-sold {
  426. font-size: 20rpx;
  427. color: #C4C4C4;
  428. }
  429. }
  430. }
  431. }
  432. .list-item:nth-child(2n) {
  433. margin-left: 20rpx;
  434. }
  435. }
  436. }
  437. }
  438. .garden-detail {
  439. padding: 20rpx 0;
  440. .detial-item {
  441. padding-bottom: 20rpx;
  442. .sub-title {
  443. display: flex;
  444. align-items: center;
  445. justify-content: center;
  446. padding-bottom: 20rpx;
  447. .line-l {
  448. width: 120rpx;
  449. height: 2rpx;
  450. background: linear-gradient(90deg, rgba(102, 102, 102, 0), rgba(0, 0, 0, 0.5));
  451. margin-right: 20rpx;
  452. }
  453. .line-r {
  454. width: 120rpx;
  455. height: 2rpx;
  456. background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(102, 102, 102, 0));
  457. margin-left: 20rpx;
  458. }
  459. .title-text {
  460. font-size: 32rpx;
  461. font-family: "PangMenZhengDao";
  462. color: #000;
  463. }
  464. }
  465. .detail-img {
  466. padding: 0 20rpx;
  467. text-align: center;
  468. .img-dom {
  469. margin: 0 auto;
  470. }
  471. }
  472. }
  473. }
  474. }
  475. .bottom-menu {
  476. position: fixed;
  477. bottom: 0;
  478. display: flex;
  479. align-items: center;
  480. justify-content: center;
  481. background-color: #FFFFFF;
  482. width: 100%;
  483. height: 100rpx;
  484. .menu-item {
  485. padding: 0 72rpx;
  486. position: relative;
  487. color: #898989;
  488. font-size: 32rpx;
  489. &.active {
  490. color: #000000;
  491. font-weight: 600;
  492. }
  493. }
  494. .menu-item + .menu-item {
  495. &::before {
  496. content: "";
  497. position: absolute;
  498. left: 0%;
  499. top: 16rpx;
  500. background-color: rgba(0, 0, 0, 0.42);
  501. width: 2rpx;
  502. height: 20rpx;
  503. }
  504. }
  505. }
  506. </style>