猫妈狗爸伴宠师小程序前端代码
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.

190 lines
3.5 KiB

3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <!-- <div>提现</div> -->
  3. <view class="box">
  4. <view class="top" :style="{ borderRadius: '16rpx' }">
  5. <view >
  6. 提现金额
  7. </view>
  8. <view class="level">
  9. <view class="money level">
  10. <text>¥</text>
  11. <up-input class="amount" placeholderClass="placeInput" placeholder="请输入提现金额" clearable fontSize="34rpx"
  12. border="bottom" type="number" color="#FF2742" v-model="num"></up-input>
  13. </view>
  14. <!-- <DForm :list="state. " @submit="handleSubmit" /> -->
  15. </view>
  16. </view>
  17. </view>
  18. <view class="center">
  19. <view class="text">
  20. 提现说明
  21. </view>
  22. <view>
  23. <up-parse :content="configList.withdrawal_statement.paramValueArea" containerStyle="{
  24. color: '#707070',
  25. fontSize: '30rpx',
  26. lineHeight: '45rpx',
  27. }"></up-parse>
  28. </view>
  29. <up-button class="buttom" type="warning" text="提现" shape="circle" @click="cashClick"></up-button>
  30. </view>
  31. <uni-popup ref="inputDialogRef" type="dialog">
  32. <uni-popup-dialog ref="inputClose" mode="input" title="提现" v-model="fullName" placeholder="请输入姓名"
  33. @confirm="dialogInputConfirm" @close="close" :before-close="true"></uni-popup-dialog>
  34. </uni-popup>
  35. </template>
  36. <script setup>
  37. import {
  38. ref,
  39. computed,
  40. } from "vue"
  41. import { useStore } from 'vuex'
  42. import {
  43. cashOut
  44. } from "@/api/amount/index.js"
  45. const store = useStore()
  46. const configList = computed(() => {
  47. return store.getters.configList
  48. })
  49. const num = ref('');;
  50. const fullName = ref('')
  51. const inputDialogRef = ref(null)
  52. const inputClose = ref(null)
  53. const cashClick = () => {
  54. if (num.value) {
  55. fullName.value = ''
  56. inputDialogRef.value.open()
  57. } else {
  58. uni.showToast({
  59. icon: 'error',
  60. title: '金额不能为空',
  61. duration: 2000
  62. })
  63. }
  64. }
  65. const dialogInputConfirm = (val) => {
  66. if (val) {
  67. //提现接口
  68. cashOut({
  69. userId: store.state.user.userInfo.userId,
  70. amount:num.value,
  71. nameValue:val,
  72. moneyType:0,
  73. }).then(res => {
  74. if (res.code == 200) {
  75. store.dispatch("getUserInfo")
  76. uni.showToast({
  77. icon: 'success',
  78. title: '提现成功',
  79. duration: 2000
  80. })
  81. uni.navigateBack(-1)
  82. }
  83. })
  84. fullName.value = val
  85. inputClose.value.close()
  86. fullName.value = ''
  87. } else {
  88. uni.showToast({
  89. icon: 'error',
  90. title: '请输入姓名',
  91. duration: 2000
  92. })
  93. }
  94. }
  95. const close = () => {
  96. inputDialogRef.value.close()
  97. fullName.value = ''
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. .box {
  102. width: 750rpx;
  103. height: 180rpx;
  104. background-image: linear-gradient(to bottom, #FFBF60, #FFFFFF);
  105. padding: 60rpx 24rpx 0 24rpx;
  106. box-sizing: border-box;
  107. }
  108. .top {
  109. width: 702rpx;
  110. height: 227rpx;
  111. background-color: #FFFFFF;
  112. padding: 24rpx 34rpx 0 34rpx;
  113. box-sizing: border-box;
  114. }
  115. .money {
  116. width: 550rpx;
  117. height: 71rpx;
  118. /* background-color: #FFBF60; */
  119. color: red !important;
  120. font-size: 54rpx !important;
  121. margin: 3% 0 0 5%;
  122. font-weight: 700;
  123. .amount {
  124. margin-left: 5%;
  125. height: 71rpx;
  126. }
  127. .placeInput {
  128. font-weight: 100;
  129. }
  130. }
  131. .center {
  132. width: 100%;
  133. height: 100vh;
  134. background-color: #FFFFFF;
  135. font-size: 30rpx;
  136. color: #707070;
  137. padding: 0 50rpx;
  138. ;
  139. box-sizing: border-box;
  140. margin-top: 80rpx;
  141. }
  142. .text {
  143. color: #000000;
  144. font-weight: 700;
  145. margin-bottom: 30rpx;
  146. }
  147. .buttom {
  148. width: 544rpx;
  149. height: 89rpx;
  150. background-color: #FFBF60;
  151. color: #FFFFFF;
  152. font-size: 28rpx;
  153. border-radius: 41rpx;
  154. margin-top: 300rpx;
  155. }
  156. .level {
  157. display: flex;
  158. }
  159. </style>