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