123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <template>
- <view style='margin-bottom:70px;'>
- <scroll-view scroll-x="true" scroll-with-animation="true" class='list-type'>
- <view v-for='item in searchTypes' @click='changetype(item)' :class='mainBusinessType==item.name?"Semibold active":"Regular"' class="typeitem">{{item.name}}</view>
- </scroll-view>
- <view v-for='item in datalist' @click='todetails(item)' class="listitem">
- <view class="flex" v-if='mainBusinessType=="我的企业"'>
- <image class='listitem-left' :src="item.attachmentAddress" mode=""></image>
- <view class="listitem-right">
- <view class="flex justify-between">
- <view class="companyname Medium">{{item.compName}}</view>
- <view v-if='item.status=="待审核"' class='listitemStatus audit Regular'>审核中</view>
- <view v-if='item.status=="已驳回"' class='listitemStatus notPass Regular'>未通过</view>
- <view v-if='item.status=="已通过"' class='listitemStatus pass Regular'>已通过</view>
- </view>
- <view class='companylocation flex align-item-center Regular'>
- <image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
- 辽宁省营口市鲅鱼圈区xx路108号
- </view>
- <view>
- <view v-if='item.showFlag==2' @click.stop='showHidden(item)' class="button Regular">显示</view>
- <view v-if='item.showFlag==1' @click.stop='showHidden(item)' class="button Regular">隐藏</view>
- <view @click.stop='edit(item)' class="button Regular">编辑</view>
- <view @click.stop='del(item)' class="button Regular">删除</view>
- </view>
- </view>
- </view>
- <view v-else>
- <view class="flex">
- <image class='listitem-left' :src="item.attachmentAddress" mode=""></image>
- <view class="listitem-right">
- <view class="flex justify-between">
- <view class="companyname Medium">中天昊元粮库中天昊元粮库</view>
- <image style='width:12px;height:12px;' :src="status1?'../../static/img/liangmai/my_shoucang1.png':'../../static/img/liangmai/my_shoucang.png'" mode=""></image>
- </view>
- <view class='Regular introduce'>我是企业介绍我是企业介绍我是企业介绍我是</view>
- </view>
- </view>
- <view class="flex align-item-center justify-between">
- <view class='companylocation flex align-item-center Regular'>
- <image class='location' src="../../static/img/liangmai/icon_ditu.png" mode=""></image>
- 辽宁省营口市鲅鱼圈区xx路108号
- </view>
- <view class='distance Regular'>50m</view>
- </view>
- </view>
- <view v-if='mainBusinessType=="我的企业"' class='exitloginwrap'>
- <button @click.stop='enterclick()' class='exitlogin'>新增</button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- components: {
-
- },
- data() {
- return {
- status:0,
- mainBusinessType:'我的企业',
- pageSize: 10,
- currentPage: 1,
- datalist:[],
- status1:true,
- isLoadMore:false,
- searchTypes:[
- {name:'我的企业',value:'1'},{name:'我的收藏',value:'1'}
- ],
- }
- },
- onShow(){
- this.getList()
-
- },
- onLoad(){
-
- },
- onReachBottom() { //上拉触底函数
- if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
- this.currentPage += 1
- }
- this.getList()
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {
- getList(){
- this.isLoadMore=true
- if(this.mainBusinessType=='我的企业'){
- this.$api.doRequest('get','/settledCompanyInfo/selectSettledCompanyInfo',{mainBusinessType:'',pageSize: this.pageSize,
- currentPage: this.currentPage,pcFlag:2}).then(res => {
- if(res.data.code==200){
- this.isLoadMore=false
- this.datalist=res.data.data.records
- }
- })
- }else{
- this.$api.doRequest('get','/settledCompanyInfo/myCollection',{phone:this.userInfo.phone,pageSize:this.pageSize,
- currentPage: this.currentPage,pcFlag:2}).then(res => {
- if(res.data.code==200){
- this.datalist=res.data.data.records
- }
- })
- }
- },
- del(item){
- this.$api.doRequest('post','/settledCompanyInfo/api/deleteSettledCompanyInfo',{id:item.id}).then(res => {
- if(res.data.code==200){
- this.$api.msg('删除成功')
- }else{
- this.$api.msg('删除失败')
- }
- })
- },
- edit(item){
- if(item.status=='已驳回'||item.status=='已通过'){
- uni.navigateTo({
- url:'/pages/grain_pulse/editcompany?id='+item.id
- })
- }
-
- },
- showHidden(item){
- this.$api.doRequest('post','/settledCompanyInfo/api/showHidden',{id:item.id}).then(res => {
- if(res.data.code==200){
- if(item.showFlag==1){
- item.showFlag=2
- this.$api.msg('隐藏成功')
- }else{
- item.showFlag=1
- this.$api.msg('显示成功')
- }
-
- }else{
- if(item.showFlag==1){
- this.$api.msg('隐藏失败')
- }else{
- this.$api.msg('显示失败')
- }
- }
- })
- },
- friendcircle(){
- uni.navigateTo({
- url:'/pages/grain_pulse/friendcircle'
- })
- },
- todetails(item) {
- uni.navigateTo({
- url: '/pages/grain_pulse/details?id=' + item.id
- })
- },
- naviageToPage(item){
- uni.navigateTo({
- url:item
- })
- },
- enterclick(){
- //入驻
- uni.navigateTo({
- url:'/pages/grain_pulse/enter'
- })
- },
- changetype(item){
- this.mainBusinessType=item.name
- this.getList()
- }
- }
- }
- </script>
- <style scoped>
- /* 《--头部 */
- .header{
- padding:0 12.5px;
- background:#fff;
- border-radius:0 0 10px 10px;
- }
- /* 头部--》 */
- /* 《--定位 */
- .location{
- width:15.5px;height:17.5px;margin-right:2.5px;
- }
- .locationwrap{
- font-size:16px;
- }
- /* 定位 --》 */
- /* 《--分布 */
- .map{
- padding:8.5px 0;
- }
- .cangku{
- width:16.5px;height:16.5px;margin-right:5px;
- }
- .distribution{
- background:#F5F6FA;
- width: 71.5px;
- height:32px;
- border-radius:15px;
- font-size:12px;
- }
- /* 分布--》 */
- /* 《--搜索 */
- .cu-bar .search-form{
- background:#F5F6F9;
- margin:0;
- margin-bottom:18px;
- padding:10px 18px;
- }
- .icon-scarch{
- width:15px;
- height:15px;
- margin-right:5px;
- }
- /* 搜索--》 */
- /* 《--内容 */
- .content{
- margin-top:13px;
- }
- /* 内容--》 */
- /* 《--类型 */
- .list-type{
- background: #fff;
- width:100vw;
- padding-top:5px;
- height:49px;
- overflow-x: scroll;
- white-space: nowrap;
- }
- .typeitem{
- margin:10px;
- position:relative;
- display:inline-block;
- padding-bottom:10px;
- font-size:17px;
- }
- .typeitem.active:after{
- content:'';
- display:block;
- position:absolute;
- height:3px;
- bottom:0;
- background:#22C572;
- width:18px;
- left:50%;
- transform: translateX(-50%);
- }
- /* 类型--》 */
- /* 《--数据 */
- .listitem{
- background:#fff;
- margin:10px;
- padding:15px 19px;
- border-radius:10px;
- }
- .listitem-left{
- width:98.5px;
- height:96.5px;
- margin-right:8px;
- border-radius:5px;
- }
- .companyname{
- font-size:14px;
- color:#333;
- }
- .introduce{
- font-size:12px;
- color:#676E80;
- }
- .companylocation{
- color:#676E80;
- font-size:12px;
- margin-top:8px;
- padding:4px 9px;
- }
- .distance{
- color:#AFB3BF;
- padding:4px;
- margin-top:8px;
- }
- /* 数据--》 */
- .button{
- display:inline-block;
- border:1px solid #CDCDCD;
- padding:6px 15px;
- border-radius:15px;
- margin:5px 3px;
- }
- .listitemStatus{
- margin-left:2px;
- }
- .listitemStatus.audit{
- color:#FE6430;
- }
- .listitemStatus.notPass{
- color:#FB1E1E;
- }
- .listitemStatus.pass{
- color:#22C572;
- }
- .exitloginwrap{
- position:fixed;
- bottom:0;
- left:0;
- width:100%;
- padding-bottom:20px;
- }
- .exitlogin{
- width:90%;
- background:#22C572;
- border-radius:30px;
- color:#fff;
- font-size:17px;
- }
- .exitlogin:after{
- border:none;
- }
- </style>
|