guquan.vue 8.0 KB

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