index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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 || '../../../static/images/avt.png'" mode="" class=""></image>
  7. </view>
  8. <view class="store-name ellipsis">
  9. {{type == 5?item.name: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.position||'暂无'}}
  19. </view>
  20. </view>
  21. <view class="info">
  22. <view class="info-tit">
  23. 工号:
  24. </view>
  25. <view class="info-val">
  26. {{item.userid}}
  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. import { getMen} from "@/api/store.js"
  98. export default {
  99. data() {
  100. return {
  101. type: '',
  102. list: [],
  103. loadingType: 'loadmore',
  104. page: 1,
  105. limit: 12,
  106. typename: ''
  107. }
  108. },
  109. onLoad(opt) {
  110. if (opt.type) {
  111. this.type = opt.type
  112. if (this.type == 1) {
  113. uni.setNavigationBarTitle({
  114. title: '高管'
  115. })
  116. this.typename = 'getOtherList'
  117. } else if (this.type == 3) {
  118. uni.setNavigationBarTitle({
  119. title: '共享股东商家'
  120. })
  121. this.typename = 'getOtherList'
  122. } else if (this.type == 4) {
  123. uni.setNavigationBarTitle({
  124. title: '高管'
  125. })
  126. this.typename = 'getOtherList'
  127. }else if (this.type == 5) {
  128. uni.setNavigationBarTitle({
  129. title: '员工'
  130. })
  131. this.typename = 'getMen'
  132. }
  133. this.getList()
  134. }
  135. },
  136. onShow() {
  137. },
  138. onReachBottom() {
  139. this.getList()
  140. },
  141. onReady() {
  142. },
  143. methods: {
  144. navto(url) {
  145. uni.navigateTo({
  146. url
  147. })
  148. },
  149. gotoDetail(item) {
  150. // 员工详情
  151. if (this.type == 5) {
  152. this.navto('/pagesT/unit/ygdetail?id=' + item.id)
  153. }
  154. },
  155. getList() {
  156. let that = this;
  157. let getList;
  158. if (that.loadingType == 'nomore' || that.loadingType == 'loading') {
  159. return
  160. }
  161. that.loadingType = 'loading'
  162. if(that.type== 5) {
  163. getList = getMen
  164. }
  165. getList({
  166. page: that.page,
  167. limit: that.limit,
  168. }).then(res => {
  169. that.list = that.list.concat(res.data.list)
  170. that.page++
  171. if (res.data.list.length == that.limit) {
  172. that.loadingType = 'loadmore'
  173. } else {
  174. that.loadingType = 'nomore'
  175. }
  176. })
  177. }
  178. }
  179. }
  180. </script>
  181. <style lang="scss">
  182. .gq-list {
  183. display: flex;
  184. flex-wrap: wrap;
  185. justify-content: flex-start;
  186. // justify-content: space-between;
  187. padding: 20rpx 0 20rpx 20rpx;
  188. }
  189. .gq-item {
  190. margin: 0 0 20rpx 14rpx;
  191. width: 227rpx;
  192. min-height: 351rpx;
  193. background: #FFFFFF;
  194. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  195. border-radius: 10rpx;
  196. display: flex;
  197. flex-direction: column;
  198. align-items: center;
  199. justify-content: space-between;
  200. padding: 30rpx 14rpx 20rpx;
  201. .gq-logo {
  202. width: 140rpx;
  203. height: 140rpx;
  204. border-radius: 50%;
  205. border: 1px solid #262261;
  206. display: flex;
  207. justify-content: center;
  208. align-items: center;
  209. image {
  210. width: 135rpx;
  211. height: 135rpx;
  212. background-color: #eee;
  213. border-radius: 50%;
  214. }
  215. }
  216. .store-name {
  217. padding-top: 10rpx;
  218. text-align: center;
  219. width: 100%;
  220. font-size: 26rpx;
  221. font-weight: 500;
  222. color: #262261;
  223. overflow: hidden;
  224. }
  225. .info {
  226. width: 100%;
  227. display: flex;
  228. padding: 5rpx 0;
  229. .info-tit {
  230. font-size: 18rpx;
  231. flex-shrink: 0;
  232. }
  233. .info-val {
  234. text-align: center;
  235. font-size: 20rpx;
  236. width: 140rpx;
  237. min-width: 140rpx;
  238. border-bottom: 1px #C7C7C7 solid;
  239. white-space: nowrap;
  240. overflow: hidden;
  241. text-overflow: ellipsis;
  242. }
  243. }
  244. }
  245. </style>