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

193 lines
3.7 KiB

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