Skip to content

Commit 06a4298

Browse files
committed
将页面由组件形式转为page
1 parent 7f5cc9c commit 06a4298

26 files changed

Lines changed: 16583 additions & 11130 deletions

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ $color-complement : spin($color-base, 180);
171171
.h2w-light .h2w__code {
172172
background-color:#f6f8fa;
173173
border-color:#eaedf0;
174+
-webkit-overflow-scrolling: touch
174175
}
175176

176177

@@ -182,7 +183,7 @@ $color-complement : spin($color-base, 180);
182183
/**内连元素**/
183184
.h2w-light .h2w__a {
184185
color:$color-base !important;
185-
border-color:#b9d9b8;
186+
border-color:$color-hover !important;
186187
}
187188

188189
.h2w-light .h2w__hr {

uni-app-cli/package-lock.json

Lines changed: 16493 additions & 0 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.1.0",
44
"private": true,
55
"scripts": {
6-
"serve": "yarn run dev:mp-weixin",
7-
"build": "yarn run build:mp-weixin",
6+
"serve": "npm run dev:mp-weixin",
7+
"build": "npm run build:mp-weixin",
88
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
99
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
1010
"build:h5": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build",
@@ -51,7 +51,7 @@
5151
"core-js": "^3.6.5",
5252
"flyio": "^0.6.2",
5353
"miniprogram-recycle-view": "^0.1.5",
54-
"moment": "^2.27.0",
54+
"moment": "^2.29.0",
5555
"query-string": "^6.4.2",
5656
"regenerator-runtime": "^0.12.1",
5757
"vue": "^2.6.11",
@@ -61,7 +61,7 @@
6161
},
6262
"devDependencies": {
6363
"@babel/plugin-syntax-typescript": "^7.10.4",
64-
"@dcloudio/types": "^2.0.4",
64+
"@dcloudio/types": "^2.0.8",
6565
"@dcloudio/uni-automator": "^2.0.0-28320200727001",
6666
"@dcloudio/uni-cli-shared": "^2.0.0-28320200727001",
6767
"@dcloudio/uni-migration": "^2.0.0-28320200727001",
@@ -78,7 +78,7 @@
7878
"cross-env": "^7.0.2",
7979
"jest": "^25.4.0",
8080
"mini-types": "^0.1.4",
81-
"miniprogram-api-typings": "^3.0.1",
81+
"miniprogram-api-typings": "^3.1.0",
8282
"postcss-comment": "^2.0.0",
8383
"sass": "^1.26.10",
8484
"sass-loader": "^8.0.2",

uni-app-cli/src/components/cu-custom.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export default {
2626
name: "cu-custom",
2727
computed: {
2828
style() {
29+
console.log("computer")
30+
2931
var bgImage = this.bgImage;
3032
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;`;
3133
if (this.bgImage) {
@@ -35,6 +37,7 @@ export default {
3537
},
3638
},
3739
created() {
40+
console.log("created")
3841
uni.getSystemInfo({
3942
success: e => {
4043
// #ifndef MP

uni-app-cli/src/components/tm-footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
this.time = time
5353
}
5454
},
55-
created() {
55+
mounted() {
5656
var a = moment([2017, 4, 12])
5757
var b = moment()
5858
let seconds = b.diff(a, 'seconds')

uni-app-cli/src/components/tm-tab.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
<script>
1313
export default {
14+
props: {
15+
active: 0,
16+
},
1417
data() {
1518
return {
16-
active: 0,
1719
safeBottom: 0,
1820
tabList: [
1921
{
@@ -49,9 +51,10 @@ export default {
4951
},
5052
methods: {
5153
changeTab(index) {
52-
this.active = index;
53-
this.$emit("onTabChange", {
54-
name: this.tabList[index].name,
54+
console.log(index);
55+
let path = ["/pages/index", "/pages/discover/index", "/pages/about/index"];
56+
uni.switchTab({
57+
url: path[index],
5558
});
5659
},
5760
},

uni-app-cli/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Vue from "vue";
22
import App from "./App.vue";
33

4-
import "./plugins";
4+
import "./utils";
55

66
// 由于uni-app的component实现差异,Vue.componet的使用只能在当前文件下生效
77
// -----------------------------------------------------------------------

uni-app-cli/src/pages.json

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
22
"pages": [
33
{
4-
"path": "pages/page"
4+
"path": "pages/index",
5+
"style": {
6+
"onReachBottomDistance": 600
7+
}
58
},
69
{
7-
"path": "pages/post"
10+
"path": "pages/discover/index"
11+
},
12+
{
13+
"path": "pages/about/index"
14+
},
15+
{
16+
"path": "pages/post/index"
817
},
918
{
1019
"path": "pages/search/searchResult"
@@ -15,10 +24,36 @@
1524
"transparentTitle": "always",
1625
"allowsBounceVertical": "NO"
1726
},
18-
"navigationStyle": "custom",
27+
"backgroundColor": "#eee",
1928
"navigationBarTitleText": "指尖魔法屋",
2029
"navigationBarBackgroundColor": "#007fff",
21-
"navigationBarTextStyle": "black",
30+
"navigationBarTextStyle": "white",
2231
"backgroundTextStyle": "light"
23-
}
32+
},
33+
"tabBar": {
34+
"color": "#333",
35+
"selectedColor": "#007fff",
36+
"backgroundColor": "#fff",
37+
"list": [
38+
{
39+
"pagePath": "pages/index",
40+
"text": "主页",
41+
"iconPath": "static/img/home.png",
42+
"selectedIconPath": "static/img/home-a.png"
43+
},
44+
{
45+
"pagePath": "pages/discover/index",
46+
"text": "发现",
47+
"iconPath": "static/img/search.png",
48+
"selectedIconPath": "static/img/search-a.png"
49+
},
50+
{
51+
"pagePath": "pages/about/index",
52+
"text": "关于",
53+
"iconPath": "static/img/code.png",
54+
"selectedIconPath": "static/img/code-a.png"
55+
}
56+
]
57+
},
58+
"usingComponents": {}
2459
}

uni-app-cli/src/pages/router-view/about.vue renamed to uni-app-cli/src/pages/about/index.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template name="about">
22
<view>
3-
<cu-custom bgColor="bg-gradual" title="关于"></cu-custom>
3+
<!-- <cu-custom bgColor="bg-gradual" title="关于"></cu-custom> -->
44
<view class="overView flex justify-between flex-direction weather rain">
55
<view class="flex justify-center align-center flex-direction margin-top-lg">
66
<image class="icon shadow" src="https://www.thinkmoon.cn/usr/uploads/2018/12/55979974.jpg"></image>
@@ -35,9 +35,10 @@
3535
<view class="spinner bg-base"></view>
3636
</view>
3737
<!-- #ifdef MP-QQ -->
38-
<ad unit-id="01a084f529176b8df06deaa2274f6721" type="card"></ad>
38+
<ad unit-id="01a084f529176b8df06deaa2274f6721" type="card" style="margin-bottom:10px"></ad>
3939
<!-- #endif -->
4040
<tm-footer></tm-footer>
41+
<!-- <tab @onTabChange="tabChange" active="2"></tab> -->
4142
</view>
4243
</template>
4344

@@ -46,10 +47,12 @@ import Vue from "vue";
4647
4748
// @ts-ignore
4849
import parse from "@/wxcomponents/tm-parse/index";
50+
import tab from "@/components/tm-tab.vue";
4951
5052
export default Vue.extend({
5153
components: {
5254
parse,
55+
tab
5356
},
5457
data() {
5558
return {
@@ -82,6 +85,9 @@ export default Vue.extend({
8285
</script>
8386

8487
<style>
88+
page {
89+
background: #fff
90+
}
8591
@import "@/../assets/css/weather.css";
8692
/*引入天气的css*/
8793

uni-app-cli/src/pages/router-view/discover.vue renamed to uni-app-cli/src/pages/discover/index.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<template>
22
<view class="bg-white content">
3-
<cu-custom bgColor="bg-gradual">
4-
<block slot="backText"><text class="icon-back"></text></block>
5-
<block slot="content">发现</block>
6-
</cu-custom>
73
<view class="cu-bar tm-search bg-white">
84
<view class="tm-search-input search-form">
95
<text class="icon-search"></text>
@@ -15,13 +11,18 @@
1511
{{ item.name }} ({{ item.count }})
1612
</view>
1713
</view>
14+
<!-- <tab @onTabChange="tabChange" active="1"></tab> -->
1815
</view>
1916
</template>
2017

2118
<script lang="ts">
19+
import tab from "@/components/tm-tab.vue";
2220
import Vue from "vue";
2321
2422
export default Vue.extend({
23+
components: {
24+
tab,
25+
},
2526
data() {
2627
return {
2728
searchHistory: [],
@@ -33,7 +34,7 @@ export default Vue.extend({
3334
searchTag(mid: number) {
3435
console.log(`寻找mid为${mid}的文章`);
3536
uni.navigateTo({
36-
url: "./search/searchResult?mid=" + mid,
37+
url: "/pages/search/searchResult?mid=" + mid,
3738
});
3839
},
3940
// 开始搜索
@@ -43,7 +44,7 @@ export default Vue.extend({
4344
return;
4445
}
4546
uni.navigateTo({
46-
url: "./search/searchResult?keyWord=" + e.detail.value,
47+
url: "/pages/search/searchResult?keyWord=" + e.detail.value,
4748
});
4849
},
4950
},

0 commit comments

Comments
 (0)