Skip to content

Commit

Permalink
fix: some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim committed Oct 27, 2022
1 parent f72cb45 commit 99e2040
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cloudfunctions/setCookbook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ exports.main = async (event) => {
}
}

return res
return null
}
4 changes: 2 additions & 2 deletions miniprogram/config/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const chineseMap = {
export const chineseMap = {
breakfast: '早餐',
condiment: '佐料',
dessert: '甜品',
Expand All @@ -9,7 +9,7 @@ const chineseMap = {
'staple': '主食'
}

const titleMap = {
export const titleMap = {
breakfast: '早餐 Breakfast',
condiment: '佐料 Condiment',
dessert: '甜品 Dessert',
Expand Down
2 changes: 1 addition & 1 deletion miniprogram/pages/detail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Page({
},

toMyCenter() {
wx.navigateTo({
wx.switchTab({
url: '/pages/my/index'
})
},
Expand Down
6 changes: 2 additions & 4 deletions miniprogram/pages/detail/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@

<view class="actions actions--{{done ? 'active' : ''}}">
<t-button-group>
<t-button t-class="actions__button" size="large" block data-type="liked" bind:tap="toggleStarOrLike">
<t-icon name="heart{{liked ? '-filled' : ''}}" color="{{liked ? '#e34d59' : ''}}" size="36rpx" class="actions__icon"/>
<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' } }}">
<text class="actions__text">{{likeds ? likeds + ' 人' : ''}}喜欢</text>
</t-button>
<t-button t-class="actions__button" size="large" block data-type="starred" bind:tap="toggleStarOrLike">
<t-icon name="star{{starred ? '-filled' : ''}}" color="{{starred ? '#ed7b2f': ''}}" size="36rpx" class="actions__icon"/>
<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' } }}">
<text class="actions__text">收藏</text>
</t-button>
</t-button-group>
Expand Down
6 changes: 3 additions & 3 deletions miniprogram/pages/index/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import infos from '../../data'
import utils from '../../utils/index.js'
import config from '../../config/index.js'
import { chineseMap, titleMap } from '../../config/index.js'
import Toast from 'tdesign-miniprogram/toast/index';

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

handleTap(e) {
const { id } = e.currentTarget.dataset;
const { id } = e.detail.item;

wx.navigateTo({
url: '../detail/index?id=' + id
Expand Down
1 change: 1 addition & 0 deletions miniprogram/pages/index/index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"navigationBarTitleText": "程序员做饭",
"navigationStyle": "custom",
"backgroundColor": "#fff",
"usingComponents": {
}
Expand Down
4 changes: 3 additions & 1 deletion miniprogram/pages/index/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

page {
padding-bottom: 100px;
}

.brand {
display: flex;
Expand Down
1 change: 1 addition & 0 deletions retry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"retry":[]}

0 comments on commit 99e2040

Please sign in to comment.