qrcode.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <Theme>
  3. <view class="wrap">
  4. <Navbar title="充值" fixed border>
  5. <template #right>
  6. <navMenu :options="{ icon: 'icon-home', text: '主页' }" />
  7. </template>
  8. </Navbar>
  9. <view class="content">
  10. <view class="cont">
  11. <view class="item">
  12. <view class="label">
  13. <trans _t="充值金额" />
  14. </view>
  15. <view class="value">{{ currency }}<text>{{ obj.money }}</text></view>
  16. </view>
  17. <view class="item_address">
  18. <view class="label">
  19. <trans _t="充值地址" />
  20. </view>
  21. <view class="value">
  22. <view class="_url">
  23. {{ obj.url }}
  24. </view>
  25. <up-copy :content="obj.url" :notice="t('复制成功')">
  26. <trans _t="复制" />
  27. </up-copy>
  28. </view>
  29. </view>
  30. <view class="item_qrimg" v-if="!!obj.qrimg">
  31. <image :src="obj.qrimg" class="img"></image>
  32. </view>
  33. </view>
  34. <view class="desc">
  35. <view class="desc_title">
  36. <trans _t="充值步骤" />:
  37. </view>
  38. <view class="desc_cont">
  39. <view class="cont_list" v-for="item, index in obj.steps" :key="index">
  40. {{ index + 1 }}.{{ item }}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="btn" @click="paySubmit">
  46. <trans _t="完成付款" />
  47. </view>
  48. </view>
  49. </Theme>
  50. </template>
  51. <script setup>
  52. import { ref, computed } from "vue";
  53. import Navbar from "@/components/navbar";
  54. import navMenu from "@/components/nav_menu";
  55. import { useSystemStore, useUserStore } from "@/store";
  56. import { Toast } from "@/utils"
  57. import { PAY_SUBMIT } from "@/api"
  58. import { onLoad } from "@dcloudio/uni-app";
  59. import { t } from "@/locale"
  60. const useSystem = useSystemStore();
  61. const obj = ref({});
  62. const currency = computed(() => useSystem.getCurrency);
  63. const paySubmit = async () => {
  64. try {
  65. const res = await PAY_SUBMIT({
  66. id: obj.value.id,
  67. money: obj.value.money,
  68. account: obj.value.account,
  69. isbefore: 1
  70. })
  71. Toast(res.msg).then(res => {
  72. setTimeout(() => {
  73. uni.navigateBack();
  74. }, 1000);
  75. })
  76. } catch (error) {
  77. Toast(error.msg)
  78. }
  79. }
  80. onLoad((options) => {
  81. obj.value = JSON.parse(options.obj || '{}')
  82. })
  83. </script>
  84. <style lang="less" scoped>
  85. @import url('@/style.less');
  86. .wrap {
  87. min-height: 100vh;
  88. background-color: var(--bg);
  89. .flex();
  90. flex-direction: column;
  91. .content {
  92. padding: 24rpx;
  93. flex-grow: 1;
  94. .cont {
  95. background-color: var(--light);
  96. padding: 24rpx;
  97. border-radius: 16rpx;
  98. .item {
  99. .flex_position(space-between);
  100. color: var(--text);
  101. .label {
  102. margin-right: 24rpx;
  103. .size(28rpx);
  104. }
  105. .value {
  106. .size(28rpx);
  107. text {
  108. .size(40rpx);
  109. margin-left: 12rpx;
  110. }
  111. }
  112. }
  113. .item_address {
  114. margin-top: 16rpx;
  115. .label {
  116. color: var(--text);
  117. .size(28rpx);
  118. }
  119. .value {
  120. border: 1px solid var(--borderColor);
  121. margin-top: 16rpx;
  122. .flex_position(space-between);
  123. padding: 12rpx;
  124. column-gap: 16rpx;
  125. .size(28rpx);
  126. color: var(--text);
  127. .copy {
  128. border: 1px solid var(--primary);
  129. color: var(--primary);
  130. .size(24rpx);
  131. padding: 6rpx 18rpx;
  132. border-radius: 50rpx;
  133. text {
  134. white-space: nowrap;
  135. }
  136. }
  137. }
  138. }
  139. .item_qrimg {
  140. margin-top: 16rpx;
  141. aspect-ratio: 1 / 1;
  142. width: 100%;
  143. height: 100%;
  144. .img {
  145. width: inherit;
  146. height: inherit;
  147. display: block;
  148. }
  149. }
  150. }
  151. .desc {
  152. margin-top: 16rpx;
  153. &_title {
  154. color: var(--text);
  155. .size(28rpx);
  156. line-height: 60rpx;
  157. }
  158. &_cont {
  159. .cont_list {
  160. color: var(--text);
  161. .size(24rpx);
  162. line-height: 40rpx;
  163. }
  164. }
  165. }
  166. }
  167. .btn {
  168. background-color: var(--primary);
  169. height: 52px;
  170. padding: 16rpx 30rpx;
  171. color: var(--light);
  172. font-weight: 700;
  173. .size(28rpx);
  174. .flex_center();
  175. }
  176. }
  177. </style>