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

165 lines
3.1 KiB

3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
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
  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.navigateBack(-1)
  91. }
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. .box {
  96. width: 750rpx;
  97. height: 180rpx;
  98. background-image: linear-gradient(to bottom, #FFBF60, #FFFFFF);
  99. padding: 60rpx 24rpx 0 24rpx;
  100. box-sizing: border-box;
  101. }
  102. .top {
  103. width: 702rpx;
  104. height: 227rpx;
  105. background-color: #FFFFFF;
  106. padding: 24rpx 34rpx 0 34rpx;
  107. box-sizing: border-box;
  108. }
  109. .money {
  110. width: 550rpx;
  111. height: 71rpx;
  112. /* background-color: #FFBF60; */
  113. color: #FFBF60 !important;
  114. font-size: 54rpx !important;
  115. ;
  116. height: 71rpx;
  117. /* background-color: #FFBF60; */
  118. color: #FFBF60 !important;
  119. font-size: 54rpx !important;
  120. margin: 3% 0 0 5%;
  121. }
  122. .money input {
  123. margin-left: 5%;
  124. font-size: 61rpx;
  125. height: 71rpx;
  126. }
  127. .center {
  128. width: 100%;
  129. height: 1265rpx;
  130. background-color: #FFFFFF;
  131. font-size: 30rpx;
  132. color: #707070;
  133. padding: 84rpx 0 0 54rpx;
  134. box-sizing: border-box;
  135. line-height: 45rpx;
  136. }
  137. .text {
  138. color: #000000;
  139. font-weight: 700;
  140. margin-bottom: 30rpx;
  141. }
  142. .buttom {
  143. width: 544rpx;
  144. height: 89rpx;
  145. background-color: #FFBF60;
  146. color: #FFFFFF;
  147. font-size: 28rpx;
  148. line-height: 89rpx;
  149. margin: 800rpx 0 0 50rpx;
  150. justify-content: center;
  151. }
  152. .level {
  153. display: flex;
  154. }
  155. </style>