敢为人鲜小程序前端代码仓库
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.

255 lines
4.6 KiB

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
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
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
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
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
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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" mode="aspectFill" />
  8. <view class="user-money">
  9. <view class="title">总佣金</view>
  10. <view class="money">{{ riceInfo.canWithdraw}}</view>
  11. </view>
  12. <view class="operation">
  13. <!-- <view @click="toRunningWater" class="operation-item">
  14. 余额记录
  15. </view>
  16. |
  17. <view @click="toRunningWater" class="operation-item">
  18. 提现记录
  19. </view>
  20. | -->
  21. <view @click="toRunningWater" 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-form">
  30. <view class="unit">
  31. </view>
  32. <uv-input type="number" placeholder="请输入提现金额" border="surround" v-model.number="form.money"></uv-input>
  33. </view>
  34. </view>
  35. <!-- 提现说明 -->
  36. <view class="withdrawal-statement">
  37. <view class="title">提现说明</view>
  38. <view v-html="configList.recharge_instructions" class="withdrawal-statement" style="color: #666666;"></view>
  39. </view>
  40. <view @click="withdraw" class="uni-color-btn">
  41. 立即提现
  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. computed: {
  53. ...mapState(['userInfo', 'riceInfo']),
  54. },
  55. data() {
  56. return {
  57. form: {
  58. money: ''
  59. },
  60. }
  61. },
  62. onShow() {
  63. this.$store.commit('getUserInfo')
  64. this.$store.commit('getRiceInfo')
  65. },
  66. methods: {
  67. withdraw() { //立即提现
  68. if (this.form.money < 300) {
  69. return uni.showToast({
  70. title: '未满300元不可提现哦!',
  71. icon: 'none'
  72. })
  73. }
  74. let isOk = this.parameterVerification();
  75. if (isOk && !isOk.auth) {
  76. return uni.showToast({
  77. title: isOk.title,
  78. icon: 'none'
  79. })
  80. }
  81. this.$api('recharge', this.form, res => {
  82. if (res.code == 200) {
  83. uni.showToast({
  84. title: '提现成功',
  85. icon: 'none'
  86. })
  87. this.$store.commit('getUserInfo')
  88. this.$store.commit('getRiceInfo')
  89. }
  90. })
  91. },
  92. parameterVerification() { //验证用户参数合法性
  93. let {
  94. money
  95. } = this.form
  96. if (!money) {
  97. return {
  98. title: '请填写提现金额',
  99. auth: false
  100. }
  101. }
  102. return {
  103. title: '验证通过',
  104. auth: true
  105. }
  106. },
  107. toRunningWater() {
  108. uni.navigateTo({
  109. url: "/pages_order/mine/runningWater"
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .page {
  117. // 佣金信息
  118. .center {
  119. position: relative;
  120. width: 710rpx;
  121. height: 316rpx;
  122. margin: 20rpx auto;
  123. }
  124. .center image {
  125. position: absolute;
  126. left: 0;
  127. top: 0;
  128. width: 710rpx;
  129. height: 316rpx;
  130. border-radius: 12rpx;
  131. }
  132. .center .user-money {
  133. position: absolute;
  134. top: 50%;
  135. transform: translateY(-50%);
  136. z-index: 9;
  137. color: white;
  138. padding-left: 50rpx;
  139. box-sizing: border-box;
  140. .title {
  141. font-size: 36rpx;
  142. }
  143. .money {
  144. font-size: 40rpx;
  145. }
  146. }
  147. .operation {
  148. position: absolute;
  149. bottom: 20rpx;
  150. left: 0rpx;
  151. width: 100%;
  152. display: flex;
  153. justify-content: flex-end;
  154. color: white;
  155. .operation-item {
  156. margin: 0rpx 20rpx;
  157. }
  158. }
  159. // 我要提现
  160. .from-body {
  161. padding: 40rpx 20rpx;
  162. font-size: 28rpx;
  163. text-align: left;
  164. color: #333333;
  165. }
  166. .from-body .title {
  167. font-size: 36rpx;
  168. }
  169. .money-form {
  170. display: flex;
  171. flex-wrap: wrap;
  172. align-items: center;
  173. background: #ebebeb;
  174. border-radius: 10rpx;
  175. margin-top: 20rpx;
  176. }
  177. .money-form .unit {
  178. display: flex;
  179. justify-content: flex-end;
  180. color: $uni-color;
  181. width: 60rpx;
  182. }
  183. &::v-deep .uv-border {
  184. border: none;
  185. }
  186. .money {
  187. margin: 20rpx 0rpx;
  188. }
  189. // 提现说明
  190. .withdrawal-statement {
  191. padding: 0rpx 20rpx;
  192. box-sizing: border-box;
  193. .title {
  194. font-size: 36rpx;
  195. margin-bottom: 20rpx;
  196. }
  197. }
  198. .recharge {
  199. position: fixed;
  200. display: flex;
  201. justify-content: center;
  202. align-items: center;
  203. left: 0;
  204. bottom: 0;
  205. width: 750rpx;
  206. height: 100rpx;
  207. background: white;
  208. }
  209. .recharge .btn {
  210. width: 85%;
  211. height: 80rpx;
  212. border-radius: 40rpx;
  213. color: white;
  214. text-align: center;
  215. line-height: 80rpx;
  216. font-size: 28rpx;
  217. background: $uni-color;
  218. }
  219. @media all and (min-width: 961px) {
  220. .recharge {
  221. left: 50% !important;
  222. transform: translateX(-50%);
  223. }
  224. }
  225. }
  226. </style>