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

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