<template>
  <view class="main">
	<view class="order_nav">
		<view class="order_nav_item" v-for="(item,index) in tab" :key="index" :class="active == index?'order_nav_active':''" @click="clickOrder(index)">
			<view class="order_nav_name">{{item}}</view>
			<view class="order_nav_m"></view>
		</view>
	</view>
	
	<view class="cont">
		<view class="cont_title">下单时间: 2025/03/06 18:00</view>
		<view class="cont_shop" @click="editEval()">
			<view class="cont_shop_l">
				<view class="cont_shop_img">
					<image class="cont_shop_imgUrl" src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_shop_title">泡椒田鸡</view>
			</view>
			<view class="cont_shop_r" v-if="active == 0" >去评价</view>
		</view>
		<block v-if="active == 1">
			<view class="cont_goos"><image class="cont_goos_img" src="../../static/eval/good.png" mode="widthFix"></image>好评</view>
			<view class="cont_text"><text>味道很鲜美，分量很足，价格实惠</text></view>
			<view class="cont_ul">
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
			</view>
		</block>
	</view>
	
	<view class="cont">
		<view class="cont_title">下单时间: 2025/03/06 18:00</view>
		<view class="cont_shop" @click="editEval()">
			<view class="cont_shop_l">
				<view class="cont_shop_img">
					<image class="cont_shop_imgUrl" src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_shop_title">泡椒田鸡</view>
			</view>
			<view class="cont_shop_r" v-if="active == 0" >去评价</view>
		</view>
		<block v-if="active == 1">
			<view class="cont_goos"><image class="cont_goos_img" src="../../static/eval/negative.png" mode="widthFix"></image>差评</view>
			<view class="cont_text"><text>味道很鲜美，分量很足，价格实惠</text></view>
			<view class="cont_ul">
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
				<view class="cont_li">
					<image src="../../static/Mask.png" mode="widthFix"></image>
				</view>
			</view>
		</block>
	</view>
	
	
	
	
  </view>
</template>

<script setup>
import { computed,ref,onMounted,onUnmounted,getCurrentInstance,nextTick } from 'vue';
import { useCounterStore } from '@/store/counter'; // 引入 Pinia Store
import { storeToRefs } from 'pinia';//实现解构付值
import { onLoad,onShow,onPullDownRefresh,onPageScroll,onReachBottom,onReady } from "@dcloudio/uni-app"
const counterStore = useCounterStore(); // 使用 Store
const { proxy } = getCurrentInstance();
//使用pinia：storeToRefs方法包裹(保持响应式更新，不使用视图无法更新)
const {statusHeight,headerHeight,statusBartop } = storeToRefs(counterStore);
const tab = ref(['待评价','已评价']);
const active = ref(0);
const clickOrder=(index)=>{
	if(index == active.value) return false;
	active.value = index;
};
const editEval=()=>{
	if(active.value != 0) return false;
	uni.navigateTo({
		url:`/order/editeval/editeval`
	})
};
onLoad((options) => {
	const { type } = options;
	if(type == 0 || type == 1){active.value = type;}
});
onShow(() => {});
onReady(()=>{})
onPullDownRefresh(()=>{})
onReachBottom(()=>{})
</script>

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