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

192 lines
3.6 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.navigateTo({
  82. url: "/otherPages/workbenchManage/myWallet/index"
  83. })
  84. }
  85. })
  86. fullName.value = val
  87. inputClose.value.close()
  88. fullName.value = ''
  89. } else {
  90. uni.showToast({
  91. icon: 'error',
  92. title: '请输入姓名',
  93. duration: 2000
  94. })
  95. }
  96. }
  97. const close = () => {
  98. inputDialogRef.value.close()
  99. fullName.value = ''
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. .box {
  104. width: 750rpx;
  105. height: 180rpx;
  106. background-image: linear-gradient(to bottom, #FFBF60, #FFFFFF);
  107. padding: 60rpx 24rpx 0 24rpx;
  108. box-sizing: border-box;
  109. }
  110. .top {
  111. width: 702rpx;
  112. height: 227rpx;
  113. background-color: #FFFFFF;
  114. padding: 24rpx 34rpx 0 34rpx;
  115. box-sizing: border-box;
  116. }
  117. .money {
  118. width: 550rpx;
  119. height: 71rpx;
  120. /* background-color: #FFBF60; */
  121. color: red !important;
  122. font-size: 54rpx !important;
  123. margin: 3% 0 0 5%;
  124. font-weight: 700;
  125. .amount {
  126. margin-left: 5%;
  127. height: 71rpx;
  128. }
  129. .placeInput {
  130. font-weight: 100;
  131. }
  132. }
  133. .center {
  134. width: 100%;
  135. height: 100vh;
  136. background-color: #FFFFFF;
  137. font-size: 30rpx;
  138. color: #707070;
  139. padding: 0 50rpx;
  140. ;
  141. box-sizing: border-box;
  142. margin-top: 80rpx;
  143. }
  144. .text {
  145. color: #000000;
  146. font-weight: 700;
  147. margin-bottom: 30rpx;
  148. }
  149. .buttom {
  150. width: 544rpx;
  151. height: 89rpx;
  152. background-color: #FFBF60;
  153. color: #FFFFFF;
  154. font-size: 28rpx;
  155. border-radius: 41rpx;
  156. margin-top: 300rpx;
  157. }
  158. .level {
  159. display: flex;
  160. }
  161. </style>