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.

373 lines
8.0 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <!-- 提现页面 -->
  2. <template>
  3. <view class="withdraw bx">
  4. <!-- 用户余额信息 -->
  5. <view class="user-money content">
  6. <view class="title info">{{ $t('page.center.balance') }}</view>
  7. <view class="money">
  8. <view class="money-unit">{{ $store.state.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.withdrawal-account') }}
  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;">{{ $store.state.unit }}</text> <input v-model="form.money" type="number" />
  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.min-withdrawal') }}
  28. </view>
  29. </view>
  30. <view class="box content">
  31. <view class="title info">{{ $t('page.withdraw.payment-password') }}</view>
  32. <input v-model="form.payPass" type="password" :placeholder="$t('page.withdraw.payment_password-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.confirm') }}</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(`message.${res.message}`))
  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. padding-left: 40rpx;
  206. margin-bottom: 40rpx;
  207. font-size: 26rpx;
  208. color: #999;
  209. }
  210. .money {
  211. display: flex;
  212. align-items: center;
  213. height: 60rpx;
  214. padding-left: 40rpx;
  215. .money-unit {
  216. margin-right: 15rpx;
  217. font-size: 26rpx;
  218. font-weight: bold;
  219. margin-top: 15rpx;
  220. }
  221. .money-detail{
  222. font-size: 50rpx;
  223. font-weight: bold;
  224. }
  225. }
  226. }
  227. .withdraw-amount{
  228. color: $uni-text-color;
  229. .withdraw-title{
  230. font-size: 28rpx;
  231. font-weight: bold;
  232. margin-bottom: 20rpx;
  233. }
  234. .withdraw-content{
  235. color: $uni-text-color;
  236. font-size: 24rpx;
  237. }
  238. }
  239. .inputs{
  240. .input-item{
  241. margin-top: 35rpx;
  242. .input-top{
  243. display: flex;
  244. justify-content: space-between;
  245. .title{
  246. font-size: 28rpx;
  247. font-weight: bold;
  248. color: $uni-text-color;
  249. }
  250. .all{
  251. background: $uni-bg-color-app;
  252. padding: 5rpx 10rpx;
  253. border-radius: 10rpx;
  254. font-size: 20rpx;
  255. color: $uni-text-color-inverse;
  256. }
  257. }
  258. .address-info{
  259. display: flex;
  260. align-items: center;
  261. box-sizing: border-box;
  262. padding-left: 20rpx;
  263. height: 80rpx;
  264. border-radius: 10rpx;
  265. background: #e9ecef;
  266. font-size: 34rpx;
  267. }
  268. input{
  269. border: 1px solid $uni-bg-color-app;
  270. height: 80rpx;
  271. margin-top: 20rpx;
  272. text-indent: 1em;
  273. border-radius: 10rpx;
  274. }
  275. }
  276. }
  277. .submit{
  278. height: 90rpx;
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. background: $uni-bg-color-app;
  283. border-radius: 40rpx;
  284. font-size: 40rpx;
  285. font-weight: bold;
  286. margin-top: 30rpx;
  287. color: $uni-text-color-inverse;
  288. }
  289. .modal{
  290. display: flex;
  291. align-items: center;
  292. justify-content: center;
  293. position: fixed;
  294. left: 0;
  295. top: 0;
  296. width: 750rpx;
  297. height: 100vh;
  298. .modal-main{
  299. width: 600rpx;
  300. background: black;
  301. border-radius: 10rpx;
  302. color: #ccc;
  303. border: 1px solid #ccc;
  304. .title{
  305. text-align: center;
  306. font-size: 36rpx;
  307. color: #afc638;
  308. font-weight: bold;
  309. padding: 20rpx 0rpx;
  310. }
  311. .tip{
  312. box-sizing: border-box;
  313. padding: 0rpx 20rpx;
  314. margin-bottom: 20rpx;
  315. }
  316. .ok{
  317. height: 90rpx;
  318. display: flex;
  319. align-items: center;
  320. justify-content: center;
  321. background: black;
  322. border-radius: 10rpx;
  323. font-size: 40rpx;
  324. font-weight: bold;
  325. border-top: 1px solid #ffffff80;
  326. }
  327. }
  328. }
  329. }
  330. </style>