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

236 lines
4.5 KiB

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