myAppointment.vue 8.7 KB

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