Преглед на файлове

系统公告接口联调

zhengjinyi преди 3 години
родител
ревизия
99a5023c8e

+ 1 - 1
components/cm-module/homeIndex/notice.vue

@@ -3,7 +3,7 @@
 		<view class="tui-rolling-view">
 			<view class="tui-rolling-news">
 				<text class="tui-roll-label">公告:</text>
-				<swiper vertical autoplay circular interval="3000" class="tui-swiper">
+				<swiper vertical autoplay circular interval="3500" class="tui-swiper">
 					<swiper-item v-for="(item,index) in list" :key="index" class="tui-swiper-item">
 						<view class="tui-news-item" @tap='detail(item)'>
 							<text class="iconfont icon-xiaochengxu"></text>

+ 4 - 4
components/cm-module/listTemplate/richTextTemplate.vue

@@ -5,8 +5,8 @@
 </template>
 
 <script>
-	import parser from "@/components/jyf-Parser/index"
-	var self;
+	import parser from '@/components/jyf-Parser/index'
+	var self
 	export default{
 		components: {
 		   parser,
@@ -20,7 +20,7 @@
 			}
 		},
 		created(){
-			self = this;		
+			self = this		
 		},
 		methods:{
 
@@ -30,7 +30,7 @@
 
 <style lang="scss">
 	page{
-		background: $sub-bg-color;
+		background: #FFFFFF;
 		border-top: 1px solid #EBEBEB;
 	}
 	.content {

+ 13 - 13
pages/service/news-detailes.vue

@@ -7,7 +7,7 @@
 <script>
 	import richTextTemplate from '@/components/cm-module/listTemplate/richTextTemplate'
 	
-	var self;
+	var self
 	export default{
 		components: {
 		   richTextTemplate
@@ -18,20 +18,18 @@
 				type: 'introduction'
 			}
 		},
-		onLoad(){
-			this.initData()
+		onLoad(option){
+			this.GetNewsCapacity(option.id)
 		},
 		methods:{
-			initData(){
-				this.CommonService.QueryAfterSale().then(response =>{
-					let _data =response.data,
-						type = this.type;
-					if(type) {
-						let html = this.$api.adaptRichTextImg(_data[type]);
-						this.$refs.childTemplate.html = html;
-					}
+			GetNewsCapacity(id){
+				this.CommonService.GetNewsCapacity({id:id}).then(response =>{
+					let data =response.data
+					let html = this.$api.adaptRichTextImg(data.capacity)
+					this.$refs.childTemplate.html = html
+					uni.setNavigationBarTitle({title:data.title})
 				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
+					this.$util.msg(error.msg,2000)
 				})
 			}
 		}
@@ -39,5 +37,7 @@
 </script>
 
 <style lang="scss">
-
+	page{
+		background-color: #FFFFFF;
+	}
 </style>

+ 20 - 27
pages/service/news-list.vue

@@ -7,12 +7,12 @@
 			</view>
 			<view v-else class="club-list">
 				<scroll-view scroll-y="true">
-					<view class="list" v-for="(item, index) in clubList" :key="index" @tap='detail(item)'>
+					<view class="list" v-for="(list, index) in newsList" :key="index" @tap='detail(list.id)'>
 						<view class="list-left">
 							<text class="iconfont icon-xiaochengxu"></text>
-							<text class="txt">{{item.name == null ? item.username : item.name}}</text>
+							<text class="txt">{{ list.title }}</text>
 						</view>
-						<view class="list-right">2022年03月07日</view>
+						<view class="list-right">{{ list.creationtime }}</view>
 					</view>
 					<!--加载loadding-->
 					<tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
@@ -40,7 +40,6 @@
 				searchInputVal:'',
 				isEmpty:false,
 				listQuery:{
-					searchWord:'',
 					pageNum:1,
 					pageSize:20,
 				},
@@ -57,13 +56,14 @@
 				prevPage:'',//上一个页面
 				tabCurrentIndex:0,
 				listStatus:1,
-				clubList:[],
+				newsList:[],
 				isIphoneX:this.$store.state.isIphoneX,
 				show_index:0,//控制显示那个组件
 			}
 		},
 		onLoad(){				
 			this.setScrollHeight()
+			this.GetNewsList()
 		},
 		methods: {
 			setScrollHeight() {
@@ -80,17 +80,13 @@
 					})
 				}, 500)
 			},
-			searchClubList(){
-				this.listQuery.pageNum=1
-				this.GetFindAllClubList()
-			},
-			GetFindAllClubList(){	
-				this.SellerService.GetFindAllClubList(this.listQuery).then(response =>{
-					let responseData = response.data
-					if(responseData.list&&responseData.list.length > 0){
+			GetNewsList(){	
+				this.CommonService.GetNewsList(this.listQuery).then(response =>{
+					let data = response.data
+					if(data.results && data.results.length > 0){
 						this.isEmpty = false
-						this.hasNextPage = response.data.hasNextPage
-						this.clubList =responseData.list
+						this.hasNextPage = data.hasNextPage
+						this.newsList =data.results
 						this.pullFlag = false
 						setTimeout(()=>{this.pullFlag = true},500)
 						if(this.hasNextPage){
@@ -110,11 +106,11 @@
 			},	
 			getOnReachBottomData(){
 				this.listQuery.pageNum+=1
-				this.SellerService.GetFindAllClubList(this.listQuery).then(response =>{
-					let responseData = response.data
-					if(responseData.list&&responseData.list.length > 0){
-						this.hasNextPage = response.data.hasNextPage
-						this.clubList = this.clubList.concat(responseData.list) 
+				this.CommonService.GetNewsList(this.listQuery).then(response =>{
+					let data = response.data
+					if(data.results && data.results.length > 0){
+						this.hasNextPage = data.hasNextPage
+						this.newsList = this.newsList.concat(data.results) 
 						this.pullFlag = false// 防上拉暴滑
 						setTimeout(()=>{this.pullFlag = true},500)
 						if(this.hasNextPage){
@@ -130,8 +126,8 @@
 					this.$util.msg(error.msg,2000)
 				})
 			},
-			detail(item){// 跳转公告详情
-				this.$api.navigateTo(`/pages/service/news-detailes?id=${item.id}`)
+			detail(id){// 跳转公告详情
+				this.$api.navigateTo(`/pages/service/news-detailes?id=${id}`)
 			},
 		},
 		onReachBottom() {
@@ -144,15 +140,12 @@
 		onPullDownRefresh() {
 			setTimeout(() => {
 				this.listQuery.pageNum = 1
-				this.GetFindAllClubList()
+				this.GetNewsList()
 				uni.stopPullDownRefresh()
 			}, 200)
 		},
 		onShow() {
-			this.$api.getStorage().then(response =>{
-				this.serviceProviderId = response.serviceProviderId
-				this.GetFindAllClubList()
-			})
+			
 		}
 	}
 </script>

+ 3 - 7
pages/tabBar/home/index.vue

@@ -9,7 +9,7 @@
 			<!-- 金刚区菜单 -->
 			<navbars :list="navBarsList" v-if="isNavRequest"></navbars>
 			<!-- 轮播公告 -->
-			<notice :list="bannerImageList" v-if="isNavRequest"></notice>
+			<notice :list="newsList" v-if="isNavRequest"></notice>
 			<!-- 优惠券入口 -->
 			<coupon v-if="isNavRequest && couponEntry == 1"></coupon>
 			<!-- 直播 -->
@@ -79,12 +79,7 @@
 				flootData:[],				// 楼层
 				bannerImageList:[],			// 轮播
 				navBarsList:[],				// 导航分类
-				newsList:[// 公告
-					{text:'2021-12月德玛莉直播秒杀活动即将开始'},
-					{text:'2022-01月德玛莉直播秒杀活动即将开始'},
-					{text:'2022-02月德玛莉直播秒杀活动即将开始'},
-					{text:'2022-03月德玛莉直播秒杀活动即将开始'},
-				],		
+				newsList:[],				// 公告
 				templateData:{},
 				pageList:[],				// 楼层
 				supplierObj:{},				// 供应商列表
@@ -177,6 +172,7 @@
 					this.skeletonShow = false
                     this.navBarsList = data.topMenuList
                     this.couponEntry = data.couponEntry
+                    this.newsList = data.annhade
                     if(!this.hasLogin && this.couponEntry == 1){
                     	if(uni.getStorageSync('isActivitySwitch')){
                     		this.$store.commit('setActivity',false)

+ 165 - 147
services/common.service.js

@@ -2,159 +2,177 @@
  * 这是所有模块公用业务逻辑的服务
  */
 export default class CommonService {
-	constructor(AjaxService) {
-		Object.assign(this, { AjaxService })
-		this.name = 'CommonService'
-	}
-	/* 首页导航模块商品列表 */
-	GetHomeClassify(data = {}) {
-		return this.AjaxService.get({
-			url: '/home/classify',
-			data,
-			isLoading: true,
-		})
-	}
-	/* 首页初始化 */
-	GetHomeModulesDataInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/home/init',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 首页楼层数据 */
-	GetHomeDataInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/home/floor',
-			data,
-			isLoading: false,
+    constructor(AjaxService) {
+        Object.assign(this, { AjaxService })
+        this.name = 'CommonService'
+    }
+    /* 首页导航模块商品列表 */
+    GetHomeClassify(data = {}) {
+        return this.AjaxService.get({
+            url: '/home/classify',
+            data,
+            isLoading: true,
+        })
+    }
+    /* 首页初始化 */
+    GetHomeModulesDataInfo(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/init',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 首页楼层数据 */
+    GetHomeDataInfo(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/floor',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/* 首页楼层查看更多数据 */
-	GetHomeFloorContentDetails(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/page/floor/details',
-			data,
-			isLoading: false,
+        })
+    }
+    /* 首页楼层查看更多数据 */
+    GetHomeFloorContentDetails(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/page/floor/details',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/* 二级页楼层查看更多数据 */
-	GePageFloorContentDetails(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/page/floor/centre',
-			data,
-			isLoading: false,
+        })
+    }
+    /* 二级页楼层查看更多数据 */
+    GePageFloorContentDetails(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/page/floor/centre',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/* 首页顶部三个模块数据 */
-	GetHomeTopDataInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/home/sidebar',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 获取其他服务信息 */
-	QueryAfterSale(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/home/sale/tips',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 首页金刚区分类 */
-	// GetHomeInit (data = {}) {
-	// 	return this.AjaxService.get({ 
-	// 		url:'/home/init', 
-	// 		data, 
-	// 		isLoading: false ,
-	// 	})
-	// }
-	GetHomeInit(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/home/init',
-			data,
-			isLoading: false,
+        })
+    }
+    /* 首页顶部三个模块数据 */
+    GetHomeTopDataInfo(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/sidebar',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 获取其他服务信息 */
+    QueryAfterSale(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/sale/tips',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 首页金刚区分类 */
+    // GetHomeInit (data = {}) {
+    // 	return this.AjaxService.get({ 
+    // 		url:'/home/init', 
+    // 		data, 
+    // 		isLoading: false ,
+    // 	})
+    // }
+    GetHomeInit(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/init',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/* 首页金刚区二级分类 */
-	GetHomeSubMenu(data = {}) {
-		return this.AjaxService.get({
-			url: '/home/subMenu',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 首页楼层 */
-	GetHomeFloorInfo(data = {}) {
-		return this.AjaxService.get({
-			url: '/home/floor',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 直播专题页图片 */
-	GetHomeLiveAdvertising(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/home/sidebar',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 搜索热门关键词 */
-	GetHomeHotSearchTerms(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/search/query/hot/keyword',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 二级列表楼层 */
-	GetInstrumentPageData(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/classify/product',
-			data,
-			isLoading: false,
+        })
+    }
+    /* 首页金刚区二级分类 */
+    GetHomeSubMenu(data = {}) {
+        return this.AjaxService.get({
+            url: '/home/subMenu',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 首页楼层 */
+    GetHomeFloorInfo(data = {}) {
+        return this.AjaxService.get({
+            url: '/home/floor',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 直播专题页图片 */
+    GetHomeLiveAdvertising(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/sidebar',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 搜索热门关键词 */
+    GetHomeHotSearchTerms(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/search/query/hot/keyword',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 二级列表楼层 */
+    GetInstrumentPageData(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/classify/product',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/* 一级分类 */
-	GetFirstClassly(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/classify',
-			data,
-			isLoading: false,
+        })
+    }
+    /* 一级分类 */
+    GetFirstClassly(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/classify',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/* 根据一级分类获取二、三级分类 */
-	GetProductChildrenClassly(data = {}) {
-		return this.AjaxService.get({
-			url: '/product/bigType/classify',
-			data,
-			isLoading: false,
-		})
-	}
-	/* 根据一、二、三级分类ID查询单条分类 */
-	GetProductOneClassly(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/type/id',
-			data,
-			isLoading: false,
+        })
+    }
+    /* 根据一级分类获取二、三级分类 */
+    GetProductChildrenClassly(data = {}) {
+        return this.AjaxService.get({
+            url: '/product/bigType/classify',
+            data,
+            isLoading: false,
+        })
+    }
+    /* 根据一、二、三级分类ID查询单条分类 */
+    GetProductOneClassly(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/type/id',
+            data,
+            isLoading: false,
 			  
-		})
-	}
-	/*活动页面获取楼层*/
-	GetActivityFloorData(data = {}) {
-		return this.AjaxService.get({
-			url: '/commodity/page/beauty',
-			data,
-			isLoading: false,
+        })
+    }
+    /*活动页面获取楼层*/
+    GetActivityFloorData(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/page/beauty',
+            data,
+            isLoading: false,
 			  
-		})
-	}
+        })
+    }
+    /*采美公告列表*/
+    GetNewsList(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/title',
+            data,
+            isLoading: true,
+			  
+        })
+    }
+    /*采美公告详情 Id */
+    GetNewsCapacity(data = {}) {
+        return this.AjaxService.get({
+            url: '/commodity/home/capacity',
+            data,
+            isLoading: true,
+			  
+        })
+    }
 }

+ 2 - 2
services/config.env.js

@@ -3,8 +3,8 @@ if(process.env.NODE_ENV === 'development'){
     // 开发环境
     // URL_CONFIG = 'http://192.168.2.67:18002'	 //智捷联调地址
     // URL_CONFIG = 'http://192.168.2.68:18002'	 //涛涛联调地址
-    // URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
-    URL_CONFIG = 'https://core-b.caimei365.com'
+    URL_CONFIG = 'http://192.168.2.75:18002'	 //超超联调地址
+    // URL_CONFIG = 'https://core-b.caimei365.com'
     // URL_CONFIG = 'https://core.caimei365.com'
 }else{
     // 生产环境