宜轩到家/服务到家第三版,换个颜色
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.

305 lines
6.6 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="withdraw">
  3. <mNavbar title="钱包提现" :leftClick="leftClick" />
  4. <view class="banner" />
  5. <view class="b-relative center font-m">
  6. <image src="/static/ms/1120.jpg" />
  7. <view class="title" style="position: absolute; top: 40rpx; left: 40rpx">
  8. <view style="line-height: 40rpx; font-size: 28rpx">账号余额</view>
  9. <view style="line-height: 60rpx; font-size: 40rpx">{{ userInfo.price }}</view>
  10. </view>
  11. <!-- <view class="title" style="position: absolute; top: 0; left: 0;
  12. width: 100%;height: 100%;
  13. display: flex;
  14. flex-direction: column;
  15. justify-content: center;
  16. align-items: center;
  17. gap: 50rpx;">
  18. <view style="line-height: 40rpx; font-size: 38rpx">账号余额</view>
  19. <view style="line-height: 60rpx; font-size: 50rpx">{{ userInfo.price }}</view>
  20. </view> -->
  21. </view>
  22. <view class="from-body">
  23. <view>我要提现</view>
  24. <view class="money">
  25. <van-cell-group inset>
  26. <van-field type="number" v-model="form.price" placeholder="请输入提现金额"
  27. style="background-color: #F5F5F5; margin: 10rpx 0px; border-radius: 20px;" />
  28. <van-field v-model="form.bank" placeholder="请输入开户行"
  29. style="background-color: #F5F5F5; margin: 10rpx 0px; border-radius: 20px;" />
  30. <van-field v-model="form.card" placeholder="请输入卡号"
  31. style="background-color: #F5F5F5; margin: 10rpx 0px; border-radius: 20px;" />
  32. </van-cell-group>
  33. </view>
  34. <view v-html="withdrawalStatement" class="withdrawal-statement"></view>
  35. </view>
  36. <view class="recharge">
  37. <view @click="withdraw" class="btn">
  38. 立即提现
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import mNavbar from '@/components/base/m-navbar.vue'
  45. export default {
  46. components: {
  47. mNavbar
  48. },
  49. data() {
  50. return {
  51. withdrawalStatement: '', //充值说明
  52. form : {
  53. type: 1,
  54. price: undefined,
  55. bank: '',
  56. card: ''
  57. },
  58. userInfo: {},
  59. }
  60. },
  61. onShow() {
  62. this.getConfig()
  63. this.getUserInfo()
  64. this.getTenRealName()
  65. },
  66. methods: {
  67. leftClick() { //返回分销代理
  68. uni.navigateTo({
  69. url: '/pages/mine/distribution'
  70. })
  71. },
  72. getConfig() { //获取配置信息
  73. this.$api('getConfig', {}, res => {
  74. if (res.code == 200) {
  75. res.result.forEach(item => {
  76. if (item.keyValue === 'withdraw') {
  77. this.withdrawalStatement = item.content
  78. }
  79. })
  80. }
  81. })
  82. },
  83. withdraw() { //立即提现
  84. let isOk = this.parameterVerification();
  85. if(isOk && !isOk.auth){
  86. return uni.showToast({
  87. title : isOk.title,
  88. icon : 'none'
  89. })
  90. }
  91. this.$api('recharge', this.form, res => {
  92. if (res.code == 200) {
  93. uni.showToast({
  94. title: '提现成功',
  95. icon: 'none'
  96. })
  97. this.getUserInfo()
  98. }
  99. })
  100. },
  101. getUserInfo() { //获取用户信息
  102. this.$api('getUserInfo', {}, res => {
  103. if (res.code == 200) {
  104. this.userInfo = res.result;
  105. }
  106. })
  107. },
  108. getTenRealName(){ //获取技师实名认证
  109. this.$api('getTenRealName', {}, res => {
  110. if (res.code == 200) {
  111. let result = res.result;
  112. if(result && result.bank && result.card){
  113. this.form.bank = result.bank
  114. this.form.card = result.card
  115. }
  116. }
  117. })
  118. },
  119. parameterVerification(){ //验证用户参数合法性
  120. let { price , bank , card } = this.form
  121. if(!price){
  122. return { title : '请填写提现金额' , auth : false }
  123. }else if(price <= 0){
  124. return { title : '提现金额必须大于0' , auth : false }
  125. }else if(price > this.userInfo.price){
  126. return { title : '提现金额大于余额' , auth : false }
  127. }else if(bank.trim() == ''){
  128. return { title : '请填写开户行' , auth : false }
  129. }else if(card.trim() == ''){
  130. return { title : '请填写卡号' , auth : false }
  131. }
  132. return { title : '验证通过' , auth : true }
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. .withdraw {
  139. .content {
  140. padding-bottom: 60px;
  141. }
  142. body {
  143. background-color: #fff;
  144. }
  145. .banner {
  146. width: 100vw;
  147. height: 256rpx;
  148. background: rgba(#ecb978, 0.2);
  149. }
  150. .center {
  151. width: 710rpx;
  152. height: 316rpx;
  153. margin: -204rpx auto 0;
  154. }
  155. .center image {
  156. width: 710rpx;
  157. height: 316rpx;
  158. border-radius: 12rpx;
  159. }
  160. .font-m {
  161. font-family: PingFang SC, PingFang SC-Bold;
  162. font-weight: 700;
  163. text-align: left;
  164. color: #ffffff;
  165. text-shadow: 0 4rpx 6rpx 0 rgba(#ecb978, 0.81);
  166. }
  167. .item-line input {
  168. width: 456rpx;
  169. height: 60rpx;
  170. line-height: 60rpx;
  171. background: #f5f5f5;
  172. border-radius: 12rpx;
  173. font-size: 24rpx;
  174. font-family: PingFang SC, PingFang SC-Medium;
  175. font-weight: 500;
  176. text-align: left;
  177. color: #939393;
  178. padding: 0 20rpx;
  179. }
  180. .from-body {
  181. padding: 40rpx 20rpx;
  182. font-size: 28rpx;
  183. text-align: left;
  184. color: #333333;
  185. }
  186. .top-label {
  187. position: relative;
  188. width: 96%;
  189. margin-left: 2%;
  190. height: 200rpx;
  191. background-image: url(/static/ms/cz.png);
  192. background-repeat: no-repeat;
  193. background-size: 100% 100%;
  194. overflow: hidden;
  195. border-radius: 10px;
  196. margin-top: 20rpx;
  197. }
  198. .top-label-box {
  199. position: relative;
  200. height: 100%;
  201. padding-left: 35rpx;
  202. box-sizing: border-box;
  203. }
  204. .top-label-box .activeLabel {
  205. position: absolute;
  206. left: 0;
  207. top: 0;
  208. width: 100%;
  209. height: 100%;
  210. background: url('../../static/ms/select.png');
  211. background-repeat: no-repeat;
  212. background-size: 100% 100%;
  213. }
  214. .top-label-box-one {
  215. display: flex;
  216. align-items: center;
  217. }
  218. .top-label-box-two {
  219. margin-left: 18rpx;
  220. font-size: 12px;
  221. padding: 6rpx 8rpx;
  222. background-color: #EBCB85;
  223. border-bottom-left-radius: 10px;
  224. border-top-right-radius: 10px;
  225. }
  226. .top-label-box-tag {
  227. position: absolute;
  228. border: 1px solid;
  229. font-size: 12px;
  230. padding: 6rpx 10rpx;
  231. color: #fff;
  232. background-color: #24CC80;
  233. top: -1px;
  234. right: 0px;
  235. border-bottom-left-radius: 10px;
  236. }
  237. .money {
  238. margin: 20rpx 0rpx;
  239. }
  240. .money .van-cell-group--inset {
  241. margin: 0;
  242. }
  243. .money .van-field {
  244. padding: auto 0rpx;
  245. margin-bottom: 30rpx !important;
  246. }
  247. .recharge {
  248. position: fixed;
  249. display: flex;
  250. justify-content: center;
  251. align-items: center;
  252. left: 0;
  253. bottom: 0;
  254. width: 750rpx;
  255. height: 100rpx;
  256. background: white;
  257. }
  258. .recharge .btn {
  259. width: 85%;
  260. height: 80rpx;
  261. border-radius: 40rpx;
  262. color: $uni-color;
  263. text-align: center;
  264. line-height: 80rpx;
  265. font-size: 28rpx;
  266. background: linear-gradient(178deg, #ffe6ed, #ecb978);
  267. }
  268. @media all and (min-width: 961px) {
  269. .recharge {
  270. left: 50% !important;
  271. transform: translateX(-50%);
  272. }
  273. }
  274. }
  275. </style>