多租户商城-商户小程序端
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.

178 lines
3.9 KiB

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