diff --git a/manifest.json b/manifest.json index 8e0d5b3..ceea22a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "卡叔电梯", + "name" : "智能电梯图纸生成", "appid" : "__UNI__3A16C1C", "description" : "", "versionName" : "1.0.0", diff --git a/pages.json b/pages.json index fbd2336..994afcd 100644 --- a/pages.json +++ b/pages.json @@ -16,19 +16,21 @@ "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { - "path": "pages/login/login", + "path": "pages/index/index", + "needLogin": true, "style": { - "navigationBarTitleText": "登录" + "navigationBarTitleText": "电梯图纸生成平台" } }, { - "path": "pages/index/index", + "path": "pages/login/login", "style": { - "navigationBarTitleText": "电梯图纸生成平台" + "navigationBarTitleText": "登录" } }, { "path" : "pages/order/order", + "needLogin": true, "style" : { "navigationBarTitleText" : "订单" @@ -36,6 +38,7 @@ }, { "path" : "pages/consumption/consumption", + "needLogin": true, "style" : { "navigationBarTitleText" : "消费" @@ -43,11 +46,19 @@ }, { "path" : "pages/mine/mine", + "needLogin": true, "style" : { "navigationBarTitleText" : "我的" } - } + }, + { + "path": "pages/404/404", + "style": { + "navigationBarTitleText": "404", + "navigationStyle": "custom" + } + } ], "subPackages": [ { @@ -57,8 +68,7 @@ "path" : "user-agreement/user-agreement", "style" : { - "navigationBarTitleText" : "用户协议", - "navigationStyle": "custom" + "navigationBarTitleText" : "用户协议" } }, { diff --git a/pages/404/404.vue b/pages/404/404.vue new file mode 100644 index 0000000..44d9656 --- /dev/null +++ b/pages/404/404.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index defb7d7..1050be1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -61,52 +61,93 @@ 设置参数 - - - - - - - - - - - - - - - - - - - - - - - - - - - -
备注说明
- -
-
-
- + + + + + + + + + + + + + + + + + + + + + +
备注说明
+ +
+
+
- - - + + + @@ -122,11 +163,12 @@ import { } from "@dcloudio/uni-app"; import { useAuthStore, useUserStore } from "@/store"; import RPC from "@/utils/request"; +import { usePermission } from "@/hooks/usePermission"; const authStore = useAuthStore(); -const userStore = useUserStore(); - -const generating = ref(false) +const userStore = useUserStore(); + +const generating = ref(false); // 响应式数据 const selectedTemplate = ref("passenger"); @@ -134,26 +176,25 @@ const selectedTemplate = ref("passenger"); // 选择模板 const selectTemplate = (template) => { selectedTemplate.value = template; -}; - -const form = ref(null) - const formField = ref({ - phone: '', - password: '', - }) - const rules = ref({ - // 'phone': { - // required: true, - // message: '请填写手机号', - // trigger: ['blur', 'change'] - // }, - // 'password': { - // required: true, - // message: '请填写验证码', - // trigger: ['blur', 'change'] - // } - }) +}; +const form = ref(null); +const formField = ref({ + phone: "", + password: "", +}); +const rules = ref({ + // 'phone': { + // required: true, + // message: '请填写手机号', + // trigger: ['blur', 'change'] + // }, + // 'password': { + // required: true, + // message: '请填写验证码', + // trigger: ['blur', 'change'] + // } +}); // 生成图纸 const generateDrawing = async () => { @@ -167,9 +208,7 @@ const generateDrawing = async () => { generating.value = true; try { - const params = { - - }; + const params = {}; // 这里调用生成图纸的API // const result = await RPC.post('/api/generate-drawing', params) @@ -199,8 +238,8 @@ const generateDrawing = async () => { }; // 查看历史记录 -const viewHistory = () => { - console.log(111) +const viewHistory = () => { + console.log(111); uni.navigateTo({ url: "/pagesA/generate-record/generate-record", }); @@ -227,6 +266,16 @@ onShareTimeline((data) => { onLoad(() => { console.log("index-onLoad"); }); + onShow(async () => { + console.log("test page onShow"); + const hasPermission = await usePermission(); + console.log(hasPermission ? "已登录" : "跳转登录"); + // 以下开始写业务逻辑... + if(!hasPermission) { + authStore.signOut(); + uni.$uv.route("/pages/login/login"); + } + }); + + - - \ No newline at end of file diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index def8f51..35c8408 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -116,7 +116,7 @@ > @@ -532,6 +532,10 @@ onShow(() => { font-size: 14px; background: linear-gradient(180deg, #7b9cdb 0%, #f8f8f8 40%); padding-bottom: 120px; + + /* #ifdef H5 */ + padding-bottom: 170px; /* H5环境下需要更多空间 (底部按钮高度 + tabBar高度 + 间距) */ + /* #endif */ } .header { @@ -734,6 +738,10 @@ onShow(() => { padding: 16px; border-top: 1px solid #e5e5e5; + /* #ifdef H5 */ + bottom: 50px; /* H5环境下给tabBar留出空间 */ + /* #endif */ + .agreement { text-align: center; font-size: 12px; diff --git a/pagesA/recharge/recharge.vue b/pagesA/recharge/recharge.vue index f661d80..b17db8e 100644 --- a/pagesA/recharge/recharge.vue +++ b/pagesA/recharge/recharge.vue @@ -78,7 +78,7 @@ @click="selectPayment('alipay')" > - + 支付宝 便民生活,轻松支付 diff --git a/pagesA/user-agreement/user-agreement.vue b/pagesA/user-agreement/user-agreement.vue index 4f911cb..87f6dbe 100644 --- a/pagesA/user-agreement/user-agreement.vue +++ b/pagesA/user-agreement/user-agreement.vue @@ -1,6 +1,5 @@