Browse Source

新增模块

zs 1 year ago
parent
commit
a889aeddff

+ 13 - 0
pages.json

@@ -33,6 +33,13 @@
 				"enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/news/index",
+			"style": {
+				"navigationBarTitleText": "新闻",
+				"enablePullDownRefresh": true
+			}
+		},
 		{
 			"path": "pages/my/index",
 			"style": {
@@ -127,6 +134,12 @@
 				"selectedIconPath": "static/home.png",
 				"text": "首页"
 			},
+			{
+				"pagePath": "pages/news/index",
+				"iconPath": "static/newsHL.png",
+				"selectedIconPath": "static/news.png",
+				"text": "新闻"
+			},
 			{
 				"pagePath": "pages/teacher/index",
 				"iconPath": "static/teacherHL.png",

+ 52 - 0
pages/news/index.vue

@@ -0,0 +1,52 @@
+<template>
+	<view class="content">
+		政策新闻
+		<up-overlay :show="show">
+			<login @showChange='showChange'></login>
+		</up-overlay>
+	</view>
+</template>
+
+<script setup lang="ts">
+	import { inject, computed, ref } from 'vue';
+	//该依赖已内置不需要单独安装
+	import { onShow, onPullDownRefresh } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = inject('$api');
+	const $config = inject('$config');
+	// 基本信息
+	const config = ref({ logo: [], file: [] });
+	const list = ref([]);
+	const total = ref(0);
+	// user
+	const user = computed(() => {
+		return uni.getStorageSync('user');
+	})
+	// 遮罩层
+	const show = ref(false);
+	onShow(async () => {
+		await searchConfig();
+		await searchOther();
+		await search();
+		if (!user.value) show.value = true
+	})
+	// config信息
+	const searchConfig = async () => {
+		config.value = uni.getStorageSync('config');
+	};
+	// 其他查询信息
+	const searchOther = async () => { };
+	// 查询
+	const search = async () => { };
+	const showChange = () => {
+		show.value = false
+	}
+</script>
+<style lang="scss" scoped>
+	.content {
+		display: flex;
+		flex-direction: column;
+		min-height: 100vh;
+		background-color: var(--f1Color);
+	}
+</style>

BIN
static/news.png


BIN
static/newsHL.png


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

@@ -8,6 +8,7 @@ if (!Math) {
   "./pages/index/index.js";
   "./pages/home/index.js";
   "./pages/teacher/index.js";
+  "./pages/news/index.js";
   "./pages/my/index.js";
   "./pagesHome/agree/index.js";
   "./pagesMy/order/index.js";

+ 7 - 0
unpackage/dist/dev/mp-weixin/app.json

@@ -3,6 +3,7 @@
     "pages/index/index",
     "pages/home/index",
     "pages/teacher/index",
+    "pages/news/index",
     "pages/my/index"
   ],
   "subPackages": [
@@ -43,6 +44,12 @@
         "selectedIconPath": "static/home.png",
         "text": "首页"
       },
+      {
+        "pagePath": "pages/news/index",
+        "iconPath": "static/newsHL.png",
+        "selectedIconPath": "static/news.png",
+        "text": "新闻"
+      },
       {
         "pagePath": "pages/teacher/index",
         "iconPath": "static/teacherHL.png",

+ 52 - 0
unpackage/dist/dev/mp-weixin/pages/news/index.js

@@ -0,0 +1,52 @@
+"use strict";
+const common_vendor = require("../../common/vendor.js");
+if (!Array) {
+  const _component_login = common_vendor.resolveComponent("login");
+  const _easycom_up_overlay2 = common_vendor.resolveComponent("up-overlay");
+  (_component_login + _easycom_up_overlay2)();
+}
+const _easycom_up_overlay = () => "../../node-modules/uview-plus/components/u-overlay/u-overlay.js";
+if (!Math) {
+  _easycom_up_overlay();
+}
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+  __name: "index",
+  setup(__props) {
+    common_vendor.inject("$api");
+    common_vendor.inject("$config");
+    const config = common_vendor.ref({ logo: [], file: [] });
+    common_vendor.ref([]);
+    common_vendor.ref(0);
+    const user = common_vendor.computed(() => {
+      return common_vendor.index.getStorageSync("user");
+    });
+    const show = common_vendor.ref(false);
+    common_vendor.onShow(async () => {
+      await searchConfig();
+      await searchOther();
+      await search();
+      if (!user.value)
+        show.value = true;
+    });
+    const searchConfig = async () => {
+      config.value = common_vendor.index.getStorageSync("config");
+    };
+    const searchOther = async () => {
+    };
+    const search = async () => {
+    };
+    const showChange = () => {
+      show.value = false;
+    };
+    return (_ctx, _cache) => {
+      return {
+        a: common_vendor.o(showChange),
+        b: common_vendor.p({
+          show: show.value
+        })
+      };
+    };
+  }
+});
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-52cd24e9"], ["__file", "D:/project/学吧/learn_applet/pages/news/index.vue"]]);
+wx.createPage(MiniProgramPage);

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

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "新闻",
+  "enablePullDownRefresh": true,
+  "usingComponents": {
+    "up-overlay": "../../node-modules/uview-plus/components/u-overlay/u-overlay"
+  }
+}

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

@@ -0,0 +1 @@
+<view class="content data-v-52cd24e9"> 政策新闻 <up-overlay wx:if="{{b}}" class="data-v-52cd24e9" u-s="{{['d']}}" u-i="52cd24e9-0" bind:__l="__l" u-p="{{b}}"><login class="data-v-52cd24e9" bindshowChange="{{a}}" u-i="52cd24e9-1,52cd24e9-0" bind:__l="__l"></login></up-overlay></view>

+ 8 - 0
unpackage/dist/dev/mp-weixin/pages/news/index.wxss

@@ -0,0 +1,8 @@
+/* 水平间距 */
+/* 水平间距 */
+.content.data-v-52cd24e9 {
+  display: flex;
+  flex-direction: column;
+  min-height: 100vh;
+  background-color: var(--f1Color);
+}

BIN
unpackage/dist/dev/mp-weixin/static/news.png


BIN
unpackage/dist/dev/mp-weixin/static/newsHL.png