myAppointment.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  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>{{ (item.pm == 0 ? '-' : '+') + item.number }}</view>
  57. <view v-if="item.status == 0" class="status">待发放</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: 1000, //每次信息条数
  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') {
  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 = data.data;
  167. })
  168. .catch(e => {
  169. console.log(e);
  170. });
  171. },
  172. //swiper 切换
  173. changeTab(e) {
  174. this.tabCurrentIndex = e.target.current;
  175. this.loadData('tabChange');
  176. },
  177. //顶部tab点击
  178. tabClick(index) {
  179. this.tabCurrentIndex = index;
  180. }
  181. }
  182. };
  183. </script>
  184. <style lang="scss">
  185. page {
  186. background: #f1f1f1;
  187. height: 100%;
  188. }
  189. .status_bar {
  190. height: var(--status-bar-height);
  191. width: 100%;
  192. background: #00bdff;
  193. }
  194. .content-money {
  195. position: relative;
  196. height: 480rpx;
  197. .content-bg {
  198. position: absolute;
  199. top: 0;
  200. left: 0;
  201. right: 0;
  202. width: 750rpx;
  203. height: 480rpx;
  204. image {
  205. width: 100%;
  206. height: 100%;
  207. }
  208. }
  209. .body-title {
  210. height: 80rpx;
  211. text-align: center;
  212. font-size: 35rpx;
  213. position: relative;
  214. .header {
  215. position: absolute;
  216. left: 0;
  217. top: 0;
  218. width: 100%;
  219. font-size: 36rpx;
  220. font-family: PingFang SC;
  221. font-weight: bold;
  222. color: #fffeff;
  223. height: 80rpx;
  224. font-size: 36rpx;
  225. font-weight: 700;
  226. z-index: 9;
  227. display: flex;
  228. justify-content: center;
  229. align-items: center;
  230. }
  231. .goback-box {
  232. position: absolute;
  233. left: 18rpx;
  234. top: 0;
  235. height: 80rpx;
  236. display: flex;
  237. align-items: center;
  238. }
  239. .goback {
  240. z-index: 100;
  241. width: 34rpx;
  242. height: 34rpx;
  243. }
  244. }
  245. }
  246. .info-box {
  247. width: 670rpx;
  248. height: 186rpx;
  249. background: #ffffff;
  250. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  251. border-radius: 20rpx;
  252. margin: -100rpx auto 0;
  253. position: relative;
  254. z-index: 2;
  255. .info-item {
  256. width: 50%;
  257. display: flex;
  258. flex-direction: column;
  259. align-items: center;
  260. line-height: 1;
  261. .info-font {
  262. font-size: 30rpx;
  263. font-weight: bold;
  264. color: #999999;
  265. }
  266. .info-num {
  267. margin-top: 30rpx;
  268. font-size: 30rpx;
  269. font-family: PingFang SC;
  270. font-weight: bold;
  271. color: #181818;
  272. }
  273. }
  274. .shu {
  275. width: 2rpx;
  276. height: 74rpx;
  277. background: #dcdfe6;
  278. }
  279. }
  280. .moneybtn-box {
  281. display: flex;
  282. justify-content: space-between;
  283. position: relative;
  284. z-index: 2;
  285. color: #ffffff;
  286. padding: 20rpx 50rpx;
  287. font-size: 30rpx;
  288. font-family: PingFang SC;
  289. font-weight: bold;
  290. color: #ffffff;
  291. }
  292. .money-box {
  293. position: relative;
  294. z-index: 2;
  295. padding-top: 90rpx;
  296. color: #ffffff;
  297. text-align: center;
  298. .money {
  299. font-size: 72rpx;
  300. font-family: PingFang SC;
  301. font-weight: bold;
  302. color: #ffffff;
  303. }
  304. .text {
  305. font-size: 30rpx;
  306. }
  307. }
  308. .money-btn {
  309. position: relative;
  310. z-index: 2;
  311. color: #ffffff;
  312. text-align: right;
  313. font-size: 30rpx;
  314. font-family: PingFang SC;
  315. font-weight: bold;
  316. color: #ffffff;
  317. text {
  318. display: inline-block;
  319. padding-left: 10rpx;
  320. }
  321. }
  322. .navbar {
  323. margin-top: 20rpx;
  324. display: flex;
  325. height: 88rpx;
  326. padding: 0 5px;
  327. background: #fff;
  328. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  329. position: relative;
  330. z-index: 10;
  331. .nav-item {
  332. flex: 1;
  333. display: flex;
  334. justify-content: center;
  335. align-items: center;
  336. height: 100%;
  337. font-size: 15px;
  338. color: #999999;
  339. position: relative;
  340. &.current {
  341. color: #000;
  342. &:after {
  343. content: '';
  344. position: absolute;
  345. left: 50%;
  346. bottom: 0;
  347. transform: translateX(-50%);
  348. width: 44px;
  349. height: 0;
  350. border-bottom: 2px solid #fe5b38;
  351. }
  352. }
  353. }
  354. }
  355. //列表
  356. .swiper-box {
  357. .order-item:last-child {
  358. margin-bottom: 60rpx;
  359. }
  360. .order-item {
  361. padding: 20rpx 30rpx;
  362. line-height: 1.5;
  363. .title-box {
  364. .title {
  365. font-size: $font-lg;
  366. color: $font-color-base;
  367. }
  368. .time {
  369. font-size: $font-base;
  370. color: $font-color-light;
  371. }
  372. }
  373. .money {
  374. color: #fd5b23;
  375. font-size: $font-lg;
  376. text-align: right;
  377. .status {
  378. color: $font-color-light;
  379. }
  380. }
  381. }
  382. }
  383. .list-scroll-content {
  384. background: #ffffff;
  385. height: 100%;
  386. }
  387. .content {
  388. height: 100%;
  389. .empty-content {
  390. background-color: #ffffff;
  391. }
  392. }
  393. .btn-box {
  394. width: 674rpx;
  395. height: 88rpx;
  396. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  397. border-radius: 44rpx;
  398. font-size: 36rpx;
  399. font-family: PingFang SC;
  400. font-weight: 500;
  401. color: #ffffff;
  402. text-align: center;
  403. line-height: 88rpx;
  404. position: fixed;
  405. bottom: 48rpx;
  406. left: 0;
  407. right: 0;
  408. margin: 0 auto;
  409. }
  410. .money-btn {
  411. position: relative;
  412. z-index: 2;
  413. color: #ffffff;
  414. text-align: right;
  415. font-size: 30rpx;
  416. font-family: PingFang SC;
  417. font-weight: bold;
  418. color: #ffffff;
  419. text {
  420. display: inline-block;
  421. padding-left: 10rpx;
  422. }
  423. }
  424. </style>