myteam.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view class="content">
  3. <view class="user-top">
  4. <!-- <view class="select-time">
  5. <picker mode="date" @change="bindDateChange" fields="month">
  6. <view class="uni-input">{{showdate}}</view>
  7. </picker>
  8. <image src="../../static/img/downjian.png" mode="widthFix"></image>
  9. </view> -->
  10. <view class="top-val">
  11. 300
  12. </view>
  13. <view class="top-tit">
  14. 转介绍人数
  15. </view>
  16. </view>
  17. <!-- <view class="sz-wrap">
  18. <view class="sz-item">
  19. <view class="sz-tit">
  20. 上月收入
  21. </view>
  22. <view class="sz-val">
  23. 200
  24. </view>
  25. </view>
  26. <view class="jg">
  27. </view>
  28. <view class="sz-item">
  29. <view class="sz-tit">
  30. 累计收入
  31. </view>
  32. <view class="sz-val">
  33. 200
  34. </view>
  35. </view>
  36. </view> -->
  37. <!-- <view class="navbar">
  38. <view v-for="(item, index) in navlist" :key="index" class="nav-item"
  39. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
  40. </view> -->
  41. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
  42. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex">
  43. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  44. <!-- 空白页 -->
  45. <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
  46. <!-- 订单列表 -->
  47. <view class="order-item" v-for="(item, index) in tabItem.list" :key="index">
  48. <image src="" mode="" class="logo"></image>
  49. <view class="title-box">
  50. <view class="title">
  51. <!-- <text>{{ item.mark }}</text> -->
  52. 全勤奖励全勤奖励全勤奖励全勤奖励全勤奖励全勤
  53. </view>
  54. <view class="time">
  55. <!-- <text>{{ item.create_time }}</text> -->
  56. 2022-12-1 09:30
  57. </view>
  58. </view>
  59. <view class="money" @click="goPage('/pagesS/yg/fcxq')">
  60. <view>{{ (item.pm == 0 ? '-' : '+') + 1500 }}</view>
  61. <image src="../../static/img/downright.png" mode=""></image>
  62. </view>
  63. </view>
  64. <u-loadmore :status="tabItem.loadingType" />
  65. </scroll-view>
  66. </swiper-item>
  67. </swiper>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. showdate: '',
  75. tabCurrentIndex: 0,
  76. height: '',
  77. id: '',
  78. navlist: [{
  79. status: 0,
  80. title: '收入',
  81. list: 9,
  82. page: 1,
  83. limit: 10,
  84. loaded: false,
  85. loadingType: 'loadmore'
  86. },
  87. {
  88. status: 1,
  89. title: '扣除',
  90. list: [],
  91. page: 1,
  92. limit: 10,
  93. loaded: false,
  94. loadingType: 'loadmore'
  95. }
  96. ]
  97. }
  98. },
  99. onLoad(opt) {
  100. if (opt.id) {
  101. this.id = opt.id
  102. }
  103. if (opt.name) {
  104. uni.setNavigationBarTitle({
  105. title: opt.name + '的工资'
  106. })
  107. }
  108. this.getTime()
  109. },
  110. onShow() {
  111. },
  112. onReachBottom() {
  113. },
  114. onReady() {
  115. var _this = this;
  116. uni.getSystemInfo({
  117. success: resu => {
  118. const query = uni.createSelectorQuery();
  119. query.select('.swiper-box').boundingClientRect();
  120. query.exec(function(res) {
  121. _this.height = resu.windowHeight - res[0].top + 'px';
  122. console.log('打印页面的剩余高度', _this.height);
  123. });
  124. },
  125. fail: res => {}
  126. });
  127. },
  128. methods: {
  129. //顶部tab点击
  130. tabClick(index) {
  131. this.tabCurrentIndex = index;
  132. this.loadData('tab')
  133. },
  134. // 选择年月
  135. bindDateChange(e) {
  136. let time = e.detail.value.split('-')
  137. this.showdate = time[0] + '年' + time[1] + '月'
  138. this.loadData('reload')
  139. },
  140. // 获取当前年月
  141. getTime() {
  142. let date = new Date()
  143. this.showdate = date.getFullYear() + '年' + (date.getMonth() + 1) + '月'
  144. this.loadData()
  145. },
  146. // 获取数据
  147. loadData(type) {
  148. let that = this
  149. let index = that.tabCurrentIndex
  150. let item = that.navlist[index]
  151. if (type == 'reload') {
  152. item.loaded = false
  153. item.loadingType = 'more'
  154. item.page = 1
  155. item.list = []
  156. }
  157. if (type == 'tab' && item.loaded) {
  158. return
  159. }
  160. if (item.loadingType == 'loading' || item.loadingType == 'noMore') {
  161. return
  162. }
  163. item.loadingType = 'loading'
  164. },
  165. }
  166. }
  167. </script>
  168. <style lang="scss">
  169. .user-top {
  170. width: 100%;
  171. height: 400rpx;
  172. background-color: #4075d6;
  173. display: flex;
  174. flex-direction: column;
  175. justify-content: center;
  176. align-items: center;
  177. padding-bottom: 60rpx;
  178. // position: relative;
  179. .top-tit {
  180. font-size: 30rpx;
  181. font-weight: bold;
  182. color: #FFFFFF;
  183. }
  184. .top-val {
  185. font-size: 72rpx;
  186. font-weight: 500;
  187. color: #FFFFFF;
  188. }
  189. .select-time {
  190. position: absolute;
  191. top: 30rpx;
  192. right: 30rpx;
  193. font-size: 26rpx;
  194. font-weight: 500;
  195. color: #fff;
  196. display: flex;
  197. align-items: center;
  198. image {
  199. width: 17rpx;
  200. margin-left: 10rpx;
  201. }
  202. }
  203. }
  204. .sz-wrap {
  205. width: 670rpx;
  206. height: 186rpx;
  207. background: #FFFFFF;
  208. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  209. border-radius: 20rpx;
  210. margin: -90rpx auto 20rpx;
  211. display: flex;
  212. justify-content: center;
  213. align-items: center;
  214. .jg {
  215. width: 2rpx;
  216. height: 74rpx;
  217. background: #DCDFE6;
  218. }
  219. .sz-item {
  220. width: 330rpx;
  221. height: 100%;
  222. display: flex;
  223. flex-direction: column;
  224. align-items: center;
  225. justify-content: center;
  226. font-size: 30rpx;
  227. font-weight: bold;
  228. .sz-tit {
  229. color: #999999;
  230. }
  231. .sz-val {
  232. margin-top: 30rpx;
  233. color: #181818;
  234. }
  235. }
  236. }
  237. .navbar {
  238. margin-top: 20rpx;
  239. display: flex;
  240. height: 88rpx;
  241. padding: 0 5px;
  242. background: #fff;
  243. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  244. position: relative;
  245. z-index: 10;
  246. .nav-item {
  247. flex: 1;
  248. display: flex;
  249. justify-content: center;
  250. align-items: center;
  251. height: 100%;
  252. font-size: 15px;
  253. color: #999999;
  254. position: relative;
  255. &.current {
  256. color: #000;
  257. &:after {
  258. content: '';
  259. position: absolute;
  260. left: 50%;
  261. bottom: 0;
  262. transform: translateX(-50%);
  263. width: 44px;
  264. height: 0;
  265. border-bottom: 2px solid #fe5b38;
  266. }
  267. }
  268. }
  269. }
  270. //列表
  271. .swiper-box {
  272. margin-top: 20rpx;
  273. padding: 0 20rpx;
  274. background-color: #fff;
  275. .order-item:last-child {
  276. margin-bottom: 60rpx;
  277. }
  278. .order-item {
  279. width: 100%;
  280. // background-color: red;
  281. padding: 20rpx 30rpx;
  282. line-height: 1.5;
  283. display: flex;
  284. align-items: center;
  285. border-bottom: 1rpx solid #F0F0F0;
  286. .logo {
  287. flex-shrink: 0;
  288. margin-right: 20rpx;
  289. width: 80rpx;
  290. height: 80rpx;
  291. border-radius: 50%;
  292. background-color: #eee;
  293. }
  294. .title-box {
  295. flex-grow: 1;
  296. padding-right: 50rpx;
  297. .title {
  298. font-size: 30rpx;
  299. color: #333333;
  300. }
  301. .time {
  302. font-size: 26rpx;
  303. color: #AEAEAE;
  304. }
  305. }
  306. .money {
  307. color: #fd5b23;
  308. min-width: 150rpx;
  309. font-size: 26rpx;
  310. text-align: right;
  311. display: flex;
  312. align-items: center;
  313. justify-content: flex-end;
  314. image {
  315. width: 10rpx;
  316. height: 20rpx;
  317. margin-left: 15rpx;
  318. }
  319. .status {
  320. color: #AEAEAE;
  321. }
  322. }
  323. }
  324. }
  325. .list-scroll-content {
  326. background: #ffffff;
  327. height: 100%;
  328. }
  329. </style>