Skip to content

Commit 61c84be

Browse files
authored
Merge pull request #8 from thinkmoon/dev
v1.1.0
2 parents a236ccf + 0eeca36 commit 61c84be

113 files changed

Lines changed: 2071 additions & 645 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Restful/Action.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function getPostBycidAction()
391391
{
392392
if (isset($_GET['cid'])) {
393393
$cid = $this->getParams('cid');
394-
$select = $this->db->select('cid', 'title', 'created', 'type', 'slug', 'likes', 'text', 'commentsNum')->from('table.contents')->where('status = ?', 'publish')->where('created < ?', time())->where('cid = ?', $cid);
394+
$select = $this->db->select('cid', 'title', 'created', 'type', 'slug', 'views', 'likes', 'text', 'commentsNum')->from('table.contents')->where('status = ?', 'publish')->where('created < ?', time())->where('cid = ?', $cid);
395395
//更新点击量数据库
396396
$row = $this->db->fetchRow($this->db->select('views')->from('table.contents')->where('cid = ?', $cid));
397397
$this->db->query($this->db->update('table.contents')->rows(array('views' => (int) $row['views'] + 1))->where('cid = ?', $cid));
@@ -439,7 +439,7 @@ function searchAction()
439439
{
440440
$keyword = $this->getParams('keyWord', 'null');
441441
$mid = $this->getParams('mid', 'null');
442-
$select = $this->db->select('distinct table.contents.cid AS cid', 'title', 'table.contents.created', 'commentsNum', 'views', 'likes')->from('table.contents')->join('table.relationships', 'table.contents.cid = table.relationships.cid', Typecho_DB::LEFT_JOIN)->where('type = ?', 'post')->where('status = ?', 'publish')->order('table.contents.created', Typecho_Db::SORT_DESC)->limit(20);
442+
$select = $this->db->select('table.contents.cid AS cid', 'title', 'table.contents.created', 'commentsNum', 'views', 'likes')->from('table.contents')->join('table.relationships', 'table.contents.cid = table.relationships.cid', Typecho_DB::LEFT_JOIN)->where('type = ?', 'post')->where('status = ?', 'publish')->order('table.contents.created', Typecho_Db::SORT_DESC)->limit(20);
443443
if ($keyword != 'null') {
444444
$select = $select->where('table.contents.text LIKE ?', '%' . $keyword . '%');
445445
}

Restful/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @package Restful
99
* @author 醉月思
10-
* @version 1.0.0
10+
* @version 1.1.0
1111
* @link https://thinkmoon.cn
1212
*/
1313
class Restful_Plugin implements Typecho_Plugin_Interface

uni-app-cli/assets/css/tmui.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ $color-complement : spin($color-base, 180);
181181

182182
/**内连元素**/
183183
.h2w-light .h2w__a {
184-
color:$color-base;
184+
color:$color-base !important;
185185
border-color:#b9d9b8;
186186
}
187187

uni-app-cli/package-lock.json

Lines changed: 1488 additions & 394 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

uni-app-cli/package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "weblog",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"private": true,
55
"scripts": {
66
"serve": "yarn run dev:mp-weixin",
@@ -36,18 +36,18 @@
3636
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
3737
},
3838
"dependencies": {
39-
"@dcloudio/uni-app-plus": "^2.0.0-27920200618002",
40-
"@dcloudio/uni-h5": "^2.0.0-27920200618002",
39+
"@dcloudio/uni-app-plus": "^2.0.0-28320200727001",
40+
"@dcloudio/uni-h5": "^2.0.0-28320200727001",
4141
"@dcloudio/uni-helper-json": "*",
42-
"@dcloudio/uni-mp-360": "^2.0.0-27920200618002",
43-
"@dcloudio/uni-mp-alipay": "^2.0.0-27920200618002",
44-
"@dcloudio/uni-mp-baidu": "^2.0.0-27920200618002",
45-
"@dcloudio/uni-mp-qq": "^2.0.0-27920200618002",
46-
"@dcloudio/uni-mp-toutiao": "^2.0.0-27920200618002",
47-
"@dcloudio/uni-mp-weixin": "^2.0.0-27920200618002",
42+
"@dcloudio/uni-mp-360": "^2.0.0-28320200727001",
43+
"@dcloudio/uni-mp-alipay": "^2.0.0-28320200727001",
44+
"@dcloudio/uni-mp-baidu": "^2.0.0-28320200727001",
45+
"@dcloudio/uni-mp-qq": "^2.0.0-28320200727001",
46+
"@dcloudio/uni-mp-toutiao": "^2.0.0-28320200727001",
47+
"@dcloudio/uni-mp-weixin": "^2.0.0-28320200727001",
4848
"@dcloudio/uni-quickapp-native": "^2.0.0-27920200618002",
49-
"@dcloudio/uni-quickapp-webview": "^2.0.0-27920200618002",
50-
"@dcloudio/uni-stat": "^2.0.0-27920200618002",
49+
"@dcloudio/uni-quickapp-webview": "^2.0.0-28320200727001",
50+
"@dcloudio/uni-stat": "^2.0.0-28320200727001",
5151
"core-js": "^3.6.5",
5252
"flyio": "^0.6.2",
5353
"miniprogram-recycle-view": "^0.1.5",
@@ -61,28 +61,28 @@
6161
},
6262
"devDependencies": {
6363
"@babel/plugin-syntax-typescript": "^7.10.4",
64-
"@dcloudio/types": "*",
65-
"@dcloudio/uni-automator": "^2.0.0-27920200618002",
66-
"@dcloudio/uni-cli-shared": "^2.0.0-27920200618002",
67-
"@dcloudio/uni-migration": "^2.0.0-27920200618002",
68-
"@dcloudio/uni-template-compiler": "^2.0.0-27920200618002",
69-
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-27920200618002",
70-
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-27920200618002",
71-
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-27920200618002",
72-
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-27920200618002",
73-
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-27920200618002",
74-
"@vue/cli-plugin-babel": "^4.4.6",
75-
"@vue/cli-plugin-typescript": "^4.4.6",
76-
"@vue/cli-service": "^4.4.6",
64+
"@dcloudio/types": "^2.0.4",
65+
"@dcloudio/uni-automator": "^2.0.0-28320200727001",
66+
"@dcloudio/uni-cli-shared": "^2.0.0-28320200727001",
67+
"@dcloudio/uni-migration": "^2.0.0-28320200727001",
68+
"@dcloudio/uni-template-compiler": "^2.0.0-28320200727001",
69+
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-28320200727001",
70+
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-28320200727001",
71+
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-28320200727001",
72+
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-28320200727001",
73+
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-28320200727001",
74+
"@vue/cli-plugin-babel": "^4.5.3",
75+
"@vue/cli-plugin-typescript": "^4.5.3",
76+
"@vue/cli-service": "^4.5.3",
7777
"babel-plugin-import": "^1.11.0",
7878
"cross-env": "^7.0.2",
7979
"jest": "^25.4.0",
80-
"mini-types": "*",
81-
"miniprogram-api-typings": "*",
80+
"mini-types": "^0.1.4",
81+
"miniprogram-api-typings": "^3.0.1",
8282
"node-sass": "^4.14.1",
8383
"postcss-comment": "^2.0.0",
8484
"sass-loader": "^8.0.2",
85-
"typescript": "^3.9.6",
85+
"typescript": "^3.9.7",
8686
"vue-template-compiler": "^2.6.11"
8787
},
8888
"browserslist": [

uni-app-cli/public/index.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

uni-app-cli/src/App.vue

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,6 @@ export default Vue.extend({
2727
},
2828
// 初始化
2929
init() {
30-
let e = uni.getSystemInfoSync();
31-
console.log("getSystemInfoSync", e);
32-
33-
// #ifndef MP
34-
Vue.prototype.StatusBar = e.statusBarHeight;
35-
if (e.platform == "android") {
36-
Vue.prototype.CustomBar = (e.statusBarHeight || 0) + 50;
37-
} else {
38-
Vue.prototype.CustomBar = (e.statusBarHeight || 0) + 45;
39-
}
40-
// #endif
41-
42-
// #ifdef MP-WEIXIN || MP-QQ
43-
Vue.prototype.StatusBar = e.statusBarHeight;
44-
let custom = wx.getMenuButtonBoundingClientRect();
45-
Vue.prototype.Custom = custom;
46-
Vue.prototype.CustomBar = custom.bottom + custom.top - (e.statusBarHeight || 0);
47-
// #endif
48-
49-
// #ifdef MP-ALIPAY
50-
Vue.prototype.StatusBar = e.statusBarHeight;
51-
Vue.prototype.CustomBar = (e.statusBarHeight || 0) + (e.titleBarHeight || 0);
52-
// #endif
53-
54-
//底部安全距离
55-
// @ts-ignore
56-
Vue.prototype.safeBottom = e.windowHeight - e.safeArea.height - e.safeArea.top;
57-
Vue.prototype.$ifWebp = ["android", "devtools"].includes(e.platform || "");
5830
},
5931
login() {
6032
uni.login({
@@ -74,12 +46,12 @@ export default Vue.extend({
7446
code: res.code,
7547
};
7648
Object.assign(data, Info.userInfo);
77-
let openid = await this.$Api.login(data);
49+
let openid = await this.$api.login(data);
7850
uni.setStorageSync("openid", openid);
7951
},
8052
});
8153
} else {
82-
let openid = await this.$Api.login({
54+
let openid = await this.$api.login({
8355
code: res.code,
8456
});
8557
uni.setStorageSync("openid", openid);
@@ -109,8 +81,8 @@ export default Vue.extend({
10981
<style lang="scss">
11082
/* 引入color UI wxss 库 */
11183
@import "../assets/css/main.css";
112-
@import "../assets/css/icon.wxss";
113-
@import "../assets/css/animation.wxss";
84+
@import "../assets/css/icon.css";
85+
@import "../assets/css/animation.css";
11486
/* ------------------ */
11587
/* 引入自定义 less 库 */
11688
@import "../assets/css/tmui.scss";
Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
<template>
22
<view>
33
<view class="cu-custom" :style="[{ height: CustomBar + 'px' }]">
4-
<view
5-
class="cu-bar fixed"
6-
:style="style"
7-
:class="[bgImage != '' ? 'none-bg text-white bg-img' : '', bgColor]"
8-
>
4+
<view class="cu-bar fixed" :style="style" :class="[bgImage != '' ? 'none-bg text-white bg-img' : '', bgColor]">
95
<view class="action text-white" @tap="BackPage" v-if="isBack">
106
<slot name="backText"></slot>
117
</view>
12-
<view
13-
class="content color-contrast"
14-
:style="[{ top: StatusBar + 'px' }]"
8+
<view class="content color-contrast" :style="[{ top: StatusBar + 'px' }]"
159
>{{ title || "" }}
1610
<slot name="content"></slot>
1711
</view>
@@ -25,22 +19,51 @@
2519
export default {
2620
data() {
2721
return {
28-
StatusBar: this.StatusBar,
29-
CustomBar: this.CustomBar,
22+
StatusBar: 0,
23+
CustomBar: 0,
3024
};
3125
},
3226
name: "cu-custom",
3327
computed: {
3428
style() {
35-
let { StatusBar, CustomBar } = this;
3629
var bgImage = this.bgImage;
37-
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
30+
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;`;
3831
if (this.bgImage) {
3932
style = `${style}background-image:url(${bgImage});`;
4033
}
4134
return style;
4235
},
4336
},
37+
created() {
38+
uni.getSystemInfo({
39+
success: e => {
40+
// #ifndef MP
41+
this.StatusBar = e.statusBarHeight;
42+
if (e.platform == "android") {
43+
this.CustomBar = e.statusBarHeight + 50;
44+
} else {
45+
this.CustomBar = e.statusBarHeight + 45;
46+
}
47+
// #endif
48+
// #ifdef MP-WEIXIN || MP-QQ
49+
this.StatusBar = e.statusBarHeight;
50+
let capsule = wx.getMenuButtonBoundingClientRect();
51+
if (capsule) {
52+
this.Custom = capsule;
53+
// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
54+
this.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
55+
} else {
56+
this.CustomBar = e.statusBarHeight + 50;
57+
}
58+
// #endif
59+
60+
// #ifdef MP-ALIPAY
61+
this.StatusBar = e.statusBarHeight;
62+
this.CustomBar = e.statusBarHeight + e.titleBarHeight;
63+
// #endif
64+
},
65+
});
66+
},
4467
props: {
4568
title: {
4669
type: String,

0 commit comments

Comments
 (0)