gjy 2 năm trước cách đây
mục cha
commit
847271cd01
5 tập tin đã thay đổi với 36 bổ sung10 xóa
  1. 1 1
      components/top.vue
  2. 2 2
      config/index.js
  3. 27 7
      pages/index/index.vue
  4. 5 0
      pages/index/zx.vue
  5. 1 0
      util/request.js

+ 1 - 1
components/top.vue

@@ -63,7 +63,7 @@
 			logOut() {
 				uni.clearStorageSync();
 				var that = this
-
+				this.isSHowUser=false
 				this.$store.commit('logout')
 				uni.navigateTo({
 					url: `/pages/index/index`

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	baseUrlNew: 'https://api.changyuntong56.com',
-	// baseUrlNew: 'http://192.168.110.9:8099',
+	// baseUrlNew: 'https://api.changyuntong56.com',
+	baseUrlNew: 'http://192.168.110.9:8099',
 	// baseUrlNew: 'http://localhost:8099',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false

+ 27 - 7
pages/index/index.vue

@@ -80,7 +80,7 @@
 					<view class="zx-content">
 						<view class="left">
 							<view class="row1">
-								<image :src="zxList[0].cover?zxList[0].cover:''" mode="widthFix" class="img"></image>
+								<image v-if='zxList[0].cover' :src="zxList[0].cover?zxList[0].cover:''" mode="widthFix" class="img"></image>
 								<view class="date">
 									<view class="day">
 										{{zxList[0].date2}}
@@ -304,6 +304,7 @@
 							this.gsList = res.data.publicConsultations2
 
 							for (let i = 0; i < this.zxList.length; i++) {
+								console.log(this.zxList[i])
 								this.zxList[i].date1 = this.zxList[i].issuingDate.substring(0, this.zxList[i]
 									.issuingDate
 									.lastIndexOf('-'))
@@ -312,7 +313,7 @@
 								this.zxList[i].content = this.getPlainText(this.zxList[i].releaseContent)
 							}
 							console.log('this.zxListt', this.zxList)
-							this.zxRightList = this.zxList.splice(1)
+							this.zxRightList = this.zxList.splice(1,3)
 							console.log('this.zxRightList', this.zxRightList)
 							uni.hideLoading()
 
@@ -348,6 +349,7 @@
 							uni.hideLoading()
 
 						} else {
+							console.log(res)
 							uni.hideLoading()
 							uni.showToast({
 								title: res.message,
@@ -357,6 +359,7 @@
 						}
 					})
 					.catch(res => {
+						console.log(res)
 						uni.showToast({
 							title: res.message,
 							icon: 'none',
@@ -448,9 +451,17 @@
 				this.isShowText = true
 			},
 			toZXPage() {
-				uni.navigateTo({
-					url: "/pages/index/zx"
-				})
+				if(uni.getStorageSync('userInfo')){
+					uni.navigateTo({
+						url: "/pages/index/zx"
+					})
+				}else{
+					uni.showToast({
+						title: '请登录账号后再查看更多资讯!',
+						icon: 'none'
+					})
+				}
+				
 			},
 			toPage(type) {
 				uni.navigateTo({
@@ -758,6 +769,11 @@
 					margin-top: 60rpx;
 					font-size: 32rpx;
 					color: #7A8189;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					display: -webkit-box;
+					-webkit-box-orient: vertical;
+					-webkit-line-clamp: 3;
 				}
 
 				.row4 {
@@ -836,16 +852,20 @@
 
 							font-size: 32rpx;
 							color: #969CA1;
-
 							line-height: 64rpx;
 							margin-top: 20rpx;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 3;
 						}
 
 						.row3 {
 							display: flex;
 							justify-content: space-between;
 							margin-top: 64rpx;
-
+							
 							.text-left {
 								font-size: 36rpx;
 								color: #90969B;

+ 5 - 0
pages/index/zx.vue

@@ -198,6 +198,11 @@
 						font-size: 36rpx;
 						color: #969CA1;
 						line-height: 64rpx;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						display: -webkit-box;
+						-webkit-box-orient: vertical;
+						-webkit-line-clamp: 3;
 					}
 
 					.row3 {

+ 1 - 0
util/request.js

@@ -25,6 +25,7 @@ const baseRequest = (method, url, data, header) => {
 					// 后端返回的状态码100为成功状态,成功则返回请求结果,在app调试时可以通过console.log(JSON.stringify(res[1].data))来查看返回值(以项目实际情况为准)
 					resolve(res[1].data)
 				} else {
+					resolve(res[1].data)
 					// uni.showToast({
 					// 	icon:'none',
 					//     title: res[1].data.message,