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.

367 lines
7.9 KiB

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