yglist.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="content">
  3. <view class="gq-list">
  4. <view class="gq-item" v-for="item in list" @click="goDetail(item)">
  5. <view class="gq-logo">
  6. <image src="" mode="" class=""></image>
  7. </view>
  8. <view class="store-name">
  9. {{item.staffName}}
  10. </view>
  11. <template v-if="type == 'gz'">
  12. <view class="info">
  13. <view class="info-tit">
  14. 电话:
  15. </view>
  16. <view class="info-val">
  17. {{item.mobile}}
  18. </view>
  19. </view>
  20. <view class="info">
  21. <view class="info-tit">
  22. 提成:
  23. </view>
  24. <view class="info-val">
  25. ¥{{(item.reward*1).toFixed(2)}}
  26. </view>
  27. </view>
  28. </template>
  29. <template v-if="type == 'yg'">
  30. <view class="info">
  31. <view class="info-tit">
  32. 职务:
  33. </view>
  34. <view class="info-val">
  35. {{item.departmentName}}
  36. </view>
  37. </view>
  38. <view class="info">
  39. <view class="info-tit">
  40. 工号:
  41. </view>
  42. <view class="info-val">
  43. {{item.staffCode}}
  44. </view>
  45. </view>
  46. </template>
  47. </view>
  48. </view>
  49. <u-loadmore :status="loadingType" />
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. loadingType: 'loadmore',
  57. type: '',
  58. list: [],
  59. page: 1,
  60. pageSize: 24,
  61. loaded: false,
  62. }
  63. },
  64. onLoad(opt) {
  65. if (opt.type) {
  66. this.type = opt.type
  67. if (opt.type == 'gz') {
  68. uni.setNavigationBarTitle({
  69. title: '工资表'
  70. })
  71. }
  72. if (opt.type == 'yg') {
  73. uni.setNavigationBarTitle({
  74. title: '员工'
  75. })
  76. }
  77. this.loadData()
  78. }
  79. },
  80. onShow() {
  81. },
  82. onReachBottom() {
  83. this.loadData()
  84. },
  85. onReady() {
  86. },
  87. methods: {
  88. loadData(type) {
  89. let that = this
  90. if (type == 'reload') {
  91. that.loaded = false
  92. that.loadingType = 'loadmore'
  93. that.page = 1
  94. that.list = []
  95. }
  96. if (type == 'tab' && that.loaded) {
  97. return
  98. }
  99. if (that.loadingType == 'loading' || that.loadingType == 'nomore') {
  100. return
  101. }
  102. that.loadingType = 'loading'
  103. that.$u.api.getYgList({
  104. page: that.page,
  105. pageSize: that.pageSize
  106. }).then(({data}) => {
  107. that.list = that.list.concat(data)
  108. that.page++
  109. if(that.pageSize == data.length) {
  110. that.loadingType = 'loadmore'
  111. }else {
  112. that.loadingType = 'nomore'
  113. }
  114. that.loaded = true
  115. })
  116. },
  117. goDetail(item) {
  118. let that = this
  119. uni.navigateTo({
  120. url: that.type == 'gz' ? ('/pagesS/yg/gzdetail?id=' + item.id): ('/pagesS/yg/ygdetail?id=' + item.id)
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss">
  127. .gq-list {
  128. display: flex;
  129. flex-wrap: wrap;
  130. justify-content: flex-start;
  131. // justify-content: space-between;
  132. padding: 20rpx 0 20rpx 20rpx;
  133. }
  134. .gq-item {
  135. margin: 0 0 20rpx 14rpx;
  136. width: 227rpx;
  137. // height: 351rpx;
  138. background: #FFFFFF;
  139. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  140. border-radius: 10rpx;
  141. display: flex;
  142. flex-direction: column;
  143. align-items: center;
  144. justify-content: space-between;
  145. padding: 30rpx 14rpx 20rpx;
  146. .gq-logo {
  147. width: 140rpx;
  148. height: 140rpx;
  149. border-radius: 50%;
  150. border: 1px solid #262261;
  151. display: flex;
  152. justify-content: center;
  153. align-items: center;
  154. image {
  155. width: 135rpx;
  156. height: 135rpx;
  157. background-color: #eee;
  158. border-radius: 50%;
  159. }
  160. }
  161. .store-name {
  162. padding-top: 10rpx;
  163. text-align: center;
  164. width: 100%;
  165. font-size: 26rpx;
  166. font-weight: 500;
  167. color: #262261;
  168. overflow: hidden;
  169. }
  170. .info {
  171. width: 100%;
  172. display: flex;
  173. padding: 5rpx 0;
  174. .info-tit {
  175. font-size: 18rpx;
  176. flex-shrink: 0;
  177. }
  178. .info-val {
  179. text-align: center;
  180. font-size: 20rpx;
  181. width: 140rpx;
  182. border-bottom: 1px #C7C7C7 solid;
  183. }
  184. }
  185. }
  186. </style>