|
@@ -1,10 +1,49 @@
|
|
|
<script setup lang="ts">
|
|
|
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
|
|
|
-
|
|
|
+import { useMemberStore } from "@/stores";
|
|
|
+import { appId } from "@/utils/http";
|
|
|
// onLaunch((options) => {
|
|
|
// console.log(decodeURIComponent(options?.query.scene));
|
|
|
// console.log("App Launch");
|
|
|
// });
|
|
|
+const userInfo = useMemberStore();
|
|
|
+// userInfo.userInfo.openId;
|
|
|
+onLaunch(() => {
|
|
|
+ userInfo.userInfo.openId;
|
|
|
+ //进入到页面的时候查看解析页面路径查看页面路径中是含有code
|
|
|
+ //如果含有code 则根据code 获取openid
|
|
|
+ //如果没有 则访问微信路径,然后重定向到我们的页面
|
|
|
+ //然后根据返回的信息有没有手机号,如果没有则调用手机号登录界面
|
|
|
+ //接下来调试---调用扫描接口看看sdk可以用吗
|
|
|
+});
|
|
|
+//判断是否有opend的接口
|
|
|
+const judgeOpenId = (openId: string) => {
|
|
|
+ if (!openId) {
|
|
|
+ //假如不存在的话
|
|
|
+ //则跳转到获取code的接口
|
|
|
+ }
|
|
|
+};
|
|
|
+//判断code是否存在
|
|
|
+const judgeCode = () => {
|
|
|
+ let localUrl = encodeURIComponent(window.location.href);
|
|
|
+ let code = getCode();
|
|
|
+};
|
|
|
+
|
|
|
+//获取code
|
|
|
+const getCode = () => {
|
|
|
+ let code = "";
|
|
|
+ let url = window.location.search;
|
|
|
+ if (url.indexOf("?") !== -1) {
|
|
|
+ var strings = url.substring(1).split("&");
|
|
|
+ for (var i in strings) {
|
|
|
+ if (strings[i].indexOf("code") === 0) {
|
|
|
+ code = strings[i].split("=")[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return code;
|
|
|
+};
|
|
|
+
|
|
|
onShow(() => {
|
|
|
console.log("App Show");
|
|
|
//调用 版本更新
|
|
@@ -12,56 +51,56 @@ onShow(() => {
|
|
|
onHide(() => {
|
|
|
console.log("App Hide");
|
|
|
});
|
|
|
-const autoUpdate = () => {
|
|
|
- if (uni.canIUse("getUpdateManager")) {
|
|
|
- const updateManager = uni.getUpdateManager();
|
|
|
- updateManager.onCheckForUpdate(function (res) {
|
|
|
- if (res.hasUpdate) {
|
|
|
- updateManager.onUpdateReady(function () {
|
|
|
- uni.showModal({
|
|
|
- title: "更新提示",
|
|
|
- content: "新版本已经准备好,是否重启应用?",
|
|
|
- showCancel: false,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- updateManager.applyUpdate();
|
|
|
- } else if (res.cancel) {
|
|
|
- uni.showModal({
|
|
|
- title: "温馨提示~",
|
|
|
- content: "本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~",
|
|
|
- success: function (res) {
|
|
|
- // autoUpdate();
|
|
|
- // return;
|
|
|
- //第二次提示后,强制更新
|
|
|
- if (res.confirm) {
|
|
|
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
- updateManager.applyUpdate();
|
|
|
- } else if (res.cancel) {
|
|
|
- //重新回到版本更新提示
|
|
|
- autoUpdate();
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- updateManager.onUpdateFailed(function () {
|
|
|
- // 新的版本下载失败
|
|
|
- uni.showModal({
|
|
|
- title: "已经有新版本了哟~",
|
|
|
- content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~",
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showModal({
|
|
|
- title: "提示",
|
|
|
- content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。",
|
|
|
- });
|
|
|
- }
|
|
|
-};
|
|
|
+// const autoUpdate = () => {
|
|
|
+// if (uni.canIUse("getUpdateManager")) {
|
|
|
+// const updateManager = uni.getUpdateManager();
|
|
|
+// updateManager.onCheckForUpdate(function (res) {
|
|
|
+// if (res.hasUpdate) {
|
|
|
+// updateManager.onUpdateReady(function () {
|
|
|
+// uni.showModal({
|
|
|
+// title: "更新提示",
|
|
|
+// content: "新版本已经准备好,是否重启应用?",
|
|
|
+// showCancel: false,
|
|
|
+// success: function (res) {
|
|
|
+// if (res.confirm) {
|
|
|
+// updateManager.applyUpdate();
|
|
|
+// } else if (res.cancel) {
|
|
|
+// uni.showModal({
|
|
|
+// title: "温馨提示~",
|
|
|
+// content: "本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~",
|
|
|
+// success: function (res) {
|
|
|
+// // autoUpdate();
|
|
|
+// // return;
|
|
|
+// //第二次提示后,强制更新
|
|
|
+// if (res.confirm) {
|
|
|
+// // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
+// updateManager.applyUpdate();
|
|
|
+// } else if (res.cancel) {
|
|
|
+// //重新回到版本更新提示
|
|
|
+// autoUpdate();
|
|
|
+// }
|
|
|
+// },
|
|
|
+// });
|
|
|
+// }
|
|
|
+// },
|
|
|
+// });
|
|
|
+// updateManager.onUpdateFailed(function () {
|
|
|
+// // 新的版本下载失败
|
|
|
+// uni.showModal({
|
|
|
+// title: "已经有新版本了哟~",
|
|
|
+// content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~",
|
|
|
+// });
|
|
|
+// });
|
|
|
+// });
|
|
|
+// }
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// uni.showModal({
|
|
|
+// title: "提示",
|
|
|
+// content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。",
|
|
|
+// });
|
|
|
+// }
|
|
|
+// };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -74,7 +113,9 @@ input,
|
|
|
scroll-view {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
-
|
|
|
+uni-page-head {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
button::after {
|
|
|
border: none;
|
|
|
}
|