Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Restful/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function getPostBycidAction()
{
if (isset($_GET['cid'])) {
$cid = $this->getParams('cid');
$select = $this->db->select('cid', 'title', 'created', 'type', 'slug', 'likes', 'text', 'commentsNum')->from('table.contents')->where('status = ?', 'publish')->where('created < ?', time())->where('cid = ?', $cid);
$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);
//更新点击量数据库
$row = $this->db->fetchRow($this->db->select('views')->from('table.contents')->where('cid = ?', $cid));
$this->db->query($this->db->update('table.contents')->rows(array('views' => (int) $row['views'] + 1))->where('cid = ?', $cid));
Expand Down Expand Up @@ -439,7 +439,7 @@ function searchAction()
{
$keyword = $this->getParams('keyWord', 'null');
$mid = $this->getParams('mid', 'null');
$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);
$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);
if ($keyword != 'null') {
$select = $select->where('table.contents.text LIKE ?', '%' . $keyword . '%');
}
Expand Down
2 changes: 1 addition & 1 deletion Restful/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @package Restful
* @author 醉月思
* @version 1.0.0
* @version 1.1.0
* @link https://thinkmoon.cn
*/
class Restful_Plugin implements Typecho_Plugin_Interface
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion uni-app-cli/assets/css/tmui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ $color-complement : spin($color-base, 180);

/**内连元素**/
.h2w-light .h2w__a {
color:$color-base;
color:$color-base !important;
border-color:#b9d9b8;
}

Expand Down
1,882 changes: 1,488 additions & 394 deletions uni-app-cli/package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions uni-app-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weblog",
"version": "1.0.1",
"version": "1.1.0",
"private": true,
"scripts": {
"serve": "yarn run dev:mp-weixin",
Expand Down Expand Up @@ -36,18 +36,18 @@
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
},
"dependencies": {
"@dcloudio/uni-app-plus": "^2.0.0-27920200618002",
"@dcloudio/uni-h5": "^2.0.0-27920200618002",
"@dcloudio/uni-app-plus": "^2.0.0-28320200727001",
"@dcloudio/uni-h5": "^2.0.0-28320200727001",
"@dcloudio/uni-helper-json": "*",
"@dcloudio/uni-mp-360": "^2.0.0-27920200618002",
"@dcloudio/uni-mp-alipay": "^2.0.0-27920200618002",
"@dcloudio/uni-mp-baidu": "^2.0.0-27920200618002",
"@dcloudio/uni-mp-qq": "^2.0.0-27920200618002",
"@dcloudio/uni-mp-toutiao": "^2.0.0-27920200618002",
"@dcloudio/uni-mp-weixin": "^2.0.0-27920200618002",
"@dcloudio/uni-mp-360": "^2.0.0-28320200727001",
"@dcloudio/uni-mp-alipay": "^2.0.0-28320200727001",
"@dcloudio/uni-mp-baidu": "^2.0.0-28320200727001",
"@dcloudio/uni-mp-qq": "^2.0.0-28320200727001",
"@dcloudio/uni-mp-toutiao": "^2.0.0-28320200727001",
"@dcloudio/uni-mp-weixin": "^2.0.0-28320200727001",
"@dcloudio/uni-quickapp-native": "^2.0.0-27920200618002",
"@dcloudio/uni-quickapp-webview": "^2.0.0-27920200618002",
"@dcloudio/uni-stat": "^2.0.0-27920200618002",
"@dcloudio/uni-quickapp-webview": "^2.0.0-28320200727001",
"@dcloudio/uni-stat": "^2.0.0-28320200727001",
"core-js": "^3.6.5",
"flyio": "^0.6.2",
"miniprogram-recycle-view": "^0.1.5",
Expand All @@ -61,28 +61,28 @@
},
"devDependencies": {
"@babel/plugin-syntax-typescript": "^7.10.4",
"@dcloudio/types": "*",
"@dcloudio/uni-automator": "^2.0.0-27920200618002",
"@dcloudio/uni-cli-shared": "^2.0.0-27920200618002",
"@dcloudio/uni-migration": "^2.0.0-27920200618002",
"@dcloudio/uni-template-compiler": "^2.0.0-27920200618002",
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-27920200618002",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-27920200618002",
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-27920200618002",
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-27920200618002",
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-27920200618002",
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-typescript": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"@dcloudio/types": "^2.0.4",
"@dcloudio/uni-automator": "^2.0.0-28320200727001",
"@dcloudio/uni-cli-shared": "^2.0.0-28320200727001",
"@dcloudio/uni-migration": "^2.0.0-28320200727001",
"@dcloudio/uni-template-compiler": "^2.0.0-28320200727001",
"@dcloudio/vue-cli-plugin-hbuilderx": "^2.0.0-28320200727001",
"@dcloudio/vue-cli-plugin-uni": "^2.0.0-28320200727001",
"@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-28320200727001",
"@dcloudio/webpack-uni-mp-loader": "^2.0.0-28320200727001",
"@dcloudio/webpack-uni-pages-loader": "^2.0.0-28320200727001",
"@vue/cli-plugin-babel": "^4.5.3",
"@vue/cli-plugin-typescript": "^4.5.3",
"@vue/cli-service": "^4.5.3",
"babel-plugin-import": "^1.11.0",
"cross-env": "^7.0.2",
"jest": "^25.4.0",
"mini-types": "*",
"miniprogram-api-typings": "*",
"mini-types": "^0.1.4",
"miniprogram-api-typings": "^3.0.1",
"node-sass": "^4.14.1",
"postcss-comment": "^2.0.0",
"sass-loader": "^8.0.2",
"typescript": "^3.9.6",
"typescript": "^3.9.7",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
Expand Down
28 changes: 0 additions & 28 deletions uni-app-cli/public/index.html

This file was deleted.

36 changes: 4 additions & 32 deletions uni-app-cli/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,6 @@ export default Vue.extend({
},
// 初始化
init() {
let e = uni.getSystemInfoSync();
console.log("getSystemInfoSync", e);

// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == "android") {
Vue.prototype.CustomBar = (e.statusBarHeight || 0) + 50;
} else {
Vue.prototype.CustomBar = (e.statusBarHeight || 0) + 45;
}
// #endif

// #ifdef MP-WEIXIN || MP-QQ
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - (e.statusBarHeight || 0);
// #endif

// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = (e.statusBarHeight || 0) + (e.titleBarHeight || 0);
// #endif

//底部安全距离
// @ts-ignore
Vue.prototype.safeBottom = e.windowHeight - e.safeArea.height - e.safeArea.top;
Vue.prototype.$ifWebp = ["android", "devtools"].includes(e.platform || "");
},
login() {
uni.login({
Expand All @@ -74,12 +46,12 @@ export default Vue.extend({
code: res.code,
};
Object.assign(data, Info.userInfo);
let openid = await this.$Api.login(data);
let openid = await this.$api.login(data);
uni.setStorageSync("openid", openid);
},
});
} else {
let openid = await this.$Api.login({
let openid = await this.$api.login({
code: res.code,
});
uni.setStorageSync("openid", openid);
Expand Down Expand Up @@ -109,8 +81,8 @@ export default Vue.extend({
<style lang="scss">
/* 引入color UI wxss 库 */
@import "../assets/css/main.css";
@import "../assets/css/icon.wxss";
@import "../assets/css/animation.wxss";
@import "../assets/css/icon.css";
@import "../assets/css/animation.css";
/* ------------------ */
/* 引入自定义 less 库 */
@import "../assets/css/tmui.scss";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<template>
<view>
<view class="cu-custom" :style="[{ height: CustomBar + 'px' }]">
<view
class="cu-bar fixed"
:style="style"
:class="[bgImage != '' ? 'none-bg text-white bg-img' : '', bgColor]"
>
<view class="cu-bar fixed" :style="style" :class="[bgImage != '' ? 'none-bg text-white bg-img' : '', bgColor]">
<view class="action text-white" @tap="BackPage" v-if="isBack">
<slot name="backText"></slot>
</view>
<view
class="content color-contrast"
:style="[{ top: StatusBar + 'px' }]"
<view class="content color-contrast" :style="[{ top: StatusBar + 'px' }]"
>{{ title || "" }}
<slot name="content"></slot>
</view>
Expand All @@ -25,22 +19,51 @@
export default {
data() {
return {
StatusBar: this.StatusBar,
CustomBar: this.CustomBar,
StatusBar: 0,
CustomBar: 0,
};
},
name: "cu-custom",
computed: {
style() {
let { StatusBar, CustomBar } = this;
var bgImage = this.bgImage;
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;`;
if (this.bgImage) {
style = `${style}background-image:url(${bgImage});`;
}
return style;
},
},
created() {
uni.getSystemInfo({
success: e => {
// #ifndef MP
this.StatusBar = e.statusBarHeight;
if (e.platform == "android") {
this.CustomBar = e.statusBarHeight + 50;
} else {
this.CustomBar = e.statusBarHeight + 45;
}
// #endif
// #ifdef MP-WEIXIN || MP-QQ
this.StatusBar = e.statusBarHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
this.Custom = capsule;
// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
this.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
} else {
this.CustomBar = e.statusBarHeight + 50;
}
// #endif

// #ifdef MP-ALIPAY
this.StatusBar = e.statusBarHeight;
this.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
},
});
},
props: {
title: {
type: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
<template>
<view class="cu-bar tabbar bg-white shadow-blur foot" :style="style">
<view
class="action"
@click="changeTab(index)"
v-for="(item, index) in tabList"
:key="index"
>
<view class="action" @click="changeTab(index)" v-for="(item, index) in tabList" :key="index">
<view>
<view
:class="(active == index ? 'color-base ' : 'text-gray ') + item.icon"
></view>
<view :class="(active == index ? 'color-base ' : 'text-gray ') + item.icon"></view>
</view>
<view :class="active == index ? 'color-base' : 'text-gray'">{{
item.text
}}</view>
<view :class="active == index ? 'color-base' : 'text-gray'">{{ item.text }}</view>
</view>
</view>
</template>
Expand All @@ -23,6 +14,7 @@ export default {
data() {
return {
active: 0,
safeBottom: 0,
tabList: [
{
icon: "icon-home",
Expand All @@ -44,13 +36,20 @@ export default {
},
computed: {
style() {
let { safeBottom } = this;
return `padding-bottom:${safeBottom}px`;
}
return `padding-bottom:${this.safeBottom}px`;
},
},
created() {
uni.getSystemInfo({
success: (e) => {
// @ts-ignore
this.safeBottom = e.windowHeight - e.safeArea.height - e.safeArea.top;
},
});
},
methods: {
changeTab(index) {
this.active = index
this.active = index;
this.$emit("onTabChange", {
name: this.tabList[index].name,
});
Expand Down
Loading