myAppointment.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view class="content">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <view class="content-money">
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack">
  7. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  8. </view>
  9. <view class="header">我的易趣卷</view>
  10. </view>
  11. <view class="content-bg">
  12. <image src="../../static/img/zhihuanjuan.png" mode=""></image>
  13. </view>
  14. <view class="money-box">
  15. <view class="money">{{ userInfo.anticipate }}</view>
  16. <view>余额</view>
  17. </view>
  18. <view class="moneybtn-box">
  19. <view class="money-btn" @click="navto('/pages/money/recharge?status=2')"></view>
  20. <view class="money-btn" @click="navto('/pages/money/wallet')">转账</view>
  21. </view>
  22. </view>
  23. <!-- <view class="info-box flex">
  24. <view class="info-item">
  25. <view class="info-font">累计收入</view>
  26. <view class="info-num">{{ recharge }}</view>
  27. </view>
  28. <view class="shu"></view>
  29. <view class="info-item">
  30. <view class="info-font">累计支出</view>
  31. <view class="info-num">{{ orderStatusSum }}</view>
  32. </view>
  33. </view> -->
  34. <view class="navbar">
  35. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  36. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  37. </view>
  38. <swiper :current="tabCurrentIndex" :style="{ height: maxheight }" class="swiper-box" duration="300"
  39. @change="changeTab">
  40. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  41. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  42. <!-- 空白页 -->
  43. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  44. <!-- 订单列表 -->
  45. <view>
  46. <view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index">
  47. <view class="title-box">
  48. <view class="title">
  49. <text>{{ item.mark }}</text>
  50. </view>
  51. <view class="time">
  52. <text>{{ item.add_time }}</text>
  53. </view>
  54. </view>
  55. <view class="money">
  56. <view :class="{status:item.status == 0}">{{ (item.pm == 0 ? '-' : '+') + item.number }} {{item.status == 0?"待发放":''}} </view>
  57. <view v-if="item.status != 0" class="status font-size-sm">余额:{{item.balance}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. <uni-load-more :status="tabItem.loadingType" v-if="!(tabItem.orderList.length == 0 && tabItem.loaded)"></uni-load-more>
  62. </scroll-view>
  63. </swiper-item>
  64. </swiper>
  65. </view>
  66. </template>
  67. <script>
  68. import {
  69. anticipatelist
  70. } from '@/api/wallet.js';
  71. import {
  72. getMoneyStyle
  73. } from '@/utils/rocessor.js';
  74. import {
  75. mapState,
  76. mapMutations
  77. } from 'vuex';
  78. import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
  79. import empty from '@/uview-ui/components/u-empty/u-empty.vue';
  80. export default {
  81. filters: {
  82. getMoneyStyle
  83. },
  84. computed: {
  85. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  86. },
  87. components: {
  88. empty,
  89. uniLoadMore
  90. },
  91. onReady(res) {
  92. var _this = this;
  93. uni.getSystemInfo({
  94. success: resu => {
  95. const query = uni.createSelectorQuery();
  96. query.select('.swiper-box').boundingClientRect();
  97. query.exec(function(res) {
  98. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  99. console.log('打印页面的剩余高度', _this.height);
  100. });
  101. },
  102. fail: res => {}
  103. });
  104. },
  105. data() {
  106. return {
  107. // 头部图高度
  108. maxheight: '',
  109. tabCurrentIndex: 0,
  110. orderStatusSum: 0,
  111. recharge: 0,
  112. navList: [{
  113. state: 0,
  114. text: '易趣卷明细',
  115. loadingType: 'more',
  116. orderList: [],
  117. page: 1, //当前页数
  118. limit: 10, //每次信息条数
  119. loaded: false
  120. }],
  121. money: ''
  122. };
  123. },
  124. onLoad(options) {},
  125. onShow() {
  126. this.loadData();
  127. },
  128. methods: {
  129. // 页面跳转
  130. navto(e) {
  131. uni.navigateTo({
  132. url: e
  133. });
  134. },
  135. // 点击返回 我的页面
  136. toBack() {
  137. uni.navigateBack({});
  138. },
  139. //获取收入支出信息
  140. async loadData(source) {
  141. let obj = this;
  142. //这里是将订单挂载到tab列表下
  143. let index = this.tabCurrentIndex;
  144. let navItem = this.navList[index];
  145. let state = navItem.state;
  146. console.log(source, 'iwiwiwiwi');
  147. if (source === 'tabChange' && navItem.loaded === true) {
  148. //tab切换只有第一次需要加载数据
  149. return;
  150. }
  151. if (navItem.loadingType === 'loading'||navItem.loadingType === 'nomore') {
  152. //防止重复加载
  153. return;
  154. }
  155. // 修改当前对象状态为加载中
  156. navItem.loadingType = 'loading';
  157. anticipatelist({
  158. page: navItem.page,
  159. limit: navItem.limit
  160. })
  161. .then(({
  162. data
  163. }) => {
  164. obj.recharge = data.sr;
  165. obj.orderStatusSum = data.zc;
  166. navItem.orderList =navItem.orderList.concat( data.data)
  167. if(data.data.length==navItem.limit){
  168. navItem.page++;
  169. navItem.loadingType = 'more';
  170. }else{
  171. console.log('nomore')
  172. navItem.loadingType = 'nomore';
  173. }
  174. })
  175. .catch(e => {
  176. console.log(e);
  177. });
  178. },
  179. //swiper 切换
  180. changeTab(e) {
  181. this.tabCurrentIndex = e.target.current;
  182. this.loadData('tabChange');
  183. },
  184. //顶部tab点击
  185. tabClick(index) {
  186. this.tabCurrentIndex = index;
  187. }
  188. }
  189. };
  190. </script>
  191. <style lang="scss">
  192. page {
  193. background: #f1f1f1;
  194. height: 100%;
  195. }
  196. .status_bar {
  197. height: var(--status-bar-height);
  198. width: 100%;
  199. background: #00bdff;
  200. }
  201. .content-money {
  202. position: relative;
  203. height: 480rpx;
  204. .content-bg {
  205. position: absolute;
  206. top: 0;
  207. left: 0;
  208. right: 0;
  209. width: 750rpx;
  210. height: 480rpx;
  211. image {
  212. width: 100%;
  213. height: 100%;
  214. }
  215. }
  216. .body-title {
  217. height: 80rpx;
  218. text-align: center;
  219. font-size: 35rpx;
  220. position: relative;
  221. .header {
  222. position: absolute;
  223. left: 0;
  224. top: 0;
  225. width: 100%;
  226. font-size: 36rpx;
  227. font-family: PingFang SC;
  228. font-weight: bold;
  229. color: #fffeff;
  230. height: 80rpx;
  231. font-size: 36rpx;
  232. font-weight: 700;
  233. z-index: 9;
  234. display: flex;
  235. justify-content: center;
  236. align-items: center;
  237. }
  238. .goback-box {
  239. position: absolute;
  240. left: 18rpx;
  241. top: 0;
  242. height: 80rpx;
  243. display: flex;
  244. align-items: center;
  245. }
  246. .goback {
  247. z-index: 100;
  248. width: 34rpx;
  249. height: 34rpx;
  250. }
  251. }
  252. }
  253. .info-box {
  254. width: 670rpx;
  255. height: 186rpx;
  256. background: #ffffff;
  257. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  258. border-radius: 20rpx;
  259. margin: -100rpx auto 0;
  260. position: relative;
  261. z-index: 2;
  262. .info-item {
  263. width: 50%;
  264. display: flex;
  265. flex-direction: column;
  266. align-items: center;
  267. line-height: 1;
  268. .info-font {
  269. font-size: 30rpx;
  270. font-weight: bold;
  271. color: #999999;
  272. }
  273. .info-num {
  274. margin-top: 30rpx;
  275. font-size: 30rpx;
  276. font-family: PingFang SC;
  277. font-weight: bold;
  278. color: #181818;
  279. }
  280. }
  281. .shu {
  282. width: 2rpx;
  283. height: 74rpx;
  284. background: #dcdfe6;
  285. }
  286. }
  287. .moneybtn-box {
  288. display: flex;
  289. justify-content: space-between;
  290. position: relative;
  291. z-index: 2;
  292. color: #ffffff;
  293. padding: 20rpx 50rpx;
  294. font-size: 30rpx;
  295. font-family: PingFang SC;
  296. font-weight: bold;
  297. color: #ffffff;
  298. }
  299. .money-box {
  300. position: relative;
  301. z-index: 2;
  302. padding-top: 90rpx;
  303. color: #ffffff;
  304. text-align: center;
  305. .money {
  306. font-size: 72rpx;
  307. font-family: PingFang SC;
  308. font-weight: bold;
  309. color: #ffffff;
  310. }
  311. .text {
  312. font-size: 30rpx;
  313. }
  314. }
  315. .money-btn {
  316. position: relative;
  317. z-index: 2;
  318. color: #ffffff;
  319. text-align: right;
  320. font-size: 30rpx;
  321. font-family: PingFang SC;
  322. font-weight: bold;
  323. color: #ffffff;
  324. text {
  325. display: inline-block;
  326. padding-left: 10rpx;
  327. }
  328. }
  329. .navbar {
  330. margin-top: 20rpx;
  331. display: flex;
  332. height: 88rpx;
  333. padding: 0 5px;
  334. background: #fff;
  335. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  336. position: relative;
  337. z-index: 10;
  338. .nav-item {
  339. flex: 1;
  340. display: flex;
  341. justify-content: center;
  342. align-items: center;
  343. height: 100%;
  344. font-size: 15px;
  345. color: #999999;
  346. position: relative;
  347. &.current {
  348. color: #000;
  349. &:after {
  350. content: '';
  351. position: absolute;
  352. left: 50%;
  353. bottom: 0;
  354. transform: translateX(-50%);
  355. width: 44px;
  356. height: 0;
  357. border-bottom: 2px solid #fe5b38;
  358. }
  359. }
  360. }
  361. }
  362. //列表
  363. .swiper-box {
  364. .order-item:last-child {
  365. margin-bottom: 60rpx;
  366. }
  367. .order-item {
  368. padding: 20rpx 30rpx;
  369. line-height: 1.5;
  370. .title-box {
  371. .title {
  372. font-size: $font-lg;
  373. color: $font-color-base;
  374. }
  375. .time {
  376. font-size: $font-base;
  377. color: $font-color-light;
  378. }
  379. }
  380. .money {
  381. color: #fd5b23;
  382. font-size: $font-lg;
  383. text-align: right;
  384. .status {
  385. color: $font-color-light;
  386. }
  387. }
  388. }
  389. }
  390. .list-scroll-content {
  391. background: #ffffff;
  392. height: 100%;
  393. }
  394. .content {
  395. height: 100%;
  396. .empty-content {
  397. background-color: #ffffff;
  398. }
  399. }
  400. .btn-box {
  401. width: 674rpx;
  402. height: 88rpx;
  403. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  404. border-radius: 44rpx;
  405. font-size: 36rpx;
  406. font-family: PingFang SC;
  407. font-weight: 500;
  408. color: #ffffff;
  409. text-align: center;
  410. line-height: 88rpx;
  411. position: fixed;
  412. bottom: 48rpx;
  413. left: 0;
  414. right: 0;
  415. margin: 0 auto;
  416. }
  417. .money-btn {
  418. position: relative;
  419. z-index: 2;
  420. color: #ffffff;
  421. text-align: right;
  422. font-size: 30rpx;
  423. font-family: PingFang SC;
  424. font-weight: bold;
  425. color: #ffffff;
  426. text {
  427. display: inline-block;
  428. padding-left: 10rpx;
  429. }
  430. }
  431. </style>