billDetails2.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <view class="white-box">
  6. <view class="tx">
  7. <view class="tx-grid">
  8. <view class="tx-grid-text">
  9. <view class="title">可提现余额</view>
  10. <view class="money">
  11. <text>{{ accountBalance }}</text>
  12. <text class="money-b">元</text>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="tx-grid" @click="toWithdraw"><span class="tx-grid-comm-sign">立即提现</span></view>
  17. </view>
  18. <view class="palace palace-one">
  19. <view class="palace-grid">
  20. <view class="palace-grid-text" :class="active==0?'active':''" @tap="changeTab(0)">
  21. <view class="palace-grid-text-data">
  22. <text>{{ applyAmount.toFixed(2) }}</text>
  23. <text class="palace-grid-text-data-b">元</text>
  24. </view>
  25. <view class="palace-grid-text-name">提现中</view>
  26. </view>
  27. </view>
  28. <view class="palace-grid">
  29. <view class="palace-grid-text" >
  30. <view class="palace-grid-text-data">
  31. <text>{{ totalAmount.toFixed(2) }}</text>
  32. <text class="palace-grid-text-data-b">元</text>
  33. </view>
  34. <view class="palace-grid-text-name">累计提现</view>
  35. </view>
  36. </view>
  37. <view class="palace-grid">
  38. <view class="palace-grid-text" :class="active==2?'active':''" @tap="changeTab(2)">
  39. <view class="palace-grid-text-data">
  40. <text>{{ payamount.toFixed(2) }}</text>
  41. <text class="palace-grid-text-data-b">元</text>
  42. </view>
  43. <view class="palace-grid-text-name">已到账</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <z-paging auto-show-back-to-top ref="paging" @query="getOrdersList" v-model="list" :default-page-size="10" :mounted-auto-call-reload="true" :style="getHeight">
  49. <view class="list-view">
  50. <!-- 查询区域Start -->
  51. <!-- <view class="queryView d-flex">
  52. <view class="d-flex a-center j-center">
  53. <picker @change="bindPickerYearChange" :value="yearIndex" :range="yearArray">
  54. <view class="d-flex a-center">{{yearArray[yearIndex]}}年 <view class="icon iconfont icon-xiala"></view></view>
  55. </picker>
  56. </view>
  57. <view class="d-flex a-center j-center">
  58. <picker @change="bindPickerMonthChange" :value="monthIndex" :range="monthArray">
  59. <view class="d-flex a-center">{{monthArray[monthIndex]}}月 <view class="icon iconfont icon-xiala"></view></view>
  60. </picker>
  61. </view>
  62. <view class="d-flex a-center j-center">
  63. <picker @change="bindPickerDateChange" :value="dateIndex" :range="dateArray">
  64. <view class="d-flex a-center">{{dateArray[dateIndex]}}日 <view class="icon iconfont icon-xiala"></view></view>
  65. </picker>
  66. </view>
  67. <view class="d-flex a-center j-center">
  68. <view class="d-flex a-center px-2">合计:0.00</view>
  69. </view>
  70. </view> -->
  71. <!-- 查询区域End -->
  72. <block v-for="(item,index) in list" :key="index">
  73. <view class="list-item" @tap="toBillInfo(index)">
  74. <view class="content-box">
  75. <view class="des-box" v-if="active==0" >
  76. <view class="tit">订单号:{{item.applyno }}</view>
  77. <view class="time">提现时间:{{ item.createtime }}</view>
  78. </view>
  79. <view class="des-box" v-if="active==2">
  80. <view class="tit">订单号:{{item.applyno }}</view>
  81. <view class="time">提现时间:{{ item.createtime }}</view>
  82. <view class="time">到账时间:{{ item.paytime }}</view>
  83. </view>
  84. </view>
  85. <view class="money d-flex a-center j-center flex-column" v-if="active==0">
  86. <view>{{item.applyamount }}</view>
  87. <view>提现金额</view>
  88. </view>
  89. <view class="money d-flex a-center j-center flex-column" v-if="active==2">
  90. <view>-{{item.applyamount }}</view>
  91. <view>提现金额</view>
  92. </view>
  93. </view>
  94. </block>
  95. </view>
  96. </z-paging>
  97. </view>
  98. </template>
  99. <script>
  100. import {mapState} from "vuex"
  101. import ZPagingMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin';
  102. export default {
  103. components: {
  104. ZPagingMixin
  105. },
  106. computed:{
  107. ...mapState(['userInfo']),
  108. getHeight() {
  109. let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(356);
  110. return `height: ${height}px`;
  111. }
  112. },
  113. onLoad() {
  114. // 搜索年选项Start
  115. this.yearArray=[(new Date().getFullYear()-2),(new Date().getFullYear()-1),new Date().getFullYear(),]
  116. this.yearIndex=this.yearArray.length-1;
  117. // 搜索年选项End
  118. // 搜索月选项Start
  119. var month = new Date().getMonth()+1;
  120. for(var i=1;i<=month;i++){
  121. if(i<10){
  122. this.monthArray.push('0'+i);
  123. }else{
  124. this.monthArray.push(i);
  125. }
  126. }
  127. this.monthIndex=this.monthArray.length-1;
  128. // 搜索月选项End
  129. // 搜索日选项Start
  130. var date = new Date().getDate();
  131. for(var i=1;i<=date;i++){
  132. if(i<10){
  133. this.dateArray.push('0'+i);
  134. }else{
  135. this.dateArray.push(i);
  136. }
  137. }
  138. this.dateIndex=this.dateArray.length-1;
  139. // 搜索日选项End
  140. },
  141. data() {
  142. return {
  143. /* 查询区域Start */
  144. yearArray:[], //订单的查询年份
  145. yearIndex:0, //订单的年份选择
  146. monthArray:[], //订单的查询月份
  147. monthIndex:0, //订单的月份选择
  148. dateArray:[], //订单的查询月份
  149. dateIndex:0, //订单的月份选择
  150. /* 查询区域End */
  151. active:0,
  152. list: [],
  153. "totalAmount": 0, //计提现
  154. "applyAmount": 0, //提现中
  155. "accountBalance": 0, //可提现金额
  156. "payamount": 0 //已到账
  157. };
  158. },
  159. async onShow() {
  160. await this.getPayAccount();
  161. },
  162. methods: {
  163. //搜索年发生变化
  164. bindPickerYearChange(e) {
  165. this.yearIndex = e.target.value;
  166. this.monthArray=[];
  167. if(this.yearIndex == (this.yearArray.length-1)){
  168. var month = new Date().getMonth()+1;
  169. for(var i=1;i<=month;i++){
  170. if(i<10){
  171. this.monthArray.push('0'+i);
  172. }else{
  173. this.monthArray.push(i);
  174. }
  175. }
  176. this.monthIndex=this.monthArray.length-1;
  177. }else{
  178. for(var i=1;i<=12;i++){
  179. if(i<10){
  180. this.monthArray.push('0'+i);
  181. }else{
  182. this.monthArray.push(i);
  183. }
  184. }
  185. this.monthIndex=0;
  186. }
  187. },
  188. //搜索月发生变化
  189. bindPickerMonthChange(e) {
  190. this.monthIndex = e.target.value;
  191. },
  192. bindPickerDateChange(e){
  193. this.dateIndex = e.target.value;
  194. },
  195. async changeTab(tabIndex){
  196. this.active = tabIndex;
  197. this.list = [];
  198. await this.getOrdersList(1,10);
  199. },
  200. // 预收账户金额查询
  201. async getPayAccount() {
  202. let res = await this.$http.get('/insPayApply/payAccount?userid=' + this.userInfo.sysUser.id, {},{load:false});
  203. if (res.code == 200) {
  204. this.totalAmount = res.data.totalAmount;
  205. this.applyAmount = res.data.applyAmount;
  206. this.accountBalance = res.data.accountBalance;
  207. this.payamount = res.data.payamount;
  208. }
  209. },
  210. //获取订单数据Start
  211. async getOrdersList(pageNo, pageSize) {
  212. var data = {
  213. "columnFilters": {
  214. "applytype": {
  215. "name": "applytype",
  216. "value": 'A'
  217. },
  218. "applystatus":{
  219. "name":"applystatus",
  220. "value":this.active
  221. },
  222. "userid": {
  223. "name": "userid",
  224. "value": this.userInfo.sysUser.id
  225. }
  226. },
  227. "pageNum": pageNo,
  228. "pageSize": pageSize
  229. };
  230. let res = await this.$http.post('/insPayApply/findPage',data);
  231. let content = [];
  232. if (res.code == 200) {
  233. if(res.data.content.length>0){
  234. content = res.data.content;
  235. }
  236. }
  237. this.$refs.paging.complete(content);
  238. },
  239. //获取订单数据End
  240. navTo(url) {
  241. console.log(url)
  242. this.navigate({
  243. url:url
  244. },"navigateTo",true)
  245. },
  246. // 去提现
  247. toWithdraw(){
  248. if((!!this.userInfo.esmUserInternal) && (!!this.userInfo.esmUserInternal.accountno)){
  249. this.navigate({
  250. url:'/pages/wallet/withdraw'
  251. },"navigateTo",true)
  252. }else{
  253. this.navigate({
  254. url:'/pages/wallet/bindBank',
  255. complete:() => {
  256. setTimeout(() => {
  257. uni.showToast({ title: '请先绑定银行卡',duration:3000,icon:"none"});
  258. }, 500);
  259. }
  260. },"navigateTo",true)
  261. }
  262. },
  263. toBillInfo(index){
  264. this.navigate({
  265. url:'/pages/wallet/billInfo',
  266. success:(res) => {
  267. res.eventChannel.emit("acceptData",{
  268. item:this.list[index]
  269. })
  270. }
  271. },"navigateTo",true)
  272. }
  273. },
  274. };
  275. </script>
  276. <style lang="scss" scoped>
  277. @import '@/style/mixin.scss';
  278. page {
  279. background-color: #fff;
  280. }
  281. .white-box {
  282. width: 94%;
  283. background: white;
  284. border-radius: 10rpx;
  285. margin: 20rpx auto 20rpx;
  286. box-shadow: 0 6rpx 20rpx #e7e7e7;
  287. }
  288. .white-box .tx {
  289. padding-top: 26rpx;
  290. overflow: hidden;
  291. display: flex;
  292. justify-content: space-between;
  293. align-content: center;
  294. }
  295. .white-box .tx .tx-grid {
  296. box-sizing: border-box;
  297. }
  298. .white-box .tx .tx-grid:first-child {
  299. margin-left: 40rpx;
  300. }
  301. .white-box .tx .tx-grid .tx-grid-comm-sign {
  302. display: block;
  303. border-radius: 40rpx 0 0 40rpx;
  304. font-size: 26rpx;
  305. padding: 16rpx 44rpx;
  306. background: linear-gradient(to right, rgba($themeColor,0.8), rgba($themeColor,0.6));
  307. color: #fff;
  308. font-weight: bold;
  309. }
  310. .white-box .tx .tx-grid .tx-grid-text {
  311. display: block;
  312. color: #333;
  313. font-size: 26rpx;
  314. white-space: nowrap;
  315. text-overflow: ellipsis;
  316. overflow: hidden;
  317. }
  318. .white-box .palace .palace-grid .palace-grid-text.active{
  319. background-color: rgba($themeColor,0.6);
  320. }
  321. .white-box .palace .palace-grid .palace-grid-text.active>view{
  322. color: #FFFFFF;
  323. }
  324. .white-box .tx .tx-grid .tx-grid-text .title {
  325. font-size: 26rpx;
  326. font-weight: normal;
  327. color: $themeColor;
  328. }
  329. .white-box .tx .tx-grid .tx-grid-text .money {
  330. font-size: 60rpx;
  331. color: $themeColor;
  332. letter-spacing: 2rpx;
  333. margin-bottom: 10rpx;
  334. }
  335. .white-box .tx .tx-grid .tx-grid-text .money-b {
  336. font-size: 28rpx;
  337. }
  338. .white-box .palace {
  339. padding-bottom: 20rpx;
  340. overflow: hidden;
  341. display: flex;
  342. justify-content: center;
  343. }
  344. .white-box .palace .palace-grid {
  345. flex: 1;
  346. position: relative;
  347. box-sizing: border-box;
  348. }
  349. .white-box .palace .palace-grid .palace-grid-text {
  350. display: block;
  351. text-align: center;
  352. color: #333;
  353. font-size: 32rpx;
  354. white-space: nowrap;
  355. text-overflow: ellipsis;
  356. overflow: hidden;
  357. }
  358. .white-box .palace .palace-grid .palace-grid-text .palace-grid-text-name {
  359. font-size: 26rpx;
  360. font-weight: normal;
  361. color: $themeColor;
  362. }
  363. .white-box .palace .palace-grid .palace-grid-text .palace-grid-text-data {
  364. font-size: 32rpx;
  365. color: $themeColor;
  366. letter-spacing: 2rpx;
  367. margin-bottom: 5rpx;
  368. }
  369. .white-box .palace .palace-grid .palace-grid-text .palace-grid-text-data .palace-grid-text-data-b {
  370. font-size: 20rpx;
  371. }
  372. .list-view {
  373. position: relative;
  374. width: 100%;
  375. overflow: hidden;
  376. }
  377. .list-item {
  378. width: 100%;
  379. padding: 30rpx 28rpx;
  380. box-sizing: border-box;
  381. background: #fff;
  382. display: flex;
  383. align-items: flex-start;
  384. justify-content: space-between;
  385. border-bottom: 1rpx solid #eaeef1;
  386. }
  387. .item-last::after {
  388. left: 0 !important;
  389. }
  390. .content-box {
  391. display: flex;
  392. align-items: flex-start;
  393. justify-content: space-between;
  394. }
  395. .des-box {
  396. min-height: 80rpx;
  397. padding-left: 28rpx;
  398. box-sizing: border-box;
  399. vertical-align: top;
  400. color: #333;
  401. font-size: 24rpx;
  402. display: flex;
  403. flex-direction: column;
  404. justify-content: space-between;
  405. }
  406. .tit {
  407. font-size: 30rpx;
  408. max-width: 500rpx;
  409. white-space: nowrap;
  410. overflow: hidden;
  411. text-overflow: ellipsis;
  412. }
  413. .time {
  414. color: #888;
  415. }
  416. .money {
  417. font-size: 38rpx;
  418. font-weight: 500;
  419. color: $themeColor;
  420. white-space: nowrap;
  421. overflow: hidden;
  422. text-overflow: ellipsis;
  423. padding-left: 20rpx;
  424. }
  425. /* 查询区域Start */
  426. .queryView {
  427. justify-content: space-around;
  428. height: 82upx;
  429. line-height: 80upx;
  430. }
  431. .queryView>view{
  432. border-top: 1px solid #FFC38F;
  433. border-bottom: 1px solid #FFC38F;
  434. border-left: 1px solid #FFC38F;
  435. box-sizing: border-box;
  436. color: #FFC38F;
  437. }
  438. .queryView>view:nth-child(1){
  439. flex: 4;
  440. }
  441. .queryView>view:nth-child(2){
  442. flex: 3;
  443. }
  444. .queryView>view:nth-child(3){
  445. flex: 3;
  446. }
  447. .queryView>view:nth-child(4){
  448. border-right: 1px solid #FFC38F;
  449. flex: 4;
  450. }
  451. /* 查询区域End */
  452. </style>