移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

472 lines
14 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div id="topMain" class="topMain">
  4. <!-- 头部开始 -->
  5. <div class="header">
  6. <!-- <img :src="avatar">-->
  7. <img v-if="avatar" :src="avatar" style="width: 50px;height: 50px;">
  8. <img v-else src="../../../../static/images/agriculturalTrusteeship/index/header.png" style="width: 50px;height: 50px;">
  9. <div class="header_box" @click="$router.push({name:'agriculturalTrusteeshipLogin'})">
  10. <p>{{nickName}}<span>{{phonenumber}}</span><img src="../../../../static/images/agriculturalTrusteeship/buyer/buyer_icon_01.png" alt=""></p>
  11. <p>{{allDeptName}}</p>
  12. </div>
  13. </div>
  14. <!-- 头部结束 -->
  15. <!-- 导航开始 -->
  16. <div class="nav">
  17. <van-grid :column-num="4" :border="false">
  18. <van-grid-item :to="{name:'agriculturalTrusteeshipSocietyList'}">
  19. <img src="../../../../static/images/agriculturalTrusteeship/index/nav_01.png"/>
  20. <p>社会化</p>
  21. </van-grid-item>
  22. <van-grid-item :to="{name:'agriculturalTrusteeshipInsuranceList',query:{type:3}}">
  23. <img src="../../../../static/images/agriculturalTrusteeship/index/nav_02.png"/>
  24. <p>农担</p>
  25. </van-grid-item>
  26. <van-grid-item :to="{name:'agriculturalTrusteeshipInsuranceList',query:{type:1}}">
  27. <img src="../../../../static/images/agriculturalTrusteeship/index/nav_03.png"/>
  28. <p>贷款</p>
  29. </van-grid-item>
  30. <van-grid-item :to="{name:'agriculturalTrusteeshipInsuranceList',query:{type:2}}">
  31. <img src="../../../../static/images/agriculturalTrusteeship/index/nav_04.png"/>
  32. <p>保险</p>
  33. </van-grid-item>
  34. </van-grid>
  35. <div class="nav_notice_box">
  36. <van-notice-bar left-icon="../../../../static/images/agriculturalTrusteeship/index/notice_icon.png" mode="link" :scrollable="false" background="#E2E9FD" color="#334281">
  37. <van-swipe
  38. vertical
  39. class="notice-swipe"
  40. :autoplay="3000"
  41. :show-indicators="false"
  42. >
  43. <van-swipe-item>12.0版本上线啦!点击查看更改内容~</van-swipe-item>
  44. <van-swipe-item>12.1版本上线啦!点击查看更改内容~</van-swipe-item>
  45. <van-swipe-item>12.2版本上线啦!点击查看更改内容~</van-swipe-item>
  46. </van-swipe>
  47. </van-notice-bar>
  48. </div>
  49. </div>
  50. <!-- 导航结束 -->
  51. </div>
  52. <!-- 内容开始 -->
  53. <div class="main">
  54. <div class="main_header">
  55. <p>社会化服务产品</p>
  56. <p>河东河西村</p>
  57. </div>
  58. <div class="search">
  59. <img src="../../../../static/images/agriculturalTrusteeship/index/search_icon_01.png" />
  60. <input type="text" v-model="searchInput" placeholder="输入需求进行搜索" />
  61. <img src="../../../../static/images/agriculturalTrusteeship/index/search_icon_02.png" @click="goSearch" />
  62. </div>
  63. <div class="main_content">
  64. <div class="main_content_left">
  65. <van-sidebar v-model="activeKey" @change="onChangeIn">
  66. <van-sidebar-item title="全套服务" />
  67. <van-sidebar-item v-for="(item,index) in productList" :key="index" :title="item.dictName" />
  68. </van-sidebar>
  69. </div>
  70. <div class="main_content_right">
  71. <div class="main_content_right_header">
  72. <p class="main_content_right_header_tit">{{main_content_right_header_tit}}</p>
  73. <van-tabs v-model="active" animated @change="orderByChange">
  74. <van-tab title="评分排序"></van-tab>
  75. <van-tab title="销量排序"></van-tab>
  76. </van-tabs>
  77. </div>
  78. <div class="main_content_right_nav" v-if="activeKey!=0">
  79. <p v-for="(item,index) in productListChildren" :key="index">{{item.dictName}}</p>
  80. </div>
  81. <van-list
  82. v-model="loading"
  83. :finished="finished"
  84. finished-text="没有更多了"
  85. @load="getList"
  86. >
  87. <!-- @load="onLoad" @click="$router.push({name:'agriculturalTrusteeshipPlaceOrder'})"-->
  88. <div class="main_content_right_list" v-for="(item,index) in supplyDemandListYes" :key="index" @click="$router.push({name:'agriculturalTrusteeshipSocietyProjectDetail',query:{id:item.id}})">
  89. <img v-if="item.supplyMasterMap" :src="item.supplyMasterMap">
  90. <img v-else src="../../../../static/images/agriculturalTrusteeship/zwtp.png">
  91. <div class="main_content_right_list_content">
  92. <p class="tt">{{item.supplyDemandName}}</p>
  93. <div class="tab">
  94. <p>¥<span>{{item.unitPrice}}</span>.00/{{item.unit}}</p>
  95. <p><span>销{{item.orderNum}}</span><span>分{{item.orderScore}}</span></p>
  96. </div>
  97. <p class="name">{{item.entityName}}</p>
  98. </div>
  99. </div>
  100. </van-list>
  101. </div>
  102. </div>
  103. </div>
  104. <!-- 内容结束 -->
  105. <img src="../../../../static/images/agriculturalTrusteeship/index/index_btn_icon_01.png" class="pc" @click="openMain"/>
  106. <buyer></buyer>
  107. </div>
  108. </template>
  109. <script>
  110. import Cookies from "js-cookie";
  111. import buyer from "@/components/common/buyer_footer";
  112. import {productTypes, supplyDemandList} from "@/api/agriculturalTrusteeship";
  113. import {getInfo} from "@/api/login";
  114. import request from "@/utils/request";
  115. export default {
  116. name: "agriculturalTrusteeshipBuyIndex",
  117. components: {
  118. buyer,
  119. },
  120. data() {
  121. return {
  122. activeKey: 0,
  123. active: 0,
  124. loading: false,
  125. finished: false,
  126. supplyDemandListYes:[],
  127. supplyDemandList:[],
  128. productListChildren:[],
  129. productList:[],
  130. main_content_right_header_tit:'全套服务',
  131. query:{
  132. entityId:Cookies.get('ACCESS-SESSION-ID'),
  133. productType:'',
  134. supplyDemandName:''
  135. },
  136. nickName:'',
  137. allDeptName:'',
  138. userId:'',
  139. avatar:'',
  140. phonenumber:'',
  141. searchInput:'',
  142. };
  143. },
  144. created() {
  145. getInfo().then(response => {
  146. this.nickName = response.user.nickName
  147. this.allDeptName = response.user.allDeptName
  148. this.userId = response.user.userId
  149. this.phonenumber = response.user.phonenumber
  150. this.avatar = location.protocol+"//"+location.host+request.defaults.baseURL+response.user.avatar
  151. });
  152. let query = {
  153. parentId : 0
  154. }
  155. productTypes(query).then(response => {
  156. this.productList = response.data;
  157. });
  158. },
  159. methods: {
  160. getList(){
  161. supplyDemandList(this.query).then(response => {
  162. response.rows.map(res=>{
  163. if(res.publishStatus == 3){
  164. // console.log(res.supplyMasterMap.split( "," ))
  165. if (res.supplyMasterMap){
  166. let supplyMasterMap = res.supplyMasterMap.split( "," )
  167. res.supplyMasterMap = '/api'+supplyMasterMap[0]
  168. }
  169. this.supplyDemandListYes.push(res);
  170. }
  171. this.supplyDemandList.push(res);
  172. })
  173. if(this.supplyDemandList.length >= response.total){
  174. this.finished = true;
  175. return;
  176. }else{
  177. this.loading = false;
  178. this.query.pageNum += 1 ;
  179. }
  180. });
  181. },
  182. onChangeIn(val){
  183. this.supplyDemandListYes = [];
  184. if (val == 0){
  185. this.main_content_right_header_tit = '全套服务';
  186. this.query.productType = '';
  187. this.getList();
  188. return;
  189. }
  190. this.query.productType = this.productList[val-1].id;
  191. let parentId = this.productList[val-1].id;
  192. this.main_content_right_header_tit = this.productList[val-1].dictName
  193. let query1 = {
  194. parentId : parentId
  195. }
  196. productTypes(query1).then(response => {
  197. this.productListChildren = response.data;
  198. this.getList();
  199. });
  200. },
  201. goSearch(){
  202. this.supplyDemandListYes = [];
  203. this.query.supplyDemandName = this.searchInput;
  204. this.getList();
  205. },
  206. orderByChange(){
  207. console.log(this.active)
  208. if (this.active == 0){
  209. this.query.orderByColumn = 'order_score'
  210. }
  211. if (this.active == 1){
  212. this.query.orderByColumn = 'order_num'
  213. }
  214. this.supplyDemandListYes = [];
  215. this.getList();
  216. },
  217. openMain(){
  218. $('#topMain').attr('none');
  219. }
  220. },
  221. }
  222. </script>
  223. <style scoped lang="scss">
  224. .home_wrapper{
  225. }
  226. /*头部*/
  227. .header{
  228. display: flex;
  229. align-items: center;
  230. background-image: linear-gradient(to right , #6E93F3 , #7E89E9 , #54C6E4);
  231. padding: 4vh 4% 2vh;
  232. img{
  233. border-radius: 100%;
  234. }
  235. .header_box{
  236. margin-left: 4%;
  237. flex: 1;
  238. p{
  239. &:nth-child(1){
  240. color: #ffffff;
  241. font-size: .45rem;
  242. display: flex;
  243. align-items: center;
  244. span{
  245. background: rgba(255,255,255,0.8) url("../../../../static/images/agriculturalTrusteeship/socialization/user_icon_07.png") 10PX center no-repeat;
  246. background-size: 12PX;
  247. color: #1E67FF;
  248. font-size: 0.35rem;
  249. padding: 0 8PX 0 25PX;
  250. border-radius: 5PX;
  251. margin-left: 10PX;
  252. }
  253. img{
  254. margin-left: auto;
  255. }
  256. }
  257. &:nth-child(2){
  258. color: #E5E5E5;
  259. margin-top: .5vh;
  260. }
  261. }
  262. }
  263. }
  264. /*导航栏目*/
  265. .nav{
  266. background-image: linear-gradient(to right , #6E93F3 , #7E89E9 , #54C6E4);
  267. .van-grid{
  268. border-top-left-radius: 25PX;
  269. border-top-right-radius: 25PX;
  270. overflow: hidden;
  271. }
  272. .nav_notice_box{
  273. background: #ffffff;
  274. padding:.5vh 0 1vh;
  275. }
  276. /deep/ .van-notice-bar{
  277. width: 94%;
  278. margin: 0 auto;
  279. border-radius: 5PX;
  280. .notice-swipe {
  281. height: 40px;
  282. line-height: 42px;
  283. }
  284. }
  285. }
  286. /*内容*/
  287. .main{
  288. background: #ffffff;
  289. .main_header{
  290. display: flex;
  291. padding: 0 4% 1vh;
  292. justify-content: space-between;
  293. align-items: center;
  294. p{
  295. color: #334281;
  296. &:nth-child(1){
  297. font-size: .4rem;
  298. }
  299. &:nth-child(2){
  300. font-size: .35rem;
  301. background: url("../../../../static/images/agriculturalTrusteeship/index/address_icon.png") no-repeat left center;
  302. padding: 5PX 0 5PX 22PX;
  303. }
  304. }
  305. }
  306. .search{
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. width: 92%;
  311. margin: 0PX auto;
  312. border: 1px solid #6E93F3;
  313. padding: 1PX 1PX 1PX 12PX ;
  314. border-radius: 50PX;
  315. input{
  316. flex: 1;
  317. background: transparent;
  318. margin-left: 10PX;
  319. }
  320. }
  321. /deep/ .van-tabs--line .van-tabs__wrap{
  322. border-radius: 100rem;
  323. height: 25PX;
  324. }
  325. /deep/ .van-tab{
  326. z-index: 1;
  327. color: #8F8F8F;
  328. padding: 5PX 10PX;
  329. }
  330. /deep/ .van-tab--active{
  331. color: #334281;
  332. }
  333. /deep/ .van-tabs__nav{
  334. background: #ECECEC;
  335. }
  336. /deep/ .van-tabs__nav--line{
  337. padding: 0;
  338. }
  339. /deep/ .van-tabs__line{
  340. background: #D6D9E6;
  341. border-radius: 100rem;
  342. z-index: 0;
  343. width: 50%;
  344. height: 100%;
  345. bottom: 0;
  346. }
  347. .main_content{
  348. display: flex;
  349. width: 96%;
  350. margin-top: 2vh;
  351. height: 56.8vh;
  352. overflow: hidden;
  353. .van-sidebar-item{
  354. text-align: center;
  355. }
  356. /deep/ .van-sidebar-item--select::before{
  357. display: none;
  358. }
  359. .main_content_left{
  360. border-top-right-radius: 15PX;
  361. height: 100%;
  362. overflow-y: scroll;
  363. }
  364. .main_content_right{
  365. flex: 1;
  366. padding-left: 4%;
  367. height: 100%;
  368. overflow-y: scroll;
  369. /deep/ .van-list{
  370. padding-bottom: 10vh;
  371. }
  372. .main_content_right_header{
  373. display: flex;
  374. justify-content: space-between;
  375. align-items: center;
  376. .main_content_right_header_tit{
  377. font-size: .4rem;
  378. color: #1A1D4A;
  379. }
  380. }
  381. .main_content_right_nav{
  382. display: flex;
  383. justify-content: space-between;
  384. margin-top: 2vh;
  385. p{
  386. padding: 5PX 10PX;
  387. background: #F5F5F5;
  388. color: #8F8F8F;
  389. border-radius: 4PX;
  390. }
  391. }
  392. .main_content_right_list{
  393. display: flex;
  394. margin-top: 2vh;
  395. img{
  396. border-radius: 15PX;
  397. margin-right: 4%;
  398. width: 25vw;
  399. height: 25vw;
  400. }
  401. .main_content_right_list_content{
  402. display: flex;
  403. flex-direction:column;
  404. justify-content: space-between;
  405. flex: 1;
  406. .tt{
  407. color: #333333;
  408. font-size: .35rem;
  409. }
  410. .tab{
  411. display: flex;
  412. justify-content: space-between;
  413. p{
  414. &:nth-child(1){
  415. flex: 1;
  416. color: #FF5E00;
  417. span{
  418. font-size: .4rem;
  419. }
  420. }
  421. &:nth-child(2){
  422. span{
  423. display: inline-block;
  424. text-align: center;
  425. padding: 2PX 5PX;
  426. &:nth-child(1){
  427. color: #497CE8;
  428. background: #E2E9FD;
  429. border-top-left-radius: 10PX;
  430. }
  431. &:nth-child(2){
  432. color: #ffffff;
  433. background-image: linear-gradient(to right , #5D87FA , #5FD5F5);
  434. border-bottom-right-radius: 10PX;
  435. }
  436. }
  437. }
  438. }
  439. }
  440. .name{
  441. color: #8F8F8F;
  442. background: url("../../../../static/images/agriculturalTrusteeship/index/name_icon.png") no-repeat left center;
  443. padding-left: 14PX;
  444. }
  445. }
  446. }
  447. }
  448. }
  449. }
  450. /*飘窗*/
  451. .pc{
  452. position: absolute;
  453. bottom: 10vh;
  454. right: 0;
  455. }
  456. </style>