<template>
	<view class="page">
		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
		<view class="content">
		<!-- 订单列表 -->
		<view class="order-list">
			<view class="list" v-for="(item,index) in list" @click="onOrderList" :key="index">
				<view class="title-status">
					<view class="title">
						<text>逝者编号：{{item.funeralNumber}}</text>
						<image src="../../static/right1.png"></image>
					</view>
					<view class="status">
						<text v-if="item.status=='0'">待评价</text>
						<text v-else>已评价</text>
					</view>
				</view>
				<view class="goods-list">
					<view class="goods">
						<view class="item">
							<view class="goods-name">
								<view class="goods-name-title">逝者姓名：{{item.deceasedName}}</view>
								<view>创建时间：{{item.createdTime}}</view>
							</view>
						</view>
					</view>
				</view>
				<view class="status-btn" v-if="item.status=='0'">
					<view><text class="red"></text><text class="red big"></text></view>
					<view class="btn" @click="tz(item)">
						<image src="../../static/btn.png" mode="widthFix"></image>
						<text>去评价</text>
					</view>
				</view>
			</view>
		</view>
		</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				OrderType: 0,
				nvConfig:{
					title:"服务评价",
					bgColor:"#ffffff",
					color:"#000000",
					fixedAssist:{
						hide:true,
					},
				},
				list:[],
			};
		},
		onPageScroll(e) {this.$refs.nv.pageScroll(e)},
		computed:{
			pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
		},
		onLoad(params) {
			this.OrderType = params.type;
			// this.getfwlist();
			this.getfwlist1();
		},
		methods:{
			// 跳转
			tz(item){
				var info = JSON.stringify(item);
				uni.navigateTo({
					url:'/pages/myevaluatedetail/myevaluatedetail?info=' + info
				})
			},
			// 获取服务列表
			getfwlist(){
				this.API.getwsyy().then(res1=>{
					console.log("获取详细报丧信息",res1);
					this.list = res1.rows
				})
				// myevaluatedetail
			},
			// 获取评价列表
			getfwlist1(){
				var info = {
					userId:uni.getStorageSync("USERS_KEY").userId
				}
				this.API.getfwlist1(info).then(res=>{
					console.log("获取服务评价",res);
					this.list = res.data
				})
			},
			/**
			 * 返回点击
			 */
			onBack(){
				uni.navigateBack();
			},
			/**
			 * 订单tab点击
			 */
			onOrderTab(type){
				this.OrderType = type;
				// #ifdef H5
				uni.redirectTo({
					url: '/pages/MyOrderList/MyOrderList?type=' + type,
				})
				//#endif
			},
			/**
			 * 订单列表点击
			 */
			onOrderList(){
				uni.navigateTo({
					url: '/pages/OrderDetails/OrderDetails',
				})
			},
      /**
       * 评价点击
       */
      onEvaluate(){
			  uni.navigateTo({
          url: '/pages/MyEvaluatePush/MyEvaluatePush'
        })
      }
		}
	}
</script>

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