Compare commits

...

10 Commits

@ -0,0 +1,119 @@
<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": true,
"needLogin": false,
"style": {
"navigationBarTitleText": "电梯图纸生成平台",
"enablePullDownRefresh":true
@ -131,6 +131,14 @@
"navigationBarTitleText" : "bug反馈",
"navigationStyle": "custom"
}
},
{
"path" : "template-apply/template-apply",
"style" :
{
"navigationBarTitleText" : "模版申请",
"enablePullDownRefresh":true
}
}
]
}

@ -3,7 +3,7 @@
<!-- 顶部筛选标签 -->
<uv-sticky bgColor="#fff" :offsetTop="isWeChatH5 ? -50 : 0">
<div class="tabBox">
<div class="tabItem" :class="{selected:active==='全部'}" @click="switchTab('全部')"></div>
<div class="tabItem" :class="{selected:active==='全部'}" @click="switchTab('全部')"></div>
<div class="tabItem" :class="{selected:active==='生成'}" @click="switchTab('生成')"></div>
<div class="tabItem" :class="{selected:active==='充值'}" @click="switchTab('充值')"></div>
<div class="tabItem" :class="{selected:active==='会员'}" @click="switchTab('会员')"></div>
@ -57,9 +57,11 @@
<view v-if="list.length === 0 && loadingStatus !== 'loading'" class="empty-state">
<u-icon name="file-text" size="60" color="#ccc"></u-icon>
<text class="empty-text">暂无消费记录</text>
</view>
</view>
<uv-load-more v-else :status="loadingStatus" />
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -70,7 +72,7 @@
ref
} from "vue";
import {
onShow,
onShow,
onReachBottom
} from "@dcloudio/uni-app";
import {
@ -78,19 +80,20 @@
useUserStore
} from "@/store";
import HeaderCustom from "/components/HeaderCustom/HeaderCustom.vue";
import RPC from "@/utils/request";
import dayjs from "dayjs";
const isWeChatH5 = ref(false)
// #ifdef H5
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
isWeChatH5.value = true
}
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import RPC from "@/utils/request";
import dayjs from "dayjs";
const isWeChatH5 = ref(false)
// #ifdef H5
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
isWeChatH5.value = true
}
// #endif
const authStore = useAuthStore();
const userStore = useUserStore();
const userStore = useUserStore();
const active = ref('全部')
const list = ref([{
@ -134,64 +137,64 @@
type: "other",
},
]);
const switchTab = (tab) => {
list.value = []
active.value = tab
page.value = 1
if(tab === '全部') {
typeParams.value = ''
}else {
typeParams.value = tab
}
getList()
}
const page = ref(1)
const typeParams = ref('')
const loadingStatus = ref('loadmore')
const switchTab = (tab) => {
list.value = []
active.value = tab
page.value = 1
if(tab === '全部') {
typeParams.value = ''
}else {
typeParams.value = tab
}
getList()
}
const page = ref(1)
const typeParams = ref('')
const loadingStatus = ref('loadmore')
const count = ref(0);
//
const getList = () => {
uni.showLoading();
RPC.post('/wallet/txns/list', {
user_id: userStore.userInfo.id,
page:page.value,
size:20,
type:typeParams.value
}).then(res => {
list.value = [...list.value, ...res.list];
count.value = res.total;
if (list.value.length >= count.value) {
loadingStatus.value = "nomore";
} else {
loadingStatus.value = "loadmore";
}
}).catch(() => {
loadingStatus.value = "loadmore";
}).finally(() => {
uni.hideLoading();
})
const getList = () => {
uni.showLoading();
RPC.post('/wallet/txns/list', {
user_id: userStore.userInfo.id,
page:page.value,
size:20,
type:typeParams.value
}).then(res => {
list.value = [...list.value, ...res.list];
count.value = res.total;
if (list.value.length >= count.value) {
loadingStatus.value = "nomore";
} else {
loadingStatus.value = "loadmore";
}
}).catch(() => {
loadingStatus.value = "loadmore";
}).finally(() => {
uni.hideLoading();
})
}
onMounted(() => {
});
onReachBottom(() => {
if (list.value.length >= count.value || loadingStatus.value === "loading")
return;
console.log("上拉加载:");
loadingStatus.value = "loading";
page.value = ++page.value;
getList();
});
onReachBottom(() => {
if (list.value.length >= count.value || loadingStatus.value === "loading")
return;
console.log("上拉加载:");
loadingStatus.value = "loading";
page.value = ++page.value;
getList();
});
onShow(() => {
//
list.value = []
page.value = 1
active.value = '全部'
//
list.value = []
page.value = 1
active.value = '全部'
typeParams.value = ''
getList();
});
@ -202,26 +205,26 @@
font-size: 14px;
min-height: 100vh;
background-color: #f8f8f8;
}
.tabBox {
height: 50px;
background-color: #fff;
display: flex;
.tabItem {
height: 100%;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
&.selected {
color: #5479ED;
border-bottom: 1px solid #5479ED;
}
}
}
.tabBox {
height: 50px;
background-color: #fff;
display: flex;
.tabItem {
height: 100%;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
&.selected {
color: #5479ED;
border-bottom: 1px solid #5479ED;
}
}
}
.consumption-list {

@ -1,5 +1,17 @@
<template>
<view class="container">
<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="header-section">
<image
@ -18,8 +30,22 @@
<!-- 选择图纸模板 -->
<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-if="loading"
v-else-if="loading"
:loading="loading"
:skeleton="[
{
@ -109,14 +135,12 @@
color="#000"
border="bottom"
:placeholderStyle="{ color: '#666778' }"
:placeholder="
item.name === '土建图号'
? '将根据土建图型号自动生成'
: '请输入'
"
:placeholder="item.type === 'number' ? `范围:${item.min} - ${item.max === 0 ? '不限' : item.max}` : (item.name === '土建图号'
? '自动生成'
: '请输入')"
></uv-input>
<!-- 数字范围提示 -->
<view
<!-- <view
v-if="
item.type === 'number' &&
(item.min !== undefined || item.max !== undefined)
@ -132,14 +156,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-else>
<view class="section" v-if="authStore.isLoggedIn && !has_access && template_id">
<div class="status">
申请状态{{ get_access_status(currentTemplate.access_status) }}
</div>
@ -153,14 +177,15 @@
</view>
<!-- 底部按钮 -->
<view class="bottom-actions">
<view class="bottom-actions" v-if="authStore.isLoggedIn">
<uv-button
:loading="generating"
@click="modalRefOpen"
text="生成图纸"
color="#3F70FF"
></uv-button>
<uv-button @click="viewHistory" text="查看记录"></uv-button>
<uv-button @click="bugFeedback" text="bug反馈"></uv-button>
<uv-button @click="viewHistory" text="查看记录" color="#df9d5d"></uv-button>
</view>
<uv-modal
ref="modalRef"
@ -186,6 +211,9 @@
</view>
</uv-modal>
<uv-picker ref="picker" :columns="columns" @confirm="confirm"></uv-picker>
<!-- 投诉与纠纷悬浮按钮 -->
<ComplaintFooter />
</view>
</template>
@ -201,7 +229,8 @@ import {
} from "@dcloudio/uni-app";
import { useAuthStore, useUserStore } from "@/store";
import RPC from "@/utils/request";
import { usePermission } from "@/hooks/usePermission";
import ComplaintFooter from "@/components/ComplaintFooter/ComplaintFooter.vue";
import dayjs from 'dayjs'
const authStore = useAuthStore();
const userStore = useUserStore();
@ -213,6 +242,21 @@ 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 {};
@ -249,6 +293,12 @@ 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({
@ -291,11 +341,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();
// });
// }
};
//
@ -346,11 +396,11 @@ const cancelApply = () => {
//
const handleInputChange = (item) => {
//
if (item.name === "土建图型号") {
nextTick(() => {
generateDrawingNumber();
});
}
// if (item.name === "") {
// nextTick(() => {
// generateDrawingNumber();
// });
// }
};
//
@ -380,7 +430,7 @@ const validateNumberRange = (item) => {
}
//
if (item.max !== undefined && value > item.max) {
if (item.max !== undefined && item.max !== 0 && value > item.max) {
uni.showToast({
title: `${item.name}不能大于${item.max}`,
icon: "error",
@ -396,21 +446,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 (!modelParam || !numberParam || !modelParam.value) return;
if (!numberParam) 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 = `${modelParam.value}-V${year}${month}-${randomPart}`;
numberParam.value = dayjs().format('YYYYMMDDHHmmss') + randomPart;
};
// 4+1
@ -420,7 +470,7 @@ const generateRandomCode = () => {
.padStart(4, "0");
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const letter = letters.charAt(Math.floor(Math.random() * letters.length));
return numbers + letter;
return numbers;
};
const generating = ref(false);
@ -470,7 +520,7 @@ const getList = () => {
limit: -1,
})
.then((res) => {
templateList.value = (res.rows || []).filter((item) => item.enabled);
templateList.value = (res.rows || []).filter((item) => item.enabled && item.has_access);
currentTemplate.value = templateList.value[0]
? JSON.parse(JSON.stringify(templateList.value[0]))
: {};
@ -480,6 +530,7 @@ const getList = () => {
RPC.post("/template/detail", { id: currentTemplate.value.id })
.then((res) => {
currentTemplate.value.params = res?.params;
generateDrawingNumber()
})
.finally(() => {
params_loading.value = false;
@ -557,19 +608,28 @@ onShareTimeline((data) => {
onLoad(() => {
console.log("index-onLoad");
});
onShow(async () => {
getList();
onShow(() => {
console.log("test page onShow");
const hasPermission = await usePermission();
console.log(hasPermission ? "已登录" : "跳转登录");
// ...
if (!hasPermission) {
authStore.signOut();
uni.$uv.route("/pages/login/login");
// 使usePermission
const isLoggedIn = authStore.isLoggedIn;
console.log(isLoggedIn ? "已登录" : "未登录");
//
if (isLoggedIn) {
//
getList();
} else {
//
templateList.value = [];
currentTemplate.value = {};
}
});
onPullDownRefresh(() => {
getList();
//
if (authStore.isLoggedIn) {
getList();
}
uni.stopPullDownRefresh();
});
</script>
@ -583,8 +643,57 @@ 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 {
@ -636,6 +745,22 @@ 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 {
@ -659,7 +784,7 @@ onPullDownRefresh(() => {
left: 0;
padding: 2px 8px;
border-radius: 0 0 10px 0;
font-size: 10px;
font-size: 14px;
color: white;
background: #00caef;
}
@ -686,7 +811,6 @@ onPullDownRefresh(() => {
.bottom-actions {
z-index: 999;
position: fixed;
bottom: 0;
left: 0;
background: #fff;
height: 50px;
@ -701,7 +825,7 @@ onPullDownRefresh(() => {
/* #ifdef H5 */
bottom: 50px;
/* H5环境下给tabBar留出空间 */
/* H5环境下给底部和tabBar留出空间 */
/* #endif */
}
@ -755,7 +879,7 @@ onPullDownRefresh(() => {
<style lang="scss">
.bottom-actions {
.uv-button-wrapper {
width: 48%;
width: 30%;
}
}
</style>

@ -89,6 +89,9 @@
href="weixin://dl/business/?appid=wxc504638e03981812&path=pages/login/login?from=h5ToWechat">
打开小程序并登录
</a> -->
<!-- 投诉与纠纷悬浮按钮 -->
<ComplaintFooter />
</view>
</template>
@ -150,6 +153,8 @@
});
const ToLoginRef = ref(null)
import ComplaintFooter from "@/components/ComplaintFooter/ComplaintFooter.vue";
const tips = ref("获取验证码");
const codeChange = (text) => {
@ -226,7 +231,7 @@
});
let redirect = HOME_PATH;
onLoad((options) => {
if (options.redirect && removeQueryString(options.redirect) !== LOGIN_PATH) {
if (options.redirect && removeQueryString(options.redirect) !== LOGIN_PATH) {
if(decodeURIComponent(options.redirect) && decodeURIComponent(options.redirect) != 'undefined')
redirect = decodeURIComponent(options.redirect);
}
@ -570,22 +575,34 @@
const login = async () => {
await form.value.validate();
console.log(userInfo.value);
// 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,
// });
// })
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('/login/phone', {
phone: userInfo.value.phone,
code: userInfo.value.password,

@ -76,6 +76,7 @@
<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"
@ -120,6 +121,12 @@
</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">
@ -140,12 +147,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">
@ -163,6 +170,9 @@
退出登录
</uv-button>
</view> -->
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -170,6 +180,7 @@
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";
@ -205,6 +216,11 @@ const viewUserAgreement = () => {
url: "/pagesA/user-agreement/user-agreement",
});
};
const templateApply = () => {
uni.navigateTo({
url: "/pagesA/template-apply/template-apply",
});
};
//
const addRequirement = () => {
@ -342,11 +358,10 @@ const logout = () => {
font-size: 14px;
background: linear-gradient(180deg, #7b9cdb 0%, #f8f8f8 40%);
min-height: 100vh;
// padding-bottom: 120px;
/* #ifdef H5 */
// padding-bottom: 170px;
/* H5环境下需要更多空间 (底部按钮高度 + tabBar高度 + 间距) */
padding-bottom: 50px;
/* H5环境下给tabBar留出空间 */
/* #endif */
}
@ -463,7 +478,7 @@ const logout = () => {
flex-shrink: 0;
background: white;
border-radius: 12px;
padding: 16px 12px;
padding: 12px 8px;
text-align: center;
position: relative;
border: 2px solid transparent;
@ -489,20 +504,25 @@ const logout = () => {
.plan-name {
font-size: 14px;
color: #333;
margin: 12px 0 8px;
margin: 12px 0 2px;
}
.plan-price {
font-size: 20px;
font-weight: bold;
color: #ff3333;
margin-bottom: 4px;
margin-bottom: 2px;
}
.plan-discount {
font-size: 12px;
color: #999;
}
.desc {
color: #999;
font-size: 12px;
}
}
}
}

@ -12,7 +12,7 @@
<view class="order-list">
<view class="order-item" v-for="order in list" :key="order.id">
<!-- 订单头部 -->
<div class="order-title">智能电梯图纸生成平台</div>
<div class="order-title">智能电梯图纸生成平台</div>
<view class="order-header">
<view class="order-info">
<text class="order-number">订单编号: {{ order.order_no }}</text>
@ -105,6 +105,9 @@
<text class="empty-text">暂无订单记录</text>
</view>
<uv-load-more v-else :status="loadingStatus" />
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -123,6 +126,7 @@
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";
@ -316,7 +320,7 @@
// #ifdef H5
// H5
const payUrl = orderInfo.mwebUrl; // H5
const payUrl = orderInfo.h5_url; // H5
window.location.href = payUrl;
return {
success: true,
@ -362,13 +366,13 @@
//
let paymentResult;
if (order.pay_channel === "wxpay") {
// #ifdef H5
uni.showToast({
icon:"none",
title:'请在小程序端使用微信支付'
})
return
if (order.pay_channel === "wxpay") {
// #ifdef H5
uni.showToast({
icon:"none",
title:'请在小程序端使用微信支付'
})
return
// #endif
// #ifdef MP-WEIXIN
const res = await uni.login({
@ -391,13 +395,13 @@
});
console.log('orderResult', orderResult)
paymentResult = await wechatPay(orderResult);
} else if (order.pay_channel === "alipay") {
// #ifdef MP-WEIXIN
uni.showToast({
icon:"none",
title:'请在h5端使用支付宝支付'
})
return
} else if (order.pay_channel === "alipay") {
// #ifdef MP-WEIXIN
uni.showToast({
icon:"none",
title:'请在h5端使用支付宝支付'
})
return
// #endif
const orderResult = await RPC.post('/membership/order/pay_by_alipay', {
order_no: order.order_no
@ -561,10 +565,10 @@
background: white;
border-radius: 12px;
margin-bottom: 16px;
overflow: hidden;
.order-title {
padding: 16px 16px 0;
overflow: hidden;
.order-title {
padding: 16px 16px 0;
}
.order-header {

@ -3,17 +3,18 @@
<!-- 生成记录列表 -->
<view class="record-list">
<uv-swipe-action>
<uv-swipe-action-item @click="delItem(record)" :options="options" v-for="record in list"
:key="record.ID">
<uv-swipe-action-item @click="index => controlItem(index,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")
? dayjs(record.CreatedAt).format("YYYY-MM-DD HH:mm:ss")
: ""
}}
</view>
@ -23,9 +24,11 @@
<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>
@ -54,6 +57,24 @@
<!-- 加载更多 -->
<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>
@ -62,6 +83,7 @@
ref,
onMounted
} from "vue";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import RPC from "@/utils/request";
import dayjs from "dayjs";
import {
@ -71,14 +93,41 @@
} from "@dcloudio/uni-app";
const options = ref([{
text: "参数",
style: {
backgroundColor: "#6eb0ea",
},
}, {
text: "删除",
style: {
backgroundColor: "#f56c6c",
},
}, ]);
const delItem = (item) => {
console.log(item);
deleteRecord(item);
}]);
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 loading = ref(false);
@ -86,7 +135,6 @@
const page = ref(1);
const list = ref([]);
const count = ref(0);
//
const downloadRecord = (record) => {
uni.showLoading({
@ -102,12 +150,38 @@
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
@ -274,8 +348,8 @@
color: #333;
font-weight: 500;
margin-bottom: 6px;
word-wrap: break-word;
white-space: normal;
word-wrap: break-word;
white-space: normal;
}
.record-time {
@ -307,6 +381,10 @@
background: #fff7e6;
color: #fa8c16;
}
&.waitting {
background: #fff7e6;
color: #4ad6f1;
}
}
.record-actions {
@ -335,4 +413,47 @@
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,6 +87,25 @@
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>
<!-- 底部支付按钮 -->
@ -104,12 +123,16 @@
<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";
@ -202,7 +225,7 @@ const wechatPay = async (orderInfo) => {
// #ifdef H5
// H5
const payUrl = orderInfo.mwebUrl; // H5
const payUrl = orderInfo.h5_url; // H5
window.location.href = payUrl;
return {
success: true,

@ -67,6 +67,26 @@
<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>
@ -100,6 +120,9 @@
立即充值
</uv-button>
</view>
<!-- 投诉与纠纷 -->
<ComplaintFooter />
</view>
</template>
@ -112,6 +135,7 @@
import {
onShow
} from "@dcloudio/uni-app";
import ComplaintFooter from "/components/ComplaintFooter/ComplaintFooter.vue";
import {
useAuthStore,
useUserStore
@ -119,18 +143,18 @@
import RPC from "@/utils/request";
const authStore = useAuthStore();
const userStore = useUserStore();
const memberInfo = ref({})
const getMemberInfo = () => {
uni.showLoading();
RPC.post('/membership/user/info', {
user_id: userStore.userInfo.id
}).then(res => {
memberInfo.value = res || {}
}).finally(() => {
uni.hideLoading();
})
const userStore = useUserStore();
const memberInfo = ref({})
const getMemberInfo = () => {
uni.showLoading();
RPC.post('/membership/user/info', {
user_id: userStore.userInfo.id
}).then(res => {
memberInfo.value = res || {}
}).finally(() => {
uni.hideLoading();
})
}
//
@ -139,7 +163,7 @@
const customAmount = ref('');
const selectedPayment = ref('wxpay');
const recharging = ref(false);
const showAlipay = ref(true);
const showAlipay = ref(true);
const isWechat = ref(false)
//
@ -217,13 +241,13 @@
// #ifdef MP-WEIXIN
//
showAlipay.value = false;
isWechat.value = true;
isWechat.value = true;
selectedPayment.value = 'wxpay';
// #endif
// #ifdef H5
// H5
showAlipay.value = true;
showAlipay.value = true;
selectedPayment.value = 'alipay';
// #endif
};
@ -258,37 +282,12 @@
// #ifdef H5
// H5
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
};
}
const payUrl = orderInfo.h5_url; // H5
window.location.href = payUrl;
return {
success: true,
redirect: true,
};
// #endif
};
@ -356,7 +355,7 @@
// API
const orderNum = await RPC.post('/wallet/recharge', {
user_id: userStore.userInfo.id,
amount_cents: finalAmount.value * 100,
amount_cents: finalAmount.value * 100,
pay_channel: selectedPayment.value
})
console.log('orderNum', orderNum)
@ -384,23 +383,30 @@
//
let paymentResult;
let orderResult = {};
if (selectedPayment.value === 'wxpay') {
// #ifdef MP-WEIXIN
const res = await uni.login({
provider: 'weixin'
})
const orderResult = await RPC.post('/membership/order/pay_by_wechat_mini', {
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: "正在跳转微信支付...",
});
console.log('orderResult', orderResult)
paymentResult = await wechatPay(orderResult);
} else if (selectedPayment.value === 'alipay') {
const orderResult = await RPC.post('/membership/order/pay_by_alipay', {
order_no: orderNum.order_no
} else if (selectedPayment.value === 'alipay') {
const orderResult = await RPC.post('/membership/order/pay_by_alipay', {
order_no: orderNum.order_no
})
uni.showLoading({
title: '正在跳转支付宝...'
@ -428,9 +434,9 @@
//
selectedAmount.value = 0;
customAmount.value = '';
// setTimeout(() => {
// getMemberInfo()
customAmount.value = '';
// setTimeout(() => {
// getMemberInfo()
// },1000)
//
@ -442,9 +448,10 @@
} catch (error) {
uni.hideLoading();
console.log(error)
console.error('充值失败:', error);
let errorMessage = '充值失败,请重试';
let errorMessage = '';
if (error.message === '用户取消支付') {
errorMessage = '支付已取消';
} else if (error.message) {
@ -452,7 +459,7 @@
}
uni.showToast({
title: errorMessage,
title: errorMessage || error,
icon: 'none'
});
} finally {
@ -515,7 +522,7 @@
});
onShow(() => {
handlePaymentCallback();
handlePaymentCallback();
getMemberInfo()
});
</script>

@ -0,0 +1,289 @@
<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,12 +15,17 @@ 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,
@ -28,11 +33,17 @@ export function hasPerm(path = "") {
return false;
}
const authStore = useAuthStore();
const cleanPath = removeQueryString(path);
// 在白名单中或有token直接放行
const hasPermission =
whiteList.includes(removeQueryString(path)) || authStore.isLoggedIn;
const inWhiteList = whiteList.includes(cleanPath);
const hasPermission = inWhiteList || authStore.isLoggedIn;
console.log("路径:", cleanPath, "在白名单:", inWhiteList, "已登录:", authStore.isLoggedIn, "有权限:", hasPermission);
if (!hasPermission) {
// 将用户的目标路径传递过去,这样可以实现用户登录之后,直接跳转到目标页面
console.log("无权限,跳转登录页");
uni.redirectTo({
url: `${LOGIN_PATH}?redirect=${encodeURIComponent(path)}`,
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 KiB

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

Loading…
Cancel
Save