Browse Source

修改小程序背景颜色

zs 1 year ago
parent
commit
fd2a973cb7

+ 1 - 0
App.vue

@@ -119,6 +119,7 @@
 		--f69Color: #696969;
 		--f69Color: #696969;
 		--f80Color: #808080;
 		--f80Color: #808080;
 		--f33Color: #333333;
 		--f33Color: #333333;
+		--f12Color: #121212;
 		--fFB1Color: #7A7E83;
 		--fFB1Color: #7A7E83;
 		--fDCColor: #DCDCDC;
 		--fDCColor: #DCDCDC;
 		--fcColor: #cccccc;
 		--fcColor: #cccccc;

+ 20 - 15
pages.json

@@ -1,23 +1,28 @@
 {
 {
 	"pages": [{
 	"pages": [{
-		"path": "pages/index/index",
-		"style": {
-			"navigationBarTitleText": "系统页"
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "系统页",
+				"navigationStyle": "custom",
+				"app-plus": {
+					"titleNView": false //禁用原生导航栏  
+				}
+			}
+		},
+		{
+			"path": "pages/home/index",
+			"style": {
+				"navigationBarTitleText": "首页"
+			}
 		}
 		}
-	},
-	{
-		"path": "pages/home/index",
-		"style": {
-			"navigationBarTitleText": "首页"
-		}
-	}],
+	],
 	"globalStyle": {
 	"globalStyle": {
-		"navigationBarTextStyle": "black",
+		"navigationBarTextStyle": "white",
 		"navigationBarTitleText": "系统页",
 		"navigationBarTitleText": "系统页",
-		"navigationBarBackgroundColor": "#F8F8F8",
-		"backgroundColor": "#F8F8F8",
+		"navigationBarBackgroundColor": "#121212",
+		"backgroundColor": "#121212",
 		"app-plus": {
 		"app-plus": {
-			"background": "#efeff4"
+			"background": "#121212"
 		}
 		}
 	}
 	}
-}
+}

+ 15 - 4
pages/home/index.vue

@@ -1,16 +1,19 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
-		系统首页
+		<view class="one">
+
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
-	import { log } from 'console';
 	import {
 	import {
 		getCurrentInstance,
 		getCurrentInstance,
 		computed,
 		computed,
 		ref
 		ref
-	} from 'vue'
+	} from 'vue';
+	//该依赖已内置不需要单独安装
+	import { onLoad, onShow } from "@dcloudio/uni-app";
 	// 请求接口
 	// 请求接口
 	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
 	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
 	// openid
 	// openid
@@ -19,6 +22,9 @@
 	})
 	})
 	// 基本信息
 	// 基本信息
 	const config = ref({});
 	const config = ref({});
+	onShow(() => {
+		uni.hideHomeButton();
+	})
 	// 用户信息
 	// 用户信息
 	const initUser = async () => {
 	const initUser = async () => {
 		const res = await $api(`/system/matchUser/find`, 'GET', {
 		const res = await $api(`/system/matchUser/find`, 'GET', {
@@ -40,9 +46,14 @@
 	initUser();
 	initUser();
 	searchConfig();
 	searchConfig();
 </script>
 </script>
-<style>
+<style lang="scss" scoped>
 	.content {
 	.content {
 		display: flex;
 		display: flex;
 		flex-direction: column;
 		flex-direction: column;
+
+		.one {
+			height: 50vw;
+			background-color: var(--f12Color);
+		}
 	}
 	}
 </style>
 </style>

+ 4 - 4
pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-	<view class="main">
+	<view class="content">
 		<view class="one">
 		<view class="one">
 			<image class="logo" :src="logoUrl||'/static/logo.png'" />
 			<image class="logo" :src="logoUrl||'/static/logo.png'" />
 		</view>
 		</view>
@@ -76,8 +76,8 @@
 	initUser();
 	initUser();
 	searchConfig();
 	searchConfig();
 </script>
 </script>
-<style lang="scss">
-	.main {
+<style lang="scss" scoped>
+	.content {
 		display: flex;
 		display: flex;
 		flex-direction: column;
 		flex-direction: column;
 		width: 100vw;
 		width: 100vw;
@@ -85,7 +85,7 @@
 
 
 		.one {
 		.one {
 			text-align: center;
 			text-align: center;
-			margin: 40vw 0 0 0;
+			margin: 50vw 0 0 0;
 
 
 			.logo {
 			.logo {
 				width: 50vw;
 				width: 50vw;

+ 3 - 3
unpackage/dist/dev/mp-weixin/app.json

@@ -4,10 +4,10 @@
     "pages/home/index"
     "pages/home/index"
   ],
   ],
   "window": {
   "window": {
-    "navigationBarTextStyle": "black",
+    "navigationBarTextStyle": "white",
     "navigationBarTitleText": "系统页",
     "navigationBarTitleText": "系统页",
-    "navigationBarBackgroundColor": "#F8F8F8",
-    "backgroundColor": "#F8F8F8"
+    "navigationBarBackgroundColor": "#121212",
+    "backgroundColor": "#121212"
   },
   },
   "usingComponents": {}
   "usingComponents": {}
 }
 }

+ 1 - 0
unpackage/dist/dev/mp-weixin/app.wxss

@@ -2452,6 +2452,7 @@ page {
   --f69Color: #696969;
   --f69Color: #696969;
   --f80Color: #808080;
   --f80Color: #808080;
   --f33Color: #333333;
   --f33Color: #333333;
+  --f12Color: #121212;
   --fFB1Color: #7A7E83;
   --fFB1Color: #7A7E83;
   --fDCColor: #DCDCDC;
   --fDCColor: #DCDCDC;
   --fcColor: #cccccc;
   --fcColor: #cccccc;

+ 15 - 10
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -3471,43 +3471,43 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
     warn(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`);
     warn(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`);
   }
   }
 }
 }
-const createHook = (lifecycle) => (hook, target = currentInstance) => (
+const createHook$1 = (lifecycle) => (hook, target = currentInstance) => (
   // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
   // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
   (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
   (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
 );
 );
-const onBeforeMount = createHook(
+const onBeforeMount = createHook$1(
   "bm"
   "bm"
   /* LifecycleHooks.BEFORE_MOUNT */
   /* LifecycleHooks.BEFORE_MOUNT */
 );
 );
-const onMounted = createHook(
+const onMounted = createHook$1(
   "m"
   "m"
   /* LifecycleHooks.MOUNTED */
   /* LifecycleHooks.MOUNTED */
 );
 );
-const onBeforeUpdate = createHook(
+const onBeforeUpdate = createHook$1(
   "bu"
   "bu"
   /* LifecycleHooks.BEFORE_UPDATE */
   /* LifecycleHooks.BEFORE_UPDATE */
 );
 );
-const onUpdated = createHook(
+const onUpdated = createHook$1(
   "u"
   "u"
   /* LifecycleHooks.UPDATED */
   /* LifecycleHooks.UPDATED */
 );
 );
-const onBeforeUnmount = createHook(
+const onBeforeUnmount = createHook$1(
   "bum"
   "bum"
   /* LifecycleHooks.BEFORE_UNMOUNT */
   /* LifecycleHooks.BEFORE_UNMOUNT */
 );
 );
-const onUnmounted = createHook(
+const onUnmounted = createHook$1(
   "um"
   "um"
   /* LifecycleHooks.UNMOUNTED */
   /* LifecycleHooks.UNMOUNTED */
 );
 );
-const onServerPrefetch = createHook(
+const onServerPrefetch = createHook$1(
   "sp"
   "sp"
   /* LifecycleHooks.SERVER_PREFETCH */
   /* LifecycleHooks.SERVER_PREFETCH */
 );
 );
-const onRenderTriggered = createHook(
+const onRenderTriggered = createHook$1(
   "rtg"
   "rtg"
   /* LifecycleHooks.RENDER_TRIGGERED */
   /* LifecycleHooks.RENDER_TRIGGERED */
 );
 );
-const onRenderTracked = createHook(
+const onRenderTracked = createHook$1(
   "rtc"
   "rtc"
   /* LifecycleHooks.RENDER_TRACKED */
   /* LifecycleHooks.RENDER_TRACKED */
 );
 );
@@ -6559,10 +6559,15 @@ const createSubpackageApp = initCreateSubpackageApp();
   wx.createPluginApp = global.createPluginApp = createPluginApp;
   wx.createPluginApp = global.createPluginApp = createPluginApp;
   wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
   wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
 }
 }
+const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
+  !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
+};
+const onShow = /* @__PURE__ */ createHook(ON_SHOW);
 exports._export_sfc = _export_sfc;
 exports._export_sfc = _export_sfc;
 exports.computed = computed;
 exports.computed = computed;
 exports.createSSRApp = createSSRApp;
 exports.createSSRApp = createSSRApp;
 exports.defineComponent = defineComponent;
 exports.defineComponent = defineComponent;
 exports.getCurrentInstance = getCurrentInstance;
 exports.getCurrentInstance = getCurrentInstance;
 exports.index = index;
 exports.index = index;
+exports.onShow = onShow;
 exports.ref = ref;
 exports.ref = ref;

+ 4 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -9,6 +9,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       return common_vendor.index.getStorageSync("openid");
       return common_vendor.index.getStorageSync("openid");
     });
     });
     const config = common_vendor.ref({});
     const config = common_vendor.ref({});
+    common_vendor.onShow(() => {
+      common_vendor.index.hideHomeButton();
+    });
     const initUser = async () => {
     const initUser = async () => {
       const res = await $api(`/system/matchUser/find`, "GET", {
       const res = await $api(`/system/matchUser/find`, "GET", {
         openid: openid.value
         openid: openid.value
@@ -33,5 +36,5 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     };
   }
   }
 });
 });
-const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/project/足球比赛/match_applet/pages/home/index.vue"]]);
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4978fed5"], ["__file", "D:/project/足球比赛/match_applet/pages/home/index.vue"]]);
 wx.createPage(MiniProgramPage);
 wx.createPage(MiniProgramPage);

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml

@@ -1 +1 @@
-<view class="content"> 系统首页 </view>
+<view class="content data-v-4978fed5"><view class="one data-v-4978fed5"></view></view>

+ 10 - 5
unpackage/dist/dev/mp-weixin/pages/home/index.wxss

@@ -1,5 +1,10 @@
-
-.content {
-		display: flex;
-		flex-direction: column;
-}
+/* 水平间距 */
+/* 水平间距 */
+.content.data-v-4978fed5 {
+  display: flex;
+  flex-direction: column;
+}
+.content .one.data-v-4978fed5 {
+  height: 50vw;
+  background-color: var(--f12Color);
+}

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -70,5 +70,5 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     };
   }
   }
 });
 });
-const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/project/足球比赛/match_applet/pages/index/index.vue"]]);
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/project/足球比赛/match_applet/pages/index/index.vue"]]);
 wx.createPage(MiniProgramPage);
 wx.createPage(MiniProgramPage);

+ 1 - 0
unpackage/dist/dev/mp-weixin/pages/index/index.json

@@ -1,4 +1,5 @@
 {
 {
   "navigationBarTitleText": "系统页",
   "navigationBarTitleText": "系统页",
+  "navigationStyle": "custom",
   "usingComponents": {}
   "usingComponents": {}
 }
 }

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/index/index.wxml

@@ -1 +1 @@
-<view class="main"><view class="one"><image class="logo" src="{{a}}"/></view></view>
+<view class="content data-v-1cf27b2a"><view class="one data-v-1cf27b2a"><image class="logo data-v-1cf27b2a" src="{{a}}"/></view></view>

+ 4 - 4
unpackage/dist/dev/mp-weixin/pages/index/index.wxss

@@ -1,16 +1,16 @@
 /* 水平间距 */
 /* 水平间距 */
 /* 水平间距 */
 /* 水平间距 */
-.main {
+.content.data-v-1cf27b2a {
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
   width: 100vw;
   width: 100vw;
   height: 100vh;
   height: 100vh;
 }
 }
-.main .one {
+.content .one.data-v-1cf27b2a {
   text-align: center;
   text-align: center;
-  margin: 40vw 0 0 0;
+  margin: 50vw 0 0 0;
 }
 }
-.main .one .logo {
+.content .one .logo.data-v-1cf27b2a {
   width: 50vw;
   width: 50vw;
   height: 50vw;
   height: 50vw;
   border-radius: 90px;
   border-radius: 90px;