index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <template>
  2. <div class="farm-page">
  3. <custom-header :name="query.isStore ? '查看详情' : '我的主页'"></custom-header>
  4. <div class="farm-list">
  5. <div class="box-wrap expert-info">
  6. <div class="expert-top">
  7. <div class="top-l" v-if="query.isStore">
  8. <img class="expert-icon store-icon" src="@/assets/img/home/nz.png" alt="">
  9. <div class="l-info store-info">
  10. <div class="info-name">
  11. <div class="expert-name">{{ storeDetail?.storeName }}</div>
  12. </div>
  13. <div class="info-bottom">
  14. <el-rate
  15. v-model="storeDetail.score"
  16. disabled
  17. :colors="['#FF953D', '#FF953D', '#FF953D']"
  18. disabled-void-color="#DDDDDD"
  19. size="small"
  20. show-score
  21. text-color="#FF953D"
  22. score-template="{value} 分"
  23. />
  24. </div>
  25. </div>
  26. </div>
  27. <div class="top-l" v-else>
  28. <img class="expert-icon" src="https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png" alt="">
  29. <div class="l-info">
  30. <div class="info-name">
  31. <div class="expert-name">韦帮稳</div>
  32. <span class="expert-tag">
  33. <img class="expert-img" src="@/assets/img/home/expert-icon.png" alt="">
  34. 专家
  35. </span>
  36. </div>
  37. <div class="info-bottom">
  38. <div
  39. class="fruit-tag"
  40. v-for="(ele, eleIndex) in tagList"
  41. :key="eleIndex"
  42. >
  43. {{ ele.name }}
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <!-- <div class="top-r">编辑信息</div> -->
  49. </div>
  50. <div class="expert-list">
  51. <div class="page-title">
  52. <img class="title-icon" src="@/assets/img/home/man.png" alt="">
  53. {{ query.isStore ? '基本简介' : '专家简介' }}
  54. </div>
  55. <div class="list-one" v-if="query.isStore">
  56. <div class="one-info">
  57. <span class="one-name">服务类型:</span>
  58. <span v-for="(item, index) in storeDetail?.serviceTypeJson" :key="index">
  59. {{ item }}
  60. <span v-if="index !== storeDetail?.serviceTypeJson.length - 1">、</span>
  61. </span>
  62. <span v-if="!storeDetail?.serviceTypeJson || storeDetail?.serviceTypeJson.length === 0">--</span>
  63. </div>
  64. <div class="one-info">
  65. <span class="one-name">服务作物:</span>
  66. <span v-for="(item, index) in storeDetail?.serviceCropsJson" :key="index">
  67. {{ item }}
  68. <span v-if="index !== storeDetail?.serviceCropsJson.length - 1">、</span>
  69. </span>
  70. <span v-if="!storeDetail?.serviceCropsJson || storeDetail?.serviceCropsJson.length === 0">--</span>
  71. </div>
  72. <div class="one-info">
  73. <span class="one-name">服务区域:</span>{{ storeDetail?.address || "--" }}
  74. </div>
  75. <div class="one-info">
  76. <span class="one-name">农机设备:</span>
  77. <span v-for="(item, index) in storeDetail?.agriculturalEquipmentJson" :key="index">
  78. {{ item }}
  79. <span v-if="index !== storeDetail?.agriculturalEquipmentJson.length - 1">、</span>
  80. </span>
  81. <span v-if="!storeDetail?.agriculturalEquipmentJson || storeDetail?.agriculturalEquipmentJson.length === 0">--</span>
  82. </div>
  83. </div>
  84. <div class="list-one" v-else>
  85. <div class="one-info">
  86. <span class="one-name">职称:</span>广州荔博园种业有限公司董事长
  87. </div>
  88. <div class="one-info">
  89. <span class="one-name">单位:</span>广州市从化区荔枝文化博览园
  90. </div>
  91. <div class="one-info">
  92. <span class="one-name">擅长:</span>荔枝的病虫害防治、生长异常调节、物候期调 节等等...
  93. </div>
  94. <div class="one-info last-one">
  95. <span class="one-name">服务品类:</span><div class="more">更多<el-icon class="more-icon"><ArrowRightBold /></el-icon></div>
  96. </div>
  97. <div class="one-type">
  98. <div class="type-item" v-for="item in 5" :key="item">
  99. <img class="type-img" src="@/assets/img/gallery/icon-0.png" alt="">
  100. <div class="type-name">荔枝</div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="box-wrap list-wrap">
  107. <div class="list-title">
  108. <div class="page-title">
  109. <img class="garden-icon" src="@/assets/img/home/garden-title.png" alt="">
  110. {{ query.isStore ? '服务农场' : '定点基地' }}
  111. </div>
  112. <div class="more" v-if="farmList && farmList.length > 9">更多<el-icon class="more-icon"><ArrowRightBold /></el-icon></div>
  113. </div>
  114. <div class="list-content">
  115. <div class="list-item" v-for="item in farmList" :key="item">
  116. <div class="item-info">
  117. <div class="item-top">
  118. <div class="left-img">
  119. <img class="img-dom" src="https://birdseye-img-ali-cdn.sysuimars.com/16926861-1e20-4cbd-8bf2-90208db5a2d0/806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_202509010800_001_806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_20250901080536_0045_V_code-ws0fsmge97gh.jpeg" alt="">
  120. </div>
  121. <div class="left-content">
  122. <div class="content-title">
  123. <span>{{ item.farmName }}</span>
  124. </div>
  125. <div class="content-desc">
  126. <div>果园面积:{{ item.mianji || "--" }}亩</div>
  127. <div>服务作物:{{ item.typeName }}</div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="item-btn" v-if="!query.isStore">查看详情</div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="bottom-btn" v-if="query.isStore">
  138. <div class="share-btn" @click="handleFreeConsult">免费咨询</div>
  139. </div>
  140. <div class="bottom-btn" v-else>
  141. <div class="share-btn">分享</div>
  142. </div>
  143. </div>
  144. </template>
  145. <script setup>
  146. import { useRouter } from "vue-router";
  147. import customHeader from "@/components/customHeader.vue";
  148. import { onActivated, ref } from "vue";
  149. import { useRoute } from "vue-router";
  150. const router = useRouter();
  151. let query = ref(useRoute().query);
  152. onActivated(() => {
  153. query.value = useRoute().query;
  154. if (query.value.id && query.value.isStore) {
  155. getStoreDetail();
  156. getFarmList();
  157. }
  158. });
  159. const getStoreDetail = () => {
  160. const params = {
  161. id: query.value.id,
  162. };
  163. VE_API.z_agricultural_store.getStoreDetail(params).then((res) => {
  164. storeDetail.value = res.data || {};
  165. storeDetail.value.score = res.data.score || 5;
  166. });
  167. };
  168. const farmList = ref([]);
  169. const getFarmList = () => {
  170. const params = {
  171. id: query.value.id,
  172. };
  173. VE_API.z_agricultural_store.getStoreList(params).then((res) => {
  174. farmList.value = res.data || [];
  175. });
  176. };
  177. const storeDetail = ref({});
  178. const tagList = [{name: "荔枝"}, {name: "龙眼"}]
  179. const handleFreeConsult = () => {
  180. router.push(`/chat_frame?userId=${storeDetail.value.managers[0].miniUserId}`);
  181. };
  182. </script>
  183. <style scoped lang="scss">
  184. .farm-page {
  185. width: 100%;
  186. height: 100vh;
  187. .farm-list {
  188. width: 100%;
  189. height: calc(100% - 40px - 52px);
  190. overflow: auto;
  191. background-color: #f7f7f7;
  192. padding: 12px;
  193. box-sizing: border-box;
  194. .page-title {
  195. display: flex;
  196. align-items: center;
  197. font-size: 16px;
  198. color: #000000;
  199. font-weight: bold;
  200. .title-icon {
  201. width: 16px;
  202. height: 16px;
  203. padding-right: 8px;
  204. }
  205. .garden-icon {
  206. width: 16px;
  207. padding-right: 8px;
  208. }
  209. }
  210. .more {
  211. display: flex;
  212. align-items: center;
  213. color: #999999;
  214. }
  215. .box-wrap {
  216. background: #ffffff;
  217. border-radius: 12px;
  218. padding: 12px;
  219. &.expert-info {
  220. .expert-top {
  221. display: flex;
  222. align-items: flex-start;
  223. justify-content: space-between;
  224. .top-l {
  225. display: flex;
  226. }
  227. .top-r {
  228. display: flex;
  229. align-items: center;
  230. padding: 4px 10px;
  231. color: #2199F8;
  232. font-size: 12px;
  233. background: rgba(33, 153, 248, 0.12);
  234. border-radius: 20px;
  235. }
  236. .l-info {
  237. padding-left: 7px;
  238. &.store-info {
  239. padding-left: 10px;
  240. .info-bottom {
  241. background: rgba(255, 149, 61, 0.1);
  242. border-radius: 4px;
  243. margin-top: 2px;
  244. padding: 0px 4px 2px 4px;
  245. ::v-deep{
  246. .el-rate .el-rate__icon {
  247. margin-right: 2px;
  248. }
  249. .el-rate--small {
  250. height: 20px;
  251. }
  252. }
  253. }
  254. }
  255. }
  256. .info-name {
  257. display: flex;
  258. align-items: center;
  259. }
  260. .info-bottom {
  261. padding-top: 8px;
  262. display: flex;
  263. }
  264. .fruit-tag {
  265. margin-left: 5px;
  266. padding: 0 8px;
  267. height: 20px;
  268. line-height: 20px;
  269. background: #cae7ff;
  270. border-radius: 2px;
  271. font-size: 12px;
  272. color: #2199f8;
  273. // &.pest {
  274. // background: #eedaff;
  275. // color: #ac4dff;
  276. // }
  277. &:nth-child(2) {
  278. background: #eedaff;
  279. color: #ac4dff;
  280. }
  281. }
  282. .expert-icon {
  283. width: 68px;
  284. height: 68px;
  285. border-radius: 8px;
  286. object-fit: cover;
  287. &.store-icon {
  288. width: 50px;
  289. height: 50px;
  290. }
  291. }
  292. .info-flex{
  293. display: flex;
  294. align-items: center;
  295. }
  296. .expert-name {
  297. color: #000;
  298. font-size: 16px;
  299. font-weight: bold;
  300. }
  301. .expert-tag {
  302. height: 20px;
  303. width: 48px;
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. color: #C77D05;
  308. background: #FFECAD;
  309. border-radius: 4px;
  310. font-size: 12px;
  311. margin-left: 8px;
  312. line-height: 20px;
  313. .expert-img {
  314. width: 12px;
  315. padding-right: 2px;
  316. }
  317. }
  318. .btn-text{
  319. font-size: 12px;
  320. color: #A8A8A8;
  321. padding: 2px 12px;
  322. border-radius: 20px;
  323. border: 1px solid #A8A8A8;
  324. background: rgba(220, 220, 220, 0.1);
  325. &.actice{
  326. color: #F3C11D;
  327. border-color: #F3C11D;
  328. background: rgba(243, 193, 29, 0.1);
  329. }
  330. }
  331. }
  332. .expert-list {
  333. padding-top: 16px;
  334. font-size: 14px;
  335. .list-one {
  336. padding-top: 8px;
  337. .one-info {
  338. // display: flex;
  339. color: #666666;
  340. line-height: 18px;
  341. padding-bottom: 4px;
  342. .one-name {
  343. flex: none;
  344. color: rgba(102, 102, 102, 0.5);
  345. }
  346. &.last-one {
  347. padding-top: 6px;
  348. display: flex;
  349. align-items: center;
  350. justify-content: space-between;
  351. }
  352. }
  353. .one-type {
  354. padding-top: 8px;
  355. display: flex;
  356. justify-content: space-around;
  357. .type-item {
  358. width: 20%;
  359. display: flex;
  360. flex-direction: column;
  361. justify-content: center;
  362. align-items: center;
  363. .type-img {
  364. width: 48px;
  365. height: 48px;
  366. border-radius: 50%;
  367. border: 1px solid #E5E5E5;
  368. }
  369. .type-name {
  370. padding-top: 2px;
  371. color: #666666;
  372. font-size: 12px;
  373. }
  374. }
  375. }
  376. }
  377. }
  378. }
  379. &.list-wrap {
  380. margin-top: 12px;
  381. .list-title {
  382. padding-bottom: 12px;
  383. display: flex;
  384. justify-content: space-between;
  385. align-items: center;
  386. border-bottom: 1px solid #F5F5F5;
  387. }
  388. }
  389. }
  390. .list-content {
  391. padding: 12px 0;
  392. }
  393. .list-item {
  394. background-color: #fff;
  395. border-radius: 10px;
  396. // padding: 10px;
  397. display: flex;
  398. justify-content: space-between;
  399. align-items: center;
  400. .item-info {
  401. .item-top {
  402. display: flex;
  403. align-items: center;
  404. gap: 12px;
  405. .left-img {
  406. width: 68px;
  407. height: 68px;
  408. border-radius: 8px;
  409. .img-dom {
  410. border-radius: 8px;
  411. width: 100%;
  412. height: 100%;
  413. object-fit: cover;
  414. }
  415. }
  416. .left-content {
  417. .content-title {
  418. display: flex;
  419. align-items: center;
  420. gap: 10px;
  421. margin-bottom: 4px;
  422. font-size: 16px;
  423. font-weight: 500;
  424. .content-tag {
  425. background-color: #2199f8;
  426. color: #fff;
  427. padding: 2px 8px;
  428. border-radius: 15px;
  429. font-size: 12px;
  430. font-weight: 400;
  431. }
  432. .content-text {
  433. font-size: 12px;
  434. color: #2199F8;
  435. font-weight: 400;
  436. }
  437. }
  438. .content-desc {
  439. font-size: 12px;
  440. color: #999999;
  441. line-height: 18px;
  442. }
  443. }
  444. }
  445. .select {
  446. width: 105px;
  447. margin-left: 80px;
  448. margin-top: 10px;
  449. ::v-deep{
  450. .el-select__wrapper{
  451. border: 1px solid #2199F8;
  452. box-shadow: none;
  453. }
  454. .el-select__placeholder,.el-select__caret{
  455. color: #2199F8;
  456. }
  457. .el-select__selection {
  458. flex: none;
  459. width: fit-content;
  460. }
  461. .el-select__placeholder {
  462. position: static;
  463. transform: none;
  464. width: fit-content;
  465. }
  466. }
  467. }
  468. }
  469. .item-btn {
  470. color: #2199F8;
  471. padding: 4px 8px;
  472. border: 1px solid #2199F8;
  473. border-radius: 4px;
  474. }
  475. }
  476. .list-item + .list-item {
  477. margin-top: 10px;
  478. padding-top: 10px;
  479. border-top: 1px solid #F5F5F5;
  480. }
  481. }
  482. .bottom-btn {
  483. height: 52px;
  484. width: 100%;
  485. padding: 6px 32px;
  486. box-sizing: border-box;
  487. &.flex-between {
  488. display: flex;
  489. justify-content: space-between;
  490. align-items: center;
  491. .forward-btn {
  492. background: #fff;
  493. border: 1px solid rgba(153, 153, 153, 0.5);
  494. color: #666666;
  495. padding: 8px 20px;
  496. }
  497. .free-btn {
  498. padding: 8px 20px;
  499. }
  500. }
  501. .share-btn {
  502. color: #fff;
  503. text-align: center;
  504. border-radius: 20px;
  505. padding: 8px;
  506. background: linear-gradient(180deg, #76C3FF, #2199F8);
  507. }
  508. }
  509. }
  510. </style>