Compare commits
3 Commits
8adc28ae9c
...
81cb0b361d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81cb0b361d | ||
|
|
e67d9eeecc | ||
|
|
965743be38 |
24
miniprogram/api/ToolApi.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { Network } from "../utils/Network";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tool 工具 API
|
||||||
|
*/
|
||||||
|
export class ToolApi {
|
||||||
|
/**
|
||||||
|
* 获取备忘录内容
|
||||||
|
*/
|
||||||
|
static getMemo(): Promise<string> {
|
||||||
|
return Network.get<string>("/journal/tool/memo");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新备忘录内容
|
||||||
|
*
|
||||||
|
* @param data - 备忘录内容
|
||||||
|
*/
|
||||||
|
static updateMemo(data: string): Promise<void> {
|
||||||
|
return Network.post<void>("/journal/tool/memo/update", {
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +1,22 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/main/journal/index",
|
"pages/main/tabs/journal/index",
|
||||||
"pages/main/journal-search/index",
|
"pages/main/tabs/travel/index",
|
||||||
"pages/main/journal-editor/index",
|
"pages/main/tabs/moment/index",
|
||||||
"pages/main/journal-map/index",
|
"pages/main/tabs/other/index",
|
||||||
"pages/main/journal-date/index",
|
"pages/main/tabs/about/index",
|
||||||
"pages/main/portfolio/index",
|
"pages/main/journal/search/index",
|
||||||
"pages/main/travel/index",
|
"pages/main/journal/editor/index",
|
||||||
"pages/main/travel-detail/index",
|
"pages/main/journal/map/index",
|
||||||
"pages/main/travel-editor/index",
|
"pages/main/journal/date/index",
|
||||||
"pages/main/travel-location-detail/index",
|
"pages/main/other/memo/index",
|
||||||
"pages/main/travel-location-map/index",
|
"pages/main/other/portfolio/index",
|
||||||
"pages/main/travel-location-editor/index",
|
"pages/main/travel/detail/index",
|
||||||
"pages/main/about/index",
|
"pages/main/travel/editor/index",
|
||||||
"pages/main/moment/index"
|
"pages/main/travel/location-detail/index",
|
||||||
|
"pages/main/travel/location-map/index",
|
||||||
|
"pages/main/travel/location-editor/index"
|
||||||
],
|
],
|
||||||
"darkmode": true,
|
"darkmode": true,
|
||||||
"themeLocation": "theme.json",
|
"themeLocation": "theme.json",
|
||||||
@@ -32,31 +34,31 @@
|
|||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"text": "归档",
|
"text": "归档",
|
||||||
"pagePath": "pages/main/journal/index",
|
"pagePath": "pages/main/tabs/journal/index",
|
||||||
"iconPath": "@tabBarIconJournal",
|
"iconPath": "@tabBarIconJournal",
|
||||||
"selectedIconPath": "@tabBarIconJournalActive"
|
"selectedIconPath": "@tabBarIconJournalActive"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"text": "专拍",
|
|
||||||
"pagePath": "pages/main/portfolio/index",
|
|
||||||
"iconPath": "@tabBarIconPortfolio",
|
|
||||||
"selectedIconPath": "@tabBarIconPortfolioActive"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"text": "瞬间",
|
|
||||||
"pagePath": "pages/main/moment/index",
|
|
||||||
"iconPath": "@tabBarIconMoment",
|
|
||||||
"selectedIconPath": "@tabBarIconMomentActive"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"text": "出行",
|
"text": "出行",
|
||||||
"pagePath": "pages/main/travel/index",
|
"pagePath": "pages/main/tabs/travel/index",
|
||||||
"iconPath": "@tabBarIconTravel",
|
"iconPath": "@tabBarIconTravel",
|
||||||
"selectedIconPath": "@tabBarIconTravelActive"
|
"selectedIconPath": "@tabBarIconTravelActive"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"text": "瞬间",
|
||||||
|
"pagePath": "pages/main/tabs/moment/index",
|
||||||
|
"iconPath": "@tabBarIconMoment",
|
||||||
|
"selectedIconPath": "@tabBarIconMomentActive"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "其他",
|
||||||
|
"pagePath": "pages/main/tabs/other/index",
|
||||||
|
"iconPath": "@tabBarIconOther",
|
||||||
|
"selectedIconPath": "@tabBarIconOtherActive"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"text": "关于",
|
"text": "关于",
|
||||||
"pagePath": "pages/main/about/index",
|
"pagePath": "pages/main/tabs/about/index",
|
||||||
"iconPath": "@tabBarIconInfo",
|
"iconPath": "@tabBarIconInfo",
|
||||||
"selectedIconPath": "@tabBarIconInfoActive"
|
"selectedIconPath": "@tabBarIconInfoActive"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
miniprogram/assets/icon/dark/other.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
miniprogram/assets/icon/dark/other_active.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
BIN
miniprogram/assets/icon/light/other.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
miniprogram/assets/icon/light/other_active.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
miniprogram/assets/image/logo.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 68 KiB |
@@ -20,7 +20,7 @@ Component({
|
|||||||
createSnowflake() {
|
createSnowflake() {
|
||||||
const snowflake = {
|
const snowflake = {
|
||||||
x: Toolkit.random(0, this.data.docWidth),
|
x: Toolkit.random(0, this.data.docWidth),
|
||||||
s: Toolkit.random(16, 64),
|
s: Toolkit.random(16, 90),
|
||||||
speed: Toolkit.random(14, 26)
|
speed: Toolkit.random(14, 26)
|
||||||
};
|
};
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
wx:for="{{snowflakes}}"
|
wx:for="{{snowflakes}}"
|
||||||
wx:key="index"
|
wx:key="index"
|
||||||
style="left: {{item.x}}px; font-size: {{item.s}}rpx; animation-duration: {{item.speed}}s;"
|
style="left: {{item.x}}px; font-size: {{item.s}}rpx; animation-duration: {{item.speed}}s;"
|
||||||
name="snowflake"
|
name="plus"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
const envArgs = {
|
const envArgs = {
|
||||||
develop: {
|
develop: {
|
||||||
url: "http://localhost:8091"
|
// url: "http://localhost:8091"
|
||||||
// url: "https://api.imyeyu.dev"
|
// url: "https://api.imyeyu.dev"
|
||||||
// url: "https://api.imyeyu.com"
|
// url: "https://api.imyeyu.com"
|
||||||
// url: "http://192.168.3.123:8091"
|
// url: "http://192.168.3.123:8091"
|
||||||
// url: "http://192.168.3.137:8091"
|
// url: "http://192.168.3.137:8091"
|
||||||
// url: "http://192.168.3.173:8091"
|
// url: "http://192.168.3.173:8091"
|
||||||
// url: "http://192.168.3.174:8091"
|
url: "http://192.168.3.174:8091"
|
||||||
},
|
},
|
||||||
trial: {
|
trial: {
|
||||||
url: "https://api.imyeyu.com"
|
url: "https://api.imyeyu.com"
|
||||||
|
|||||||
8
miniprogram/package-lock.json
generated
@@ -9,7 +9,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tdesign-miniprogram": "^1.12.0"
|
"tdesign-miniprogram": "^1.12.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"miniprogram-api-typings": "^4.1.0"
|
"miniprogram-api-typings": "^4.1.0"
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/tdesign-miniprogram": {
|
"node_modules/tdesign-miniprogram": {
|
||||||
"version": "1.12.0",
|
"version": "1.12.2",
|
||||||
"resolved": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.12.2.tgz",
|
||||||
"integrity": "sha512-Ft+B1HWMOKuOpM9+Z0mflprWrxSB/ESo6TVymjxJ6xzMgSfEcbmFaXpd0nJ+Oj/5GCljqP06ZTeWazuk1G6Ugg=="
|
"integrity": "sha512-ZpOdwonT26RRCK/FWbg9tR2lAJ54Hb4PAdyTWu8URWkbKOmSQhn0JCwCtWWRofKbyWCPsCn5NqljobaGh5VCMg=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"tdesign-miniprogram": "^1.12.0"
|
"tdesign-miniprogram": "^1.12.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"miniprogram-api-typings": "^4.1.0"
|
"miniprogram-api-typings": "^4.1.0"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Page({
|
|||||||
type: JournalPageType.PREVIEW
|
type: JournalPageType.PREVIEW
|
||||||
});
|
});
|
||||||
wx.switchTab({
|
wx.switchTab({
|
||||||
url: "/pages/main/journal/index",
|
url: "/pages/main/tabs/journal/index",
|
||||||
})
|
})
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error?.code === 40100) {
|
if (error?.code === 40100) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<scroll-view class="index" scroll-y type="list">
|
<scroll-view class="index" scroll-y type="list">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<image class="logo" src="/assets/image/logo.png"></image>
|
<image class="logo" src="/assets/image/logo.jpg"></image>
|
||||||
<text>
|
<text>
|
||||||
<text class="name gao">小糕</text>
|
<text class="name gao">小糕</text>
|
||||||
<text>和</text>
|
<text>和</text>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* pages/main/journal-date/index.less */
|
/* pages/main/journal/date/index.less */
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// pages/main/journal-date/index.ts
|
// pages/main/journal/date/index.ts
|
||||||
import { Journal, JournalPageType } from "../../../types/Journal";
|
import { Journal, JournalPageType } from "../../../../types/Journal";
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import { JournalApi } from "../../../api/JournalApi";
|
import { JournalApi } from "../../../../api/JournalApi";
|
||||||
|
|
||||||
interface JournalDateData {
|
interface JournalDateData {
|
||||||
// 存储每个日期的日记 id 列表
|
// 存储每个日期的日记 id 列表
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--pages/main/journal-date/index.wxml-->
|
<!--pages/main/journal/date/index.wxml-->
|
||||||
<t-navbar title="日期查找" left-arrow />
|
<t-navbar title="日期查找" placeholder left-arrow />
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 日历视图 -->
|
<!-- 日历视图 -->
|
||||||
<calendar journal-map="{{journalMap}}" bind:dateselect="onDateSelect" />
|
<calendar journal-map="{{journalMap}}" bind:dateselect="onDateSelect" />
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* pages/main/journal-editor/index.wxss */
|
/* pages/main/journal/editor/index.wxss */
|
||||||
.container {
|
.container {
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
// pages/main/journal-editor/index.ts
|
// pages/main/journal/editor/index.ts
|
||||||
import Events from "../../../utils/Events";
|
import Events from "../../../../utils/Events";
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
import config from "../../../config/index";
|
import config from "../../../../config/index";
|
||||||
import { Location, MediaItem, MediaItemType, WechatMediaItem } from "../../../types/UI";
|
import { Location, MediaItem, MediaItemType, WechatMediaItem } from "../../../../types/UI";
|
||||||
import { JournalType } from "../../../types/Journal";
|
import { JournalType } from "../../../../types/Journal";
|
||||||
import { MediaAttachType, PreviewImageMetadata } from "../../../types/Attachment";
|
import { MediaAttachType, PreviewImageMetadata } from "../../../../types/Attachment";
|
||||||
import IOSize, { Unit } from "../../../utils/IOSize";
|
import IOSize, { Unit } from "../../../../utils/IOSize";
|
||||||
import { JournalApi } from "../../../api/JournalApi";
|
import { JournalApi } from "../../../../api/JournalApi";
|
||||||
|
|
||||||
interface JournalEditorData {
|
interface JournalEditorData {
|
||||||
/** 模式:create 或 edit */
|
/** 模式:create 或 edit */
|
||||||
@@ -341,7 +341,7 @@ Page({
|
|||||||
cancel() {
|
cancel() {
|
||||||
if (this.data.mode === "create") {
|
if (this.data.mode === "create") {
|
||||||
wx.switchTab({
|
wx.switchTab({
|
||||||
url: "/pages/main/journal/index"
|
url: "/pages/main/tabs/journal/index"
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
wx.navigateBack();
|
wx.navigateBack();
|
||||||
@@ -459,7 +459,7 @@ Page({
|
|||||||
});
|
});
|
||||||
await Toolkit.sleep(1000);
|
await Toolkit.sleep(1000);
|
||||||
wx.switchTab({
|
wx.switchTab({
|
||||||
url: "/pages/main/journal/index"
|
url: "/pages/main/tabs/journal/index"
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("创建日记失败:", error);
|
console.error("创建日记失败:", error);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--pages/main/journal-editor/index.wxml-->
|
<!--pages/main/journal/editor/index.wxml-->
|
||||||
<t-navbar title="{{mode === 'create' ? '新纪录' : '编辑记录'}}">
|
<t-navbar title="{{mode === 'create' ? '新纪录' : '编辑记录'}}" placeholder>
|
||||||
<text slot="left" bindtap="cancel">取消</text>
|
<text slot="left" bindtap="cancel">取消</text>
|
||||||
</t-navbar>
|
</t-navbar>
|
||||||
<scroll-view
|
<scroll-view
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* pages/main/journal-map/index.less */
|
/* pages/main/journal/map/index.less */
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// pages/main/journal-map/index.ts
|
// pages/main/journal/map/index.ts
|
||||||
import config from "../../../config/index";
|
import config from "../../../../config/index";
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import { JournalPageType } from "../../../types/Journal";
|
import { JournalPageType } from "../../../../types/Journal";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
import { MapMarker } from "../../../types/UI";
|
import { MapMarker } from "../../../../types/UI";
|
||||||
import { JournalApi } from "../../../api/JournalApi";
|
import { JournalApi } from "../../../../api/JournalApi";
|
||||||
|
|
||||||
interface LocationMarker {
|
interface LocationMarker {
|
||||||
locationKey: string; // 位置键 "lat,lng"
|
locationKey: string; // 位置键 "lat,lng"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--pages/main/journal-map/index.wxml-->
|
<!--pages/main/journal/map/index.wxml-->
|
||||||
<t-navbar title="地图查找" left-arrow />
|
<t-navbar title="地图查找" left-arrow placeholder />
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<map
|
<map
|
||||||
id="journal-map"
|
id="journal-map"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// pages/main/journal-search/index.ts
|
// pages/main/journal/search/index.ts
|
||||||
import Events from "../../../utils/Events";
|
import Events from "../../../../utils/Events";
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -13,7 +13,7 @@ Page({
|
|||||||
onNavigateItem(e: WechatMiniprogram.CustomEvent) {
|
onNavigateItem(e: WechatMiniprogram.CustomEvent) {
|
||||||
const { id } = e.detail;
|
const { id } = e.detail;
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/journal-editor/index?id=${id}`
|
url: `/pages/main/journal/editor/index?id=${id}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<view class="page-container">
|
<view class="page-container">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<t-navbar title="列表查找" left-arrow />
|
<t-navbar title="列表查找" left-arrow placeholder />
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<journal-list
|
<journal-list
|
||||||
7
miniprogram/pages/main/other/memo/index.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||||
|
"t-navbar": "tdesign-miniprogram/navbar/navbar"
|
||||||
|
},
|
||||||
|
"disableScroll": true
|
||||||
|
}
|
||||||
66
miniprogram/pages/main/other/memo/index.less
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// pages/main/other/memo/index.less
|
||||||
|
.memo {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-card {
|
||||||
|
padding: 2rem 1.5rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-hint {
|
||||||
|
padding: 1.5rem 1rem 0 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
.editor {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: .0625rem solid var(--theme-border-light);
|
||||||
|
padding: 1rem 1rem 2rem 1rem;
|
||||||
|
overflow: auto;
|
||||||
|
font-size: 1rem;
|
||||||
|
background: var(--theme-bg-primary);
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbar {
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
right: 100%;
|
||||||
|
height: 3.125rem;
|
||||||
|
bottom: 0;
|
||||||
|
border: .0625rem solid var(--theme-border-light);
|
||||||
|
padding: 0 1rem;
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
background: var(--theme-bg-primary);
|
||||||
|
box-sizing: border-box;
|
||||||
|
align-items: center;
|
||||||
|
border-left: none;
|
||||||
|
border-right: none;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: var(--theme-wx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
162
miniprogram/pages/main/other/memo/index.ts
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
// 备忘录页面逻辑
|
||||||
|
import { ToolApi } from "../../../../api/ToolApi";
|
||||||
|
|
||||||
|
type EditorInputEvent = WechatMiniprogram.CustomEvent<{
|
||||||
|
html?: string;
|
||||||
|
text?: string;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
interface MemoData {
|
||||||
|
formats: Record<string, unknown>;
|
||||||
|
placeholder: string;
|
||||||
|
editorHeight: number;
|
||||||
|
keyboardHeight: number;
|
||||||
|
isIOS: boolean;
|
||||||
|
isSaving: boolean;
|
||||||
|
isEditorReady: boolean;
|
||||||
|
contentHtml: string;
|
||||||
|
contentText: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: <MemoData>{
|
||||||
|
formats: {},
|
||||||
|
placeholder: "开始输入...",
|
||||||
|
editorHeight: 300,
|
||||||
|
keyboardHeight: 0,
|
||||||
|
isIOS: false,
|
||||||
|
isSaving: false,
|
||||||
|
isEditorReady: false,
|
||||||
|
contentHtml: "",
|
||||||
|
contentText: ""
|
||||||
|
},
|
||||||
|
editorCtx: null as WechatMiniprogram.EditorContext | null,
|
||||||
|
pendingHtml: "",
|
||||||
|
hasSavedOnLeave: false,
|
||||||
|
hasLoadFailed: false,
|
||||||
|
async onLoad() {
|
||||||
|
const platform = wx.getSystemInfoSync().platform;
|
||||||
|
const isIOS = platform === "ios";
|
||||||
|
this.setData({ isIOS });
|
||||||
|
this.updatePosition(0);
|
||||||
|
this.bindKeyboardHeightChange();
|
||||||
|
await this.loadMemo();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.hasSavedOnLeave = false;
|
||||||
|
},
|
||||||
|
async onUnload() {
|
||||||
|
await this.saveMemoOnLeave();
|
||||||
|
},
|
||||||
|
async onHide() {
|
||||||
|
await this.saveMemoOnLeave();
|
||||||
|
},
|
||||||
|
bindKeyboardHeightChange() {
|
||||||
|
let keyboardHeight = 0;
|
||||||
|
wx.onKeyboardHeightChange((res) => {
|
||||||
|
if (res.height === keyboardHeight) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const duration = 0 < res.height ? res.duration * 1000 : 0;
|
||||||
|
keyboardHeight = res.height;
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.pageScrollTo({
|
||||||
|
scrollTop: 0,
|
||||||
|
success: () => {
|
||||||
|
this.updatePosition(keyboardHeight);
|
||||||
|
this.editorCtx?.scrollIntoView();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, duration);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
updatePosition(keyboardHeight: number) {
|
||||||
|
const toolbarHeight = 50;
|
||||||
|
const { windowHeight } = wx.getSystemInfoSync();
|
||||||
|
const editorHeight = 0 < keyboardHeight
|
||||||
|
? windowHeight - keyboardHeight - toolbarHeight
|
||||||
|
: windowHeight;
|
||||||
|
this.setData({ editorHeight, keyboardHeight });
|
||||||
|
},
|
||||||
|
onEditorReady() {
|
||||||
|
const query = wx.createSelectorQuery();
|
||||||
|
query.select("#memo-editor").context((res) => {
|
||||||
|
this.editorCtx = (res as { context?: WechatMiniprogram.EditorContext }).context || null;
|
||||||
|
this.setData({ isEditorReady: true });
|
||||||
|
this.applyPendingContent();
|
||||||
|
});
|
||||||
|
query.exec();
|
||||||
|
},
|
||||||
|
applyPendingContent() {
|
||||||
|
if (!this.editorCtx || !this.pendingHtml) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.editorCtx.setContents({
|
||||||
|
html: this.pendingHtml
|
||||||
|
});
|
||||||
|
this.pendingHtml = "";
|
||||||
|
},
|
||||||
|
onStatusChange(e: WechatMiniprogram.CustomEvent<Record<string, unknown>>) {
|
||||||
|
this.setData({ formats: e.detail || {} });
|
||||||
|
},
|
||||||
|
format(e: WechatMiniprogram.BaseEvent) {
|
||||||
|
const { name, value } = e.target.dataset as { name?: string; value?: string | number };
|
||||||
|
if (!name || !this.editorCtx) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.editorCtx.format(name, value);
|
||||||
|
},
|
||||||
|
onEditorInput(e: EditorInputEvent) {
|
||||||
|
const { html = "", text = "" } = e.detail || {};
|
||||||
|
this.setData({
|
||||||
|
contentHtml: html,
|
||||||
|
contentText: text
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async loadMemo() {
|
||||||
|
wx.showLoading({ title: "加载中..", mask: true });
|
||||||
|
let shouldGoBack = false;
|
||||||
|
try {
|
||||||
|
const contentHtml = await ToolApi.getMemo();
|
||||||
|
this.pendingHtml = contentHtml;
|
||||||
|
this.setData({
|
||||||
|
contentHtml,
|
||||||
|
contentText: this.normalizeMemoText(contentHtml)
|
||||||
|
});
|
||||||
|
this.applyPendingContent();
|
||||||
|
} catch (error) {
|
||||||
|
console.error("加载备忘录失败", error);
|
||||||
|
this.hasLoadFailed = true;
|
||||||
|
shouldGoBack = true;
|
||||||
|
} finally {
|
||||||
|
wx.hideLoading();
|
||||||
|
if (shouldGoBack) {
|
||||||
|
wx.navigateBack({ delta: 1 });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
normalizeMemoText(html: string) {
|
||||||
|
const normalized = html
|
||||||
|
.replace(/<[^>]*>/g, "")
|
||||||
|
.replace(/ /g, " ")
|
||||||
|
.replace(/\s+/g, " ")
|
||||||
|
.trim();
|
||||||
|
return normalized;
|
||||||
|
},
|
||||||
|
async saveMemoOnLeave() {
|
||||||
|
if (this.hasLoadFailed || this.data.isSaving || this.hasSavedOnLeave) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.hasSavedOnLeave = true;
|
||||||
|
this.setData({ isSaving: true });
|
||||||
|
wx.showLoading({ title: "保存中..", mask: true });
|
||||||
|
try {
|
||||||
|
await ToolApi.updateMemo(this.data.contentHtml || "");
|
||||||
|
} catch (error) {
|
||||||
|
console.error("保存备忘录失败", error);
|
||||||
|
} finally {
|
||||||
|
wx.hideLoading();
|
||||||
|
this.setData({ isSaving: false });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
65
miniprogram/pages/main/other/memo/index.wxml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<!-- 备忘录页面 -->
|
||||||
|
<view class="custom-navbar">
|
||||||
|
<t-navbar class="custom-navbar" title="备忘录" left-arrow placeholder />
|
||||||
|
</view>
|
||||||
|
<view class="memo setting-bg">
|
||||||
|
<view class="content">
|
||||||
|
<view class="container" style="height:{{editorHeight}}px;">
|
||||||
|
<editor
|
||||||
|
id="memo-editor"
|
||||||
|
class="editor"
|
||||||
|
placeholder="{{placeholder}}"
|
||||||
|
bindready="onEditorReady"
|
||||||
|
bindinput="onEditorInput"
|
||||||
|
bindstatuschange="onStatusChange"
|
||||||
|
show-img-size="{{false}}"
|
||||||
|
show-img-toolbar="{{false}}"
|
||||||
|
show-img-resize="{{false}}"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="toolbar"
|
||||||
|
catchtouchend="format"
|
||||||
|
hidden="{{0 < keyboardHeight ? false : true}}"
|
||||||
|
style="bottom: {{isIOS ? keyboardHeight : 0}}px"
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="icon {{formats.header === 2 ? 'active' : ''}}"
|
||||||
|
data-name="header"
|
||||||
|
data-value="{{2}}"
|
||||||
|
>H2</text>
|
||||||
|
<text
|
||||||
|
class="icon {{formats.header === 3 ? 'active' : ''}}"
|
||||||
|
data-name="header"
|
||||||
|
data-value="{{3}}"
|
||||||
|
>H3</text>
|
||||||
|
<t-icon
|
||||||
|
class="icon {{formats.bold ? 'active' : ''}}"
|
||||||
|
name="textformat-bold"
|
||||||
|
data-name="bold"
|
||||||
|
/>
|
||||||
|
<t-icon
|
||||||
|
class="icon {{formats.italic ? 'active' : ''}}"
|
||||||
|
name="textformat-italic"
|
||||||
|
data-name="italic"
|
||||||
|
/>
|
||||||
|
<t-icon
|
||||||
|
class="icon {{formats.underline ? 'active' : ''}}"
|
||||||
|
name="textformat-underline"
|
||||||
|
data-name="underline"
|
||||||
|
/>
|
||||||
|
<t-icon
|
||||||
|
class="icon"
|
||||||
|
name="task"
|
||||||
|
data-name="list"
|
||||||
|
data-value="check"
|
||||||
|
/>
|
||||||
|
<t-icon
|
||||||
|
class="icon {{formats.list === 'bullet' ? 'active' : ''}}"
|
||||||
|
name="bulletpoint"
|
||||||
|
data-name="list"
|
||||||
|
data-value="bullet"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* pages/main/portfolio/index.wxss */
|
/* pages/main/other/portfolio/index.wxss */
|
||||||
.portfolio-list {
|
.portfolio-list {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
// pages/main/portfolio/index.ts
|
// pages/main/other/portfolio/index.ts
|
||||||
|
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import config from "../../../config/index"
|
import config from "../../../../config/index"
|
||||||
import Events from "../../../utils/Events";
|
import Events from "../../../../utils/Events";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
import { Journal, JournalPage, JournalPageType } from "../../../types/Journal";
|
import { Journal, JournalPage, JournalPageType } from "../../../../types/Journal";
|
||||||
import { OrderType, } from "../../../types/Model";
|
import { OrderType, } from "../../../../types/Model";
|
||||||
import { PreviewImageMetadata } from "../../../types/Attachment";
|
import { PreviewImageMetadata } from "../../../../types/Attachment";
|
||||||
import { MediaItem, MediaItemType } from "../../../types/UI";
|
import { MediaItem, MediaItemType } from "../../../../types/UI";
|
||||||
import { JournalApi } from "../../../api/JournalApi";
|
import { JournalApi } from "../../../../api/JournalApi";
|
||||||
|
|
||||||
interface IPortfolioData {
|
interface IPortfolioData {
|
||||||
page: JournalPage;
|
page: JournalPage;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--pages/main/portfolio/index.wxml-->
|
<!--pages/main/other/portfolio/index.wxml-->
|
||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<t-navbar class="custom-navbar" title="专拍" />
|
<t-navbar class="custom-navbar" title="专拍" left-arrow placeholder />
|
||||||
</view>
|
</view>
|
||||||
<view class="portfolio-list">
|
<view class="portfolio-list">
|
||||||
<t-collapse class="collapse" expandMutex expandIcon>
|
<t-collapse class="collapse" expandMutex expandIcon>
|
||||||
@@ -4,6 +4,6 @@
|
|||||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||||
"t-button": "tdesign-miniprogram/button/button",
|
"t-button": "tdesign-miniprogram/button/button",
|
||||||
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
||||||
"snowflake": "../../../components/background/snowflake"
|
"snowflake": "/components/background/snowflake"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// pages/info/info.ts
|
// pages/info/info.ts
|
||||||
|
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import config from "../../../config/index"
|
import config from "../../../../config/index"
|
||||||
|
|
||||||
interface IAboutData {
|
interface IAboutData {
|
||||||
timer?: number;
|
timer?: number;
|
||||||
@@ -61,4 +61,4 @@ Page({
|
|||||||
"url": "/pages/index/index?from=info"
|
"url": "/pages/index/index?from=info"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<!--pages/info/info.wxml-->
|
<!--pages/info/info.wxml-->
|
||||||
<snowflake />
|
<snowflake />
|
||||||
<t-navbar title="关于我们" />
|
<t-navbar title="关于我们" placeholder />
|
||||||
<scroll-view class="info" scroll-y>
|
<scroll-view class="info" scroll-y>
|
||||||
<view class="cotainer">
|
<view class="cotainer">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<image class="logo" src="/assets/image/logo.png"></image>
|
<image class="logo" src="/assets/image/logo.jpg"></image>
|
||||||
<view>
|
<view>
|
||||||
<text>记录</text>
|
<text>记录</text>
|
||||||
<text class="name gao">小糕</text>
|
<text class="name gao">小糕</text>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="label">版本:</text>
|
<text class="label">版本:</text>
|
||||||
<text>1.6.6</text>
|
<text>1.7.0</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item copyright">
|
<view class="item copyright">
|
||||||
<text>{{copyright}}</text>
|
<text>{{copyright}}</text>
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
// pages/journal/index.ts
|
// pages/journal/index.ts
|
||||||
|
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import config from "../../../config/index"
|
import config from "../../../../config/index"
|
||||||
import Events from "../../../utils/Events";
|
import Events from "../../../../utils/Events";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
import { Journal, JournalPage, JournalPageType } from "../../../types/Journal";
|
import { Journal, JournalPage, JournalPageType } from "../../../../types/Journal";
|
||||||
import { OrderType } from "../../../types/Model";
|
import { OrderType } from "../../../../types/Model";
|
||||||
import { PreviewImageMetadata } from "../../../types/Attachment";
|
import { PreviewImageMetadata } from "../../../../types/Attachment";
|
||||||
import { MediaItem, MediaItemType } from "../../../types/UI";
|
import { MediaItem, MediaItemType } from "../../../../types/UI";
|
||||||
import { JournalApi } from "../../../api/JournalApi";
|
import { JournalApi } from "../../../../api/JournalApi";
|
||||||
|
|
||||||
interface JournalData {
|
interface JournalData {
|
||||||
page: JournalPage;
|
page: JournalPage;
|
||||||
@@ -126,22 +126,22 @@ Page({
|
|||||||
},
|
},
|
||||||
toCreater() {
|
toCreater() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
"url": "/pages/main/journal-editor/index?from=journal"
|
url: "/pages/main/journal/editor/index?from=journal"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toSearch() {
|
toSearch() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "/pages/main/journal-search/index"
|
url: "/pages/main/journal/search/index"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toMap() {
|
toMap() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "/pages/main/journal-map/index"
|
url: "/pages/main/journal/map/index"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toDate() {
|
toDate() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "/pages/main/journal-date/index"
|
url: "/pages/main/journal/date/index"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async fetch() {
|
async fetch() {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<t-navbar title="我们的记录">
|
<t-navbar title="我们的记录" placeholder>
|
||||||
<view slot="left" class="more" bind:tap="toggleMoreMenu">
|
<view slot="left" class="more" bind:tap="toggleMoreMenu">
|
||||||
<t-icon name="view-list" size="24px" />
|
<t-icon name="view-list" size="24px" />
|
||||||
</view>
|
</view>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
"t-button": "tdesign-miniprogram/button/button",
|
"t-button": "tdesign-miniprogram/button/button",
|
||||||
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
|
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
|
||||||
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
|
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
|
||||||
"journal-list": "../../../components/journal-list/index",
|
"journal-list": "/components/journal-list/index",
|
||||||
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
|
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
|
||||||
},
|
},
|
||||||
"styleIsolation": "shared"
|
"styleIsolation": "shared"
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
// pages/main/moment/index.ts
|
// pages/main/moment/index.ts
|
||||||
import config from "../../../config/index";
|
import config from "../../../../config/index";
|
||||||
import Events from "../../../utils/Events";
|
import Events from "../../../../utils/Events";
|
||||||
import IOSize, { Unit } from "../../../utils/IOSize";
|
import IOSize, { Unit } from "../../../../utils/IOSize";
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
import { Location, MediaItemType } from "../../../types/UI";
|
import { Location, MediaItemType } from "../../../../types/UI";
|
||||||
import { PreviewImageMetadata } from "../../../types/Attachment";
|
import { PreviewImageMetadata } from "../../../../types/Attachment";
|
||||||
import { MomentApi } from "../../../api/MomentApi";
|
import { MomentApi } from "../../../../api/MomentApi";
|
||||||
import { JournalApi } from "../../../api/JournalApi";
|
import { JournalApi } from "../../../../api/JournalApi";
|
||||||
import { Network } from "../../../utils/Network";
|
import { Network } from "../../../../utils/Network";
|
||||||
|
|
||||||
type Item = {
|
type Item = {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -459,4 +459,4 @@ Page({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--pages/main/moment/index.wxml-->
|
<!--pages/main/moment/index.wxml-->
|
||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<t-navbar class="custom-navbar" title="瞬间" />
|
<t-navbar class="custom-navbar" title="瞬间" placeholder />
|
||||||
</view>
|
</view>
|
||||||
<view class="moment">
|
<view class="moment">
|
||||||
<view class="tips">
|
<view class="tips">
|
||||||
7
miniprogram/pages/main/tabs/other/index.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
||||||
|
"t-cell": "tdesign-miniprogram/cell/cell",
|
||||||
|
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
miniprogram/pages/main/tabs/other/index.less
Normal file
33
miniprogram/pages/main/tabs/other/index.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
type NavItem = {
|
||||||
|
title: string;
|
||||||
|
icon: string;
|
||||||
|
url: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
interface OtherData {
|
||||||
|
navList: NavItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: <OtherData>{
|
||||||
|
navList: [
|
||||||
|
{
|
||||||
|
title: "备忘录",
|
||||||
|
icon: "task-checked",
|
||||||
|
url: "/pages/main/other/memo/index"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "专拍",
|
||||||
|
icon: "face-retouching",
|
||||||
|
url: "/pages/main/other/portfolio/index"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
onNavTap(e: WechatMiniprogram.BaseEvent) {
|
||||||
|
const { url } = e.currentTarget.dataset as { url?: string };
|
||||||
|
if (!url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wx.navigateTo({ url });
|
||||||
|
}
|
||||||
|
});
|
||||||
17
miniprogram/pages/main/tabs/other/index.wxml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<view class="custom-navbar">
|
||||||
|
<t-navbar title="其他" placeholder />
|
||||||
|
</view>
|
||||||
|
<view class="setting-bg">
|
||||||
|
<t-cell-group class="list">
|
||||||
|
<t-cell
|
||||||
|
wx:for="{{navList}}"
|
||||||
|
wx:for-item="item"
|
||||||
|
wx:key="title"
|
||||||
|
title="{{item.title}}"
|
||||||
|
leftIcon="{{item.icon}}"
|
||||||
|
arrow
|
||||||
|
bind:tap="onNavTap"
|
||||||
|
data-url="{{item.url}}"
|
||||||
|
/>
|
||||||
|
</t-cell-group>
|
||||||
|
</view>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// pages/main/travel/index.ts
|
// pages/main/travel/index.ts
|
||||||
|
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import { TravelApi } from "../../../api/TravelApi";
|
import { TravelApi } from "../../../../api/TravelApi";
|
||||||
import { Travel, TravelPage, TravelStatus, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TransportationTypeIcon } from "../../../types/Travel";
|
import { Travel, TravelPage, TravelStatus, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TransportationTypeIcon } from "../../../../types/Travel";
|
||||||
|
|
||||||
interface TravelData {
|
interface TravelData {
|
||||||
/** 分页参数 */
|
/** 分页参数 */
|
||||||
@@ -163,14 +163,14 @@ Page({
|
|||||||
/** 新建出行 */
|
/** 新建出行 */
|
||||||
toCreate() {
|
toCreate() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "/pages/main/travel-editor/index"
|
url: "/pages/main/travel/editor/index"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 查看详情 */
|
/** 查看详情 */
|
||||||
toDetail(e: WechatMiniprogram.BaseEvent) {
|
toDetail(e: WechatMiniprogram.BaseEvent) {
|
||||||
const { id } = e.currentTarget.dataset;
|
const { id } = e.currentTarget.dataset;
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/travel-detail/index?id=${id}`
|
url: `/pages/main/travel/detail/index?id=${id}`
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--pages/main/travel/index.wxml-->
|
<!--pages/main/travel/index.wxml-->
|
||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<t-navbar title="出行计划">
|
<t-navbar title="出行计划" placeholder>
|
||||||
<view slot="left" class="filter-btn" bind:tap="toggleFilterMenu">
|
<view slot="left" class="filter-btn" bind:tap="toggleFilterMenu">
|
||||||
<t-icon name="filter" size="24px" />
|
<t-icon name="filter" size="24px" />
|
||||||
</view>
|
</view>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// pages/main/travel-detail/index.less
|
// pages/main/travel/detail/index.less
|
||||||
|
|
||||||
.travel-detail {
|
.travel-detail {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// pages/main/travel-detail/index.ts
|
// pages/main/travel/detail/index.ts
|
||||||
|
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import { TravelApi } from "../../../api/TravelApi";
|
import { TravelApi } from "../../../../api/TravelApi";
|
||||||
import { TravelLocationApi } from "../../../api/TravelLocationApi";
|
import { TravelLocationApi } from "../../../../api/TravelLocationApi";
|
||||||
import config from "../../../config/index";
|
import config from "../../../../config/index";
|
||||||
import { Travel, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TravelLocation, TravelLocationTypeLabel, TravelLocationTypeIcon, TransportationTypeIcon, TravelLocationType } from "../../../types/Travel";
|
import { Travel, TravelStatusLabel, TravelStatusIcon, TransportationTypeLabel, TravelLocation, TravelLocationTypeLabel, TravelLocationTypeIcon, TransportationTypeIcon, TravelLocationType } from "../../../../types/Travel";
|
||||||
|
|
||||||
interface TravelLocationView extends TravelLocation {
|
interface TravelLocationView extends TravelLocation {
|
||||||
/** 预览图 */
|
/** 预览图 */
|
||||||
@@ -174,7 +174,7 @@ Page({
|
|||||||
const { travel } = this.data;
|
const { travel } = this.data;
|
||||||
if (travel && travel.id) {
|
if (travel && travel.id) {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/travel-editor/index?id=${travel.id}`
|
url: `/pages/main/travel/editor/index?id=${travel.id}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -184,7 +184,7 @@ Page({
|
|||||||
const { travel } = this.data;
|
const { travel } = this.data;
|
||||||
if (travel && travel.id) {
|
if (travel && travel.id) {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/travel-location-editor/index?travelId=${travel.id}`
|
url: `/pages/main/travel/location-editor/index?travelId=${travel.id}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -195,7 +195,7 @@ Page({
|
|||||||
const { travel } = this.data;
|
const { travel } = this.data;
|
||||||
if (id && travel && travel.id) {
|
if (id && travel && travel.id) {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/travel-location-detail/index?id=${id}&travelId=${travel.id}`
|
url: `/pages/main/travel/location-detail/index?id=${id}&travelId=${travel.id}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -205,7 +205,7 @@ Page({
|
|||||||
const { travel } = this.data;
|
const { travel } = this.data;
|
||||||
if (travel && travel.id) {
|
if (travel && travel.id) {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/travel-location-map/index?travelId=${travel.id}`
|
url: `/pages/main/travel/location-map/index?travelId=${travel.id}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--pages/main/travel-detail/index.wxml-->
|
<!--pages/main/travel/detail/index.wxml-->
|
||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<t-navbar title="出行详情" leftArrow bind:go-back="goBack">
|
<t-navbar title="出行详情" leftArrow placeholder bind:go-back="goBack">
|
||||||
<view slot="right" class="edit-btn" bind:tap="toEdit">
|
<view slot="right" class="edit-btn" bind:tap="toEdit">
|
||||||
<t-icon name="edit" size="24px" />
|
<t-icon name="edit" size="24px" />
|
||||||
</view>
|
</view>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// pages/main/travel-editor/index.less
|
// pages/main/travel/editor/index.less
|
||||||
|
|
||||||
.travel-editor {
|
.travel-editor {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// pages/main/travel-editor/index.ts
|
// pages/main/travel/editor/index.ts
|
||||||
|
|
||||||
import Time from "../../../utils/Time";
|
import Time from "../../../../utils/Time";
|
||||||
import { TravelApi } from "../../../api/TravelApi";
|
import { TravelApi } from "../../../../api/TravelApi";
|
||||||
import { TravelStatus, TransportationType } from "../../../types/Travel";
|
import { TravelStatus, TransportationType } from "../../../../types/Travel";
|
||||||
|
|
||||||
interface TravelEditorData {
|
interface TravelEditorData {
|
||||||
/** 模式:create 或 edit */
|
/** 模式:create 或 edit */
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--pages/main/travel-editor/index.wxml-->
|
<!--pages/main/travel/editor/index.wxml-->
|
||||||
<t-navbar title="{{mode === 'create' ? '新建出行' : '编辑出行'}}">
|
<t-navbar title="{{mode === 'create' ? '新建出行' : '编辑出行'}}" placeholder>
|
||||||
<text slot="left" bindtap="cancel">取消</text>
|
<text slot="left" bindtap="cancel">取消</text>
|
||||||
</t-navbar>
|
</t-navbar>
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// pages/main/travel-location-detail/index.less
|
// pages/main/travel/location-detail/index.less
|
||||||
.travel-location-detail {
|
.travel-location-detail {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
// pages/main/travel-location-detail/index.ts
|
// pages/main/travel/location-detail/index.ts
|
||||||
|
|
||||||
import config from "../../../config/index";
|
import config from "../../../../config/index";
|
||||||
import { TravelLocationApi } from "../../../api/TravelLocationApi";
|
import { TravelLocationApi } from "../../../../api/TravelLocationApi";
|
||||||
import { TravelLocation, TravelLocationTypeIcon, TravelLocationTypeLabel } from "../../../types/Travel";
|
import { TravelLocation, TravelLocationTypeIcon, TravelLocationTypeLabel } from "../../../../types/Travel";
|
||||||
import { MediaAttachType, PreviewImageMetadata } from "../../../types/Attachment";
|
import { MediaAttachType, PreviewImageMetadata } from "../../../../types/Attachment";
|
||||||
import { MapMarker, MediaItem, MediaItemType } from "../../../types/UI";
|
import { MapMarker, MediaItem, MediaItemType } from "../../../../types/UI";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
|
|
||||||
interface TravelLocationView extends TravelLocation {
|
interface TravelLocationView extends TravelLocation {
|
||||||
/** 媒体列表 */
|
/** 媒体列表 */
|
||||||
@@ -161,7 +161,7 @@ Page({
|
|||||||
const { location, travelId } = this.data;
|
const { location, travelId } = this.data;
|
||||||
if (location && location.id) {
|
if (location && location.id) {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/main/travel-location-editor/index?id=${location.id}&travelId=${travelId || location.travelId || ""}`
|
url: `/pages/main/travel/location-editor/index?id=${location.id}&travelId=${travelId || location.travelId || ""}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--pages/main/travel-location-detail/index.wxml-->
|
<!--pages/main/travel/location-detail/index.wxml-->
|
||||||
<view class="custom-navbar">
|
<view class="custom-navbar">
|
||||||
<t-navbar title="地点详情" leftArrow bind:go-back="goBack">
|
<t-navbar title="地点详情" leftArrow placeholder bind:go-back="goBack">
|
||||||
<view slot="right" class="edit-btn" bind:tap="toEdit">
|
<view slot="right" class="edit-btn" bind:tap="toEdit">
|
||||||
<t-icon name="edit" size="24px" />
|
<t-icon name="edit" size="24px" />
|
||||||
</view>
|
</view>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// pages/main/travel-location-editor/index.less
|
// pages/main/travel/location-editor/index.less
|
||||||
|
|
||||||
.travel-location-editor {
|
.travel-location-editor {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
// pages/main/travel-location-editor/index.ts
|
// pages/main/travel/location-editor/index.ts
|
||||||
|
|
||||||
import { Network, WechatMediaItem } from "../../../utils/Network";
|
import { Network, WechatMediaItem } from "../../../../utils/Network";
|
||||||
import { TravelLocationApi } from "../../../api/TravelLocationApi";
|
import { TravelLocationApi } from "../../../../api/TravelLocationApi";
|
||||||
import { TravelLocationType, TravelLocationTypeLabel } from "../../../types/Travel";
|
import { TravelLocationType, TravelLocationTypeLabel } from "../../../../types/Travel";
|
||||||
import { MediaAttachType, PreviewImageMetadata } from "../../../types/Attachment";
|
import { MediaAttachType, PreviewImageMetadata } from "../../../../types/Attachment";
|
||||||
import config from "../../../config/index";
|
import config from "../../../../config/index";
|
||||||
import { MediaItem, MediaItemType } from "../../../types/UI";
|
import { MediaItem, MediaItemType } from "../../../../types/UI";
|
||||||
|
|
||||||
interface TravelLocationEditorData {
|
interface TravelLocationEditorData {
|
||||||
/** 模式:create 或 edit */
|
/** 模式:create 或 edit */
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--pages/main/travel-location-editor/index.wxml-->
|
<!--pages/main/travel/location-editor/index.wxml-->
|
||||||
<t-navbar title="{{mode === 'create' ? '添加地点' : '编辑地点'}}">
|
<t-navbar title="{{mode === 'create' ? '添加地点' : '编辑地点'}}" placeholder>
|
||||||
<text slot="left" bindtap="cancel">取消</text>
|
<text slot="left" bindtap="cancel">取消</text>
|
||||||
</t-navbar>
|
</t-navbar>
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* pages/main/travel-location-map/index.less */
|
/* pages/main/travel/location-map/index.less */
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// pages/main/travel-location-map/index.ts
|
// pages/main/travel/location-map/index.ts
|
||||||
|
|
||||||
import { TravelLocationApi } from "../../../api/TravelLocationApi";
|
import { TravelLocationApi } from "../../../../api/TravelLocationApi";
|
||||||
import { TravelLocation, TravelLocationTypeLabel } from "../../../types/Travel";
|
import { TravelLocation, TravelLocationTypeLabel } from "../../../../types/Travel";
|
||||||
import Toolkit from "../../../utils/Toolkit";
|
import Toolkit from "../../../../utils/Toolkit";
|
||||||
|
|
||||||
interface MapMarker {
|
interface MapMarker {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--pages/main/travel-location-map/index.wxml-->
|
<!--pages/main/travel/location-map/index.wxml-->
|
||||||
<t-navbar title="地点地图" left-arrow />
|
<t-navbar title="地点地图" left-arrow placeholder />
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<map
|
<map
|
||||||
id="travel-location-map"
|
id="travel-location-map"
|
||||||
@@ -12,12 +12,12 @@
|
|||||||
"tabBarBorderStyle": "white",
|
"tabBarBorderStyle": "white",
|
||||||
"tabBarIconJournal": "assets/icon/light/journal.png",
|
"tabBarIconJournal": "assets/icon/light/journal.png",
|
||||||
"tabBarIconJournalActive": "assets/icon/light/journal_active.png",
|
"tabBarIconJournalActive": "assets/icon/light/journal_active.png",
|
||||||
"tabBarIconPortfolio": "assets/icon/light/portfolio.png",
|
|
||||||
"tabBarIconPortfolioActive": "assets/icon/light/portfolio_active.png",
|
|
||||||
"tabBarIconMoment": "assets/icon/light/moment.png",
|
"tabBarIconMoment": "assets/icon/light/moment.png",
|
||||||
"tabBarIconMomentActive": "assets/icon/light/moment_active.png",
|
"tabBarIconMomentActive": "assets/icon/light/moment_active.png",
|
||||||
"tabBarIconTravel": "assets/icon/light/travel.png",
|
"tabBarIconTravel": "assets/icon/light/travel.png",
|
||||||
"tabBarIconTravelActive": "assets/icon/light/travel_active.png",
|
"tabBarIconTravelActive": "assets/icon/light/travel_active.png",
|
||||||
|
"tabBarIconOther": "assets/icon/light/other.png",
|
||||||
|
"tabBarIconOtherActive": "assets/icon/light/other_active.png",
|
||||||
"tabBarIconInfo": "assets/icon/light/info.png",
|
"tabBarIconInfo": "assets/icon/light/info.png",
|
||||||
"tabBarIconInfoActive": "assets/icon/light/info_active.png"
|
"tabBarIconInfoActive": "assets/icon/light/info_active.png"
|
||||||
},
|
},
|
||||||
@@ -34,12 +34,12 @@
|
|||||||
"tabBarBorderStyle": "black",
|
"tabBarBorderStyle": "black",
|
||||||
"tabBarIconJournal": "assets/icon/dark/journal.png",
|
"tabBarIconJournal": "assets/icon/dark/journal.png",
|
||||||
"tabBarIconJournalActive": "assets/icon/dark/journal_active.png",
|
"tabBarIconJournalActive": "assets/icon/dark/journal_active.png",
|
||||||
"tabBarIconPortfolio": "assets/icon/dark/portfolio.png",
|
|
||||||
"tabBarIconPortfolioActive": "assets/icon/dark/portfolio_active.png",
|
|
||||||
"tabBarIconMoment": "assets/icon/dark/moment.png",
|
"tabBarIconMoment": "assets/icon/dark/moment.png",
|
||||||
"tabBarIconMomentActive": "assets/icon/dark/moment_active.png",
|
"tabBarIconMomentActive": "assets/icon/dark/moment_active.png",
|
||||||
"tabBarIconTravel": "assets/icon/dark/travel.png",
|
"tabBarIconTravel": "assets/icon/dark/travel.png",
|
||||||
"tabBarIconTravelActive": "assets/icon/dark/travel_active.png",
|
"tabBarIconTravelActive": "assets/icon/dark/travel_active.png",
|
||||||
|
"tabBarIconOther": "assets/icon/dark/other.png",
|
||||||
|
"tabBarIconOtherActive": "assets/icon/dark/other_active.png",
|
||||||
"tabBarIconInfo": "assets/icon/dark/info.png",
|
"tabBarIconInfo": "assets/icon/dark/info.png",
|
||||||
"tabBarIconInfoActive": "assets/icon/dark/info_active.png"
|
"tabBarIconInfoActive": "assets/icon/dark/info_active.png"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
"tabIndent": "tab",
|
"tabIndent": "tab",
|
||||||
"tabSize": 4
|
"tabSize": 4
|
||||||
},
|
},
|
||||||
"libVersion": "3.10.1",
|
"libVersion": "3.11.3",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"include": []
|
"include": []
|
||||||
|
|||||||