gztx.vue 7.0 KB

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