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

204 lines
3.5 KiB

3 months ago
3 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
  1. <template>
  2. <!-- <div>保证金</div> -->
  3. <view class="box">
  4. <view class="top" :style="{ borderRadius: '16rpx' }">
  5. <view class="level account">
  6. <view class="text1">
  7. 账户总览
  8. </view>
  9. <view class="level text4">
  10. <view @click="jumpToDetail">
  11. 资金明细
  12. </view>
  13. <view @click="jumpToRefund" class="line">
  14. 申请退还
  15. </view>
  16. </view>
  17. </view>
  18. <view class="level Recharge">
  19. <view class="money level">
  20. <text>¥</text>
  21. <input v-model="money" type="text" />
  22. </view>
  23. <view class="text2" :style="{ borderRadius: '23.5rpx' }" @click="onPay">
  24. 去充值
  25. </view>
  26. </view>
  27. </view>
  28. <view class="center size-28">
  29. <view class="text3">
  30. 保证金说明
  31. </view>
  32. <view >
  33. <up-parse class="size-28" :content="configList.pet_money_text.paramValueArea"></up-parse>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script setup>
  39. import {
  40. ref,
  41. computed
  42. } from 'vue'
  43. import {
  44. cashIn
  45. } from '@/api/amount/index.js'
  46. import {
  47. useStore
  48. } from "vuex"
  49. import { onShow } from '@dcloudio/uni-app'
  50. const money = ref()
  51. const store = useStore();
  52. const configList = computed(() => {
  53. return store.getters.configList
  54. })
  55. const userInfo = computed(() => {
  56. return store.getters.userInfo
  57. })
  58. const jumpToDetail = () => {
  59. uni.navigateTo({
  60. url: "/otherPages/myOrdersManage/bond/detail"
  61. })
  62. }
  63. const jumpToRefund = () => {
  64. uni.navigateTo({
  65. url: "/otherPages/myOrdersManage/bond/refund"
  66. })
  67. }
  68. const onPay = async () => {
  69. if (!money.value) {
  70. return uni.showToast({
  71. title: '请填写充值金额',
  72. icon: "none"
  73. })
  74. }
  75. let response = await cashIn({
  76. money: money.value,
  77. type: 1,
  78. userId: userInfo.value.userId
  79. })
  80. if (response.code == 200) {
  81. uni.showToast({
  82. title: response.msg,
  83. icon: "none"
  84. })
  85. }
  86. }
  87. onShow(() => {
  88. money.value = Number(configList.value.pet_money.pet_money_text)
  89. })
  90. </script>
  91. <style scoped lang="scss">
  92. .box {
  93. width: 750rpx;
  94. height: 180rpx;
  95. background-image: linear-gradient(to bottom, #FFBF60, #F2F2F2);
  96. padding: 60rpx 24rpx 0 24rpx;
  97. box-sizing: border-box;
  98. }
  99. .top {
  100. width: 702rpx;
  101. height: 227rpx;
  102. background-color: #FFFFFF;
  103. padding: 24rpx 34rpx 0 34rpx;
  104. box-sizing: border-box;
  105. }
  106. .account {
  107. justify-content: space-between;
  108. color: #BDBDBD;
  109. font-size: 22rpx;
  110. }
  111. .text1 {
  112. font-size: 30rpx;
  113. color: #000000;
  114. }
  115. .text4 {
  116. color: #BDBDBD;
  117. font-size: 22rpx;
  118. }
  119. .line {
  120. position: relative;
  121. padding: 0 0 0 20rpx;
  122. &::before {
  123. position: absolute;
  124. top: 7rpx;
  125. left: 10rpx;
  126. content: "";
  127. width: 3rpx;
  128. height: 26rpx;
  129. border-radius: 9rpx;
  130. background-color: #BDBDBD;
  131. }
  132. }
  133. .Recharge {
  134. width: auto;
  135. height: 71rpx;
  136. justify-content: space-between;
  137. margin: 30rpx 0 0 30rpx;
  138. color: #FFFFFF;
  139. font-size: 22rpx;
  140. align-items: center;
  141. }
  142. .money {
  143. width: 450rpx;
  144. height: 71rpx;
  145. /* background-color: #FFBF60; */
  146. color: #FFBF60 !important;
  147. font-size: 54rpx !important;
  148. }
  149. .money input {
  150. margin-left: 5%;
  151. font-size: 61rpx;
  152. height: 71rpx;
  153. }
  154. .text2 {
  155. width: 131rpx;
  156. height: 47rpx;
  157. background-color: #FFBF60;
  158. line-height: 47rpx;
  159. display: flex;
  160. justify-content: center;
  161. }
  162. .center {
  163. width: 100%;
  164. height: 1265rpx;
  165. font-size: 30rpx;
  166. color: #707070;
  167. padding: 44rpx 8rpx 0 34rpx;
  168. box-sizing: border-box;
  169. line-height: 45rpx;
  170. }
  171. .text3 {
  172. color: #000000;
  173. font-weight: 700;
  174. margin-bottom: 30rpx;
  175. }
  176. .level {
  177. display: flex;
  178. }
  179. .text4 {
  180. /* color: ; */
  181. }
  182. </style>