Index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-base :show="false">
  3. <view class="div container">
  4. <view class="div common-header-wrap">
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="店铺资金" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="div header">
  14. <view class="p">可用余额</view>
  15. <view><text class="h2">{{store_info.store_avaliable_money}}</text></view>
  16. <view><text class="h5">冻结金额:{{store_info.store_freeze_money}}</text></view>
  17. </view>
  18. <view class="div main-content">
  19. <view class="div" @click="goSellerMoneyLogList">
  20. <flex-line :is-link="true" :show-border="true"><text class="span line-name">资金明细</text></flex-line>
  21. </view>
  22. <view class="div" @click="goSellerMoneyWithdrawList">
  23. <flex-line :is-link="true" :show-border="true"><text class="span line-name">提现列表</text></flex-line>
  24. </view>
  25. <view class="div" @click="goSellerMoneyWithdrawForm">
  26. <flex-line :is-link="true" :show-border="true"><text class="span line-name">申请提现</text></flex-line>
  27. </view>
  28. </view>
  29. </view>
  30. <uni-popup background-color="#fff" ref="confirm" type="dialog">
  31. <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
  32. </uni-popup>
  33. </seller-base>
  34. </template>
  35. <script>
  36. import {getFontSize} from '@/util/common'
  37. import TitleHeader from '../../TitleHeader'
  38. import SellerBase from '../SellerBase'
  39. import { getSellerInfo } from '../../../api/seller'
  40. import { addSellerMoneyWithdraw } from '../../../api/sellerMoney'
  41. import flexLine from '../../flexLine'
  42. export default {
  43. name: 'Index',
  44. computed:{
  45. fontSize(){
  46. return getFontSize()
  47. },
  48. },
  49. data(){
  50. return {
  51. navHeight: 0,
  52. dialog:{},
  53. store_info: {}
  54. }
  55. },
  56. components:{ TitleHeader, SellerBase, flexLine },
  57. created: function () {
  58. this.getSellerInfo()
  59. },
  60. mounted(){
  61. // #ifdef MP-WEIXIN
  62. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  63. // #endif
  64. },
  65. methods:{
  66. closeDialog(){
  67. },
  68. confirmDialog(value){
  69. addSellerMoneyWithdraw(value).then(res => {
  70. this.getSellerInfo()
  71. uni.showToast({icon:'none',title: res.message})
  72. }).catch(function (error) {
  73. uni.showToast({icon:'none',title: error.message})
  74. })
  75. },
  76. goBack(){uni.navigateBack({delta:1})},
  77. getSellerInfo () {
  78. getSellerInfo().then(response => {
  79. if (response && response.result) {
  80. this.store_info = response.result.store_info
  81. }
  82. }
  83. ).catch(function (error) {
  84. uni.showToast({icon:'none',title: error.message})
  85. })
  86. },
  87. // 店铺资金明细
  88. goSellerMoneyLogList () {
  89. uni.navigateTo({url:'/pages/seller/money/LogList'})
  90. },
  91. // 提现明细
  92. goSellerMoneyWithdrawList () {
  93. uni.navigateTo({url:'/pages/seller/money/WithdrawList'})
  94. },
  95. // 申请提现
  96. goSellerMoneyWithdrawForm () {
  97. this.dialog={mode:'input',content:'请输入提现金额'}
  98. this.$refs.confirm.open()
  99. }
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .common-header-wrap .common-header{box-shadow: unset}
  105. .main-content{background: #fff;padding:0 $pageSpace}
  106. .header{background: $primaryColor;width: 100%;position: relative;color: #fff;padding:2.2rem 0;text-align:center;}
  107. .header .p{font-size:$h2;}
  108. .header .h2 {font-size:1.6rem;padding: .5rem 0;}
  109. .header .h5 {font-size:$h2;}
  110. </style>