Browse Source

部分bug处理

master
kola-web 3 months ago
parent
commit
ae1bb03f26
  1. 316
      keymap.json
  2. 2
      src/components/global-toast/index.wxml
  3. BIN
      src/images/empty-search.png
  4. 5
      src/pages/classify/index.scss
  5. 3
      src/pages/classify/index.ts
  6. 54
      src/pages/classify/index.wxml
  7. 5
      src/pages/home/index.scss
  8. 11
      src/pages/home/index.ts
  9. 27
      src/pages/home/index.wxml
  10. 1
      src/pages/my/index.scss
  11. 2
      src/pages/my/index.ts
  12. 31
      src/pages/my/index.wxml
  13. 7
      src/pages/search/index.ts
  14. 27
      src/pages/search/index.wxml

316
keymap.json

@ -0,0 +1,316 @@ @@ -0,0 +1,316 @@
[
// emmet
{
"key": "alt+e",
"command": "workbench.action.showEmmetCommands"
},
// console
{
"key": "ctrl+shift+l",
"command": "js-console.insertConsoleLog",
"when": "editorTextFocus"
},
{
"key": "shift+alt+l",
"command": "-js-console.insertConsoleLog",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+t",
"command": "js-console.insertConsoleTable",
"when": "editorTextFocus"
},
{
"key": "shift+alt+t",
"command": "-js-console.insertConsoleTable",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+w",
"command": "js-console.insertConsoleWarn",
"when": "editorTextFocus"
},
{
"key": "shift+alt+w",
"command": "-js-console.insertConsoleWarn",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+d",
"command": "workbench.debug.panel.action.clearReplAction"
},
{
"key": "ctrl+shift+e",
"command": "js-console.insertConsoleError",
"when": "editorTextFocus"
},
{
"key": "shift+alt+e",
"command": "-js-console.insertConsoleError",
"when": "editorTextFocus"
},
// Explorer
{
"key": "enter",
"command": "list.select",
"when": "listFocus && !inputFocus"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "shift+a",
"command": "explorer.newFolder",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "y",
"command": "filesExplorer.copy",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "x",
"command": "filesExplorer.cut",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "p",
"command": "filesExplorer.paste",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "m",
"command": "workbench.files.action.refreshFilesExplorer",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
// {
// "key": "m",
// "command": "editor.action.showContextMenu",
// "when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
// },
{
"key": "q",
"command": "workbench.action.toggleSidebarVisibility",
"when": "explorerResourceMoveableToTrash && explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
// "command": "workbench.files.action.refreshFilesExplorer",
{
"key": "d",
"command": "moveFileToTrash",
"when": "explorerResourceMoveableToTrash && explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
{
"key": "shift+d",
"command": "deleteFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
{
"key": "c",
"command": "workbench.files.action.collapseExplorerFolders",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
{
"key": "s",
"command": "explorer.openToSide",
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
},
{
"key": "f",
"command": "revealFileInOS",
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
},
{
"key": "t",
"command": "openInTerminal",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "u",
"command": "copyFilePath",
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
},
{
"key": "i",
"command": "copyRelativeFilePath",
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
},
// select
{
"key": "ctrl+n",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+p",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
// focus
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft",
"when": "terminalFocus || sideBarFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight",
"when": "terminalFocus || sideBarFocus"
},
{
"key": "ctrl+p",
"command": "workbench.action.navigateUp",
"when": "terminalFocus || sideBarFocus"
},
{
"key": "ctrl+n",
"command": "workbench.action.navigateDown",
"when": "terminalFocus || sideBarFocus"
},
// changeCase
{
"key": "alt+;",
"command": "extension.changeCase.commands"
},
// focus
{
"key": "alt+`",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "alt+1",
"command": "workbench.view.explorer"
},
{
"key": "alt-2",
"command": "outline.focus"
},
{
"key": "alt-3",
"command": "workbench.view.extension.project-manager"
},
{
"key": "alt-4",
"command": "todo-tree-view.focus"
},
{
"key": "alt-5",
"command": "workbench.view.extension.dockerView"
},
{
"key": "alt+9",
"command": "workbench.view.scm"
},
{
"key": "alt-0",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "tab",
"command": "markdown.extension.onTabKey",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown' && vim.mode =='Insert'"
},
{
"key": "tab",
"command": "-markdown.extension.onTabKey",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
},
{
"key": "shift+tab",
"command": "-markdown.extension.onShiftTabKey",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
},
{
"key": "shift+tab",
"command": "markdown.extension.onShiftTabKey",
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown' && vim.mode =='Insert'"
},
// nav buffer
{
"key": "tab",
"command": "workbench.action.nextEditor",
"when": "vim.mode != 'Insert' && vim.mode != 'CommandlineInProgress' && !panelFocus"
},
{
"key": "shift+tab",
"command": "workbench.action.previousEditor",
"when": "vim.mode != 'Insert' && vim.mode != 'CommandlineInProgress' && !panelFocus"
},
//
{
"key": "alt+-",
"command": "color-conversion.colorConversion",
"when": "editorTextFocus && editorHasSelection"
},
// whichkey
{
"key": "space",
"command": "whichkey.show",
"when": "!inputFocus"
},
{
"key": "e",
"command": "whichkey.triggerKey",
"args": {
"key": "e",
"when": "sideBarVisible && explorerViewletVisible"
},
"when": "whichkeyVisible && sideBarVisible && explorerViewletVisible"
},
//
{
"key": "shift+ctrl+0",
"command": "workbench.action.evenEditorWidths"
},
{
"key": "ctrl+down",
"command": "workbench.action.decreaseViewHeight"
},
{
"key": "ctrl+up",
"command": "workbench.action.increaseViewHeight"
},
{
"key": "ctrl+right",
"command": "workbench.action.decreaseViewWidth"
},
{
"key": "ctrl+left",
"command": "workbench.action.increaseViewWidth"
},
{
"key": "alt+j",
"command": "workbench.action.togglePanel"
},
{
"key": "ctrl+j",
"command": "-workbench.action.togglePanel"
},
// replace vim C-d C-u
{
"key": "ctrl+d",
"command": "cursorPageDown",
"when": "textInputFocus"
},
{
"key": "ctrl+u",
"command": "cursorPageUp",
"when": "textInputFocus"
}
]

2
src/components/global-toast/index.wxml

@ -43,6 +43,6 @@ @@ -43,6 +43,6 @@
<view class="title">该账号未开通阅读权益</view>
<view class="tip">此小程序暂时仅供经邀请的企业用户使用,请换个手机号登录以完成身份验证。</view>
<view class="btn1" bind:tap="handleConform">换个手机号登录</view>
<view class="btn2" bind:close="handleClose">取消</view>
<view class="btn2" bind:tap="handleClose">取消</view>
</view>
</van-popup>

BIN
src/images/empty-search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

5
src/pages/classify/index.scss

@ -3,10 +3,13 @@ page { @@ -3,10 +3,13 @@ page {
}
.page {
padding-bottom: 80rpx;
.scroll {
background-color: #fff;
}
.nav {
padding: 0 16rpx;
display: flex;
overflow-x: auto;
background-color: #fff;
&::-webkit-scrollbar {
display: none;

3
src/pages/classify/index.ts

@ -21,6 +21,8 @@ Page({ @@ -21,6 +21,8 @@ Page({
CateId: '',
CateSecondId: '',
cateSecondList: [] as any,
scrollIntoView: '',
},
onLoad(options) {
this.setData({
@ -43,6 +45,7 @@ Page({ @@ -43,6 +45,7 @@ Page({
if (this.data.CateId) {
this.setData({
cateSecondList: res.find((item: any) => item.Id === this.data.CateId)?.Children || [],
scrollIntoView: `nav-item${this.data.CateId}`,
});
}
});

54
src/pages/classify/index.wxml

@ -1,13 +1,28 @@ @@ -1,13 +1,28 @@
<view class="page">
<view class="nav">
<view class="nav-item {{!CateId && 'active'}}" bind:tap="handleCate">全部</view>
<view class="nav-item {{CateId=== item.Id &&'active'}}" wx:for="{{cateList}}" wx:key="Id" bind:tap="handleCate" data-index="{{index}}">
{{item.CateName}}
<scroll-view class="scroll" scroll-x scroll-into-view="{{scrollIntoView}}">
<view class="nav">
<view class="nav-item {{!CateId && 'active'}}" bind:tap="handleCate">全部</view>
<view
class="nav-item {{CateId=== item.Id &&'active'}}"
wx:for="{{cateList}}"
wx:key="Id"
bind:tap="handleCate"
data-index="{{index}}"
id="nav-item{{item.Id}}"
>
{{item.CateName}}
</view>
</view>
</view>
</scroll-view>
<view class="types" wx:if="{{CateId && cateSecondList.length}}">
<view class="type {{!CateSecondId && 'active'}}" bind:tap="handleSecondCate">全部</view>
<view class="type {{CateSecondId=== item.Id && 'active'}}" wx:for="{{cateSecondList}}" wx:key="Id" bind:tap="handleSecondCate" data-index="{{index}}">
<view
class="type {{CateSecondId=== item.Id && 'active'}}"
wx:for="{{cateSecondList}}"
wx:key="Id"
bind:tap="handleSecondCate"
data-index="{{index}}"
>
{{item.CateName}}
</view>
</view>
@ -21,7 +36,13 @@ @@ -21,7 +36,13 @@
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
</view>
<view class="s-item active" wx:if="{{item.IsCollect === '1'}}" catch:tap="handleUnCollect" data-index="{{index}}" data-list="list">
<view
class="s-item active"
wx:if="{{item.IsCollect === '1'}}"
catch:tap="handleUnCollect"
data-index="{{index}}"
data-list="list"
>
<image class="icon" src="{{imageUrl}}icon-collection-active.png?t={{Timestamp}}"></image>
已收藏
</view>
@ -43,7 +64,13 @@ @@ -43,7 +64,13 @@
<image class="icon" src="{{imageUrl}}icon-eye.png?t={{Timestamp}}"></image>
{{item.BrowseNum}}
</view>
<view class="s-item active" wx:if="{{item.IsCollect === '1'}}" catch:tap="handleUnCollect" data-index="{{index}}" data-list="recommendList">
<view
class="s-item active"
wx:if="{{item.IsCollect === '1'}}"
catch:tap="handleUnCollect"
data-index="{{index}}"
data-list="recommendList"
>
<image class="icon" src="{{imageUrl}}icon-collection-active.png?t={{Timestamp}}"></image>
已收藏
</view>
@ -56,8 +83,15 @@ @@ -56,8 +83,15 @@
</view>
</block>
<div class="pagintion">
<image class="none" src="{{imageUrl}}none.png?t={{Timestamp}}" wx:if="{{pagination.count==0 && recommendPagination.count===0}}"></image>
<van-divider contentPosition="center" wx:elif="{{pagination.page<pagination.pages || recommendPagination.page < recommendPagination.pages}}">
<image
class="none"
src="{{imageUrl}}none.png?t={{Timestamp}}"
wx:if="{{pagination.count==0 && recommendPagination.count===0}}"
></image>
<van-divider
contentPosition="center"
wx:elif="{{pagination.page<pagination.pages || recommendPagination.page < recommendPagination.pages}}"
>
<van-loading />
加载中...
</van-divider>

5
src/pages/home/index.scss

@ -100,6 +100,8 @@ page { @@ -100,6 +100,8 @@ page {
justify-content: center;
flex-direction: column;
overflow: hidden;
height: 164rpx;
box-sizing: border-box;
.title {
font-size: 36rpx;
color: #3795f7;
@ -161,5 +163,8 @@ page { @@ -161,5 +163,8 @@ page {
background: linear-gradient(90deg, #134df6 36%, #3795f7 100%);
border-radius: 112rpx 112rpx 112rpx 112rpx;
}
.not-submit {
background: #e3e3e3;
}
}
}

11
src/pages/home/index.ts

@ -71,10 +71,15 @@ Page({ @@ -71,10 +71,15 @@ Page({
method: 'GET',
url: '?r=shizhong/account/get-can-feedback-count',
data: {},
showMsg: false,
}).then((res) => {
this.setData({
feedbackCount: res,
});
wx.showToast({
icon: 'none',
title: '留言成功',
});
});
},
handleRemark() {
@ -96,6 +101,12 @@ Page({ @@ -96,6 +101,12 @@ Page({
});
});
},
handleNotRemark() {
wx.showToast({
icon: 'none',
title: '今日留言次数已达上限,欢迎明天再来留言吧',
});
},
});
export {};

27
src/pages/home/index.wxml

@ -1,4 +1,7 @@ @@ -1,4 +1,7 @@
<view class="page" style="background: url('{{imageUrl}}home-bg.png?t={{Timestamp}}') no-repeat top center/100% 580rpx;padding-top:{{menuButtonInfo.top}}px;">
<view
class="page"
style="background: url('{{imageUrl}}home-bg.png?t={{Timestamp}}') no-repeat top center/100% 580rpx;padding-top:{{menuButtonInfo.top}}px;"
>
<image class="logo" src="{{imageUrl}}home-logo.png?t={{Timestamp}}"></image>
<image class="page-title" src="{{imageUrl}}home-title.png?t={{Timestamp}}"></image>
<view class="page-slogan">人人都是家庭健康师,让生活更有质量</view>
@ -14,12 +17,7 @@ @@ -14,12 +17,7 @@
placeholder="请输入要搜索的内容"
/>
</view>
<swiper
class="swiper"
indicator-dots
indicator-color="rgba(255,255,255,0.62)"
indicator-active-color="#FFFFFF"
>
<swiper class="swiper" indicator-dots indicator-color="rgba(255,255,255,0.62)" indicator-active-color="#FFFFFF">
<swiper-item
class="swiper-item"
wx:for="{{bannerList}}"
@ -27,11 +25,7 @@ @@ -27,11 +25,7 @@
bind:tap="handleBanner"
data-index="{{index}}"
>
<image
class="banner"
mode="aspectFill"
src="{{item.configImg}}"
></image>
<image class="banner" mode="aspectFill" src="{{item.configImg}}"></image>
</swiper-item>
</swiper>
<view class="cards">
@ -57,12 +51,7 @@ @@ -57,12 +51,7 @@
confirm-type="send"
bindconfirm="handleRemark"
></textarea>
<view
class="submit"
wx:if="{{feedbackCount>0}}"
bindconfirm="handleRemark"
>
提交
</view>
<view wx:if="{{feedbackCount>0}}" class="submit" bind:tap="handleRemark">提交</view>
<view wx:else class="submit not-submit" bind:tap="handleNotRemark">提交</view>
</view>
</view>

1
src/pages/my/index.scss

@ -37,6 +37,7 @@ page { @@ -37,6 +37,7 @@ page {
color: #141515;
font-weight: bold;
line-height: 1;
word-break: break-all;
.icon {
width: 36rpx;
height: 36rpx;

2
src/pages/my/index.ts

@ -8,7 +8,7 @@ Page({ @@ -8,7 +8,7 @@ Page({
userInfo: {} as any,
},
onLoad() {
app.waitLogin(false, true).then(() => {
app.waitLogin().then(() => {
app.getUserInfo(this);
});
},

31
src/pages/my/index.wxml

@ -1,33 +1,14 @@ @@ -1,33 +1,14 @@
<view class="page" style="padding-top:{{ menuButtonInfo.bottom }}px;">
<view class="login" wx:if="{{userInfo.isLogin===1}}">
<uploadFile
class="upload"
chooseAvatar
bind:file="handleFile"
data-key="Img"
bind:file="handleAvatar"
>
<image
wx:if="{{userInfo.avatar}}"
class="avatar"
mode="aspectFill"
src="{{userInfo.avatar}}"
></image>
<image
wx:else
class="avatar"
mode="aspectFill"
src="{{imageUrl}}user.png?t={{Timestamp}}"
></image>
<uploadFile class="upload" chooseAvatar bind:file="handleFile" data-key="Img" bind:file="handleAvatar">
<image wx:if="{{userInfo.avatar}}" class="avatar" mode="aspectFill" src="{{userInfo.avatar}}"></image>
<image wx:else class="avatar" mode="aspectFill" src="{{imageUrl}}user.png?t={{Timestamp}}"></image>
</uploadFile>
<view class="user">
<view class="name">{{userInfo.username || '---'}}
<image
class="icon"
src="{{imageUrl}}icon-edit.png?t={{Timestamp}}"
bind:tap="handleEditUser"
></image>
<view class="name">
{{userInfo.username || '---'}}health_1733302440913576
<image class="icon" src="{{imageUrl}}icon-edit.png?t={{Timestamp}}" bind:tap="handleEditUser"></image>
</view>
<view class="tel">{{userInfo.telephone}}</view>
<view class="status">{{userInfo.isMember===1?'会员':'非会员'}}</view>

7
src/pages/search/index.ts

@ -9,7 +9,7 @@ Page({ @@ -9,7 +9,7 @@ Page({
pagination: {
page: 1,
pages: 1,
count: 0,
count: 1,
},
list: [],
},
@ -20,6 +20,11 @@ Page({ @@ -20,6 +20,11 @@ Page({
});
});
},
handleInput() {
this.setData({
'pagination.count': 1,
});
},
handleSearch() {
if (!this.data.Search) {
wx.showToast({

27
src/pages/search/index.wxml

@ -5,14 +5,8 @@ @@ -5,14 +5,8 @@
bind:click-left="handleBack"
fixed
>
<van-icon
name="arrow-left"
slot="left"
color="#000"
size="46rpx"
/>
<van-icon name="arrow-left" slot="left" color="#000" size="46rpx" />
</van-nav-bar>
<view class="page" style="padding-top:{{menuButtonInfo.bottom}}px;">
<view class="search">
<image class="icon" src="{{imageUrl}}icon-search.png?t={{Timestamp}}"></image>
@ -25,22 +19,15 @@ @@ -25,22 +19,15 @@
confirm-type="search"
bindconfirm="handleSearch"
placeholder="请输入要搜索的内容"
bindinput="handleInput"
/>
</view>
<view class="tip" wx:if="{{list.length}}">以下为搜到的内容</view>
<view
class="card"
wx:for="{{list}}"
wx:key="index"
>
<image
class="photo"
mode="aspectFill"
src="{{item.CoverUrl}}"
></image>
<view class="card" wx:for="{{list}}" wx:key="index">
<image class="photo" mode="aspectFill" src="{{item.CoverUrl}}"></image>
<view class="c-container">
<view class="title">{{item.ChapterName}}</view>
<div class="book-name">{{item.BookName}}</div>
<view class="book-name">{{item.BookName}}</view>
<view class="c-footer">
<view class="type">{{item.CateName}}{{item.CateSecondName ? '/'+item.CateSecondName : ''}}</view>
<view class="stat">
@ -52,7 +39,7 @@ @@ -52,7 +39,7 @@
</view>
</view>
</view>
<view class="empty-search" wx:if="{{search && pagination.count===0}}">
<view class="empty-search" wx:if="{{Search && pagination.count==='0'}}">
<image class="e-icon" src="{{imageUrl}}empty-1.png?t={{Timestamp}}"></image>
<view class="content">
抱歉,未搜到相关内容
@ -60,5 +47,5 @@ @@ -60,5 +47,5 @@
换个词试试吧
</view>
</view>
<pagination wx:else pagination="{{pagination}}"></pagination>
<pagination wx:elif="{{list.length}}" pagination="{{pagination}}"></pagination>
</view>

Loading…
Cancel
Save