Skip to content

Commit 99e2040

Browse files
committed
fix: some bugs
1 parent f72cb45 commit 99e2040

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed

cloudfunctions/setCookbook/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ exports.main = async (event) => {
6262
}
6363
}
6464

65-
return res
65+
return null
6666
}

miniprogram/config/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const chineseMap = {
1+
export const chineseMap = {
22
breakfast: '早餐',
33
condiment: '佐料',
44
dessert: '甜品',
@@ -9,7 +9,7 @@ const chineseMap = {
99
'staple': '主食'
1010
}
1111

12-
const titleMap = {
12+
export const titleMap = {
1313
breakfast: '早餐 Breakfast',
1414
condiment: '佐料 Condiment',
1515
dessert: '甜品 Dessert',

miniprogram/pages/detail/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Page({
8282
},
8383

8484
toMyCenter() {
85-
wx.navigateTo({
85+
wx.switchTab({
8686
url: '/pages/my/index'
8787
})
8888
},

miniprogram/pages/detail/index.wxml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@
8585

8686
<view class="actions actions--{{done ? 'active' : ''}}">
8787
<t-button-group>
88-
<t-button t-class="actions__button" size="large" block data-type="liked" bind:tap="toggleStarOrLike">
89-
<t-icon name="heart{{liked ? '-filled' : ''}}" color="{{liked ? '#e34d59' : ''}}" size="36rpx" class="actions__icon"/>
88+
<t-button t-class="actions__button" size="large" block data-type="liked" bind:tap="toggleStarOrLike" icon-props="{{ { name: liked ? 'heart-filled' : 'heart', color: liked ? '#e34d59': '', size: '36rpx' } }}">
9089
<text class="actions__text">{{likeds ? likeds + ' 人' : ''}}喜欢</text>
9190
</t-button>
92-
<t-button t-class="actions__button" size="large" block data-type="starred" bind:tap="toggleStarOrLike">
93-
<t-icon name="star{{starred ? '-filled' : ''}}" color="{{starred ? '#ed7b2f': ''}}" size="36rpx" class="actions__icon"/>
91+
<t-button t-class="actions__button" size="large" block data-type="starred" bind:tap="toggleStarOrLike" icon-props="{{ { name: starred ? 'star-filled' : 'star', color: starred ? '#ed7b2f': '', size: '36rpx' } }}">
9492
<text class="actions__text">收藏</text>
9593
</t-button>
9694
</t-button-group>

miniprogram/pages/index/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import infos from '../../data'
22
import utils from '../../utils/index.js'
3-
import config from '../../config/index.js'
3+
import { chineseMap, titleMap } from '../../config/index.js'
44
import Toast from 'tdesign-miniprogram/toast/index';
55

66
let isSubscribeShow = false;
@@ -17,7 +17,7 @@ Page({
1717
const menu = utils.groupBy(infos, 'category');
1818
const list = Object.entries(menu).filter(([item]) => item !== 'template').map(([catetory, list]) => {
1919
return {
20-
name: config.titleMap[catetory],
20+
name: titleMap[catetory],
2121
icon: `/assets/images/${catetory}.png`,
2222
list
2323
}
@@ -41,7 +41,7 @@ Page({
4141
},
4242

4343
handleTap(e) {
44-
const { id } = e.currentTarget.dataset;
44+
const { id } = e.detail.item;
4545

4646
wx.navigateTo({
4747
url: '../detail/index?id=' + id

miniprogram/pages/index/index.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"navigationBarTitleText": "程序员做饭",
3+
"navigationStyle": "custom",
34
"backgroundColor": "#fff",
45
"usingComponents": {
56
}

miniprogram/pages/index/index.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
1+
page {
2+
padding-bottom: 100px;
3+
}
24

35
.brand {
46
display: flex;

retry.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"retry":[]}

0 commit comments

Comments
 (0)