root 5 月之前
父节点
当前提交
b26df3a3eb
共有 9 个文件被更改,包括 665 次插入650 次删除
  1. 6 5
      .env
  2. 2 3
      src/components/ShuiWuSH.vue
  3. 44 16
      src/components/ShuiWuTop.vue
  4. 1 1
      src/pages/index/components/HomeList.vue
  5. 334 344
      src/pages/index/pay.vue
  6. 162 165
      src/pages/my/myEdit.vue
  7. 1 1
      src/services/home.ts
  8. 二进制
      src/static/images/index_icon.png
  9. 115 115
      src/utils/http.ts

+ 6 - 5
.env

@@ -1,16 +1,17 @@
 
 
 # NODE_ENV = 'development'
 # NODE_ENV = 'development'
-# VITE_SERVE = 'http://10.113.248.3:8443' # 开发阶段服务器地址
-# VITE_MEDIA = 'https://test.jue-ming.com:8084'
-# VITE_PORT = 8443
+# VITE_SERVE = 'http://10.113.248.3:8445' # 开发阶段服务器地址
+# VITE_MEDIA = 'http://10.113.248.3:8445'
+# VITE_PORT = 8445
 
 
 # NODE_ENV = 'test'
 # NODE_ENV = 'test'
 # VITE_SERVE = 'https://jinhong-credit.com:8445' # 开发阶段服务器地址
 # VITE_SERVE = 'https://jinhong-credit.com:8445' # 开发阶段服务器地址
-# VITE_IMG_URL = 'https://jinhong-credit.com:8443'
+# VITE_IMG_URL = 'https://jinhong-credit.com:8445'
 # VITE_MEDIA = 'https://jinhong-credit.com:8445'
 # VITE_MEDIA = 'https://jinhong-credit.com:8445'
 # VITE_PORT = 8445
 # VITE_PORT = 8445
 
 
 NODE_ENV = 'production'
 NODE_ENV = 'production'
 VITE_SERVE = 'https://jinhong-credit.com:8443' # 开发阶段服务器地址
 VITE_SERVE = 'https://jinhong-credit.com:8443' # 开发阶段服务器地址
-VITE_MEDIA = 'https://test.jue-ming.com:8084'
+VITE_IMG_URL = 'https://jinhong-credit.com:8443'
+VITE_MEDIA = 'https://jinhong-credit.com:8443'
 VITE_PORT = 8443
 VITE_PORT = 8443

+ 2 - 3
src/components/ShuiWuSH.vue

@@ -44,11 +44,10 @@ const dialogInputConfirm = async () => {
 		});
 		});
 		return;
 		return;
 	}
 	}
-	//如果都填写了则判断跳转到另一个页面
-	inputDialog.value.close();
 
 
-	// 保存报告
+	// 保存报告,关闭弹窗
 	emit('saveReport', { name: name.value, swNum: swNum.value, phone: phone.value });
 	emit('saveReport', { name: name.value, swNum: swNum.value, phone: phone.value });
+	inputDialog.value.close();
 };
 };
 
 
 //打开输入税号的弹出框
 //打开输入税号的弹出框

+ 44 - 16
src/components/ShuiWuTop.vue

@@ -1,26 +1,54 @@
 <script setup lang="ts">
 <script setup lang="ts">
-	const prop = defineProps({
-		des: {},
-	});
-	const safe = uni.getSystemInfoSync().safeArea?.top as number;
-	console.log(safe);
-	// const saftTop = safe.top
-	//获取安全距离
+const props = defineProps({
+	des: {
+		type: Object,
+		default: {
+			showGoIndex: false,
+			title: ''
+		}
+	},
+});
+const safe = uni.getSystemInfoSync().safeArea?.top as number;
+console.log(safe);
+// const saftTop = safe.top
+//获取安全距离
+const goIndex = () => {
+	uni.switchTab({
+		url: '/pages/index/index'
+	})
+}
 </script>
 </script>
 
 
 <template>
 <template>
 	<view class="view-top" :style="{ paddingTop: safe + 40 + 'rpx' }">
 	<view class="view-top" :style="{ paddingTop: safe + 40 + 'rpx' }">
-		{{ des }}
+		<view v-if="props.des.showGoIndex" class="go_index">
+			<image @click="goIndex" src="../static/images/index_icon.png" mode="widthFix"></image>
+			{{ props.des.title }}
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <style>
 <style>
-	.view-top {
-		text-align: center;
-		color: #8ebfc7;
-		font-size: 40rpx;
-		/* background-color: rgb(243, 250, 248); */
-		padding-bottom: 40rpx;
-		font-weight: 700;
-	}
+.view-top {
+	text-align: center;
+	color: #8ebfc7;
+	font-size: 36rpx;
+	/* background-color: rgb(243, 250, 248); */
+	padding-bottom: 40rpx;
+	font-weight: 700;
+}
+
+.go_index {
+	position: relative;
+	margin-top: 6px;
+}
+
+.go_index image {
+	width: 50rpx;
+	height: auto;
+	float: left;
+	position: absolute;
+	left: 6rpx;
+	top: 0;
+}
 </style>
 </style>

+ 1 - 1
src/pages/index/components/HomeList.vue

@@ -13,7 +13,7 @@ const props = defineProps({
 	}
 	}
 })
 })
 
 
-const reportList = reactive<any>({});
+const reportList = reactive<any>([]);
 
 
 // 邀约订单查询报告记录
 // 邀约订单查询报告记录
 const queryReportList = async () => {
 const queryReportList = async () => {

+ 334 - 344
src/pages/index/pay.vue

@@ -1,378 +1,368 @@
 <!-- eslint-disable no-prototype-builtins -->
 <!-- eslint-disable no-prototype-builtins -->
 <script setup lang="ts">
 <script setup lang="ts">
-import { onLoad, onShow, onUnload } from "@dcloudio/uni-app";
-import { ref, reactive } from "vue";
-import {
-	createOrderApi,
-	payAppointmentApi,
-	queryOrderStatusApi,
-	queryParamsApi,
-	saveReportApi,
-	cancelPayApi
-} from "@/services/home";
-import type { QueryPa } from "@/types/home";
-import HomeList from "./components/HomeList.vue";
-import { loginUser } from "@/hooks/useIsLogin";
-import { useMemberStore } from "@/stores";
-import ShuiWuSH from "@/components/ShuiWuSH.vue";
-
-const userInfo = useMemberStore();
-//1 未支付   --可查看全部信息
-//2 openId相等  但是状态是支付中  --可查看全部状态
-//3 openId不相等  状态是别人在支付中 --不可查看任何信息
-//4 openId 相等  但是已支付  --不再支付可查看生成的报告
-//5 openId 不相等  别人已支付  --不可查看任何信息
-
-/**
- * 总结  当返回状态是
- * 1或2时--按钮是微信支付---且列表显示--全部信息展示
- * 3和5时 所有信息不展示
- * 4时 按钮为查看风险评估
- *
- */
-
-/**
- * flag = 1 表示未支付
- * flag = 4 表示已支付,且当前扫码用户userId = 已支付用户userId
- * flag = 5 已支付,且当前扫码用户userId != 已支付用户userId
-*/
-
-//获取到的传输过来的唯一值
-const params = reactive<any>({
-	title: "", //标题
-	num: "", //剩余次数
-	time: "", //有效截止日期
-	flag: "", //当前订单的状态
-});
-
-
-let orderParams = reactive<any>({
-	userId: '',
-	linId: '',
-	channelId: '', //渠道id
-	title: '', //标题
-	amount: '',
-	times: '',
-	effectiveDate: '', //天数
-	createDate: '',
-	staffId: '',
-	staffName: '',
-	backGround: '',
-	status: '',
-	flag: ''
-})
-
-// const userId = ref<string>("");
-//调用查询参数需要的入参
-const scene = ref<QueryPa>({ scene: "", userId: "" });
-const orderId = ref<string>("");
-
-//onLoad方法  --在页面初次加载时触发,仅会在页面初次加载时触发一次
-//应该将二维码获取唯一标识放到缓存中--这样即使从其他页面过来就回调用就能记住这个标识--然后根据标识去查询
-onLoad((options) => {
-	//获取的二维码中得到的参数信息
-	// console.log(decodeURIComponent(options?.scene));
-	// scene.value.scene = decodeURIComponent(options?.scene);
-	// userInfo.saveScene(decodeURIComponent(options?.scene));
-
-	//根据页面中的options 获取参数
-	//1判断是否含有这个参数
-
-	//2如果没有则是表明是从另一个页面进来的不是扫码进来的
-	//3则需要调用接口需要看到访问次数和过期时间
-	const option = options as any;
-	console.log(option.hasOwnProperty("scene"));
-	console.log(option.hasOwnProperty("id"));
-	if (option.hasOwnProperty("scene")) {
-		//
-		userInfo.saveScene(option.scene);
-	} else {
-		userInfo.saveScene("");
-		//获取参数接口
-	}
-	//将scene存入缓存中
-
-	// loginUser().then((res) => {
-	//   //这时已经有返回信息了且用户数据已经
-	//   scene.value.userId = res as string;
-	//   //获取到userId了
-	//   queryParams(scene.value);
-	// });
-});
-onShow(() => {
-	//从缓存中取出信息
-	//  scene.value.scene = decodeURIComponent(options?.scene);
-	//将scene存入缓存中
-	//需要判断是否有scene
-	scene.value.scene = userInfo.scene;
-	//不等于空的话就说明是从扫码进来的
-	//如果是空的话就是渠道点击进来的
-	if (scene.value.scene !== "") {
-		loginUser().then((res) => {
-			//这时已经有返回信息了且用户数据已经
-			scene.value.userId = res as string;
-			//获取到userId了
-			queryParams(scene.value);
-		});
-	} else {
-		//如果是渠道点击进来的
-		//则调用渠道接口//然后返回数据
-	}
-});
+	import { onLoad, onShow, onUnload } from "@dcloudio/uni-app";
+	import { ref, reactive } from "vue";
+	import {
+		createOrderApi,
+		payAppointmentApi,
+		queryOrderStatusApi,
+		queryParamsApi,
+		saveReportApi,
+		cancelPayApi
+	} from "@/services/home";
+	import type { QueryPa } from "@/types/home";
+	import HomeList from "./components/HomeList.vue";
+	import { loginUser } from "@/hooks/useIsLogin";
+	import { useMemberStore } from "@/stores";
+	import ShuiWuSH from "@/components/ShuiWuSH.vue";
+	const userInfo = useMemberStore();
+
+	let qrCode = ref<any>({
+		id: '',
+		userId: '',
+		channelId: '', //渠道id
+		title: '', //标题
+		"orderNo": null,
+		amount: '',
+		times: '',
+		remainTimes: '',
+		effectiveDate: '', //天数
+		createDate: '',
+		staffId: '',
+		staffName: '',
+		backGround: '',
+		status: '',
+		flag: ''
+	})
 
 
-//查询 根据唯一键值对
-const queryParams = async (val: QueryPa) => {
-	const res = await queryParamsApi(val);
-	params.flag = res.data.flag;
-	if (params.flag == 3 || params.flag == 5) {
-		uni.showToast({
-			icon: 'none',
-			title: '该二维码已被使用'
-		})
-		return;
-	}
-	params.title = res.data.title;
-	params.num = res.data.remainTimes;
-
-	params.time = formatterData(res.data.createDate, res.data.effectiveDays);
-
-	orderParams.userId = userInfo.userInfo.id;
-	orderParams.linId = res.data.id;
-	orderParams.channelId = res.data.channelId;
-	orderParams.title = res.data.title;
-	orderParams.amount = res.data.amount;
-	orderParams.times = res.data.times;
-	orderParams.effectiveDate = res.data.effectiveDays;
-	orderParams.createDate = res.data.createDate;
-	orderParams.staffId = res.data.staffId;
-	orderParams.staffName = res.data.staffName;
-	orderParams.backGround = res.data.backGround;
-	orderParams.status = res.data.status;
-	orderParams.flag = res.data.flag;
-};
-
-const homeList = ref<any>();
-
-// 保存邀约订单
-const saveReportHandle = async (val: any) => {
-	const res = await saveReportApi({
-		companyName: val.name,
-		tax: val.swNum,
-		contactNumber: val.phone,
-		reportType: 1,
-		linkId: orderParams.linId,
-		channelId: orderParams.channelId,
-		userId: orderParams.userId
+	// const userId = ref<string>("");
+	//调用查询参数需要的入参
+	const scene = ref<QueryPa>({ scene: "", userId: "" });
+	const orderId = ref<string>("");
+
+	//onLoad方法  --在页面初次加载时触发,仅会在页面初次加载时触发一次
+	//应该将二维码获取唯一标识放到缓存中--这样即使从其他页面过来就回调用就能记住这个标识--然后根据标识去查询
+	onLoad((options) => {
+		//获取的二维码中得到的参数信息
+		// console.log(decodeURIComponent(options?.scene));
+		// scene.value.scene = decodeURIComponent(options?.scene);
+		// userInfo.saveScene(decodeURIComponent(options?.scene));
+
+		//根据页面中的options 获取参数
+		//1判断是否含有这个参数
+
+		//2如果没有则是表明是从另一个页面进来的不是扫码进来的
+		//3则需要调用接口需要看到访问次数和过期时间
+		const option = options as any;
+		console.log(option.hasOwnProperty("scene"));
+		console.log(option.hasOwnProperty("id"));
+		if (option.hasOwnProperty("scene")) {
+			//
+			userInfo.saveScene(option.scene);
+		} else {
+			userInfo.saveScene("");
+			//获取参数接口
+		}
 	});
 	});
-	homeList.value.queryReportList();
-	queryParams(scene.value);
-	uni.showToast({
-		title: '提交成功'
-	})
-}
-
-//有效日期
-const formatterData = (date: any, day: any) => {
-	//将data日期格式化为初始的毫秒值
-	//将day 日期格式化为day
-
-	let dateF = new Date(date).getTime();
-	let dayF = day * 24 * 60 * 60 * 1000;
-	console.log(dateF);
-	console.log(dayF);
-	let dataN = dateF + dayF;
-	//然后将毫秒值转化为具体时间
-	let dataNew = new Date(dataN);
-	let y = dataNew.getFullYear();
-	let m =
-		dataNew.getMonth() + 1 < 10 ? "0" + (dataNew.getMonth() + 1) : dataNew.getMonth() + 1;
-
-	let d = dataNew.getDate() < 10 ? "0" + dataNew.getDate() : dataNew.getDate();
-	return y + "-" + m + "-" + d;
-};
-
-//点击支付按钮生成的方法
-const payButton = () => {
-	//先调用订单生成
-	creatOrderFun({ 'linkId': orderParams.linId, 'userId': orderParams.userId })
-};
-
-// 预支付,生成支付信息
-const creatOrderFun = async (val: any) => {
-	const res = await createOrderApi(val);
-	// 预支付成功,拉起微信支付
-	if (res.code == '200') {
-		let payInfo = {
-			"timeStamp": res.data.timeStamp,
-			"nonceStr": res.data.nonceStr,
-			"package": res.data.package,
-			"signType": "RSA",
-			"paySign": res.data.paySign,
+	onShow(() => {
+		//从缓存中取出信息
+		//  scene.value.scene = decodeURIComponent(options?.scene);
+		//将scene存入缓存中
+		//需要判断是否有scene
+		scene.value.scene = userInfo.scene;
+		//不等于空的话就说明是从扫码进来的
+		//如果是空的话就是渠道点击进来的
+		if (scene.value.scene !== "") {
+			loginUser().then((res) => {
+				//这时已经有返回信息了且用户数据已经
+				scene.value.userId = res as string;
+				//获取到userId了
+				queryParams(scene.value);
+			});
+		} else {
+			//如果是渠道点击进来的
+			//则调用渠道接口//然后返回数据
+		}
+	});
+
+	//1 未支付   --可查看全部信息
+	//2 openId相等  但是状态是支付中  --可查看全部状态
+	//3 openId不相等  状态是别人在支付中 --不可查看任何信息
+	//4 openId 相等  但是已支付  --不再支付可查看生成的报告
+	//5 openId 不相等  别人已支付  --不可查看任何信息
+
+	/**
+	 * 总结  当返回状态是
+	 * 1或2时--按钮是微信支付---且列表显示--全部信息展示
+	 * 3和5时 所有信息不展示
+	 * 4时 按钮为查看风险评估
+	 *
+	 */
+
+	/**
+	 * flag = 1 表示未支付
+	 * flag = 4 表示已支付,且当前扫码用户userId = 已支付用户userId
+	 * flag = 5 已支付,且当前扫码用户userId != 已支付用户userId
+	*/
+
+	//查询 根据唯一键值对
+	const queryParams = async (val : QueryPa) => {
+		const res = await queryParamsApi(val);
+		// 校验二维码是否正常
+		if (res && res.code == '2001') {
+			uni.showToast({
+				icon: 'none',
+				title: res.msg
+			})
+			return
+		}
+
+		// 校验二维码是已使用
+		if (res.data.flag == 3 || res.data.flag == 5) {
+			uni.showToast({
+				icon: 'none',
+				title: '该二维码已被使用'
+			})
+			return;
 		}
 		}
-		payFun(payInfo);
+
+
+		qrCode.value = { ...res.data, userId: userInfo.userInfo.id }
+
+		// 若待支付金额为0,调用预支付直接完成订单
+		if (qrCode.value.flag == 1 && qrCode.value.amount == 0) {
+			creatOrderFun({ 'linkId': qrCode.value.id, 'userId': qrCode.value.userId })
+		}
+	};
+
+	const homeList = ref<any>();
+
+	// 保存邀约订单
+	const saveReportHandle = async (val : any) => {
+		const res = await saveReportApi({
+			companyName: val.name,
+			tax: val.swNum,
+			contactNumber: val.phone,
+			reportType: 1,
+			linkId: qrCode.value.id,
+			channelId: qrCode.value.channelId,
+			userId: qrCode.value.userId
+		});
+		homeList.value.queryReportList();
+		queryParams(scene.value);
+		uni.showToast({
+			title: '提交成功'
+		})
 	}
 	}
-};
-
-// 拉起微信支付收银台
-const payFun = async (val: any) => {
-	uni.requestPayment({
-		...val,
-		success: (res: any) => {
-			if (res) {
-				if (res.errMsg == "requestPayment:ok") {
-					params.flag = 4;
-					// console.log("支付成功");
+
+	//格式化有效日期
+	const formatterData = (date : any, day : any) => {
+		let dateF = new Date(date).getTime();
+		let dayF = day * 24 * 60 * 60 * 1000;
+		console.log(dateF);
+		console.log(dayF);
+		let dataN = dateF + dayF;
+		//然后将毫秒值转化为具体时间
+		let dataNew = new Date(dataN);
+		let y = dataNew.getFullYear();
+		let m =
+			dataNew.getMonth() + 1 < 10 ? "0" + (dataNew.getMonth() + 1) : dataNew.getMonth() + 1;
+
+		let d = dataNew.getDate() < 10 ? "0" + dataNew.getDate() : dataNew.getDate();
+		return y + "-" + m + "-" + d;
+	};
+
+	//点击支付按钮生成的方法
+	const payButton = () => {
+		//先调用订单生成
+		creatOrderFun({ 'linkId': qrCode.value.id, 'userId': qrCode.value.userId })
+	};
+
+	// 预支付,生成支付信息
+	const creatOrderFun = async (val : any) => {
+		const res = await createOrderApi(val);
+		// 预支付成功,拉起微信支付
+		if (res.code == '200') {
+			if (res.data == '0000') {
+				qrCode.value.flag = 4;
+			} else {
+				let payInfo = {
+					"timeStamp": res.data.timeStamp,
+					"nonceStr": res.data.nonceStr,
+					"package": res.data.package,
+					"signType": "RSA",
+					"paySign": res.data.paySign,
 				}
 				}
+				payFun(payInfo);
 			}
 			}
-		},
-		fail: (err: any) => {
-			console.log(err);
-			if (err.errMsg == "requestPayment:fail cancel") {
-				cancelPay(orderParams.linId)
-			} else {
+
+		}
+	};
+
+	// 拉起微信支付收银台
+	const payFun = async (val : any) => {
+		uni.requestPayment({
+			...val,
+			success: (res : any) => {
+				if (res) {
+					if (res.errMsg == "requestPayment:ok") {
+						queryOrderStatus(qrCode.value.id);
+						// console.log("支付成功");
+					}
+				}
+			},
+			fail: (err : any) => {
+				console.log(err);
+				if (err.errMsg == "requestPayment:fail cancel") {
+					cancelPay(qrCode.value.id)
+				} else {
+				}
+			},
+		});
+	};
+
+	// 用户取消支付
+	const cancelPay = async (val : any) => {
+		const res = await cancelPayApi(val);
+	}
+
+	//点击税务风险检测--弹出输入税务号的信息
+	const swGet = ref<any>();
+	const openSW = () => {
+		swGet.value.openSH();
+	};
+
+	//查询订单状态
+	const queryOrderStatus = async (val : any) => {
+		const res = await queryOrderStatusApi(val);
+		if (res && res.code == '200') {
+			let tradeState = JSON.parse(res.data.body)['trade_state'];
+			if (tradeState == 'SUCCESS') {
+				qrCode.value.flag = 4;
 			}
 			}
-		},
+		} else {
+			uni.showToast({
+				title: res.msg,
+				icon: 'none',
+				mask: true
+			})
+		}
+		// clearInterval(timeMe.value);
+	};
+
+	//定时器参数
+	const timeMe = ref<any>();
+	//创建一个定时器
+
+	const queryOrderFor = () => {
+		//进来的时候清除定时器
+		clearInterval(timeMe.value);
+		timeMe.value = setInterval(() => {
+			queryOrderStatus(qrCode.value.id);
+		}, 3000);
+	};
+
+	//销毁页面
+	onUnload(() => {
+		//来清除定时器
+		clearInterval(timeMe.value);
 	});
 	});
-};
-
-// 查询支付结果
-const queryPayResult = () => {
-
-}
-
-// 用户取消支付
-const cancelPay = async (val: any) => {
-	const res = await cancelPayApi(val);
-}
-
-//点击税务风险检测--弹出输入税务号的信息
-const swGet = ref<any>();
-const openSW = () => {
-	swGet.value.openSH();
-};
-
-
-const goCheck = () => {
-}
-
-//查询订单状态
-const queryOrderStatus = async (val: any) => {
-	const res = await queryOrderStatusApi(val);
-	clearInterval(timeMe.value);
-};
-
-//定时器参数
-const timeMe = ref<any>();
-//创建一个定时器
-
-const queryOrderFor = () => {
-	//进来的时候清除定时器
-	clearInterval(timeMe.value);
-	timeMe.value = setInterval(() => {
-		//嗲用方法
-		queryOrderStatus(orderParams.linId);
-	}, 3000);
-};
-
-//销毁页面
-onUnload(() => {
-	//来清除定时器
-	clearInterval(timeMe.value);
-});
 </script>
 </script>
 <template>
 <template>
 	<view class="payBg">
 	<view class="payBg">
-		<ShuiWuTop />
+		<ShuiWuTop :des="{showGoIndex: true, title: '税务风险检测'}" />
 		<view class="pay_params">
 		<view class="pay_params">
 			<view class="pay_card_title1">
 			<view class="pay_card_title1">
-				{{ params.title }}
+				{{ qrCode.title }}
+			</view>
+			<view class="pay_card_num"> 剩余生成次数:{{ qrCode.remainTimes }} </view>
+			<view class="pay_card_time">
+				有效日期:{{qrCode.createDate ? formatterData(qrCode.createDate, qrCode.effectiveDays) : ''}}
 			</view>
 			</view>
-			<view class="pay_card_num"> 剩余生成次数:{{ params.num }} </view>
-			<view class="pay_card_time"> 有效日期:{{ params.time }} </view>
 		</view>
 		</view>
-		<view v-show="params.flag == 1 || params.flag == 2"><button class="pay_button" @click="payButton">立即支付</button>
+		<view v-show="qrCode.flag < 3 && qrCode.amount != 0"><button class="pay_button" @click="payButton">立即支付</button>
 		</view>
 		</view>
-		<view v-show="params.flag == 4 && params.num > 0"><button class="detection_button"
+		<view v-show="qrCode.flag == 4 && qrCode.remainTimes > 0"><button class="detection_button"
 				@click="openSW">税务风险检测</button></view>
 				@click="openSW">税务风险检测</button></view>
 		<view>
 		<view>
-			<HomeList v-if="params.flag == 4" ref="homeList" :linkId="orderParams.linId" class="home_list_com" />
+			<HomeList v-if="qrCode.flag == 4" ref="homeList" :linkId="qrCode.id" class="home_list_com" />
 		</view>
 		</view>
 		<ShuiWuSH ref="swGet" @saveReport="saveReportHandle" />
 		<ShuiWuSH ref="swGet" @saveReport="saveReportHandle" />
 	</view>
 	</view>
 </template>
 </template>
 <style lang="scss">
 <style lang="scss">
-page {
-	height: 100%;
-}
-
-.payBg {
-	width: 750rpx;
-	height: 100%;
-	padding: 0rpx 20rpx;
-
-	.pay_params {
-		width: 703rpx;
-		height: 273rpx;
-		color: #333333;
-		margin-top: 60rpx;
-		padding: 20rpx 40rpx;
-		background: url(https://test.jue-ming.com:8849/api/show?filePath=./jinhong/index/pay_card.png) no-repeat top;
-		background-size: cover;
-		display: flex;
-		flex-direction: column;
-
-		.pay_card_title1 {
-			font-family: 'Alibaba PuHuiTi 2.0';
-			font-weight: normal;
-			font-size: 32rpx;
-			color: #0056FF;
-			padding: 20rpx 0 40rpx 20rpx;
-		}
+	page {
+		height: 100%;
+	}
 
 
-		.pay_card_num {
-			font-family: 'Alibaba PuHuiTi 2.0';
-			font-weight: normal;
-			font-size: 28rpx;
+	.payBg {
+		width: 750rpx;
+		height: 100%;
+		padding: 0rpx 20rpx;
+
+		.pay_params {
+			width: 703rpx;
+			height: 273rpx;
 			color: #333333;
 			color: #333333;
-			padding-left: 20rpx;
-			margin-top: 20rpx;
+			margin-top: 60rpx;
+			padding: 20rpx 40rpx;
+			background: url(https://test.jue-ming.com:8849/api/show?filePath=./jinhong/index/pay_card.png) no-repeat top;
+			background-size: cover;
+			display: flex;
+			flex-direction: column;
+
+			.pay_card_title1 {
+				font-family: 'Alibaba PuHuiTi 2.0';
+				font-weight: normal;
+				font-size: 32rpx;
+				color: #0056FF;
+				padding: 20rpx 0 40rpx 20rpx;
+			}
+
+			.pay_card_num {
+				font-family: 'Alibaba PuHuiTi 2.0';
+				font-weight: normal;
+				font-size: 28rpx;
+				color: #333333;
+				padding-left: 20rpx;
+				margin-top: 20rpx;
+			}
+
+			.pay_card_time {
+				font-family: 'Alibaba PuHuiTi 2.0';
+				font-weight: normal;
+				font-size: 28rpx;
+				color: #333333;
+				padding-left: 20rpx;
+				margin-top: 20rpx;
+				margin-bottom: 40rpx;
+			}
 		}
 		}
 
 
-		.pay_card_time {
-			font-family: 'Alibaba PuHuiTi 2.0';
+		.pay_button {
+			width: 703rpx;
+			line-height: 77rpx;
+			background: linear-gradient(90deg, #BC63F4 0%, #4A89FB 100%);
+			border-radius: 20rpx;
+			border: 1px solid #FFFFFF;
+			font-family: Alibaba PuHuiTi 2.0;
 			font-weight: normal;
 			font-weight: normal;
-			font-size: 28rpx;
-			color: #333333;
-			padding-left: 20rpx;
-			margin-top: 20rpx;
-			margin-bottom: 40rpx;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			margin: 72rpx 0 60rpx;
 		}
 		}
-	}
-
-	.pay_button {
-		width: 703rpx;
-		line-height: 77rpx;
-		background: linear-gradient(90deg, #BC63F4 0%, #4A89FB 100%);
-		border-radius: 20rpx;
-		border: 1px solid #FFFFFF;
-		font-family: Alibaba PuHuiTi 2.0;
-		font-weight: normal;
-		font-size: 32rpx;
-		color: #FFFFFF;
-		margin: 72rpx 0 60rpx;
-	}
 
 
-	.detection_button {
-		width: 703rpx;
-		line-height: 77rpx;
-		background: linear-gradient(90deg, #BC63F4 0%, #4A89FB 100%);
-		border-radius: 20rpx;
-		border: 1px solid #FFFFFF;
-		font-family: Alibaba PuHuiTi 2.0;
-		font-weight: normal;
-		font-size: 32rpx;
-		color: #FFFFFF;
-		margin: 72rpx 0 60rpx;
+		.detection_button {
+			width: 703rpx;
+			line-height: 77rpx;
+			background: linear-gradient(90deg, #BC63F4 0%, #4A89FB 100%);
+			border-radius: 20rpx;
+			border: 1px solid #FFFFFF;
+			font-family: Alibaba PuHuiTi 2.0;
+			font-weight: normal;
+			font-size: 32rpx;
+			color: #FFFFFF;
+			margin: 72rpx 0 60rpx;
+		}
 	}
 	}
-}
 </style>
 </style>

+ 162 - 165
src/pages/my/myEdit.vue

@@ -1,115 +1,118 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { ref, reactive } from "vue";
-import { imgUrl } from "../../utils/http";
-import { useMemberStore } from "@/stores";
-import { userInfoUpdateApi } from "@/services/my";
-import type { UserInfoT } from "@/types/my";
+	import { ref, reactive } from "vue";
+	import { imgUrl } from "../../utils/http";
+	import { useMemberStore } from "@/stores";
+	import { userInfoUpdateApi } from "@/services/my";
+	import type { UserInfoT } from "@/types/my";
 
 
-const valiFormData = reactive({
-  userName: "",
-  mail: "",
-});
+	const valiFormData = reactive({
+		userName: "",
+		mail: "",
+	});
 
 
-//从缓存取个人用户信息
-const userInfo = useMemberStore();
-//将缓存里边取出来的东西拿出来//放在这个用户的字段里
-valiFormData.userName = userInfo.userInfo.userName;
-valiFormData.mail = userInfo.userInfo.mail;
-const valiForm = ref();
-const submit = (ref: string) => {
-  if (valiFormData.userName == "") {
-    uni.showToast({
-      title: "请填写名称",
-      duration: 2000,
-      icon: "error",
-    });
-    return;
-  }
-  userInfoUpdate({
-    id: userInfo.userInfo.id,
-    avatar: userInfo.userInfo.photoPath,
-    userName: valiFormData.userName,
-    mail: valiFormData.mail,
-  });
-};
-const userInfoUpdate = async (val: UserInfoT) => {
-  const res = await userInfoUpdateApi(val);
-  //修改用户信息
-  console.log("修改用户信息");
-  if (res.code) {
-    uni.showToast({
-      title: "修改成功",
-      duration: 2000,
-      icon: "success",
-    });
-  }
-};
+	//从缓存取个人用户信息
+	const userInfo = useMemberStore();
+	//将缓存里边取出来的东西拿出来//放在这个用户的字段里
+	valiFormData.userName = userInfo.userInfo.userName;
+	valiFormData.mail = userInfo.userInfo.mail;
+	const valiForm = ref();
+	const submit = (ref : string) => {
+		if (valiFormData.userName == "") {
+			uni.showToast({
+				title: "请填写名称",
+				duration: 2000,
+				icon: "error",
+			});
+			return;
+		}
+		userInfoUpdate({
+			id: userInfo.userInfo.id,
+			avatar: userInfo.userInfo.photoPath,
+			userName: valiFormData.userName,
+			mail: valiFormData.mail,
+		});
+	};
+	const userInfoUpdate = async (val : UserInfoT) => {
+		const res = await userInfoUpdateApi(val);
+		//修改用户信息
+		console.log("修改用户信息");
+		if (res.code == '200') {
+			uni.showToast({
+				title: "修改成功",
+				duration: 2000,
+				icon: "success",
+				success() {
+					const saveUserInfo = useMemberStore().saveUserInfo;
+					saveUserInfo({
+						...userInfo.userInfo, userName: valiFormData.userName, mail: valiFormData.mail
+					})
+				}
+			});
+		}
+	};
 
 
-//获取用户头像
-const getAvatar = (e: any) => {
-  //需要调用上传接口将图片上传至自己的服务器
-  //然后返回个地址就是头像的地址
-  uni.uploadFile({
-    url: "/file/customUpload",
-    filePath: e.detail.avatarUrl,
-    name: "file",
-    success: (res) => {
-      let photo = `${imgUrl}${JSON.parse(res.data).data}`;
-      console.log(photo);
+	//获取用户头像
+	const getAvatar = (e : any) => {
+		//需要调用上传接口将图片上传至自己的服务器
+		//然后返回个地址就是头像的地址
+		uni.uploadFile({
+			url: "/file/customUpload",
+			filePath: e.detail.avatarUrl,
+			name: "file",
+			success: (res) => {
+				let photo = `${imgUrl}${JSON.parse(res.data).data}`;
+				console.log(photo);
 
 
-      userInfo.userInfo.photoPath = photo;
-      console.log(userInfo.userInfo);
-      userInfo.saveUserInfo(userInfo.userInfo);
-    },
-  });
-};
-//提交并进行表单校验
-//注释
-// const valiForm = ref();
-// const submit = (ref: string) => {
-//   valiForm.value
-//     .validate()
-//     .then((res: any) => {
-//       console.log("success", res);
-//       uni.showToast({
-//         title: `校验通过`,
-//       });
-//     })
-//     .catch((err: any) => {
-//       console.log("err", err);
-//     });
-// };
+				userInfo.userInfo.photoPath = photo;
+				console.log(userInfo.userInfo);
+				userInfo.saveUserInfo(userInfo.userInfo);
+			},
+		});
+	};
+	//提交并进行表单校验
+	//注释
+	// const valiForm = ref();
+	// const submit = (ref: string) => {
+	//   valiForm.value
+	//     .validate()
+	//     .then((res: any) => {
+	//       console.log("success", res);
+	//       uni.showToast({
+	//         title: `校验通过`,
+	//       });
+	//     })
+	//     .catch((err: any) => {
+	//       console.log("err", err);
+	//     });
+	// };
 </script>
 </script>
 <template>
 <template>
-  <view class="my_edit">
-    <uni-forms label-position="right" ref="valiForm" :modelValue="valiFormData">
-      <uni-forms-item label="">
-        <view class="avatar_class">
-          <view>头像</view>
-          <!-- 获取用户头像 -->
-          <!-- 获取用户头像 -->
-          <view>
-            <button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="getAvatar">
-              <image
-                style="
+	<view class="my_edit">
+		<uni-forms label-position="right" ref="valiForm" :modelValue="valiFormData">
+			<uni-forms-item label="">
+				<view class="avatar_class">
+					<view>头像</view>
+					<!-- 获取用户头像 -->
+					<!-- 获取用户头像 -->
+					<view>
+						<button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="getAvatar">
+							<image style="
                   width: 80rpx;
                   width: 80rpx;
                   height: 80rpx;
                   height: 80rpx;
                   background-color: #eeeeee;
                   background-color: #eeeeee;
                   border-radius: 50%;
                   border-radius: 50%;
-                "
-                :src="userInfo.userInfo.photoPath"
-              ></image>
-              <!-- <u-avatar
+                " :src="userInfo.userInfo.photoPath"></image>
+							<!-- <u-avatar
               @click="handleAva"
               @click="handleAva"
               class="avatar"
               class="avatar"
               size="80"
               size="80"
                  :src="userInfo.userInfo.photo"
                  :src="userInfo.userInfo.photo"
               :src="userStore.userAvatar"
               :src="userStore.userAvatar"
             ></u-avatar> -->
             ></u-avatar> -->
-            </button></view
-          >
+						</button>
+					</view>
 
 
-          <!-- <uni-file-picker
+					<!-- <uni-file-picker
             style="width: 100rpx"
             style="width: 100rpx"
             limit="1"
             limit="1"
             :del-icon="false"
             :del-icon="false"
@@ -118,86 +121,80 @@ const getAvatar = (e: any) => {
             file-mediatype="image"
             file-mediatype="image"
             >&nbsp;</uni-file-picker
             >&nbsp;</uni-file-picker
           > -->
           > -->
-          <!-- <image
+					<!-- <image
             @click="getAvatarFun"
             @click="getAvatarFun"
             style="width: 200px; height: 200px; background-color: #eeeeee"
             style="width: 200px; height: 200px; background-color: #eeeeee"
             src=""
             src=""
           ></image> -->
           ></image> -->
-        </view>
-      </uni-forms-item>
-      <uni-forms-item label="">
-        <view class="name_class">
-          <view>名字</view>
-          <uni-easyinput
-            :clearable="false"
-            :inputBorder="false"
-            v-model="valiFormData.userName"
-            placeholder="请输入名字"
-          ></uni-easyinput>
-        </view>
-      </uni-forms-item>
-      <uni-forms-item label="">
-        <view class="name_class">
-          <view> 邮箱 </view>
-          <uni-easyinput
-            :inputBorder="false"
-            :clearable="false"
-            v-model="valiFormData.mail"
-            placeholder="请输入邮箱"
-          ></uni-easyinput>
-        </view>
-      </uni-forms-item>
-      <uni-forms-item></uni-forms-item>
-    </uni-forms>
-    <button class="submit_user" @click="submit('valiForm')">提交</button>
-  </view>
+				</view>
+			</uni-forms-item>
+			<uni-forms-item label="">
+				<view class="name_class">
+					<view>名字</view>
+					<uni-easyinput :clearable="false" :inputBorder="false" v-model="valiFormData.userName"
+						placeholder="请输入名字"></uni-easyinput>
+				</view>
+			</uni-forms-item>
+			<uni-forms-item label="">
+				<view class="name_class">
+					<view> 邮箱 </view>
+					<uni-easyinput :inputBorder="false" :clearable="false" v-model="valiFormData.mail"
+						placeholder="请输入邮箱"></uni-easyinput>
+				</view>
+			</uni-forms-item>
+			<uni-forms-item></uni-forms-item>
+		</uni-forms>
+		<button class="submit_user" @click="submit('valiForm')">提交</button>
+	</view>
 </template>
 </template>
 <style lang="scss">
 <style lang="scss">
-.my_edit .uni-easyinput {
-  text-align: right;
-}
+	.my_edit .uni-easyinput {
+		text-align: right;
+	}
 
 
-.my_edit .uni-easyinput__content {
-  background-color: transparent !important;
-}
+	.my_edit .uni-easyinput__content {
+		background-color: transparent !important;
+	}
 
 
-page {
-  height: 100%;
-}
+	page {
+		height: 100%;
+	}
 
 
-.my_edit {
-  background: rgb(243, 250, 248);
-  height: 100%;
-  padding: 0rpx 20rpx;
-  .submit_user {
-    background: linear-gradient(rgb(0, 89, 255), rgb(153, 0, 255));
-    color: #ffffff;
-  }
-  .avatar_class {
-    padding-bottom: 14rpx;
-    border-bottom: 2rpx solid #dbd8d8;
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
+	.my_edit {
+		background: rgb(243, 250, 248);
+		height: 100%;
+		padding: 0rpx 20rpx;
 
 
-    .uni-file-picker {
-      flex: none;
-      width: auto;
-    }
+		.submit_user {
+			background: linear-gradient(rgb(0, 89, 255), rgb(153, 0, 255));
+			color: #ffffff;
+		}
 
 
-    .file-picker__box-content {
-      border-color: #c5c2c2 !important;
-    }
-  }
+		.avatar_class {
+			padding-bottom: 14rpx;
+			border-bottom: 2rpx solid #dbd8d8;
+			display: flex;
+			flex-direction: row;
+			justify-content: space-between;
+			align-items: center;
 
 
-  .name_class {
-    padding-bottom: 14rpx;
-    border-bottom: 2rpx solid #dbd8d8;
-    display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    align-items: center;
-  }
-}
-</style>
+			.uni-file-picker {
+				flex: none;
+				width: auto;
+			}
+
+			.file-picker__box-content {
+				border-color: #c5c2c2 !important;
+			}
+		}
+
+		.name_class {
+			padding-bottom: 14rpx;
+			border-bottom: 2rpx solid #dbd8d8;
+			display: flex;
+			flex-direction: row;
+			justify-content: space-between;
+			align-items: center;
+		}
+	}
+</style>

+ 1 - 1
src/services/home.ts

@@ -191,7 +191,7 @@ export const queryReportListByUserApi = (id: string, val: any) => {
 export const queryOrderStatusApi = (val: any) => {
 export const queryOrderStatusApi = (val: any) => {
   return http<any>({
   return http<any>({
     method: 'GET',
     method: 'GET',
-    url: `queryOrderStatusUrl/${val}`,
+    url: `${queryOrderStatusUrl}/${val}`,
   })
   })
 }
 }
 
 

二进制
src/static/images/index_icon.png


+ 115 - 115
src/utils/http.ts

@@ -8,33 +8,33 @@ const baseUrl = import.meta.env.VITE_SERVE
 export const imgUrl = `${import.meta.env.VITE_IMG_URL}/file/show?filePath=`
 export const imgUrl = `${import.meta.env.VITE_IMG_URL}/file/show?filePath=`
 export const mediaUrl = `${import.meta.env.VITE_MEDIA}/file/show?filePath=`
 export const mediaUrl = `${import.meta.env.VITE_MEDIA}/file/show?filePath=`
 
 
-let temp_request: any[] = [],
-  is_freshing = false
+let temp_request : any[] = [],
+	is_freshing = false
 const httpInterceptor = {
 const httpInterceptor = {
-  //拦截前触发
-  invoke(options: UniApp.RequestOptions) {
-    //拼接地址
-    if (!options.url.startsWith('http')) {
-      options.url = baseUrl + options.url
-    }
-    //请求时间
-    options.timeout = 10000
-    options.header = {
-      ...options.header,
-      'source-client': 'miniapp',
-    }
-    //判断如果请求体里有data//且data不为空
-    if ('data' in options) {
-      //如果包含data属性
-      options.data = { data: Encrypt(JSON.stringify(options.data)) }
-    }
-    console.log(options)
-    //添加 token 请求头标识
-    const memberStore = useMemberStore()
-    // const token = memberStore.profile?.token
-    const token = memberStore.token
-    options.header.Authorization = token ? `Bearer ${token}` : ''
-  },
+	//拦截前触发
+	invoke(options : UniApp.RequestOptions) {
+		//拼接地址
+		if (!options.url.startsWith('http')) {
+			options.url = baseUrl + options.url
+		}
+		//请求时间
+		options.timeout = 10000
+		options.header = {
+			...options.header,
+			'source-client': 'miniapp',
+		}
+		//判断如果请求体里有data//且data不为空
+		if ('data' in options) {
+			//如果包含data属性
+			options.data = { data: Encrypt(JSON.stringify(options.data)) }
+		}
+		console.log(options)
+		//添加 token 请求头标识
+		const memberStore = useMemberStore()
+		// const token = memberStore.profile?.token
+		const token = memberStore.token
+		options.header.Authorization = token ? `Bearer ${token}` : ''
+	},
 }
 }
 
 
 uni.addInterceptor('request', httpInterceptor)
 uni.addInterceptor('request', httpInterceptor)
@@ -49,103 +49,103 @@ uni.addInterceptor('uploadFile', httpInterceptor)
  */
  */
 
 
 interface Data<T> {
 interface Data<T> {
-  code: string
-  msg: string
-  data: T
+	code : string
+	msg : string
+	data : T
 }
 }
 
 
-export const http = <T>(option: UniApp.RequestOptions) => {
-  uni.showLoading()
-  let params_ = option
-  // console.log(option?.data)
-  return new Promise<Data<T>>((resolve, reject) => {
-    uni.request({
-      ...option,
-      success(res) {
-        //获取状态码
-        // res.ststusCode
-        if (res.statusCode >= 200 && res.statusCode < 300) {
-          //访问成功
-          // eslint-disable-next-line no-debugger
+export const http = <T>(option : UniApp.RequestOptions) => {
+	uni.showLoading()
+	let params_ = option
+	// console.log(option?.data)
+	return new Promise<Data<T>>((resolve, reject) => {
+		uni.request({
+			...option,
+			success(res) {
+				//获取状态码
+				// res.ststusCode
+				if (res.statusCode >= 200 && res.statusCode < 300) {
+					//访问成功
+					// eslint-disable-next-line no-debugger
 
 
-          resolve(JSON.parse(Decrypt(res.data)))
+					resolve(JSON.parse(Decrypt(res.data)))
 
 
-          // resolve(res.data as Data<T>)
-        } else if (res.statusCode === 401) {
-          //当token过期后弹出确认再次登录的提示框
-          //如果点击确定再次调用登录接口
-          if (!is_freshing) {
-            //调用登录接口
-            refresh()
-          } else {
-            resolve(
-              new Promise((resol) => {
-                temp_request.push(() => {
-                  resol(http(params_))
-                })
-              }),
-            )
-          }
+					// resolve(res.data as Data<T>)
+				} else if (res.statusCode === 401) {
+					//当token过期后弹出确认再次登录的提示框
+					//如果点击确定再次调用登录接口
+					if (!is_freshing) {
+						//调用登录接口
+						refresh()
+					} else {
+						resolve(
+							new Promise((resol) => {
+								temp_request.push(() => {
+									resol(http(params_))
+								})
+							}),
+						)
+					}
 
 
-          //清理用户信息
-          //跳转到登录页
-          const memberStore = useMemberStore()
-          memberStore.clearProfile()
-          uni.navigateTo({
-            url: '/src/pages/index/index',
-          })
-          reject(res)
-        } else {
-          // (res.data as Data<T>).msg
-          uni.showToast({
-            icon: 'none',
-            title: (res.data as Data<T>).msg || '请求错误请稍后再试',
-          })
-          reject(res)
-        }
-      },
-      //响应失败,网络断开
-      fail(err) {
-        console.log(err)
-        uni.showToast({
-          icon: 'none',
-          title: '网络错误',
-        })
-        //网络错误
-      },
-      complete() {
-        uni.hideLoading({
-          noConflict: true,
-        })
-      },
-    })
-  })
+					//清理用户信息
+					//跳转到登录页
+					const memberStore = useMemberStore()
+					memberStore.clearProfile()
+					uni.navigateTo({
+						url: '/src/pages/index/index',
+					})
+					reject(res)
+				} else {
+					// (res.data as Data<T>).msg
+					uni.showToast({
+						icon: 'none',
+						title: (res.data as Data<T>).msg || '请求错误请稍后再试',
+					})
+					reject(res)
+				}
+			},
+			//响应失败,网络断开
+			fail(err) {
+				console.log(err)
+				uni.showToast({
+					icon: 'none',
+					title: '网络错误',
+				})
+				//网络错误
+			},
+			complete() {
+				uni.hideLoading({
+					noConflict: true,
+				})
+			},
+		})
+	})
 }
 }
 
 
 const refresh = () => {
 const refresh = () => {
-  is_freshing = true
-  uni.login({
-    success: (res) => {
-      if (res.errMsg === 'login:ok') {
-        //调用登录接口
-        //获取到code后
-        loginHttp(res.code)
-      }
-    },
-  })
+	is_freshing = true
+	uni.login({
+		success: (res) => {
+			if (res.errMsg === 'login:ok') {
+				//调用登录接口
+				//获取到code后
+				loginHttp(res.code)
+			}
+		},
+	})
 }
 }
 
 
-const loginHttp = async (code: string) => {
-  const res = await userLoginApi({ code: code })
+const loginHttp = async (code : string) => {
+	const res = await userLoginApi({ code: code })
 
 
-  //登录成功后需要将 is_refresh 状态改为false
-  //然后回调
-  if (res.data) {
-    console.log(res.data)
-  } else {
-    is_freshing = false
-    temp_request.map((cb) => cb())
-    // 清空temp_request
-    temp_request = []
-  }
-}
+	//登录成功后需要将 is_refresh 状态改为false
+	//然后回调
+	if (res.data) {
+		console.log(res.data)
+	} else {
+		is_freshing = false
+		temp_request.map((cb) => cb())
+		// 清空temp_request
+		temp_request = []
+	}
+}