zhangdan 4 gadi atpakaļ
vecāks
revīzija
80ccd19942
1 mainītis faili ar 199 papildinājumiem un 192 dzēšanām
  1. 199 192
      pages/index/index.vue

+ 199 - 192
pages/index/index.vue

@@ -4,6 +4,7 @@
 		<swiper class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
 			<swiper-item v-for="(item,index) in imageTopList" :key="index">
 				<div class="swiper-item uni-bg-red">
+					<!-- <image class="swiper-item-imgse" :fade-show='true' :src="item.photo"></image> -->
 					<u-image mode="scaleToFill" width="750upx" height="400upx" :src="item.photoPath"></u-image>
 				</div>
 			</swiper-item>
@@ -17,16 +18,16 @@
 		<div class="panel-box">
 			<div class="panel-title">
 				<span class="texts">待办单</span>
-				<span class="btns" @click="toDoList">更多 
-				<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="24" color="#4eacfe"></u-icon>
+				<span class="btns" @click="toDoList">更多
+					<u-icon name="icon-xian-11" custom-prefix="xd-icon" size="24" color="#4eacfe"></u-icon>
 				</span>
 			</div>
 			<div class="panel-body">
 				<div class="order-list">
-					<div v-for="item in toDoData" :key="item.id" @click="viewToDo(item)">
+					<div v-for="item in toDoData" :key="item.id">
 						<span>{{item.createDate.split(' ')[0]}}</span>
 						<span>{{item.sourceTypeDictValue}}</span>
-						<span :class="item.status">{{item.statusDictValue}}</span>
+						<span>{{item.statusDictValue}}</span>
 					</div>
 				</div>
 				<div class="nodata" v-if="toDoData.length==0">{{notoDoDataText}}</div>
@@ -36,209 +37,215 @@
 </template>
 
 <script>
-import iconItemsList from '@/components/icon-items-list/icon-items-list.vue'
-import { bannerList } from "@/api/banner.js"
-import { getBackLogList } from '@/api/backLog'
-import { getLookUpDatas } from "@/api/data.js"
-import moment from 'moment'
-export default {
-	components: {
-		iconItemsList
-	},
-	data() {
-		return {
-			// 顶部轮播图片
-			imageTopList:[],
-			notoDoDataText: '数据加载中,请稍后...',
-			toDoData: [],
-			// 快捷导航
-			navList: [
-				{
-					id: 'SPXD',
-					icon: 'xundian',
-					color: '#00aaff',
-					name: '视频巡店',
-					url: '/pages/videoShopTour/videoShopTour',
-					target: 'page',
-					auth: true
-				},
-				{
-					id: 'DJZX',
-					icon: 'dianjian',
-					color: '#ff8b3e',
-					name: '点检中心',
-					url:'/pages/spotCheckCenter/spotChecking',
-					target: 'page',
-					auth: true
-				},
-				{
-					id: 'XCXD',
-					icon: 'xianchangjiancha',
-					color: '#00aa7f',
-					name: '现场巡店',
-					url:'/pages/siteInspection/siteInspection',
-					target: 'page',
-					auth: true
-				},
-				{
-					id: 'XDJL',
-					icon: 'tubiaokuwenjian-gengxin-',
-					color: '#55aaff',
-					name: '巡店记录',
-					url:'/pages/shopTourRecord/shopTourRecord',
-					target: 'page',
-					auth: true
-				}
-			],
-		};
-	},
-	onLoad() {
-		this.getBanner('HOME_TOP')
-		this.gettoDoData()
-		// 获取周
-		this.getLookUpList('WEEK', 'vuex_weeks');
-		// 获取点检任务状态
-		this.getLookUpList('POINT_TASK_STATUS','vuex_spotCheckStatus')
-		// 获取巡店任务状态
-		this.getLookUpList('TASK_STATUS','vuex_taskStatus')
-	},
-	methods: {
-		// 或某一项字典列表,参数code
-		getLookUpList(code, vuexKey) {
-			getLookUpDatas({ type: code }).then(res => {
-				console.log(res)
-				if (res.status == 200) {
-					this.$store.state[vuexKey] = res.data || [];
-				}
-			});
+	import iconItemsList from '@/components/icon-items-list/icon-items-list.vue'
+	import {
+		bannerList
+	} from "@/api/banner.js"
+	import {
+		getBackLogList
+	} from '@/api/backLog'
+	import {
+		getLookUpDatas
+	} from "@/api/data.js"
+	import moment from 'moment'
+	export default {
+		components: {
+			iconItemsList
 		},
-		openVideo() {
-			 uni.navigateTo({
-			 	url:"/pages/shopTour/shopTour"
-			 })
+		data() {
+			return {
+				// 顶部轮播图片
+				imageTopList: [],
+				notoDoDataText: '数据加载中,请稍后...',
+				toDoData: [],
+				// 快捷导航
+				navList: [{
+						id: 'SPXD',
+						icon: 'xundian',
+						color: '#00aaff',
+						name: '视频巡店',
+						url: '/pages/videoShopTour/videoShopTour',
+						target: 'page',
+						auth: true
+					},
+					{
+						id: 'DJZX',
+						icon: 'dianjian',
+						color: '#ff5500',
+						name: '点检中心',
+						url: '/pages/spotCheckCenter/spotChecking',
+						target: 'page',
+						auth: true
+					},
+					{
+						id: 'XCXD',
+						icon: 'xianchangjiancha',
+						color: '#00aa00',
+						name: '现场巡店',
+						url: '/pages/siteInspection/siteInspection',
+						target: 'page',
+						auth: true
+					},
+					{
+						id: 'XDJL',
+						icon: 'tubiaokuwenjian-gengxin-',
+						color: '#d0527e',
+						name: '巡店记录',
+						url: '/pages/shopTourRecord/shopTourRecord',
+						target: 'page',
+						auth: true
+					}
+				],
+			};
 		},
-		// 消息提示
-		showTotast(title){
-			uni.showToast({
-				icon: 'none',
-				title:title
-			})
+		onLoad() {
+			this.getBanner('HOME_TOP')
+			this.gettoDoData()
+			// 获取周
+			this.getLookUpList('WEEK', 'vuex_weeks');
+			// 获取点检任务状态
+			this.getLookUpList('POINT_TASK_STATUS', 'vuex_spotCheckStatus')
 		},
-		// 获取顶部与中部轮播图片
-		getBanner(position){
-			bannerList({
-				position: position,
-				status : '1',
-				bannerType: 'App'
-			}).then(res=>{
-				if(res.status == 200){
-					if(position == 'HOME_TOP'){
-						this.imageTopList=res.data
+		methods: {
+			// 或某一项字典列表,参数code
+			getLookUpList(code, vuexKey) {
+				getLookUpDatas({
+					type: code
+				}).then(res => {
+					if (res.status == 200) {
+						this.$store.state[vuexKey] = res.data || [];
 					}
+				});
+			},
+			openVideo() {
+				uni.navigateTo({
+					url: "/pages/shopTour/shopTour"
+				})
+			},
+			// 消息提示
+			showTotast(title) {
+				uni.showToast({
+					icon: 'none',
+					title: title
+				})
+			},
+			// 获取顶部与中部轮播图片
+			getBanner() {
+				bannerList({
+					position: 'HOME_TOP',
+					bannerType: 'app'
+				}).then(res => {
+					if (res.status == 200) {
+						this.imageTopList = res.data || []
+					}
+				})
+			},
+			// 获取待办单
+			gettoDoData() {
+				let _this = this
+				let toDoData = {
+					pageNo: 1,
+					pageSize: 10,
+					endDate: moment().format('YYYY-MM-DD'),
+					beginDate: moment().subtract(7, 'days').format('YYYY-MM-DD')
 				}
-			}).catch(err=>{
-				console.log('数据获取失败')
-			})
-		},
-		// 获取待办单
-		gettoDoData(){
-			let _this = this
-			let toDoData = {
-			  pageNo: 1,
-			  pageSize: 10,
-			  endDate: moment().format('YYYY-MM-DD'),
-			  beginDate: moment().subtract(7, 'days').format('YYYY-MM-DD')
-			}
-			getBackLogList(toDoData).then(res=>{
-				console.log(res)
-				if(res.status==200){
-					let data = res.data.list
-					if(data.length) {
-						_this.toDoData = data.slice(0,10)
+				getBackLogList(toDoData).then(res => {
+					console.log(res)
+					if (res.status == 200) {
+						let data = res.data.list
+						if (data.length) {
+							_this.toDoData = data.slice(0, 10)
+						} else {
+							_this.toDoData = []
+							_this.notoDoDataText = '暂无数据'
+						}
 					} else {
-						_this.toDoData = []
-						_this.notoDoDataText = '暂无数据'
+						this.showTotast(res.message ? res.message : '网络似乎出错了,请稍后再试')
+						this.notoDoDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
 					}
-				} else {
-					this.showTotast(res.message ? res.message : '网络似乎出错了,请稍后再试')
-					this.notoDoDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
-				}
-			})
-		},
-		// 更多待办
-		toDoList(){
-			uni.navigateTo({
-				url: '/pages/toDoList/toDoList'
-			})
-		},
-		// 详细页
-		viewToDo(item){
-			uni.navigateTo({
-				url: "/pages/toDoList/backlogDetail?id="+item.id
-			})
-		},
-	}
-};
+				})
+			},
+			// 更多待办
+			toDoList() {
+				uni.navigateTo({
+					url: '/pages/toDoList/toDoList'
+				})
+			}
+		}
+	};
 </script>
 
 <style lang="scss">
-.content {
-	.top-ad-swiper{
-		height: 340upx;
-	}
-	.swiper-item-imgse{
-		width: 750upx;
-		height: 340upx;
-	}
-	.panel-box{
-		.panel-title{
-			display: flex;
-			align-items: center;
-			padding:20upx 25upx;
-			border-bottom: 2upx solid #eee;
-			.texts{
-				font-size: 28upx;
-				flex-grow: 1;
-				padding-left: 15upx;
-			}
-			.btns{
-				font-size: 24upx;
-				color: #999;
-			}
+	.content {
+		.top-ad-swiper {
+			height: 340upx;
 		}
-		.panel-body{
-			padding: 20upx 0;
-			.nodata{
-				text-align: center;
-				font-size: 24upx;
-				width: 100%;
-				color: #999999;
-				padding: 30upx 0;
-			}
+
+		.swiper-item-imgse {
+			width: 750upx;
+			height: 340upx;
 		}
-	}
-	.order-list{
-		> div{
-			display: flex;
-			align-items: center;
-			font-size: 30upx;
-			padding: 15upx 0;
-			span{
-				flex-grow: 1;
-				text-align: center;
-				color: #666;
-				width: 33.3%;
-			}
-			span.PENDING{
-				color: #ff736e;
+
+		.panel-box {
+			.panel-title {
+				display: flex;
+				align-items: center;
+				padding: 20upx 15upx;
+				border-bottom: 2upx solid #eee;
+
+				.texts {
+					font-size: 28upx;
+					flex-grow: 1;
+					padding-left: 15upx;
+					background: url(/static/pt.png) no-repeat left center;
+					background-size: auto 80%;
+				}
+
+				.btns {
+					font-size: 24upx;
+					color: #999;
+				}
 			}
-			span.EXPIRED{
-				color: #999;
+
+			.panel-body {
+				padding: 20upx 0;
+
+				.nodata {
+					text-align: center;
+					font-size: 24upx;
+					width: 100%;
+					color: #999999;
+					padding: 30upx 0;
+				}
 			}
-			span.FINISHED{
-				color: #bbec82;
+		}
+
+		.order-list {
+			>div {
+				display: flex;
+				align-items: center;
+				font-size: 30upx;
+				padding: 14upx 0;
+
+				span {
+					flex-grow: 1;
+					text-align: center;
+					color: #666;
+					width: 33.3%;
+				}
+
+				span.daiJs {
+					color: #ff0000;
+				}
+
+				span.daiWg {
+					color: #ffaa00;
+				}
+
+				span.yiJs {
+					color: #5fbe00;
+				}
 			}
 		}
 	}
-}
 </style>