home.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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}}
  9. </view>
  10. <view @click='naviageToPage("/pages/grain_pulse/distribution/distribution")'
  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. 辽宁省营口市鲅鱼圈区xx路108号
  65. </view>
  66. <view 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. status: 0,
  84. mainBusinessType: '',
  85. mainBusinessTypeKey: '0',
  86. pageSize: 10,
  87. currentPage: 1,
  88. searchTypes: [{
  89. name: '全部',
  90. value: '0'
  91. }, {
  92. name: '粮库',
  93. value: '1'
  94. }, {
  95. name: '加工厂',
  96. value: '2'
  97. },
  98. {
  99. name: '烘干塔',
  100. value: '3'
  101. }, {
  102. name: '饲料厂',
  103. value: '4'
  104. }, {
  105. name: '养殖场',
  106. value: '5'
  107. },
  108. {
  109. name: '粮贸',
  110. value: '6'
  111. }, {
  112. name: '期货',
  113. value: '7'
  114. }
  115. ],
  116. datalist: []
  117. }
  118. },
  119. onShow(val) {
  120. this.$api.doRequest('get', '/settledCompanyInfo/selectSettledCompanyInfo', {
  121. mainBusinessType: this.mainBusinessType,
  122. pageSize: this.pageSize,
  123. currentPage: this.currentPage,
  124. pcFlag: 2
  125. }).then(res => {
  126. if (res.data.code == 200) {
  127. this.datalist = res.data.data.records
  128. }
  129. })
  130. uni.getStorage({
  131. key: 'setLocaltion',
  132. success: (res) => {
  133. console.log(res.data)
  134. this.position = res.data
  135. uni.removeStorage({
  136. key: 'setLocaltion'
  137. })
  138. },
  139. })
  140. },
  141. onLoad(option) {
  142. debugger
  143. if (option.position)
  144. this.position = option.position
  145. },
  146. methods: {
  147. mainBusinessTypecahnge(item) {
  148. if (item.name != '全部') {
  149. this.mainBusinessType = item.name
  150. } else {
  151. this.mainBusinessType = ''
  152. }
  153. this.mainBusinessTypeKey = item.value
  154. },
  155. enter() {
  156. //入驻
  157. uni.navigateTo({
  158. url: '/pages/grain_pulse/enter'
  159. })
  160. },
  161. friendcircle() {
  162. uni.navigateTo({
  163. url: '/pages/grain_pulse/friendcircle'
  164. })
  165. },
  166. todetails(item) {
  167. uni.navigateTo({
  168. url: '/pages/grain_pulse/details?id=' + item.id
  169. })
  170. },
  171. naviageToPage(item) {
  172. console.log(item)
  173. uni.navigateTo({
  174. url: item
  175. })
  176. }
  177. }
  178. }
  179. </script>
  180. <style scoped>
  181. /* 《--头部 */
  182. .header {
  183. padding: 0 12.5px;
  184. background: #fff;
  185. border-radius: 0 0 10px 10px;
  186. }
  187. /* 头部--》 */
  188. /* 《--定位 */
  189. .location {
  190. width: 15.5px;
  191. height: 17.5px;
  192. margin-right: 2.5px;
  193. }
  194. .locationwrap {
  195. font-size: 16px;
  196. }
  197. /* 定位 --》 */
  198. /* 《--分布 */
  199. .map {
  200. padding: 8.5px 0;
  201. }
  202. .cangku {
  203. width: 16.5px;
  204. height: 16.5px;
  205. margin-right: 5px;
  206. }
  207. .distribution {
  208. background: #F5F6FA;
  209. width: 71.5px;
  210. height: 32px;
  211. border-radius: 15px;
  212. font-size: 12px;
  213. }
  214. /* 分布--》 */
  215. /* 《--搜索 */
  216. .cu-bar .search-form {
  217. background: #F5F6F9;
  218. margin: 0;
  219. margin-bottom: 18px;
  220. padding: 10px 18px;
  221. }
  222. .icon-scarch {
  223. width: 15px;
  224. height: 15px;
  225. margin-right: 5px;
  226. }
  227. /* 搜索--》 */
  228. /* 《--内容 */
  229. .content {
  230. margin-top: 13px;
  231. }
  232. /* 内容--》 */
  233. /* 《--圈友说 */
  234. .friendcircle {
  235. background: #fff;
  236. margin: 0 9px;
  237. border-radius: 4px;
  238. }
  239. .friendcircle .title {
  240. font-size: 16px;
  241. padding: 11.5px 14.5px;
  242. }
  243. .icon-friendcircle {
  244. width: 17px;
  245. height: 17px;
  246. margin-right: 5.5px;
  247. }
  248. .bg {
  249. width: 110px;
  250. height: 124px;
  251. }
  252. .friendcircle-content {
  253. padding: 0 17px 18px;
  254. }
  255. .friendcircle-content-right {
  256. margin-left: 15.5px;
  257. }
  258. .friendcircle-content-right-item {
  259. background: linear-gradient(90deg, #F5F6FA 0%, #FFFFFF 100%);
  260. border-radius: 12.5px;
  261. margin-bottom: 10px;
  262. width: 205.5px;
  263. font-size: 12px;
  264. padding: 3px 0;
  265. }
  266. .headportrait {
  267. width: 22.5px;
  268. height: 22.5px;
  269. margin-right: 8.5px;
  270. }
  271. /* 圈友说--》 */
  272. /* 《--类型 */
  273. .list-type {
  274. background: linear-gradient(180deg, #F5F6FA 0%, #FFFFFF 100%);
  275. width: 100vw;
  276. padding-top: 5px;
  277. height: 49px;
  278. overflow-x: scroll;
  279. white-space: nowrap;
  280. }
  281. .typeitem {
  282. margin: 10px;
  283. position: relative;
  284. display: inline-block;
  285. padding-top: 8px;
  286. padding-bottom: 5px;
  287. }
  288. .typeitem.active {
  289. font-size: 16px;
  290. }
  291. .typeitem.active:after {
  292. content: '';
  293. display: block;
  294. position: absolute;
  295. height: 3px;
  296. bottom: 0;
  297. background: #22C572;
  298. width: 50%;
  299. left: 50%;
  300. transform: translateX(-50%);
  301. }
  302. /* 类型--》 */
  303. /* 《--数据 */
  304. .listitem {
  305. background: #fff;
  306. margin: 10px;
  307. padding: 15px 19px;
  308. }
  309. .listitem-left {
  310. width: 98.5px;
  311. height: 96.5px;
  312. margin-right: 8px;
  313. border-radius: 5px;
  314. }
  315. .companyname {
  316. font-size: 14px;
  317. color: #333;
  318. }
  319. .introduce {
  320. font-size: 12px;
  321. color: #676E80;
  322. }
  323. .companylocation {
  324. color: #676E80;
  325. background: #F5F6FA;
  326. margin-top: 8px;
  327. padding: 4px 10px;
  328. border-radius: 15px;
  329. }
  330. .distance {
  331. color: #AFB3BF;
  332. padding: 4px;
  333. margin-top: 8px;
  334. }
  335. /* 数据--》 */
  336. .enter {
  337. position: fixed;
  338. right: 0;
  339. top: 80%;
  340. width: 56.5px;
  341. height: 28px;
  342. }
  343. .enter-content {
  344. position: absolute;
  345. right: 5px;
  346. top: 50%;
  347. transform: translateY(-50%);
  348. color: #fff;
  349. }
  350. </style>