微信小程序发布试用版本
This commit is contained in:
182
pages-subpackage/workspace/scene-detail.vue
Normal file
182
pages-subpackage/workspace/scene-detail.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<!-- #ifdef APP -->
|
||||
<statusBar></statusBar>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 导航栏 -->
|
||||
<uni-nav-bar
|
||||
:fixed="true"
|
||||
:statusBar="true"
|
||||
:border="false"
|
||||
:title="sceneInfo.title"
|
||||
leftIcon="left"
|
||||
@clickLeft="goBack"
|
||||
color="#333"
|
||||
backgroundColor="#FFFFFF">
|
||||
</uni-nav-bar>
|
||||
|
||||
<view class="content">
|
||||
<view class="nav-list">
|
||||
<view
|
||||
class="nav-item"
|
||||
v-for="(item, index) in sceneInfo.navItems"
|
||||
:key="index"
|
||||
@click="navigateToPage(item)">
|
||||
<view class="nav-item-content">
|
||||
<view class="nav-item-icon">
|
||||
<uni-icons type="right" size="20" color="#CCCCCC"></uni-icons>
|
||||
</view>
|
||||
<text class="nav-item-title">{{ item.title }}</text>
|
||||
<view class="nav-item-arrow">
|
||||
<uni-icons type="right" size="16" color="#CCCCCC"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP
|
||||
import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
// #ifdef APP
|
||||
components: {
|
||||
statusBar
|
||||
},
|
||||
// #endif
|
||||
data() {
|
||||
return {
|
||||
sceneInfo: {
|
||||
title: '',
|
||||
navItems: []
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.scene) {
|
||||
try {
|
||||
this.sceneInfo = JSON.parse(decodeURIComponent(options.scene));
|
||||
} catch (e) {
|
||||
console.error('解析场景信息失败:', e);
|
||||
uni.showToast({
|
||||
title: '参数错误',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
navigateToPage(item) {
|
||||
// 检查页面路径是否存在
|
||||
if (item.path) {
|
||||
// 判断是 tabBar 页面还是普通页面
|
||||
const tabBarPages = [
|
||||
'/pages/furniture_reception/furniture_reception',
|
||||
'/pages/furniture_customer/furniture_customer',
|
||||
'/pages/furniture_top_sales/furniture_top_sales',
|
||||
'/pages/ucenter/ucenter'
|
||||
];
|
||||
|
||||
if (tabBarPages.includes(item.path)) {
|
||||
uni.switchTab({
|
||||
url: item.path,
|
||||
fail: (err) => {
|
||||
console.error('跳转失败:', err);
|
||||
uni.showToast({
|
||||
title: '页面不存在',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: item.path,
|
||||
fail: (err) => {
|
||||
console.error('跳转失败:', err);
|
||||
uni.showToast({
|
||||
title: '页面不存在',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '页面路径未配置',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-top: 44px;
|
||||
padding: 44px 16px 20px;
|
||||
}
|
||||
|
||||
.nav-list {
|
||||
background: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
border-bottom: 1px solid #F0F0F0;
|
||||
}
|
||||
|
||||
.nav-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.nav-item-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px 16px;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.nav-item:active .nav-item-content {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.nav-item-icon {
|
||||
margin-right: 12px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.nav-item-title {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.nav-item-arrow {
|
||||
margin-left: 12px;
|
||||
}
|
||||
</style>
|
||||
169
pages-subpackage/workspace/workspace.vue
Normal file
169
pages-subpackage/workspace/workspace.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<!-- #ifdef APP -->
|
||||
<statusBar></statusBar>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 导航栏 -->
|
||||
<uni-nav-bar
|
||||
:fixed="true"
|
||||
:statusBar="true"
|
||||
:border="false"
|
||||
title="工作台"
|
||||
color="#333"
|
||||
backgroundColor="#FFFFFF">
|
||||
</uni-nav-bar>
|
||||
|
||||
<view class="content">
|
||||
<view class="scene-grid">
|
||||
<view
|
||||
class="scene-card"
|
||||
v-for="scene in scenes"
|
||||
:key="scene.id"
|
||||
@click="navigateToScene(scene)">
|
||||
<view class="scene-icon">
|
||||
<uni-icons :type="scene.icon" size="40" :color="scene.color"></uni-icons>
|
||||
</view>
|
||||
<text class="scene-title">{{ scene.title }}</text>
|
||||
<text class="scene-desc">{{ scene.desc }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP
|
||||
import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
// #ifdef APP
|
||||
components: {
|
||||
statusBar
|
||||
},
|
||||
// #endif
|
||||
data() {
|
||||
return {
|
||||
scenes: [
|
||||
{
|
||||
id: 'meeting',
|
||||
title: '会议场景',
|
||||
desc: '会议总结',
|
||||
icon: 'calendar',
|
||||
color: '#2A68FF',
|
||||
navItems: [
|
||||
{ title: '总结', path: '/pages/meeting_summary/meeting_summary' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'general_sales',
|
||||
title: '通用销售场景',
|
||||
desc: '通用销售场景功能',
|
||||
icon: 'grid',
|
||||
color: '#4ECDC4',
|
||||
navItems: [
|
||||
{ title: '销售准备', path: '/pages/general_sales/prepare/prepare' },
|
||||
{ title: '销售过程', path: '/pages/general_sales/process/process' },
|
||||
{ title: '销售总结', path: '/pages/general_sales/summary/summary' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'furniture_sales',
|
||||
title: '家具销售场景',
|
||||
desc: '家具销售场景功能',
|
||||
icon: 'list',
|
||||
color: '#FFA07A',
|
||||
navItems: [
|
||||
{ title: '销售准备', path: '/pages/furniture_sales/prepare/prepare' },
|
||||
{ title: '销售过程', path: '/pages/furniture_sales/process/process' },
|
||||
{ title: '销售总结', path: '/pages/furniture_sales/summary/summary' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'car_sales',
|
||||
title: '汽车销售场景',
|
||||
desc: '汽车销售场景功能',
|
||||
icon: 'settings',
|
||||
color: '#95E1D3',
|
||||
navItems: [
|
||||
{ title: '销售准备', path: '/pages/car_sales/prepare/prepare' },
|
||||
{ title: '销售过程', path: '/pages/car_sales/process/process' },
|
||||
{ title: '销售总结', path: '/pages/car_sales/summary/summary' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
navigateToScene(scene) {
|
||||
// 跳转到场景详情页面,传递场景信息
|
||||
uni.navigateTo({
|
||||
url: `/pages-subpackage/workspace/scene-detail?scene=${encodeURIComponent(JSON.stringify(scene))}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-top: 44px;
|
||||
padding: 44px 16px 20px;
|
||||
}
|
||||
|
||||
.scene-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.scene-card {
|
||||
background: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
padding: 24px 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.scene-card:active {
|
||||
transform: scale(0.98);
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.scene-icon {
|
||||
margin-bottom: 12px;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, rgba(42, 104, 255, 0.1) 0%, rgba(42, 104, 255, 0.05) 100%);
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.scene-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.scene-desc {
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user