多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
3.3 KiB

2 years ago
2 years ago
2 years ago
  1. <!-- 我的账户 -->
  2. <template>
  3. <view>
  4. <global-loading />
  5. <view class="container" v-if="ifShow">
  6. <view class="balance">
  7. </view>
  8. <view class="balanceInfo">
  9. <view class="infoBox">
  10. <view v-if="accountInfo.price != null " class="cur-balance">{{accountInfo.price}}</view>
  11. <view v-else class="cur-balance">0.00</view>
  12. <view class="mar-top-20">{{$t('common.balance')}}</view>
  13. </view>
  14. </view>
  15. <view class="balance-operation">
  16. <view class="item-btn" @click="memberAccountWithdraw">
  17. <image class="item-btn-icon" src="https://ceres.zkthink.com/static/images/withdraw.png" mode="widthFix"></image>
  18. <view class="item-btn-text">{{$t('common.withdraw')}}</view>
  19. <image class="item-btn-right" src="https://ceres.zkthink.com/static/images/greyArrow.png" mode="widthFix"></image>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. const NET = require('../../utils/request')
  27. const API = require('../../config/api')
  28. export default {
  29. data() {
  30. return {
  31. accountInfo:[],
  32. ifShow: false
  33. }
  34. },
  35. onShow() {
  36. this.getBalance()
  37. },
  38. onBackPress(e) {
  39. if (e.from === 'navigateBack') {
  40. return false;
  41. }
  42. this.back();
  43. return true;
  44. },
  45. methods: {
  46. back(){
  47. uni.switchTab({
  48. url:'../../pages/tabbar/user/index'
  49. });
  50. },
  51. getBalance(){
  52. const _ = this
  53. // uni.showLoading({
  54. // mask: true,
  55. // title: '加载中...'
  56. // })
  57. NET.request(API.GetDistributor,{},"GET").then(res => {
  58. uni.hideLoading()
  59. this.ifShow = true
  60. _.accountInfo = res.data
  61. }).catch(res => {
  62. })
  63. },
  64. memberAccountWithdraw(){
  65. if(this.accountInfo.price <= 0 ){
  66. uni.showToast({
  67. title: "您暂时没有余额,不能提现",
  68. duration: 2000,
  69. icon: 'none'
  70. })
  71. }else{
  72. uni.navigateTo({
  73. url:'withdraw'
  74. })
  75. }
  76. }
  77. },
  78. filters: {
  79. parseMoney(money){
  80. return parseFloat(money/100).toFixed(2)
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. page {
  87. background: #F8F8F8;
  88. }
  89. .container{
  90. background: #f8f8f8;
  91. .balance{
  92. display: block;
  93. height: 400rpx;
  94. background: url("https://ceres.zkthink.com/static/images/bankBg.png") no-repeat left top;
  95. background-size: cover;
  96. text-align:center;
  97. padding: 100rpx 20rpx 0 20rpx;
  98. }
  99. .balanceInfo {
  100. width: 712rpx;
  101. background: url("https://ceres.zkthink.com/static/images/accountBg.png") no-repeat left top;
  102. height: 342rpx;
  103. background-size: cover;
  104. margin: -300rpx auto 0 auto;
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. border-radius: 20rpx;
  109. .infoBox {
  110. text-align: center;
  111. .cur-balance{
  112. font-size:60rpx;
  113. color: #71521B;
  114. }
  115. }
  116. }
  117. .balance-operation {
  118. margin-top: 38rpx;
  119. padding: 0 24rpx;
  120. .item-btn {
  121. }
  122. }
  123. }
  124. .item-btn{
  125. width: 100%;
  126. height: 100upx;
  127. display: flex;
  128. flex-direction: row;
  129. align-items: center;
  130. box-sizing: border-box;
  131. background-color: #fff;
  132. padding: 0 30upx;
  133. .item-btn-icon{
  134. width: 90upx;
  135. height: 90upx;
  136. }
  137. .item-btn-text{
  138. font-size:28upx;
  139. margin-left: 20upx;
  140. font-weight:500;
  141. flex: 1;
  142. color:rgba(102,102,102,1);
  143. }
  144. .item-btn-right{
  145. width: 60upx;
  146. height: 60upx;
  147. }
  148. }
  149. .mt20{
  150. margin-top: 20upx;
  151. }
  152. .mt1{
  153. margin-top: 1upx;
  154. }
  155. </style>