珠宝小程序前端代码
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.

283 lines
5.4 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="提现" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
  5. <!-- 佣金信息 -->
  6. <view class="b-relative center font-m">
  7. <image src="@/pages_order/static/withdraw/cz.png" />
  8. <view class="user-money">
  9. <view class="title">总佣金</view>
  10. <view class="money">999999</view>
  11. </view>
  12. <view class="operation">
  13. <view class="operation-item">
  14. 余额记录
  15. </view>
  16. |
  17. <view class="operation-item">
  18. 提现记录
  19. </view>
  20. |
  21. <view class="operation-item">
  22. 佣金记录
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 我要提现 -->
  27. <view class="from-body">
  28. <view>我要提现</view>
  29. <view class="money">
  30. <van-cell-group inset>
  31. <van-field type="number" v-model="form.price" placeholder="请输入提现金额"
  32. style="background-color: #F5F5F5; margin: 10rpx 0px; border-radius: 20px;" />
  33. <van-field v-model="form.bank" placeholder="请输入开户行"
  34. style="background-color: #F5F5F5; margin: 10rpx 0px; border-radius: 20px;" />
  35. <van-field v-model="form.card" placeholder="请输入卡号"
  36. style="background-color: #F5F5F5; margin: 10rpx 0px; border-radius: 20px;" />
  37. </van-cell-group>
  38. </view>
  39. <view v-html="withdrawalStatement" class="withdrawal-statement"></view>
  40. </view>
  41. <view class="recharge">
  42. <view @click="withdraw" class="btn">
  43. 立即提现
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import mixinsList from '@/mixins/list.js'
  50. import {
  51. mapState
  52. } from 'vuex'
  53. export default {
  54. mixins: [mixinsList],
  55. data() {
  56. return {
  57. mixinsListApi: 'getWaterPageList',
  58. list: [],
  59. type: ['+', '-'],
  60. state: ['未到账', '已到账'],
  61. form: {
  62. money: '',
  63. bankNo: '',
  64. bankName: '',
  65. },
  66. }
  67. },
  68. computed: {
  69. ...mapState(['userInfo', 'riceInfo']),
  70. },
  71. data() {
  72. return {
  73. withdrawalStatement: '', //充值说明
  74. form: {
  75. type: 1,
  76. price: undefined,
  77. bank: '',
  78. card: ''
  79. },
  80. }
  81. },
  82. onShow() {
  83. this.getConfig()
  84. this.getUserInfo()
  85. this.getTenRealName()
  86. },
  87. methods: {
  88. getConfig() { //获取配置信息
  89. this.$api('getConfig', {}, res => {
  90. if (res.code == 200) {
  91. res.result.forEach(item => {
  92. if (item.keyValue === 'withdraw') {
  93. this.withdrawalStatement = item.content
  94. }
  95. })
  96. }
  97. })
  98. },
  99. withdraw() { //立即提现
  100. let isOk = this.parameterVerification();
  101. if (isOk && !isOk.auth) {
  102. return uni.showToast({
  103. title: isOk.title,
  104. icon: 'none'
  105. })
  106. }
  107. this.$api('recharge', this.form, res => {
  108. if (res.code == 200) {
  109. uni.showToast({
  110. title: '提现成功',
  111. icon: 'none'
  112. })
  113. this.getUserInfo()
  114. }
  115. })
  116. },
  117. getTenRealName() { //获取技师实名认证
  118. this.$api('getTenRealName', {}, res => {
  119. if (res.code == 200) {
  120. let result = res.result;
  121. if (result && result.bank && result.card) {
  122. this.form.bank = result.bank
  123. this.form.card = result.card
  124. }
  125. }
  126. })
  127. },
  128. parameterVerification() { //验证用户参数合法性
  129. let {
  130. price,
  131. bank,
  132. card
  133. } = this.form
  134. if (!price) {
  135. return {
  136. title: '请填写提现金额',
  137. auth: false
  138. }
  139. } else if (price <= 0) {
  140. return {
  141. title: '提现金额必须大于0',
  142. auth: false
  143. }
  144. } else if (price > this.userInfo.price) {
  145. return {
  146. title: '提现金额大于余额',
  147. auth: false
  148. }
  149. } else if (bank.trim() == '') {
  150. return {
  151. title: '请填写开户行',
  152. auth: false
  153. }
  154. } else if (card.trim() == '') {
  155. return {
  156. title: '请填写卡号',
  157. auth: false
  158. }
  159. }
  160. return {
  161. title: '验证通过',
  162. auth: true
  163. }
  164. }
  165. }
  166. }
  167. </script>
  168. <style scoped lang="scss">
  169. .page {
  170. // 佣金信息
  171. .center {
  172. position: relative;
  173. width: 710rpx;
  174. height: 316rpx;
  175. margin: 20rpx auto;
  176. }
  177. .center image {
  178. position: absolute;
  179. left: 0;
  180. top: 0;
  181. width: 710rpx;
  182. height: 316rpx;
  183. border-radius: 12rpx;
  184. }
  185. .center .user-money {
  186. position: absolute;
  187. top: 50%;
  188. transform: translateY(-50%);
  189. z-index: 9;
  190. color: white;
  191. padding-left: 50rpx;
  192. box-sizing: border-box;
  193. .title {
  194. font-size: 36rpx;
  195. }
  196. .money {
  197. font-size: 40rpx;
  198. }
  199. }
  200. .operation {
  201. position: absolute;
  202. bottom: 20rpx;
  203. left: 0rpx;
  204. width: 100%;
  205. display: flex;
  206. justify-content: center;
  207. color: white;
  208. .operation-item {
  209. margin: 0rpx 20rpx;
  210. }
  211. }
  212. // 我要提现
  213. .from-body {
  214. padding: 40rpx 20rpx;
  215. font-size: 28rpx;
  216. text-align: left;
  217. color: #333333;
  218. }
  219. .money {
  220. margin: 20rpx 0rpx;
  221. }
  222. .money .van-cell-group--inset {
  223. margin: 0;
  224. }
  225. .money .van-field {
  226. padding: auto 0rpx;
  227. margin-bottom: 30rpx !important;
  228. }
  229. .recharge {
  230. position: fixed;
  231. display: flex;
  232. justify-content: center;
  233. align-items: center;
  234. left: 0;
  235. bottom: 0;
  236. width: 750rpx;
  237. height: 100rpx;
  238. background: white;
  239. }
  240. .recharge .btn {
  241. width: 85%;
  242. height: 80rpx;
  243. border-radius: 40rpx;
  244. color: white;
  245. text-align: center;
  246. line-height: 80rpx;
  247. font-size: 28rpx;
  248. background: $uni-color;
  249. }
  250. @media all and (min-width: 961px) {
  251. .recharge {
  252. left: 50% !important;
  253. transform: translateX(-50%);
  254. }
  255. }
  256. }
  257. </style>