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