daiJiaoGeRenChaXunJieGuo.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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.idNumber }}
  18. </view>
  19. </view>
  20. <view class="info-item-box flex">
  21. <view class="label">
  22. 业务水平认证证书编号
  23. </view>
  24. <view class="text">
  25. {{ info.licenseNo ?? '无' }}
  26. </view>
  27. </view>
  28. <view class="info-item-box flex">
  29. <view class="label">
  30. 信用信息卡号
  31. </view>
  32. <view class="text">
  33. {{ info.creditNo ?? '无' }}
  34. </view>
  35. </view>
  36. <view class="info-item-box flex">
  37. <view class="label">
  38. 缴费年份
  39. </view>
  40. <view class="text" @click="showYear = true">
  41. {{ info.year }}(可拉下选中缴费时间)
  42. </view>
  43. </view>
  44. </view>
  45. <u-select v-model="showYear" :list="yearList" @confirm="onYearConfirm"></u-select>
  46. <view class="bottom-box">
  47. <u-button type="error" shape="circle" @click="onSubmit">点击缴费</u-button>
  48. </view>
  49. </view>
  50. </template>
  51. <script setup>
  52. import { ref } from 'vue'
  53. import { onLoad } from '@dcloudio/uni-app'
  54. import { person, personPayment } from '@/api/cost.js'
  55. import { useAuthStore } from '@/store/authStore'
  56. const authStore = useAuthStore()
  57. const openid = ref('')
  58. const form = ref({
  59. name: '',
  60. idNumber: ''
  61. })
  62. const info = ref({
  63. userId: 1,
  64. username: 'xxxxxxxxxx', // 姓名
  65. idNumber: 'xxxxxxxxxx', // 证件号码
  66. phone: 'xxxxxxxxxx', // 手机号码
  67. licenseNo: 'xxxxxxxxxx', // 业务水平认证证书编号
  68. creditNo: 'xxxxxxxxxx', // 信用信息卡号
  69. year: '', // 缴交年份
  70. duePrice: 0.00, // 价格
  71. })
  72. const showYear = ref(false)
  73. const yearList = ref([
  74. {
  75. value: '2025',
  76. label: '2025'
  77. }
  78. ])
  79. function onYearConfirm(val) {
  80. info.value.year = val[0].value
  81. }
  82. function onSubmit() {
  83. const {giver, giverPhone} = info.value
  84. /**
  85. * 20250915
  86. * 1.代缴个人支付接口增加代缴用户姓名,代缴用户联系电话
  87. * 2.目前对接正式数据,未作支付测试
  88. */
  89. const form = {
  90. title: `${info.value.year}年度个人会费代缴`,
  91. year: info.value.year,
  92. amount: info.value.duePrice,
  93. desc: `${info.value.year}年度个人会费代缴`,
  94. userId: info.value.userId,
  95. openid: openid.value,
  96. giver,
  97. giverPhone
  98. }
  99. // console.log(form, "支付代缴个人")
  100. personPayment(form).then(res => {
  101. if (res && res.code === 0) {
  102. const params = res.data
  103. wx.requestPayment({
  104. timeStamp: params.timeStamp,
  105. nonceStr: params.nonceStr,
  106. package: params.package,
  107. signType: params.signType,
  108. paySign: params.paySign,
  109. success (res) {
  110. msgSuccess('支付成功')
  111. uni.navigateBack()
  112. },
  113. fail (res) {
  114. const errMsg = res.errMsg
  115. if (errMsg.indexOf('fail cancel')) {
  116. msgError('已取消支付')
  117. }
  118. }
  119. })
  120. }
  121. })
  122. }
  123. onLoad((load) => {
  124. yearList.value = []
  125. const year = new Date().getFullYear()
  126. const giver = load.giver
  127. const giverPhone = load.giverPhone
  128. openid.value = uni.getStorageSync('openid')
  129. for (let i = 0; i < 10; i++) {
  130. yearList.value.push({
  131. value: `${year - i}`,
  132. label: `${year - i}`
  133. })
  134. }
  135. form.value = {
  136. name: load.name,
  137. idNumber: load.idNumber,
  138. }
  139. person(form.value).then(res => {
  140. if (res && res.code === 0) {
  141. info.value = res.data
  142. info.value.year = year
  143. info.value.userId = res.data.userId
  144. info.value.giver = giver
  145. info.value.giverPhone = giverPhone
  146. }
  147. })
  148. })
  149. </script>
  150. <style lang="scss" scoped>
  151. .container {
  152. height: 100vh;
  153. width: 100vw;
  154. background-color: $uni-bg-color;
  155. padding: 0 20rpx;
  156. .info-box {
  157. padding: 30rpx;
  158. background-color: $uni-bg-color-grey;
  159. border-radius: $uni-card-border-radius;
  160. .info-item-box {
  161. font-size: $uni-title-font-size-2;
  162. border-bottom: 1rpx solid #E6E6E6;
  163. height: 82rpx;
  164. .label {
  165. font-weight: bold;
  166. }
  167. }
  168. .flex {
  169. display: flex;
  170. align-items: center;
  171. .label {
  172. width: 40%;
  173. }
  174. .text {
  175. width: 60%;
  176. }
  177. }
  178. .row {
  179. .label {
  180. line-height: 62rpx;
  181. }
  182. .text {
  183. line-height: 42rpx;
  184. font-size: $uni-title-font-size-3;
  185. font-weight: bold;
  186. }
  187. }
  188. }
  189. .bottom-box {
  190. padding: 20rpx;
  191. position: absolute;
  192. bottom: 50rpx;
  193. width: 95%;
  194. }
  195. }
  196. </style>