lzj500 1 rok temu
rodzic
commit
d69294135d

+ 9 - 3
game_test1/package.json

@@ -52,8 +52,13 @@
     "@dcloudio/uni-mp-toutiao": "3.0.0-3081220230817001",
     "@dcloudio/uni-mp-weixin": "3.0.0-3081220230817001",
     "@dcloudio/uni-quickapp-webview": "3.0.0-3081220230817001",
+    "@ycxxkj/uniapp": "^1.0.17",
+    "await-to-js": "^3.0.0",
+    "dayjs": "^1.11.10",
+    "js-md5": "^0.8.3",
     "vue": "^3.2.45",
-    "vue-i18n": "^9.1.9"
+    "vue-i18n": "^9.1.9",
+    "pinia": "2.0.33"
   },
   "devDependencies": {
     "@dcloudio/types": "^3.3.2",
@@ -61,10 +66,11 @@
     "@dcloudio/uni-cli-shared": "3.0.0-3081220230817001",
     "@dcloudio/uni-stacktracey": "3.0.0-3081220230817001",
     "@dcloudio/vite-plugin-uni": "3.0.0-3081220230817001",
-    "@vue/tsconfig": "^0.1.3",
     "@vue/runtime-core": "^3.2.45",
+    "@vue/tsconfig": "^0.1.3",
+    "sass": "^1.69.5",
     "typescript": "^4.9.4",
     "vite": "4.1.4",
     "vue-tsc": "^1.0.24"
   }
-}
+}

+ 9 - 1
game_test1/src/App.vue

@@ -10,4 +10,12 @@ onHide(() => {
   console.log("App Hide");
 });
 </script>
-<style></style>
+<style lang="scss">
+@import "./static/style/common.scss";
+/* #ifdef H5 */
+uni-page-head{
+    display: none;
+}
+/* #endif */
+  
+</style>

+ 139 - 0
game_test1/src/libs/data/device.ts

@@ -0,0 +1,139 @@
+export const provinceList = [
+	{ label: "北京", value: "北京", selected: 0 },
+	{ label: "天津", value: "天津", selected: 0 },
+	{ label: "河北", value: "河北", selected: 0 },
+	{ label: "山西", value: "山西", selected: 0 },
+	{ label: "内蒙古", value: "内蒙古", selected: 0 },
+	{ label: "辽宁", value: "辽宁", selected: 0 },
+	{ label: "吉林", value: "吉林", selected: 0 },
+	{ label: "黑龙江", value: "黑龙江", selected: 0 },
+	{ label: "上海", value: "上海", selected: 0 },
+	{ label: "江苏", value: "江苏", selected: 0 },
+	{ label: "浙江", value: "浙江", selected: 0 },
+	{ label: "安徽", value: "安徽", selected: 0 },
+	{ label: "福建", value: "福建", selected: 0 },
+	{ label: "江西", value: "江西", selected: 0 },
+	{ label: "山东", value: "山东", selected: 0 },
+	{ label: "河南", value: "河南", selected: 0 },
+	{ label: "湖北", value: "湖北", selected: 0 },
+	{ label: "湖南", value: "湖南", selected: 0 },
+	{ label: "广东", value: "广东", selected: 0 },
+	{ label: "广西", value: "广西", selected: 0 },
+	{ label: "海南", value: "海南", selected: 0 },
+	{ label: "重庆", value: "重庆", selected: 0 },
+	{ label: "四川", value: "四川", selected: 0 },
+	{ label: "贵州", value: "贵州", selected: 0 },
+	{ label: "云南", value: "云南", selected: 0 },
+	{ label: "西藏", value: "西藏", selected: 0 },
+	{ label: "陕西", value: "陕西", selected: 0 },
+	{ label: "甘肃", value: "甘肃", selected: 0 },
+	{ label: "青海", value: "青海", selected: 0 },
+	{ label: "宁夏", value: "宁夏", selected: 0 },
+	{ label: "新疆", value: "新疆", selected: 0 },
+	{ label: "台湾", value: "台湾", selected: 0 },
+	{ label: "香港", value: "香港", selected: 0 },
+	{ label: "澳门", value: "澳门", selected: 0 }
+];
+
+export const ispList = [
+	{ label: "电信", value: "1", selected: 0 },
+	{ label: "移动", value: "2", selected: 0 },
+	{ label: "联通", value: "3", selected: 0 }
+];
+
+export const natTypeList = [
+	{ label: "公网", value: "public" },
+	{ label: "内网", value: "inner" }
+];
+
+export const dialTypeList = [
+	{ label: "固定公网单IP", value: "staticNetSingle", type: "1" },
+	{ label: "固定公网多IP", value: "staticNetCouple", type: "1" },
+	{ label: "服务器拨号", value: "serverDial", type: "1" },
+	{ label: "软路由", value: "virtualRoute", type: "1" },
+	{ label: "静态单IP", value: "1", type: "2" }
+];
+export const dialTypeSingleList = [{ label: "静态单IP", value: "1" }];
+export const ipTypeList = [
+	{ label: "多IP", value: "1" },
+	{ label: "单IP", value: "2" }
+];
+export const ipProtocolList = [
+	{ label: "双线", value: "1" },
+	{ label: "IPV4", value: "2" },
+	{ label: "IPV6", value: "3" }
+];
+export const netCardList = [
+	{ netDevName: "eth0", ip: "192.168.1.12", speed: "1000", selected: false },
+	{ netDevName: "eth1", ip: "192.168.1.13", speed: "1000", selected: true },
+	{ netDevName: "eth2", ip: "192.168.1.15", speed: "1000", selected: false },
+	{ netDevName: "eth3", ip: "", speed: "1000", selected: false },
+	{ netDevName: "eth4", ip: "", speed: "", selected: false }
+];
+export const businessTypeList = [
+	{ label: "PX", value: "1" },
+	{ label: "QN", value: "2" }
+];
+export const stateList = [
+	{ label: "待审核", value: "bound", color: "#F33535", selected: 0, css: "dot_error" },
+	{ label: "交付中", value: "waitAudit", color: "#F33535", selected: 0, css: "dot_error" },
+	{ label: "验收未通过", value: "auditFailed", color: "#F33535", selected: 0, css: "dot_error" },
+	{ label: "服务中", value: "inService", color: "#00af51", selected: 0, css: "dot_success" },
+	{ label: "已下线", value: "offline", color: "#F33535", selected: 0, css: "dot_warning" },
+	{ label: "已清退", value: "repelled", color: "#F33535", selected: 0, css: "dot_warning" }
+];
+export const resourceTypeList = [
+	{ label: "汇聚资源", value: "aggregation" },
+	{ label: "专线资源", value: "dedicated" }
+];
+export const onlineStatusList = [
+	{ label: "离线", value: "outline", selected: 0, color: "#F33535", css: "dot_error" },
+	{ label: "在线", value: "online", selected: 0, color: "#00af51", css: "dot_success" },
+	{ label: "网络异常", value: "error", selected: 0, color: "#f0ad4e", css: "dot_warning" }
+];
+export const dialStatusList = [
+	{ label: "拨号失败", value: "failed" },
+	{ label: "已拨通", value: "succeed" }
+];
+export const connectStatusList = [
+	{ label: "联网失败", value: "failed" },
+	{ label: "已联网", value: "succeed" }
+];
+export const cardTypeList = [
+	{ label: "银行卡", value: 1, icon: "jc-icon-yinxingqia002", slected: 0, color: "#107c84" },
+	{ label: "支付宝", value: 2, icon: "jc-icon-zhifubaozhifu", slected: 0, color: "#009fe8" },
+	{ label: "微信", value: 3, icon: "jc-icon-weixinzhifu", slected: 0, color: "#6bcc03" }
+];
+export const deviceHelper = {
+	getConnectStatusText(value: string) {
+		return this.getText(connectStatusList, value);
+	},
+	getDialStatusText(value: string) {
+		return this.getText(dialStatusList, value);
+	},
+	getOnlineStatusText(value: string) {
+		return this.getText(onlineStatusList, value);
+	},
+	getStateText(value: string) {
+		return this.getText(stateList, value);
+	},
+	getResourceTypeText(value: string) {
+		return this.getText(resourceTypeList, value);
+	},
+	getDialTypeText(value: string) {
+		return this.getText(dialTypeList, value);
+	},
+	getNatTypeText(value: string) {
+		return this.getText(natTypeList, value);
+	},
+	getText(list: any[], value: string, key: string = "label") {
+		let text = "";
+		list.forEach((item) => {
+			if (item.value === value) {
+				text = item[key];
+				return;
+			}
+		});
+		return text.trim();
+	}
+};

+ 15 - 0
game_test1/src/libs/model/Index.ts

@@ -0,0 +1,15 @@
+const tagInfo = "[/libs/model/Index.ts]:";
+import Http from "../net/Http";
+
+/**
+ * 首页
+ */
+const Index = {
+	async login(username: string, password: string) {
+		let url = "/verify_mobile/index/login";
+		let res = await Http.post(url, { username, password });
+		return res;
+	}
+};
+
+export default Index;

+ 20 - 0
game_test1/src/libs/model/Upload.ts

@@ -0,0 +1,20 @@
+const tagInfo = "[/libs/model/Upload.ts]:";
+import Http from "../net/Http";
+
+/**
+ * 上传模块
+ */
+const Upload = {
+	/**
+	 * 上传头像
+	 * @param filePath
+	 * @returns
+	 */
+	async uploadMemberIcon(filePath: string, member_id: string | number, name: string = "icon") {
+		let url = "url";
+		let res = Http.upload(url, filePath, name);
+		return res;
+	}
+};
+
+export default Upload;

+ 22 - 0
game_test1/src/libs/net/ErrorCode.ts

@@ -0,0 +1,22 @@
+const errorMsg: any = {
+    612: "612",
+    614: "手机号已被注册",
+    613: "密码不正确",
+    621: "手机号不正确",
+};
+const ErrorCode = {
+    getMsg(code: string | number, message: string = '') {
+
+        let msg: string = "";
+        if (errorMsg[code]) {
+            msg = errorMsg[code];
+            return msg;
+        }
+        msg = " 接口错误,错误码:" + code;
+        if (message) {
+            msg += "," + message
+        }
+        return msg;
+    }
+};
+export default ErrorCode;

+ 166 - 0
game_test1/src/libs/net/Http.ts

@@ -0,0 +1,166 @@
+import Config from "@/config";
+import Sign from "./Sign";
+import to from "await-to-js";
+import { YcStorage } from "@ycxxkj/uniapp";
+/**
+ * 网络请求帮助类
+ */
+const http = {
+	SUCCESS_CODE: 1000,
+	async get(url: string, param: any = {}, header: object = {}, isShowLoading: boolean = true): Promise<any> {
+		let [err, res] = await to(http.request(url, param, header, isShowLoading, "GET"));
+		if (err) {
+			return err;
+		}
+		return res;
+	},
+	async post(url: string, param: any = {}, header: object = {}, isShowLoading: boolean = true) {
+		let [err, res] = await to(http.request(url, param, header, isShowLoading, "POST"));
+		if (err) {
+			return err;
+		}
+		return res;
+	},
+	async patch(url: string, param: any = {}, header: object = {}, isShowLoading: boolean = true) {
+		let [err, res] = await to(http.request(url, param, header, isShowLoading, "PATCH"));
+		if (err) {
+			return err;
+		}
+		return res;
+	},
+	async delete(url: string, param: any = {}, header: object = {}, isShowLoading: boolean = true) {
+		let [err, res] = await to(http.request(url, param, header, isShowLoading, "DELETE"));
+		if (err) {
+			return err;
+		}
+		return res;
+	},
+	async upload(url: string, filePath: string, name: string = "file", param: any = {}, isShowLoading: boolean = true) {
+		let [err, res] = await to(http.uploadFile(url, filePath, name, param, isShowLoading));
+		if (err) {
+			return err;
+		}
+		return res;
+	},
+
+	uploadFile(url: string, filePath: string, name: string = "file", param: any = {}, isShowLoading: boolean = true): Promise<any> {
+		if (isShowLoading) {
+			uni.showLoading({
+				title: "正在上传..."
+			});
+		}
+		let combineObj = http.combimeData(param);
+		return new Promise((resolve, reject) => {
+			uni.uploadFile({
+				url: Config.apiHost + url,
+				filePath: filePath,
+				name: name,
+				formData: combineObj.param,
+				header: combineObj.header,
+				success: (res: any) => {
+					let result = res.data;
+					if (typeof res.data == "string") {
+						result = JSON.parse(res.data);
+					}
+					resolve(result);
+				},
+				fail: (res: any) => {
+					let result = res.data;
+					if (typeof res.data == "string") {
+						result = JSON.parse(res.data);
+					}
+					reject(result);
+				},
+				complete() {
+					uni.hideLoading();
+				}
+			});
+		});
+	},
+	request(url: string, param: object, header: object = {}, isShowLoading: boolean = true, method: any = "POST"): Promise<any> {
+		if (isShowLoading) {
+			uni.showLoading({
+				title: "正在加载..."
+			});
+		}
+		let combineObj = http.combimeData(param, header);
+		return new Promise((resolve, reject) => {
+			uni.request({
+				url: Config.apiHost + url,
+				data: combineObj.param,
+				method: method,
+				header: combineObj.header,
+				success(response: any) {
+					// if (response.statusCode == 600) {
+					// 	//处理登录流程
+					// 	toLogin();
+					// 	return;
+					// }
+					if (response.statusCode != 200) {
+						reject({ code: response.statusCode, desc: response.data.error, data: response.data });
+						return;
+					}
+					console.log("request success", response);
+					let res = response.data;
+					if (res.code == 600) {
+						//登录
+						//这里写未登录的逻辑
+						toLogin();
+						reject(res);
+						return;
+					}
+					if (res.code == 602) {
+						return;
+					}
+					resolve(res);
+				},
+				fail(err) {
+					uni.hideLoading();
+					let error = {
+						code: 9999,
+						msg: "网络请求错误",
+						data: err
+					};
+					reject(error);
+				},
+				complete() {
+					uni.hideLoading();
+				}
+			});
+		});
+	},
+	/**
+	 * 组合header和bodydata参数
+	 * @param {*} param
+	 * @returns
+	 */
+	combimeData(param: any = {}, header: any = {}) {
+		let token = YcStorage.get("token"); // uni.getStorageSync("token"); //从缓存取token
+		if (!header["Content-Type"]) {
+			header["Content-Type"] = "application/json";
+		}
+		if (token) {
+			header["Authorization"] = token;
+		}
+		// param = sign(param);//签名
+		return { param, header };
+	}
+};
+
+const toLogin = () => {
+	YcStorage.clear();
+	let pages = getCurrentPages();
+	console.log("lzj500🚀 ~ file: Http.ts:153 ~ toLogin ~ pages:", pages);
+	let callback = "/pages/index/index";
+	if (pages.length > 0) {
+		let curPage: any = pages[pages.length - 1];
+		console.log("lzj500🚀 ~ file: Http.ts:156 ~ toLogin ~ curPage:", curPage);
+		callback = curPage.$page.fullPath;
+	}
+	YcStorage.set("callback", callback);
+	uni.reLaunch({
+		url: "/pages/index/index"
+	});
+	//let curPage = pages[pages.length - 1];
+};
+export default http;

+ 21 - 0
game_test1/src/libs/net/Sign.ts

@@ -0,0 +1,21 @@
+import md5 from "js-md5";
+import Config from "@/config";
+import { YcStringUtil } from "@ycxxkj/uniapp";
+const api_sign_secret = Config.apiSignKey; //签名密钥
+const tagInfo = "/libs/net/sign.js";
+export default function (data: any) {
+	if (!data) {
+		data = {}; //如果没有传data就实例化一个空对象
+	}
+	const timestamp: number = new Date().getTime() / 1000; //获取当前时间戳(秒)
+	data._timestamp = timestamp;
+	const sortData: any = {};
+	Object.keys(data)
+		.sort()
+		.forEach((key) => {
+			sortData[key] = YcStringUtil.parseString(data[key]); //对data所有参数按键值进行排序
+		});
+	//console.log(tagInfo, JSON.stringify(sortData) + api_sign_secret);
+	sortData._sign = md5(JSON.stringify(sortData) + api_sign_secret); //签名=md5(参数的json字符串+签名密钥)
+	return sortData;
+}

+ 85 - 0
game_test1/src/libs/pages/Page.ts

@@ -0,0 +1,85 @@
+import { useScrollStore } from "@/stores/scroll";
+// import UniHelper from "../utils/UniHelper";
+import  { YcBase64, YcReg, YcStorage, YcStringUtil, YcUniapp, Yc } from "@ycxxkj/uniapp";
+import { deviceHelper } from "../data/device";
+const ycxxkj = { YcBase64, YcReg, YcStorage, YcStringUtil, YcUniapp, Yc };
+const Page = {
+	SUCCESS_CODE: 0,
+	setTitle: (title: string = "核销端") => {
+		uni.setNavigationBarTitle({ title });
+	},
+	getVersion: () => {
+		// @ts-ignore
+		// const version = __VERSION__ as string;
+		let version = "copyright © 1.0.3";
+		return version;
+	},
+	switch(url: string) {
+		uni.switchTab({
+			url
+		});
+	},
+	goBack(delta: number = 1) {
+		uni.navigateBack({
+			delta
+		});
+	},
+	goto: (url: string) => {
+		console.log("#debug#🚀 ~ file: Page.ts:30 ~ goto url:", url);
+		uni.navigateTo({
+			url
+		});
+	},
+	relauch(url: string) {
+		uni.reLaunch({
+			url
+		});
+	},
+	redirect(url: string) {
+		uni.redirectTo({ url });
+	},
+	isLogin() {
+		let token = ycxxkj.YcStorage.get("token");
+		if (token) {
+			return true;
+		}
+		return false;
+	},
+	onPageScroll(e: any) {
+		const store = useScrollStore();
+		// console.log("onPageScroll:e", e, store);
+		store.setTop(e.scrollTop);
+		let pages = getCurrentPages();
+		let curPage = pages[pages.length - 1];
+		curPage.$vm.scrollTop = e.scrollTop;
+		// console.log("curPage.$vm.scrollTop", curPage.$vm, curPage.$vm.scrollTop);
+	},
+	test() {
+		console.log("onLoad yc is", ycxxkj);
+	},
+	showVal(val: any, def: string | number = "-", suffix: string = ""): string | number | any {
+		if (!val && val !== 0 && val !== "0") {
+			return def;
+		}
+		return val + suffix;
+	},
+	/**
+	 * 格式化金额 ,由分转为元,并保留2位小数
+	 * @param val
+	 * @returns
+	 */
+	priceFormat(val: string | number) {
+		let price = Number(val);
+		if (isNaN(price)) {
+			price = 0;
+		}
+		return (price / 100).toFixed(2);
+	},
+	deviceHelper,
+	...ycxxkj
+	// ...UniHelper
+};
+console.log("#debug#🚀 ~ file: Page.ts:81 ~ Page.url:", Page.url);
+console.log("#debug#🚀 ~ file: Page.ts:81 ~ Page.url:", Page.url);
+console.log("#debug#🚀 ~ file: Page.ts:81 ~ Page.url:", Page.url);
+export default Page;

+ 237 - 0
game_test1/src/libs/utils/UniHelper.ts

@@ -0,0 +1,237 @@
+// import MapHelper from "./map_helper";
+import to from "await-to-js";
+const UniHelper = {
+	async login() {
+		return new Promise((resolve, reject) => {
+			uni.login({
+				provider: "weixin",
+				success: (res) => {
+					console.log(res.code);
+					resolve(res);
+				},
+				fail: (res) => {
+					reject(res);
+				}
+			});
+		});
+	},
+	//扫描
+	takePhoto() {
+		return new Promise((resolve, reject) => {
+			uni.scanCode({
+				scanType: ["qrcode"],
+				success: (res) => {
+					resolve(res.result);
+				}
+			});
+		});
+	},
+	copyText(data: string) {
+		return new Promise((resolve, reject) => {
+			uni.setClipboardData({
+				data: data,
+				success: function () {
+					console.log("success");
+					resolve(true);
+				}
+			});
+		});
+	},
+	previewImage(images: Array<string>, current = 0) {
+		console.log("previewImage", images);
+		uni.previewImage({
+			urls: images,
+			current: current,
+			longPressActions: {
+				itemList: ["发送给朋友", "保存图片", "收藏"],
+				success: function (data) {
+					console.log("选中了第" + (data.tapIndex + 1) + "个按钮,第" + (data.index + 1) + "张图片");
+				},
+				fail: function (err) {
+					console.log(err.errMsg);
+				}
+			}
+		});
+	},
+	///========消息=============
+	toast(title: string, duration = 2000, icon: any = "none") {
+		return new Promise((resolve, reject) => {
+			uni.showToast({
+				title: title,
+				duration: duration,
+				icon: icon,
+				success: function () {
+					resolve(true);
+				}
+			});
+		});
+	},
+	//隐藏键盘
+	hideKeyboard(timeout: number = 200) {
+		return new Promise(() => {
+			setTimeout(() => {
+				uni.hideKeyboard();
+			}, timeout);
+		});
+	},
+	/**
+	 * 加载中
+	 * @param {*} title
+	 */
+	loading(title: string = "加载中...") {
+		uni.showLoading({
+			title: title,
+			mask: true
+		});
+	},
+	/**
+	 *  隐藏 loading 提示框
+	 */
+	hideLoading() {
+		uni.hideLoading();
+	},
+	/**
+	 * 消息提示,有确认按钮
+	 * @param {*} msg
+	 */
+	alert(msg: string) {
+		return new Promise((resolve, reject) => {
+			uni.showModal({
+				content: msg,
+				showCancel: false,
+				success: function () {
+					resolve(true);
+				}
+			});
+		});
+	},
+	/**
+	 * 消息二次确认
+	 * @param {*} title
+	 * @param {*} content
+	 * @returns
+	 */
+	async confirm(title: string, content: string) {
+		return new Promise((resolve, reject) => {
+			uni.showModal({
+				title: title,
+				content: content,
+				success: function (res) {
+					if (res.confirm) {
+						console.log("用户点击确定");
+						resolve(true);
+					} else if (res.cancel) {
+						console.log("用户点击取消");
+						resolve(false);
+					}
+				}
+			});
+		});
+	},
+	/**
+	 * 带输入的确认框
+	 * @param title
+	 * @param content
+	 * @param placeholderText
+	 * @param confirmText
+	 * @returns
+	 */
+	async prompt(title: string, content: string = "", placeholderText: string = "", confirmText: string = "确定"): Promise<{ confirm: boolean; content: string | undefined }> {
+		return new Promise((resolve, reject) => {
+			console.log("prompt", {
+				title: title,
+				content,
+				confirmText,
+				editable: true,
+				placeholderText
+			});
+			uni.showModal({
+				title: title,
+				content,
+				confirmText,
+				editable: true,
+				placeholderText,
+				success: function (res) {
+					if (res.confirm) {
+						resolve({ confirm: true, content: res.content });
+					} else if (res.cancel) {
+						resolve({ confirm: false, content: res.content });
+					}
+				}
+			});
+		});
+	},
+
+	////////==========上传============//////////////////////////
+	/**
+	 * 选1张图片
+	 * @returns
+	 */
+	async simpleChooseImage() {
+		let [err, res]: [any, any] = await to(this.chooseImage(1));
+		console.log("simpleChooseImage", err, res);
+		return res.tempFilePaths[0];
+	},
+	/**
+	 * 选图片,改promise
+	 * @param {*} count
+	 * @param {*} sizeType
+	 * @param {*} sourceType
+	 * @returns
+	 */
+	chooseImage(count: number = 9, sizeType = ["compressed"], sourceType = ["album", "camera "]) {
+		return new Promise((resolve, reject) => {
+			uni.chooseImage({
+				count, //默认9
+				sizeType, //: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ["album"], //从相册选择
+				success: function (res) {
+					console.log(JSON.stringify(res.tempFilePaths));
+					resolve(res);
+				}
+			});
+		});
+	},
+	async scanCode(onlyFromCamera: boolean = false, scanType: string[] = ["qrCode", "barCode"]) {
+		return new Promise((resolve, reject) => {
+			uni.scanCode({
+				onlyFromCamera,
+				scanType,
+				success: function (res) {
+					resolve({ code: 0, ...res });
+				},
+				fail: function (res) {
+					reject({ code: 999, msg: res.errMsg, ...res });
+				}
+			});
+		});
+	}
+	/* getLocation(type = "gcj02") {
+        return new Promise((resolve, reject) => {
+            uni.getLocation({
+                geocode: true,
+                success: async function (res) {
+ 
+                    console.log("当前位置: res", res);
+                    console.log("当前位置的经度:" + res.longitude);
+                    console.log("当前位置的纬度:" + res.latitude);
+                    let res1 = MapHelper.wgs84togcj02(res.latitude, res.longitude);
+                    res.latitude = res1.lat;
+                    res.longitude = res1.lon;
+                    res.lat = res1.lat;
+                    res.lng = res1.lon;
+                    resolve(res);
+                    // uni.showModal({
+                    //     content: "当前位置的经度:" + res.longitude + "当前位置的纬度:" + res.latitude + "," + JSON.stringify(res1)
+                    // })
+ 
+                },
+                fail: function (res) {
+                    resolve(false);
+                }
+            });
+        });
+    } */
+};
+
+export default UniHelper;

+ 6 - 6
game_test1/src/pages.json

@@ -1,16 +1,16 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "uni-app"
-			}
+			"path": "pages/index/index"
+		},
+		{
+			"path": "pages/hilo/index"
 		}
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uni-app",
+		"navigationBarTitleText": "演示程序",
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8"
 	}
-}
+}

+ 28 - 0
game_test1/src/pages/hilo/index.vue

@@ -0,0 +1,28 @@
+<template>
+  <view class="page">
+   <view class="canvas_box">
+    <view class="tc p20">canvas演示</view>
+    <canvas canvas-id="canvasId" class="canvas" />
+   </view>
+  </view>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+const title = ref('Hello')
+</script>
+
+<style lang="scss" scoped>
+.page{
+    .canvas_box{
+        background-color: #f5f5ff;
+        height: 100vh;
+        .canvas{
+          width: 100%;
+          height: 500rpx;
+          background-color: #fff;
+        }
+    }
+}
+
+</style>

+ 3 - 30
game_test1/src/pages/index/index.vue

@@ -1,41 +1,14 @@
 <template>
   <view class="content">
-    <image class="logo" src="/static/logo.png" />
-    <view class="text-area">
-      <text class="title">{{ title }}</text>
-    </view>
+    <view class="p20 fs40 text_color_link" @click="Page.goto('/pages/hilo/index')">演示1</view>
   </view>
 </template>
 
 <script setup lang="ts">
 import { ref } from 'vue'
+import Page from "@/libs/pages/Page";
 const title = ref('Hello')
 </script>
 
-<style>
-.content {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.logo {
-  height: 200rpx;
-  width: 200rpx;
-  margin-top: 200rpx;
-  margin-left: auto;
-  margin-right: auto;
-  margin-bottom: 50rpx;
-}
-
-.text-area {
-  display: flex;
-  justify-content: center;
-}
-
-.title {
-  font-size: 36rpx;
-  color: #8f8f94;
-}
+<style lang="scss" scoped>
 </style>

+ 547 - 0
game_test1/src/static/style/common.scss

@@ -0,0 +1,547 @@
+//================common begin=================
+
+//颜色
+$u-color-border: #eee;
+$u-color-theme: #999;
+$u-color-warn: #f44;
+$u-color-bg: #eff4ff; //全站背景色
+$u-color-theme-light: #ccc;
+$u-color-theme-red: #f44;
+$u-type-primary: #007aff;
+$u-type-warning: #f0ad4e;
+$u-type-success: #00af51;
+$u-type-info: #5bc0de;
+$u-type-error: #dd524d;
+$u-main-color: #333;
+$u-color-content: #666;
+$u-tips-color: #999;
+$u-light-color: #ccc;
+$u-placeholder-color: #808080;
+$u-icon-color: #999;
+$u-selectd-color: #52AAFF;
+$u-color-link: #72A4E5;
+
+a:hover {
+    text-decoration: none;
+}
+
+//边框
+
+.bds {
+    border: solid 1rpx $u-color-border !important;
+
+}
+
+.bdd {
+    border: dashed 1rpx $u-color-border !important;
+}
+
+.bdd_t {
+    border-top: dashed 1rpx $u-color-border !important;
+}
+
+.bdd_l {
+    border-left: dashed 1rpx $u-color-border !important;
+}
+
+.bdd_r {
+    border-right: dashed 1rpx $u-color-border !important;
+}
+
+.bdd_t {
+    border-top: dashed 1rpx $u-color-border !important;
+}
+
+.bds_b {
+    border-bottom: solid 1rpx $u-color-border !important;
+}
+
+.bds_t {
+    border-top: solid 1rpx $u-color-border !important;
+}
+
+.bds_l {
+    border-left: solid 1rpx $u-color-border !important;
+}
+
+.bds_r {
+    border-right: solid 1rpx $u-color-border !important;
+}
+
+.bdd_b {
+    border-bottom: dashed 1rpx $u-color-border !important;
+}
+
+.bdn {
+    border: none !important;
+}
+
+.bdn_b {
+    border-bottom: none !important;
+}
+
+.bdn_t {
+    border-top: none !important;
+}
+
+.bdn_l {
+    border-left: none !important;
+}
+
+
+.main_bg {
+    background-color: #F7F7F7;
+}
+
+.cursor {
+    cursor: pointer;
+}
+
+.cursor_none {
+    cursor: default !important;
+}
+
+
+//浮动
+.fl {
+    float: left !important;
+}
+
+.fr {
+    float: right !important;
+}
+
+.clear_both {
+    clear: both;
+}
+
+
+
+.clearfix:after {
+    content: "\20";
+    display: block;
+    height: 0;
+    clear: both;
+}
+
+.ma0 {
+    margin: 0 auto !important;
+}
+
+//文字
+
+.tl {
+    text-align: left !important;
+}
+
+.tr {
+    text-align: right !important;
+}
+
+.tc {
+    text-align: center !important;
+}
+
+
+.fwb {
+    font-weight: bold;
+}
+
+
+
+//循环
+@for $i from 1 through 9 {
+    .fwb#{$i*100} {
+        font-weight: #{$i*100};
+    }
+}
+
+@for $i from 0 through 10 {
+    .opacity#{$i} {
+        opacity: calc($i / 10);
+    }
+}
+
+@for $i from 12 through 100 {
+    .fs#{$i} {
+        font-size: $i*1rpx !important;
+    }
+}
+
+@for $i from 12 through 100 {
+    .lh#{$i} {
+        line-height: $i*1rpx !important;
+    }
+}
+
+@for $i from 1 through 150 {
+    .h#{$i*10} {
+        height: #{$i*10}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .m#{$i*5} {
+        margin: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .mb#{$i*5} {
+        margin-bottom: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 80 {
+    .mt#{$i*5} {
+        margin-top: #{$i*5}rpx !important
+    }
+}
+
+@for $i from 0 through 40 {
+    .ml#{$i*5} {
+        margin-left: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .mr#{$i*5} {
+        margin-right: #{$i*5}rpx !important;
+    }
+}
+
+
+@for $i from 0 through 24 {
+    .p#{$i*5} {
+        padding: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .pl#{$i*5} {
+        padding-left: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .pr#{$i*5} {
+        padding-right: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .pb#{$i*5} {
+        padding-bottom: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 0 through 40 {
+    .pt#{$i*5} {
+        padding-top: #{$i*5}rpx !important;
+    }
+}
+
+@for $i from 1 through 100 {
+    .pct#{$i} {
+        width: $i*1% !important
+    }
+}
+
+@for $i from 0 through 80 {
+    .w#{$i*20} {
+        width: #{$i*20}rpx !important;
+    }
+}
+
+
+@for $i from 0 through 80 {
+    .border_radius_#{$i} {
+        border-radius: #{$i}rpx;
+    }
+}
+
+@for $i from 1 through 10 {
+    .nowrap#{$i} {
+        /* 超出部分隐藏 */
+        overflow: hidden;
+        /* 末尾加省略号 */
+        text-overflow: ellipsis;
+        display: -webkit-box;
+        word-break: break-all;
+        -webkit-box-orient: vertical;
+        /* 行数,也可以设为1,用来做单行 */
+        -webkit-line-clamp:#{$i}; //在第几行加省略号
+    }
+}
+
+@for $i from 0 through 100 {
+    .zindex#{$i*1} {
+        z-index: #{$i*1} !important;
+    }
+}
+
+//字体省略nowrap
+.nowrap {
+    overflow: hidden;
+    -o-text-overflow: ellipsis;
+    /*兼容opera*/
+    text-overflow: ellipsis;
+    /*这就是省略号喽*/
+    overflow: hidden;
+    /*设置超过的隐藏*/
+    white-space: nowrap;
+    /*设置不折行*/
+}
+
+
+
+//定位
+.pos_r {
+    position: relative;
+}
+
+.pos_a {
+    position: absolute;
+}
+
+.pos_f {
+    position: fixed;
+}
+
+.pos_s {
+    position: sticky;
+    top: 0
+}
+
+
+
+//圆角
+.border_radius_s {
+    border-radius: 10rpx;
+}
+
+.border_radius_m {
+    border-radius: 20rpx;
+}
+
+.border_radius_l {
+    border-radius: 40rpx;
+}
+
+//空白
+.blank_xxs {
+    height: 12rpx;
+}
+
+.blank_xs {
+    height: 24rpx;
+}
+
+.blank_s {
+    height: 32rpx;
+}
+
+.blank_m {
+    height: 48rpx;
+}
+
+.blank_l {
+    height: 60rpx;
+}
+
+.blank_xl {
+    height: 72rpx;
+}
+
+.blank_xxl {
+    height: 84rpx;
+}
+
+.black_index {
+    height: 140rpx;
+}
+
+.blank_tabbar {
+    height: 220rpx;
+}
+
+//字体颜色
+.text_color_theme {
+    color: $u-color-theme;
+}
+
+.text_color_theme_warn {
+    color: $u-color-warn;
+}
+
+.text_color_theme_light {
+    color: $u-color-theme-light;
+}
+
+.text_color_theme_red {
+    color: $u-color-theme-red;
+}
+
+.text_color_primary {
+    color: $u-type-primary;
+}
+
+.text_color_warning {
+    color: $u-type-warning;
+}
+
+.text_color_success {
+    color: $u-type-success;
+}
+
+.text_color_info {
+    color: $u-type-info;
+}
+
+.text_color_error {
+    color: $u-type-error;
+}
+
+.text_color_link {
+    color: $u-color-link;
+}
+
+.text_color_main {
+    color: $u-main-color;
+}
+
+.text_color_content {
+    color: $u-color-content;
+}
+
+.text_color_tips {
+    color: $u-tips-color;
+}
+
+.text_color_light {
+    color: $u-light-color;
+}
+
+.text_color_placeholder {
+    color: $u-placeholder-color;
+}
+
+.text_color_white {
+    color: #fff;
+}
+
+.text_color_icon {
+    color: $u-icon-color;
+}
+
+.text_color_selected {
+    color: $u-selectd-color;
+}
+
+//盒子
+.dis_blk {
+    display: block !important;
+}
+
+.dis_none {
+    display: none !important;
+}
+
+.dis_inline {
+    display: inline !important;
+}
+
+.dis_inb {
+    display: inline-block !important;
+}
+
+.dis_flex {
+    display: flex !important;
+}
+
+.dis_flex_align_center {
+    display: flex;
+    align-items: center;
+}
+
+.dis_flex_align_right_center {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+}
+
+.dis_flex_align_between_center {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+
+.dis_flex_align_around_center {
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+}
+
+.dis_flex_align_content_center {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.dis_flex_align_content_evenly {
+
+    display: flex;
+    align-items: center;
+    justify-content: space-evenly;
+}
+
+.dis_flex_align_center_flex_w {
+    display: flex;
+    flex-wrap: wrap;
+    align-items: center;
+}
+
+.bg_main {
+    background-color: $u-color-bg;
+}
+
+.bg_primary {
+    background-color: $u-type-primary;
+}
+
+.bg_warning {
+    background-color: $u-type-warning;
+}
+
+.bg_error {
+    background-color: $u-type-error;
+}
+
+.bg_success {
+    background-color: $u-type-success;
+}
+
+.bg_f3 {
+    background-color: #f3f3f3;
+}
+
+//背景色
+.bg_f5 {
+    background: #F5F5F5;
+}
+
+.bg_f7 {
+    background: #f7f7f7;
+}
+
+.bg_ff {
+    background: #fff;
+}
+
+.bg_none {
+    background: none;
+}
+
+.bg_light {
+    background-color: #f7fafe;
+}

+ 43 - 0
game_test1/src/static/style/iconfont.css

@@ -0,0 +1,43 @@
+@font-face {
+  font-family: "jc-iconfont"; /* Project id 4207988 */
+  src: url('//at.alicdn.com/t/c/font_4207988_5uc8r9kquhs.woff2?t=1692120508306') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4207988_5uc8r9kquhs.woff?t=1692120508306') format('woff'),
+       url('//at.alicdn.com/t/c/font_4207988_5uc8r9kquhs.ttf?t=1692120508306') format('truetype');
+}
+
+.jc-iconfont {
+  font-family: "jc-iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.jc-icon-zhifubaozhifu:before {
+  content: "\e634";
+}
+
+.jc-icon-zhifupingtai-yinlian:before {
+  content: "\e614";
+}
+
+.jc-icon-weixinzhifu:before {
+  content: "\e607";
+}
+
+.jc-icon-yinxingqia002:before {
+  content: "\e62e";
+}
+
+.jc-icon-xiangqing1:before {
+  content: "\ea07";
+}
+
+.jc-icon-yinhangqia:before {
+  content: "\e680";
+}
+
+.jc-icon-24gf-fileText:before {
+  content: "\eac4";
+}
+

+ 176 - 0
game_test1/src/static/style/main.scss

@@ -0,0 +1,176 @@
+view,
+text {
+    word-wrap: break-word;
+    word-break: break-all;
+}
+
+page {
+    background-color: #F3F3F3;
+}
+
+.login_bg {
+    position: absolute;
+    left: 0;
+    width: 100%;
+    top: 0;
+    z-index: 0;
+
+    .bgimg {
+        width: 750rpx;
+        height: 100vh;
+    }
+}
+
+.pageimg {
+    width: 100%;
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: -2;
+    opacity: 0.8;
+}
+
+$pageWidth: 690rpx;
+// $pageWidth: 600rpx;
+
+//标准宽度
+.page_width {
+    width: $pageWidth;
+}
+
+//顶部图片
+.header_bg {
+    display: block;
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 750rpx;
+    z-index: 0;
+}
+
+//卡片
+.card_box {
+    width: $pageWidth;
+    background: #FFFFFF;
+    box-shadow: 0px 3rpx 18rpx 0px rgba(0, 71, 147, 0.09);
+    border-radius: 12rpx;
+    margin: 0 auto;
+    padding: 24rpx 36rpx;
+
+    .title {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+
+        .left {
+            display: flex;
+            align-items: center;
+
+            .title_icon {
+                width: 9rpx;
+                height: 26rpx;
+                background: #f98f30;
+                border-radius: 5rpx;
+                color: #f98f30;
+                overflow: hidden;
+            }
+        }
+
+
+    }
+
+}
+
+.dot {
+    width: 18rpx;
+    height: 18rpx;
+    display: inline-block;
+    border-radius: 50%;
+    margin-right: 10rpx;
+
+
+}
+
+.dot_primary {
+    background: #4D98F4;
+    border: 4rpx solid rgba(77, 152, 244, 0.15);
+    box-shadow:
+        0 0 0 1px #a0cfff,
+        0 0 0 3px #ecf5ff,
+        0 0 2px 3px rgba(77, 152, 244, 0.15);
+}
+
+.dot_error {
+    background: #F33535;
+    border: 4rpx solid rgba(243, 53, 53, 0.15);
+    box-shadow:
+        0 0 0 1px #fab6b6,
+        0 0 0 3px #fef0f0,
+        0 0 2px 3px rgba(#fa3534, 0.15);
+
+}
+
+.dot_warning {
+    background: #F5A629;
+    border: 4rpx solid rgba(240, 155, 45, 0.15);
+    box-shadow:
+        0 0 0 1px #fcbd71,
+        0 0 0 3px #fdf6ec,
+        0 0 2px 3px rgba(240, 155, 45, 0.15);
+}
+
+.dot_success {
+    background: #0CB986;
+    border: 4px solid rgba(12, 185, 134, 0.15);
+    box-shadow:
+        0 0 0 1px #71d5a1,
+        0 0 0 3px #dbf1e1,
+        0 0 2px 3px rgba(12, 185, 134, 0.15);
+}
+
+.out_box {
+    //外围盒子
+    background: #f1f7ff;
+    // background: #000;
+    border-radius: 20rpx 20rpx 0rpx 0rpx;
+    display: block;
+    padding: 20rpx;
+    min-height: calc(100vh - 400rpx);
+}
+
+.bg_theme {
+    background: $uni-color-primary;
+}
+
+.bg_main2 {
+    background: #f1f7ff;
+}
+
+.fixed_bottom {
+    width: 100%;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    z-index: 2;
+}
+
+//表格
+.table_box {
+    .u-tr {
+        &:nth-child(2n) {
+            background: #f6fafe;
+        }
+
+        ::v-deep .u-th {
+            background: #edf4fe;
+            color: #4d98f4;
+            line-height: 40rpx;
+            font-size: 24rpx;
+        }
+
+        :v-deep .u-td {
+            font-size: 20rpx;
+            padding: 20rpx 0;
+        }
+    }
+}

+ 13 - 0
game_test1/src/stores/counter.ts

@@ -0,0 +1,13 @@
+import { defineStore } from "pinia";
+
+export const counterStore = defineStore("counter", {
+	state: () => ({
+		count: 0
+	}),
+	getters: {},
+	actions: {
+		increment() {
+			this.count++;
+		}
+	}
+});

+ 14 - 0
game_test1/src/stores/scroll.ts

@@ -0,0 +1,14 @@
+import { defineStore } from "pinia";
+
+export const useScrollStore = defineStore("scroll", {
+	state: () => {
+		return { top: 0 };
+	},
+	// 也可以这样定义
+	// state: () => ({ count: 0 })
+	actions: {
+		setTop(top: number) {
+			this.top = top;
+		}
+	}
+});