my_grain_pulse.vue 7.6 KB

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