index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view>
  3. <view v-if='company.length==0' style='text-align:center;transform: translateY(30%);'>
  4. <image class='image zanwu' :showLoading="true" src="../../../static/mine/company/zanwu.png"></image>
  5. <view style='font-size:13px;'>您还没有公司哦,快来添加吧~</view>
  6. <view @click="goDetailPage('/pages/mine/company/addcompany')" class='add'>去添加</view>
  7. </view>
  8. <view v-else class='content'>
  9. <view class='content1'>所属公司({{company.length}})</view>
  10. <view v-for='item in company' class='wrap'>
  11. <view class='flex flex-space-between'>
  12. <view>{{item.companyName}}</view>
  13. <view v-if='item.status=="已认证"' class='status passed'>{{item.status}}</view>
  14. <view v-if='item.status=="审核中"' class='status aduit'>{{item.status}}</view>
  15. <view v-if='item.status=="已驳回"' class='status reject'>{{item.status}}</view>
  16. </view>
  17. <view class="row2">
  18. <image v-if='item.status!="审核中"' @click='edit(item)' style='width:17px;height:17px;margin:0 10px;' src="@/static/mine/company/edit.png"></image>
  19. <image @click='del(item)' style='width:17px;height:17px;margin:0 10px;' src="@/static/mine/company/del.png"></image>
  20. </view>
  21. </view>
  22. <view class='footer'>
  23. <view @click="goDetailPage('/pages/mine/company/addcompany')" class='newlyIncreased'>新增</view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapState
  31. } from 'vuex';
  32. export default {
  33. data() {
  34. return {
  35. company:[]
  36. }
  37. },
  38. computed: {
  39. ...mapState(['hasLogin', 'userInfo']),
  40. },
  41. onLoad(){
  42. var _this = this;
  43. if (!this.hasLogin) {
  44. uni.$u.route('/pages/public/login');
  45. }
  46. this.getList()
  47. },
  48. methods: {
  49. goDetailPage(src) {
  50. uni.$u.route(src);
  51. },
  52. edit(item){
  53. this.goDetailPage('/pages/mine/company/editcompany?id='+item.id)
  54. },
  55. del(item){
  56. uni.showLoading({
  57. title: '加载中',
  58. mask:true
  59. })
  60. var _this=this
  61. this.$request.baseRequest('post', '/companyInfo/api/deleteCompany', {id:item.id}).then(res => {
  62. uni.hideLoading()
  63. uni.$u.toast('删除成功')
  64. this.getList()
  65. })
  66. .catch(res => {
  67. uni.hideLoading()
  68. uni.showToast({
  69. title: res.message,
  70. icon: 'none',
  71. duration: 2000
  72. })
  73. });
  74. },
  75. goDetailPage(src){
  76. uni.$u.route(src);
  77. },
  78. getList(){
  79. uni.showLoading({
  80. title: '加载中',
  81. mask:true
  82. })
  83. var _this=this
  84. this.$request.baseRequest('get', '/companyInfo/selectCompany', {commonId:this.userInfo.id}).then(res => {
  85. uni.hideLoading()
  86. this.company=res.data
  87. })
  88. .catch(res => {
  89. uni.hideLoading()
  90. uni.showToast({
  91. title: res.message,
  92. icon: 'none',
  93. duration: 2000
  94. })
  95. });
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. page{
  102. background:#F5F6FA;
  103. }
  104. .zanwu{
  105. width:235px;
  106. height:235px;
  107. }
  108. .add{
  109. width:106px;height:42px;
  110. margin:36px auto 0;
  111. color:#fff;
  112. background:url(../../../static/mine/company/Mask@3x.png);
  113. background-size:100%;
  114. line-height:42px ;
  115. }
  116. .wrap{
  117. background:#fff;
  118. border-radius:10rpx;
  119. padding:24rpx;
  120. box-sizing: border-box;
  121. margin-top: 20rpx;
  122. .row2{
  123. margin-top: 112rpx;
  124. display: flex;
  125. justify-content: flex-end;
  126. }
  127. }
  128. .status{
  129. font-size:26rpx;
  130. padding:5rpx 18rpx;
  131. color:#fff;
  132. border-radius:20rpx;
  133. }
  134. .status.passed{
  135. background:#25E491;
  136. }
  137. .status.aduit{
  138. background:#FE8031;
  139. }
  140. .status.reject{
  141. background:#FC5A51;
  142. }
  143. .content{
  144. padding: 20rpx;
  145. }
  146. .footer{
  147. position:fixed;
  148. background:#fff;
  149. width:100%;
  150. bottom:0;
  151. left:0;
  152. padding:15px 15px 30px;
  153. box-sizing: border-box;
  154. }
  155. .newlyIncreased{
  156. width: 100%;
  157. height: 80rpx;
  158. margin: 0 auto;
  159. text-align: center;
  160. color: #fff;
  161. background: #2772FB;
  162. background-size: 100%;
  163. border-radius: 50rpx;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. }
  168. </style>