home.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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. if (option.position)
  143. this.position = option.position
  144. },
  145. methods: {
  146. mainBusinessTypecahnge(item) {
  147. if (item.name != '全部') {
  148. this.mainBusinessType = item.name
  149. } else {
  150. this.mainBusinessType = ''
  151. }
  152. this.mainBusinessTypeKey = item.value
  153. },
  154. enter() {
  155. //入驻
  156. uni.navigateTo({
  157. url: '/pages/grain_pulse/enter'
  158. })
  159. },
  160. friendcircle() {
  161. uni.navigateTo({
  162. url: '/pages/grain_pulse/friendcircle'
  163. })
  164. },
  165. todetails(item) {
  166. uni.navigateTo({
  167. url: '/pages/grain_pulse/details?id=' + item.id
  168. })
  169. },
  170. naviageToPage(item) {
  171. console.log(item)
  172. uni.navigateTo({
  173. url: item
  174. })
  175. }
  176. }
  177. }
  178. </script>
  179. <style scoped>
  180. /* 《--头部 */
  181. .header {
  182. padding: 0 12.5px;
  183. background: #fff;
  184. border-radius: 0 0 10px 10px;
  185. }
  186. /* 头部--》 */
  187. /* 《--定位 */
  188. .location {
  189. width: 15.5px;
  190. height: 17.5px;
  191. margin-right: 2.5px;
  192. }
  193. .locationwrap {
  194. font-size: 16px;
  195. }
  196. /* 定位 --》 */
  197. /* 《--分布 */
  198. .map {
  199. padding: 8.5px 0;
  200. }
  201. .cangku {
  202. width: 16.5px;
  203. height: 16.5px;
  204. margin-right: 5px;
  205. }
  206. .distribution {
  207. background: #F5F6FA;
  208. width: 71.5px;
  209. height: 32px;
  210. border-radius: 15px;
  211. font-size: 12px;
  212. }
  213. /* 分布--》 */
  214. /* 《--搜索 */
  215. .cu-bar .search-form {
  216. background: #F5F6F9;
  217. margin: 0;
  218. margin-bottom: 18px;
  219. padding: 10px 18px;
  220. }
  221. .icon-scarch {
  222. width: 15px;
  223. height: 15px;
  224. margin-right: 5px;
  225. }
  226. /* 搜索--》 */
  227. /* 《--内容 */
  228. .content {
  229. margin-top: 13px;
  230. }
  231. /* 内容--》 */
  232. /* 《--圈友说 */
  233. .friendcircle {
  234. background: #fff;
  235. margin: 0 9px;
  236. border-radius: 4px;
  237. }
  238. .friendcircle .title {
  239. font-size: 16px;
  240. padding: 11.5px 14.5px;
  241. }
  242. .icon-friendcircle {
  243. width: 17px;
  244. height: 17px;
  245. margin-right: 5.5px;
  246. }
  247. .bg {
  248. width: 110px;
  249. height: 124px;
  250. }
  251. .friendcircle-content {
  252. padding: 0 17px 18px;
  253. }
  254. .friendcircle-content-right {
  255. margin-left: 15.5px;
  256. }
  257. .friendcircle-content-right-item {
  258. background: linear-gradient(90deg, #F5F6FA 0%, #FFFFFF 100%);
  259. border-radius: 12.5px;
  260. margin-bottom: 10px;
  261. width: 205.5px;
  262. font-size: 12px;
  263. padding: 3px 0;
  264. }
  265. .headportrait {
  266. width: 22.5px;
  267. height: 22.5px;
  268. margin-right: 8.5px;
  269. }
  270. /* 圈友说--》 */
  271. /* 《--类型 */
  272. .list-type {
  273. background: linear-gradient(180deg, #F5F6FA 0%, #FFFFFF 100%);
  274. width: 100vw;
  275. padding-top: 5px;
  276. height: 49px;
  277. overflow-x: scroll;
  278. white-space: nowrap;
  279. }
  280. .typeitem {
  281. margin: 10px;
  282. position: relative;
  283. display: inline-block;
  284. padding-top: 8px;
  285. padding-bottom: 5px;
  286. }
  287. .typeitem.active {
  288. font-size: 16px;
  289. }
  290. .typeitem.active:after {
  291. content: '';
  292. display: block;
  293. position: absolute;
  294. height: 3px;
  295. bottom: 0;
  296. background: #22C572;
  297. width: 50%;
  298. left: 50%;
  299. transform: translateX(-50%);
  300. }
  301. /* 类型--》 */
  302. /* 《--数据 */
  303. .listitem {
  304. background: #fff;
  305. margin: 10px;
  306. padding: 15px 19px;
  307. }
  308. .listitem-left {
  309. width: 98.5px;
  310. height: 96.5px;
  311. margin-right: 8px;
  312. border-radius: 5px;
  313. }
  314. .companyname {
  315. font-size: 14px;
  316. color: #333;
  317. }
  318. .introduce {
  319. font-size: 12px;
  320. color: #676E80;
  321. }
  322. .companylocation {
  323. color: #676E80;
  324. background: #F5F6FA;
  325. margin-top: 8px;
  326. padding: 4px 10px;
  327. border-radius: 15px;
  328. }
  329. .distance {
  330. color: #AFB3BF;
  331. padding: 4px;
  332. margin-top: 8px;
  333. }
  334. /* 数据--》 */
  335. .enter {
  336. position: fixed;
  337. right: 0;
  338. top: 80%;
  339. width: 56.5px;
  340. height: 28px;
  341. }
  342. .enter-content {
  343. position: absolute;
  344. right: 5px;
  345. top: 50%;
  346. transform: translateY(-50%);
  347. color: #fff;
  348. }
  349. </style>