geRenHuiFeiJiaoJiao.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="container">
  3. <view class="info-box">
  4. <view class="info-item-box flex">
  5. <view class="label">
  6. 用户名
  7. </view>
  8. <view class="text">
  9. {{ info.username }}
  10. </view>
  11. </view>
  12. <view class="info-item-box flex">
  13. <view class="label">
  14. 支付项目
  15. </view>
  16. <view class="text">
  17. {{ info.payProject }}
  18. </view>
  19. </view>
  20. <view class="info-item-box flex">
  21. <view class="label">
  22. 类型
  23. </view>
  24. <view class="text">
  25. {{ info.type }}
  26. </view>
  27. </view>
  28. <view class="info-item-box flex">
  29. <view class="label">
  30. 年份
  31. </view>
  32. <view class="text">
  33. {{ info.year }}年
  34. </view>
  35. </view>
  36. <view class="info-item-box flex">
  37. <view class="label">
  38. 金额
  39. </view>
  40. <view class="text">
  41. {{ info.price }}元
  42. </view>
  43. </view>
  44. <view class="info-item-box flex">
  45. <view class="label">
  46. 会籍有效期
  47. </view>
  48. <view class="text">
  49. {{ info.periodOfValidity }}
  50. </view>
  51. </view>
  52. <view class="info-item-box row">
  53. <view class="label">
  54. 描述:
  55. </view>
  56. <view class="text" v-html="info.remark"></view>
  57. </view>
  58. </view>
  59. <view class="bottom-box">
  60. <u-button type="error" shape="circle" @click="onSubmit">支付</u-button>
  61. </view>
  62. </view>
  63. </template>
  64. <script setup>
  65. import { ref } from 'vue'
  66. import { onLoad } from '@dcloudio/uni-app'
  67. import { useAuthStore } from '@/store/authStore'
  68. import { personPayment } from '@/api/cost.js'
  69. const authStore = useAuthStore()
  70. // 用户信息
  71. const user = ref({
  72. userIcon: '1',
  73. name: '某某某',
  74. corpName: '广州市xx地产有限公司',
  75. corpRegNo: '123xxxx'
  76. })
  77. const info = ref({
  78. username: '某某某',
  79. payProject: '2024年度个人会费',
  80. type: '个人会费',
  81. year: 2024,
  82. price: 200,
  83. periodOfValidity: '2024.05.1-2025.4.30',
  84. remark: '根据《协会章程》规定,个人会费200元/年/人,会员会籍为每年5月1日至4月30日。<br/>个人会员可享受以下会员服务:<br/>1、免费使用网络教育培训系统【系统已上线121个视频课程77本电子书,涵盖:政策法规、职业素养、商务礼仪、客户服务销售技能、市场营销、团队管理、办公软件等多个知识领域】<br/>2、优先优惠参加协会组织的公开培训课<br/>更多优惠请关注协会微信号【gzreavip】'
  85. })
  86. function onSubmit() {
  87. const form = {
  88. title: info.value.payProject,
  89. year: info.value.year,
  90. amount: info.value.price,
  91. desc: info.value.payProject
  92. }
  93. personPayment(form).then(res => {
  94. if (res && res.message === 'success') {
  95. const params = res.data
  96. wx.requestPayment({
  97. timeStamp: params.timeStamp,
  98. nonceStr: params.nonceStr,
  99. package: params.package,
  100. signType: params.signType,
  101. paySign: params.paySign,
  102. success (res) {
  103. console.log('支付成功', res)
  104. },
  105. fail (res) {
  106. console.log('支付失败', res)
  107. }
  108. })
  109. }
  110. })
  111. }
  112. onLoad((load) => {
  113. user.value = authStore.userInfo
  114. info.value = {
  115. username: user.value.name,
  116. payProject: `${load.year}年度个人会费`,
  117. type: '个人会费',
  118. year: Number(load.year),
  119. price: Number(load.duePrice),
  120. periodOfValidity: `${Number(load.year)}.05.1-${Number(load.year) + 1}.4.30`,
  121. remark: '根据《协会章程》规定,个人会费200元/年/人,会员会籍为每年5月1日至4月30日。<br/>个人会员可享受以下会员服务:<br/>1、免费使用网络教育培训系统【系统已上线121个视频课程77本电子书,涵盖:政策法规、职业素养、商务礼仪、客户服务销售技能、市场营销、团队管理、办公软件等多个知识领域】<br/>2、优先优惠参加协会组织的公开培训课<br/>更多优惠请关注协会微信号【gzreavip】'
  122. }
  123. })
  124. </script>
  125. <style lang="scss" scoped>
  126. .container {
  127. height: 100vh;
  128. width: 100vw;
  129. background-color: $uni-bg-color;
  130. padding: 20rpx;
  131. .info-box {
  132. padding: 30rpx;
  133. background-color: $uni-bg-color-grey;
  134. border-radius: $uni-card-border-radius;
  135. .info-item-box {
  136. font-size: $uni-title-font-size-2;
  137. border-bottom: 1rpx solid #E6E6E6;
  138. height: 82rpx;
  139. .label {
  140. font-weight: bold;
  141. }
  142. }
  143. .flex {
  144. display: flex;
  145. align-items: center;
  146. .label {
  147. width: 30%;
  148. }
  149. .text {
  150. width: 70%;
  151. }
  152. }
  153. .row {
  154. .label {
  155. line-height: 62rpx;
  156. }
  157. .text {
  158. line-height: 42rpx;
  159. font-size: $uni-title-font-size-3;
  160. font-weight: bold;
  161. }
  162. }
  163. }
  164. .bottom-box {
  165. padding: 20rpx;
  166. position: absolute;
  167. bottom: 50rpx;
  168. width: 95%;
  169. }
  170. }
  171. </style>