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

179 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"
  13. v-model="form.amount"></up-input>
  14. </view>
  15. <!-- <DForm :list="state. " @submit="handleSubmit" /> -->
  16. </view>
  17. </view>
  18. </view>
  19. <view class="center">
  20. <view class="text">
  21. 提现说明
  22. </view>
  23. <view>
  24. <up-parse :content="configList.withdrawal_statement.paramValueArea" containerStyle="{
  25. color: '#707070',
  26. fontSize: '30rpx',
  27. lineHeight: '45rpx',
  28. }"></up-parse>
  29. </view>
  30. <up-button class="buttom" type="warning" text="提现" shape="circle" @click="cashClick"></up-button>
  31. </view>
  32. <uni-popup ref="inputDialogRef" type="dialog">
  33. <uni-popup-dialog ref="inputClose" mode="input" title="提现" v-model="form.name" placeholder="请输入姓名"
  34. @confirm="dialogInputConfirm" @close="close" :before-close="true"></uni-popup-dialog>
  35. </uni-popup>
  36. </template>
  37. <script setup>
  38. import {
  39. ref,
  40. computed,
  41. } from "vue"
  42. import { useStore } from 'vuex'
  43. import {
  44. cashOut
  45. } from "@/api/amount/index.js"
  46. const store = useStore()
  47. const configList = computed(() => {
  48. return store.getters.configList
  49. })
  50. const userInfo = computed(() => {
  51. return store.getters.userInfo
  52. })
  53. const form = ref({
  54. amount: '',
  55. name : '',
  56. })
  57. const inputDialogRef = ref(null)
  58. const inputClose = ref(null)
  59. const cashClick = () => {
  60. if (form.value.amount) {
  61. form.value.name = ''
  62. inputDialogRef.value.open()
  63. } else {
  64. uni.showToast({
  65. icon: 'error',
  66. title: '金额不能为空',
  67. duration: 2000
  68. })
  69. }
  70. }
  71. const dialogInputConfirm = async (val) => {
  72. if (val) {
  73. let response = await cashOut({
  74. ...form.value,
  75. type: 0,
  76. userId: userInfo.value.userId
  77. })
  78. if (response.code == 200) {
  79. uni.showToast({
  80. title: response.msg,
  81. icon: "none"
  82. })
  83. }
  84. form.value.name = val
  85. inputClose.value.close()
  86. form.value.name = ''
  87. } else {
  88. uni.showToast({
  89. icon: 'error',
  90. title: '请输入姓名',
  91. duration: 2000
  92. })
  93. }
  94. }
  95. const close = () => {
  96. inputDialogRef.value.close()
  97. form.value.name = ''
  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>