Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
deancn committed Apr 27, 2019
1 parent 7a11b31 commit 3b28fc7
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 14 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,33 @@ npm run build
## How to use weui in wepy

[wechat-applet-wepy-introduces-weui](https://laravelcode.cn/posts/63/wechat-applet-wepy-introduces-weui)


# Error Code

| Code | Errmsg |
| ---- | --- |
| 1002 | 获取话题数据错误 |
| 1004 | 创建回复错误 |
| 1101 | 正常显示数据错误 |
| 1301 | 列表信息错误 |


app.wpy: content: '服务器错误,请联系管理员'
components/topicList.wpy: content: '服务器错误,请联系管理员'
mixins/replyMixin.js: content: '服务器错误,请联系管理员'
mixins/replyMixin.js: content: '服务器错误,请联系管理员'
pages/auth/register.wpy: content: '服务器错误,请联系管理员'
pages/auth/register.wpy: content: '服务器错误,请联系管理员'
pages/auth/register.wpy: content: '服务器错误,请联系管理员'
pages/auth/login.wpy: content: '服务器错误,请联系管理员'
pages/auth/login.wpy: content: '服务器错误,请联系管理员'
pages/replies/create.wpy: content: '错误: 1004,请联系管理员'
pages/users/show.wpy: content: '服务器错误,请联系管理员'
pages/users/edit.wpy: content: '服务器错误,请联系管理员'
pages/users/edit.wpy: content: '服务器错误,请联系管理员'
pages/notifications/index.wpy: content: '服务器错误,请联系管理员'
pages/notifications/index.wpy: content: '服务器错误,请联系管理员'
pages/topics/show.wpy: content: '错误码: 1002,请联系管理员'
pages/topics/index.wpy: content: '服务器错误,请联系管理员'
utils/api.js: content: '服务器错误,请联系管理员或重试'
8 changes: 4 additions & 4 deletions src/app.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export default class extends wepy.app {
list: [{
pagePath: 'pages/topics/index',
text: '首页',
iconPath: 'images/index.png',
selectedIconPath: 'images/index_selected.png'
iconPath: '/static/tabs/home.png',
selectedIconPath: '/static/tabs/home_active.png'
}, {
pagePath: 'pages/users/me',
text: '我的',
iconPath: 'images/user.png',
selectedIconPath: 'images/user_selected.png'
iconPath: '/static/tabs/user_active.png',
selectedIconPath: '/static/tabs/user_active.png'
}],
color: '#707070',
selectedColor: '#00b5ad'
Expand Down
2 changes: 1 addition & 1 deletion src/components/topicList.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
console.log(err)
wepy.showModal({
title: '提示',
content: '服务器错误,请联系管理员'
content: '服务器错误 topiclist,请联系管理员'
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/replyMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class ReplyMixin extends wepy.mixin {
console.log(err)
wepy.showModal({
title: '提示',
content: '服务器错误,请联系管理员'
content: '错误: 1301,请联系管理员'
})
}
}
Expand Down Expand Up @@ -122,7 +122,7 @@ export default class ReplyMixin extends wepy.mixin {
console.log(err)
wepy.showModal({
title: '提示',
content: '服务器错误,请联系管理员'
content: '错误: 1305,请联系管理员'
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/replies/create.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
console.log(err)
wepy.showModal({
title: '提示',
content: '服务器错误,请联系管理员'
content: '错误: 1004,请联系管理员'
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/replies/index.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</view>
</view>

<image wx:if="{{ reply.can_delete }}" class="reply-delete" src="/images/trash.png" @tap="deleteReply({{ reply.topic_id }}, {{ reply.id }})"/>
<image wx:if="{{ reply.can_delete }}" class="reply-delete" src="/images/trash.png" @tap="deleteReply({{ reply.topic_id }}, {{ reply.ID }})"/>
</view>
</repeat>
<view class="weui-loadmore weui-loadmore_line" wx:if="{{ noMoreData }}">
Expand Down
3 changes: 2 additions & 1 deletion src/pages/topics/index.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<view @tap="changeCategory()" class="weui-cell weui-cell_access {{ !currentCategory.id ? 'category-list__item_selected' : ''}}">
<view class="weui-cell__bd">话题</view>
</view>
<view @tap="changeCategory({{ category.id }})" class="weui-cell weui-cell_access {{ currentCategory.id === category.ID ? 'category-list__item_selected' : ''}}" wx:for="{{ categories }}" wx:for-item="category" wx:key="id">
<view @tap="changeCategory({{ category.id }})" class="weui-cell weui-cell_access {{ currentCategory.id === category.id ? 'category-list__item_selected' : ''}}" wx:for="{{ categories }}" wx:for-item="category" wx:key="id">
<view class="weui-cell__bd">{{ category.name }}</view>
</view>
</view>
Expand Down Expand Up @@ -125,6 +125,7 @@
}

this.categories = categories
console.log('categories====', categories)
this.$apply()
}
onLoad() {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/topics/show.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ page{
<view class="page">
<view class="page__bd">
<view class="weui-cells weui-cells_after-title">
<navigator class="weui-cell" url="/pages/users/show?id={{ topic.user.id }}" open-type="redirect">
<navigator class="weui-cell" url="/pages/users/show?id={{ topic.user.ID }}" open-type="redirect">
<view class="weui-cell__hd avatar-wrap">
<image class="avatar" src="{{ topic.user.avatar }}"/>
</view>
Expand Down Expand Up @@ -73,15 +73,15 @@ page{
</repeat>
</view>
<view class="weui-panel__ft">
<navigator class="weui-cell weui-cell_access weui-cell_link" url="/pages/replies/index?topic_id={{ topic.id }}">
<navigator class="weui-cell weui-cell_access weui-cell_link" url="/pages/replies/index?topic_id={{ topic.ID }}">
<view class="weui-cell__bd">查看全部回复</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</view>
</view>

<!-- 回复按钮 -->
<navigator url="/pages/replies/create?topic_id={{ topic.id }}">
<navigator url="/pages/replies/create?topic_id={{ topic.ID }}">
<image src="/images/reply.png" class="create-reply" />
</navigator>
</view>
Expand Down Expand Up @@ -147,7 +147,7 @@ page{
console.log(err)
wepy.showModal({
title: '提示',
content: '服务器错误,请联系管理员'
content: '错误码: 1002,请联系管理员'
})
}
}
Expand Down

0 comments on commit 3b28fc7

Please sign in to comment.