myAppointment.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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?id=1')">转账</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">{{ sr }}</view>
  23. </view>
  24. <view class="shu"></view>
  25. <view class="info-item">
  26. <view class="info-font">累计支出</view>
  27. <view class="info-num">{{ zc }}</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. sr:'',
  97. zc:'',
  98. tabCurrentIndex: 0,
  99. orderStatusSum: 0,
  100. recharge: 0,
  101. navList: [
  102. {
  103. state: 1,
  104. text: '收入',
  105. loadingType: 'more',
  106. orderList: [],
  107. page: 1, //当前页数
  108. limit: 1000, //每次信息条数
  109. loaded: false
  110. },
  111. {
  112. state: 0,
  113. text: '支出',
  114. loadingType: 'more',
  115. orderList: [],
  116. page: 1, //当前页数
  117. limit: 1000, //每次信息条数
  118. loaded: false
  119. }
  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. pm:navItem.state
  161. })
  162. .then(({ data }) => {
  163. // obj.recharge = data.income;
  164. // obj.orderStatusSum = data.expend;
  165. console.log(data,'datta');
  166. obj.sr = data.sr
  167. obj.zc = data.zc
  168. if(state == 1 ){
  169. navItem.orderList = data.list
  170. }
  171. if(state == 0 ){
  172. navItem.orderList = data.list
  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. }
  200. .content-money {
  201. position: relative;
  202. height: 480rpx;
  203. .content-bg {
  204. position: absolute;
  205. top: 0;
  206. left: 0;
  207. right: 0;
  208. width: 750rpx;
  209. height: 480rpx;
  210. image {
  211. width: 100%;
  212. height: 100%;
  213. }
  214. }
  215. .body-title {
  216. height: 80rpx;
  217. text-align: center;
  218. font-size: 35rpx;
  219. position: relative;
  220. .header {
  221. position: absolute;
  222. left: 0;
  223. top: 0;
  224. width: 100%;
  225. font-size: 36rpx;
  226. font-family: PingFang SC;
  227. font-weight: bold;
  228. color: #fffeff;
  229. height: 80rpx;
  230. font-size: 36rpx;
  231. font-weight: 700;
  232. z-index: 9;
  233. display: flex;
  234. justify-content: center;
  235. align-items: center;
  236. }
  237. .goback-box {
  238. position: absolute;
  239. left: 18rpx;
  240. top: 0;
  241. height: 80rpx;
  242. display: flex;
  243. align-items: center;
  244. }
  245. .goback {
  246. z-index: 100;
  247. width: 34rpx;
  248. height: 34rpx;
  249. }
  250. }
  251. }
  252. .info-box {
  253. width: 670rpx;
  254. height: 186rpx;
  255. background: #ffffff;
  256. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  257. border-radius: 20rpx;
  258. margin: -100rpx auto 0;
  259. position: relative;
  260. z-index: 2;
  261. .info-item {
  262. width: 50%;
  263. display: flex;
  264. flex-direction: column;
  265. align-items: center;
  266. line-height: 1;
  267. .info-font {
  268. font-size: 30rpx;
  269. font-weight: bold;
  270. color: #999999;
  271. }
  272. .info-num {
  273. margin-top: 30rpx;
  274. font-size: 30rpx;
  275. font-family: PingFang SC;
  276. font-weight: bold;
  277. color: #181818;
  278. }
  279. }
  280. .shu {
  281. width: 2rpx;
  282. height: 74rpx;
  283. background: #dcdfe6;
  284. }
  285. }
  286. .moneybtn-box {
  287. display: flex;
  288. justify-content: space-between;
  289. position: relative;
  290. z-index: 2;
  291. color: #ffffff;
  292. padding: 20rpx 50rpx;
  293. font-size: 30rpx;
  294. font-family: PingFang SC;
  295. font-weight: bold;
  296. color: #ffffff;
  297. }
  298. .money-box {
  299. position: relative;
  300. z-index: 2;
  301. padding-top: 20rpx;
  302. color: #ffffff;
  303. text-align: center;
  304. .money {
  305. font-size: 72rpx;
  306. font-family: PingFang SC;
  307. font-weight: bold;
  308. color: #ffffff;
  309. }
  310. .text {
  311. font-size: 30rpx;
  312. }
  313. }
  314. .money-btn {
  315. position: relative;
  316. z-index: 2;
  317. color: #ffffff;
  318. text-align: right;
  319. font-size: 30rpx;
  320. font-family: PingFang SC;
  321. font-weight: bold;
  322. color: #ffffff;
  323. text {
  324. display: inline-block;
  325. padding-left: 10rpx;
  326. }
  327. }
  328. .navbar {
  329. margin-top: 20rpx;
  330. display: flex;
  331. height: 88rpx;
  332. padding: 0 5px;
  333. background: #fff;
  334. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  335. position: relative;
  336. z-index: 10;
  337. .nav-item {
  338. flex: 1;
  339. display: flex;
  340. justify-content: center;
  341. align-items: center;
  342. height: 100%;
  343. font-size: 15px;
  344. color: #999999;
  345. position: relative;
  346. &.current {
  347. color: #000;
  348. &:after {
  349. content: '';
  350. position: absolute;
  351. left: 50%;
  352. bottom: 0;
  353. transform: translateX(-50%);
  354. width: 44px;
  355. height: 0;
  356. border-bottom: 2px solid #fe5b38;
  357. }
  358. }
  359. }
  360. }
  361. //列表
  362. .swiper-box {
  363. .order-item:last-child {
  364. margin-bottom: 60rpx;
  365. }
  366. .order-item {
  367. padding: 20rpx 30rpx;
  368. line-height: 1.5;
  369. .title-box {
  370. .title {
  371. font-size: $font-lg;
  372. color: $font-color-base;
  373. }
  374. .time {
  375. font-size: $font-base;
  376. color: $font-color-light;
  377. }
  378. }
  379. .money {
  380. color: #fd5b23;
  381. font-size: $font-lg;
  382. text-align: right;
  383. .status {
  384. color: $font-color-light;
  385. }
  386. }
  387. }
  388. }
  389. .list-scroll-content {
  390. background: #ffffff;
  391. height: 100%;
  392. }
  393. .content {
  394. height: 100%;
  395. .empty-content {
  396. background-color: #ffffff;
  397. }
  398. }
  399. .btn-box {
  400. width: 674rpx;
  401. height: 88rpx;
  402. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  403. border-radius: 44rpx;
  404. font-size: 36rpx;
  405. font-family: PingFang SC;
  406. font-weight: 500;
  407. color: #ffffff;
  408. text-align: center;
  409. line-height: 88rpx;
  410. position: fixed;
  411. bottom: 48rpx;
  412. left: 0;
  413. right: 0;
  414. margin: 0 auto;
  415. }
  416. .money-btn {
  417. position: relative;
  418. z-index: 2;
  419. color: #ffffff;
  420. text-align: right;
  421. font-size: 30rpx;
  422. font-family: PingFang SC;
  423. font-weight: bold;
  424. color: #ffffff;
  425. text {
  426. display: inline-block;
  427. padding-left: 10rpx;
  428. }
  429. }
  430. </style>