<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.orderNumber}}</text>
								<image src="../../static/right1.png"></image>
							</view>
							<view class="status">
								<text>待评价</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">
							<view></view>
							<view class="btn" @click="mydeathdetail(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,
					},
				},
				info:{
					pageNum:1,
					pageSize:10,
					userId:"",
				},
				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.getinfo();
		},
		methods: {
			mydeathdetail(item) {
				var info = JSON.stringify(item)
				uni.navigateTo({
					url: '/pages/mydeathdetail/mydeathdetail?info=' + info
				})
			},
			getinfo(){
				this.info.userId = uni.getStorageSync("USERS_KEY").userId
				console.log("user",uni.getStorageSync("USERS_KEY"));
				this.API.getwsyy(this.info).then(res=>{
					console.log("获取网上报丧信息",res);
					for(let i = 0;i < res.rows.length;i++){
						this.list.push(res.rows[i])
					}
				})
			},
		}
	}
</script>

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