修改:优化恋爱日记配置信息

This commit is contained in:
小莫唐尼 2022-12-11 17:41:31 +08:00
parent b7e2025ebb
commit 1305b4a555
6 changed files with 291 additions and 137 deletions

1
.gitignore vendored
View File

@ -2,4 +2,5 @@ node_modules/
unpackage/
config/halo.config.js
config/ad.config.js
config/love.config.js
package-lock.json

View File

@ -2,7 +2,6 @@
* 恋爱日记配置
*/
export default {
photoKeyName: '恋爱相册', // 对应后台的图库分组名称
waveImageUrl: 'https://b.925i.cn/uni_halo/uni_halo_about_wave.gif', // 波浪图片地址
bgImageUrl: 'https://b.925i.cn/uni_halo_love/love_bg1.png', // 背景图片
loveImageUrl: 'https://b.925i.cn/uni_halo_love/like.png', // 爱心图片
@ -12,19 +11,49 @@ export default {
avatar: 'https://b.925i.cn/uni_halo_love/love_boy.png',
birthday: '2022-09-25', // 生日
},
girl: {
name: '未知女主',
avatar: 'https://b.925i.cn/uni_halo_love/love_girl.png',
birthday: '2022-07-25', // 生日
},
loveStartDate: '2022-05-20 13:14:20', // 恋爱开始时间
timeTitle: '这是我们一起走过的',
// 我们的故事
story: `
loveStartDate: '2022-05-20 13:14:20', // 恋爱开始时间
nav: [{
key: 'journey',
use: true,
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
title: '关于我们',
desc: '我们一起度过的那些经历'
},
{
key: 'album',
use: true,
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
title: '恋爱相册',
desc: '定格了我们的那些小美好'
},
{
key: 'list',
use: true,
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
title: '恋爱清单',
desc: '你我之间的约定我们都在努力实现'
},
],
// 关于我们:支持富文本内容
journey: `
<p>有一只马它的邻居是一只驴</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
`,
// 恋爱相册
albumKeyName: '恋爱相册', // 对应后台的图库分组名称
// 恋爱清单
loveList: [{
loveList: {
useApi: false, // 是否启用api接口
api: '', // api 接口如果使用api接口的方式则下方的data可以留空但是api接口必须按照对应的数据格式返回
data: [{
index: 0, // 序号
finish: true, // 是否已完成
title: '偷偷记录对方熟睡的模样', // 事件名称
@ -115,4 +144,5 @@ export default {
}
}
],
}
}

View File

@ -2,7 +2,6 @@
* 恋爱日记配置
*/
export default {
photoKeyName: '情侣相册', // 对应后台的图库分组名称
waveImageUrl: 'https://b.925i.cn/uni_halo/uni_halo_about_wave.gif', // 波浪图片地址
bgImageUrl: 'https://b.925i.cn/uni_halo_love/love_bg1.png', // 背景图片
loveImageUrl: 'https://b.925i.cn/uni_halo_love/like.png', // 爱心图片
@ -12,28 +11,140 @@ export default {
avatar: 'https://b.925i.cn/uni_halo_love/love_boy.png',
birthday: '2022-09-25', // 生日
},
girl: {
name: '未知女主',
avatar: 'https://b.925i.cn/uni_halo_love/love_girl.png',
birthday: '2022-07-25', // 生日
},
timeTitle: '这是我们一起走过的', // 恋爱时间标题
loveStartDate: '2022-05-20 13:14:20', // 恋爱开始时间
timeTitle: '这是我们一起走过的',
// 恋爱日记首页导航(除了 key 以外都可以修改)
nav: [{
key: 'journey',
use: true,
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
title: '关于我们',
desc: '我们一起度过的那些经历'
},
{
key: 'album',
use: true,
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
title: '恋爱相册',
desc: '定格了我们的那些小美好'
},
{
key: 'list',
use: true,
iconImageUrl: 'https://b.925i.cn/uni_halo_love/diandian.png',
title: '恋爱清单',
desc: '你我之间的约定我们都在努力实现'
},
],
// 关于我们:支持富文本内容
journey: `
<p>有一只马它的邻居是一只驴</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
`,
// 恋爱相册
albumKeyName: '恋爱相册', // 对应后台的图库分组名称
// 恋爱清单
loveList: [{
index: 1, // 序号
loveList: {
useApi: false, // 是否启用api接口
api: '', // api 接口如果使用api接口的方式则下方的data可以留空但是api接口必须按照对应的数据格式返回
data: [{
index: 0, // 序号
finish: true, // 是否已完成
title: '陪对方过生日', // 事件名称
desc: '陪对方一起过生日', // 事件描述
moment: '很难忘的一次生日,他陪我我陪他反正就是很难忘', // 完成瞬间的记录
title: '偷偷记录对方熟睡的模样', // 事件名称
desc: '偷偷观察对方熟睡的模样,记录下来', // 事件描述
detail: {
start: '2022年05月20日', // 计划开始时间
desc: '偷偷观察对方熟睡的模样,记录下来', // 事件详细描述
end: '每天', // 完成时间,
moment: '', // 完成瞬间的记录
other: '', // 其他说明
}
}, {
index: 1,
finish: false,
title: '陪对方过生日',
desc: '陪对方一起过生日',
detail: {
start: '2023年05月20日',
desc: '陪对方一起过生日,他和我的生日',
end: '',
moment: '',
other: '他 生日5月20日 我生日9月25日',
}
},
{
index: 2,
finish: false,
title: '一起去旅行',
desc: '一起来一场说走就走的旅行,希望去的是大理',
moment: '',
detail: {
start: '',
desc: '',
end: '',
moment: '一起来一场说走就走的旅行,希望去的是大理',
other: '',
}
},
// 更多...
{
index: 3,
finish: false,
title: '一起穿情侣装逛街',
desc: '一起穿情侣装逛街',
detail: {
start: '',
desc: '',
end: '',
moment: '',
other: '',
}
},
{
index: 4,
finish: false,
title: '一起看日出',
desc: '一起看日出',
detail: {
start: '',
desc: '',
end: '',
moment: '',
other: '',
}
},
{
index: 5,
finish: false,
title: '一起看日落',
desc: '一起看日落',
detail: {
start: '',
desc: '',
end: '',
moment: '',
other: '', // 其他说明
}
},
{
index: 6,
finish: false,
title: '一起买菜、做饭、刷碗',
desc: '一起买菜、做饭、刷碗',
detail: {
start: '',
desc: '',
end: '',
moment: '',
other: '',
}
}
],
}
}

View File

@ -23,7 +23,7 @@ export default {
methods: {
fnInit() {
clearTimeout(this.timer);
const _html = LoveConfig.story;
const _html = LoveConfig.journey;
let _index = 0;
const _typing = () => {
this.timer = setTimeout(() => {

View File

@ -99,14 +99,38 @@ export default {
}
},
created() {
this.fnFormatList();
this.fnGetList();
},
methods: {
fnFormatList() {
this.list = LoveConfig.loveList.map(item => {
fnGetList() {
if (LoveConfig.loveList.useApi && LoveConfig.loveList.api) {
uni.request({
url: LoveConfig.loveList.api,
header: {
ContentType: 'application/json'
},
method: 'GET',
dataType: 'json',
success: res => {
if (res.statusCode == 200 && res.data.status == 200) {
this.list = res.data.data.map(item => {
item['open'] = false;
return item;
});
} else {
uni.$tm.toast('数据请求失败,请检查接口!');
}
},
fail: err => {
uni.$tm.toast('数据请求失败,请检查接口!');
}
});
} else {
this.list = LoveConfig.loveList.data.map(item => {
item['open'] = false;
return item;
});
}
},
fnOnItemOpen(item) {
item.open = !item.open;
@ -141,7 +165,7 @@ export default {
rgba(109, 186, 130, 0.1)
);
// background: rgba(247, 246, 242, 1);
color: #55423b;
// color: #55423b;
}
.love-card {
width: 100%;

View File

@ -40,27 +40,15 @@
</view>
<!-- 功能导航 -->
<view class="list-wrap">
<view class="list-item" @click="fnToPage('journey')">
<view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
<block v-for="(nav, index) in loveConfig.nav" :key="index">
<view v-if="nav.use" class="list-item" @click="fnToPage(nav.key)">
<view class="left"><image class="icon" :src="nav.iconImageUrl" mode="aspectFit"></image></view>
<view class="right">
<view class="name">关于我们</view>
<view class="desc">我们一起度过的那些经历</view>
</view>
</view>
<view class="list-item" @click="fnToPage('album')">
<view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
<view class="right">
<view class="name">恋爱相册</view>
<view class="desc">定格了我们的那些小美好</view>
</view>
</view>
<view class="list-item" @click="fnToPage('list')">
<view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
<view class="right">
<view class="name">恋爱清单</view>
<view class="desc">你我之间的约定我们都在努力实现</view>
<view class="name">{{ nav.title }}</view>
<view class="desc">{{ nav.desc }}</view>
</view>
</view>
</block>
</view>
</view>
</template>