gardenItem.vue 12 KB

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