Index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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="div title">应缴保证金</view>
  15. <view class="div amount">¥{{store_info.store_payable_deposit}}</view>
  16. <view class="div desc-wrapper">
  17. <view class="div desc">已缴:{{store_info.store_avaliable_deposit}}</view>
  18. <view class="div desc">审核:{{store_info.store_freeze_deposit}}</view>
  19. </view>
  20. </view>
  21. <view class="div main-content">
  22. <view class="div" @click="goSellerDepositList">
  23. <flex-line :is-link="true" :show-border="true"><text class="span line-name">保证金明细</text></flex-line>
  24. </view>
  25. <view class="div" @click="goSellerDepositWithdrawList">
  26. <flex-line :is-link="true" :show-border="true"><text class="span line-name">保证金审核</text></flex-line>
  27. </view>
  28. <view class="div" @click="addDeposit">
  29. <flex-line :is-link="true" :show-border="true"><text class="span line-name">补缴保证金</text></flex-line>
  30. </view>
  31. <view class="div" @click="reduceDeposit">
  32. <flex-line :is-link="true" :show-border="true"><text class="span line-name">取出保证金</text></flex-line>
  33. </view>
  34. </view>
  35. </view>
  36. <uni-popup background-color="#fff" ref="confirm" type="dialog">
  37. <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
  38. </uni-popup>
  39. </seller-base>
  40. </template>
  41. <script>
  42. import {getFontSize} from '@/util/common'
  43. import TitleHeader from '../../TitleHeader'
  44. import SellerBase from '../SellerBase'
  45. import { getSellerInfo } from '../../../api/seller'
  46. import { addSellerDeposit, reduceSellerDeposit } from '../../../api/sellerDeposit'
  47. import flexLine from '../../flexLine'
  48. export default {
  49. name: 'Index',
  50. computed:{
  51. fontSize(){
  52. return getFontSize()
  53. },
  54. },
  55. data(){
  56. return {
  57. navHeight: 0,
  58. dialog:{},
  59. store_info: {}
  60. }
  61. },
  62. components:{ TitleHeader, SellerBase, flexLine },
  63. created: function () {
  64. this.getSellerInfo()
  65. },
  66. mounted(){
  67. // #ifdef MP-WEIXIN
  68. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  69. // #endif
  70. },
  71. methods:{
  72. closeDialog(){
  73. },
  74. confirmDialog(value){
  75. switch(this.dialog.condition){
  76. case 1:
  77. addSellerDeposit(value).then(res => {
  78. this.getSellerInfo()
  79. uni.showToast({icon:'none',title: res.message})
  80. }).catch(function (error) {
  81. uni.showToast({icon:'none',title: error.message})
  82. })
  83. break
  84. case 2:
  85. reduceSellerDeposit(value).then(res => {
  86. this.getSellerInfo()
  87. uni.showToast({icon:'none',title: res.message})
  88. }).catch(function (error) {
  89. uni.showToast({icon:'none',title: error.message})
  90. })
  91. break
  92. }
  93. },
  94. goBack(){uni.navigateBack({delta:1})},
  95. getSellerInfo () {
  96. getSellerInfo().then(response => {
  97. if (response && response.result) {
  98. this.store_info = response.result.store_info
  99. }
  100. }
  101. ).catch(function (error) {
  102. uni.showToast({icon:'none',title: error.message})
  103. })
  104. },
  105. // 店铺保证金明细
  106. goSellerDepositList () {
  107. uni.navigateTo({url:'/pages/seller/deposit/DepositList'})
  108. },
  109. // 保证金审核列表
  110. goSellerDepositWithdrawList () {
  111. uni.navigateTo({url:'/pages/seller/deposit/WithdrawList'})
  112. },
  113. // 申请提现
  114. addDeposit () {
  115. this.dialog={condition:1,mode:'input',content:'请输入补缴金额'}
  116. this.$refs.confirm.open()
  117. },
  118. reduceDeposit () {
  119. this.dialog={condition:2,mode:'input',content:'请输入取出金额'}
  120. this.$refs.confirm.open()
  121. }
  122. }
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. .common-header-wrap .common-header{box-shadow: unset}
  127. .main-content{background: #fff;padding:0 $pageSpace}
  128. .header{background: $primaryColor;position: relative;color: #fff;padding:1rem $pageSpace;
  129. .title{font-size:$h2}
  130. .amount{font-size:1.6rem;text-align: center;padding:1rem 0;}
  131. .desc-wrapper{display: flex;
  132. .desc{flex:1;font-size:$h2 }
  133. }
  134. }
  135. </style>