Browse Source

小程序首页服务跳转对应小程序,压缩首页banner图片

wrh 2 năm trước cách đây
mục cha
commit
b9217bb6e4

+ 122 - 44
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/index/index.js

@@ -8,7 +8,9 @@ import {
 	request
 } from "../api/request"
 
-import { yjzjList } from "../api/index-api"
+import {
+	yjzjList
+} from "../api/index-api"
 
 import * as echarts from '../../ec-canvas/echarts';
 
@@ -66,10 +68,10 @@ Page({
 				img: imgUrl + 'service-9.png',
 				name: '住房置业'
 			},
-			{
-				img: imgUrl + 'service-10.png',
-				name: '更多功能'
-			}
+			// {
+			// 	img: imgUrl + 'service-10.png',
+			// 	name: '更多功能'
+			// }
 		],
 		// 百姓聚焦
 		peopleService: [{
@@ -324,21 +326,97 @@ Page({
 			this.setData({
 				naItemTab: 1
 			})
-  },
-  // 点击服务
-  clickService1(e) {
-    const index = e.currentTarget.dataset.item
-    switch(index) {
-      case 0: {
-        wx.navigateToMiniProgram({
-          appId: 'wxd2ade0f25a874ee2',
-          success(res) {
-            // 打开成功
-          }
-        })
-      };break;
-    }
-  },
+	},
+	// 点击服务
+	clickService1(e) {
+		const index = e.currentTarget.dataset.item
+		switch (index) {
+			case 0: {
+				wx.navigateToMiniProgram({
+					appId: 'wxd2ade0f25a874ee2',
+					success(res) {
+						// 打开成功
+					}
+				})
+			};
+			break;
+		case 1: {
+			wx.navigateToMiniProgram({
+				appId: 'wxfc86707bae655315',
+				success(res) {
+					// 打开成功
+				}
+			})
+		};
+		break;
+		case 2: {
+			wx.navigateToMiniProgram({
+				appId: 'wx0bff7955e6e8b2bb',
+				success(res) {
+					// 打开成功
+				}
+			})
+		};
+		break;
+		case 3: {
+			wx.navigateToMiniProgram({
+				appId: 'wxfc86707bae655315',
+				success(res) {
+					// 打开成功
+				}
+			})
+		};
+		break;
+		case 4: {
+			wx.navigateToMiniProgram({
+				appId: 'wxfc86707bae655315',
+				success(res) {
+					// 打开成功
+				}
+			})
+		};
+		break;
+		}
+	},
+	// 点击服务
+	clickService2(e) {
+		const index = e.currentTarget.dataset.item
+		switch (index) {
+			case 0: {
+				wx.navigateToMiniProgram({
+					appId: 'wxfc86707bae655315',
+					success(res) {
+						// 打开成功
+					}
+				})
+			};
+			break;
+		case 1: {
+			wx.navigateToMiniProgram({
+				appId: 'wxbb58374cdce267a6',
+				success(res) {
+					// 打开成功
+				}
+			})
+		};
+		break;
+		case 2: {
+			wx.navigateTo({
+				url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/maps/sy_mobile.html&se=核酸检测",
+			})
+		};
+		break;
+		case 3: {
+			wx.navigateToMiniProgram({
+				appId: 'wxfc86707bae655315',
+				success(res) {
+					// 打开成功
+				}
+			})
+		};
+		break;
+		}
+	},
 	toDataCenter() {
 		wx.navigateTo({
 			url: '/pages/dataCenter/dataCenter',
@@ -679,12 +757,12 @@ Page({
 			var list = []
 			if (res.statusCode == 200 && res.datas.pageInfo.totalResults > 0) {
 				list = res.datas.data
-				for (var i=0;i<list.length;i++) {
+				for (var i = 0; i < list.length; i++) {
 					list[i].beginTime = this.formatDateNumber(new Date(list[i].beginTime * 1))
 					list[i].endTime = this.formatDateNumber(new Date(list[i].endTime * 1))
 				}
 				this.setData({
-					'yjzjDataList':list
+					'yjzjDataList': list
 				})
 			}
 		})
@@ -692,8 +770,8 @@ Page({
 	goYjzjDetail(e) {
 		var html = e.currentTarget.dataset.item
 		wx.navigateTo({
-		  url: "/pages/yjzjDetail/yjzjDetail?html=" + encodeURIComponent(html)
-		})	
+			url: "/pages/yjzjDetail/yjzjDetail?html=" + encodeURIComponent(html)
+		})
 	},
 	// 日期格式化
 	formatDateNumber: function (date) {
@@ -799,42 +877,42 @@ Page({
 			url: '/pages/dataCenterZWTJ/dataCenterZWTJ',
 		})
 	},
-	gotoNewsPaper(){
+	gotoNewsPaper() {
 		wx.navigateTo({
 			url: '/pages/newsPaper/newsPaper',
 		})
 	},
-	gotoZlwd(){
+	gotoZlwd() {
 		wx.navigateTo({
-		  url: '/pages/web/web?url='+"https://www.cqna.gov.cn/ghwd/znwd/mobile/index.html",
-		})	
+			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/ghwd/znwd/mobile/index.html",
+		})
 	},
 	gotoDTSS(e) {
-    const search = e.currentTarget.dataset.item
-    if (search && search != '') {
-      wx.navigateTo({
-        url: '/pages/web/web?url='+"https://www.cqna.gov.cn/maps/sy_mobile.html&se=" + search,
-      })
-    } else {
-      wx.navigateTo({
-        url: '/pages/web/web?url='+"https://www.cqna.gov.cn/maps/sy_mobile.html",
-      })
-    }
+		const search = e.currentTarget.dataset.item
+		if (search && search != '') {
+			wx.navigateTo({
+				url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/maps/sy_mobile.html&se=" + search,
+			})
+		} else {
+			wx.navigateTo({
+				url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/maps/sy_mobile.html",
+			})
+		}
 	},
 	gotoMTJZ() {
 		wx.navigateTo({
-			url: '/pages/web/web?url='+"https://data.cqna.gov.cn/newMedia/officialAccounts.html",
-		  })	
+			url: '/pages/web/web?url=' + "https://data.cqna.gov.cn/newMedia/officialAccounts.html",
+		})
 	},
 	gotoSPTJ() {
 		wx.navigateTo({
-			url: '/pages/web/web?url='+"http://www.cqna.com.cn/na_Class/node_24133.html",
-		  })	
+			url: '/pages/web/web?url=' + "http://www.cqna.com.cn/na_Class/node_24133.html",
+		})
 	},
 	gotoNAB() {
 		wx.navigateTo({
-			url: '/pages/web/web?url='+"http://www.cqna.com.cn/na_Class/node_24150.html",
-		  })	
+			url: '/pages/web/web?url=' + "http://www.cqna.com.cn/na_Class/node_24150.html",
+		})
 	}
 
 })

+ 4 - 4
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/index/index.wxml

@@ -11,16 +11,16 @@
 		<!-- 内容top -->
 		<view class="content-search-tab" style="height: 648rpx;">
 			<!-- 搜索 -->
-			<view style="width:650rpx;height:60rpx">
+			<!-- <view style="width:650rpx;height:60rpx">
 				<view class="search-view">
 					<view class="search-icon">
 						<image src="{{imgUrl}}index-search.png" style="height:28rpx;width:28rpx"></image>
 					</view>
 					<input class="search-input" bindinput="bindKeyInput" placeholder="在此输入关键字" />
 				</view>
-			</view>
+			</view> -->
 			<!-- 服务内容1 -->
-			<view class="content-service" style="margin-top: 15rpx">
+			<view class="content-service">
 				<view bindtap="clickService1" data-item="{{index}}" wx:for="{{ serviceItems1 }}" wx:for-item="item" wx:for-index="index" wx:key="index" class="content-service-item">
 					<view data-item="{{index}}">
 						<image src="{{ item.img }}" style="height:88rpx;width:88rpx"></image>
@@ -30,7 +30,7 @@
 			</view>
 			<!-- 服务内容2 -->
 			<view class="content-service">
-				<view wx:for="{{ serviceItems2 }}" wx:for-item="item" wx:for-index="index" wx:key="index" class="content-service-item">
+				<view bindtap="clickService2" data-item="{{index}}" wx:for="{{ serviceItems2 }}" wx:for-item="item" wx:for-index="index" wx:key="index" class="content-service-item">
 					<view>
 						<image src="{{ item.img }}" style="height:88rpx;width:88rpx"></image>
 					</view>