my_grain_pulse.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view style='margin-bottom:70px;'>
  3. <scroll-view scroll-x="true" scroll-with-animation="true" class='list-type'>
  4. <view v-for='item in searchTypes' @click='changetype(item)' :class='mainBusinessType==item.name?"Semibold active":"Regular"' class="typeitem">{{item.name}}</view>
  5. </scroll-view>
  6. <view v-for='item in datalist' @click='todetails(item)' class="listitem">
  7. <view class="flex" v-if='mainBusinessType=="我的企业"'>
  8. <image class='listitem-left' :src="item.attachmentAddress" mode=""></image>
  9. <view class="listitem-right">
  10. <view class="flex justify-between">
  11. <view class="companyname Medium">{{item.compName}}</view>
  12. <view v-if='item.status=="待审核"' class='listitemStatus audit Regular'>审核中</view>
  13. <view v-if='item.status=="已驳回"' class='listitemStatus notPass Regular'>未通过</view>
  14. <view v-if='item.status=="已通过"' class='listitemStatus pass Regular'>已通过</view>
  15. </view>
  16. <view class='companylocation flex align-item-center Regular'>
  17. <image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
  18. 辽宁省营口市鲅鱼圈区xx路108号
  19. </view>
  20. <view>
  21. <view class="button Regular">隐藏</view>
  22. <view class="button Regular">编辑</view>
  23. <view @click='del(item)' class="button Regular">删除</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view v-else>
  28. <view class="flex">
  29. <image class='listitem-left' :src="item.attachmentAddress" mode=""></image>
  30. <view class="listitem-right">
  31. <view class="flex justify-between">
  32. <view class="companyname Medium">中天昊元粮库中天昊元粮库</view>
  33. <image style='width:12px;height:12px;' :src="status1?'../../static/img/liangmai/my_shoucang1.png':'../../static/img/liangmai/my_shoucang.png'" mode=""></image>
  34. </view>
  35. <view class='Regular introduce'>我是企业介绍我是企业介绍我是企业介绍我是</view>
  36. </view>
  37. </view>
  38. <view class="flex align-item-center justify-between">
  39. <view class='companylocation flex align-item-center Regular'>
  40. <image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
  41. 辽宁省营口市鲅鱼圈区xx路108号
  42. </view>
  43. <view class='distance Regular'>50m</view>
  44. </view>
  45. </view>
  46. <view v-if='mainBusinessType=="我的企业"' class='exitloginwrap'>
  47. <button @click.stop='enterclick()' class='exitlogin'>新增</button>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import {
  54. mapState
  55. } from 'vuex';
  56. export default {
  57. components: {
  58. },
  59. data() {
  60. return {
  61. status:0,
  62. mainBusinessType:'我的企业',
  63. pageSize: 10,
  64. currentPage: 1,
  65. datalist:[],
  66. status1:true,
  67. searchTypes:[
  68. {name:'我的企业',value:'1'},{name:'我的收藏',value:'1'}
  69. ],
  70. }
  71. },
  72. onShow(){
  73. this.getList()
  74. },
  75. onLoad(){
  76. },
  77. computed: {
  78. ...mapState(['hasLogin', 'userInfo'])
  79. },
  80. methods: {
  81. getList(){
  82. if(this.mainBusinessType=='我的企业'){
  83. this.$api.doRequest('get','/settledCompanyInfo/selectSettledCompanyInfo',{mainBusinessType:'',pageSize: this.pageSize,
  84. currentPage: this.currentPage,pcFlag:2}).then(res => {
  85. if(res.data.code==200){
  86. this.datalist=res.data.data.records
  87. }
  88. })
  89. }else{
  90. this.$api.doRequest('get','/settledCompanyInfo/myCollection',{phone:this.userInfo.phone,pageSize:this.pageSize,
  91. currentPage: this.currentPage,pcFlag:2}).then(res => {
  92. if(res.data.code==200){
  93. this.datalist=res.data.data.records
  94. }
  95. })
  96. }
  97. },
  98. del(item){
  99. this.$api.doRequest('post','/settledCompanyInfo/api/deleteSettledCompanyInfo',{id:item.id}).then(res => {
  100. if(res.data.code==200){
  101. this.$api.msg('删除成功')
  102. }else{
  103. this.$api.msg('删除失败')
  104. }
  105. })
  106. },
  107. friendcircle(){
  108. uni.navigateTo({
  109. url:'/pages/grain_pulse/friendcircle'
  110. })
  111. },
  112. todetails(item) {
  113. uni.navigateTo({
  114. url: '/pages/grain_pulse/details?id=' + item.id
  115. })
  116. },
  117. naviageToPage(item){
  118. uni.navigateTo({
  119. url:item
  120. })
  121. },
  122. enterclick(){
  123. //入驻
  124. uni.navigateTo({
  125. url:'/pages/grain_pulse/enter'
  126. })
  127. },
  128. changetype(item){
  129. this.mainBusinessType=item.name
  130. this.getList()
  131. }
  132. }
  133. }
  134. </script>
  135. <style scoped>
  136. /* 《--头部 */
  137. .header{
  138. padding:0 12.5px;
  139. background:#fff;
  140. border-radius:0 0 10px 10px;
  141. }
  142. /* 头部--》 */
  143. /* 《--定位 */
  144. .location{
  145. width:15.5px;height:17.5px;margin-right:2.5px;
  146. }
  147. .locationwrap{
  148. font-size:16px;
  149. }
  150. /* 定位 --》 */
  151. /* 《--分布 */
  152. .map{
  153. padding:8.5px 0;
  154. }
  155. .cangku{
  156. width:16.5px;height:16.5px;margin-right:5px;
  157. }
  158. .distribution{
  159. background:#F5F6FA;
  160. width: 71.5px;
  161. height:32px;
  162. border-radius:15px;
  163. font-size:12px;
  164. }
  165. /* 分布--》 */
  166. /* 《--搜索 */
  167. .cu-bar .search-form{
  168. background:#F5F6F9;
  169. margin:0;
  170. margin-bottom:18px;
  171. padding:10px 18px;
  172. }
  173. .icon-scarch{
  174. width:15px;
  175. height:15px;
  176. margin-right:5px;
  177. }
  178. /* 搜索--》 */
  179. /* 《--内容 */
  180. .content{
  181. margin-top:13px;
  182. }
  183. /* 内容--》 */
  184. /* 《--类型 */
  185. .list-type{
  186. background: #fff;
  187. width:100vw;
  188. padding-top:5px;
  189. height:49px;
  190. overflow-x: scroll;
  191. white-space: nowrap;
  192. }
  193. .typeitem{
  194. margin:10px;
  195. position:relative;
  196. display:inline-block;
  197. padding-bottom:10px;
  198. font-size:17px;
  199. }
  200. .typeitem.active:after{
  201. content:'';
  202. display:block;
  203. position:absolute;
  204. height:3px;
  205. bottom:0;
  206. background:#22C572;
  207. width:18px;
  208. left:50%;
  209. transform: translateX(-50%);
  210. }
  211. /* 类型--》 */
  212. /* 《--数据 */
  213. .listitem{
  214. background:#fff;
  215. margin:10px;
  216. padding:15px 19px;
  217. border-radius:10px;
  218. }
  219. .listitem-left{
  220. width:98.5px;
  221. height:96.5px;
  222. margin-right:8px;
  223. border-radius:5px;
  224. }
  225. .companyname{
  226. font-size:14px;
  227. color:#333;
  228. }
  229. .introduce{
  230. font-size:12px;
  231. color:#676E80;
  232. }
  233. .companylocation{
  234. color:#676E80;
  235. font-size:12px;
  236. margin-top:8px;
  237. padding:4px 9px;
  238. }
  239. .distance{
  240. color:#AFB3BF;
  241. padding:4px;
  242. margin-top:8px;
  243. }
  244. /* 数据--》 */
  245. .button{
  246. display:inline-block;
  247. border:1px solid #CDCDCD;
  248. padding:6px 15px;
  249. border-radius:15px;
  250. margin:5px 5px;
  251. }
  252. .listitemStatus{
  253. margin-left:2px;
  254. }
  255. .listitemStatus.audit{
  256. color:#FE6430;
  257. }
  258. .listitemStatus.notPass{
  259. color:#FB1E1E;
  260. }
  261. .listitemStatus.pass{
  262. color:#22C572;
  263. }
  264. .exitloginwrap{
  265. position:fixed;
  266. bottom:0;
  267. left:0;
  268. width:100%;
  269. padding-bottom:20px;
  270. }
  271. .exitlogin{
  272. width:90%;
  273. background:#22C572;
  274. border-radius:30px;
  275. color:#fff;
  276. font-size:17px;
  277. }
  278. .exitlogin:after{
  279. border:none;
  280. }
  281. </style>