From c4e6d4aa8978f90e8aae9b6bda63377124aa7b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=A4=A9=E6=80=A1?= <10205501416@stu.ecnu.edu.cn> Date: Thu, 2 Jun 2022 10:42:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'hangout-master/asset/components/message'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hangout-master/asset/components/message/message.js | 75 ++++++++++++++++++++++ .../asset/components/message/message.json | 4 ++ .../asset/components/message/message.wxml | 19 ++++++ .../asset/components/message/message.wxss | 57 ++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 hangout-master/asset/components/message/message.js create mode 100644 hangout-master/asset/components/message/message.json create mode 100644 hangout-master/asset/components/message/message.wxml create mode 100644 hangout-master/asset/components/message/message.wxss diff --git a/hangout-master/asset/components/message/message.js b/hangout-master/asset/components/message/message.js new file mode 100644 index 0000000..92b3257 --- /dev/null +++ b/hangout-master/asset/components/message/message.js @@ -0,0 +1,75 @@ +// components/message/message.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + list : [{ + text:"饮食", + iconPath:"/asset/img/icon-eat.png", + },{ + text:"娱乐", + iconPath:"/asset/img/icon-play.png" + },{ + text:"交通", + iconPath:"/asset/img/icon-info.png" + },{ + text:"天气", + iconPath:"/asset/img/icon-weather.png" + },{ + text:"防疫政策", + iconPath:"/asset/img/icon-virus.png" + }] + + }, + + /** + * 组件的方法列表 + */ + methods: { + onRet: function () { + wx.reLaunch({ + url: "/Pages/travel/home/home", + }); + }, + + switchPage : function(e){ + switch (e.currentTarget.id) { + case '0': + wx.redirectTo({ + url: '/Pages/travel/preparation/message/eat/eat', + }) + break; + case '1': + wx.redirectTo({ + url: '/Pages/travel/preparation/message/play/play', + }) + break + case '2': + wx.redirectTo({ + url: '/Pages/travel/preparation/message/travel/travel', + }) + break + case '3': + wx.redirectTo({ + url: '/Pages/travel/preparation/message/weather/weather', + }) + break + case '4': + wx.redirectTo({ + url: '/Pages/travel/preparation/message/epidemic/epidemic', + }) + break + default: + break; + } + } + } +}) diff --git a/hangout-master/asset/components/message/message.json b/hangout-master/asset/components/message/message.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/hangout-master/asset/components/message/message.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/hangout-master/asset/components/message/message.wxml b/hangout-master/asset/components/message/message.wxml new file mode 100644 index 0000000..ea3a675 --- /dev/null +++ b/hangout-master/asset/components/message/message.wxml @@ -0,0 +1,19 @@ + + + + + + + + + 当地信息 + + + + + {{item.text}} + + + + + \ No newline at end of file diff --git a/hangout-master/asset/components/message/message.wxss b/hangout-master/asset/components/message/message.wxss new file mode 100644 index 0000000..cd33e89 --- /dev/null +++ b/hangout-master/asset/components/message/message.wxss @@ -0,0 +1,57 @@ +/* components/message/message.wxss */ +.navi { + width: 40px; + height: 30px; + margin: 5px; + padding-top: 10px; +} + +.title { + position: relative; + top: 20px; + left: 15px; + font-size: 22px; + font-weight: 900; + color: #000; +} + +.icon { + position: relative; + top: 10vh; + padding: 5vw; + width: 40%; + justify-content: center; + text-align: center; + align-items: center; + flex: 1; + flex-direction: column; +} + +.icon-image { + height: 40px; + width: 40px; + justify-content: center; + align-items: center; + float: left; + padding: 5px; +} + +.icon-text { + padding: 0; + margin-inline: 10vw; + position: relative; + top: 2vh; + font-weight: bolder; + font-size: 22px; + text-align: center; +} +.icon-button { + float: right; + font-size: large; + font-weight: 600; + color: #7b8b6f; + margin-right: 5vw; + width: 40px; + height: 40px; + text-align: center; +}