bank_pay.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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">
  18. <view class="item_left">
  19. <view class="label">
  20. <trans _t="银行名称" />:
  21. </view>
  22. <view class="value">{{ obj.setting.open }}</view>
  23. </view>
  24. <up-copy :content="obj.setting.open" :notice="t('复制成功')">
  25. <trans class="copy" _t="复制" />
  26. </up-copy>
  27. </view>
  28. <view class="item">
  29. <view class="item_left">
  30. <view class="label">
  31. <trans _t="收款人" />:
  32. </view>
  33. <view class="value">{{ obj.setting.name }}</view>
  34. </view>
  35. <up-copy :content="obj.setting.name" :notice="t('复制成功')">
  36. <trans class="copy" _t="复制" />
  37. </up-copy>
  38. </view>
  39. <view class="item">
  40. <view class="item_left">
  41. <view class="label">
  42. <trans _t="银行卡" />:
  43. </view>
  44. <view class="value">{{ obj.setting.card }}</view>
  45. </view>
  46. <up-copy :content="obj.setting.card" :notice="t('复制成功')">
  47. <trans class="copy" _t="复制" />
  48. </up-copy>
  49. </view>
  50. </view>
  51. <view class="desc">
  52. <view class="desc_title">
  53. <trans _t="充值步骤" />:
  54. </view>
  55. <view class="desc_cont">
  56. <view class="cont_list" v-for="item, index in obj.steps" :key="index">
  57. {{ index + 1 }}.{{ item }}
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="btn" @click="paySubmit">
  63. <trans _t="完成付款" />
  64. </view>
  65. </view>
  66. </Theme>
  67. </template>
  68. <script setup>
  69. import { ref, computed } from "vue";
  70. import Navbar from "@/components/navbar";
  71. import navMenu from "@/components/nav_menu";
  72. import { useSystemStore, useUserStore } from "@/store";
  73. import { Toast } from "@/utils"
  74. import { PAY_SUBMIT } from "@/api"
  75. import { onLoad } from "@dcloudio/uni-app";
  76. import { t } from "@/locale"
  77. const useSystem = useSystemStore();
  78. const obj = ref({});
  79. const currency = computed(() => useSystem.getCurrency);
  80. const paySubmit = async () => {
  81. try {
  82. const res = await PAY_SUBMIT({
  83. id: obj.value.id,
  84. money: obj.value.money,
  85. account: obj.value.account,
  86. isbefore: 1
  87. })
  88. Toast(res.msg)
  89. } catch (error) {
  90. if (error.ret == 3) {
  91. Toast(res.msg).then(res => {
  92. setTimeout(() => {
  93. uni.navigateBack();
  94. }, 1000);
  95. })
  96. } else {
  97. Toast(error.msg)
  98. }
  99. }
  100. }
  101. onLoad((options) => {
  102. obj.value = JSON.parse(options.obj || '{}')
  103. })
  104. </script>
  105. <style lang="less" scoped>
  106. @import url('@/style.less');
  107. .wrap {
  108. min-height: 100vh;
  109. background-color: var(--bg);
  110. .flex();
  111. flex-direction: column;
  112. .content {
  113. padding: 24rpx;
  114. flex-grow: 1;
  115. .cont {
  116. background-color: var(--light);
  117. padding: 24rpx;
  118. border-radius: 16rpx;
  119. .item {
  120. .flex_position(space-between);
  121. color: var(--text);
  122. column-gap: 24rpx;
  123. line-height: 50rpx;
  124. .label {
  125. .size(28rpx);
  126. }
  127. .value {
  128. .size(28rpx);
  129. text {
  130. .size(40rpx);
  131. margin-left: 12rpx;
  132. }
  133. }
  134. &_left {
  135. .ver();
  136. column-gap: 24rpx;
  137. }
  138. &:first-child {
  139. justify-content: unset;
  140. }
  141. .copy {
  142. color: var(--text);
  143. .size(28rpx);
  144. }
  145. }
  146. .item_address {
  147. margin-top: 16rpx;
  148. .label {
  149. color: var(--text);
  150. .size(28rpx);
  151. }
  152. .value {
  153. border: 1px solid var(--borderColor);
  154. margin-top: 16rpx;
  155. .flex_position(space-between);
  156. padding: 12rpx;
  157. column-gap: 16rpx;
  158. .size(28rpx);
  159. color: var(--text);
  160. .copy {
  161. border: 1px solid var(--primary);
  162. color: var(--primary);
  163. .size(24rpx);
  164. padding: 6rpx 18rpx;
  165. border-radius: 50rpx;
  166. text {
  167. white-space: nowrap;
  168. }
  169. }
  170. }
  171. }
  172. .item_qrimg {
  173. margin-top: 16rpx;
  174. aspect-ratio: 1 / 1;
  175. width: 100%;
  176. height: 100%;
  177. .img {
  178. width: inherit;
  179. height: inherit;
  180. display: block;
  181. }
  182. }
  183. }
  184. .desc {
  185. margin-top: 16rpx;
  186. &_title {
  187. color: var(--text);
  188. .size(28rpx);
  189. line-height: 60rpx;
  190. }
  191. &_cont {
  192. .cont_list {
  193. color: var(--text);
  194. .size(24rpx);
  195. line-height: 40rpx;
  196. }
  197. }
  198. }
  199. }
  200. .btn {
  201. background-color: var(--black);
  202. height: 52px;
  203. padding: 16rpx 30rpx;
  204. color: var(--light);
  205. font-weight: 700;
  206. .size(28rpx);
  207. .flex_center();
  208. }
  209. }
  210. </style>