Pārlūkot izejas kodu

refactor:公告详情

zhanghui 2 gadi atpakaļ
vecāks
revīzija
c0b9e3b76e

+ 1 - 2
common/js/api.js

@@ -542,8 +542,7 @@ export default {
 	getNoticeDetail(data) {
 		return request({
 			url: '/system/openapi/notice/' + data.noticeId,
-			method: 'GET',
-			data: data
+			method: 'GET'
 		})
 	},
 

+ 1 - 1
components/scroll-notice/ScrollNotice.vue

@@ -5,7 +5,7 @@
 		</view>
 		<view class="notice-swiper-wrap">
 			<swiper class="notice-swiper" :style="'height:'+height+'px;line-height:'+height+'px;'" autoplay="true"
-				:interval="interval" duration="500" circular="true" :vertical="type==1?true:false">
+				:interval="interval" duration="500"  circular="true" :vertical="type==1?true:false">
 				<swiper-item v-for="(list,index) in dataList" :key="index" @click.stop="clickList(list)">
 					<view class="notice-swiper-item" :style="'font-size:'+fontSize+'px;color:'+color">
 						{{list.noticeTitle}}

+ 1 - 6
myPages/aboutOur/index.vue

@@ -26,12 +26,7 @@ export default {
 
 	},
 	methods: {
-		// 获取服务条款信息
-		gotoTermOfService(name){
-			uni.navigateTo({
-				url: '/myPages/TermsOfService/index?name='+name,
-			})
-		},
+
 	}
 };
 </script>

+ 0 - 415
otherPages/serviceItems/index.wxss

@@ -1,415 +0,0 @@
-@charset "UTF-8";
-/**
- * 这里是uni-app内置的常用样式变量
- *
- * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
- * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
- *
- */
-/**
- * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
- *
- * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
- */
-/* 颜色变量 */
-/* 行为相关颜色 */
-/* 文字基本颜色 */
-/* 背景颜色 */
-/* 边框颜色 */
-/* 尺寸变量 */
-/* 文字尺寸 */
-/* 图片尺寸 */
-/* Border Radius */
-/* 水平间距 */
-/* 垂直间距 */
-/* 透明度 */
-/* 文章场景相关 */
-.flex-col.data-v-d0be296e {
-	display: flex;
-	flex-direction: column;
-}
-.flex-row.data-v-d0be296e {
-	display: flex;
-	flex-direction: row;
-}
-.flex-row-reverse.data-v-d0be296e {
-	display: flex;
-	flex-direction: row-reverse;
-}
-.bord.data-v-d0be296e{
-	border: 1px solid red;
-}
-.justify-start.data-v-d0be296e {
-	display: flex;
-	justify-content: flex-start;
-}
-.justify-center.data-v-d0be296e {
-	display: flex;
-	justify-content: center;
-}
-.justify-end.data-v-d0be296e {
-	display: flex;
-	justify-content: flex-end;
-}
-.justify-evenly.data-v-d0be296e {
-	display: flex;
-	justify-content: space-evenly;
-}
-.justify-around.data-v-d0be296e {
-	display: flex;
-	justify-content: space-around;
-}
-.justify-between.data-v-d0be296e {
-	display: flex;
-	justify-content: space-between;
-}
-.align-start.data-v-d0be296e {
-	display: flex;
-	align-items: flex-start;
-}
-.align-center.data-v-d0be296e {
-	display: flex;
-	align-items: center;
-}
-.align-end.data-v-d0be296e {
-	display: flex;
-	align-items: flex-end;
-}
-.sticky.data-v-d0be296e {
-
-	display: flex;
-	position: -webkit-sticky;
-
-	position: sticky;
-	top: 0rpx;
-	z-index: 99;
-}
-.bord.data-v-d0be296e{
-	border:  1px  solid  red;
-}
-.page.data-v-d0be296e {
-  background-color: white;
-  position: relative;
-  width: 750rpx;
-  overflow: hidden;
-  padding-left: 0rpx;
-  padding-right: 0rpx;
-  padding-top: 0rpx;
-  padding-bottom: 32rpx;
-  display: flex;
-  flex-direction: column;
-}
-.box_2.data-v-d0be296e {
-  width: 698rpx;
-  margin-top: 32rpx;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-}
-.image-text_1.data-v-d0be296e {
-  width: 256rpx;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-  margin: 6rpx 0 6rpx 0;
-}
-.thumbnail_1.data-v-d0be296e {
-  width: 40rpx;
-  height: 40rpx;
-  margin: 4rpx 0 4rpx 0;
-}
-.text-group_1.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 32rpx;
-  font-family: PingFangSC-Medium;
-  font-weight: 500;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 48rpx;
-}
-.image_2.data-v-d0be296e {
-  width: 180rpx;
-  height: 60rpx;
-}
-.block_2.data-v-d0be296e {
-  background-color: white;
-  padding: 24rpx 32rpx;
-}
-.text_3.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 28rpx;
-  font-family: PingFangSC-Medium;
-  font-weight: 500;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 44rpx;
-  margin-left: 32rpx;
-}
-.box_3.data-v-d0be296e {
-  flex-direction: row;
-  display: flex;
-  margin-top: 24rpx;
-}
-.group_2.data-v-d0be296e {
-  margin-left: 32rpx;
-  display: flex;
-  flex-direction: column;
-}
-.image-text_2.data-v-d0be296e {
-  width: 156rpx;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-}
-.thumbnail_2.data-v-d0be296e {
-  width: 28rpx;
-  height: 28rpx;
-  margin: 4rpx 0 4rpx 0;
-}
-.text-group_2.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #666666;
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-}
-.group_3.data-v-d0be296e {
-  width: 156rpx;
-  margin-top: 16rpx;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-}
-.thumbnail_3.data-v-d0be296e {
-  width: 28rpx;
-  height: 28rpx;
-  margin: 4rpx 0 4rpx 0;
-}
-.text_4.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #666666;
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-}
-.text-wrapper_2.data-v-d0be296e {
-  display: flex;
-  flex-direction: column;
-}
-.text_5.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-  margin-right: 180rpx;
-}
-.text_6.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-  margin-top: 16rpx;
-}
-.text-wrapper_3.data-v-d0be296e {
-  margin-top: 24rpx;
-  margin-left: 32rpx;
-}
-.text_7.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #666666;
-  font-size: 20rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-  margin-top: 4rpx;
-}
-.text_8.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #ed569f;
-  font-size: 28rpx;
-  font-family: PingFangSC-Medium;
-  font-weight: 500;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 44rpx;
-}
-.box_4.data-v-d0be296e {
-  background-color: #eeeeee;
-  width: 686rpx;
-  height: 2rpx;
-  margin-top: 32rpx;
-  display: flex;
-  flex-direction: column;
-}
-.text_11.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-  margin-right: 180rpx;
-}
-.text_12.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 24rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-  margin-top: 16rpx;
-}
-.text-wrapper_5.data-v-d0be296e {
-  width: 212rpx;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-  margin: 24rpx 410rpx 0 64rpx;
-}
-.text_13.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #666666;
-  font-size: 20rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 36rpx;
-  margin-top: 4rpx;
-}
-.text_14.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #ed569f;
-  font-size: 28rpx;
-  font-family: PingFangSC-Medium;
-  font-weight: 500;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 44rpx;
-}
-.box_6.data-v-d0be296e {
-  background-color: #eeeeee;
-  width: 686rpx;
-  height: 2rpx;
-  margin-top: 32rpx;
-  display: flex;
-  flex-direction: column;
-}
-.block_3.data-v-d0be296e {
-  background-color: #f7f7f7;
-  border-radius: 50rpx;
-  width: 686rpx;
-  align-self: center;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-  height: 84rpx;
-}
-.text_15.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 28rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: left;
-  white-space: nowrap;
-  line-height: 84rpx;
-}
-.image-text_4.data-v-d0be296e {
-  width: 132rpx;
-  flex-direction: row;
-  display: flex;
-  justify-content: space-between;
-}
-.text-group_4.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #999999;
-  font-size: 28rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: right;
-  white-space: nowrap;
-  line-height: 84rpx;
-}
-.text-group_5.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: red;
-  font-size: 28rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  white-space: nowrap;
-  line-height: 84rpx;
-}
-.thumbnail_6.data-v-d0be296e {
-  width: 32rpx;
-  height: 32rpx;
-  margin: 6rpx 0 6rpx 0;
-}
-.text-wrapper_6.data-v-d0be296e {
-  background-color: #ffe05c;
-  border-radius: 54rpx;
-  align-self: center;
-  margin-top: 24rpx;
-  display: flex;
-  flex-direction: column;
-  width: 686rpx;
-  padding: 20rpx 314rpx 20rpx 316rpx;
-}
-.text_16.data-v-d0be296e {
-  overflow-wrap: break-word;
-  color: #333333;
-  font-size: 28rpx;
-  font-family: PingFangSC-Regular;
-  font-weight: normal;
-  text-align: center;
-  white-space: nowrap;
-  line-height: 44rpx;
-}
-.tabBarLineHeight.data-v-d0be296e {
-  height: 250rpx;
-}
-.submitButton.data-v-d0be296e {
-  text-align: center;
-  line-height: 84rpx;
-  width: 686rpx;
-  height: 84rpx;
-  background: #FFE05C;
-  border-radius: 54rpx;
-  margin-top: 24rpx;
-}
-.text_9.data-v-d0be296e {
-  margin-left: 24rpx;
-}
-.bottomView.data-v-d0be296e {
-  position: fixed;
-  bottom: 0;
-  width: 750rpx;
-  height: 224rpx;
-  background: #FFFFFF;
-}
-.outView.data-v-d0be296e {
-  width: 600rpx;
-}
-

+ 7 - 0
pages.json

@@ -353,6 +353,13 @@
 						"navigationBarTitleText": "选择门店",
 						"enablePullDownRefresh": false
 					}
+				},
+				{
+					"path": "notice/index",
+					"style": {
+						"navigationBarTitleText": "公告详情",
+						"enablePullDownRefresh": false
+					}
 				}
 			]
 		}

+ 2 - 5
pages/index/index.vue

@@ -305,11 +305,8 @@ export default {
     //点击通知
     handleNoticeClick(e) {
       console.log(e)
-      uni.$u.route({
-        url: '/pages/notice/notice-detail',
-        params: {
-          noticeId: e.noticeId
-        }
+      uni.navigateTo({
+        url: '/storePages/notice/index?noticeId=' + e.noticeId,
       })
     },
     // 去优惠劵大厅

+ 15 - 0
storePages/notice/index.rpx.css

@@ -0,0 +1,15 @@
+.page{
+    padding: 20rpx 30rpx;
+}
+.scroll-y{
+    height: 95%;
+    overflow: hidden;
+
+}
+.content-box {
+    text-indent:2rem;
+    padding: 20rpx 20rpx;
+}
+.time{
+    font-size: 28rpx;
+}

+ 63 - 0
storePages/notice/index.vue

@@ -0,0 +1,63 @@
+<template>
+	<view class="page">
+
+		<view class="flex-row justify-between">
+			<view class="time">
+				发布时间:<text>{{this.dateFormat(notice.createTime) }}</text>
+			</view>
+			<view class="time">
+				发布人:<text>{{notice.createBy}}</text>
+			</view>
+		</view>
+		<scroll-view scroll-y="true" class="scroll-y " :style="{'height':height}">
+			<view class="content-box flex-col "  :style="{'height':height}">
+				<!--				<web-view  src="http://www.gzqcdj.cn/doc/2.html"></web-view>-->
+				<rich-text v-html="notice.noticeContent">
+				</rich-text>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			notice: {},
+			height:''
+		};
+	},
+	onLoad(option) {
+		// 判断Openid是否为空
+		let sysInfo=uni.getSystemInfoSync();
+		this.height= sysInfo.windowHeight -50  +'px';
+		console.log("获取到的高度",this.height)
+		this.getNoticeDetail(option.noticeId);
+
+	},
+	methods: {
+		getNoticeDetail(id){
+			let that = this;
+			// 用户绑定门店
+			this.$api.getNoticeDetail({noticeId:id}).then((res)=>{
+				console.log('++++++++++++++++getNoticeDetail++++++++++++++++++',res)
+				const regex = /<img\b[^>]*>/g;
+				// const result = res.data.data.noticeContent.replace(regex, (match) => {
+				//   const newMatch = match.replace(/http:/, 'https:');
+				//   return newMatch.replace(/<img/, '<img class="content-img"');
+				// });
+				this.notice = res.data.data;
+			})
+		},
+		// 日期格式化
+		dateFormat(date){
+		  let time = Date.parse(date);
+		  return uni.$u.date(time, 'yyyy-mm-dd');
+		},
+	}
+};
+</script>
+
+<style lang="scss">
+	@import '/common/css/common.css';
+	@import './index.rpx.css';
+</style>