official.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="content">
  3. <view class="gq-list">
  4. <view class="gq-item" v-for="item in list" @click="gotoDetail(item)">
  5. <view class="gq-logo">
  6. <image :src="item.avatar" mode="" class=""></image>
  7. </view>
  8. <view class="store-name ellipsis">
  9. {{type == 5?item.staffName:item.name }}
  10. </view>
  11. <!-- 员工 -->
  12. <template v-if="type == 5">
  13. <view class="info">
  14. <view class="info-tit">
  15. 职务:
  16. </view>
  17. <view class="info-val">
  18. {{item.departmentName}}
  19. </view>
  20. </view>
  21. <view class="info">
  22. <view class="info-tit">
  23. 工号:
  24. </view>
  25. <view class="info-val">
  26. {{item.staffCode}}
  27. </view>
  28. </view>
  29. </template>
  30. <!-- 高管 -->
  31. <template v-if="type == 4">
  32. <view class="info">
  33. <view class="info-tit">
  34. 职务:
  35. </view>
  36. <view class="info-val">
  37. {{item.duties}}
  38. </view>
  39. </view>
  40. <view class="info">
  41. <view class="info-tit">
  42. 工号:
  43. </view>
  44. <view class="info-val">
  45. {{item.job_no}}
  46. </view>
  47. </view>
  48. <view class="info">
  49. <view class="info-tit">
  50. 业务:
  51. </view>
  52. <view class="info-val">
  53. {{item.business}}
  54. </view>
  55. </view>
  56. </template>
  57. <template v-if="type == 3">
  58. <view class="info">
  59. <view class="info-tit">
  60. 职务:
  61. </view>
  62. <view class="info-val">
  63. {{item.duties}}
  64. </view>
  65. </view>
  66. <view class="info">
  67. <view class="info-tit">
  68. 联系:
  69. </view>
  70. <view class="info-val">
  71. {{item.phone}}
  72. </view>
  73. </view>
  74. <view class="info">
  75. <view class="info-tit">
  76. 地址:
  77. </view>
  78. <view class="info-val clamp">
  79. {{item.address}}
  80. </view>
  81. </view>
  82. </template>
  83. <!-- <view class="info">
  84. <view class="info-tit">
  85. 业务:
  86. </view>
  87. <view class="info-val">
  88. 创始人
  89. </view>
  90. </view> -->
  91. </view>
  92. </view>
  93. <u-loadmore :status="loadingType" />
  94. </view>
  95. </template>
  96. <script>
  97. export default {
  98. data() {
  99. return {
  100. type: '',
  101. list: [],
  102. loadingType: 'loadmore',
  103. page: 1,
  104. limit: 12,
  105. typename: ''
  106. }
  107. },
  108. onLoad(opt) {
  109. if (opt.type) {
  110. this.type = opt.type
  111. if (this.type == 1) {
  112. uni.setNavigationBarTitle({
  113. title: '高管'
  114. })
  115. this.typename = 'getOtherList'
  116. } else if (this.type == 3) {
  117. uni.setNavigationBarTitle({
  118. title: '共享股东商家'
  119. })
  120. this.typename = 'getOtherList'
  121. } else if (this.type == 4) {
  122. uni.setNavigationBarTitle({
  123. title: '高管'
  124. })
  125. this.typename = 'getOtherList'
  126. }else if (this.type == 5) {
  127. uni.setNavigationBarTitle({
  128. title: '员工'
  129. })
  130. this.typename = 'getAllygList'
  131. }
  132. this.getList()
  133. }
  134. },
  135. onShow() {
  136. },
  137. onReachBottom() {
  138. this.getList()
  139. },
  140. onReady() {
  141. },
  142. methods: {
  143. navto(url) {
  144. uni.navigateTo({
  145. url
  146. })
  147. },
  148. gotoDetail(item) {
  149. // 员工详情
  150. if (this.type == 5) {
  151. this.navto('/pagesT/unit/ygdetail?id=' + item.id)
  152. }
  153. },
  154. getList() {
  155. let that = this
  156. if (that.loadingType == 'nomore' || that.loadingType == 'loading') {
  157. return
  158. }
  159. that.loadingType = 'loading'
  160. this.$u.api[that.typename]({
  161. page: that.page,
  162. pageSize: that.limit,
  163. type: that.type
  164. }).then(res => {
  165. console.log(res)
  166. that.list = that.list.concat(res.data)
  167. that.page++
  168. if (res.data.length == that.limit) {
  169. that.loadingType = 'loadmore'
  170. } else {
  171. that.loadingType = 'nomore'
  172. }
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss">
  179. .gq-list {
  180. display: flex;
  181. flex-wrap: wrap;
  182. justify-content: flex-start;
  183. // justify-content: space-between;
  184. padding: 20rpx 0 20rpx 20rpx;
  185. }
  186. .gq-item {
  187. margin: 0 0 20rpx 14rpx;
  188. width: 227rpx;
  189. min-height: 351rpx;
  190. background: #FFFFFF;
  191. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  192. border-radius: 10rpx;
  193. display: flex;
  194. flex-direction: column;
  195. align-items: center;
  196. justify-content: space-between;
  197. padding: 30rpx 14rpx 20rpx;
  198. .gq-logo {
  199. width: 140rpx;
  200. height: 140rpx;
  201. border-radius: 50%;
  202. border: 1px solid #262261;
  203. display: flex;
  204. justify-content: center;
  205. align-items: center;
  206. image {
  207. width: 135rpx;
  208. height: 135rpx;
  209. background-color: #eee;
  210. border-radius: 50%;
  211. }
  212. }
  213. .store-name {
  214. padding-top: 10rpx;
  215. text-align: center;
  216. width: 100%;
  217. font-size: 26rpx;
  218. font-weight: 500;
  219. color: #262261;
  220. overflow: hidden;
  221. }
  222. .info {
  223. width: 100%;
  224. display: flex;
  225. padding: 5rpx 0;
  226. .info-tit {
  227. font-size: 18rpx;
  228. flex-shrink: 0;
  229. }
  230. .info-val {
  231. text-align: center;
  232. font-size: 20rpx;
  233. width: 140rpx;
  234. border-bottom: 1px #C7C7C7 solid;
  235. }
  236. }
  237. }
  238. </style>