Payment.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div>
  3. <div class="headers">
  4. <div class="back" @click="goBack">
  5. <img src="@/assets/back.png" alt="">
  6. </div>
  7. <div class="title">转入</div>
  8. </div>
  9. <div class="invite-page">
  10. <div class="fund-card">
  11. <div class="title">参与基金</div>
  12. <div class="subtitle">
  13. {{item.title}}
  14. </div>
  15. <div class="form-section">
  16. <div class="label">请选择支付方式</div>
  17. <div class="pay-group">
  18. <label
  19. v-for="item in payList"
  20. :key="item.id"
  21. class="pay-radio"
  22. :class="{ active: payType === item.title }"
  23. >
  24. <input
  25. type="radio"
  26. :value="item.title"
  27. v-model="payType"
  28. class="radio-input"
  29. >
  30. <span class="radio-label">{{ item.title }}</span>
  31. </label>
  32. </div>
  33. </div>
  34. <div class="form-section">
  35. <div class="label">产品价格</div>
  36. <div class="price-field">
  37. <input
  38. type="text"
  39. v-model="item.money"
  40. readonly
  41. class="price-input"
  42. >
  43. </div>
  44. </div>
  45. <button
  46. class="submit-btn"
  47. :disabled="!payType"
  48. @click="handleSubmit"
  49. >
  50. 参与
  51. </button>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import {getTong,getChongInfo} from '@/api/home.js'
  58. import { Toast } from 'vant';
  59. export default {
  60. name: 'InvitePeople',
  61. data() {
  62. return {
  63. payType: '',
  64. payList: [],
  65. item:{}
  66. }
  67. },
  68. methods:{
  69. goBack() {
  70. this.$router.go(-1)
  71. },
  72. async getPayType(){
  73. const res = await getTong()
  74. this.payList = res.data || []
  75. },
  76. handleSubmit() {
  77. // 处理提交逻辑
  78. let params = {
  79. type: this.payType,
  80. money: this.item.money,
  81. }
  82. getChongInfo(params).then(res => {
  83. if(res.code === 1){
  84. Toast.success('提交成功')
  85. setTimeout(() => {
  86. window.location.href = res.data.payUrl
  87. }, 1000);
  88. }
  89. })
  90. }
  91. },
  92. mounted(){
  93. this.getPayType()
  94. this.item = this.$route.query.item
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .invite-page {
  100. min-height: 100vh;
  101. background: url('~@/assets/dabag.png') no-repeat center center;
  102. background-size: cover;
  103. padding: 120px 16px 32px 16px;
  104. box-sizing: border-box;
  105. }
  106. .headers {
  107. position: relative;
  108. height: 44px;
  109. background-color: #fff;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. border-bottom: 1px solid #eee;
  114. .back {
  115. position: absolute;
  116. left: 15px;
  117. font-size: 20px;
  118. img{
  119. width: 20px;
  120. height: 20px;
  121. }
  122. }
  123. .title {
  124. font-size: 18px;
  125. font-weight: 500;
  126. }
  127. }
  128. .top-header {
  129. display: flex;
  130. align-items: center;
  131. margin-bottom: 24px;
  132. padding-top:12px;
  133. .logo {
  134. width: 85px;
  135. height: 58px;
  136. object-fit: contain;
  137. background: #fff;
  138. margin-right: 16px;
  139. }
  140. .slogan {
  141. color: #fff;
  142. font-size: 16px;
  143. font-weight: bold;
  144. line-height: 1.3;
  145. text-shadow: 0 2px 8px rgba(0,0,0,0.12);
  146. }
  147. }
  148. .fund-card {
  149. background: #fff;
  150. border-radius: 16px;
  151. box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  152. padding: 28px 18px 24px 18px;
  153. max-width: 350px;
  154. margin: 0 auto;
  155. text-align: center;
  156. }
  157. .title {
  158. font-size: 24px;
  159. font-weight: bold;
  160. margin-bottom: 8px;
  161. }
  162. .subtitle {
  163. font-size: 16px;
  164. color: #333;
  165. margin-bottom: 18px;
  166. .amount {
  167. font-weight: bold;
  168. font-size: 16px;
  169. }
  170. }
  171. .form-section {
  172. margin-bottom: 18px;
  173. text-align: left;
  174. }
  175. .label {
  176. font-size: 15px;
  177. color: #333;
  178. margin-bottom: 8px;
  179. }
  180. .pay-group {
  181. background: #f7f8fa;
  182. border-radius: 12px;
  183. padding: 6px 0;
  184. display: flex;
  185. justify-content: flex-start;
  186. flex-wrap: wrap;
  187. }
  188. .pay-radio {
  189. margin-right: 18px;
  190. background: #fff;
  191. border-radius: 8px;
  192. padding: 4px 18px;
  193. display: inline-flex;
  194. align-items: center;
  195. cursor: pointer;
  196. transition: all 0.3s;
  197. border: 1px solid #eee;
  198. &.active {
  199. background: #e8f5e9;
  200. border-color: #4caf50;
  201. }
  202. .radio-input {
  203. display: none;
  204. }
  205. .radio-label {
  206. font-size: 14px;
  207. color: #333;
  208. }
  209. }
  210. .price-field {
  211. background: #f7f8fa;
  212. border-radius: 8px;
  213. padding: 8px 12px;
  214. .price-input {
  215. width: 100%;
  216. border: none;
  217. background: transparent;
  218. color: #333;
  219. font-size: 16px;
  220. font-weight: bold;
  221. outline: none;
  222. }
  223. }
  224. .submit-btn {
  225. margin-top: 10px;
  226. height: 40px;
  227. width: 100%;
  228. font-size: 18px;
  229. border-radius: 12px;
  230. background: #f7f8fa;
  231. color: #999;
  232. border: none;
  233. font-weight: bold;
  234. cursor: pointer;
  235. transition: all 0.3s;
  236. &:not(:disabled) {
  237. background: #4caf50;
  238. color: #fff;
  239. }
  240. &:disabled {
  241. cursor: not-allowed;
  242. }
  243. }
  244. </style>