xiaokuang před 3 týdny
rodič
revize
70af04e51e
4 změnil soubory, kde provedl 140 přidání a 68 odebrání
  1. 7 6
      components/common/u-swiper/index.vue
  2. 86 31
      package-lock.json
  3. 47 30
      pages/index/home.vue
  4. 0 1
      utils/request.js

+ 7 - 6
components/common/u-swiper/index.vue

@@ -5,9 +5,9 @@
 			<template v-for="(item, index) in items">
 				<swiper-item :key="index">
 					<view class="image-wrapper" @tap="onImageClick(item)">
-						<image v-if="item.src" :mode="imageMode" :src="item.src" :style="imageStyle"/>
+						<image v-if="item.url" :mode="imageMode" :src="item.url" :style="imageStyle"/>
 						<slot v-else :scope="item"></slot>
-						<view class="video-play" v-if="item.url && item.url.indexOf('.mp4') !== -1">
+						<view class="video-play" v-if="item.href && item.href.indexOf('.mp4') !== -1">
 							<view class="iconfont icon-playcircle"></view>
 						</view>
 					</view>
@@ -128,12 +128,13 @@
 				this.current = e.detail.current
 			},
 			onImageClick(item) {
-				if (item.url) {
-					if (item.url.indexOf('.mp4') !== -1) {
-						this.videoUrl = item.url
+				if (item.href) {
+					if (item.href.indexOf('.mp4') !== -1) {
+						this.videoUrl = item.href
 						this.showOverlay = true
 					} else {
-						this.navigateTo(item.url)
+						console.log(item.href);
+						this.navigateTo(item.href)
 					}
 				}
 			}

+ 86 - 31
package-lock.json

@@ -1,124 +1,179 @@
 {
 	"name": "productronica",
 	"version": "1.0.0",
-	"lockfileVersion": 1,
+	"lockfileVersion": 3,
 	"requires": true,
-	"dependencies": {
-		"@escook/request-miniprogram": {
+	"packages": {
+		"": {
+			"name": "productronica",
+			"version": "1.0.0",
+			"license": "ISC",
+			"dependencies": {
+				"@escook/request-miniprogram": "^0.2.1",
+				"axios": "^1.7.7",
+				"vue-i18n": "^10.0.4",
+				"vuex": "^4.1.0"
+			}
+		},
+		"node_modules/@escook/request-miniprogram": {
 			"version": "0.2.1",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz",
 			"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ=="
 		},
-		"@intlify/core-base": {
+		"node_modules/@intlify/core-base": {
 			"version": "10.0.4",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/@intlify/core-base/-/core-base-10.0.4.tgz",
 			"integrity": "sha512-GG428DkrrWCMhxRMRQZjuS7zmSUzarYcaHJqG9VB8dXAxw4iQDoKVQ7ChJRB6ZtsCsX3Jse1PEUlHrJiyQrOTg==",
-			"requires": {
+			"dependencies": {
 				"@intlify/message-compiler": "10.0.4",
 				"@intlify/shared": "10.0.4"
 			}
 		},
-		"@intlify/message-compiler": {
+		"node_modules/@intlify/message-compiler": {
 			"version": "10.0.4",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/@intlify/message-compiler/-/message-compiler-10.0.4.tgz",
 			"integrity": "sha512-AFbhEo10DP095/45EauinQJ5hJ3rJUmuuqltGguvc3WsvezZN+g8qNHLGWKu60FHQVizMrQY7VJ+zVlBXlQQkQ==",
-			"requires": {
+			"dependencies": {
 				"@intlify/shared": "10.0.4",
 				"source-map-js": "^1.0.2"
 			}
 		},
-		"@intlify/shared": {
+		"node_modules/@intlify/shared": {
 			"version": "10.0.4",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/@intlify/shared/-/shared-10.0.4.tgz",
 			"integrity": "sha512-ukFn0I01HsSgr3VYhYcvkTCLS7rGa0gw4A4AMpcy/A9xx/zRJy7PS2BElMXLwUazVFMAr5zuiTk3MQeoeGXaJg=="
 		},
-		"@vue/devtools-api": {
+		"node_modules/@vue/devtools-api": {
 			"version": "6.6.4",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
 			"integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g=="
 		},
-		"asynckit": {
+		"node_modules/asynckit": {
 			"version": "0.4.0",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/asynckit/-/asynckit-0.4.0.tgz",
 			"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
 		},
-		"axios": {
+		"node_modules/axios": {
 			"version": "1.7.7",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/axios/-/axios-1.7.7.tgz",
 			"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
-			"requires": {
+			"dependencies": {
 				"follow-redirects": "^1.15.6",
 				"form-data": "^4.0.0",
 				"proxy-from-env": "^1.1.0"
 			}
 		},
-		"combined-stream": {
+		"node_modules/combined-stream": {
 			"version": "1.0.8",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/combined-stream/-/combined-stream-1.0.8.tgz",
 			"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
-			"requires": {
+			"dependencies": {
 				"delayed-stream": "~1.0.0"
+			},
+			"engines": {
+				"node": ">= 0.8"
 			}
 		},
-		"delayed-stream": {
+		"node_modules/delayed-stream": {
 			"version": "1.0.0",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/delayed-stream/-/delayed-stream-1.0.0.tgz",
-			"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
+			"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+			"engines": {
+				"node": ">=0.4.0"
+			}
 		},
-		"follow-redirects": {
+		"node_modules/follow-redirects": {
 			"version": "1.15.9",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/follow-redirects/-/follow-redirects-1.15.9.tgz",
-			"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ=="
+			"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
+			"funding": [
+				{
+					"type": "individual",
+					"url": "https://github.com/sponsors/RubenVerborgh"
+				}
+			],
+			"engines": {
+				"node": ">=4.0"
+			},
+			"peerDependenciesMeta": {
+				"debug": {
+					"optional": true
+				}
+			}
 		},
-		"form-data": {
+		"node_modules/form-data": {
 			"version": "4.0.0",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/form-data/-/form-data-4.0.0.tgz",
 			"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
-			"requires": {
+			"dependencies": {
 				"asynckit": "^0.4.0",
 				"combined-stream": "^1.0.8",
 				"mime-types": "^2.1.12"
+			},
+			"engines": {
+				"node": ">= 6"
 			}
 		},
-		"mime-db": {
+		"node_modules/mime-db": {
 			"version": "1.52.0",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/mime-db/-/mime-db-1.52.0.tgz",
-			"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
+			"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+			"engines": {
+				"node": ">= 0.6"
+			}
 		},
-		"mime-types": {
+		"node_modules/mime-types": {
 			"version": "2.1.35",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/mime-types/-/mime-types-2.1.35.tgz",
 			"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
-			"requires": {
+			"dependencies": {
 				"mime-db": "1.52.0"
+			},
+			"engines": {
+				"node": ">= 0.6"
 			}
 		},
-		"proxy-from-env": {
+		"node_modules/proxy-from-env": {
 			"version": "1.1.0",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
 			"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
 		},
-		"source-map-js": {
+		"node_modules/source-map-js": {
 			"version": "1.2.1",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/source-map-js/-/source-map-js-1.2.1.tgz",
-			"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="
+			"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+			"engines": {
+				"node": ">=0.10.0"
+			}
 		},
-		"vue-i18n": {
+		"node_modules/vue-i18n": {
 			"version": "10.0.4",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/vue-i18n/-/vue-i18n-10.0.4.tgz",
 			"integrity": "sha512-1xkzVxqBLk2ZFOmeI+B5r1J7aD/WtNJ4j9k2mcFcQo5BnOmHBmD7z4/oZohh96AAaRZ4Q7mNQvxc9h+aT+Md3w==",
-			"requires": {
+			"dependencies": {
 				"@intlify/core-base": "10.0.4",
 				"@intlify/shared": "10.0.4",
 				"@vue/devtools-api": "^6.5.0"
+			},
+			"engines": {
+				"node": ">= 16"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/kazupon"
+			},
+			"peerDependencies": {
+				"vue": "^3.0.0"
 			}
 		},
-		"vuex": {
+		"node_modules/vuex": {
 			"version": "4.1.0",
 			"resolved": "https://mirrors.cloud.tencent.com/npm/vuex/-/vuex-4.1.0.tgz",
 			"integrity": "sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ==",
-			"requires": {
+			"dependencies": {
 				"@vue/devtools-api": "^6.0.0-beta.11"
+			},
+			"peerDependencies": {
+				"vue": "^3.2.0"
 			}
 		}
 	}

+ 47 - 30
pages/index/home.vue

@@ -10,12 +10,13 @@
 		</nav-bar>
 		<u-swiper :items="images" indicato-dots-style="morphing" :height="387" />
 		<view class="main-container">
-			<u-search v-model="searchKeyword" placeholder="搜索展商 / 展品名称 / 会议" @search="onClickSearch"/>
+			<u-search v-model="searchKeyword" placeholder="搜索展商 / 展品名称 / 会议" @search="onClickSearch" />
 			<view class="nav-icons">
 				<template v-for="(item, index) in navIcons">
 					<view class="nav-icon-wrapper" :key="index">
 						<view class="nav-icon" @click="onClickNavIcon(item)">
-							<view v-if="item.icon.indexOf('.svg') !== -1" :style="'background-image:url(' + item.icon +  ')'"></view>
+							<view v-if="item.icon.indexOf('.svg') !== -1"
+								:style="'background-image:url(' + item.icon +  ')'"></view>
 							<view v-else-if="item.icon.indexOf('icon-') !== -1" :class="'iconfont ' + item.icon"></view>
 						</view>
 						<view class="nav-text">
@@ -26,8 +27,8 @@
 			</view>
 			<view class="panel-group panel-group-1">
 				<u-panel title="精彩视频" link="https://www.productronicachina.com.cn/for-journalists-impression-videos">
-					<u-swiper :items="videos" :height="360" :autoplay="false" :border-radius="10" :image-width="508" :image-height="286"
-						next-margin="100rpx" />
+					<u-swiper :items="videos" :height="360" :autoplay="false" :border-radius="10" :image-width="508"
+						:image-height="286" next-margin="100rpx" />
 				</u-panel>
 				<u-panel title="精彩图集" link="https://www.productronicachina.com.cn/for-journalists-impression-videos">
 					<view class="album">
@@ -110,6 +111,7 @@
 	import NewsRecommend from '@/pages/news/components/news-recommend.vue'
 	import ContactUs from '@/pages/index/components/contact-us.vue'
 	import PopupAd from '@/pages/index/components/popup-ad.vue'
+	import { getDashboardInfo } from '@/api/index'
 
 	export default {
 		options: {
@@ -163,16 +165,7 @@
 					name: '交通指南',
 					link: 'https://www.productronicachina.com.cn/travel-stay-getting-there'
 				}],
-				images: [{
-					src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_750',
-					url: 'https://www.productronicachina.com.cn/'
-				}, {
-					src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_750',
-					url: 'https://www.productronicachina.com.cn/'
-				}, {
-					src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a7dd374.png?x-oss-process=image/resize,w_750',
-					url: 'https://www.productronicachina.com.cn/'
-				}],
+				images: [],
 				videos: [{
 					src: 'https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da5a8add02.jpeg?x-oss-process=image/resize,w_500',
 					url: 'https://matchexpo.obs.cn-north-1.myhuaweicloud.com/common/2023/1113/655190052f376.mp4'
@@ -235,7 +228,9 @@
 				}],
 			}
 		},
-		created() {},
+		created() {
+			this.getDashboardData()
+		},
 		methods: {
 			onClickNavIcon(item) {
 				if (item.link === '/pages/exhibitor/index') {
@@ -255,6 +250,12 @@
 					current: index,
 					urls: pics
 				})
+			},
+			getDashboardData() {
+				getDashboardInfo().then(res => {
+					this.images = res.data.module1
+					console.log(this.images)
+				})
 			}
 		}
 	}
@@ -265,21 +266,26 @@
 		width: 150rpx;
 		height: 37rpx;
 	}
-	.panel-group{
+
+	.panel-group {
 		margin-top: 43rpx;
 		background-color: #FFFFFF;
-		&.panel-group-1{
+
+		&.panel-group-1 {
 			margin-top: 0;
 		}
 	}
+
 	.top-container {
 		display: flex;
 		align-items: center;
+
 		.countdown {
 			display: flex;
 			align-items: center;
 			margin-left: 27rpx;
 			font-size: $fontSize3;
+
 			.days {
 				color: #F97316;
 				font-size: $fontSize6;
@@ -298,18 +304,21 @@
 			border: 2rpx solid #D9D9D9;
 			padding: 4rpx;
 			overflow: hidden;
-			.van-field__placeholder{
+
+			.van-field__placeholder {
 				font-size: $fontSize2;
 			}
-			.van-cell__left-icon-wrap{
+
+			.van-cell__left-icon-wrap {
 				height: 50rpx;
 			}
-			.van-field__control{
+
+			.van-field__control {
 				font-size: $fontSize2;
 				height: 50rpx;
 			}
 		}
-		
+
 		.van-search {
 			--search-padding: 0rpx;
 			--search-input-height: 34rpx;
@@ -317,7 +326,8 @@
 			padding-right: 24rpx;
 			font-size: $fontSize2;
 		}
-		.search-text{
+
+		.search-text {
 			font-size: $fontSize2;
 		}
 
@@ -360,10 +370,12 @@
 			border-radius: 50%;
 			overflow: hidden;
 			background-color: $buttonPrimaryColor;
-			.iconfont{
+
+			.iconfont {
 				font-size: 46rpx;
 				color: #FFFFFF;
 			}
+
 			&>view {
 				width: 46rpx;
 				height: 46rpx;
@@ -430,43 +442,48 @@
 		grid-template-columns: repeat(4, 1fr);
 		grid-column-gap: 9rpx;
 		grid-row-gap: 13rpx;
-		.partner{
+
+		.partner {
 			@include display-flex-center;
 			width: 150rpx;
 			height: 91rpx;
 		}
+
 		image {
 			width: 127rpx;
 			height: 25rpx;
 		}
 	}
-	.floating-buttons{
+
+	.floating-buttons {
 		position: fixed;
 		right: 30rpx;
 		bottom: 200rpx;
 		display: grid;
 		grid-template-columns: 1fr;
 		grid-row-gap: 19rpx;
-		&>view{
+
+		&>view {
 			@include display-flex-center;
 			flex-direction: column;
 			width: 100rpx;
 			height: 100rpx;
 			background-color: #FFFFFF;
-			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.25);
+			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.25);
 			border-radius: 50%;
 			cursor: pointer;
 		}
-		.floating-button-label{
+
+		.floating-button-label {
 			margin-top: 4rpx;
 			font-size: $fontSize0;
 			color: #94A3B8;
 			white-space: nowrap;
 		}
-		.iconfont{
+
+		.iconfont {
 			font-size: 44rpx;
 			color: $textActionColor;
 		}
 	}
-	
 </style>

+ 0 - 1
utils/request.js

@@ -96,7 +96,6 @@ const request = new Request()
  * 创建请求
  * @param baseURL
  */
-
 request.baseUrl = process.env.BASE_API
 request.config = {
 	retry: 3,