Jelajahi Sumber

完成会费列表,个人会费缴交接口接入

LinWuTai 1 hari lalu
induk
melakukan
c9d735af7e

+ 30 - 0
api/cost.js

@@ -43,4 +43,34 @@ export function personPayment(data) {
 		'method': 'post',
 		'data': data
 	})
+}
+
+/**
+ * 单位会费代缴查询
+ * @param {Object} data 参数
+ */
+export function dept(data) {
+	return request({
+		'url': '/cost/dept',
+		headers: {
+			isToken: true
+		},
+		'method': 'post',
+		'data': data
+	})
+}
+
+/**
+ * 单位会费支付
+ * @param {Object} data 参数
+ */
+export function deptPayment(data) {
+	return request({
+		'url': '/cost/dept/payment',
+		headers: {
+			isToken: true
+		},
+		'method': 'post',
+		'data': data
+	})
 }

+ 9 - 0
pages/daiJiaoDanWeiHuiFei/daiJiaoDanWeiHuiFei.vue

@@ -84,6 +84,15 @@
 	})
 	
 	onLoad(() => {
+		yearList.value = []
+		const year = new Date().getFullYear()
+		
+		for (let i = 0; i < 10; i++) {
+			yearList.value.push({
+				value: `${year - i}`,
+				label: `${year - i}`
+			})
+		}
 		console.log('onLoad')
 	})
 </script>

+ 14 - 1
pages/daiJiaoGeRenChaXunJieGuo/daiJiaoGeRenChaXunJieGuo.vue

@@ -60,6 +60,7 @@
 	})
 	
 	const info = ref({
+		userId: 1,
 		username: 'xxxxxxxxxx', // 姓名
 		idNumber: 'xxxxxxxxxx', // 证件号码
 		phone: 'xxxxxxxxxx', // 手机号码
@@ -81,7 +82,18 @@
 	}
 	
 	function onSubmit() {
-		console.log('点击缴费');
+		const form = {
+			title: `${info.value.year}年度个人会费代缴`,
+			year: info.value.year,
+			amount: info.value.duePrice,
+			desc: `${info.value.year}年度个人会费代缴`,
+			userId: info.value.userId
+		}
+		personPayment(form).then(res => {
+			if (res && res.message === 'success') {
+				console.log('会费缴交', res)
+			}
+		})
 	}
 	
 	onLoad((load) => {
@@ -103,6 +115,7 @@
 			if (res && res.message === 'success') {
 				info.value = res.data
 				info.value.year = year
+				info.value.userId = res.data.userId
 			}
 		})
 	})

+ 33 - 5
pages/geRenHuiFeiJiaoJiao/geRenHuiFeiJiaoJiao.vue

@@ -65,25 +65,53 @@
 <script setup>
 	import { ref } from 'vue'
 	import { onLoad } from '@dcloudio/uni-app'
+	import { useAuthStore } from '@/store/authStore'
+	import { personPayment } from '@/api/cost.js'
+	const authStore = useAuthStore()
 	
-	const id = ref()
+	// 用户信息
+	const user = ref({
+		userIcon: '1',
+		name: '某某某',
+		corpName: '广州市xx地产有限公司',
+		corpRegNo: '123xxxx'
+	})
 	
 	const info = ref({
 		username: '某某某',
 		payProject: '2024年度个人会费',
 		type: '个人会费',
-		year: '2024',
-		price: '200',
+		year: 2024,
+		price: 200,
 		periodOfValidity: '2024.05.1-2025.4.30',
 		remark: '根据《协会章程》规定,个人会费200元/年/人,会员会籍为每年5月1日至4月30日。<br/>个人会员可享受以下会员服务:<br/>1、免费使用网络教育培训系统【系统已上线121个视频课程77本电子书,涵盖:政策法规、职业素养、商务礼仪、客户服务销售技能、市场营销、团队管理、办公软件等多个知识领域】<br/>2、优先优惠参加协会组织的公开培训课<br/>更多优惠请关注协会微信号【gzreavip】'
 	})
 	
 	function onSubmit() {
-		console.log('点击支付');
+		const form = {
+			title: info.value.payProject,
+			year: info.value.year,
+			amount: info.value.price,
+			desc: info.value.payProject
+		}
+		personPayment(form).then(res => {
+			if (res && res.message === 'success') {
+				console.log('会费缴交', res)
+			}
+		})
 	}
 	
 	onLoad((load) => {
-		id.value = load.id
+		user.value = authStore.userInfo
+		info.value = {
+			username: user.value.name,
+			payProject: `${load.year}年度个人会费`,
+			type: '个人会费',
+			year: Number(load.year),
+			price: Number(load.duePrice),
+			periodOfValidity: `${Number(load.year)}.05.1-${Number(load.year) + 1}.4.30`,
+			remark: '根据《协会章程》规定,个人会费200元/年/人,会员会籍为每年5月1日至4月30日。<br/>个人会员可享受以下会员服务:<br/>1、免费使用网络教育培训系统【系统已上线121个视频课程77本电子书,涵盖:政策法规、职业素养、商务礼仪、客户服务销售技能、市场营销、团队管理、办公软件等多个知识领域】<br/>2、优先优惠参加协会组织的公开培训课<br/>更多优惠请关注协会微信号【gzreavip】'
+		}
 	})
 </script>
 

+ 3 - 3
pages/huiFeiJiaoJiao/huiFeiJiaoJiao.vue

@@ -94,11 +94,11 @@
 		},
 	])
 	function onJiaoFei(val) {
-		if (val.isPay) {
+		if (val.payed) {
 			return
 		}
 		uni.navigateTo({
-			url: `/pages/geRenHuiFeiJiaoJiao/geRenHuiFeiJiaoJiao?id=${val.id}`
+			url: `/pages/geRenHuiFeiJiaoJiao/geRenHuiFeiJiaoJiao?year=${val.year}&duePrice=${val.duePrice}`
 		})
 	}
 	function onDaiJiaoGeRenHuiFei() {
@@ -116,7 +116,7 @@
 		user.value = authStore.userInfo
 		list().then(res => {
 			if (res && res.message === 'success') {
-				console.log(res)
+				listData.value = res.data
 			}
 		})
 	})