Compare commits

..

No commits in common. '2f7ae6db7c3077bf7f88311f85ed4f3dbe789f8c' and '902623352d74da8f4a3b87cf63795bec13e3eb54' have entirely different histories.

@ -1,119 +0,0 @@
<template>
<view>
<!-- 悬浮按钮 -->
<view class="floating-btn" @click="openComplaintModal">
<view class="floating-text">服务协议与</view>
<view class="floating-text">隐私说明</view>
</view>
<!-- 客户投诉与纠纷处理机制弹窗 -->
<uv-modal
ref="complaintModalRef"
title="服务协议与隐私说明"
confirmText="我知道了"
@confirm="closeComplaintModal"
>
<scroll-view scroll-y class="complaint-content">
<view class="complaint-text">
<view class="p">为规范平台交易秩序保障用户合法权益结合我司图纸生成电子图纸设计方案等虚拟数字类产品的业务特性特建立完善的服务协议与隐私说明具体如下</view>
<view class="h3">业务及退款规则说明</view>
<view class="p">本平台为用户提供电梯相关工程图纸在线生成下载服务
用户登录后可自主选择对应套餐或单次计费方式使用服务
所有线上服务流程公开透明功能实时可用</view>
<view class="h3">售后退款规则 </view>
<view class="p">图纸已生成已下载属于虚拟数字化服务一经使用不支持退款
如遇系统故障功能异常无法正常使用可联系客服核实处理</view>
<view class="p">联系电话<text class="phone-link" @click="callService">13666500395</text></view>
<view class="h3">用户协议</view>
<view class="p">用户需合法合规使用本平台服务禁止违规违法用途
平台保留服务优化功能升级的权利
请勿恶意刷量违规操作违者将限制账号使用
付费服务以页面标注价格及规则为准自愿下单购买</view>
<view class="h3">隐私政策</view>
<view class="p">我们仅收集必要登录及业务填写信息用于正常提供服务
不会私自泄露出售外传用户个人信息及使用记录
仅用于平台内部业务使用保障用户信息安全</view>
</view>
</scroll-view>
</uv-modal>
</view>
</template>
<script setup>
import { ref } from 'vue';
const complaintModalRef = ref(null);
const openComplaintModal = () => {
complaintModalRef.value.open();
};
const closeComplaintModal = () => {
complaintModalRef.value.close();
};
const callService = () => {
uni.makePhoneCall({
phoneNumber: '13666500395'
});
};
</script>
<style lang="scss" scoped>
.floating-btn {
position: fixed;
right: 16px;
bottom: 120px;
/* #ifdef H5 */
bottom: 170px;
/* #endif */
width: 70px;
height: 70px;
background: linear-gradient(135deg, #3f70ff, #5c8aff);
border-radius: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: white;
box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
z-index: 999;
font-size: 12px;
.floating-text {
line-height: 1.2;
}
}
.complaint-content {
max-height: 60vh;
padding: 0 10px 10px;
.complaint-text {
font-size: 14px;
color: #333;
line-height: 1.6;
.h3 {
font-size: 15px;
font-weight: bold;
margin-top: 16px;
margin-bottom: 8px;
color: #111;
}
.p {
margin-bottom: 8px;
text-align: justify;
color: #666;
}
.phone-link {
color: #3f70ff;
text-decoration: underline;
display: inline-block;
padding: 0 4px;
}
}
}
</style>

@ -17,7 +17,7 @@
//pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"needLogin": false,
"needLogin": true,
"style": {
"navigationBarTitleText": "电梯图纸生成平台",
"enablePullDownRefresh":true
@ -131,14 +131,6 @@
"navigationBarTitleText" : "bug反馈",
"navigationStyle": "custom"
}
},
{
"path" : "template-apply/template-apply",
"style" :
{
"navigationBarTitleText" : "模版申请",
"enablePullDownRefresh":true
}
}
]
}

@ -60,8 +60,6 @@
</view>
<uv-load-more v-else :status="loadingStatus" />
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -80,7 +78,6 @@
useUserStore
} from "@/store";
import HeaderCustom from "/components/HeaderCustom/HeaderCustom.vue";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import RPC from "@/utils/request";
import dayjs from "dayjs";

@ -1,17 +1,5 @@
<template>
<view class="container" :class="{ 'logged-in': authStore.isLoggedIn }">
<!-- 服务价值展示 -->
<view class="service-intro">
<view class="intro-title">电梯图纸在线生成平台</view>
<view class="intro-subtitle">
专注电梯土建图电气原理图一键自动生成填写参数即可快速导出标准 PDF 图纸为工程设计现场施工提供高效出图服务登录即可使用完整出图功能
</view>
<view class="demo-btn" @click="viewDemo">
<text class="demo-icon">📄</text>
<text class="demo-text">查看演示图纸</text>
</view>
</view>
<view class="container">
<!-- 顶部图片和标题 -->
<view class="header-section">
<image
@ -30,22 +18,8 @@
<!-- 选择图纸模板 -->
<view class="section">
<view class="section-title">选择图纸模板</view>
<!-- 未登录提示 -->
<view v-if="!authStore.isLoggedIn" class="login-prompt">
<view class="prompt-icon">🔒</view>
<view class="prompt-text">请先登录以使用完整功能</view>
<uv-button
size="small"
@click="goToLogin"
text="立即登录"
color="#3F70FF"
customStyle="margin-top: 12px;"
></uv-button>
</view>
<uv-skeletons
v-else-if="loading"
v-if="loading"
:loading="loading"
:skeleton="[
{
@ -135,12 +109,14 @@
color="#000"
border="bottom"
:placeholderStyle="{ color: '#666778' }"
:placeholder="item.type === 'number' ? `范围:${item.min} - ${item.max === 0 ? '不限' : item.max}` : (item.name === '土建图号'
? '自动生成'
: '请输入')"
:placeholder="
item.name === '土建图号'
? '将根据土建图型号自动生成'
: '请输入'
"
></uv-input>
<!-- 数字范围提示 -->
<!-- <view
<view
v-if="
item.type === 'number' &&
(item.min !== undefined || item.max !== undefined)
@ -156,14 +132,14 @@
<text v-else-if="item.max !== undefined">
最大值{{ item.max }}
</text>
</view> -->
</view>
</uv-form-item>
</uv-form>
</view>
</view>
</view>
<view class="section" v-if="authStore.isLoggedIn && !has_access && template_id">
<view class="section" v-else>
<div class="status">
申请状态{{ get_access_status(currentTemplate.access_status) }}
</div>
@ -177,15 +153,14 @@
</view>
<!-- 底部按钮 -->
<view class="bottom-actions" v-if="authStore.isLoggedIn">
<view class="bottom-actions">
<uv-button
:loading="generating"
@click="modalRefOpen"
text="生成图纸"
color="#3F70FF"
></uv-button>
<uv-button @click="bugFeedback" text="bug反馈"></uv-button>
<uv-button @click="viewHistory" text="查看记录" color="#df9d5d"></uv-button>
<uv-button @click="viewHistory" text="查看记录"></uv-button>
</view>
<uv-modal
ref="modalRef"
@ -211,9 +186,6 @@
</view>
</uv-modal>
<uv-picker ref="picker" :columns="columns" @confirm="confirm"></uv-picker>
<!-- 投诉与纠纷悬浮按钮 -->
<ComplaintFooter />
</view>
</template>
@ -229,8 +201,7 @@ import {
} from "@dcloudio/uni-app";
import { useAuthStore, useUserStore } from "@/store";
import RPC from "@/utils/request";
import ComplaintFooter from "@/components/ComplaintFooter/ComplaintFooter.vue";
import dayjs from 'dayjs'
import { usePermission } from "@/hooks/usePermission";
const authStore = useAuthStore();
const userStore = useUserStore();
@ -242,21 +213,6 @@ const applyModalRef = ref(null);
const applyReason = ref("");
const applyLoading = ref(false);
//
const viewDemo = () => {
uni.previewImage({
urls: ['/static/imgs/demo.jpg'],
current: 0
});
};
//
const goToLogin = () => {
uni.navigateTo({
url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index/index')
});
};
// category
const groupedParams = computed(() => {
if (!currentTemplate.value.params) return {};
@ -293,12 +249,6 @@ const get_access_status = (access_status) => {
return str;
};
const bugFeedback = () => {
uni.navigateTo({
url: "/pagesA/bug-feedback/bug-feedback",
});
};
const modalRefOpen = () => {
if (!has_access.value) {
uni.showToast({
@ -341,11 +291,11 @@ const confirm = (val) => {
console.log(val);
currentParams.value.value = val.value[0];
//
// if (currentParams.value.name === "") {
// nextTick(() => {
// generateDrawingNumber();
// });
// }
if (currentParams.value.name === "土建图型号") {
nextTick(() => {
generateDrawingNumber();
});
}
};
//
@ -396,11 +346,11 @@ const cancelApply = () => {
//
const handleInputChange = (item) => {
//
// if (item.name === "") {
// nextTick(() => {
// generateDrawingNumber();
// });
// }
if (item.name === "土建图型号") {
nextTick(() => {
generateDrawingNumber();
});
}
};
//
@ -430,7 +380,7 @@ const validateNumberRange = (item) => {
}
//
if (item.max !== undefined && item.max !== 0 && value > item.max) {
if (item.max !== undefined && value > item.max) {
uni.showToast({
title: `${item.name}不能大于${item.max}`,
icon: "error",
@ -446,21 +396,21 @@ const generateDrawingNumber = () => {
if (!params) return;
//
// const modelParam = params.find((p) => p.name === "");
const modelParam = params.find((p) => p.name === "土建图型号");
const numberParam = params.find((p) => p.name === "土建图号");
if (!numberParam) return;
if (!modelParam || !numberParam || !modelParam.value) return;
//
// const now = new Date();
// const year = now.getFullYear().toString().slice(-2); //
// const month = (now.getMonth() + 1).toString().padStart(2, "0"); //
const now = new Date();
const year = now.getFullYear().toString().slice(-2); //
const month = (now.getMonth() + 1).toString().padStart(2, "0"); //
// 4+
const randomPart = generateRandomCode();
// GSE400-V25-10-0002A
numberParam.value = dayjs().format('YYYYMMDDHHmmss') + randomPart;
numberParam.value = `${modelParam.value}-V${year}${month}-${randomPart}`;
};
// 4+1
@ -470,7 +420,7 @@ const generateRandomCode = () => {
.padStart(4, "0");
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const letter = letters.charAt(Math.floor(Math.random() * letters.length));
return numbers;
return numbers + letter;
};
const generating = ref(false);
@ -520,7 +470,7 @@ const getList = () => {
limit: -1,
})
.then((res) => {
templateList.value = (res.rows || []).filter((item) => item.enabled && item.has_access);
templateList.value = (res.rows || []).filter((item) => item.enabled);
currentTemplate.value = templateList.value[0]
? JSON.parse(JSON.stringify(templateList.value[0]))
: {};
@ -530,7 +480,6 @@ const getList = () => {
RPC.post("/template/detail", { id: currentTemplate.value.id })
.then((res) => {
currentTemplate.value.params = res?.params;
generateDrawingNumber()
})
.finally(() => {
params_loading.value = false;
@ -608,28 +557,19 @@ onShareTimeline((data) => {
onLoad(() => {
console.log("index-onLoad");
});
onShow(() => {
onShow(async () => {
getList();
console.log("test page onShow");
// 使usePermission
const isLoggedIn = authStore.isLoggedIn;
console.log(isLoggedIn ? "已登录" : "未登录");
//
if (isLoggedIn) {
//
getList();
} else {
//
templateList.value = [];
currentTemplate.value = {};
const hasPermission = await usePermission();
console.log(hasPermission ? "已登录" : "跳转登录");
// ...
if (!hasPermission) {
authStore.signOut();
uni.$uv.route("/pages/login/login");
}
});
onPullDownRefresh(() => {
//
if (authStore.isLoggedIn) {
getList();
}
getList();
uni.stopPullDownRefresh();
});
</script>
@ -643,57 +583,8 @@ onPullDownRefresh(() => {
/* #ifdef H5 */
padding-bottom: 102px;
/* H5环境下需要更多空间 (50px按钮 + 50px tabBar + 2px间距) */
/* #endif */
&.logged-in {
padding-bottom: 102px;
/* #ifdef H5 */
padding-bottom: 152px;
/* #endif */
}
}
.service-intro {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 24px 20px;
color: white;
.intro-title {
font-size: 20px;
font-weight: bold;
margin-bottom: 12px;
text-align: center;
}
.intro-subtitle {
font-size: 13px;
line-height: 1.6;
margin-bottom: 16px;
opacity: 0.95;
text-align: justify;
}
.demo-btn {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 20px;
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(10px);
.demo-icon {
font-size: 18px;
margin-right: 8px;
}
.demo-text {
font-size: 14px;
font-weight: 500;
}
}
}
.header-section {
@ -745,22 +636,6 @@ onPullDownRefresh(() => {
.status {
margin-bottom: 20px;
}
.login-prompt {
text-align: center;
padding: 40px 20px;
.prompt-icon {
font-size: 48px;
margin-bottom: 12px;
}
.prompt-text {
font-size: 15px;
color: #666;
margin-bottom: 8px;
}
}
}
.template-grid {
@ -784,7 +659,7 @@ onPullDownRefresh(() => {
left: 0;
padding: 2px 8px;
border-radius: 0 0 10px 0;
font-size: 14px;
font-size: 10px;
color: white;
background: #00caef;
}
@ -811,6 +686,7 @@ onPullDownRefresh(() => {
.bottom-actions {
z-index: 999;
position: fixed;
bottom: 0;
left: 0;
background: #fff;
height: 50px;
@ -825,7 +701,7 @@ onPullDownRefresh(() => {
/* #ifdef H5 */
bottom: 50px;
/* H5环境下给底部和tabBar留出空间 */
/* H5环境下给tabBar留出空间 */
/* #endif */
}
@ -879,7 +755,7 @@ onPullDownRefresh(() => {
<style lang="scss">
.bottom-actions {
.uv-button-wrapper {
width: 30%;
width: 48%;
}
}
</style>

@ -89,9 +89,6 @@
href="weixin://dl/business/?appid=wxc504638e03981812&path=pages/login/login?from=h5ToWechat">
打开小程序并登录
</a> -->
<!-- 投诉与纠纷悬浮按钮 -->
<ComplaintFooter />
</view>
</template>
@ -154,8 +151,6 @@
const ToLoginRef = ref(null)
import ComplaintFooter from "@/components/ComplaintFooter/ComplaintFooter.vue";
const tips = ref("获取验证码");
const codeChange = (text) => {
tips.value = text;
@ -575,34 +570,22 @@
const login = async () => {
await form.value.validate();
console.log(userInfo.value);
if(userInfo.value.phone.startsWith('test-')) {
RPC.post('/login', {
username: userInfo.value.phone,
password: userInfo.value.password,
}, {
custom: {
loading: true,
loadingText: '正在登录...'
},
}).then(res => {
authStore.setAccessToken(res.token)
RPC.post('/user/info', {
token: res.token,
})
.then((res) => {
userStore.setUserInfo(res)
uni.$uv.route({
type: isTabBarPath(redirect || HOME_PATH) ? "switchTab" : "redirectTo",
url: redirect || HOME_PATH,
});
})
.finally(() => {
loading.value = false
})
})
return
}
// RPC.post('/account/login', {
// username: userInfo.value.name,
// password: userInfo.value.password,
// }, {
// custom: {
// loading: true,
// loadingText: '...'
// },
// }).then(res => {
// authStore.setAccessToken(res.token)
// userStore.setUserInfo(res)
// uni.$uv.route({
// type: isTabBarPath(redirect) ? "switchTab" : "redirectTo",
// url: redirect,
// });
// })
RPC.post('/login/phone', {
phone: userInfo.value.phone,
code: userInfo.value.password,

@ -76,7 +76,6 @@
<view class="tag" v-if="item.tags">{{ item.tags }}</view>
<view class="plan-name">{{ item.name }}</view>
<view class="plan-price">¥{{ item.price }}</view>
<view class="desc">{{ item.desc }}</view>
</view>
<!-- <view
class="membership-item"
@ -121,12 +120,6 @@
</view> -->
<!-- 用户协议 -->
<view class="profile-item" @click="templateApply">
<view class="item-label">模板申请</view>
<view class="item-content">
<uv-icon name="arrow-right" size="16" color="#ccc"></uv-icon>
</view>
</view>
<view class="profile-item" @click="viewUserAgreement">
<view class="item-label">用户协议</view>
<view class="item-content">
@ -147,12 +140,12 @@
<uv-icon name="arrow-right" size="16" color="#ccc"></uv-icon>
</view>
</view>
<!-- <view class="profile-item" @click="bugFeedback">
<view class="profile-item" @click="bugFeedback">
<view class="item-label">bug反馈</view>
<view class="item-content">
<uv-icon name="arrow-right" size="16" color="#ccc"></uv-icon>
</view>
</view> -->
</view>
<view class="profile-item" @click="logout">
<view class="item-label">退出登录</view>
<view class="item-content">
@ -170,9 +163,6 @@
退出登录
</uv-button>
</view> -->
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -180,7 +170,6 @@
import { ref, onMounted } from "vue";
import { onShow, onPullDownRefresh } from "@dcloudio/uni-app";
import HeaderCustom from "/components/HeaderCustom/HeaderCustom.vue";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import { useAuthStore, useUserStore } from "@/store";
import RPC from "@/utils/request";
import dayjs from "dayjs";
@ -216,11 +205,6 @@ const viewUserAgreement = () => {
url: "/pagesA/user-agreement/user-agreement",
});
};
const templateApply = () => {
uni.navigateTo({
url: "/pagesA/template-apply/template-apply",
});
};
//
const addRequirement = () => {
@ -358,10 +342,11 @@ const logout = () => {
font-size: 14px;
background: linear-gradient(180deg, #7b9cdb 0%, #f8f8f8 40%);
min-height: 100vh;
// padding-bottom: 120px;
/* #ifdef H5 */
padding-bottom: 50px;
/* H5环境下给tabBar留出空间 */
// padding-bottom: 170px;
/* H5环境下需要更多空间 (底部按钮高度 + tabBar高度 + 间距) */
/* #endif */
}
@ -478,7 +463,7 @@ const logout = () => {
flex-shrink: 0;
background: white;
border-radius: 12px;
padding: 12px 8px;
padding: 16px 12px;
text-align: center;
position: relative;
border: 2px solid transparent;
@ -504,25 +489,20 @@ const logout = () => {
.plan-name {
font-size: 14px;
color: #333;
margin: 12px 0 2px;
margin: 12px 0 8px;
}
.plan-price {
font-size: 20px;
font-weight: bold;
color: #ff3333;
margin-bottom: 2px;
margin-bottom: 4px;
}
.plan-discount {
font-size: 12px;
color: #999;
}
.desc {
color: #999;
font-size: 12px;
}
}
}
}

@ -105,9 +105,6 @@
<text class="empty-text">暂无订单记录</text>
</view>
<uv-load-more v-else :status="loadingStatus" />
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -126,7 +123,6 @@
useUserStore
} from "@/store";
import HeaderCustom from '/components/HeaderCustom/HeaderCustom.vue'
import ComplaintFooter from '/components/ComplaintFooter/ComplaintFooter.vue'
import RPC from "@/utils/request";
import dayjs from "dayjs";
@ -320,7 +316,7 @@
// #ifdef H5
// H5
const payUrl = orderInfo.h5_url; // H5
const payUrl = orderInfo.mwebUrl; // H5
window.location.href = payUrl;
return {
success: true,

@ -3,18 +3,17 @@
<!-- 生成记录列表 -->
<view class="record-list">
<uv-swipe-action>
<uv-swipe-action-item @click="index => controlItem(index,record)" :options="options"
v-for="record in list" :key="record.ID">
<uv-swipe-action-item @click="delItem(record)" :options="options" v-for="record in list"
:key="record.ID">
<view class="record-item">
<!-- 记录信息 -->
<view class="record-info">
<view class="record-title">{{ record.file_name || record.order_no || record.plannedNo }}
</view>
<view class="record-title">{{ record.file_name || record.order_no || record.plannedNo }}</view>
<view class="record-time">
生成时间:
{{
record.CreatedAt
? dayjs(record.CreatedAt).format("YYYY-MM-DD HH:mm:ss")
? dayjs(record.CreatedAt).format("YYYY-MM-DD")
: ""
}}
</view>
@ -24,11 +23,9 @@
<view class="status-tag" :class="{
completed: record.status == 4,
failed: record.status == 5,
waitting:record.status == 1
}">
<span v-if="record.status == 4"></span>
<span v-else-if="record.status == 5">生成失败</span>
<span v-else-if="record.status == 1">等待生成</span>
<span v-else></span>
</view>
@ -57,24 +54,6 @@
<!-- 加载更多 -->
<uv-load-more v-else :status="loadingStatus" @loadmore="loadmore" />
<!-- 参数展示弹窗 -->
<uv-modal ref="paramsModalRef" title="生成参数" :showCancelButton="false" confirmText="确定">
<view class="params-modal-content">
<view v-if="currentParams.length === 0" class="no-params">
暂无参数信息
</view>
<view v-else class="params-list">
<view v-for="param in currentParams" :key="param.name" class="param-item">
<view class="param-name">{{ param.name }}</view>
<view class="param-value">{{ param.value || '未设置' }}</view>
</view>
</view>
</view>
</uv-modal>
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -83,7 +62,6 @@
ref,
onMounted
} from "vue";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import RPC from "@/utils/request";
import dayjs from "dayjs";
import {
@ -93,41 +71,14 @@
} from "@dcloudio/uni-app";
const options = ref([{
text: "参数",
style: {
backgroundColor: "#6eb0ea",
},
}, {
text: "删除",
style: {
backgroundColor: "#f56c6c",
},
}]);
const currentParams = ref([])
const showParamsModal = ref(false)
const paramsModalRef = ref(null)
const controlItem = (index, item) => {
console.log(index, item);
if (index.index === 0) {
//
showParams(item);
} else {
deleteRecord(item);
}
};
//
const showParams = (item) => {
if (item.template_data) {
currentParams.value = Object.entries(item.template_data).map(([key, value]) => ({
name: key,
value: value
}));
} else {
currentParams.value = [];
}
paramsModalRef.value.open();
}, ]);
const delItem = (item) => {
console.log(item);
deleteRecord(item);
};
//
const loading = ref(false);
@ -135,6 +86,7 @@
const page = ref(1);
const list = ref([]);
const count = ref(0);
//
const downloadRecord = (record) => {
uni.showLoading({
@ -150,38 +102,12 @@
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// downloadA(record.result_url, (record.file_name || record.plannedNo))
uni.hideLoading();
uni.showToast({
title: "开始下载",
icon: "success",
});
// uni.request({
// url:'/api/proxyDownload',
// data:{"name":record.file_name || record.plannedNo,url:record.result_url},
// method:'POST',
// responseType: 'arraybuffer',
// success:res => {
// const blob = new Blob([res.data], {
// type: 'application/pdf'
// })
// const base64 = res.data
// const iframe = document.createElement('iframe')
// iframe.style.display = 'none'
// iframe.src = `data:application/pdf;base64,${base64}`
// document.body.appendChild(iframe)
// // const url = URL.createObjectURL(blob)
// // const a = document.createElement('a')
// // a.href = url
// // a.download = record.file_name
// // a.click()
// // URL.revokeObjectURL(url)
// },
// complete:() => {
// uni.hideLoading();
// }
// })
// #endif
// #ifdef MP-WEIXIN
// App使uni.downloadFile
@ -349,7 +275,7 @@
font-weight: 500;
margin-bottom: 6px;
word-wrap: break-word;
white-space: normal;
white-space: normal;
}
.record-time {
@ -381,10 +307,6 @@
background: #fff7e6;
color: #fa8c16;
}
&.waitting {
background: #fff7e6;
color: #4ad6f1;
}
}
.record-actions {
@ -413,47 +335,4 @@
padding: 20px;
text-align: center;
}
.params-modal-content {
padding: 20px 0;
max-height: 400px;
overflow-y: auto;
.no-params {
text-align: center;
color: #999;
font-size: 14px;
padding: 20px 0;
}
.params-list {
.param-item {
display: flex;
align-items: flex-start;
padding: 12px 0;
border-bottom: 1px solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.param-name {
flex-shrink: 0;
font-weight: 500;
color: #333;
font-size: 14px;
min-width: 80px;
margin-right: 12px;
}
.param-value {
flex: 1;
color: #666;
font-size: 14px;
word-wrap: break-word;
white-space: normal;
}
}
}
}
</style>

@ -87,25 +87,6 @@
size="20"
></uv-icon>
</view>
<view
v-if="showAlipay"
class="payment-item"
:class="{ active: selectedPayment === 'wxpay' }"
@click="selectPayment('wxpay')"
>
<view class="payment-info">
<uv-icon name="weixin-fill" color="#07c160" size="24"></uv-icon>
<view class="payment-details">
<text class="payment-name">微信支付</text>
<text class="payment-desc">推荐使用微信支付</text>
</view>
</view>
<uv-icon
name="checkmark-circle-fill"
:color="selectedPayment === 'wxpay' ? '#ff3333' : '#ccc'"
size="20"
></uv-icon>
</view>
</view>
<!-- 底部支付按钮 -->
@ -123,16 +104,12 @@
<text class="link" @click="showAgreement"></text>
</view>
</view>
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import { useAuthStore, useUserStore } from "@/store";
import RPC from "@/utils/request";
@ -225,7 +202,7 @@ const wechatPay = async (orderInfo) => {
// #ifdef H5
// H5
const payUrl = orderInfo.h5_url; // H5
const payUrl = orderInfo.mwebUrl; // H5
window.location.href = payUrl;
return {
success: true,

@ -67,26 +67,6 @@
<uv-icon name="checkmark-circle-fill" :color="selectedPayment === 'alipay' ? '#4285f4' : '#ccc'"
size="20"></uv-icon>
</view>
<view
v-if="showAlipay"
class="payment-item"
:class="{ active: selectedPayment === 'wxpay' }"
@click="selectPayment('wxpay')"
>
<view class="payment-info">
<uv-icon name="weixin-fill" color="#07c160" size="24"></uv-icon>
<view class="payment-details">
<view class="payment-name">微信支付</view>
<view class="payment-desc">推荐使用微信支付</view>
</view>
</view>
<uv-icon
name="checkmark-circle-fill"
:color="selectedPayment === 'wxpay' ? '#ff3333' : '#ccc'"
size="20"
></uv-icon>
</view>
</view>
</view>
@ -120,9 +100,6 @@
立即充值
</uv-button>
</view>
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -135,7 +112,6 @@
import {
onShow
} from "@dcloudio/uni-app";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import {
useAuthStore,
useUserStore
@ -282,12 +258,37 @@
// #ifdef H5
// H5
const payUrl = orderInfo.h5_url; // H5
window.location.href = payUrl;
return {
success: true,
redirect: true,
};
if (typeof WeixinJSBridge !== 'undefined') {
return new Promise((resolve, reject) => {
WeixinJSBridge.invoke('getBrandWCPayRequest', {
appId: orderInfo.appId,
timeStamp: orderInfo.timeStamp,
nonceStr: orderInfo.nonceStr,
package: orderInfo.package,
signType: orderInfo.signType,
paySign: orderInfo.paySign
}, (res) => {
if (res.err_msg === 'get_brand_wcpay_request:ok') {
resolve({
success: true,
data: res
});
} else if (res.err_msg === 'get_brand_wcpay_request:cancel') {
reject(new Error('用户取消支付'));
} else {
reject(new Error('微信支付失败'));
}
});
});
} else {
//
const payUrl = orderInfo.mwebUrl;
window.location.href = payUrl;
return {
success: true,
redirect: true
};
}
// #endif
};
@ -383,22 +384,15 @@
//
let paymentResult;
let orderResult = {};
if (selectedPayment.value === 'wxpay') {
// #ifdef MP-WEIXIN
const res = await uni.login({
provider: 'weixin'
})
orderResult = await RPC.post('/membership/order/pay_by_wechat_mini', {
const orderResult = await RPC.post('/membership/order/pay_by_wechat_mini', {
code: res.code,
"order_no": orderNum.order_no
})
// #endif
// #ifdef H5
orderResult = await RPC.post("/membership/order/pay_by_wechat_h5", {
order_no: orderNum.order_no,
});
// #endif
uni.showLoading({
title: "正在跳转微信支付...",
});
@ -448,10 +442,9 @@
} catch (error) {
uni.hideLoading();
console.log(error)
console.error('充值失败:', error);
let errorMessage = '';
let errorMessage = '充值失败,请重试';
if (error.message === '用户取消支付') {
errorMessage = '支付已取消';
} else if (error.message) {
@ -459,7 +452,7 @@
}
uni.showToast({
title: errorMessage || error,
title: errorMessage,
icon: 'none'
});
} finally {

@ -1,289 +0,0 @@
<template>
<view class="container">
<!-- 生成记录列表 -->
<view class="record-list">
<div v-for="record in list" :key="record.ID">
<view class="record-item">
<!-- 记录信息 -->
<view class="record-info">
<view class="record-title">{{ record.name }}</view>
<view class="record-time">
{{ record.description }}
</view>
</view>
<!-- 操作按钮 -->
<view class="record-actions">
<uv-button type="primary" size="small" v-if="record.access_status == 'revoked' || record.access_status == 'rejected' || record.access_status == 'none'"
@click="openApplyModal(record)">
申请权限
</uv-button>
</view>
<!-- 状态标签 -->
<view class="status-tag" :class="{
completed: record.access_status == 'approved',
failed: record.access_status == 'rejected' || record.access_status == 'revoked',
waitting: record.access_status == 'pending',
}">
{{get_access_status(record.access_status)}}
</view>
</view>
</div>
</view>
<!-- 空状态 -->
<view v-if="list.length === 0 && loadingStatus !== 'loading'" class="empty-state">
<uv-icon name="file-text" size="60" color="#ccc"></uv-icon>
<text class="empty-text">暂无模板</text>
</view>
<uv-modal
ref="applyModalRef"
showCancelButton
title="申请权限"
@confirm="confirmApply"
@cancel="cancelApply"
>
<view class="apply-modal-content">
<view class="apply-label">申请理由</view>
<uv-textarea
v-model="applyReason"
placeholder="请输入申请理由"
maxlength="200"
count
></uv-textarea>
</view>
</uv-modal>
<!-- 加载更多 -->
<!-- <uv-load-more v-else :status="loadingStatus" @loadmore="loadmore" /> -->
</view>
</template>
<script setup>
import {
ref,
onMounted
} from "vue";
import RPC from "@/utils/request";
import dayjs from "dayjs";
import {
onShow,
onPullDownRefresh,
onReachBottom
} from "@dcloudio/uni-app";
//
const loading = ref(false);
const loadingStatus = ref("loadmore");
const page = ref(1);
const list = ref([]);
const count = ref(0);
//
const loadRecords = async () => {
uni.showLoading();
loadingStatus.value = "loading";
RPC.post("/template/list_with_access", {
page: 1,
limit: -1,
})
.then((res) => {
list.value = (res.rows || []).filter((item) => item.enabled);
})
.finally(() => {
uni.hideLoading();
});
};
//
onPullDownRefresh(() => {
loadRecords();
uni.stopPullDownRefresh();
});
const get_access_status = (access_status) => {
let str = "";
if (access_status === "none") {
str = "无权限";
} else if (access_status === "pending") {
str = "待审批";
} else if (access_status === "rejected") {
str = "已拒绝";
} else if (access_status === "revoked") {
str = "已撤回";
} else if (access_status === "approved") {
str = "已通过";
} else {
str = access_status;
}
return str;
};
onShow(() => {
//
list.value = [];
page.value = 1;
loadRecords();
});
const currentTemplate = ref({})
//
const openApplyModal = (item) => {
applyReason.value = "";
currentTemplate.value = item
applyModalRef.value.open();
};
const applyLoading = ref(false)
const applyReason = ref('')
const applyModalRef = ref(null)
//
const confirmApply = async () => {
if (!applyReason.value.trim()) {
uni.showToast({
title: "请输入申请理由",
icon: "error",
});
return;
}
applyLoading.value = true;
try {
await RPC.post("/template_access_apply", {
template_id: currentTemplate.value.id,
reason: applyReason.value.trim(),
});
uni.showToast({
title: "申请已提交",
icon: "success",
});
applyModalRef.value.close();
applyReason.value = "";
loadRecords();
} catch (error) {
uni.showToast({
title: "申请失败,请重试",
icon: "error",
});
} finally {
applyLoading.value = false;
}
};
//
const cancelApply = () => {
applyReason.value = "";
};
</script>
<style lang="scss" scoped>
.container {
font-size: 14px;
min-height: 100vh;
background-color: #f8f8f8;
padding: 16px;
}
.record-list {
.record-item {
background: white;
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 12px;
.record-info {
flex: 1;
overflow: auto;
.record-title {
width: 100%;
font-size: 16px;
color: #333;
font-weight: 500;
margin-bottom: 6px;
word-wrap: break-word;
white-space: normal;
}
.record-time {
font-size: 13px;
color: #999;
}
}
.status-tag {
flex-shrink: 0;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: 500;
background: #eee;
color: #333;
&.waitting {
background: #fff7e6;
color: #fa8c16;
}
&.completed {
background: #e8f5e8;
color: #52c41a;
}
&.failed {
background: #fff1f0;
color: #ff4d4f;
}
&.processing {
background: #fff7e6;
color: #fa8c16;
}
}
.record-actions {
display: flex;
align-items: center;
flex-shrink: 0;
}
}
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80px 20px;
.empty-text {
color: #999;
font-size: 14px;
margin-top: 16px;
}
}
.load-more {
padding: 20px;
text-align: center;
}
.apply-modal-content {
padding: 20px 0;
width: 100%;
.apply-label {
font-size: 14px;
color: #333;
margin-bottom: 12px;
}
}
</style>

@ -15,17 +15,12 @@ routes.forEach((item) => {
}
});
// 调试:打印白名单
console.log("权限白名单:", whiteList);
/**
* 权限校验
* @param {String} path
* @returns
*/
export function hasPerm(path = "") {
console.log("hasPerm检查路径:", path);
if (!isPathExists(path) && path !== '/') {
uni.redirectTo({
url: ERROR404_PATH,
@ -33,17 +28,11 @@ export function hasPerm(path = "") {
return false;
}
const authStore = useAuthStore();
const cleanPath = removeQueryString(path);
// 在白名单中或有token直接放行
const inWhiteList = whiteList.includes(cleanPath);
const hasPermission = inWhiteList || authStore.isLoggedIn;
console.log("路径:", cleanPath, "在白名单:", inWhiteList, "已登录:", authStore.isLoggedIn, "有权限:", hasPermission);
const hasPermission =
whiteList.includes(removeQueryString(path)) || authStore.isLoggedIn;
if (!hasPermission) {
// 将用户的目标路径传递过去,这样可以实现用户登录之后,直接跳转到目标页面
console.log("无权限,跳转登录页");
uni.redirectTo({
url: `${LOGIN_PATH}?redirect=${encodeURIComponent(path)}`,
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 KiB

@ -28,14 +28,7 @@ export default defineConfig(({ mode }) => {
proxy: {
['/jsonrpc']: {
changeOrigin: true,
// target: 'https://lift-drawing-h5.ruixininfo.com',
target: 'https://lift-h5.shulinelev.com',
// target: 'https://lift-drawing.ruixininfo.com',
},
['/api/proxyDownload']: {
changeOrigin: true,
// target: 'https://lift-drawing-h5.ruixininfo.com',
target: 'https://lift-h5.shulinelev.com',
target: 'https://lift-drawing-h5.ruixininfo.com',
// target: 'https://lift-drawing.ruixininfo.com',
},
},

Loading…
Cancel
Save