home.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <view>
  3. <view class="header">
  4. <view class="flex justify-between map">
  5. <view class='Medium flex align-item-center locationwrap'
  6. @click='naviageToPage("/pages/grain_pulse/position/position")'>
  7. <image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
  8. {{position.name}}
  9. </view>
  10. <view @click='naviageToPage("/pages/grain_pulse/distribution/distribution?position="+JSON.stringify(position))'
  11. class='Regular flex align-item-center distribution justify-center'>
  12. <image class='cangku' src="../../static/img/liangmai/cangku.png" mode=""></image>
  13. 分布
  14. </view>
  15. </view>
  16. <view class="cu-bar search">
  17. <view class="search-form round" @click="naviageToPage('/pages/grain_pulse/search')">
  18. <image class='icon-scarch' src="../../static/img/liangmai/sousuo.png" mode=""></image>
  19. <view class='Regular'> 请输入货名或标题</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="content">
  24. <view @click='friendcircle' class="friendcircle">
  25. <view class='title flex align-item-center Medium'>
  26. <image class='icon-friendcircle' src="../../static/img/liangmai/icon.png" mode=""></image>
  27. 圈友说
  28. </view>
  29. <view class='friendcircle-content flex justify-between'>
  30. <image class='bg' src="../../static/img/liangmai/bg.png" mode=""></image>
  31. <view class='friendcircle-content-right'>
  32. <view class='friendcircle-content-right-item Regular flex align-item-center'>
  33. <image class='headportrait' src="../../static/img/add@3x.png" mode=""></image>中天昊元粮库中天昊元…
  34. </view>
  35. <view class='friendcircle-content-right-item Regular flex align-item-center'>
  36. <image class='headportrait' src="../../static/img/add@3x.png" mode=""></image>中天昊元粮库中天昊元…
  37. </view>
  38. <view class='friendcircle-content-right-item Regular flex align-item-center'>
  39. <image class='headportrait' src="../../static/img/add@3x.png" mode=""></image>中天昊元粮库中天昊元…
  40. </view>
  41. <view class='friendcircle-content-right-item Regular flex align-item-center'>
  42. <image class='headportrait' src="../../static/img/add@3x.png" mode=""></image>中天昊元粮库中天昊元…
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <scroll-view scroll-x="true" scroll-with-animation="true" class='list-type'>
  48. <view v-for='item in searchTypes' @click='mainBusinessTypecahnge(item)'
  49. :class='mainBusinessTypeKey==item.value?"Semibold active":"Regular"' class="typeitem">{{item.name}}
  50. </view>
  51. </scroll-view>
  52. <view v-for='item in datalist' @click='todetails(item)' class="listitem">
  53. <view class="flex">
  54. <image class='listitem-left' :src="item.attachmentAddress" mode=""></image>
  55. <view class="listitem-right">
  56. <view class="companyname Medium">{{item.compName}}</view>
  57. <view class='Regular introduce'>{{item.companyProfile}}</view>
  58. </view>
  59. </view>
  60. <view class="flex align-item-center justify-between">
  61. <view @click.stop='naviageToPage("/pages/grain_pulse/localtion/localtion")'
  62. class='companylocation flex align-item-center Regular'>
  63. <image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
  64. {{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}
  65. </view>
  66. <view v-if='position.name!="未设置"' class='distance Regular'>50m</view>
  67. </view>
  68. </view>
  69. </view>
  70. <view v-if='datalist.length==0' class="enter" @click="enter">
  71. <image style='width:56.5px;height:28px;' src="../../static/img/liangmai/ruzhu.png" mode=""></image>
  72. <view class='enter-content'>入驻</view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. export default {
  78. components: {
  79. },
  80. data() {
  81. return {
  82. position:{
  83. name:"未设置"
  84. } ,
  85. status: 0,
  86. mainBusinessType: '',
  87. mainBusinessTypeKey: '0',
  88. pageSize: 10,
  89. currentPage: 1,
  90. searchTypes: [{
  91. name: '全部',
  92. value: '0'
  93. }, {
  94. name: '粮库',
  95. value: '1'
  96. }, {
  97. name: '加工厂',
  98. value: '2'
  99. },
  100. {
  101. name: '烘干塔',
  102. value: '3'
  103. }, {
  104. name: '饲料厂',
  105. value: '4'
  106. }, {
  107. name: '养殖场',
  108. value: '5'
  109. },
  110. {
  111. name: '粮贸',
  112. value: '6'
  113. }, {
  114. name: '期货',
  115. value: '7'
  116. }
  117. ],
  118. datalist: []
  119. }
  120. },
  121. onShow(val) {
  122. this.$api.doRequest('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
  123. mainBusinessType: this.mainBusinessType,
  124. pageSize: this.pageSize,
  125. currentPage: this.currentPage,
  126. pcFlag: 2
  127. }).then(res => {
  128. if (res.data.code == 200) {
  129. this.datalist = res.data.data.records
  130. }
  131. })
  132. uni.getStorage({
  133. key: 'setLocaltion',
  134. success: (res) => {
  135. console.log(res.data)
  136. this.position = res.data
  137. // uni.removeStorage({
  138. // key: 'setLocaltion'
  139. // })
  140. },
  141. })
  142. },
  143. onLoad(option) {
  144. if (option.position){
  145. this.position = option.position
  146. }
  147. },
  148. methods: {
  149. mainBusinessTypecahnge(item) {
  150. if (item.name != '全部') {
  151. this.mainBusinessType = item.name
  152. } else {
  153. this.mainBusinessType = ''
  154. }
  155. this.mainBusinessTypeKey = item.value
  156. },
  157. enter() {
  158. //入驻
  159. uni.navigateTo({
  160. url: '/pages/grain_pulse/enter'
  161. })
  162. },
  163. friendcircle() {
  164. uni.navigateTo({
  165. url: '/pages/grain_pulse/dynamic'
  166. })
  167. },
  168. todetails(item) {
  169. uni.navigateTo({
  170. url: '/pages/grain_pulse/details?id=' + item.id
  171. })
  172. },
  173. naviageToPage(item) {
  174. console.log(item)
  175. uni.navigateTo({
  176. url: item
  177. })
  178. }
  179. }
  180. }
  181. </script>
  182. <style scoped>
  183. /* 《--头部 */
  184. .header {
  185. padding: 0 12.5px;
  186. background: #fff;
  187. border-radius: 0 0 10px 10px;
  188. }
  189. /* 头部--》 */
  190. /* 《--定位 */
  191. .location {
  192. width: 15.5px;
  193. height: 17.5px;
  194. margin-right: 2.5px;
  195. }
  196. .locationwrap {
  197. font-size: 16px;
  198. }
  199. /* 定位 --》 */
  200. /* 《--分布 */
  201. .map {
  202. padding: 8.5px 0;
  203. }
  204. .cangku {
  205. width: 16.5px;
  206. height: 16.5px;
  207. margin-right: 5px;
  208. }
  209. .distribution {
  210. background: #F5F6FA;
  211. width: 71.5px;
  212. height: 32px;
  213. border-radius: 15px;
  214. font-size: 12px;
  215. }
  216. /* 分布--》 */
  217. /* 《--搜索 */
  218. .cu-bar .search-form {
  219. background: #F5F6F9;
  220. margin: 0;
  221. margin-bottom: 18px;
  222. padding: 10px 18px;
  223. }
  224. .icon-scarch {
  225. width: 15px;
  226. height: 15px;
  227. margin-right: 5px;
  228. }
  229. /* 搜索--》 */
  230. /* 《--内容 */
  231. .content {
  232. margin-top: 13px;
  233. }
  234. /* 内容--》 */
  235. /* 《--圈友说 */
  236. .friendcircle {
  237. background: #fff;
  238. margin: 0 9px;
  239. border-radius: 4px;
  240. }
  241. .friendcircle .title {
  242. font-size: 16px;
  243. padding: 11.5px 14.5px;
  244. }
  245. .icon-friendcircle {
  246. width: 17px;
  247. height: 17px;
  248. margin-right: 5.5px;
  249. }
  250. .bg {
  251. width: 110px;
  252. height: 124px;
  253. }
  254. .friendcircle-content {
  255. padding: 0 17px 18px;
  256. }
  257. .friendcircle-content-right {
  258. margin-left: 15.5px;
  259. }
  260. .friendcircle-content-right-item {
  261. background: linear-gradient(90deg, #F5F6FA 0%, #FFFFFF 100%);
  262. border-radius: 12.5px;
  263. margin-bottom: 10px;
  264. width: 205.5px;
  265. font-size: 12px;
  266. padding: 3px 0;
  267. }
  268. .headportrait {
  269. width: 22.5px;
  270. height: 22.5px;
  271. margin-right: 8.5px;
  272. }
  273. /* 圈友说--》 */
  274. /* 《--类型 */
  275. .list-type {
  276. background: linear-gradient(180deg, #F5F6FA 0%, #FFFFFF 100%);
  277. width: 100vw;
  278. padding-top: 5px;
  279. height: 49px;
  280. overflow-x: scroll;
  281. white-space: nowrap;
  282. }
  283. .typeitem {
  284. margin: 10px;
  285. position: relative;
  286. display: inline-block;
  287. padding-top: 8px;
  288. padding-bottom: 5px;
  289. }
  290. .typeitem.active {
  291. font-size: 16px;
  292. }
  293. .typeitem.active:after {
  294. content: '';
  295. display: block;
  296. position: absolute;
  297. height: 3px;
  298. bottom: 0;
  299. background: #22C572;
  300. width: 50%;
  301. left: 50%;
  302. transform: translateX(-50%);
  303. }
  304. /* 类型--》 */
  305. /* 《--数据 */
  306. .listitem {
  307. background: #fff;
  308. margin: 10px;
  309. padding: 15px 19px;
  310. }
  311. .listitem-left {
  312. width: 98.5px;
  313. height: 96.5px;
  314. margin-right: 8px;
  315. border-radius: 5px;
  316. }
  317. .companyname {
  318. font-size: 14px;
  319. color: #333;
  320. }
  321. .introduce {
  322. font-size: 12px;
  323. color: #676E80;
  324. }
  325. .companylocation {
  326. color: #676E80;
  327. background: #F5F6FA;
  328. margin-top: 8px;
  329. padding: 4px 10px;
  330. border-radius: 15px;
  331. }
  332. .distance {
  333. color: #AFB3BF;
  334. padding: 4px;
  335. margin-top: 8px;
  336. }
  337. /* 数据--》 */
  338. .enter {
  339. position: fixed;
  340. right: 0;
  341. top: 80%;
  342. width: 56.5px;
  343. height: 28px;
  344. }
  345. .enter-content {
  346. position: absolute;
  347. right: 5px;
  348. top: 50%;
  349. transform: translateY(-50%);
  350. color: #fff;
  351. }
  352. </style>