From d06eb120e389055d2fa4c6314a104f83d9c87a87 Mon Sep 17 00:00:00 2001
From: shikong <919411476@qq.com>
Date: Wed, 16 Oct 2024 21:01:30 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=AF=BC=E8=88=AA=E6=A0=8F?=
=?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages.json | 15 +++++++++++-
src/pages/category/category.vue | 13 +++++++++++
src/pages/index/index.vue | 34 ++++++++++++++++++++++++++++
src/pages/my-info/my-info.vue | 4 ++--
src/static/icon/category-select.png | Bin 0 -> 483 bytes
src/static/icon/category.png | Bin 0 -> 458 bytes
6 files changed, 63 insertions(+), 3 deletions(-)
create mode 100644 src/pages/category/category.vue
create mode 100644 src/static/icon/category-select.png
create mode 100644 src/static/icon/category.png
diff --git a/src/pages.json b/src/pages.json
index 910c3d3..2d2bb21 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -10,7 +10,8 @@
{
"path": "pages/index/index",
"style": {
- "navigationBarTitleText": "首页"
+ "navigationBarTitleText": "首页",
+ "navigationStyle": "custom"
}
},
{
@@ -19,6 +20,12 @@
"navigationBarTitleText": "我的"
}
},
+ {
+ "path": "pages/category/category",
+ "style": {
+ "navigationBarTitleText": "分类"
+ }
+ },
{
"path": "pages/test-page/test-page",
"style": {
@@ -41,6 +48,12 @@
"pagePath": "pages/index/index",
"text": "首页"
},
+ {
+ "iconPath": "static/icon/category.png",
+ "selectedIconPath": "static/icon/category-select.png",
+ "pagePath": "pages/category/category",
+ "text": "分类"
+ },
{
"iconPath": "static/icon/My.png",
"selectedIconPath": "static/icon/My-select.png",
diff --git a/src/pages/category/category.vue b/src/pages/category/category.vue
new file mode 100644
index 0000000..9db4a06
--- /dev/null
+++ b/src/pages/category/category.vue
@@ -0,0 +1,13 @@
+
+
+
+
+ 分类页
+
+
+
+
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 2d74c85..ad14e4c 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -1,4 +1,17 @@
+
+
+
+
+
+
+
+
@@ -22,6 +35,9 @@ let timer = null
export default {
data() {
return {
+ navHeight: 0,
+ statusBarHeight: 0,
+ capsuleWidth: 0,
now: moment().format('YYYY-MM-DD HH:mm:ss'),
title: 'Hello',
pic: {
@@ -35,10 +51,19 @@ export default {
url: "https://www.httpbin.org/image/jpeg",
},
]
+ },
+ search: {
+ keyword: ""
}
}
},
mounted() {
+ let capsule = uni.getMenuButtonBoundingClientRect(); // 小程序右上角胶囊信息
+ let system = uni.getSystemInfoSync(); // 获取设备信息
+ this.navHeight = system.statusBarHeight + capsule.height; // 导航栏的高度
+ this.statusBarHeight = system.statusBarHeight // 与顶部的距离
+ this.capsuleWidth = capsule.width; // 胶囊按钮与右侧的距离
+
if(timer){
clearInterval(timer)
}
@@ -55,6 +80,15 @@ export default {
indicator: 'default',
loop: true
})
+ },
+ searchKeyword() {
+ console.log(this.search.keyword)
+
+ uni.showModal({
+ title: '发起搜索',
+ content: `搜索关键字:${this.search.keyword}`,
+ showCancel: false
+ })
}
}
}
diff --git a/src/pages/my-info/my-info.vue b/src/pages/my-info/my-info.vue
index c3c8fba..48d4175 100644
--- a/src/pages/my-info/my-info.vue
+++ b/src/pages/my-info/my-info.vue
@@ -20,10 +20,10 @@ function getLocation(){
uni.getLocation({
type: "wgs84",
success: function (res) {
- console.log(`当前位置: ${res.latitude}, ${res.longitude}`)
+ console.log(`当前位置: ${res.longitude},${res.latitude}`)
uni.showModal({
title: '获取位置成功',
- content: `当前位置: ${res.latitude}, ${res.longitude}`,
+ content: `当前位置: ${res.longitude},${res.latitude}`,
showCancel: false
})
},
diff --git a/src/static/icon/category-select.png b/src/static/icon/category-select.png
new file mode 100644
index 0000000000000000000000000000000000000000..1887db9762893fdef6f72b197c81ab87f60c33a3
GIT binary patch
literal 483
zcmV<90UZ8`P)Px$ok>JNRCr$PTEUURFbtG(4FDBzkI)9t3HKybqzZUa3Q$MxK?OhqM0fe+5(Y#@
z)|m71RRjZ1ustw9z#Rsl0F7vS@?9Cg!7-sW9)_@lQ)20ESr!
z)J)6kIzMO$7;URXCbWNrfDjlUz^Vs?SekoQF+hOTE?}@Y
z^j-?se(y+RWijz4hY%euMZRq3n>b($E&;2F$CyX84aPWdt1*E9D<Px$gh@m}RCr$Pn$d9sAq+&a+7!Ywf
zwVOp?pa2xm2t-?PEkm9e7`Ol~fD1fNMu-6$3}ghT3=Fp*_#vs(^wx2@8J66>Cl!vs
za3jFF@n?3eS|9=g0=#~M5vMcsjZmrO-#vDHpQDu0rPz5K85p}=z;W+mO=Z0j8*9~$
ztAPMVGN+u%s(_59MFz(1Aeixs%D{jC5}`&xvK7c^j8x1-Tv<<54nqK~F?xeEN9hiC
zB>%L>c^|+730{c&t0yuMO^Z4ej=-QCrW|%EhdWY$P1C7bV;N1042<0|z~jV+oWpu6
zJmlg%76kzwEY3U!3YhuyJl2i^JXoB0j^!2b3m;U(L9%FYMgRZ+07*qoM6N<$g1H*E
A#{d8T
literal 0
HcmV?d00001