gqdetail.vue 7.2 KB

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