Browse Source

Merge branch 'master' of http://116.63.33.55/git/nazw

sunjuan 2 years ago
parent
commit
c2864b4e80

+ 43 - 12
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/album/album.js

@@ -1,6 +1,8 @@
 // pages/album/album.js
 import {
-	imgUrl
+	imgUrl,
+	request,
+	baseUrl
 } from "../api/request"
 
 Page({
@@ -11,8 +13,9 @@ Page({
 	data: {
 		// 图片前缀
 		imgUrl: imgUrl,
+		baseUrl: baseUrl + '/',
 		// 专辑列表
-		albumList: ['张三专辑', '李四专辑', '李二专辑', 'XXX专辑', 'AAA专辑'],
+		albumList: [],
 		// 专辑标题
 		albumTitle: [],
 		// 默认选中
@@ -23,27 +26,33 @@ Page({
 			name: '张三',
 			introduction: '专辑有论文专辑、音乐专辑等。论文专辑是指期刊的某一期专门对某一个大家关注的领域、问题、事件进行集中报道、讨论。',
 			albumList: [{
+					id: '1',
 					url: 'album-list.png',
 					date: '2019 10/24',
 					detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
 				},
 				{
+					id: '2',
 					url: 'album-list.png',
 					date: '2019 10/24',
 					detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
 				}, {
+					id: '3',
 					url: 'album-list.png',
 					date: '2019 10/24',
 					detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
 				}, {
+					id: '4',
 					url: 'album-list.png',
 					date: '2019 10/24',
 					detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
 				}, {
+					id: '5',
 					url: 'album-list.png',
 					date: '2019 10/24',
 					detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸'
 				}, {
+					id: '6',
 					url: 'album-list.png',
 					date: '2019 10/24',
 					detail: '想要宜居生活,去南岸;想 要休憩放松,五南岸;想要 亲友伙伴欢聚,同样可以南岸南岸南岸'
@@ -51,9 +60,36 @@ Page({
 			]
 		}
 	},
+	// 获取专辑列表
+	getAlbumList() {
+		request({
+			url: '/yxna/getAlbumList',
+			method: 'GET'
+		}).then(res => {
+			this.setData({
+				albumList: res.data
+			})
+			this.getAlbumTitle();
+			this.getAlbumDetail();
+		})
+	},
+	// 获取专辑列表详细
+	getAlbumDetail() {
+		request({
+			url: '/yxna/getAlbumById/' + this.data.albumList[this.data.currentTab].id,
+			data: {
+				page: '1',
+				limit: '10'
+			},
+			method: 'GET'
+		}).then(res => {
+			console.log(res);
+		})
+	},
+	// 获取专辑标题
 	getAlbumTitle() {
 		let temp = [];
-		let album = this.data.albumList[this.data.currentTab];
+		let album = this.data.albumList[this.data.currentTab].name;
 		for (let index = 0; index < album.length; index++) {
 			temp.push(album.substr(index, 1));
 		}
@@ -67,7 +103,6 @@ Page({
 		this.setData({
 			currentTab
 		})
-		this.getAlbumTitle();
 	},
 	// 切换专辑
 	handleSwiper(e) {
@@ -88,16 +123,12 @@ Page({
 	 * 生命周期函数--监听页面加载
 	 */
 	onLoad(options) {
-		this.getAlbumTitle();
-	},
-	toYXNADetailInfo(){
-		wx.navigateTo({
-			url: '/pages/albumDetail/albumDetail',
-		})
+		this.getAlbumList();
 	},
-	toYXNAEdit(){
+	// 前往专辑内容详细界面
+	toYXNADetailInfo(data) {
 		wx.navigateTo({
-			url: '/pages/albumEdit/albumEdit',
+			url: '/pages/albumDetail/albumDetail?id=' + data.currentTarget.dataset.id,
 		})
 	},
 

+ 6 - 6
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/album/album.wxml

@@ -2,7 +2,7 @@
 <view style="background: #F0F0F0;">
 	<scroll-view class="scroll-wrapper" scroll-x scroll-with-animation="true" scroll-into-view="item{{currentTab < 4 ? 0 : currentTab - 3}}">
 		<view class="navigate-item" id="item{{index}}" wx:for="{{albumList}}" wx:key="index" data-index="{{index}}" bindtap="tabNav">
-			<view class="names {{currentTab === index ? 'active' : ''}}">{{item}}</view>
+			<view class="names {{currentTab === index ? 'active' : ''}}">{{item.name}}</view>
 			<view class="currtline {{currentTab === index ? 'active' : ''}}" wx:if="{{currentTab === index}}"></view>
 		</view>
 	</scroll-view>
@@ -15,15 +15,15 @@
 						<view wx:for="{{albumTitle}}" wx:key="index" style="width: 44rpx;height: 44rpx;background: #DD3706;border-radius: 50%;color: #FFFFFF;text-align: center;line-height: 44rpx;font-size: 30rpx;margin-right: 10rpx;">{{item}}</view>
 					</view>
 				</view>
-				<view bindtap="toYXNADetailInfo" style="width: 704rpx;height: 314rpx;background: #FFFFFF;box-shadow: 0 7rpx 10rpx 0 rgba(27,58,123,0.13);border-radius: 10rpx;margin: -50rpx 22rpx 30rpx 22rpx;position: relative;display: flex;justify-content: space-between;">
-					<image src="{{imgUrl}}{{albumInfo.url}}" style="width: 275rpx;height: 328rpx;border-radius: 10rpx;margin: -50rpx 23rpx 0 22rpx;" />
+				<view style="width: 704rpx;height: 314rpx;background: #FFFFFF;box-shadow: 0 7rpx 10rpx 0 rgba(27,58,123,0.13);border-radius: 10rpx;margin: -50rpx 22rpx 30rpx 22rpx;position: relative;display: flex;justify-content: space-between;">
+					<image src="{{baseUrl}}{{albumList[currentTab].picture}}" style="width: 275rpx;height: 328rpx;border-radius: 10rpx;margin: -50rpx 23rpx 0 22rpx;" />
 					<view style="width: 366rpx;margin: 0 18rpx 37rpx 0;">
-						<view style="font-size: 40rpx;font-weight: bold;color: #333333;margin: 34rpx 0 36rpx 10rpx;">{{albumInfo.name}}</view>
+						<view style="font-size: 40rpx;font-weight: bold;color: #333333;margin: 34rpx 0 36rpx 10rpx;">{{albumList[currentTab].name}}</view>
 						<view style="overflow: hidden;font-size: 24rpx;font-weight: 500;line-height: 36rpx;height: 148rpx;text-overflow: ellipsis;-webkit-line-clamp:4;display: -webkit-box;-webkit-box-orient:vertical;">{{albumInfo.introduction}}</view>
 					</view>
 				</view>
-				<view bindtap="toYXNAEdit" style="display: flex;justify-content: space-between;flex-wrap: wrap;padding: 0 22rpx 20rpx 22rpx;">
-					<view style="width: 339rpx;height: 384rpx;background: #FFFFFF;box-shadow: 0 7rpx 10rpx 0 rgba(27,58,123,0.13);border-radius: 10rpx;margin: 10rpx 0" wx:for="{{albumInfo.albumList}}" wx:key="index">
+				<view style="display: flex;justify-content: space-between;flex-wrap: wrap;padding: 0 22rpx 20rpx 22rpx;">
+					<view bindtap="toYXNADetailInfo" data-id="{{item.id}}" style="width: 339rpx;height: 384rpx;background: #FFFFFF;box-shadow: 0 7rpx 10rpx 0 rgba(27,58,123,0.13);border-radius: 10rpx;margin: 10rpx 0" wx:for="{{albumInfo.albumList}}" wx:key="index">
 						<view>
 							<image src="{{imgUrl}}{{item.url}}" style="width: 339rpx;height: 191rpx;border-radius: 10rpx 10rpx 0 0;" />
 							<view style="padding: 0 21rpx 20rpx 21rpx;color: #333333;font-size: 30rpx;font-weight: 400;">{{item.date}}</view>

+ 18 - 3
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/albumDetail/albumDetail.js

@@ -1,6 +1,7 @@
 // pages/albumDetail/albumDetail.js
 import {
-	imgUrl
+	imgUrl,
+	request
 } from "../api/request"
 
 Page({
@@ -12,14 +13,28 @@ Page({
 		// 图片前缀
 		imgUrl: imgUrl,
 		// 专辑标题
-		title: '解放前'
+		titleList: ['1949年', '1949年-1980年', '1980年-2000年', '2000年-至今'],
+		// 详细
+		detail: {
+			urlAddress: 'album-bg.png',
+			vestingDate: '2019/10/24',
+			pictureTitle: '《南岸的创奇事迹》',
+			pictureAuthor: 'XXX',
+			pictureDescription: '想要宜居生活,去南岸;想要休憩放松,五南岸;想要亲友伙伴欢聚, 同样可以去南岸。南岸区就是这样一处天堂般的存在,它能带给人们的, 是一种随时随地都能亲近自然以及回归乡野的纯朴与感动。',
+			pictureType: 1
+		}
 	},
 
 	/**
 	 * 生命周期函数--监听页面加载
 	 */
 	onLoad(options) {
-
+		request({
+			url: '/yxna/getDocumentById/' + options.id,
+			method: 'GET'
+		}).then(res => {
+			console.log(res);
+		})
 	},
 
 	/**

+ 6 - 10
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/albumDetail/albumDetail.wxml

@@ -1,19 +1,15 @@
 <!--pages/albumDetail/albumDetail.wxml-->
 <view style="background: #F0F0F0;height: 100vh;">
-	<view style="font-size: 36rpx;color: #333333;padding: 40rpx 0 5rpx 20rpx;font-weight: 400;">{{title}}</view>
+	<view style="font-size: 36rpx;color: #333333;padding: 40rpx 0 5rpx 20rpx;font-weight: 400;">{{titleList[detail.pictureType]}}</view>
 	<view style="width: 705rpx;height: 782rpx;background: #FFFFFF;margin: 22rpx;">
-		<image src="{{imgUrl}}album-bg.png" style="width: 670rpx;height: 376rpx;padding: 18rpx;" />
-		<view style="padding: 0 22rpx;font-size: 30rpx;color: #333333;">2019/10/24</view>
+		<image src="{{imgUrl}}{{detail.urlAddress}}" style="width: 670rpx;height: 376rpx;padding: 18rpx;" />
+		<view style="padding: 0 22rpx;font-size: 30rpx;color: #333333;">{{detail.vestingDate}}</view>
 		<view style="display: flex; justify-content: space-between;padding: 0 22rpx;font-size: 30rpx;color: #333333;">
-			<view>作者:XXX</view>
-			<view>《南岸的创奇事迹》</view>
+			<view>作者:{{detail.pictureAuthor}}</view>
+			<view>{{detail.pictureTitle}}</view>
 		</view>
 		<view style="border-bottom: 1px solid #D7D7D7;margin: 26rpx 22rpx 31rpx 22rpx;" />
 		<view style="padding: 0 22rpx;font-size: 26rpx;color: #47413B;">
-			想要宜居生活,去南岸;想要休憩放松,五南岸;
-			想要亲友伙伴欢聚,同样可以去南岸。
-			南岸区就是这样一处天堂般的存在,
-			它能带给人们的,是一种随时随地都能亲近自然
-			以及回归乡野的纯朴与感动。</view>
+			{{detail.pictureDescription}}</view>
 	</view>
 </view>

+ 2 - 2
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/albumEdit/albumEdit.js

@@ -6,9 +6,9 @@ Page({
 	 */
 	data: {
 		// 默认归属日期
-		date: '2021-01-01',
+		date: '',
 		// 默认作品年代
-		index: 0,
+		index: '',
 		// 作品年代
 		array: ['解放前', '解放后-80年代', '80年代-新世纪', '新世纪-千禧年'],
 		// 图片

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

@@ -28,10 +28,10 @@
 			<view style="display: flex;border-bottom: 1px solid #DDDDDD;margin: 20rpx 18rpx;">
 				<view style="font-size: 24rpx;display: flex;line-height: 70rpx;height: 70rpx;">
 					<view style="color: #A91919;">*</view>
-					<view style="width: 132rpx;">归属期</view>
+					<view style="width: 132rpx;">归属期</view>
 				</view>
 				<picker name="date" mode="date" value="{{date}}" bindchange="bindDateChange" style="line-height: 70rpx;font-size: 24rpx;">
-					<view>{{date}}</view>
+					<input style="font-size: 24rpx;line-height: 70rpx;height: 70rpx;width: 100%;" placeholder="请选择归属日期" value="{{date}}" />
 				</picker>
 			</view>
 			<view style="display: flex;border-bottom: 1px solid #DDDDDD;margin: 20rpx 18rpx;">
@@ -40,7 +40,7 @@
 					<view style="width: 132rpx;">作品年代</view>
 				</view>
 				<picker name="age" bindchange="bindPickerChange" value="{{index}}" range="{{array}}" style="line-height: 70rpx;font-size: 24rpx;">
-					{{array[index]}}
+					<input style="font-size: 24rpx;line-height: 70rpx;height: 70rpx;width: 100%;" placeholder="请选择作品年代" value="{{array[index]}}" />
 				</picker>
 			</view>
 			<view style="display: flex;border-bottom: 1px solid #DDDDDD;margin: 20rpx 18rpx;">
@@ -55,7 +55,7 @@
 					<view style="font-size: 24rpx;color: #D2D2D2;">支持jpg. png格式,大小在5M以下</view>
 					<view>
 						<image src="{{imgURl}}{{img}}"></image>
-						<input name="img" style="display: none;" value="{{imgURl}}{{img}}" type="text"/>
+						<input name="img" style="display: none;" value="{{imgURl}}{{img}}" type="text" />
 					</view>
 				</view>
 			</view>

+ 28 - 23
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/api/request.js

@@ -1,13 +1,14 @@
-const baseUrl = "https://data.cqna.gov.cn"
-// const baseUrl = "https://www.cqna.gov.cn"
+// const baseUrl = "https://data.cqna.gov.cn"
+// const baseUrl = "https://www.cqna.gov.cn/data"
 // const baseUrl = "http://localhost:7777"
+const baseUrl = "http://192.168.1.253:7777"
 const imgUrl = "http://116.63.49.144:8081/applet/"
 // const imgUrl = "http://117.50.172.145/"
 
 let token = wx.getStorageSync('token')
 
 const request = (options) => {
-    return new Promise((resolve,reject) => {
+	return new Promise((resolve, reject) => {
 		options.url = baseUrl + options.url
 		let contentType;
 		if (options.method && options.method === 'POST') {
@@ -15,24 +16,28 @@ const request = (options) => {
 		} else {
 			contentType = 'application/json;charset=UTF-8'
 		}
-        wx.request({
-        	// 配置 "wx.request" 请求参数
-            ...options,
-            header: {
-                'content-type': contentType,
-                'mini-token':`${token}`                             
-            },
-            success: function (res) {
-                console.log("network-res=>", res);
-                // 返回成功信息
-                resolve(res.data)    
-            },
-            fail: function (error) {
-                console.log("network-err=>", error);
-                // 返回错误信息
-                reject(error)
-            }
-        })
-    })
+		wx.request({
+			// 配置 "wx.request" 请求参数
+			...options,
+			header: {
+				'content-type': contentType,
+				'mini-token': `${token}`
+			},
+			success: function (res) {
+				console.log("network-res=>", res);
+				// 返回成功信息
+				resolve(res.data)
+			},
+			fail: function (error) {
+				console.log("network-err=>", error);
+				// 返回错误信息
+				reject(error)
+			}
+		})
+	})
 }
-export {request, imgUrl}
+export {
+	request,
+	imgUrl,
+	baseUrl
+}

+ 56 - 47
nngkxxdp/src/main/resources/static/school/school.html

@@ -32,21 +32,21 @@
                 <div class="title"><span>所</span><span>在</span><span>区</span><span>域</span><span>:</span></div>
                 <ul class="list">
                     <li class="click">不限</li>
-                    <li>南坪街道</li>
-                    <li>龙门浩街道</li>
-                    <li>海棠溪街道</li>
-                    <li>弹子石街道</li>
-                    <li>铜元局街道</li>
-                    <li>花园路街道</li>
-                    <li>南山街道</li>
-                    <li>天文街道</li>
-                    <li>南坪镇</li>
-                    <li>峡口镇</li>
-                    <li>涂山镇</li>
-                    <li>鸡冠石镇</li>
-                    <li>长生桥镇</li>
-                    <li>迎龙镇</li>
-                    <li>广阳镇</li>
+<!--                    <li>南坪街道</li>-->
+<!--                    <li>龙门浩街道</li>-->
+<!--                    <li>海棠溪街道</li>-->
+<!--                    <li>弹子石街道</li>-->
+<!--                    <li>铜元局街道</li>-->
+<!--                    <li>花园路街道</li>-->
+<!--                    <li>南山街道</li>-->
+<!--                    <li>天文街道</li>-->
+<!--                    <li>南坪镇</li>-->
+<!--                    <li>峡口镇</li>-->
+<!--                    <li>涂山镇</li>-->
+<!--                    <li>鸡冠石镇</li>-->
+<!--                    <li>长生桥镇</li>-->
+<!--                    <li>迎龙镇</li>-->
+<!--                    <li>广阳镇</li>-->
                 </ul>
             </div>
             <div class="item">
@@ -72,8 +72,7 @@
                 </div>
                 <ul class="list department">
                     <li class="click">不限</li>
-                    <li>南坪街道</li>
-                    <li>龙门浩街道</li>
+                    <li>区教委</li>
                 </ul>
             </div>
 
@@ -82,21 +81,24 @@
                 </div>
                 <ul class="list group">
                     <li class="click">不限</li>
-                    <li>南坪街道</li>
-                    <li>龙门浩街道</li>
-                    <li>海棠溪街道</li>
-                    <li>弹子石街道</li>
-                    <li>铜元局街道</li>
-                    <li>花园路街道</li>
-                    <li>南山街道</li>
-                    <li>天文街道</li>
-                    <li>南坪镇</li>
-                    <li>峡口镇</li>
-                    <li>涂山镇</li>
-                    <li>鸡冠石镇</li>
-                    <li>长生桥镇</li>
-                    <li>迎龙镇</li>
-                    <li>广阳镇</li>
+                    <li>重庆二外教育集团</li>
+                    <li>十一中学教育集团</li>
+                    <li>广益中学教育集团</li>
+                    <li>江南小学教育集团</li>
+                    <li>南坪中学教育集团</li>
+                    <li>辅仁中学教育集团</li>
+                    <li>南开(融侨)中学教育集团</li>
+                    <li>珊瑚中学教育集团</li>
+                    <li>南坪实验小学教育集团</li>
+                    <li>一一0中学教育集团</li>
+                    <li>珊瑚实验小学教育集团</li>
+                    <li>职业教育集团</li>
+                    <li>天台岗小学教育集团</li>
+                    <li>人民(融侨)小学教育集团</li>
+                    <li>弹子石小学教育集团</li>
+                    <li>龙门浩隆平小学教育集团</li>
+                    <li>教师进修学院附属小学教育集团</li>
+                    <li>融合教育集团</li>
                 </ul>
             </div>
             <div style="font-size: 14px;color: #999999;margin-top:20px;">注:学校顺序按更新时间自动排序</div>
@@ -158,34 +160,24 @@
     $('.department li').click(function () {
         $(this).addClass('click').siblings().removeClass('click');
         department = $(this)[0].outerText
+        queryData()
     })
     // 监听学校类型
     $('.schoolType li').click(function () {
         $(this).addClass('click').siblings().removeClass('click');
         schoolType = $(this)[0].getAttribute('type')
+        queryData()
     })
     // 监听所属组
     $('.group li').click(function () {
         $(this).addClass('click').siblings().removeClass('click');
         group = $(this)[0].outerText
+        queryData()
     })
     // 点击搜索
     $('#searchBtn').click(function () {
-        if (schoolLocation == '不限') {
-            schoolLocation = ''
-        }
-        if (department == '不限') {
-            department = ''
-        }
-        if (group == '不限') {
-            group = ''
-        }
-        if (schoolType == -1) {
-            schoolType = ''
-        }
         schoolName = $('#schoolName')[0].value;
-        page = 1
-        getData();
+        queryData()
     })
     $(".content").keydown(function (e){
         // 当 keyCode 是13时,是回车操作
@@ -207,6 +199,22 @@
             getData();
         }
     })
+    function queryData() {
+        if (schoolLocation == '不限') {
+            schoolLocation = ''
+        }
+        if (department == '不限') {
+            department = ''
+        }
+        if (group == '不限') {
+            group = ''
+        }
+        if (schoolType == -1) {
+            schoolType = ''
+        }
+        page = 1
+        getData();
+    }
     function gotoInfo(id) {
         window.location.href = PATH + "/school/schoolDetail.html?id=" + schoolData[id].id
     }
@@ -239,8 +247,9 @@
                         let website = schoolData[i].website==null?"":schoolData[i].website
                         let tell = schoolData[i].contactTel==null?"":schoolData[i].contactTel
                         let schoolAddress = schoolData[i].address==null?"":schoolData[i].address
+                        let schoolBgImg = schoolData[i].schoolImg==null?"images/school.png":schoolData[i].schoolImg
                         schoolHtml += "<div class=\"schoolList\">" +
-                            "<div onclick='gotoInfo(" + i + ")' class=\"logo hand\" style=\"background-image: url(" + schoolData[i].schoolImg + ");\">" +
+                            "<div onclick='gotoInfo(" + i + ")' class=\"logo hand\" style=\"background-image: url(" + schoolBgImg + ");\">" +
                             "<div class=\"name\" style=\"background-image: url(" + getSchoolTypeImg(schoolData[i].schoolType) + ");\">" + getSchoolType(schoolData[i].schoolType) + "</div>" +
                             "</div>" +
                             "<div style='position: relative' class=\"message\">" +