Przeglądaj źródła

+ 与会企业行程

chen.cheng 11 miesięcy temu
rodzic
commit
02e69394c9

+ 7 - 0
common/EnumConst.js

@@ -0,0 +1,7 @@
+export const COMP_CODE = {
+  index_ctl: 'index_ctl',
+  index_swip: 'index_swip',
+};
+export const ICON_CFG = {
+  file_icon: '/profile/upload/2024/08/17/file_icon_20240817121536A002.svg',
+};

+ 9 - 0
common/api.js

@@ -6,3 +6,12 @@ export const fetchContentInfo = (params) => http.get('/cp/contentInfo/list',
   { params });
 
 export const fetchContentDetail = (id) => http.get(`/cp/contentInfo/${id}`);
+
+export const fetchMsgList = (params) => http.get('/cp/msg/list',
+  { params });
+
+export const fetchViewCfgList = (params) => http.get('/cp/viewcfg/list',
+  { params });
+
+export const fetchFileList = (params) => http.get('/cp/fileInfo/list',
+  { params });

+ 14 - 0
jsconfig.json

@@ -0,0 +1,14 @@
+{
+    "compilerOptions": {
+        "baseUrl": "./",
+        "paths": {
+            "@/*": [
+                "./*"
+            ]
+        }
+    },
+    "exclude": [
+        "node_modules",
+        "dist"
+    ]
+}

+ 6 - 2
package.json

@@ -39,7 +39,9 @@
 				"env": {
 					"UNI_PLATFORM": "mp-weixin",
 					"UNI_FILE_PREFIX": "http://127.0.0.1:8080/tfc",
-					"UNI_API_PREFIX": "http://127.0.0.1:8080/tfc"
+					"UNI_API_PREFIX": "http://127.0.0.1:8080/tfc",
+					"UNI_WX_APPID": "wxf385eefdd03327fd",
+					"UNI_WX_AS": "7bca97ad298a17539c7c75a5bf337063"
 				},
 				"define": {
 					"MP-WEIXIN": true
@@ -50,7 +52,9 @@
 				"env": {
 					"UNI_PLATFORM": "mp-weixin",
 					"UNI_FILE_PREFIX": "http://127.0.0.1:8080/tfc",
-					"UNI_API_PREFIX": "http://127.0.0.1:8080/tfc/"
+					"UNI_API_PREFIX": "http://127.0.0.1:8080/tfc/",
+					"UNI_WX_APPID": "wxf385eefdd03327fd",
+					"UNI_WX_AS": "7bca97ad298a17539c7c75a5bf337063"
 				},
 				"define": {
 					"MP-WEIXIN": true

+ 25 - 7
pages.json

@@ -17,18 +17,36 @@
 			"style": {
 				"navigationBarTitleText": "我的"
 			}
+		}
+	],
+	"subPackages": [
+		{
+			"root": "pasb",
+			"name": "sub-1",
+			"pages": [
+				{
+					"path": "pages/detail/index",
+					"style": {
+						"navigationBarTitleText": "最新资讯"
+					}
+				}
+			]
 		},
 		{
-			"path": "pages/detail/index",
-			"style": {
-				"navigationBarTitleText": "资讯详情"
-			}
+			"root": "pasb",
+			"name": "sub-2",
+			"pages": [
+				{
+					"path": "pages/file/index",
+					"style": {
+						"navigationBarTitleText": "交流材料汇编"
+					}
+				}
+			]
 		}
 	],
-	"subPackages": [],
 	"globalStyle": {
-		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "uView",
+		"navigationBarTextStyle": "#fefefe",
 		"navigationBarBackgroundColor": "#005598",
 		"backgroundColor": "#f2f2f2"
 	},

+ 43 - 43
pages/tabbar/index/index.vue

@@ -5,7 +5,7 @@
     </view>
 
     <u-swiper :list="list" imgMode="aspectFill" :radius='0' :height="240" />
-    <u-notice-bar :text="msg" :more-icon="false" color="#5af" bg-color="#d6e8f7"></u-notice-bar>
+    <u-notice-bar :text="msg" direction="column" :more-icon="false" color="#5af" bg-color="#d6e8f7"></u-notice-bar>
     <view style="width: 100%; margin-top: 20rpx">
       <u-grid
           :border="false"
@@ -16,7 +16,7 @@
             v-for="(baseListItem,baseListIndex) in baseList"
             :key="baseListIndex"
         >
-          <view class="grid-item-icon" :style="{backgroundColor: baseListItem.bgColor}">
+          <view class="grid-item-icon" :style="[baseListItem.style]">
             <image :src="baseListItem.icon"></image>
           </view>
           <text class="grid-text">{{ baseListItem.title }}</text>
@@ -43,6 +43,8 @@
 import { fetchContentInfo } from '@/common/api';
 import ItemList from '@/components/ItemList/index.vue';
 import { getImageUrl } from '@/util';
+import { fetchMsgList, fetchViewCfgList } from '@/common/api';
+import { COMP_CODE } from '@/common/EnumConst';
 
 export default {
   components: {
@@ -52,52 +54,20 @@ export default {
     return {
       keyword: '',
       list: [
-        '/static/images/swiper/title.png',
       ],
-      msg: '加快建设交通强国大会将于2024年8月在南京召开',
+      msg: [],
       baseList: [
-        {
-          name: 'photo',
-          icon: '/static/images/icons/meeting_info.svg',
-          bgColor: '#6abff9',
-          title: '大会介绍',
-        },
-        {
-          name: 'lock',
-          icon: '/static/images/icons/meeting_apply.svg',
-          bgColor: '#f1b06c',
-          title: '会议报名',
-        },
-        {
-          name: 'star',
-          icon: '/static/images/icons/meeting_point.svg',
-          title: '会议指南',
-          bgColor: '#ee794d',
-        },
-        {
-          name: 'star',
-          icon: '/static/images/icons/meeting_doc.svg',
-          title: '交流材料汇编',
-          bgColor: '#e66b66',
-        },
-        {
-          name: 'star',
-          icon: '/static/images/icons/meeting_traffic.svg',
-          title: '交通指引',
-          bgColor: '#82cf92',
-        },
-        {
-          name: 'star',
-          icon: '/static/images/icons/meeting_contact.svg',
-          title: '联系我们',
-          bgColor: '#4a75f6',
-        },
       ],
       indexList: [],
+      styleObj: {
+        "backgroundColor": "#000"
+      }
     };
   },
   onLoad() {
+    this.loadMsg();
     this.loadmore();
+    this.viewCfg();
   },
   methods: {
     click() {
@@ -105,7 +75,7 @@ export default {
     },
     onContentClick(item) {
       uni.navigateTo({
-        url: `/pages/detail/index?id=${item.id}`,
+        url: `/pasb/pages/detail/index?id=${item.id}`,
       });
     },
     async loadmore() {
@@ -122,9 +92,39 @@ export default {
         };
         });
     },
+    async loadMsg() {
+      let result = [];
+      const res = await fetchMsgList({
+        pageNum: 1,
+        pageSize: 99,
+      });
+      if (res.rows.length > 0) {
+        result = res.rows.map(item => item.msg);
+      }
+      this.msg = result;
+    },
+    async viewCfg() {
+      let result = [];
+      const res = await fetchViewCfgList({
+        pageNum: 1,
+        pageSize: 99,
+      });
+      if (res.rows.length > 0) {
+        result = res.rows.map(item => item.msg);
+        const index_ctl = res.rows.filter((item) => item.compCode === COMP_CODE.index_ctl);
+        const index_swip = res.rows.filter((item) => item.compCode === COMP_CODE.index_swip);
+        this.list = index_swip.map(item => getImageUrl(item.iconUri));
+        this.baseList = index_ctl.map(item => {
+          return {
+            icon: getImageUrl(item.iconUri),
+            style: JSON.parse(item.style),
+            title: item.labelTxt,
+          };
+        });
+      }
+    },
     onSearch(val) {
-      debugger
-      uni.navigateTo({
+      uni.reLaunch({
         url: `/pages/tabbar/news/index?keyword=${val}`,
       });
     },

+ 41 - 4
pages/tabbar/my/index.vue

@@ -10,17 +10,54 @@
 </template>
 
 <script>
-	export default {
+
+  export default {
 		data() {
 			return {
-			
+
 			}
 		},
 		onLoad() {
-			
+      // #ifdef MP-WEIXIN
+      wx.login({
+        success: function(res) {
+          wx.request({
+            url: "https://api.weixin.qq.com/sns/jscode2session",
+            data: {
+              appid: process.env.UNI_WX_APPID,
+              secret: process.env.UNI_WX_AS,
+              js_code: res.code,
+              grant_type: "authorization_code",
+            },
+            success: function(response) {
+              const openid = response.data.openid;
+              console.log("获取到的code:", res.code, "获取到的openid:", openid);
+              // 使用登录凭证获取用户信息
+              uni.getUserInfo({
+                provider: 'weixin',
+                success: function (infoRes) {
+                  console.log(infoRes.userInfo); // 打印用户信息
+                  console.log('用户昵称为: ' + infoRes.userInfo.nickName); // 打印用户昵称
+                  // 在这里,你可以将用户的头像和昵称保存到本地或者发送到后端进行处理
+                  // infoRes.userInfo.avatarUrl是用户的头像链接
+                  // infoRes.userInfo.nickName是用户的昵称
+                }
+              });
+            }
+          })
+        }
+      })
+      // #endif
 		},
 		methods: {
-			
+			getUserInfo() {
+				uni.getUserProfile({
+					desc: '获取用户信息',
+					success: (res) => {
+						console.log(res);
+					}
+				})
+			},
 		},
 		onShareAppMessage() {
 			return {

+ 16 - 17
pages/tabbar/news/index.vue

@@ -30,38 +30,37 @@ export default {
   },
   data() {
     return {
-      keyword: this.queryParams?.keyword || '',
+      keyword: '',
       indexList: [],
     };
   },
-  watch: {
-    keyword(val) {
-      this.indexList = [];
-      this.loadmore();
-    },
-  },
-  onLoad() {
+  onLoad(option) {
+    this.keyword = option?.keyword || '';
     this.loadmore();
   },
   methods: {
     async loadmore() {
+      let result = [];
       const res = await fetchContentInfo({
         pageNum: 1,
         pageSize: 99,
         title: this.keyword,
       });
-      this.indexList = res.rows.map(item => {
-        return {
-          id: item.id,
-          imgUrl: getImageUrl(item.thumbnail),
-          title: item.title,
-          date: item.createTime,
-        };
-      });
+      if (res.rows.length > 0) {
+        result = res.rows.map(item => {
+          return {
+            id: item.id,
+            imgUrl: getImageUrl(item.thumbnail),
+            title: item.title,
+            date: item.createTime,
+          };
+        });
+      }
+      this.indexList = result;
     },
     onContentClick(item) {
       uni.navigateTo({
-        url: `/pages/detail/index?id=${item.id}`,
+        url: `/pasb/pages/detail/index?id=${item.id}`,
       });
     },
   },

+ 0 - 0
pages/detail/index.scss → pasb/pages/detail/index.scss


+ 0 - 0
pages/detail/index.vue → pasb/pages/detail/index.vue


+ 5 - 0
pasb/pages/file/index.scss

@@ -0,0 +1,5 @@
+.content-info-container {
+  width: 90%;
+  margin: 20rpx auto;
+  padding: 0;
+}

+ 79 - 0
pasb/pages/file/index.vue

@@ -0,0 +1,79 @@
+<template>
+  <view class="file-info-container">
+    <view class="u-page">
+      <u-list
+          @scrolltolower="scrolltolower"
+      >
+        <u-list-item
+            v-for="(item, index) in indexList"
+            :key="index"
+        >
+          <view class="file-info-item">
+            <view class="file-info-item-img">
+              <image :src="getImageUrl(ICON_CFG.file_icon)" mode="aspectFill" />
+            </view>
+            <view class="file-info-item-content">
+              <view class="file-info-item-title">{{ item.title }}</view>
+              <view class="file-info-item-date">{{ item.date }}</view>
+            </view>
+          </view>
+        </u-list-item>
+      </u-list>
+      <u-loadmore :status="loadStatus" />
+    </view>
+  </view>
+</template>
+
+<script>
+
+import { fetchFileList } from '@/common/api';
+import { ICON_CFG } from '@/common/EnumConst';
+import { getImageUrl } from '@/util';
+
+let page = 1;
+export default {
+  name: 'content',
+  props: {},
+  data() {
+    return {
+      ICON_CFG,
+      indexList: [],
+      loadStatus: 'loadmore', // loadmore,loading,nomore
+    };
+  },
+  created() {
+  },
+  onLoad() {
+    this.loadmore();
+  },
+  methods: {
+    getImageUrl,
+    scrolltolower() {
+      this.loadmore();
+    },
+    loadmore() {
+      this.loadStatus = 'loading';
+      fetchFileList({
+        pageNum: page,
+        pageSize: 10,
+        fileType: 1,
+      }).then(res => {
+        page += 1;
+        if (res.rows.length > 0) {
+          this.indexList = this.indexList.concat(res.rows.map(item => {
+            return {
+              id: item.id,
+              title: item.fileName,
+              date: item.createTime,
+            };
+          }));
+        }
+        if (res.rows.length < 10) {
+          this.loadStatus = 'nomore';
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" src="./index.scss" />;

+ 0 - 1
static/images/icons/meeting_apply.svg

@@ -1 +0,0 @@
-<svg t="1723263597553" class="icon" viewBox="0 0 1059 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15563" width="32" height="32"><path d="M282.474785 918.043052a34.956255 34.956255 0 0 1-19.571467-5.952147L165.853053 847.424356H136.1932a136.1932 136.1932 0 0 1-136.1932-136.1932V136.1932A136.1932 136.1932 0 0 1 136.1932 0h716.275349a136.1932 136.1932 0 0 1 136.1932 136.1932v322.828326a35.309348 35.309348 0 0 1-70.618697 0V136.1932a65.574504 65.574504 0 0 0-65.574503-65.574504H136.1932a65.574504 65.574504 0 0 0-65.574504 65.574504v575.037956a65.574504 65.574504 0 0 0 65.574504 65.574504h40.353541a35.309348 35.309348 0 0 1 19.571467 5.952147L282.474785 840.312044l86.356578-57.554237A35.309348 35.309348 0 0 1 388.40283 776.80566h141.237392a35.309348 35.309348 0 0 1 0 70.618696H399.096518l-97.050265 64.666549A34.956255 34.956255 0 0 1 282.474785 918.043052z" p-id="15564" fill="#ffffff"></path><path d="M706.186963 317.784133H211.856089a35.309348 35.309348 0 0 1 0-70.618696h494.330874a35.309348 35.309348 0 0 1 0 70.618696zM459.021526 494.330874H211.856089a35.309348 35.309348 0 0 1 0-70.618696h247.165437a35.309348 35.309348 0 0 1 0 70.618696zM628.758607 1023.971097a35.309348 35.309348 0 0 1-34.603161-42.219892l24.968753-124.843767a35.309348 35.309348 0 0 1 9.634408-18.058209l249.687533-249.687534a105.928044 105.928044 0 0 1 149.81252 0 105.928044 105.928044 0 0 1 0 149.81252l-249.687533 249.687534a35.006697 35.006697 0 0 1-18.007768 9.634407l-124.843766 25.220963a32.585484 32.585484 0 0 1-6.960986 0.453978z m124.843767-60.278102z m-67.339971-82.472549l-12.459156 62.447105L736.452119 931.157953l242.121244-242.121245a35.309348 35.309348 0 0 0 0-49.937506 35.309348 35.309348 0 0 0-49.937506 0z" p-id="15565" fill="#ffffff"></path></svg>

Plik diff jest za duży
+ 0 - 0
static/images/icons/meeting_contact.svg


+ 0 - 1
static/images/icons/meeting_doc.svg

@@ -1 +0,0 @@
-<svg t="1723263695819" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20086" width="32" height="32"><path d="M407.374 398.024h367.26v71.814H407.329v-71.814z m0-215.44h367.26v71.813H407.329v-71.813z" fill="#ffffff" p-id="20087"></path><path d="M893.596 559.727V26.18A26.179 26.179 0 0 0 867.417 0H283.782a26.179 26.179 0 0 0-26.18 26.179v98.215H156.584a26.179 26.179 0 0 0-26.179 26.179v409.154H93.006a26.179 26.179 0 0 0-26.223 26.18V995.06h890.434V585.906a26.179 26.179 0 0 0-26.178-26.179H893.64zM321.18 62.197h508.839v497.53H575.622v124.394H448.334V559.727H321.18V62.197zM193.98 186.547h63.622v373.136H193.98V186.59z m699.615 746.272H130.449V621.97H384.89v124.393h254.398V621.97h254.397v310.94z" fill="#ffffff" p-id="20088"></path></svg>

+ 0 - 1
static/images/icons/meeting_info.svg

@@ -1 +0,0 @@
-<svg t="1723263519034" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10942" width="32" height="32"><path d="M806.5024 1013.76c-9.216 0-18.432-3.4816-25.3952-10.4448L569.5488 789.9136c-13.9264-13.9264-13.7216-36.6592 0.2048-50.5856 13.9264-14.1312 36.4544-13.9264 50.5856 0.2048l211.5584 213.4016c13.9264 13.9264 13.7216 36.6592-0.2048 50.5856-6.9632 6.9632-15.9744 10.24-25.1904 10.24z" fill="#ffffff" p-id="10943"></path><path d="M521.6256 728.6784c19.6608 0 35.6352 15.9744 35.6352 35.6352v214.2208c0 19.6608-15.9744 35.6352-35.6352 35.6352-19.6608 0-35.6352-15.9744-35.6352-35.6352V764.3136c0-19.6608 15.9744-35.6352 35.6352-35.6352z" fill="#ffffff" p-id="10944"></path><path d="M236.7488 1013.76c9.216 0 18.432-3.4816 25.3952-10.4448l211.5584-213.4016c13.9264-13.9264 13.7216-36.6592-0.2048-50.5856-13.9264-14.1312-36.4544-13.9264-50.5856 0.2048L211.3536 952.9344c-13.9264 13.9264-13.7216 36.6592 0.2048 50.5856 6.9632 6.9632 15.9744 10.24 25.1904 10.24z" fill="#ffffff" p-id="10945"></path><path d="M628.736 14.336H414.5152c-39.5264 0-71.4752 31.9488-71.4752 71.4752v71.4752c0 39.5264 31.9488 71.4752 71.4752 71.4752H628.736c39.5264 0 71.4752-31.9488 71.4752-71.4752V85.8112C700.2112 46.2848 668.2624 14.336 628.736 14.336z m0 142.9504H414.5152V85.8112H628.736v71.4752z" fill="#ffffff" p-id="10946"></path><path d="M343.04 157.2864H128.8192v571.392h785.6128v-571.392H700.2112V85.8112h214.2208c39.5264 0 71.4752 31.9488 71.4752 71.4752v571.392c0 39.5264-31.9488 71.4752-71.4752 71.4752H128.8192C89.2928 799.9488 57.344 768 57.344 728.6784v-571.392c0-39.5264 31.9488-71.4752 71.4752-71.4752h214.2208v71.4752z" fill="#ffffff" p-id="10947"></path></svg>

Plik diff jest za duży
+ 0 - 0
static/images/icons/meeting_point.svg


+ 0 - 1
static/images/icons/meeting_traffic.svg

@@ -1 +0,0 @@
-<svg t="1723265564394" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23308" width="32" height="32"><path d="M948.5312 205.7216c9.1136 9.1136 9.1136 18.3296 0 27.4432L857.1904 324.608C851.0464 327.68 846.4384 329.1136 843.4688 329.1136L550.8096 329.1136l0 109.6704 274.3296 0c12.1856 0 18.3296 6.144 18.3296 18.3296L843.4688 640c0 12.288-6.144 18.3296-18.3296 18.3296L550.8096 658.3296l0 347.4432C550.8096 1017.9584 544.768 1024 532.5824 1024L459.4688 1024c-12.1856 0-18.3296-6.0416-18.3296-18.3296L441.1392 658.3296 112.0256 658.3296c-3.072 0-7.5776-1.4336-13.7216-4.608L6.8608 562.2784c-9.1136-9.1136-9.1136-18.3296 0-27.4432L98.304 443.392c6.144-3.072 10.6496-4.608 13.7216-4.608l329.1136 0L441.1392 329.1136 130.2528 329.1136c-12.1856 0-18.3296-6.0416-18.3296-18.3296L111.9232 128c0-12.1856 6.144-18.3296 18.3296-18.3296l310.8864 0L441.1392 18.3296C441.1392 6.144 447.2832 0 459.4688 0l73.1136 0C544.768 0 550.8096 6.144 550.8096 18.3296l0 91.4432 292.5568 0c3.072 0 7.5776 1.536 13.7216 4.608L948.5312 205.7216zM806.8096 475.4432 118.8864 475.4432 45.6704 548.5568l73.1136 73.1136 688.0256 0L806.8096 475.4432zM909.7216 219.4432 836.608 146.3296 148.5824 146.3296l0 146.3296L836.608 292.6592 909.7216 219.4432zM477.696 109.6704l36.5568 0L514.2528 36.5568 477.696 36.5568 477.696 109.6704zM514.2528 329.1136 477.696 329.1136l0 109.6704 36.5568 0L514.2528 329.1136zM514.2528 658.3296 477.696 658.3296l0 329.1136 36.5568 0L514.2528 658.3296z" p-id="23309" fill="#ffffff"></path></svg>

BIN
static/images/swiper/title.png


+ 2 - 0
util/index.js

@@ -1,3 +1,5 @@
 export const getImageUrl = (uri) => {
   return `${process.env.UNI_FILE_PREFIX}${uri}`;
 };
+
+

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików