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.

340 lines
7.4 KiB

10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <!-- 提现页面 -->
  2. <template>
  3. <view class="withdraw bx">
  4. <navbar :leftClick="leftClick" :title="$t('page.withdraw.title')"></navbar>
  5. <!-- 用户余额信息 -->
  6. <view class="user-money content">
  7. <view class="title">{{ $t('page.purse.account') }}</view>
  8. <view class="money">
  9. <view class="money-unit">{{ $t('page.withdraw.unit') }}</view>
  10. <view class="money-detail">{{ money }}</view>
  11. </view>
  12. </view>
  13. <view class="withdraw-amount content">
  14. <view class="withdraw-title">{{ $t('page.withdraw.withdraw-amount')}}</view>
  15. <view class="withdraw-content">{{ $t('page.withdraw.withdraw-descript')}}</view>
  16. </view>
  17. <!-- 输入框组 -->
  18. <view class="inputs content">
  19. <view class="input-item">
  20. <view class="input-top">
  21. <view class="title">{{ $t('page.withdraw.address') }}</view>
  22. </view>
  23. <view class="address-info" style="margin-top: 20rpx;">
  24. {{ userInfo.moneyAddress }}
  25. </view>
  26. </view>
  27. <view class="input-item">
  28. <view class="input-top">
  29. <view class="title">{{ $t('page.withdraw.withdraw-amount') }}</view>
  30. <view @click="withdrawAll" class="all">{{ $t('page.withdraw.withdrawal-all') }}</view>
  31. </view>
  32. <input v-model="form.money" type="number" :placeholder="$t('page.withdraw.deposit-now')"/>
  33. </view>
  34. <!-- <view class="input-item">
  35. <view class="input-top">
  36. <view class="title">{{ $t('page.withdraw.pin') }}</view>
  37. </view>
  38. <input v-model="form.payPass" type="password"/>
  39. </view> -->
  40. </view>
  41. <!-- 提交按钮 -->
  42. <view @click="withdraw" class="submit content">{{ $t('page.withdraw.submit') }}</view>
  43. <!-- 超出最大提现金额提示 -->
  44. <view v-if="showModal" class="modal">
  45. <view class="modal-main">
  46. <view class="title">{{ $t('page.withdraw.warn') }}</view>
  47. <view class="tip">{{ $t('page.withdraw.warn-detail') }}</view>
  48. <view @click="showModal = false;$play()" class="ok">{{ $t('page.withdraw.ok') }}</view>
  49. </view>
  50. </view>
  51. <!-- 客服列表 -->
  52. <serviceList :show="showService" :serverList="serverList" @close="closeServiceList"></serviceList>
  53. </view>
  54. </template>
  55. <script>
  56. import navbar from '@/components/base/m-navbar.vue'
  57. import serviceList from '@/components/serviceList/serviceList.vue';
  58. export default {
  59. components: {
  60. navbar
  61. },
  62. data() {
  63. return {
  64. money : '',
  65. form : {
  66. money : '', //提现金额
  67. // payPass : '',
  68. address : ''
  69. },
  70. vipInfo : {},
  71. showModal : false, //是否显示超出最大提现金额提示
  72. serverList : [],
  73. showService : false,
  74. userInfo : {}
  75. }
  76. },
  77. onShow() {
  78. this.getUserInfo()
  79. this.forgetPass()
  80. },
  81. methods: {
  82. leftClick() {
  83. if(this.$route.query.type){
  84. return uni.navigateTo({
  85. url: '/pages/home/home'
  86. })
  87. }else{
  88. uni.navigateTo({
  89. url: '/pages/center/center'
  90. })
  91. }
  92. },
  93. //获取用户信息
  94. getUserInfo(){
  95. this.request('userInfo').then(res => {
  96. if(res.code == 200){
  97. this.userInfo = res.result.userInfo
  98. this.money = res.result.userInfo.money
  99. this.vipInfo = res.result.vip
  100. }
  101. })
  102. },
  103. //点击提现全部按钮
  104. withdrawAll(){
  105. this.$play()
  106. if(!this.money){
  107. return uni.$u.toast(this.$t('page.withdraw.noBalance'))
  108. }
  109. this.form.money = this.money
  110. },
  111. //提现
  112. withdraw(){
  113. this.$play()
  114. this.form.address = this.userInfo.moneyAddress
  115. let { money , address } = this.form;
  116. if(address.trim() == ''){
  117. return uni.$u.toast(this.$t('page.withdraw.addressEmpty'))
  118. }
  119. if(money <= 0){
  120. return uni.$u.toast(this.$t('page.withdraw.creditLimit'))
  121. }
  122. if(money > this.money){ //用户提现金额大于用户余额
  123. return uni.$u.toast(this.$t('page.withdraw.insufficientBalance'))
  124. }
  125. // if(payPass.trim() == ''){
  126. // return uni.$u.toast(this.$t('page.withdraw.payPassEmpty'))
  127. // }
  128. this.request('withdrawal2',{},this.form).then(res => {
  129. if(res.code == 200){
  130. uni.$u.toast(this.$t('page.withdraw.successfulWithdrawal'))
  131. this.cleanForm()
  132. this.revealServiceList()
  133. this.getUserInfo() //刷新用户信息(更新用户余额)
  134. }
  135. })
  136. },
  137. //显示客服列表
  138. revealServiceList(){
  139. this.$play()
  140. this.showService = true;
  141. },
  142. //关闭客服列表
  143. closeServiceList(){
  144. this.showService = false;
  145. },
  146. //忘记密码(获取客服列表)
  147. forgetPass(){
  148. this.request('forgetPass').then(res => {
  149. if(res.code == 200){
  150. this.serverList = res.result
  151. }
  152. })
  153. },
  154. //清空表单数据
  155. cleanForm(){
  156. this.form = {}
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .withdraw {
  163. width: 750rpx;
  164. min-height: 100vh;
  165. // background-color: black;
  166. margin: 0 auto;
  167. // background-image: url('@/static/withdraw/bg.png');
  168. background-size: 100%;
  169. background-repeat: no-repeat;
  170. .content {
  171. width: 96%;
  172. margin: 0 auto;
  173. }
  174. .user-money {
  175. background: $uni-bg-color-app;
  176. color: $uni-text-color-inverse;
  177. margin: 20rpx auto 30rpx auto;
  178. // border: 4rpx solid #D3EA5E;
  179. padding: 60rpx 0rpx;
  180. font-size: 36rpx;
  181. .title,
  182. .money {
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. height: 60rpx;
  187. .money-unit {
  188. margin-right: 15rpx;
  189. font-size: 28rpx;
  190. font-weight: bold;
  191. }
  192. .money-detail{
  193. font-size: 50rpx;
  194. font-weight: bold;
  195. }
  196. }
  197. }
  198. .withdraw-amount{
  199. color: $uni-text-color;
  200. .withdraw-title{
  201. font-size: 28rpx;
  202. font-weight: bold;
  203. margin-bottom: 20rpx;
  204. }
  205. .withdraw-content{
  206. color: $uni-text-color;
  207. font-size: 24rpx;
  208. }
  209. }
  210. .inputs{
  211. .input-item{
  212. margin-top: 35rpx;
  213. .input-top{
  214. display: flex;
  215. justify-content: space-between;
  216. .title{
  217. font-size: 28rpx;
  218. font-weight: bold;
  219. color: $uni-text-color;
  220. }
  221. .all{
  222. background: $uni-bg-color-app;
  223. padding: 5rpx 10rpx;
  224. border-radius: 10rpx;
  225. font-size: 20rpx;
  226. color: $uni-text-color-inverse;
  227. }
  228. }
  229. .address-info{
  230. display: flex;
  231. align-items: center;
  232. box-sizing: border-box;
  233. padding-left: 20rpx;
  234. height: 80rpx;
  235. border-radius: 10rpx;
  236. background: #e9ecef;
  237. font-size: 34rpx;
  238. }
  239. input{
  240. border: 1px solid $uni-bg-color-app;
  241. height: 80rpx;
  242. margin-top: 20rpx;
  243. text-indent: 1em;
  244. border-radius: 10rpx;
  245. }
  246. }
  247. }
  248. .submit{
  249. height: 90rpx;
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. background: $uni-bg-color-app;
  254. border-radius: 10rpx;
  255. font-size: 40rpx;
  256. font-weight: bold;
  257. margin-top: 30rpx;
  258. color: $uni-text-color-inverse;
  259. }
  260. .modal{
  261. display: flex;
  262. align-items: center;
  263. justify-content: center;
  264. position: fixed;
  265. left: 0;
  266. top: 0;
  267. width: 750rpx;
  268. height: 100vh;
  269. .modal-main{
  270. width: 600rpx;
  271. background: black;
  272. border-radius: 10rpx;
  273. color: #ccc;
  274. border: 1px solid #ccc;
  275. .title{
  276. text-align: center;
  277. font-size: 36rpx;
  278. color: #afc638;
  279. font-weight: bold;
  280. padding: 20rpx 0rpx;
  281. }
  282. .tip{
  283. box-sizing: border-box;
  284. padding: 0rpx 20rpx;
  285. margin-bottom: 20rpx;
  286. }
  287. .ok{
  288. height: 90rpx;
  289. display: flex;
  290. align-items: center;
  291. justify-content: center;
  292. background: black;
  293. border-radius: 10rpx;
  294. font-size: 40rpx;
  295. font-weight: bold;
  296. border-top: 1px solid #ffffff80;
  297. }
  298. }
  299. }
  300. }
  301. </style>