瀏覽代碼

印象南岸

elis 1 年之前
父節點
當前提交
3bda347c3b

+ 6 - 0
nnzwminiapp/components/customBannerSwiper/customBannerSwiper.js

@@ -93,6 +93,12 @@ Component({
       this.setData({
         currentIndex: e.detail.current
       });
+    },
+    gotoPic(e){
+      console.log(e.currentTarget.dataset.url);
+      wx.navigateTo({
+        url:'/pages/web/web?url='+e.currentTarget.dataset.url
+      })
     }
   }
 })

+ 1 - 1
nnzwminiapp/components/customBannerSwiper/customBannerSwiper.wxml

@@ -1,7 +1,7 @@
 <swiper autoplay="{{autoplay}}" interval="{{interval}}" indicator-dots="{{indicatorDots}}" indicator-color='{{indicatorColor}}' indicator-active-color='{{indicatorActiveColor}}' circular="{{circular}}" previous-margin="{{previousMargin}}" next-margin="{{nextMargin}}" current="{{0}}" bindchange="swiperChange" class="swiper-block">
   <block wx:for="{{myData}}" wx:index="{{index}}" wx:key="index">
     <swiper-item class="swiper-item" style="padding-right: {{padding}};">
-      <view src="{{item.url}}" class="slide-image {{shadow?'shadow':''}} {{currentIndex == index ? 'active' : 'common'}}" style="background-image: url({{item.url}});background-size:cover;background-position: 100% 100%;border-radius: {{radius}}; {{currentIndex == index ? 'transform: scale(1);height:' + heightActive + ';' : 'transform: scale(' + scale + ');height:' + heightCommon + ';'}}">
+      <view src="{{item.url}}" bindtap = "gotoPic" data-url = "{{item.docpuburl}}" class="slide-image {{shadow?'shadow':''}} {{currentIndex == index ? 'active' : 'common'}}" style="background-image: url({{item.url}});background-size:cover;background-position: 100% 100%;border-radius: {{radius}}; {{currentIndex == index ? 'transform: scale(1);height:' + heightActive + ';' : 'transform: scale(' + scale + ');height:' + heightCommon + ';'}}">
 			  <view wx:if="{{showTitle}}" class="title" style="{{titleStyle}}">{{item.title}}</view>
       </view>
       <slot></slot>

+ 121 - 115
nnzwminiapp/pages/nais/nais.js

@@ -26,79 +26,79 @@ Page({
 		}],
 		// 书香南岸
 		scholarly1: [{
-				url: 'nais-8-2022-content-icon-1.png',
-				name: '校园地图'
-			},
-			{
-				url: 'nais-9-2022-content-icon-2.png',
-				name: '文明校园'
-			},
-			{
-				url: 'nais-10-2022-content-icon-3.png',
-				name: '集团化办学'
-			},
-			{
-				url: 'nais-11-2022-content-icon-4.png',
-				name: '在区高校'
-			}
+			url: 'nais-8-2022-content-icon-1.png',
+			name: '校园地图'
+		},
+		{
+			url: 'nais-9-2022-content-icon-2.png',
+			name: '文明校园'
+		},
+		{
+			url: 'nais-10-2022-content-icon-3.png',
+			name: '集团化办学'
+		},
+		{
+			url: 'nais-11-2022-content-icon-4.png',
+			name: '在区高校'
+		}
 		],
 		scholarly2: [{
-				count: '44',
-				name: '小学'
-			},
-			{
-				count: '8',
-				name: '九年一贯制学校'
-			},
-			{
-				count: '11',
-				name: '初级中学'
-			},
-			{
-				count: '8',
-				name: '完全中学'
-			},
-			{
-				count: '1',
-				name: '特殊教育'
-			}
+			count: '44',
+			name: '小学'
+		},
+		{
+			count: '8',
+			name: '九年一贯制学校'
+		},
+		{
+			count: '11',
+			name: '初级中学'
+		},
+		{
+			count: '8',
+			name: '完全中学'
+		},
+		{
+			count: '1',
+			name: '特殊教育'
+		}
 		],
 		scholarly3: [{
-				url: 'nais-38-school.png',
-				count: '2',
-				name: '所全国文明校园',
-				color: '#E40000'
-			},
-			{
-				url: 'nais-38-school.png',
-				count: '9',
-				name: '所重庆市文明校园',
-				color: '#E40000'
-			},
-			{
-				url: 'nais-12-school.png',
-				count: '13',
-				name: '所艺术特色学校',
-				color: '#D62F00'
-			},
-			{
-				url: 'nais-12-school.png',
-				count: '3',
-				name: '所艺术传承学校',
-				color: '#D62F00'
-			},
-			{
-				url: 'nais-13-school.png',
-				count: '5',
-				name: '所在区高校',
-				color: '#7D1000'
-			},
-			{
-				url: 'nais-14-school.png',
-				count: '83',
-				name: '所体卫艺科学校',
-				color: '#FF9800'
-			}
+			url: 'nais-38-school.png',
+			count: '2',
+			name: '所全国文明校园',
+			color: '#E40000'
+		},
+		{
+			url: 'nais-38-school.png',
+			count: '9',
+			name: '所重庆市文明校园',
+			color: '#E40000'
+		},
+		{
+			url: 'nais-12-school.png',
+			count: '13',
+			name: '所艺术特色学校',
+			color: '#D62F00'
+		},
+		{
+			url: 'nais-12-school.png',
+			count: '3',
+			name: '所艺术传承学校',
+			color: '#D62F00'
+		},
+		{
+			url: 'nais-13-school.png',
+			count: '5',
+			name: '所在区高校',
+			color: '#7D1000'
+		},
+		{
+			url: 'nais-14-school.png',
+			count: '83',
+			name: '所体卫艺科学校',
+			color: '#FF9800'
+		}
 		],
 		scholarly4: ['nais-15-school-content-1.png', 'nais-16-school-content-2.png', 'nais-17-school-content-3.png', 'nais-18-school-content-4.png'],
 		// 产业发展
@@ -120,17 +120,18 @@ Page({
 		autoplay: false,
 		duration: 500,
 		interval: 3000,
-		swiperList: [{
-			url: `${imgUrl}nais-36-2022-yxna-icon-2.png`
-		}, {
-			url: `${imgUrl}nais-35-2022-yxna-icon-1.png`
-		}, {
-			url: `${imgUrl}nais-37-2022-yxna-icon-3.png`
-    }],
-    scroll_height:""
+		// swiperList: [{
+		// 	url: `${imgUrl}nais-36-2022-yxna-icon-2.png`
+		// }, {
+		// 	url: `${imgUrl}nais-35-2022-yxna-icon-1.png`
+		// }, {
+		// 	url: `${imgUrl}nais-37-2022-yxna-icon-3.png`
+		// }],
+		swiperList:[],
+		scroll_height: ""
 	},
 
-	onChange(e) {},
+	onChange(e) { },
 
 
 	/**
@@ -164,25 +165,26 @@ Page({
 		}
 	},
 	onLoad() {
-    var windowWidth = wx.getSystemInfoSync().windowWidth;
-    var windowHeight = wx.getSystemInfoSync().windowHeight;
-    //rpx与px单位之间的换算 : 750/windowWidth = 屏幕的高度(rpx)/windowHeight
-    var scroll_height = 750*windowHeight/windowWidth;
-    wx.getSystemInfo({
-      success: res => {
-        let system =  res.system.split(" ")
-        // console.log(system);
-        if (res.safeArea.top > 20 && system[0]=='iOS') { //iphonex,xr,xs
-          scroll_height =  scroll_height-70
-         }
-      },
-      fail(err) {
-        console.error(err);
-      }
-    })
-     this.setData({
-        scroll_height:scroll_height
-    })
+		var windowWidth = wx.getSystemInfoSync().windowWidth;
+		var windowHeight = wx.getSystemInfoSync().windowHeight;
+		//rpx与px单位之间的换算 : 750/windowWidth = 屏幕的高度(rpx)/windowHeight
+		var scroll_height = 750 * windowHeight / windowWidth;
+		wx.getSystemInfo({
+			success: res => {
+				let system = res.system.split(" ")
+				// console.log(system);
+				if (res.safeArea.top > 20 && system[0] == 'iOS') { //iphonex,xr,xs
+					scroll_height = scroll_height - 70
+				}
+			},
+			fail(err) {
+				console.error(err);
+			}
+		})
+		this.setData({
+			scroll_height: scroll_height
+		})
+		this.loadyxna()
 	},
 
 	/**
@@ -337,23 +339,27 @@ Page({
 		wx.navigateTo({
 			url: '/pages/web/web?url=' + "https://www.cqna.gov.cn/zjna/gyw/#tryb",
 		})
-	}
-
+	},
 
-	// wx.request({
-	// 	url: 'https://data.cqna.gov.cn/mini/hlw/send?page=1&limit=2&channelId=158049',
-	// 	method: 'GET',
-	// 	success: res => {
-	// 		for (let i = 0; i < res.data.data.DATA.length; i++) {
-	// 			// 截取logo图片
-	// 			let url = res.data.data.DATA[i].DOCPUBURL.substring(0, res.data.data.DATA[i].DOCPUBURL.lastIndexOf("/") + 1)
-	// 			let logo = res.data.data.DATA[i].LOGOURL.substring(res.data.data.DATA[i].LOGOURL.lastIndexOf("FileName=") + "fileName=".length)
-	// 			res.data.data.DATA[i].logoImg = url + logo
-	// 		}
-	// 		this.setData({
-	// 			pictureInterpretationList: res.data.data.DATA,
-	// 			isZCJDLoading: false
-	// 		})
-	// 	}
-	// })
+	loadyxna(){
+		wx.request({
+			url: 'https://data.cqna.gov.cn/mini/hlw/send?page=1&limit=3&channelId=370523',
+			method: 'GET',
+			success: res => {
+				
+				let iamges = []
+				for (let i = 0; i < res.data.data.DATA.length; i++) {
+					// 截取logo图片
+					let url = res.data.data.DATA[i].DOCPUBURL.substring(0, res.data.data.DATA[i].DOCPUBURL.lastIndexOf("/") + 1)
+					let logo = res.data.data.DATA[i].LOGOURL.substring(res.data.data.DATA[i].LOGOURL.lastIndexOf("FileName=") + "fileName=".length)
+					
+					iamges.push({url:url + logo,title:res.data.data.DATA[i].DOCTITLE,docpuburl:res.data.data.DATA[i].DOCPUBURL})
+				}
+				console.log(iamges);
+				this.setData({
+					swiperList:iamges
+				})
+			}
+		})
+	}
 })