tong 5 年之前
父节点
当前提交
e6e8b397e2

+ 116 - 58
pages/me/Reward-details/index.vue

@@ -1,59 +1,66 @@
 <template>
 	<!-- 奖励明细页面 -->
 	<view class="header">
-		<view class="header-one">
+		
+			<view class="header-one">
+					</view>
+			
+					<view class="content">
+						<u-tabs style="width: 500rpx;" bg-color="#0095ff" inactive-color="#FFFFFF" active-color="#fff" :list="list"
+						 :is-scroll="false" :current="current" @change="change"></u-tabs>
+						<u-select @cancel="clear" style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" label-name="brandName" :list="brandList"></u-select>
+						<u-calendar style=" color: #fff;" @change="changetime" v-model="showDate" :mode="mode"></u-calendar>
+						<view @click="search">
+							<u-search :show-action="true" :animation="true"></u-search>
+						</view>
+					</view>
+					<view v-if="count!=0">
+					<view class="content-one" v-for="(item,index) in datalist" :key="index">
+						<view class="content-one-view">
+						</view>
+						<view class="content-one-text">获得奖励:{{item.money}}元</view>
+			
+			
+						<view class="content-two">
+							<view class="">
+								轮胎型号
+							</view>
+							<view class="">
+								{{item.tireModel}}
+							</view>
+						</view>
+						<view class="content-two">
+							<view class="">
+								扫码胎号
+							</view>
+							<view class="">
+								{{item.tyreNum}}
+							</view>
+						</view>
+						<view class="content-two">
+							<view class="">
+								奖励类型
+							</view>
+							<view class="">
+								{{getWay}}
+							</view>
+						</view>
+						<view class="content-two">
+							<view class="">
+								获得时间
+							</view>
+							<view class="">
+								{{item.createTime}}
+							</view>
+						</view>
+						
+					</view>
+			
+			<u-loadmore :status="status" />
 		</view>
-
-		<view class="content">
-			<u-tabs style="width: 500rpx;" bg-color="#0095ff" inactive-color="#FFFFFF" active-color="#fff" :list="list"
-			 :is-scroll="false" :current="current" @change="change"></u-tabs>
-			<u-select style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" label-name="brandName" :list="brandList"></u-select>
-			<u-calendar style=" color: #fff;" @change="changetime" v-model="showDate" :mode="mode"></u-calendar>
-			<view @click="search">
-				<u-search :show-action="true" :animation="true"></u-search>
-			</view>
-		</view>
-		<view class="content-one" v-for="(item,index) in datalist" :key="index">
-			<view class="content-one-view">
-			</view>
-			<view class="content-one-text">获得奖励:{{item.money}}元</view>
-
-
-			<view class="content-two">
-				<view class="">
-					轮胎型号
-				</view>
-				<view class="">
-					{{item.tireModel}}
-				</view>
-			</view>
-			<view class="content-two">
-				<view class="">
-					扫码胎号
-				</view>
-				<view class="">
-					{{item.tyreNum}}
-				</view>
-			</view>
-			<view class="content-two">
-				<view class="">
-					奖励类型
-				</view>
-				<view class="">
-					{{getWay}}
-				</view>
-			</view>
-			<view class="content-two">
-				<view class="">
-					获得时间
-				</view>
-				<view class="">
-					{{item.createTime}}
-				</view>
-			</view>
+		<view v-else style="margin-top: 400rpx;">
+			<u-empty text="暂无数据" mode="list"></u-empty>
 		</view>
-
-
 	</view>
 </template>
 
@@ -66,6 +73,7 @@
 		data() {
 			return {
 				datalist: [],
+				status: 'loadmore',
 				getWay: '',
 				list: [{
 					name: '全部'
@@ -74,6 +82,7 @@
 				}, {
 					name: '时间',
 				}],
+				
 				itemList: [{
 					head: "赛轮 12R22.5 18PR S838",
 					body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
@@ -99,6 +108,8 @@
 				// 	}
 				// ],
 				current: 0,
+				// 默认页数
+				current1: 1,
 				showBrand: false,
 				showDate: false,
 				mode: 'range',
@@ -106,7 +117,11 @@
 				startTime: '',
 				// 结束时间
 				endTime: '',
-				label: ''
+				pages: '',
+				count:'',
+				datalength: '',
+				label: '',
+				
 				
 			};
 		},
@@ -123,12 +138,16 @@
 						data: {
 							'storeId': '1000',
 							'userId': '123',
-							'current': '1',
+							'current': this.current1,
 							'size': '10'
 						}
 					}).then(res => {
 						console.log(res)
-						this.datalist = res.data.data
+						// this.datalist = res.data.data
+						this.count = res.data.count
+						this.datalength = res.data.data.length
+						this.datalist = this.datalist.concat(res.data.data)
+						
 						// 判断扫码类型
 						for (var i = 0; i < res.data.data.length; i++) {
 							if (res.data.data[i].getWay == 0) {
@@ -137,7 +156,6 @@
 								this.getWay = "门店扫码"
 							}
 						}
-						console.log(res.data.data)
 					}).catch(err => {
 						console.log(err)
 					})
@@ -154,6 +172,7 @@
 				console.log(e)
 				this.startTime = e.startDate
 				this.endTime = e.endDate
+				this.datalist= []
 				request({
 						url: '/myPage/getPageScanRewordList',
 						method: 'post',
@@ -167,7 +186,11 @@
 						}
 					}).then(res => {
 						console.log(res)
-						this.datalist = res.data.data
+						// this.datalist = res.data.data
+						this.datalist = this.datalist.concat(res.data.data)
+						console.log(res.data.data)
+						console.log(this.datalist)
+						this.count = res.data.count
 						// 判断扫码类型
 						for (var i = 0; i < res.data.data.length; i++) {
 							if (res.data.data[i].getWay == 0) {
@@ -198,7 +221,8 @@
 							'userId': '123'	
 						}
 					}).then(res => {
-						this.brandList = JSON.parse(JSON.stringify(res.data.data))		
+						this.brandList = JSON.parse(JSON.stringify(res.data.data))	
+						
 					}).catch(err => {
 						console.log(err)
 					})
@@ -212,6 +236,7 @@
 			},
 			// 点击获取品牌
 			confirm(e) {
+				
 				console.log(e)
 				console.log(e[0].label)
 				this.label = e[0].label
@@ -227,7 +252,9 @@
 						}
 					}).then(res => {
 						console.log(res)
-						this.datalist = res.data.data
+						this.count = res.data.count
+						this.datalength = res.data.data.length
+						this.datalist = this.datalist.concat(res.data.data)
 						// 判断扫码类型
 						for (var i = 0; i < res.data.data.length; i++) {
 							if (res.data.data[i].getWay == 0) {
@@ -248,6 +275,13 @@
 				
 					})
 				},
+				// 点击取消按钮
+					
+					
+				clear() {
+					this.current = 0
+					console.log("@@")
+				},
 			search() {
 				this.$u.route({
 					url: 'pages/me/search/index',
@@ -257,11 +291,35 @@
 				this.current = index;
 				if (this.current == 1) {
 					this.showBrand = true
+					this.datalist= []
 				} else if (this.current == 2) {
 					this.showDate = true
+					this.datalist= []
 				}
+				this.current1 = 1
+				this.datalist= []
 				this.data()
 			}
+		},
+		onReachBottom() {
+			console.log("@@@")
+			console.log(this.count)
+			console.log(this.datalength)
+			setTimeout(() => {
+				if (this.count > this.datalength) {
+					this.current1 = ++this.current1;
+					this.data()
+					this.status = 'nomore'
+					
+				} else {
+					
+					this.status = 'loading';
+					console.log("@@@")
+					// this.status = 'nomore'
+					
+				}
+			}, 1000)
+		
 		}
 	}
 </script>

+ 220 - 115
pages/me/Settlement-center/index.vue

@@ -2,105 +2,46 @@
 	<!-- 结算中心页面 -->
 	<view>
 		<view class="top">
-			<view class="content">
+			<view class="content" v-for="(item,index) in datalist" :key="index">
 				<view class="content-one">
 				</view>
-				<text class="content-two">代理商2</text>
-				<text class="content-three">核销返利</text>
+				<text class="content-two">{{item.agentName}}</text>
+				<text class="content-three" @click="button(index)" :key='index'>核销返利</text>
 				<view class="content-four">
 					<text>品牌</text>
 					<text>奖励</text>
-					<text @click="checkedAll1">全选</text>
+					<text @click="checkedAll(index,item)" :key='index'>全选</text>
 				</view>
-				<view class="content-five">
-					<view>
-						<u-icon name="photo"></u-icon>
-					</view>
-					<view>
-						800万
-					</view>
-					<view>
-						<u-checkbox-group>
-									<u-checkbox 
-										v-model="checked1" 
-									></u-checkbox>
-								</u-checkbox-group>
-					</view>
-				</view>
-				<view class="content-five">
-					<view>
-						<u-icon name="photo"></u-icon>
+				<checkbox-group @change="checkboxChange($event,index)">
+				<view class="content-five" v-for="(item,brandIndex) in item.storegentBrandList" :key="brandIndex">
+					<view class="content-five-img">
+						<u-image width="100%" height="65%" scaleType="matrix" :src="item.logoUrl"></u-image>
+						<!-- {{ item.brandCode }} -->
 					</view>
-					<view>
-						800万
-					</view>
-					<view>
-						<u-checkbox-group>
-									<u-checkbox 
-										v-model="checked2" 
-									></u-checkbox>
-								</u-checkbox-group>
-					</view>
-				</view>
-				<view class="content-five">
-					<view>
-						<u-icon name="photo"></u-icon>
-					</view>
-					<view>
-						800万
-					</view>
-					<view>
-						<u-checkbox-group>
-									<u-checkbox 
-										v-model="checked3" 
-									></u-checkbox>
-								</u-checkbox-group>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="content2">
-				<view class="content-one">
-				</view>
-				<text class="content-two">代理商1</text>
-				<text class="content-three">核销返利</text>
-				<view class="content-four">
-					<text>品牌</text>
-					<text>奖励</text>
-					<text @click="checkedAll">全选</text>
-				</view>
-				<view class="content-five">
-					<view>
-						<u-icon name="photo"></u-icon>
-					</view>
-					<view>
-						800万
+					<view class="content-five-view">
+						{{item.usableMoney}}元
 					</view>
 					<view>
-						<u-checkbox-group>
-									<u-checkbox 
-										v-model="checked4" 
-									></u-checkbox>
-								</u-checkbox-group>
-					</view>
-				</view>
-				<view class="content-five">
-					<view>
-						<u-icon name="photo"></u-icon>
-					</view>
-					<view>
-						800万
-					</view>
-					<view>
-						<u-checkbox-group>
-									<u-checkbox 
-										v-model="checked5" 
-									></u-checkbox>
-								</u-checkbox-group>
-								<!-- <u-button @click="checkedAll">全选</u-button> -->
+						<!-- <u-checkbox-group @change="checkboxGroupChange" :disabled="item.usableMoney==0?true:false">
+							<u-checkbox @change="checkboxChange(storegentBrandList[index],checkboxList[index],index)" v-model="checkboxList[index]" :key="index"></u-checkbox>
+						</u-checkbox-group> -->
+							<view class="" v-show="false">
+								{{index}}
+								{{ '^^^^' + checkboxList[index] }}
+								{{ '&&&' + isCheckedAll }}
+							</view>
+							
+							<label>
+								<checkbox :value="JSON.stringify(item)" :checked="checkboxList[index]" :disabled="item.usableMoney==0" color="#FFCC33" style="transform:scale(0.7)"/>
+							</label>
+							<!-- <label>
+								<checkbox value="cb" color="#FFCC33" style="transform:scale(0.7)" />未选中
+							</label> -->
+					
 					</view>
+
 				</view>
-				
+				</checkbox-group>
 			</view>
 		</view>
 
@@ -108,37 +49,187 @@
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
-				checked1: false,
-				checked2: false,
-				checked3: false,
-				checked4: false,
-				checked5: false
+				datalist: [],
+				agentId: '',
+				Arry: [],
+				brandCodeCheckList:[],
+				amount: '',
+				choice: 0,
+				kunnr: '',
+				brandCode: '',
+				agentOpDate: '',
+				src: 'https://b2bcnfile.sailuntire.com/upload//sailun-allsteel-admin/2020110616154607343814..jpg',
+				storegentBrandList: [],
+				checked: true,
+				list: [{}],
+				checkboxList: [],
+				idList:[],
+				isCheckedAll:false
 			};
 		},
-			methods: {
-				// 选中某个复选框时,由checkbox时触发
-				checkboxChange(e) {
-					//console.log(e);
-				},
-				// 选中任一checkbox时,由checkbox-group触发
-				checkboxGroupChange(e) {
-					// console.log(e);
-				},
-				// 全选
-				checkedAll() {
-					this.checked4 = true
-					this.checked5 = true
-				},
-				checkedAll1() {
-					this.checked1 = true
-					this.checked2 = true
-					this.checked3 = true
-				}
+		created() {
+			this.getData()
+		},
+		methods: {
+			// 获取结算中心数据
+			getData() {
+				request({
+						url: '/myapp/storeSettlementCenter',
+						method: 'post',
+						data: {
+							'storeId': '3000',
+							'userId': ''
+						}
+					}).then(res => {
+						console.log(res)
+						console.log(res.data)
+						this.datalist = res.data.data
+						this.Arry.length = this.datalist.length
+						// this.checkboxList.length = this.datalist.length
+						for(var i=0;i<this.datalist.length;i++){
+							this.Arry[i] = []
+							this.checkboxList.push(false)
+						}
+						console.log(this.checkboxList)
+						console.log(res.data.data[0].storegentBrandList)
+						// 遍历
+						if (this.choice == 0) {
+							for (var l = 0; l < res.data.data.length; l++) {
+								this.storegentBrandList = res.data.data[l].storegentBrandList
+								for (var i = 0; i < res.data.data[l].storegentBrandList.length; i++) {
+									// this.checkboxList[i] = false
+								}
+							}
+						} else {
+							for (var l = 0; l < res.data.data.length; l++) {
+								this.storegentBrandList = res.data.data[l].storegentBrandList
+								for (var i = 0; i < res.data.data[l].storegentBrandList.length; i++) {
+									// this.checkboxList[i] = true
+								}
+							}
+						}
+
+
+					}).catch(err => {
+						console.log(err + "")
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 1000)
+
+					})
+			},
+
+			checkboxChange1() {
+				console.log("###")
+			},
+			// 选中某个复选框时,由checkbox时触发
+			// ,bollean,index
+			checkboxChange(e,index){
+				console.log(e)
+				let newArr = []
+				// this.Arry.length = this.datalist.length
+				// this.Arry[index] = []
+				console.log(this.Arry)
+				// 调用数组的每个元素并将元素传递给回调函数
+				// item回调函数
+				// JSON.parse()将回调函数字符串转为对象取出
+				e.detail.value.forEach((item) =>{
+					var obj = {
+						"storeId": "3000",
+						"amount": JSON.parse(item).usableMoney,
+						"brandCode": JSON.parse(item).brandCode,
+						"kunnr": JSON.parse(item).kunnr,
+						'userId': ''
+					}
+					// let obj = JSON.parse(item)
+					console.log(obj)
+					newArr.push(obj)
+				})
+				this.Arry[index] = newArr
+				console.log(this.Arry[index])
+				console.log('%%%%%%',this.Arry)
+			},
+			// 核销返利
+			button(index) {
+				console.log(index)
+				console.log(this.Arry[index])
+				request({
+						url: '/myapp/storeCancel',
+						method: 'post',
+						data: this.Arry[index]
+					}).then(res => {
+						console.log(res)
+						if(res.data.msg=="success") {
+							uni.showToast({
+							    title: '核销返利成功',
+							    duration: 2000
+							});
+							
+						}else {
+							uni.showToast({
+							    title: '核销返利失败',
+								icon: false,
+							    duration: 2000
+							});
+						}
+						
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 1000)
+				
+					})
+				
+			},
+			// 选中任一checkbox时,由checkbox-group触发
+			checkboxGroupChange(e) {
+				// console.log(e);
 			},
+			// 全选
+			checkedAll(index,e) {
+				console.log(e)
+				this.isCheckedAll = !this.isCheckedAll
+				console.log(index,e)
+				let newArr=[]
+				console.log(this.checkboxList)
+				if(this.Arry[index].length == e.storegentBrandList.filter((item)=>{
+					return item.usableMoney !=0
+				}).length ){
+					this.checkboxList[index] = false
+					this.Arry[index] = []
+				}else{
+					this.checkboxList[index] = true
+					for(var i=0;i<e.storegentBrandList.length;i++){
+						if( e.storegentBrandList[i].usableMoney !=0){
+							var obj = {
+								"storeId": "3000",
+								"amount": e.storegentBrandList[i].usableMoney,
+								"brandCode": e.storegentBrandList[i].brandCode,
+								"kunnr": e.storegentBrandList[i].agentId
+							}
+							newArr.push(obj)
+						}
+					}
+					this.Arry[index] = newArr
+				}
+				console.log(this.Arry,this.checkboxList)		
 			}
+		},
+	}
 </script>
 
 <style>
@@ -151,14 +242,17 @@
 
 	.content {
 		width: 712rpx;
-		height: 445rpx;
+		/* height: 445rpx; */
 		margin: 0 auto;
+		margin-bottom: 30rpx;
 		background: #FFFFFF;
 		box-shadow: 0px 0px 24px 0px rgba(101, 176, 249, 0.41);
 		border-radius: 18px;
 		position: relative;
 		top: 30rpx;
+		margin-bottom: 50rpx;
 	}
+
 	.content2 {
 		width: 712rpx;
 		height: 351rpx;
@@ -168,7 +262,7 @@
 		border-radius: 18px;
 		position: relative;
 		top: 170rpx;
-		}
+	}
 
 	.content-one {
 		width: 6rpx;
@@ -195,7 +289,7 @@
 		background-color: #3A9FF2;
 		position: relative;
 		top: -14rpx;
-		left: 470rpx;
+		left: 430rpx;
 		border-radius: 10rpx;
 		font-size: 24rpx;
 		color: #fff;
@@ -221,5 +315,16 @@
 		margin-left: 100rpx;
 		font-weight: bolder;
 		margin-right: 30rpx;
+		padding-bottom: 40rpx;
+	}
+
+	.content-five-img {
+		width: 164rpx;
+		height: 50rpx;
+		margin-left: -50rpx;
+	}
+
+	.content-five-view {
+		margin-left: -100rpx;
 	}
 </style>

+ 198 - 95
pages/me/Statistical-task/index.vue

@@ -1,32 +1,30 @@
 <template>
 	<view class="top">
 		<view class="qiun-charts">
-			<view v-for="(item,index) in datalist" :key="index">
+			<view v-for="(item,index) in orderList" :key="index">
 				<view class="content">
 					<view class="qiun-charts-one">
 					</view>
-					<text class="qiun-charts-two">赛轮轮胎品牌任务统计</text>
+					<text class="qiun-charts-two">{{item.brand}}</text>
 					<view style="display: flex;justify-content: space-between;">
-						
-					
-					<view class="qiun-charts-three">
-						<view>
-						</view>
-						<view>
-							10月10条任务统计
-						</view>
-					</view>
-					<view class="qiun-charts-four">
-						<view>
+						<view class="qiun-charts-three">
+							<view>
+							</view>
+							<view>
+								{{item.month}}
+							</view>
 						</view>
-						<view>
-							10月10条任务统计
+						<view class="qiun-charts-four">
+							<view>
+							</view>
+							<view>
+								{{item.quarter}}
+							</view>
 						</view>
 					</view>
-					</view>
 					<view class="content-one">
-						<canvas canvas-id="canvasRing" id="canvasRing" class="charts" @touchstart="touchRing"></canvas>
-						<canvas canvas-id="canvasRing" id="canvasRing" class="charts" @touchstart="touchRing"></canvas>
+						<canvas :canvas-id="'mouthPie' + index" :id="'mouthPie' + index" class="charts" @touchstart="touchPie($event,'mouthPie' + index)"></canvas>
+						<canvas :canvas-id="'quarterPie' + index" :id="'quarterPie' + index" class="charts" @touchstart="touchPie($event,'quarterPie' + index)"></canvas>
 					</view>
 				</view>
 			</view>
@@ -35,76 +33,183 @@
 </template>
 
 <script>
+	var canvasObj = {};
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	import uCharts from '@/components/u-charts/u-charts.js';
 	import {
 		isJSON
 	} from '@/common/checker.js';
 	var _self;
-	var canvaRing = null;
+	var canvaPie = null;
 
 	export default {
 		data() {
 			return {
-				datalist: [{},
-					{},
-					{},
-					{},
-					{},
-				],
+				orderList: [],
 				cWidth: '',
 				cHeight: '',
 				pixelRatio: 1,
-				textarea: ''
+				piearr: [],
+				textarea: '',
+				// name: '',
+				pieObj:{
+					series:[
+						{
+							data:60,
+							name:'已完成'
+						},
+						{
+							data:40,
+							name:'未完成'
+						},
+					]
+				},
+				pieObj2:{
+					series:[
+						{
+							data:60,
+							name:'已完成'
+						},
+						{
+							data:40,
+							name:'未完成'
+						},
+					]
+				}
 			}
 		},
 		onLoad() {
 			_self = this;
 			_self.cWidth = uni.upx2px(370);
 			_self.cHeight = uni.upx2px(320);
-			this.showRing('canvasRing')
-			// this.getServerData();
+			// this.showPie('canvasRing')
+		},
+		created() {
+			this.getDate()
 		},
 		methods: {
-			// 这是官网给的调接口渲染数据的代码,我写的没有后台数据,自己写的固定的数据  就注销了
-			// getServerData() {
-			// 	uni.request({
-			// 		url: 'https://www.ucharts.cn/data.json',
-			// 		data: {},
-			// 		success: function(res) {
-			// 			console.log(res.data.data)
-			// 			console.log("3333")
-			// 			let Ring = {
-			// 				series: []
-			// 			};
-			// 			//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
-			// 			Ring.series = res.data.data.Ring.series;
-			// 			//自定义文案示例,需设置format字段
-			// 			for (let i = 0; i < Ring.series.length; i++) {
-			// 				Ring.series[i].format = () => {
-			// 					console.log(Ring.series[i].name + Ring.series[i].data)
-			// 					return Ring.series[i].name + Ring.series[i].data
-			// 				};
-			// 			}
-			// 			_self.textarea = JSON.stringify(res.data.data.Ring);
-			// 			_self.showRing("canvasRing", Ring);
-			// 		},
-			// 		fail: () => {
-			// 			_self.tips = "网络错误,小程序端请检查合法域名";
-			// 		},
-			// 	});
-			// },
+			getDate() {
+				request({
+						url: '/myapp/storeBrandTask',
+						method: 'post',
+						data: {
+							"storeId": '1000'
 
-			showRing(canvasId, chartData) {
-				var chartData = {
-					series: [{
-						"name": "已完成",
-						"data": 50
-					}, {
-						"name": "待完成",
-						"data": 30
-					}]
-				};
-				canvaRing = new uCharts({
+						}
+					}).then(res => {
+						console.log(res)
+						this.orderList = res.data.data
+						for(var i=0;i<res.data.data.length;i++){
+							let  monthPie = {
+								series: []
+							};
+							let quarterPie = {
+								series: []
+							}
+							
+							for(var j=0;j<res.data.data[i].storeMonthList.length;j++){
+								// var _this = this
+								this.name = res.data.data[i].storeMonthList[j].data
+								let name = ""
+								console.log(this.name)
+								let monthObj = {
+									data:null,
+									name:'',
+								}
+								let quarterObj = {
+									data:null,
+									name:'',
+								}
+								name= res.data.data[i].storeMonthList[j].data
+								console.log(name)
+								monthObj.data = res.data.data[i].storeMonthList[j].data
+								monthObj.name = res.data.data[i].storeMonthList[j].name
+								quarterObj.data = res.data.data[i].storeQuarterList[j].data
+								quarterObj.name = res.data.data[i].storeQuarterList[j].name
+								
+								console.log('^^^^',monthObj)
+								console.log('9999999',quarterObj)
+								
+								monthPie.series.push(monthObj)
+								quarterPie.series.push(quarterObj)
+								
+							}
+							
+							console.log(`mouthPie${i}`,monthPie,quarterPie)
+							 this.showPie(`mouthPie${i}`,monthPie);
+							 this.showPie(`quarterPie${i}`,quarterPie)
+							// this[`${this.refVal}`]
+						}
+						
+						
+						// let HstoreMonthList = res.data.data[0].storeMonthList
+						// let SstoreMonthList = res.data.data[1].storeMonthList
+						// for(var i=0;i<HstoreMonthList.length;i++){
+						// 	let obj = {
+						// 		data:null,
+						// 		name:'',
+						// 	}
+						// 	obj.data = HstoreMonthList[i].data
+						// 	obj.name = HstoreMonthList[i].name
+						// 	console.log(obj)
+						// 	Pie.series[i] = obj
+						// }
+						// this.showPie("canvasPie", Pie);
+						//这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
+						// for (let i = 0; i < res.data.data.length; i++) {
+						// 	for(let j=0;j<res.data.data[i].storeMonthList.length;j++){
+						// 		let obj = {
+						// 			data:null,
+						// 			name:'',
+						// 		}
+						// 		console.log(res.data.data[i].storeMonthList[j].data)
+						// 		console.log(res.data.data[i].storeMonthList[j].name)
+						// 		obj.data = res.data.data[i].storeMonthList[j].data
+						// 		obj.name = res.data.data[i].storeMonthList[j].name
+						// 		Pie.series[j] = obj
+						// 	}
+						// 	this.showPie("canvasPie", Pie);
+							// this.pieObj = res.data.data[i].storeMonthList
+							// for(let j =0;j<res.data.data[i].storeMonthList.length;j++){
+							// 	let obj = {
+							// 		name:'',
+							// 		data:null
+							// 	}
+							// 	obj.name = res.data.data[i].storeMonthList[j].name
+							// 	obj.data = res.data.data[i].storeMonthList[j].data
+							// 	Pie.series[j] = obj
+							// 	console.log('^^^^^',Pie)
+							// 	this.showPie("canvasPie",Pie);
+							// }
+							// let obj = {
+							// 	name:'',
+							// 	data:null
+							// }
+							// obj.name = res.data.data[i]
+						// Pie.series = res.data.data[i].storeMonthList;
+						// console.log(this.pieObj)
+						// console.log(Pie)
+						
+						
+						
+						// }
+						
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
+			},
+			showPie(canvasId, chartData) {
+				console.log('8888888',canvasId,chartData)
+				canvasObj[canvasId]=new uCharts({
 					$this: _self,
 					canvasId: canvasId,
 					type: 'ring',
@@ -131,12 +236,12 @@
 					disablePieStroke: true,
 					dataLabel: true,
 					subtitle: {
-						name: '70%',
+						// name: 40,1
 						color: '#7cb5ec',
 						fontSize: 12 * _self.pixelRatio,
 					},
 					title: {
-						name: '完成',
+						name: '完成',
 						color: '#666666',
 						fontSize: 13 * _self.pixelRatio,
 					},
@@ -148,6 +253,7 @@
 						}
 					},
 				});
+				// this.piearr = canvaPie.opts.series;
 			},
 			// touchRing(e) {
 			// 	canvaRing.touchLegend(e, {
@@ -159,30 +265,22 @@
 			// 		}
 			// 	});
 			// },
-			touchRing(e) {
-				canvaRing.touchLegend(e, {
-					animation: false
-				});
-				canvaRing.showToolTip(e, {
-					format: function(item) {
-						return item.name + ':' + item.data
-					}
+			touchPie(e,id){
+				console.log(e,id)
+				
+				// canvaPie.touchLegend(e, {
+				// 	animation: false
+				// });
+				canvasObj[id].showToolTip(e, {
+						format: function (item) {
+								return item.name + ':' + item.data 
+						}
 				});
 			},
-			changeData() {
-				if (isJSON(_self.textarea)) {
-					let newdata = JSON.parse(_self.textarea);
-					canvaRing.updateData({
-						series: newdata.series,
-						categories: newdata.categories
-					});
-				} else {
-					uni.showToast({
-						title: '数据格式错误',
-						image: '../../../static/images/alert-warning.png'
-					})
-				}
-			}
+			
+			
+			
+			
 		}
 	}
 </script>
@@ -239,48 +337,53 @@
 		position: relative;
 		top: -20rpx;
 	}
+
 	.qiun-charts-three>view:nth-child(1) {
 		width: 24rpx;
 		height: 24rpx;
 		border: 6rpx solid #0094FE;
-		transform:rotate(50deg);
+		transform: rotate(50deg);
 		position: relative;
 		top: 20rpx;
 		left: 30rpx;
 	}
+
 	.qiun-charts-three>view:nth-child(2) {
 		width: 150rpx;
 		height: 22rpx;
 		background-color: #000000;
 		color: #fff;
 		font-size: 15rpx;
-        opacity: 0.3;
+		opacity: 0.3;
 		text-align: center;
 		position: relative;
 		top: -2rpx;
 		left: 40rpx;
 		border-top-right-radius: 12rpx;
 	}
+
 	.qiun-charts-four {
 		position: relative;
 		right: 200rpx;
 	}
+
 	.qiun-charts-four>view:nth-child(1) {
 		width: 24rpx;
 		height: 24rpx;
 		border: 6rpx solid #0094FE;
-		transform:rotate(50deg);
+		transform: rotate(50deg);
 		position: relative;
 		top: 20rpx;
 		left: 30rpx;
 	}
+
 	.qiun-charts-four>view:nth-child(2) {
 		width: 150rpx;
 		height: 22rpx;
 		background-color: #000000;
 		color: #fff;
 		font-size: 15rpx;
-	    opacity: 0.3;
+		opacity: 0.3;
 		text-align: center;
 		position: relative;
 		top: -2rpx;

+ 174 - 173
pages/me/Write-off-management/index.vue

@@ -1,205 +1,201 @@
 <template>
 	<view>
 		<view class="wrap">
-			<view class="u-tabs-box">
-				<u-tabs-swiper activeColor="#0094FE" ref="tabs" :list="list" :current="current" @change="change" :is-scroll="false"
-				 swiperWidth="750"></u-tabs-swiper>
+			<view class="u-tabs-box" style="width:100%">
+				<u-tabs :list="list" :is-scroll="false" :current="current" @change="handleFilterBrand"></u-tabs>
 			</view>
-			<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
-				<swiper-item class="swiper-item">
-					<scroll-view scroll-y style="height: 100%;width: 100%;">
-						<view class="page-box">
-							<view class="order" v-for="(res, index) in orderList" :key="res.id">
-								<view class="order-one">
-								</view>
-								<text class="order-one-text">核销金额:¥100000</text>
-								<view class="order-one-xian">
-								</view>
-								<view class="order-two">
-									<view class="">
-										创建时间
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-								<view class="order-two">
-									<view class="">
-										核审时间
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-								<view class="order-two">
-									<view class="">
-										当前状态
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-							</view>
-							<!-- <u-loadmore :status="loadStatus[0]" bgColor="#f2f2f2"></u-loadmore> -->
+			<view class="page-box" v-if="pages!=0">
+				<view class="order" v-for="(res, index) in orderList" :key="res.id">
+					<view class="order-one">
+					</view>
+					<text class="order-one-text">核销金额:¥{{res.amount}}</text>
+					<view class="order-one-xian">
+					</view>
+					<view class="order-two">
+						<view class="">
+							创建时间
 						</view>
-					</scroll-view>
-				</swiper-item>
-				<swiper-item class="swiper-item">
-					<scroll-view scroll-y style="height: 100%;width: 100%;">
-						<view class="page-box">
-							
-							<view class="order" v-for="(res, index) in orderList" :key="res.id">
-								<view class="order-one">
-								</view>
-								<text class="order-one-text">核销金额:¥100000</text>
-								<view class="order-one-xian">
-								</view>
-								<view class="order-two">
-									<view class="">
-										创建时间
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-								<view class="order-two">
-									<view class="">
-										核审时间
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-								<view class="order-two">
-									<view class="">
-										当前状态
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-							</view>
+						<view class="">
+							{{res.createTime}}
 						</view>
-					</scroll-view>
-				</swiper-item>
-				<swiper-item class="swiper-item">
-					<scroll-view scroll-y style="height: 100%;width: 100%;">
-						<view class="page-box">
-							<view class="order" v-for="(res, index) in orderList" :key="res.id">
-								<view class="order-one">
-								</view>
-								<text class="order-one-text">核销金额:¥100000</text>
-								<view class="order-one-xian">
-							
-								</view>
-								<view class="order-two">
-									<view class="">
-										创建时间
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-								<view class="order-two">
-									<view class="">
-										核审时间
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-								<view class="order-two">
-									<view class="">
-										当前状态
-									</view>
-									<view class="">
-										2020-10-28 08:10:42
-									</view>
-								</view>
-							</view>
+					</view>
+					<view class="order-two">
+						<view class="">
+							核审时间
 						</view>
-					</scroll-view>
-				</swiper-item>
+						<view class="">
+							{{res.b2bAuditTime}}
+						</view>
+					</view>
+					<view class="order-two">
+						<view class="">
+							当前状态
+						</view>
+						<view class="">
+							{{b2bStatus}}
+						</view>
+					</view>
+				</view>
+
+			</view>
+			<view v-else style="margin-top: 100rpx;">
+				<u-empty text="暂无数据" mode="list"></u-empty>
+			</view>
 
-			</swiper>
 		</view>
+		<u-loadmore :status="status" />
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
 				orderList: [
-					[
-						
-					],
-					[],
-					[]
-					
+
 				],
+				length: '',
+				status: 'loadmore',
+				pages: '',
+				b2bStatus: '',
 				list: [{
-						name: '待付款'
-					},
-					{
-						name: '待发货'
-					},
-					{
-						name: '待收货'
-					},
-				],
+					name: "待审核"
+
+				}, {
+					name: "已审核"
+
+				}, {
+					name: "已失效"
+
+				}],
 				current: 0,
-				swiperCurrent: 0,
-				tabsHeight: 0,
-				dx: 0,
-				loadStatus: ['loadmore', 'loadmore', 'loadmore', 'loadmore'],
+				current3: 0,
+				current2: 1
 			};
 		},
-		onLoad() {
-			// this.getOrderList(0);
-			// this.getOrderList(1);
-			// this.getOrderList(3);
-		},
-		computed: {
-			// 价格小数
-			priceDecimal() {
-				return val => {
-					if (val !== parseInt(val)) return val.slice(-2);
-					else return '00';
-				};
-			},
-			// 价格整数
-			priceInt() {
-				return val => {
-					if (val !== parseInt(val)) return val.split('.')[0];
-					else return val;
-				};
-			}
+		onLoad() {},
+		created() {
+			this.getDate()
 		},
 		methods: {
-		
-			// tab栏切换
-			change(index) {
-				this.swiperCurrent = index;
+			// 获取列表数据
+			getDate() {
+				request({
+						url: '/myapp/storeSelectCoupon',
+						method: 'post',
+						data: {
+							"storeId": '3000',
+							"size": 10, //门店0
+							"current": this.current2,
+							"status": this.current3,
+							"userId": ''
+						}
+					}).then(res => {
+						console.log(res)
+						console.log(this.pages)
+						this.orderList = this.orderList.concat(res.data.data.records)
+						// 页数
+						this.pages = res.data.data.pages
+						for (let i = 0; i < res.data.data.records.length; i++) {
+							console.log(res.data.data.records[i].b2bStatus)
+							if (res.data.data.records[i].b2bStatus == 0) {
+								this.b2bStatus = "待审核"
+							} else if (res.data.data.records[i].b2bStatus == 1) {
+								this.b2bStatus = "审核未通过"
+							} else if (res.data.data.records[i].b2bStatus == 2) {
+								this.b2bStatus = "审核通过"
+							} else {
+								this.b2bStatus = "已过期"
+							}
+						}
+
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
 			},
-			transition({
-				detail: {
-					dx
-				}
-			}) {
-				this.$refs.tabs.setDx(dx);
+			handleSearch: function(v) {
+				console.log(v)
 			},
-			animationfinish({
-				detail: {
-					current
+			handleFilterBrand: function(v2) {
+				this.current = v2
+				if (v2 == 0) {
+					this.current1 = 0
+					this.current3 = 0
+				} else if (v2 == 1) {
+					this.current1 = 4
+					this.current3 = 4
+				} else {
+					this.current1 = 3
+					this.current3 = 3
 				}
-			}) {
-				this.$refs.tabs.setFinishCurrent(current);
-				this.swiperCurrent = current;
-				this.current = current;
+				this.current2 = 1
+
+				request({
+						url: '/myapp/storeSelectCoupon',
+						method: 'post',
+						data: {
+							"storeId": '3000',
+							"size": 10, //门店0
+							"current": this.current2,
+							"status": this.current1,
+							"userId": ''
+						}
+					}).then(res => {
+						console.log(res)
+						this.orderList = res.data.data.records
+						// 页数
+						this.pages = res.data.data.pages
+						// this.orderList = this.orderList.concat(res.data.data.records)
+						for (let i = 0; i < res.data.data.records.length; i++) {
+							console.log(res.data.data.records[i].b2bStatus)
+							if (res.data.data.records[i].b2bStatus == 0) {
+								this.b2bStatus = "待审核"
+							} else if (res.data.data.records[i].b2bStatus == 1) {
+								this.b2bStatus = "审核未通过"
+							} else if (res.data.data.records[i].b2bStatus == 2) {
+								this.b2bStatus = "审核通过"
+							} else {
+								this.b2bStatus = "已过期"
+							}
+						}
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
+
 			}
+		},
+		onReachBottom() {
+			setTimeout(() => {
+				if (this.current2 > this.pages) {
+					console.log(this.current2)
+					console.log(this.pages)
+					this.status = 'nomore'
+				} else {
+					this.current2 = ++this.current2;
+					this.status = 'loading';
+					this.getDate()
+				}
+			}, 2000)
+
 		}
-	};
+
+	}
 </script>
 
 <style>
@@ -213,6 +209,11 @@
 </style>
 
 <style lang="scss" scoped>
+	.u-tabs-box {
+		width: 100%;
+		// padding-left:30rpx;
+	}
+
 	// 插件代码
 	.order {
 		width: 710rpx;

+ 14 - 2
pages/me/index.vue

@@ -53,7 +53,7 @@
 						<view style="font-size: 34rpx;">
 							结算中心
 						</view>
-						<view class="u-col-bottom" style="color: #4B4B4B;font-size: 24rpx;">
+						<view class="u-col-bottom" @click="insettlement" style="color: #4B4B4B;font-size: 24rpx;">
 							查看全部
 						</view>
 					</view>
@@ -179,7 +179,7 @@
 					</view>
 				</u-card>
 				<u-cell-group>
-					<u-cell-item  title="核销记录">
+					<u-cell-item  title="核销记录" @click="inWrite">
 						<u-icon slot="icon" size="42" name="balance-o" custom-prefix="van-icon"></u-icon>
 					</u-cell-item>
 					<u-cell-item  title="兑换记录">
@@ -254,6 +254,18 @@
 				this.$u.route({
 					url: 'pages/me/setting/setting',
 				})
+			},
+			// 核销管理
+			inWrite(){
+				this.$u.route({
+					url: 'pages/me/Write-off-management/index',
+				})
+			},
+			// 查看结算
+			insettlement(){
+				this.$u.route({
+					url: 'pages/me/Settlement-center/index',
+				})
 			}
 		}
 	}

+ 14 - 4
pages/me/my-order/my-order.vue

@@ -178,13 +178,16 @@
 		border-top: 1rpx solid #E7E8EA;
 		padding-top: 20rpx;
 	}
-	.content>view{
+
+	.content>view {
 		margin-bottom: 10rpx;
 	}
-	.content>view>text{
+
+	.content>view>text {
 		color: #303134;
 		font-size: 28rpx;
 	}
+
 	.content>view>text:nth-child(2) {
 		float: right;
 	}
@@ -229,7 +232,10 @@
 		overflow: hidden;
 	}
 
-	.triangle,.triangle1,.triangle2,.triangle3 {
+	.triangle,
+	.triangle1,
+	.triangle2,
+	.triangle3 {
 		width: 0px;
 		height: 0px;
 		margin-top: 60rpx;
@@ -238,15 +244,19 @@
 		transform: rotate(270deg);
 		float: right;
 	}
-	.triangle{
+
+	.triangle {
 		border-color: #B89804 #B89804 transparent transparent;
 	}
+
 	.triangle1 {
 		border-color: #960000 #960000 transparent transparent;
 	}
+
 	.triangle2 {
 		border-color: #0F519C #0F519C transparent transparent;
 	}
+
 	.triangle3 {
 		border-color: #01A07D #01A07D transparent transparent;
 	}

+ 82 - 112
pages/msg/System-message/index.vue

@@ -1,18 +1,19 @@
 <template>
 	<!-- 系统消息页面 -->
 	<view class="header">
-		<view class="content" v-for="(item,index) in datalist" @click="inDetails" :key="index">
+		<view class="content" v-for="(item,index) in orderList" @click="inDetails" :key="index">
 			<view class="content-one">
-				<text class="content-one-first">{{item.title}}</text>
+				<text class="content-one-first">{{item.msgTitle}}</text>
 				<text class="content-one-second">{{item.data}}</text>
 			</view>
 			<!-- 中间的虚线 -->
 			<view class="content-two">
 			</view>
-			<view class="content-three">
-				{{item.order}}
-			</view>
-			<view class="content-four">
+
+			<text class="content-three">
+				{{msgContent}}
+			</text>
+			<!-- <view class="content-four">
 				订单编号:{{item.number}}
 			</view>
 			<view class="content-four">
@@ -29,7 +30,7 @@
 			</view>
 			<view class="content-four">
 				零售店地址:{{item.address}}
-			</view>
+			</view> -->
 			<view class="content-five">
 				<text class="content-five-first">查看订单详情</text>
 				<text class="content-five-second">
@@ -37,127 +38,95 @@
 				</text>
 			</view>
 		</view>
-		<view class="header">
-			<view class="content" v-for="(item,index) in goodsList" :key="index">
-				<view class="content-one">
-					<text class="content-one-first">{{item.title}}</text>
-					<text class="content-one-second">11.26</text>
-				</view>
-				<!-- 中间的虚线 -->
-				<view class="content-two">
-				</view>
-				<view class="content-three" style="color:red;">
-					{{item.data}}
-				</view>
-				<view class="content-four-tail">
-					促销商品1(规格):{{item.order1}}
-				</view>
-				<view class="content-four-tail">
-					优惠力度: {{item.order2}}
-				</view>
-				<view class="content-four-tail">
-					促销商品2(规格):{{item.order3}}
-				</view>
-				<view class="content-four-tail">
-					优惠力度: {{item.order3}}
-				</view>
-				<view class="content-four" style="color:#FF651A;">
-					
-					{{item.address}}
-				</view>
-				<view class="content-five">
-					<text class="content-five-first">查看订单详情</text>
-					<text class="content-five-second">
-						<u-icon name="arrow-right"></u-icon>
-					</text>
-				</view>
 
-			</view>
-		</view>
+	</view>
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
-				datalist: [{
-						title: '零售店订单信息',
-						data: '4月22日',
-						order: '您接收到赛轮轮胎市北店的新订单',
-						number: '20202000202202',
-						time: '2020/04/21',
-						amount: '300',
-						name: '曹某',
-						Telephone: '17863993980',
-						address: '山东省青岛市李沧区某某小区某楼'
-					}, {
-						title: '零售店订单信息',
-						data: '4月22日',
-						order: '您接收到赛轮轮胎市北店的新订单',
-						number: '20202000202202',
-						time: '2020/04/21',
-						amount: '300',
-						name: '曹某',
-						Telephone: '17863993980',
-						address: '山东省青岛市李沧区某某小区某楼'
-					},
-					{
-						title: '零售店订单信息',
-						data: '4月22日',
-						order: '您接收到赛轮轮胎市北店的新订单',
-						number: '20202000202202',
-						time: '2020/04/21',
-						amount: '300',
-						name: '曹某',
-						Telephone: '17863993980',
-						address: '山东省青岛市李沧区某某小区某楼'
-					},
-					{
-						title: '零售店订单信息',
-						data: '4月22日',
-						order: '您接收到赛轮轮胎市北店的新订单',
-						number: '20202000202202',
-						time: '2020/04/21',
-						amount: '300',
-						name: '曹某',
-						Telephone: '17863993980',
-						address: '山东省青岛市李沧区某某小区某楼'
-					},
-
-				],
-				goodsList: [
-					{
-						title: '零售店订单信息',
-						data: '赛轮集团针对优质客户提供以下优惠活动,立马抢购吧!',
-						order1: '225/55R17',
-						order2: '每条胎在零售价基础上优惠20元',
-						order3: '225/55R17',
-						order4: '每条胎在零售价基础上优惠20元',
-						address: '库存有限,赶紧去订单促销活动界面抢购吧。'
-					},
-					{
-						title: '零售店订单信息',
-						data: '赛轮集团针对优质客户提供以下优惠活动,立马抢购吧!',
-						order1: '225/55R17',
-						order2: '每条胎在零售价基础上优惠20元',
-						order3: '225/55R17',
-						order4: '每条胎在零售价基础上优惠20元',
-						address: '库存有限,赶紧去订单促销活动界面抢购吧。'
-					},
-				]
+				msgContent: '',
+				orderList: []
 			}
 		},
 
 		onLoad() {
 
 		},
-
+		onLoad(options) {
+			console.log(options.sendUserId)
+			this.sendUserId = options.sendUserId
+		},
+		created() {
+			this.getDate()
+			this.getList()
+		},
 		methods: {
-			inDetails(){
+			// 获取列表
+			getDate() {
+				request({
+						url: '/appMessage/getMessageList',
+						method: 'post',
+						data: {
+							"acceptUserId": '3000',
+							"sendUserId": this.sendUserId,
+							'userId': ''
+
+						}
+					}).then(res => {
+						console.log(res)
+						this.orderList = res.data.list
+						this.msgContent = res.data.list[0].msgContent
+
+
+
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
+			},
+			// 获取消息状态
+			getList() {
+				request({
+						url: '/appMessage/updateMessage',
+						method: 'post',
+						data: {
+							"acceptUserId": '3000',
+							"sendUserId": this.sendUserId,
+							'userId': ''
+			
+						}
+					}).then(res => {
+						console.log(res)
+						
+			
+			
+			
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
+			},
+			inDetails() {
 				this.$u.route({
 					url: 'pages/msg/Order-details/index',
-				})	
+				})
 			}
 		},
 	}
@@ -216,8 +185,9 @@
 	}
 
 	.content-three {
+		display: inline-block;
+		margin-left: 30rpx;
 		color: #aeaeae;
-		margin-left: 20rpx;
 		margin-top: 20rpx;
 		font-size: 24rpx;
 		margin-bottom: 27rpx;

+ 157 - 80
pages/msg/index.vue

@@ -2,26 +2,35 @@
 	<view>
 
 		<view class="u-page">
-			<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in msgList" :key="item.id" @click="click" @content-click="inSystem" @open="open"
-			 :options="options">
-				<view class="item u-border-bottom">
-					<image mode="aspectFill" :src="item.images" />
+			<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in orderList" @click="click(item.sendUserId)"
+			 @content-click="inSystem" @open="open(index)" :options="options">
+				<navigator :url="'./System-message/index?sendUserId='+item.sendUserId"
+				 class="item u-border-bottom">
+					<image mode="aspectFill" src="https://cdn.uviewui.com/uview/common/logo.png" />
 					<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
 					<view class="title-wrap">
-						<text class="title u-line-2">{{ item.title }}</text>
+						<text class="title u-line-2">{{ item.msgTitle }}</text>
 						<view class="title-wrap-one">
-							【{{ item.text }} 】
+							【{{ item.sendUserName }} 】
 						</view>
 					</view>
 					<view class="title-wrap-two">
 						<view>
-							{{ item.time }}
+							{{ item.gatTime|formatDate}}
+							<!-- 12.25 -->
 						</view>
-						<view>
-							{{ item.ip }}
+
+						<view v-if="item.unread===0">
 						</view>
+						<view v-else>
+							<view class="title-wrap-two-one">
+								{{ item.unread }}
+							</view>
+
+						</view>
+
 					</view>
-				</view>
+				</navigator>
 			</u-swipe-action>
 		</view>
 		<!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
@@ -29,92 +38,154 @@
 </template>
 
 <script>
+	import {
+		request
+	} from '../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
-				msgList: [{
-						id: 1,
-						ip: 1,
-						time: '14.23',
-						title: '青岛市市北区赛轮轮胎经销部',
-						text: '订单信息',
-						images: 'https://cdn.uviewui.com/uview/common/logo.png',
-						show: false
-					},
-					{
-						id: 2,
-						ip: 2,
-						time: '17.23',
-						title: '青岛市市北区赛轮轮胎经销部',
-						text: '订单信息',
-						images: 'https://cdn.uviewui.com/uview/common/logo.png',
-						show: false
-					},
-					{
-						id: 3,
-						ip: 3,
-						time: '19.23',
-						title: '青岛市市北区赛轮轮胎经销部',
-						text: '订单信息',
-						images: 'https://cdn.uviewui.com/uview/common/logo.png',
-						show: false,
-					}
-				],
+				currentdate: '',
+				orderList: [],
 				disabled: false,
 				btnWidth: 180,
 				show: false,
 				options: [{
-						text: '收藏',
-						style: {
-							backgroundColor: '#007aff'
-						}
-					},
-					{
-						text: '删除',
-						style: {
-							backgroundColor: '#dd524d'
-						}
+					text: '删除',
+					style: {
+						backgroundColor: '#dd524d'
 					}
-				]
+				}],
 			};
 		},
+		created() {
+
+		},
+		onShow() {
+			this.getDate()
+			// this.addDate()
+		},
+		filters: {
+			formatDate: function(time) {
+				var now = new Date()
+				var year = now.getFullYear();
+				var month = now.getMonth() + 1;
+				var day = now.getDate();
+				if (month < 10) {
+					month = "0" + month;
+				}
+				if (day < 10) {
+					day = "0" + day;
+				}
+				let nowDay = year + "-" + month + "-" + day
+				if (nowDay != time.substring(0, 10)) {
+					return time.substring(0, 10)
+				} else {
+					return time.substring(11, 19)
+				}
+			},
+		},
 		methods: {
+			getDate() {
+				request({
+						url: '/appMessage/getMessageCategory',
+						method: 'post',
+						data: {
+							"acceptUserId": '3000',
+							'userId': ''
+
+						}
+					}).then(res => {
+						console.log(res)
+						this.orderList = res.data.category
+
+						for (let i = 0; i < res.data.data.category.length; i++) {
+							// this.orderList = res.data.data.category[i]
+							this.gatTime = res.data.data.category[i].gatTime
+						}
+
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
+
+			},
 			inSystem(index) {
 				console.log(index)
-				this.$u.route({
-					url: 'pages/msg/System-message/index',
-					
-				})
+				// console.log(index)
+				// this.$u.route({
+				// 	url: 'pages/msg/System-message/index',
+
+				// })
 			},
-					click(index, index1) {
-						if(index1 == 1) {
-							this.msgList.splice(index, 1);
-							this.$u.toast(`删除了第${index}个cell`);
-						} else {
-							this.msgList[index].show = false;
-							this.$u.toast(`收藏成功`);
+			click(index) {
+				console.log(index)
+
+				// this.orderList.splice(index, 1);
+
+				request({
+						url: '/appMessage/deleteMessage',
+						method: 'post',
+						data: {
+							"acceptUserId": '3000',
+							"sendUserId": index,
+							'userId': ''
+
 						}
-					},
-					// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
-					open(index) {
-						// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
-						// 原本为'false',再次设置为'false'会无效
-						this.msgList[index].show = true;
-						this.msgList.map((val, idx) => {
-							if(index != idx) this.msgList[idx].show = false;
-						})
-					}
-				},
-				
+					}).then(res => {
+						this.$u.toast(`删除了第${index}个cell`);
+						this.getDate()
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
+
+
+			},
+			// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
+			open(index) {
+				console.log(index)
+				// console.log(this.orderList[index].show)
+				// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
+				// 原本为'false',再次设置为'false'会无效
+				// this.orderList[index].show = true;
+				console.log(this.orderList[index].show)
+				// this.orderList.map((val, idx) => {
+				// 	console.log(index)
+				// 	console.log(idx)
+					// if (index != idx) this.orderList[index].show = false;
+					this.orderList[index].show = true;
+									this.orderList.map((val, idx) => {
+										if(index != idx) this.orderList[idx].show = false;
+									})
+				// })
+			}
+		},
+
 	};
 </script>
 
 <style lang="scss" scoped>
+		
+	.u-page {
+		margin-bottom: 100rpx;
+	}
+	
 	.item {
 		display: flex;
 		padding: 20rpx;
 	}
-
+	
 	image {
 		width: 120rpx;
 		flex: 0 0 120rpx;
@@ -122,7 +193,7 @@
 		margin-right: 20rpx;
 		border-radius: 12rpx;
 	}
-
+	
 	.title {
 		text-align: left;
 		font-size: 29rpx;
@@ -130,24 +201,30 @@
 		font-weight: bold;
 		margin-top: 20rpx;
 	}
-
+	
+	.title-wrap {
+		width: 280rpx;
+	
+	}
+	
 	.title-wrap-one {
 		margin-top: 10rpx;
 		font-size: 23rpx;
 		color: #999999;
 	}
-
+	
 	.title-wrap-two {
-		margin-left: 120rpx;
+		margin-left: 150rpx;
 		margin-top: 10rpx;
+	
 	}
-
+	
 	.title-wrap-two>view:nth-child(1) {
 		font-size: 19rpx;
 		color: #999999;
 	}
-
-	.title-wrap-two>view:nth-child(2) {
+	
+	.title-wrap-two-one {
 		width: 35rpx;
 		height: 35rpx;
 		background: #FC3228;