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

167 lines
3.1 KiB

1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month 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. <input v-model="form.amount" type="digit" />
  12. </view>
  13. <!-- <DForm :list="state. " @submit="handleSubmit" /> -->
  14. </view>
  15. </view>
  16. </view>
  17. <view class="center">
  18. <view class="text">
  19. 提现说明
  20. </view>
  21. <view>
  22. <up-parse :content="configList.withdrawal_statement.paramValueArea" containerStyle="{
  23. color: '#707070',
  24. fontSize: '30rpx',
  25. lineHeight: '45rpx',
  26. }"></up-parse>
  27. </view>
  28. <view @click="handleSubmit" class="buttom level" :style="{ borderRadius: '41rpx' }">
  29. 提现
  30. </view>
  31. </view>
  32. <view >
  33. <!-- <u-popup :show="show" mode="center" @close="close" @open="open"> -->
  34. </view>
  35. </template>
  36. <script setup>
  37. import {
  38. reactive,
  39. ref,
  40. computed
  41. } from "vue";
  42. import DForm from "@/components/dForm/index.vue"
  43. import {
  44. cashOut
  45. } from "@/api/amount/index.js"
  46. import {
  47. useStore
  48. } from "vuex"
  49. const state = reactive({
  50. list: [{
  51. type: "input",
  52. key: "提现金额",
  53. placeholder: "请输入提现金额",
  54. }, ]
  55. })
  56. const store = useStore();
  57. const configList = computed(() => {
  58. return store.getters.configList
  59. })
  60. const userInfo = computed(() => {
  61. return store.getters.userInfo
  62. })
  63. const form = ref({
  64. amount: ''
  65. })
  66. const handleSubmit = async (val) => {
  67. if (!form.value.amount) {
  68. return uni.showToast({
  69. title: '请填写提现金额',
  70. icon: "none"
  71. })
  72. }
  73. let response = await cashOut({
  74. amount:form.value.amount,
  75. type: 0,
  76. userId: userInfo.value.userId,
  77. moneyType:1
  78. })
  79. if (response.code == 200) {
  80. uni.showToast({
  81. title: response.msg,
  82. icon: "none"
  83. })
  84. store.dispatch("getUserInfo")
  85. uni.showToast({
  86. icon: 'success',
  87. title: '提现成功',
  88. duration: 2000
  89. })
  90. uni.switchTab({
  91. url: "/pages/userManage/index"
  92. })
  93. }
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .box {
  98. width: 750rpx;
  99. height: 180rpx;
  100. background-image: linear-gradient(to bottom, #FFBF60, #FFFFFF);
  101. padding: 60rpx 24rpx 0 24rpx;
  102. box-sizing: border-box;
  103. }
  104. .top {
  105. width: 702rpx;
  106. height: 227rpx;
  107. background-color: #FFFFFF;
  108. padding: 24rpx 34rpx 0 34rpx;
  109. box-sizing: border-box;
  110. }
  111. .money {
  112. width: 550rpx;
  113. height: 71rpx;
  114. /* background-color: #FFBF60; */
  115. color: #FFBF60 !important;
  116. font-size: 54rpx !important;
  117. ;
  118. height: 71rpx;
  119. /* background-color: #FFBF60; */
  120. color: #FFBF60 !important;
  121. font-size: 54rpx !important;
  122. margin: 3% 0 0 5%;
  123. }
  124. .money input {
  125. margin-left: 5%;
  126. font-size: 61rpx;
  127. height: 71rpx;
  128. }
  129. .center {
  130. width: 100%;
  131. height: 1265rpx;
  132. background-color: #FFFFFF;
  133. font-size: 30rpx;
  134. color: #707070;
  135. padding: 84rpx 0 0 54rpx;
  136. box-sizing: border-box;
  137. line-height: 45rpx;
  138. }
  139. .text {
  140. color: #000000;
  141. font-weight: 700;
  142. margin-bottom: 30rpx;
  143. }
  144. .buttom {
  145. width: 544rpx;
  146. height: 89rpx;
  147. background-color: #FFBF60;
  148. color: #FFFFFF;
  149. font-size: 28rpx;
  150. line-height: 89rpx;
  151. margin: 800rpx 0 0 50rpx;
  152. justify-content: center;
  153. }
  154. .level {
  155. display: flex;
  156. }
  157. </style>