青蛙卖大米小程序2024-11-24
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.

210 lines
3.8 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
  1. <template>
  2. <view class="page">
  3. <navbar title="提现"
  4. bgColor="#A3D250"
  5. color="#fff"
  6. leftClick
  7. @leftClick="$utils.navigateBack" />
  8. <view class="bg"/>
  9. <view class="price">
  10. <view class="title">
  11. 请输入提现金额
  12. </view>
  13. <view class="input-box">
  14. <view class="input">
  15. <input type="text" v-model="form.money"/>
  16. </view>
  17. <view class=""
  18. @click="selectAll">
  19. 全部提现
  20. </view>
  21. </view>
  22. <view class="num">
  23. 可提现金额{{ riceInfo.canWithdraw || 0 }}
  24. </view>
  25. </view>
  26. <view class="cell">
  27. <view class="cell-top">提现说明</view>
  28. <view style="padding: 0 20rpx;">
  29. <uv-parse :content="configList.withdrawal_instructions"></uv-parse>
  30. </view>
  31. </view>
  32. <view class="uni-color-btn"
  33. @click="submit">
  34. 提现
  35. </view>
  36. <view class="cell">
  37. <view class="cell-top">提现记录</view>
  38. <view class="cell-box"
  39. :key="index"
  40. v-for="(item,index) in list">
  41. <uv-cell-group>
  42. <uv-cell
  43. :title="item.title"
  44. :label="item.createTime"
  45. :center="true">
  46. <template #value>
  47. <view class="cell-text">
  48. <view class="price-text">{{ type[item.type] }}{{ item.money }}</view>
  49. <view class="tips">已到账</view>
  50. </view>
  51. </template>
  52. </uv-cell>
  53. </uv-cell-group>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import mixinsList from '@/mixins/list.js'
  60. import { mapState } from 'vuex'
  61. export default {
  62. mixins : [mixinsList],
  63. data() {
  64. return {
  65. mixinsListApi : 'getWaterPageList',
  66. list : [],
  67. type : ['+', '-'],
  68. state : ['审核中', '成功', '失败'],
  69. form : {
  70. money : 0,
  71. },
  72. }
  73. },
  74. computed: {
  75. ...mapState(['userInfo', 'riceInfo']),
  76. },
  77. onShow() {
  78. this.$store.commit('getUserInfo')
  79. this.$store.commit('getRiceInfo')
  80. },
  81. methods: {
  82. selectAll(){
  83. this.form.money = this.riceInfo.canWithdraw
  84. },
  85. submit(){
  86. if(this.$utils.verificationAll(this.form, {
  87. money : '请输入金额'
  88. })){
  89. return
  90. }
  91. if(this.form.money <= 0){
  92. uni.showToast({
  93. title: '输入金额必须大于0',
  94. icon: 'none'
  95. })
  96. return
  97. }
  98. this.$api('withdraw', this.form, res => {
  99. if(res.code == 200){
  100. uni.showToast({
  101. title: '提现成功',
  102. icon : 'none'
  103. })
  104. this.$store.commit('getUserInfo')
  105. this.$store.commit('getRiceInfo')
  106. this.getData()
  107. }
  108. })
  109. },
  110. },
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. .page{
  115. .bg{
  116. background-color: $uni-color;
  117. height: 380rpx;
  118. position: absolute;
  119. left: 0;
  120. width: 100%;
  121. z-index: -1;
  122. border-bottom-left-radius: 30rpx;
  123. border-bottom-right-radius: 30rpx;
  124. }
  125. .price{
  126. color: #FFFFFF;
  127. padding: 40rpx;
  128. .title{
  129. color: #eee;
  130. font-size: 28rpx;
  131. }
  132. .input-box{
  133. background-color: #FFFFFF;
  134. color: $uni-color;
  135. display: flex;
  136. justify-content: center;
  137. border-radius: 30rpx;
  138. align-items: center;
  139. padding: 10rpx;
  140. margin: 20rpx 0;
  141. .input{
  142. color: #000;
  143. font-size: 40rpx;
  144. font-weight: 900;
  145. display: flex;
  146. flex: 1;
  147. input{
  148. flex: 1;
  149. padding: 14rpx 20rpx;
  150. }
  151. }
  152. }
  153. .num{
  154. font-size: 30rpx;
  155. font-weight: 900;
  156. margin-top: 10rpx;
  157. }
  158. }
  159. .cell {
  160. margin: 20rpx;
  161. background-color: #FFFFFF;
  162. border-radius: 16rpx;
  163. .cell-top {
  164. padding: 40rpx 34rpx;
  165. color: #474747;
  166. font-size: 34rpx;
  167. font-weight: 600;
  168. position: relative;
  169. &::after{
  170. content: '';
  171. display: block;
  172. position: absolute;
  173. left: 55rpx;
  174. bottom: 38rpx;
  175. height: 10rpx;
  176. width: 120rpx;
  177. background: linear-gradient(to right, #fff, $uni-color);
  178. }
  179. }
  180. .cell-text{
  181. text-align: right;
  182. .price-text{
  183. color: #f40;
  184. font-size: 32rpx;
  185. font-weight: 900;
  186. }
  187. .tips{
  188. font-size: 22rpx;
  189. color: #aaa;
  190. margin-top: 10rpx;
  191. }
  192. }
  193. }
  194. }
  195. </style>