serve.vue 2.73 KB
<template>
	<view class="page">
		<view class="screen-list">
			<view class="list">
				<u-input v-model="pageindex.start" type="select" @click="typeShow = true" placeholder='服务记录' />
			</view>
		</view>
		<!-- 记录列表 -->
		<view class="record-list">
			<view class="record-list-box" v-for="(item,index) in recordList" :key="index" @click="recordXq(item)">
				<view class="list">
					<view class="title">
						<view class="left">报修:{{item.warrantyIssue}}</view>
						<view class="right"><u-icon name="arrow-rightward"></u-icon></view>
					</view>
					<view class="info-item">申请时间:{{item.applicationTime}}</view>
					<view class="info-item">状态:<span style="color: #0FBB59;">{{item.status=='1'?'受理中':'已完成'}}</span></view>
				</view>
			</view>
			<view class="record-list-box" v-for="(item,index) in toushu" :key="index" @click="recordXq(item)">
				<view class="list">
					<view class="title">
						<view class="left">投诉:{{item.complaintType}}</view>
						<view class="right"><u-icon name="arrow-rightward"></u-icon></view>
					</view>
					<view class="info-item">申请时间:{{item.applicationTime}}</view>
					<view class="info-item">状态:<span style="color: #0FBB59;">{{item.status=='1'?'受理中':'已完成'}}</span></view>
				</view>
			</view>
		</view>
		<u-select v-model="typeShow" :list="activesType" @confirm="typeChange"></u-select>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				recordList:[
					
				],
				toushu:[],
				pageindex: {
					pageNumber: 0,
					pageSize: 10
				},
				activesType: [
					{
					value: 0,
					label: '投诉记录'
				},{
					value: 1,
					label: '报修记录'
				}
				],
				typeShow:false
			}
		},
		mounted(){
			this.getALL()
		},
		methods: {
			getALL(){
				this.pageindex.createUser =uni.getStorageSync('user').phone
				this.$http.sendRequest('/cereComplaintsSuggestions/queryByPage', 'POST',this.pageindex,1).then(res => {
						this.toushu = res.data.data.content
				}).catch(err => {
					console.log(err)
					//请求失败
				})
			},
			recordXq(item){
				 const encodedItem = encodeURIComponent(JSON.stringify(item));
				uni.navigateTo({
				 url: `/pages/serve/jiDed?item=${encodedItem}`,
				 })
			},
			typeChange(e) {
				
				this.pageindex.start = e[0].labels
				if(e[0].value == 0){
				this.$http.sendRequest('/cereReportIssuesRepairs/queryByPage', 'POST',this.pageindex,1).then(res => {
						this.recordList = res.data.data.content
				})
				}else{
					this.$http.sendRequest('/cereComplaintsSuggestions/queryByPage', 'POST',this.pageindex,1).then(res => {
							this.toushu = res.data.data.content
					})
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	@import 'serve.scss';
</style>