houjie 4 年 前
コミット
ec763a61e7

+ 24 - 26
App.vue

@@ -1,31 +1,29 @@
 <script>
-	import {getToken} from './Lib/Request';
-	export default {
-		onLaunch: function() {
-			console.log('App Launch')
-			//获取token
-			getToken()
-			
-			function uidCallback(data){
-				console.log(data);
-				uni.showToast({
-					title:`登录成功!`
-				})
-				
-			}
-			uni.$on('user_getUid',uidCallback)
-		},
-		onShow: function() {
-			console.log('App Show')
-		},
-		onHide: function() {
-			console.log('App Hide')
-		},
-		
-		
-	}
+import { getToken } from "./Lib/Request";
+export default {
+  onLaunch: function () {
+    console.log("App Launch");
+    //获取token
+    getToken();
+
+    function uidCallback(data) {
+      console.log(data);
+      uni.showToast({
+        title: `登录成功!`,
+      });
+    }
+    uni.$on("user_getUid", uidCallback);
+  },
+  onShow: function () {
+    console.log("App Show");
+  },
+  onHide: function () {
+    console.log("App Hide");
+  },
+};
 </script>
 
 <style>
-	/*每个页面公共css */
+/*每个页面公共css */
+ @import './common/common.css';
 </style>

+ 51 - 0
common/common.css

@@ -0,0 +1,51 @@
+/* 按钮默认样式 */
+
+.btn {
+    background-color: #353535;
+    width: 69.33%;
+    border-radius: 50rpx;
+    color: white;
+    padding-top: 24rpx;
+    padding-bottom: 24rpx;
+    font-size: 32rpx;
+    font-weight: 600;
+    line-height: 1;
+}
+
+
+/* 默认按钮按下样式 */
+
+.btn-hover {
+    background-color: #999999;
+    color: white;
+}
+
+
+/* 紫色按钮样式 */
+
+.btn-primary {
+    background-color: #684bbe;
+}
+
+
+/* 紫色按钮按下样式 */
+
+.btn-primary-hover {
+    background-color: #a78be0;
+    color: white;
+}
+
+
+/* 取消按钮的样式*/
+
+.btn-cancel {
+    background-color: #999999;
+}
+
+
+/* 取消按钮按下的样式*/
+
+.btn-cancel-hover {
+    background-color: #ccc8c8;
+    color: #5c5b5b;
+}

+ 1 - 1
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="content">
-    <button type="primary" @click="addDevice">添加设备</button>
+    <button  @click="addDevice1" hover-class="button-hover">添加设备</button>
     <device-item v-for="(device,index) in deviceList" :key="index" :device="device" @onclick='goDeviceInfo'></device-item>
   </view>
 </template>

BIN
static/home/home.png


BIN
static/home/home_selected.png


BIN
static/home/mine.png


BIN
static/home/mine_selected.png


BIN
static/home/play.png


BIN
static/home/play_selected.png