Lufaneng 11 months ago
parent 384dede6ad
commit 265bda45d6

@ -1,5 +1,5 @@
{ {
"name" : "卡叔电梯", "name" : "智能电梯图纸生成",
"appid" : "__UNI__3A16C1C", "appid" : "__UNI__3A16C1C",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",

@ -16,19 +16,21 @@
"pages": [ "pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/login/login", "path": "pages/index/index",
"needLogin": true,
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "电梯图纸生成平台"
} }
}, },
{ {
"path": "pages/index/index", "path": "pages/login/login",
"style": { "style": {
"navigationBarTitleText": "电梯图纸生成平台" "navigationBarTitleText": "登录"
} }
}, },
{ {
"path" : "pages/order/order", "path" : "pages/order/order",
"needLogin": true,
"style" : "style" :
{ {
"navigationBarTitleText" : "订单" "navigationBarTitleText" : "订单"
@ -36,6 +38,7 @@
}, },
{ {
"path" : "pages/consumption/consumption", "path" : "pages/consumption/consumption",
"needLogin": true,
"style" : "style" :
{ {
"navigationBarTitleText" : "消费" "navigationBarTitleText" : "消费"
@ -43,11 +46,19 @@
}, },
{ {
"path" : "pages/mine/mine", "path" : "pages/mine/mine",
"needLogin": true,
"style" : "style" :
{ {
"navigationBarTitleText" : "我的" "navigationBarTitleText" : "我的"
} }
} },
{
"path": "pages/404/404",
"style": {
"navigationBarTitleText": "404",
"navigationStyle": "custom"
}
}
], ],
"subPackages": [ "subPackages": [
{ {
@ -57,8 +68,7 @@
"path" : "user-agreement/user-agreement", "path" : "user-agreement/user-agreement",
"style" : "style" :
{ {
"navigationBarTitleText" : "用户协议", "navigationBarTitleText" : "用户协议"
"navigationStyle": "custom"
} }
}, },
{ {

@ -0,0 +1,35 @@
<template>
<div class="not-found">
<uv-navbar leftIconSize="40rpx" @leftClick="handleBack"></uv-navbar>
<uv-empty
mode="page"
textSize="20"
text="Page Not Found"
icon="/static/404.png"
width="380"
height="380"
></uv-empty>
</div>
</template>
<script setup>
import { HOME_PATH, isTabBarPath } from "@/router";
function handleBack() {
uni.$uv.route({
type: isTabBarPath(HOME_PATH) ? "switchTab" : "redirectTo",
url: HOME_PATH,
});
}
</script>
<style lang="scss" scoped>
.not-found {
height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
</style>

@ -61,52 +61,93 @@
<!-- 设置参数 --> <!-- 设置参数 -->
<view class="section"> <view class="section">
<view class="section-title">设置参数</view> <view class="section-title">设置参数</view>
<view class="form"> <view class="form">
<uv-form labelAlign="left" labelWidth="auto" labelPosition="left" :model="formField" :rules="rules" <uv-form
ref="form"> labelAlign="left"
<uv-form-item prop="phone" label="电梯类型"> labelWidth="auto"
<uv-input v-model="formField.phone" color="#000" border="none" labelPosition="left"
:placeholderStyle="{color:'#666778'}" placeholder="请输入"> :model="formField"
</uv-input> :rules="rules"
</uv-form-item> ref="form"
<uv-form-item prop="password" label="载重kg"> >
<uv-input v-model="formField.password" color="#000" border="none" <uv-form-item prop="phone" label="电梯类型">
:placeholderStyle="{color:'#666778'}" placeholder="请输入"> <uv-input
</uv-input> v-model="formField.phone"
</uv-form-item> color="#000"
<uv-form-item prop="password" label="井道宽度mm"> border="none"
<uv-input type="digit" v-model="formField.password" color="#000" border="none" :placeholderStyle="{ color: '#666778' }"
:placeholderStyle="{color:'#666778'}" placeholder="请输入"> placeholder="请输入"
</uv-input> ></uv-input>
</uv-form-item> </uv-form-item>
<uv-form-item prop="password" label="井道深度mm"> <uv-form-item prop="password" label="载重kg">
<uv-input type="digit" v-model="formField.password" color="#000" border="none" <uv-input
:placeholderStyle="{color:'#666778'}" placeholder="请输入"> v-model="formField.password"
</uv-input> color="#000"
</uv-form-item> border="none"
<uv-form-item prop="password" label="顶层高度mm"> :placeholderStyle="{ color: '#666778' }"
<uv-input type="digit" v-model="formField.password" color="#000" border="none" placeholder="请输入"
:placeholderStyle="{color:'#666778'}" placeholder="请输入"> ></uv-input>
</uv-input> </uv-form-item>
</uv-form-item> <uv-form-item prop="password" label="井道宽度mm">
<uv-form-item prop="password" label="底坑深度mm"> <uv-input
<uv-input type="digit" v-model="formField.password" color="#000" border="none" type="digit"
:placeholderStyle="{color:'#666778'}" placeholder="请输入"> v-model="formField.password"
</uv-input> color="#000"
</uv-form-item> border="none"
<uv-form-item prop="password"> :placeholderStyle="{ color: '#666778' }"
<div style="margin-bottom: 4px;">备注说明</div> placeholder="请输入"
<uv-textarea v-model="formField.password" placeholder="请输入"></uv-textarea> ></uv-input>
</uv-form-item> </uv-form-item>
</uv-form> <uv-form-item prop="password" label="井道深度mm">
</view> <uv-input
type="digit"
v-model="formField.password"
color="#000"
border="none"
:placeholderStyle="{ color: '#666778' }"
placeholder="请输入"
></uv-input>
</uv-form-item>
<uv-form-item prop="password" label="顶层高度mm">
<uv-input
type="digit"
v-model="formField.password"
color="#000"
border="none"
:placeholderStyle="{ color: '#666778' }"
placeholder="请输入"
></uv-input>
</uv-form-item>
<uv-form-item prop="password" label="底坑深度mm">
<uv-input
type="digit"
v-model="formField.password"
color="#000"
border="none"
:placeholderStyle="{ color: '#666778' }"
placeholder="请输入"
></uv-input>
</uv-form-item>
<uv-form-item prop="password">
<div style="margin-bottom: 4px">备注说明</div>
<uv-textarea
v-model="formField.password"
placeholder="请输入"
></uv-textarea>
</uv-form-item>
</uv-form>
</view>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="bottom-actions"> <view class="bottom-actions">
<uv-button :loading="generating" @click="viewHistory" text="生成图纸" color="#3F70FF"></uv-button> <uv-button
<uv-button @click="viewHistory" text="查看记录"></uv-button> :loading="generating"
@click="viewHistory"
text="生成图纸"
color="#3F70FF"
></uv-button>
<uv-button @click="viewHistory" text="查看记录"></uv-button>
</view> </view>
</view> </view>
</template> </template>
@ -122,11 +163,12 @@ import {
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
import { useAuthStore, useUserStore } from "@/store"; import { useAuthStore, useUserStore } from "@/store";
import RPC from "@/utils/request"; import RPC from "@/utils/request";
import { usePermission } from "@/hooks/usePermission";
const authStore = useAuthStore(); const authStore = useAuthStore();
const userStore = useUserStore(); const userStore = useUserStore();
const generating = ref(false) const generating = ref(false);
// //
const selectedTemplate = ref("passenger"); const selectedTemplate = ref("passenger");
@ -134,26 +176,25 @@ const selectedTemplate = ref("passenger");
// //
const selectTemplate = (template) => { const selectTemplate = (template) => {
selectedTemplate.value = 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 () => { const generateDrawing = async () => {
@ -167,9 +208,7 @@ const generateDrawing = async () => {
generating.value = true; generating.value = true;
try { try {
const params = { const params = {};
};
// API // API
// const result = await RPC.post('/api/generate-drawing', params) // const result = await RPC.post('/api/generate-drawing', params)
@ -199,8 +238,8 @@ const generateDrawing = async () => {
}; };
// //
const viewHistory = () => { const viewHistory = () => {
console.log(111) console.log(111);
uni.navigateTo({ uni.navigateTo({
url: "/pagesA/generate-record/generate-record", url: "/pagesA/generate-record/generate-record",
}); });
@ -227,6 +266,16 @@ onShareTimeline((data) => {
onLoad(() => { onLoad(() => {
console.log("index-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");
}
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -235,6 +284,10 @@ onLoad(() => {
min-height: 100vh; min-height: 100vh;
background-color: #f8f8f8; background-color: #f8f8f8;
padding-bottom: 52px; padding-bottom: 52px;
/* #ifdef H5 */
padding-bottom: 102px; /* H5环境下需要更多空间 (50px按钮 + 50px tabBar + 2px间距) */
/* #endif */
} }
.header-section { .header-section {
@ -252,16 +305,16 @@ onLoad(() => {
top: 50%; top: 50%;
right: 0; right: 0;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
color: white; color: white;
width:70%; width: 70%;
transform: translate(0, -50%); transform: translate(0, -50%);
padding:20px 10px; padding: 20px 10px;
.header-title { .header-title {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-bottom: 8px; margin-bottom: 8px;
color: #BD9E85 ; color: #bd9e85;
} }
.header-subtitle { .header-subtitle {
@ -282,8 +335,8 @@ onLoad(() => {
color: #333; color: #333;
margin-bottom: 16px; margin-bottom: 16px;
} }
} }
.template-grid { .template-grid {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
@ -315,28 +368,32 @@ onLoad(() => {
} }
} }
.bottom-actions { .bottom-actions {
z-index: 999; z-index: 999;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
background: #fff; background: #fff;
height: 50px; height: 50px;
border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
justify-content: space-between; justify-content: space-between;
padding: 0 16px; padding: 0 16px;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
/* #ifdef H5 */
bottom: 50px; /* H5环境下给tabBar留出空间 */
/* #endif */
}
</style>
<style lang="scss">
.bottom-actions {
.uv-button-wrapper {
width: 48%;
}
} }
</style>
<style lang="scss">
.bottom-actions {
.uv-button-wrapper {
width: 48%;
}
}
</style> </style>

@ -116,7 +116,7 @@
> >
<view class="payment-info"> <view class="payment-info">
<uv-icon <uv-icon
name="alipay-circle-fill" name="/static/imgs/alipay.png"
color="#1677ff" color="#1677ff"
size="24" size="24"
></uv-icon> ></uv-icon>
@ -532,6 +532,10 @@ onShow(() => {
font-size: 14px; font-size: 14px;
background: linear-gradient(180deg, #7b9cdb 0%, #f8f8f8 40%); background: linear-gradient(180deg, #7b9cdb 0%, #f8f8f8 40%);
padding-bottom: 120px; padding-bottom: 120px;
/* #ifdef H5 */
padding-bottom: 170px; /* H5环境下需要更多空间 (底部按钮高度 + tabBar高度 + 间距) */
/* #endif */
} }
.header { .header {
@ -734,6 +738,10 @@ onShow(() => {
padding: 16px; padding: 16px;
border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5;
/* #ifdef H5 */
bottom: 50px; /* H5环境下给tabBar留出空间 */
/* #endif */
.agreement { .agreement {
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;

@ -78,7 +78,7 @@
@click="selectPayment('alipay')" @click="selectPayment('alipay')"
> >
<view class="payment-info"> <view class="payment-info">
<uv-icon name="alipay-circle-fill" color="#1677ff" size="28"></uv-icon> <uv-icon name="/static/imgs/alipay.png" color="#1677ff" size="28"></uv-icon>
<view class="payment-details"> <view class="payment-details">
<view class="payment-name">支付宝</view> <view class="payment-name">支付宝</view>
<view class="payment-desc">便民生活轻松支付</view> <view class="payment-desc">便民生活轻松支付</view>

@ -1,6 +1,5 @@
<template> <template>
<view class="container"> <view class="container">
<HeaderCustom title="用户协议" :showBack="true"></HeaderCustom>
<div class="contentBox"> <div class="contentBox">
<div class="part"> <div class="part">
总则 总则

@ -21,7 +21,7 @@ routes.forEach((item) => {
* @returns * @returns
*/ */
export function hasPerm(path = "") { export function hasPerm(path = "") {
if (!isPathExists(path)) { if (!isPathExists(path) && path !== '/') {
uni.redirectTo({ uni.redirectTo({
url: ERROR404_PATH, url: ERROR404_PATH,
}); });
@ -34,7 +34,7 @@ export function hasPerm(path = "") {
if (!hasPermission) { if (!hasPermission) {
// 将用户的目标路径传递过去,这样可以实现用户登录之后,直接跳转到目标页面 // 将用户的目标路径传递过去,这样可以实现用户登录之后,直接跳转到目标页面
uni.redirectTo({ uni.redirectTo({
url: `/pages/index/index`, url: `${LOGIN_PATH}?redirect=${encodeURIComponent(path)}`,
}); });
} }
return hasPermission; return hasPermission;

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Loading…
Cancel
Save