update at 2026-02-12 17:30:41
This commit is contained in:
10
miniapp/README.md
Normal file
10
miniapp/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 小程序端骨架
|
||||
|
||||
当前目录提供了与 Figma `node-id=584:64` 对齐的页面骨架:
|
||||
|
||||
- 顶部 Logo/主题/上传/导出区域
|
||||
- 效果预览区域
|
||||
- 源数据与目标数据列选择区域
|
||||
- 主题底部选择器(底部弹层)
|
||||
|
||||
后续接入时建议直接复用 `src/core` 的解析与聚合逻辑,保持 Web 与小程序一致的数据行为。
|
||||
1
miniapp/app.js
Normal file
1
miniapp/app.js
Normal file
@@ -0,0 +1 @@
|
||||
App({});
|
||||
10
miniapp/app.json
Normal file
10
miniapp/app.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"pages": ["pages/index/index"],
|
||||
"window": {
|
||||
"navigationBarTitleText": "星程桑基图",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
5
miniapp/app.wxss
Normal file
5
miniapp/app.wxss
Normal file
@@ -0,0 +1,5 @@
|
||||
page {
|
||||
background: #f3f4f6;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
||||
color: #1d2129;
|
||||
}
|
||||
25
miniapp/pages/index/index.js
Normal file
25
miniapp/pages/index/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Page({
|
||||
data: {
|
||||
selectedThemeIndex: 1,
|
||||
sourceColumns: ['列1', '列2'],
|
||||
targetColumns: ['列1', '列2'],
|
||||
sourceDataIndex: 1,
|
||||
sourceDescChecked: [1],
|
||||
targetDescChecked: [1],
|
||||
showThemeSheet: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 主题选择按钮点击后,切换底部选择器。
|
||||
*/
|
||||
onToggleThemeSheet() {
|
||||
this.setData({ showThemeSheet: !this.data.showThemeSheet });
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭主题底部选择器。
|
||||
*/
|
||||
onCloseThemeSheet() {
|
||||
this.setData({ showThemeSheet: false });
|
||||
}
|
||||
});
|
||||
4
miniapp/pages/index/index.json
Normal file
4
miniapp/pages/index/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "星程桑基图",
|
||||
"usingComponents": {}
|
||||
}
|
||||
100
miniapp/pages/index/index.wxml
Normal file
100
miniapp/pages/index/index.wxml
Normal file
@@ -0,0 +1,100 @@
|
||||
<view class="page">
|
||||
<view class="header">
|
||||
<image class="logo" src="/assets/icons/webicon.png" mode="aspectFill" />
|
||||
<image class="title" src="/assets/icons/星程字体转换.svg" mode="widthFix" />
|
||||
</view>
|
||||
|
||||
<view class="toolbar">
|
||||
<view class="tool-item" bindtap="onToggleThemeSheet">
|
||||
<text>选择主题</text>
|
||||
<image class="tool-icon" src="/assets/icons/choose-color.svg" mode="aspectFit" />
|
||||
</view>
|
||||
|
||||
<view class="tool-item">
|
||||
<image class="tiny-icon" src="/assets/icons/content.svg" mode="aspectFit" />
|
||||
<text>文件上传</text>
|
||||
<image class="tool-icon" src="/assets/icons/upload.svg" mode="aspectFit" />
|
||||
</view>
|
||||
|
||||
<view class="export-box">
|
||||
<image class="export-main" src="/assets/icons/export.svg" mode="aspectFit" />
|
||||
<image class="export-icon" src="/assets/icons/export-svg.svg" mode="aspectFit" />
|
||||
<image class="export-icon" src="/assets/icons/export-png.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="preview-block">
|
||||
<text class="block-title">效果预览</text>
|
||||
<view class="preview-canvas" />
|
||||
</view>
|
||||
|
||||
<view class="bottom-grid">
|
||||
<view class="block">
|
||||
<text class="block-title">源数据</text>
|
||||
<view class="field">
|
||||
<view class="field-title">
|
||||
<image src="/assets/icons/expand.svg" mode="aspectFit" />
|
||||
<text>数据列</text>
|
||||
</view>
|
||||
|
||||
<view class="row" wx:for="{{sourceColumns}}" wx:key="*this">
|
||||
<image src="/assets/icons/data.svg" mode="aspectFit" />
|
||||
<text class="label">{{item}}</text>
|
||||
<image
|
||||
src="{{sourceDataIndex === index ? '/assets/icons/radiobutton.svg' : '/assets/icons/radiobutton-no.svg'}}"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="field">
|
||||
<view class="field-title">
|
||||
<image src="/assets/icons/expand.svg" mode="aspectFit" />
|
||||
<text>描述列</text>
|
||||
</view>
|
||||
|
||||
<view class="row" wx:for="{{sourceColumns}}" wx:key="*this">
|
||||
<image src="/assets/icons/description.svg" mode="aspectFit" />
|
||||
<text class="label">{{item}}</text>
|
||||
<image
|
||||
src="{{sourceDescChecked.indexOf(index) > -1 ? '/assets/icons/checkbox.svg' : '/assets/icons/checkbox-no.svg'}}"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="block">
|
||||
<text class="block-title">目标数据</text>
|
||||
<view class="field">
|
||||
<view class="field-title">
|
||||
<image src="/assets/icons/expand.svg" mode="aspectFit" />
|
||||
<text>描述列</text>
|
||||
</view>
|
||||
|
||||
<view class="row" wx:for="{{targetColumns}}" wx:key="*this">
|
||||
<image src="/assets/icons/description.svg" mode="aspectFit" />
|
||||
<text class="label">{{item}}</text>
|
||||
<image
|
||||
src="{{targetDescChecked.indexOf(index) > -1 ? '/assets/icons/checkbox.svg' : '/assets/icons/checkbox-no.svg'}}"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="footer">@版权说明:星程社所有,反馈邮箱:douboer@gmail.com</view>
|
||||
|
||||
<view class="theme-sheet-mask" wx:if="{{showThemeSheet}}" bindtap="onCloseThemeSheet" />
|
||||
<view class="theme-sheet" wx:if="{{showThemeSheet}}">
|
||||
<text class="theme-title">选择配色主题</text>
|
||||
<view class="theme-row" wx:for="{{4}}" wx:key="index">
|
||||
<image
|
||||
src="{{selectedThemeIndex === index ? '/assets/icons/radiobutton.svg' : '/assets/icons/radiobutton-no.svg'}}"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<view class="theme-bar" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
178
miniapp/pages/index/index.wxss
Normal file
178
miniapp/pages/index/index.wxss
Normal file
@@ -0,0 +1,178 @@
|
||||
.page {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.tool-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tool-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.tiny-icon {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.export-box {
|
||||
margin-left: auto;
|
||||
background: #fff;
|
||||
border: 1px solid #e5e6eb;
|
||||
border-radius: 4px;
|
||||
padding: 2px 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.export-main {
|
||||
width: 10px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.export-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.preview-block,
|
||||
.block {
|
||||
margin-top: 8px;
|
||||
border: 1px solid #fbaca3;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.block-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.preview-canvas {
|
||||
margin-top: 4px;
|
||||
min-height: 300px;
|
||||
background: #f7f8fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.bottom-grid {
|
||||
margin-top: 8px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.field-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.field-title image {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
height: 24px;
|
||||
border-bottom: 1px solid #c9cdd4;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding-bottom: 6px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.row image {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.label {
|
||||
flex: 1;
|
||||
color: #86909c;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 8px;
|
||||
color: #86909c;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.theme-sheet-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.theme-sheet {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
border-radius: 16px 16px 0 0;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.theme-title {
|
||||
color: #9b6bc2;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.theme-row {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.theme-row image {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.theme-bar {
|
||||
flex: 1;
|
||||
height: 20px;
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(90deg, #f72585, #3f37c9, #4cc9f0);
|
||||
}
|
||||
4
miniapp/sitemap.json
Normal file
4
miniapp/sitemap.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"desc": "星程桑基图小程序",
|
||||
"rules": []
|
||||
}
|
||||
Reference in New Issue
Block a user