daiJiaoDanWeiChaXunJieGuo.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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.name }}
  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>
  53. <view class="info-box" style="background: none;">
  54. <view class="info-item-box row" style="height: auto;border-bottom: 0;">
  55. <view class="text" v-html="info.remark"></view>
  56. </view>
  57. </view>
  58. <view class="bottom-box-block">
  59. </view>
  60. <view class="bottom-box">
  61. <u-button type="error" shape="circle" @click="onSubmit">支付</u-button>
  62. </view>
  63. </view>
  64. </template>
  65. <script setup>
  66. import {
  67. ref
  68. } from 'vue'
  69. import {
  70. onLoad
  71. } from '@dcloudio/uni-app'
  72. import {
  73. dept,
  74. deptPayment,
  75. getSubUnitCastAgree
  76. } from '@/api/cost.js'
  77. import {
  78. msgError
  79. } from '../../utils/common'
  80. import {
  81. useAuthStore
  82. } from '@/store/authStore'
  83. const authStore = useAuthStore()
  84. const openid = ref('')
  85. const info = ref({
  86. name: '某某某机构', // 机构名称
  87. payProject: '2025年度理事单位会费', // 支付项目
  88. type: '理事单位会费', // 类型
  89. year: '2024', // 年份
  90. price: '1000', // 金额
  91. periodOfValidity: '2024.1.1-2024.12.31',
  92. userIds: null,
  93. remark: '根据《协会章程》规定,会费标准如下:<br/>1、副会长单位:50000元/年;<br/>2、常务理事及理事单位:10000元/年;<br/>3、普通会员单位:1000元/年;单位会员会籍为每年1月1日至12月31日。<br/>会员可享受以下权利:<br/>1、协会的选举权、被选举权和表决权;<br/>2、优先参加协会组织开展的各类活动;<br/>3、获得协会服务的优先权;<br/>4、对协会工作的批评建议权和监督权;<br/>5、请求协会维护合法权益;<br/>6、入会自愿、退会自由。',
  94. giver: "",
  95. giverPhone: ""
  96. })
  97. const params = ref({
  98. timeStamp: '',
  99. nonceStr: '',
  100. package: '',
  101. signType: '',
  102. paySign: '',
  103. })
  104. function init() {
  105. getSubUnitCastAgree().then(res => {
  106. if (res && res.code === 0) {
  107. info.value.remark = res.data.content
  108. // info.value.remark = `<p>
  109. // 描述:
  110. // </p>
  111. // <p>
  112. // 会员可享受以下权利:
  113. // </p>
  114. // <p>
  115. // 1、本会的选举权、被选举权和表决权;
  116. // </p>
  117. // <p>
  118. // 2、参加本会的活动权;
  119. // </p>
  120. // <p>
  121. // 3、获得本会服务的优先权;
  122. // </p>
  123. // <p>
  124. // 4、入会自愿、退会自由权;
  125. // </p>
  126. // <p>
  127. // 5、查阅本会章程、会员名册、会议纪要(决议)、财务审计报告等知情权;
  128. // </p>
  129. // <p>
  130. // 6、批评建议权和监督权;
  131. // </p>
  132. // <p>
  133. // 7、请求协会维护合法权益。
  134. // </p>`
  135. // console.log("代缴单位会费缴交",res.data)
  136. }
  137. })
  138. }
  139. function onSubmit() {
  140. // 支付写了,但是没有测试
  141. const {
  142. giver,
  143. giverPhone
  144. } = info.value
  145. const form = {
  146. title: `${info.value.payProject}代缴`,
  147. year: info.value.year,
  148. amount: info.value.price,
  149. desc: `${info.value.payProject}代缴`,
  150. userId: info.value.userId,
  151. openid: openid.value,
  152. giver,
  153. giverPhone
  154. }
  155. // console.log(form)
  156. deptPayment(form).then(res => {
  157. if (res && res.code === 0) {
  158. params.value = res.data
  159. wx.requestPayment({
  160. timeStamp: params.value.timeStamp,
  161. nonceStr: params.value.nonceStr,
  162. package: params.value.package,
  163. signType: params.value.signType,
  164. paySign: params.value.paySign,
  165. success(res) {
  166. msgSuccess('支付成功')
  167. uni.navigateBack()
  168. },
  169. fail(res) {
  170. // console.log('支付失败', res)
  171. const errMsg = res.errMsg
  172. if (errMsg.indexOf('fail cancel')) {
  173. msgError('已取消支付')
  174. }
  175. }
  176. })
  177. } else {
  178. msgError(res.message)
  179. uni.navigateBack()
  180. }
  181. })
  182. }
  183. onLoad((load) => {
  184. const name = load.name
  185. const year = load.year
  186. const number = load.number
  187. const price = load.price
  188. const type = Number(price) > 10000
  189. ? '副会长单位' : Number(price) > 1000
  190. ? '理事单位' : '普通会员单位'
  191. const userId = load.userId
  192. openid.value = uni.getStorageSync('openid')
  193. const giver = load.giver
  194. const giverPhone = load.giverPhone
  195. info.value = {
  196. name: name, // 机构名称
  197. payProject: `${year}年度${type}会费`, // 支付项目
  198. type: `${type}会费`, // 类型
  199. year, // 年份
  200. price, // 金额
  201. periodOfValidity: `${year}.1.1-${year}.12.31`,
  202. userId,
  203. remark: '根据《协会章程》规定,会费标准如下:<br/>1、副会长单位:50000元/年;<br/>2、常务理事及理事单位:10000元/年;<br/>3、普通会员单位:1000元/年;单位会员会籍为每年1月1日至12月31日。<br/>会员可享受以下权利:<br/>1、协会的选举权、被选举权和表决权;<br/>2、优先参加协会组织开展的各类活动;<br/>3、获得协会服务的优先权;<br/>4、对协会工作的批评建议权和监督权;<br/>5、请求协会维护合法权益;<br/>6、入会自愿、退会自由。',
  204. giver,
  205. giverPhone
  206. }
  207. init()
  208. // console.log(info.value)
  209. })
  210. </script>
  211. <style lang="scss" scoped>
  212. .container {
  213. height: 100vh;
  214. width: 100vw;
  215. background-color: $uni-bg-color;
  216. padding: 20rpx;
  217. .info-box {
  218. padding: 30rpx;
  219. background-color: $uni-bg-color-grey;
  220. border-radius: $uni-card-border-radius;
  221. .info-item-box {
  222. font-size: $uni-title-font-size-2;
  223. border-bottom: 1rpx solid #E6E6E6;
  224. height: 82rpx;
  225. .label {
  226. font-weight: bold;
  227. }
  228. }
  229. .flex {
  230. display: flex;
  231. align-items: center;
  232. .label {
  233. width: 30%;
  234. }
  235. .text {
  236. width: 70%;
  237. }
  238. }
  239. .row {
  240. .label {
  241. line-height: 62rpx;
  242. }
  243. .text {
  244. line-height: 180%;
  245. font-size: 28rpx;
  246. font-weight: bold;
  247. }
  248. }
  249. }
  250. .bottom-box-block {
  251. height: 150rpx;
  252. }
  253. .bottom-box {
  254. padding: 20rpx;
  255. position: fixed;
  256. bottom: 50rpx;
  257. width: 95%;
  258. }
  259. }
  260. </style>