推拿小程序前端代码仓库
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.

276 lines
5.1 KiB

3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="提现" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  5. <view class="content">
  6. <!-- 佣金信息 -->
  7. <view class="info">
  8. <image class="info-bg" src="../static/withdraw/bg.png"></image>
  9. <view class="info-content">
  10. <view class="label">总佣金余额</view>
  11. <view class="value">{{ riceInfo.canWithdraw || 0 }}</view>
  12. <view class="flex desc">
  13. <!-- todo: 对接接口字段 -->
  14. <view>{{ `累积提现:${123 || 0}` }}</view>
  15. <button plain class="btn">
  16. <text>提现记录</text>
  17. <image class="btn-icon" src="@/static/image/center/icon-arrow.png" mode="widthFix"></image>
  18. </button>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 我要提现 -->
  23. <view class="form">
  24. <view class="form-title">我要提现</view>
  25. <view class="form-item">
  26. <uv-input
  27. v-model.number="form.money"
  28. placeholder="请输入提现金额"
  29. :placeholderStyle="placeholderStyle"
  30. :customStyle="customStyle"
  31. color="#FF2A2A"
  32. >
  33. <template #prefix>
  34. <view class="unit"></view>
  35. </template>
  36. </uv-input>
  37. </view>
  38. <view class="form-item">
  39. <uv-input
  40. v-model.trim="form.name"
  41. placeholder="请输入真实姓名"
  42. :placeholderStyle="placeholderStyle"
  43. :customStyle="customStyle"
  44. ></uv-input>
  45. </view>
  46. </view>
  47. <!-- 提现说明 -->
  48. <view class="desc">
  49. <view class="desc-title">提现说明</view>
  50. <!-- todo: check -->
  51. <uv-parse class="desc-content" :content="configList.recharge_instructions"></uv-parse>
  52. <!-- <view v-html="configList.recharge_instructions" class="withdrawal-statement" style="color: #666666;"></view> -->
  53. </view>
  54. <view class="tools">
  55. <button class="flex btn" @click="withdraw">立即提现</button>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import mixinsList from '@/mixins/list.js'
  62. import {
  63. mapState
  64. } from 'vuex'
  65. export default {
  66. mixins: [mixinsList],
  67. computed: {
  68. ...mapState(['userInfo', 'riceInfo']),
  69. },
  70. data() {
  71. return {
  72. form: {
  73. money: '',
  74. name: '',
  75. },
  76. placeholderStyle: {
  77. color: '#999999',
  78. fontSize: '28rpx',
  79. },
  80. customStyle: {
  81. backgroundColor: '#F5F5F5',
  82. border: 'none',
  83. borderRadius: '16rpx',
  84. padding: '28rpx 35rpx'
  85. }
  86. }
  87. },
  88. onShow() {
  89. this.$store.commit('getUserInfo')
  90. this.$store.commit('getRiceInfo')
  91. },
  92. methods: {
  93. withdraw() { //立即提现
  94. if (!this.form.name) {
  95. uni.showToast({
  96. title: '请输入真实姓名',
  97. icon: 'none'
  98. })
  99. return
  100. }
  101. // todo
  102. if (this.form.money < 300) {
  103. return uni.showToast({
  104. title: '未满300元不可提现哦!',
  105. icon: 'none'
  106. })
  107. }
  108. let isOk = this.parameterVerification();
  109. if (isOk && !isOk.auth) {
  110. return uni.showToast({
  111. title: isOk.title,
  112. icon: 'none'
  113. })
  114. }
  115. this.$api('recharge', this.form, res => {
  116. if (res.code == 200) {
  117. uni.showToast({
  118. title: '提现成功',
  119. icon: 'none'
  120. })
  121. this.$store.commit('getUserInfo')
  122. this.$store.commit('getRiceInfo')
  123. }
  124. })
  125. },
  126. parameterVerification() { //验证用户参数合法性
  127. let {
  128. money
  129. } = this.form
  130. if (!money) {
  131. return {
  132. title: '请填写提现金额',
  133. auth: false
  134. }
  135. }
  136. return {
  137. title: '验证通过',
  138. auth: true
  139. }
  140. },
  141. toRunningWater() {
  142. uni.navigateTo({
  143. url: "/pages_order/mine/runningWater"
  144. })
  145. }
  146. }
  147. }
  148. </script>
  149. <style scoped lang="scss">
  150. .page {
  151. background-color: $uni-fg-color;
  152. min-height: 100vh;
  153. /deep/ .nav-bar__view {
  154. background-image: linear-gradient(#84A73F, #D8FF8F);
  155. }
  156. }
  157. .content {
  158. padding: 28rpx 13rpx;
  159. }
  160. .info {
  161. position: relative;
  162. width: 100%;
  163. height: 290rpx;
  164. &-bg {
  165. width: 100%;
  166. height: 100%;
  167. }
  168. &-content {
  169. position: absolute;
  170. top: 0;
  171. left: 0;
  172. width: 100%;
  173. box-sizing: border-box;
  174. padding: 42rpx 48rpx 0 35rpx;
  175. color: $uni-text-color-inverse;
  176. .label {
  177. font-size: 30rpx;
  178. }
  179. .value {
  180. margin-top: 18rpx;
  181. font-weight: 700;
  182. font-size: 55rpx;
  183. }
  184. .desc {
  185. justify-content: space-between;
  186. font-size: 22rpx;
  187. margin-top: 58rpx;
  188. }
  189. .btn {
  190. border: none;
  191. font-size: 22rpx;
  192. color: $uni-text-color-inverse;
  193. &-icon {
  194. width: 16rpx;
  195. height: 16rpx;
  196. margin-left: 7rpx;
  197. }
  198. }
  199. }
  200. }
  201. .form {
  202. margin-top: 30rpx;
  203. &-title {
  204. color: #000000;
  205. font-size: 28rpx;
  206. padding: 0 35rpx;
  207. }
  208. &-item {
  209. margin-top: 18rpx;
  210. .unit {
  211. color: #FF2A2A;
  212. padding-left: 42rpx;
  213. }
  214. }
  215. }
  216. .desc {
  217. margin-top: 45rpx;
  218. padding: 0 42rpx;
  219. font-size: 28rpx;
  220. &-title {
  221. color: #000000;
  222. }
  223. &-content {
  224. margin-top: 10rpx;
  225. color: #707070;
  226. }
  227. }
  228. .tools {
  229. margin-top: 166rpx;
  230. padding: 0 69rpx;
  231. .btn {
  232. width: 100%;
  233. padding: 29rpx 0;
  234. color: $uni-text-color-inverse;
  235. font-size: 28rpx;
  236. line-height: 40rpx;
  237. border-radius: 49rpx;
  238. border: none;
  239. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  240. }
  241. }
  242. </style>