gardenItem.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  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="`${config.BASIC_IMG}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" width="100%" :src="`${config.BASIC_IMG}home/fruit.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" width="100%" :src="`${config.BASIC_IMG}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" width="100%" :src="`${config.BASIC_IMG}home/fruit.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="`${config.BASIC_IMG}home/fruit.png`" 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. text: "",
  176. price: '107',
  177. sold: "1250"
  178. },
  179. {
  180. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  181. text: "",
  182. price: '107',
  183. sold: "1250"
  184. },
  185. {
  186. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  187. text: "",
  188. price: '107',
  189. sold: "1250"
  190. },
  191. {
  192. name: "海南妃子笑荔枝新鲜采摘新鲜采摘",
  193. text: "",
  194. price: '107',
  195. sold: "1250"
  196. }
  197. ])
  198. function selectFilter(i) {
  199. filterIndex.value = i
  200. }
  201. </script>
  202. <style lang="scss" scoped>
  203. .garden-item-page {
  204. width: 100%;
  205. height: 100vh;
  206. .report-content {
  207. width: 100%;
  208. height: calc(100% - 120rpx);
  209. position: relative;
  210. .home-search {
  211. position: absolute;
  212. z-index: 2;
  213. top: 20rpx;
  214. left: 24rpx;
  215. display: flex;
  216. align-items: center;
  217. width: calc(100% - 48rpx);
  218. border: 2rpx solid rgba(255, 255, 255, 0.39);
  219. border-radius: 40rpx;
  220. margin-bottom: 40rpx;
  221. background-color: rgba(0, 0, 0, 0.31);
  222. .search-wrap {
  223. flex: 1;
  224. // padding-left: 22rpx;
  225. ::v-deep {
  226. .u-search {
  227. .u-search__content {
  228. background-color: transparent !important;
  229. .u-search__content__input {
  230. background-color: transparent !important;
  231. }
  232. }
  233. .uni-input-input {
  234. color: rgba(255, 255, 255, 0.8);
  235. }
  236. .u-search__action {
  237. text-align: center;
  238. line-height: 52rpx;
  239. border-radius: 40rpx;
  240. font-size: 28rpx;
  241. background-color: rgba(255, 255, 255, 0.3);
  242. color: rgba(255, 255, 255, 0.3);
  243. margin: 6rpx 8rpx;
  244. width: 112rpx;
  245. height: 52rpx;
  246. }
  247. }
  248. }
  249. }
  250. }
  251. .tips {
  252. position: absolute;
  253. z-index: 2;
  254. top: 110rpx;
  255. left: 0;
  256. color: #FFFFFF;
  257. font-size: 24rpx;
  258. width: 100%;
  259. text-align: center;
  260. .tips-content {
  261. position: relative;
  262. display: flex;
  263. align-items: center;
  264. justify-content: center;
  265. .down-icon {
  266. width: 14rpx;
  267. height: 14rpx;
  268. padding-right: 20rpx;
  269. }
  270. .line-l {
  271. width: 208rpx;
  272. height: 2rpx;
  273. background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2));
  274. margin-right: 20rpx;
  275. }
  276. .line-r {
  277. margin-left: 20rpx;
  278. width: 208rpx;
  279. height: 2rpx;
  280. background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  281. }
  282. }
  283. }
  284. .swipe-item {
  285. width: 100%;
  286. height: 100%;
  287. .video-wrap {
  288. width: 100%;
  289. height: 100%;
  290. object-fit: cover;
  291. }
  292. ::v-deep {
  293. .uni-video-video {
  294. object-fit: cover !important;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. .panel-content {
  301. padding: 0 24rpx 24rpx;
  302. height: calc(100vh - 420rpx);
  303. overflow: auto;
  304. .panel-title {
  305. display: flex;
  306. align-items: center;
  307. justify-content: space-between;
  308. .title-l {
  309. flex: 1;
  310. display: flex;
  311. align-items: center;
  312. .garden-img {
  313. width: 100rpx;
  314. height: 100rpx;
  315. border-radius: 10rpx;
  316. }
  317. .title-info {
  318. padding-left: 20rpx;
  319. .title-garden {
  320. color: #000000;
  321. font-size: 28rpx;
  322. font-weight: 600;
  323. padding-bottom: 10rpx;
  324. }
  325. .btn-second {
  326. padding: 0 30rpx;
  327. border-radius: 40rpx;
  328. font-size: 24rpx;
  329. color: #C49600;
  330. background: rgba(255, 217, 94, 0.2);
  331. height: 56rpx;
  332. line-height: 56rpx;
  333. }
  334. }
  335. }
  336. .title-r {
  337. display: flex;
  338. font-size: 24rpx;
  339. padding: 8rpx 22rpx;
  340. background: #FFD95E;
  341. border-radius: 30rpx;
  342. .add-text {
  343. padding-left: 6rpx;
  344. font-weight: 600;
  345. }
  346. }
  347. }
  348. .panel-video {
  349. padding: 20rpx 0;
  350. height: 300rpx;
  351. width: 100%;
  352. .video-dom {
  353. width: 100%;
  354. height: 100%;
  355. object-fit: cover;
  356. border-radius: 10rpx;
  357. }
  358. }
  359. .discover-content {
  360. .discover-filter {
  361. color: #A6A6A6;
  362. font-size: 28rpx;
  363. display: flex;
  364. align-items: center;
  365. .filter-item {
  366. padding: 12rpx 20rpx;
  367. &.active {
  368. color: #000000;
  369. }
  370. }
  371. }
  372. .discover-list {
  373. padding-top: 20rpx;
  374. .list-line {
  375. padding-bottom: 20rpx;
  376. display: flex;
  377. flex-wrap: wrap;
  378. .list-item {
  379. background-color: #FFFFFF;
  380. border-radius: 10rpx;
  381. width: calc(50% - 16rpx);
  382. margin-bottom: 20rpx;
  383. border: 2rpx solid rgba(0, 0, 0, 0.1);
  384. .item-img {
  385. width: 100%;
  386. height: 340rpx;
  387. object-fit: cover;
  388. border-radius: 10rpx 10rpx 0 0;
  389. }
  390. .item-desc {
  391. padding: 0 10rpx 10rpx;
  392. .item-text {
  393. width: calc(100% - 22rpx);
  394. overflow: hidden;
  395. text-overflow: ellipsis;
  396. color: #000000;
  397. font-size: 28rpx;
  398. line-height: 42rpx;
  399. font-weight: 600;
  400. white-space: nowrap;
  401. }
  402. .item-subtext {
  403. color: #AFAFAF;
  404. font-size: 24rpx;
  405. line-height: 36rpx;
  406. .subtext-text + .subtext-text {
  407. padding-left: 10rpx;
  408. }
  409. }
  410. .info-price {
  411. display: flex;
  412. align-items: baseline;
  413. justify-content: space-between;
  414. .price-text {
  415. color: #FF7700;
  416. font-size: 36rpx;
  417. .price-unit {
  418. font-size: 23rpx;
  419. }
  420. }
  421. .info-sold {
  422. font-size: 20rpx;
  423. color: #C4C4C4;
  424. }
  425. }
  426. }
  427. }
  428. .list-item:nth-child(2n) {
  429. margin-left: 20rpx;
  430. }
  431. }
  432. }
  433. }
  434. .garden-detail {
  435. padding: 20rpx 0;
  436. .detial-item {
  437. padding-bottom: 20rpx;
  438. .sub-title {
  439. display: flex;
  440. align-items: center;
  441. justify-content: center;
  442. padding-bottom: 20rpx;
  443. .line-l {
  444. width: 120rpx;
  445. height: 2rpx;
  446. background: linear-gradient(90deg, rgba(102, 102, 102, 0), rgba(0, 0, 0, 0.5));
  447. margin-right: 20rpx;
  448. }
  449. .line-r {
  450. width: 120rpx;
  451. height: 2rpx;
  452. background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(102, 102, 102, 0));
  453. margin-left: 20rpx;
  454. }
  455. .title-text {
  456. font-size: 32rpx;
  457. font-family: "PangMenZhengDao";
  458. color: #000;
  459. }
  460. }
  461. .detail-img {
  462. text-align: center;
  463. .img-dom {
  464. margin: 0 auto;
  465. }
  466. }
  467. }
  468. }
  469. }
  470. .bottom-menu {
  471. position: fixed;
  472. bottom: 0;
  473. display: flex;
  474. align-items: center;
  475. justify-content: center;
  476. background-color: #FFFFFF;
  477. width: 100%;
  478. height: 100rpx;
  479. .menu-item {
  480. padding: 0 72rpx;
  481. position: relative;
  482. color: #898989;
  483. font-size: 32rpx;
  484. &.active {
  485. color: #000000;
  486. font-weight: 600;
  487. }
  488. }
  489. .menu-item + .menu-item {
  490. &::before {
  491. content: "";
  492. position: absolute;
  493. left: 0%;
  494. top: 16rpx;
  495. background-color: rgba(0, 0, 0, 0.42);
  496. width: 2rpx;
  497. height: 20rpx;
  498. }
  499. }
  500. }
  501. </style>