daiJiaoGeRenChaXunJieGuo.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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="info-box" style="background: none;">
  47. <view class="info-item-box row" style="height: auto;border-bottom: 0;">
  48. <view class="text" v-html="info.remark"></view>
  49. </view>
  50. </view>
  51. <view class="bottom-box-block">
  52. </view>
  53. <view class="bottom-box">
  54. <u-button type="error" shape="circle" @click="onSubmit">点击缴费</u-button>
  55. </view>
  56. </view>
  57. </template>
  58. <script setup>
  59. import { ref } from 'vue'
  60. import { onLoad } from '@dcloudio/uni-app'
  61. import { person, personPayment, getSubPersonCastAgree } from '@/api/cost.js'
  62. import { useAuthStore } from '@/store/authStore'
  63. const authStore = useAuthStore()
  64. const openid = ref('')
  65. const form = ref({
  66. name: '',
  67. idNumber: ''
  68. })
  69. const info = ref({
  70. userId: 1,
  71. username: 'xxxxxxxxxx', // 姓名
  72. idNumber: 'xxxxxxxxxx', // 证件号码
  73. phone: 'xxxxxxxxxx', // 手机号码
  74. licenseNo: 'xxxxxxxxxx', // 业务水平认证证书编号
  75. creditNo: 'xxxxxxxxxx', // 信用信息卡号
  76. year: '', // 缴交年份
  77. duePrice: 0.00, // 价格
  78. remark: ""
  79. })
  80. const showYear = ref(false)
  81. const yearList = ref([
  82. {
  83. value: '2025',
  84. label: '2025'
  85. }
  86. ])
  87. function onYearConfirm(val) {
  88. info.value.year = val[0].value
  89. }
  90. function onSubmit() {
  91. const {giver, giverPhone} = info.value
  92. /**
  93. * 20250915
  94. * 1.代缴个人支付接口增加代缴用户姓名,代缴用户联系电话
  95. * 2.目前对接正式数据,未作支付测试
  96. */
  97. const form = {
  98. title: `${info.value.year}年度个人会费代缴`,
  99. year: info.value.year,
  100. amount: info.value.duePrice,
  101. desc: `${info.value.year}年度个人会费代缴`,
  102. userId: info.value.userId,
  103. openid: openid.value,
  104. giver,
  105. giverPhone
  106. }
  107. // console.log(form, "支付代缴个人")
  108. personPayment(form).then(res => {
  109. if (res && res.code === 0) {
  110. const params = res.data
  111. wx.requestPayment({
  112. timeStamp: params.timeStamp,
  113. nonceStr: params.nonceStr,
  114. package: params.package,
  115. signType: params.signType,
  116. paySign: params.paySign,
  117. success (res) {
  118. msgSuccess('支付成功')
  119. uni.navigateBack()
  120. },
  121. fail (res) {
  122. const errMsg = res.errMsg
  123. if (errMsg.indexOf('fail cancel')) {
  124. msgError('已取消支付')
  125. }
  126. }
  127. })
  128. }
  129. })
  130. }
  131. function init(){
  132. getSubPersonCastAgree().then(res=>{
  133. if (res && res.code === 0) {
  134. // console.log("代缴个人会费缴交",res.data)
  135. info.value.remark = res.data.content
  136. // info.value.remark = `<p>
  137. // 描述:
  138. // </p>
  139. // <p>
  140. // 根据协会章程,个人会费200元/年/人,会员会籍为每年1月1日至12月31日。
  141. // </p>
  142. // <p>
  143. // 个人会员可享受以下会员服务:
  144. // </p>
  145. // <p>
  146. // 1、免费使用网络教育培训系统【系统已上线海量视频课程,77本电子书,涵盖:政策法规、职业素养、商务礼仪、客户服务、销售技能、市场营销、团队管理、办公软件等多个知识领域】
  147. // </p>
  148. // <p>
  149. // 2、优先或以会员价参加协会组织的公开培训课
  150. // </p>
  151. // <p>
  152. // 更多优惠请关注协会微信号【gzreavip】
  153. // </p>`
  154. }
  155. })
  156. }
  157. onLoad((load) => {
  158. yearList.value = []
  159. const year = new Date().getFullYear()
  160. const giver = load.giver
  161. const giverPhone = load.giverPhone
  162. openid.value = uni.getStorageSync('openid')
  163. for (let i = 0; i < 10; i++) {
  164. yearList.value.push({
  165. value: `${year - i}`,
  166. label: `${year - i}`
  167. })
  168. }
  169. form.value = {
  170. name: load.name,
  171. idNumber: load.idNumber,
  172. }
  173. init()
  174. person(form.value).then(res => {
  175. if (res && res.code === 0) {
  176. info.value = res.data
  177. info.value.year = year
  178. info.value.userId = res.data.userId
  179. info.value.giver = giver
  180. info.value.giverPhone = giverPhone
  181. }
  182. })
  183. })
  184. </script>
  185. <style lang="scss" scoped>
  186. .container {
  187. height: 100vh;
  188. width: 100vw;
  189. background-color: $uni-bg-color;
  190. padding: 0 20rpx;
  191. .info-box {
  192. padding: 30rpx;
  193. background-color: $uni-bg-color-grey;
  194. border-radius: $uni-card-border-radius;
  195. .info-item-box {
  196. font-size: $uni-title-font-size-2;
  197. border-bottom: 1rpx solid #E6E6E6;
  198. height: 82rpx;
  199. .label {
  200. font-weight: bold;
  201. }
  202. }
  203. .flex {
  204. display: flex;
  205. align-items: center;
  206. .label {
  207. width: 40%;
  208. }
  209. .text {
  210. width: 60%;
  211. }
  212. }
  213. .row {
  214. .label {
  215. line-height: 62rpx;
  216. }
  217. .text {
  218. line-height: 180%;
  219. font-size: 28rpx;
  220. font-weight: bold;
  221. }
  222. }
  223. }
  224. .bottom-box-block{
  225. height: 150rpx;
  226. }
  227. .bottom-box {
  228. padding: 20rpx;
  229. position: fixed;
  230. bottom: 50rpx;
  231. width: 95%;
  232. }
  233. }
  234. </style>