withdraw.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="page">
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false" left-icon="left" title="收益提现" @clickLeft="back" />
  5. <!-- #endif -->
  6. <view class="title flex-col">
  7. <!--#ifdef H5-->
  8. <view class="flex-row justify-center" v-if="$isWxBrowser()">
  9. <text class="title1">收益提现</text>
  10. </view>
  11. <!--#endif-->
  12. <text class="title2" @click="navigateTo('/pages/withdrawalRecord/withdrawalRecord')">提现记录</text>
  13. </view>
  14. <view class="flex-col justify-center" :style="{marginTop:'150rpx'}">
  15. <view class="flex-row justify-center">
  16. <text class="priceTitle">可提现金额</text>
  17. </view>
  18. <view class="flex-row justify-center marginTop">
  19. <text class="price">{{statistics.myEarning || '0.00'}}</text>
  20. </view>
  21. </view>
  22. <view class="flex-row justify-start ":style="{marginTop:'150rpx'}">
  23. <checkbox-group @change="checkboxChange">
  24. <checkbox :checked="checked" color="#000000" :style="{'transform':'scale(0.7)'}"/>
  25. <text class="read">请阅读并同意</text>
  26. <text @click.stop="gotoTermOfService(8)" class="read">《娇骄儿拓客活动规则》</text>
  27. </checkbox-group>
  28. </view>
  29. <view class="flex-row justify-center marginTop">
  30. <view class="withdrawButton" @click="apply">
  31. <text>立即提现</text>
  32. </view>
  33. </view>
  34. <!--#ifdef H5-->
  35. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  36. <!--#endif-->
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. checked:false,
  44. statistics:{},
  45. }
  46. },
  47. onShow() {
  48. this.exStatistics()
  49. },
  50. methods: {
  51. // 查看储值协议
  52. gotoTermOfService(type){
  53. uni.navigateTo({
  54. url: '/pages/agreement/agreement?name='+'娇骄儿拓客活动规则'+'&type=' + 10,
  55. })
  56. },
  57. apply(){
  58. if (!this.checked){
  59. uni.showToast({
  60. icon: 'none',
  61. duration: 3000,
  62. title: '请同意《娇骄儿拓客活动规则》'
  63. });
  64. return
  65. }
  66. this.$api.service.apply({
  67. amount:null
  68. }).then(res=>{
  69. uni.showToast({
  70. icon: 'success',
  71. duration: 3000,
  72. title: '申请成功'
  73. });
  74. })
  75. },
  76. exStatistics(){
  77. this.$api.service.exStatistics().then(res=>{
  78. this.statistics = res.data.data
  79. })
  80. },
  81. navigateTo(url) {
  82. uni.navigateTo({
  83. url: url
  84. })
  85. },
  86. back() {
  87. let pages = getCurrentPages()
  88. if (pages.length > 1){
  89. uni.navigateBack({
  90. delta: 1,
  91. fail:err=>{
  92. console.log(err)
  93. }
  94. })
  95. }else {
  96. uni.switchTab({
  97. url: '/pages/my/my'
  98. });
  99. }
  100. },
  101. checkboxChange(){
  102. this.checked = !this.checked
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. @import './index.rpx.css';
  109. </style>