<template>
	<view class="main">
		<view class="top-box view" v-if="managers!=null">
			<view class="time">
				<image style="border-radius: 50%;" :src="managers.avatar" mode="" />
				<view class="margin-left-sm">
					<view class="line" style="margin-bottom: 15rpx;">信用管理师姓名：{{managers.name}}</view>
					<view class="line" style="font-size: 24rpx;margin-bottom: 15rpx;">
						接单时间：{{order.managerorder.start_time||'未接单'}}</view>
					<view class="line" style="font-size: 24rpx;margin-bottom: 15rpx;">
						订单处理天数：{{order.managerorder.end_day||'未接单'}}</view>
					<view class="line" style="font-size: 24rpx;margin-bottom: 15rpx;">
						信用管理师联系电话：{{managers.phone}}</view>
				</view>
			</view>
		</view>
		<view class="top-box view">
			<view class="title">
				<view class="id">订单号：{{ order.order.order_sn == (null||undefined)? '' : order.order.order_sn }}</view>
				<view
					:class="{ status: order.order.order_status_new == 2||order.order.order_status_new == 4, statusTwo: order.order.order_status_new == 1, statusThree: order.order.order_status_new == 5, statusFour: order.order.order_status_new == 3,statusFive:order.order.order_status_new == 6 }">
					<!-- {{status == 1 :待付款, 进行中 : status == 2, 售后中 : status == 3 }} -->
					{{ order.order.order_status_new == 1 ? '待支付' : order.order.order_status_new == 2 ? '待评估' : order.order.order_status_new == 3 ? '待审核' : order.order.order_status_new == 4 ?'已评估': order.order.order_status_new == 5 ?'已完成':'已取消'}}
				</view>
			</view>
			<view class="time">
				<image v-if="order.order.type==2" src="../../static/index/3166d3d1d9b79004291261c7e8357a3.jpg"
					mode="" />
				<image v-if="order.order.type==1" src="../../static/index/47e8bab2b5b68f3fff001bce06e0a11.jpg"
					mode="" />
				<view class="margin-left-sm">
					<view class="line" style="margin-bottom: 15rpx;">征信评估订单</view>
					<view class="line" style="font-size: 24rpx;margin-bottom: 15rpx;">
						项目类型：{{ order.order.type == 1 ? '个人征信异议申诉' : '企业信用问题咨询' }}</view>
					<view class="line" style="font-size: 24rpx;margin-bottom: 15rpx;">
						创建时间：{{ order.order.created_at == (null||undefined)? '' : order.order.created_at  }}</view>
				</view>
				<view class="price"
					v-if="order.order.order_status_new == 1||order.order.order_status_new == 2||order.order.order_status_new == 3||order.order.order_status_new == 6">
					¥{{ order.order.place_payment_amount/100 }}
				</view>
				<view class="price" v-if="order.order.order_status_new == 4||order.order.order_status_new == 5">
					¥{{ order.order.total_price/100 }}
				</view>
			</view>
			<view class="upload">
				<view class="cu-bar bg-white border-bottom">
					<view class="action">{{ order.order.type == 1 ? '个人征信报告上传预览：' : '企业征信报告上传预览：' }}</view>
				</view>
				<view class="cu-form-group">
					<view class="grid col-4 grid-square flex-sub">
						<view class="bg-img" v-for="(item, index) in imgList" :key="index" @tap="ViewImage"
							:data-url="imgList[index]">
							<image :src="imgList[index]" mode="aspectFill"></image>
						</view>
						<view
							v-if="order.order.order_status_new != 4 && order.order.order_status_new != 5 && imgList.length < 100"
							class="solids" @tap="ChooseImage"><text class="cuIcon-cameraadd"></text></view>
					</view>
				</view>
			</view>
			<view class="btns">
				<!--<view class="btn flex align-center justify-between" @click="reportTbales(order.order.credit_image_urls)">
					已经上传图片查看
					<text class="cuIcon-right lg text-gray margin-left-xs"></text>
				</view>-->
				<view class="btn flex align-center justify-between" @click="previewPDF(order.order.report_pdf_url)"
					v-if="order.order.report_pdf_url !=''">
					评估报告PDF查看
					<text class="cuIcon-right lg text-gray margin-left-xs"></text>
				</view>
				<view class="btn flex align-center justify-between" @click="copy(order.order.report_pdf_url)"
					v-if="order.order.report_pdf_url !=''">
					复制PDF网站地址
					<text class="cuIcon-right lg text-gray margin-left-xs"></text>
				</view>
			</view>
			<view class="btns" v-if="order.order.order_status_new == 6">
				<view class="cu-bar bg-white flex align-center justify-end">
					<view class="submit nextbtn" style="background-color: rgb(139,139,139);margin-right: 15rpx;"
						data-target="cancelOrder" @click="againOrder">
						重新评估
					</view>
					<view class="submit nextbtn" style="background-color:rgb(222,132,133);" @click="delOrder">
						删除订单
					</view>
				</view>
			</view>
		</view>
		<view class="view" style="margin-bottom: 0;" v-if="order.order.order_status_new == 1">
			<!-- <rich-text nodes=""></rich-text> -->
			<scroll-view scroll-y="true" style="height: 700rpx;">
				<view class="margin-lr-sm" style="line-height: 70rpx;">
					<view class="" style="width: 100%;text-align: center;">
						声明
					</view>
					<text>{{ configDataList.statement_pay }}</text>
				</view>
			</scroll-view>
			<view class="bg-white">
				<!-- <checkbox-group @change="checkboxChange2">
					<label class="flex align-center justify-center">
						<checkbox :checked="showbtn" style="transform:scale(0.7)" />
						<text class="margin-left-xs text-xs">我已完全阅读《聚联诚集团征信评估支付合同》并同意相关条款</text>
					</label>
				</checkbox-group> -->
				<view class="cu-bar bg-white flex align-center justify-end">
					<view class="submit nextbtn" @click="playphone"
						style="color: rgb(251, 198, 0); background-color: #fff;margin-right: 15rpx;display: flex;align-items: center;justify-content: center;">
						<image src="@/static/index/service.png" mode=""
							style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"></image>
						咨询客服
					</view>
					<view class="submit nextbtn" style="background-color: rgb(139,139,139);margin-right: 15rpx;"
						data-target="cancelOrder" @click="cancelOrder">
						取消订单
					</view>
					<view class="submit nextbtn" @click="submitorder">
						立即支付
					</view>
				</view>
			</view>
		</view>
		<!-- 评估报告 -->
		<!-- <scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="0" v-if="order.assessmentReport&&order.assessmentReport.assessment_info">
			<view class="table" style="width: 100%;">
				<view class="tableContent">
					<view>
						<view class="tbaleTitle">
							<image class="log" style="width: 40px;height: 30px;" src="../../static/mine/log.png" mode="" />
							<text>{{ order.assessmentReport.name }}</text>
							<text>征信异议申述评估报告</text>
						</view>
					</view>
					<view>
						<view class="tableHeade">
							<text class="userName">
								<text style="padding-right: 20px;">姓名：</text>
								<text>{{order.assessmentReport.name == (null||undefined)? '': order.assessmentReport.name}}</text>
							</text>
							<text class="printReportDate">
								<text>打印报告时间：</text>
								<text>{{order.assessmentReport.created_at == (null||undefined)? '': order.assessmentReport.created_at}}</text>
							</text>
						</view>
						<t-table>
							<t-tr>
								<t-th>序号</t-th>
								<t-th>申述类型</t-th>
								<t-th>逾期次数</t-th>
								<t-th>逾期时间</t-th>
								<t-th>预计成功率</t-th>
								<t-th>服务费用</t-th>
								<t-th>备注</t-th>
							</t-tr>
							<t-tr v-for="(item, index) in order_project" :key="index">
								<t-td>{{ index + 1 }}</t-td>
								<t-td>{{ item.appeal_state == (null||undefined)? '': item.appeal_state}}</t-td>
								<t-td>{{ item.overdue_num == (null||undefined)? '': item.overdue_num }}次</t-td>
								<t-td>{{ item.overdue_time_info == (null||undefined)? '': item.overdue_time_info }}</t-td>
								<t-td>{{ item.expect_result == (null||undefined)? '': item.expect_result }}</t-td>
								<t-td>{{ item.price == (null||undefined)? '': item.price }}</t-td>
								<t-td>{{ item.remark == (null||undefined)? '': item.remark }}</t-td>
							</t-tr>
						</t-table>
					</view>
				</view>
			</view>
		</scroll-view> -->
		<view class="info view"
			v-if="order.order.order_status_new ==4&&configDataList.is_show ==1||order.order.order_status_new ==5">
			<!-- <view class="assessResult">
				<text class="info-title">评估结果：</text></br>
				{{ order.assessmentReport.assessment_info == undefined ? '' : order.assessmentReport.assessment_info }}
			</view> -->
			<view class="customerRequire" v-if="order.order.type == 2&&order.assessmentReport!=null">
				<text class="info-title">客户诉求：</text></br>
				{{ order.assessmentReport.user_demand == undefined ? '' : order.assessmentReport.user_demand}}
			</view>
			<view class="suggest" v-if="order.order.type == 2&&order.assessmentReport!=null">
				<text class="info-title">评估师建议：</text></br>
				{{ order.assessmentReport.advise == undefined ? '' : order.assessmentReport.advise}}
			</view>
			<view class="legal">
				<!--<view class="legalTitle">
					第二十五条
				</view>
				<text class="legalContent">信息主体认为征信机构采集、保存、提供的信息存在错误、遗漏的，有权向征信机构或者信息提供者提出异议，要求更正。征信机构或者信息提供者收到异议，应当按照国务院征信业监督管理部门的规定对相关信息作出存在异议的标注，自收到异议之日起
					20日内进行核查和处理，并将结果书面答复异议人。经核查，确认相关信息确有错误、遗漏的，信息提供者、征信机构应当予以更正；确认不存在错误、遗漏的，应当取消异议标注；经核查仍不能确认的，对核查情况和异议内容应当予以记载。</text>
				<view class="legalTitle">
					第二十六条
				</view>
				<text class="legalContent">信息主体认为征信机构或者信息提供者、信息使用者侵害其合法权益的，可以向所在地的国务院征信业监督管理部门派出机构投诉。受理投诉的机构应当及时进行核查和处理，自受理之日起
					30日内书面答复投诉人。信息主体认为征信机构或者信息提供者、信息使用者侵害其合法权益的，可以直接向人民法院起诉。</text>-->
				<text>{{ configDataList.repair_project_clause }}</text>
			</view>
		</view>
		<view class="view"
			v-if="order.order.order_status_new == 4&&order.order_project.length!=0||order.order.order_status_new == 5">
			<wyb-table ref="table" width="100%" :default-col-width="140" :headers="headers" :font-size="[25]"
				:contents="order.order_project" />
		</view>
		<view class="project view"
			v-if="order.order.order_status_new == 4&&order.order_project.length!=0&&orderproject!='0'">
			<view class="projectStatus" v-if="order.order.order_status_new == 4&&order.order_project.length!=0">
				<text>选择项目</text>
				<text class="margin-left-sm text-red text-sm">剩余支付项（{{orderproject}}）</text>
				<view class="projectContent">
					<view class="projectContentItem">
						<checkbox-group @change="checkboxChange">
							<!-- 遍历raido框-->
							<label class="projectItem" v-for="(item, index) in order.order_project" :key="index">
								<!-- 选择框内容 -->
								<view class="item-checkbox" v-if="item.payment_status==1">
									<checkbox :value="item.id+''" :checked="item.payment_status > 1? true:false"
										:disabled="item.payment_status > 1? true:false" />
									<text class="checkbox-content">{{ item.appeal_state }}</text>
								</view>
								<!-- 对应选项的金额 -->
								<view class="item-money" v-if="item.payment_status==1">
									<text class="">{{ item.price }}</text>
								</view>
							</label>
						</checkbox-group>
						<!-- 总金额 -->
						<view class="sum" v-if="order.order.payment_status<3">
							<view class="sumTitle">
								合计：
								<text class="money">¥{{ totalMoney }}</text>
							</view>
						</view>
						<view class="sum" v-else>
							<view class="sumTitle">
								<view class="">
									<text>已付金额（线上）：</text>
									<text class="money">¥{{ order.order.payment_amount }}</text>
								</view>
								<view class="">
									<text>待付尾款（线下）：</text>
									<text
										class="money">¥{{ ((order.order.total_price/100) - order.order.payment_amount).toFixed(2)  }}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="btnAll">
					<!-- <view class="btnItem" @tap="cancelOrder">取消</view> -->
					<!-- <button class="btnItem blueBtn" open-type="contact">去咨询</button> -->
					<view class="btnItem yellowBtn" @click="payBox" v-if="order.order.payment_status<3">去支付</view>
				</view>
			</view>
			<!-- 状态列表 -->
			<!-- <view class="projectContentStatus" v-else>
				<template v-for="(item, index) in order.order_project">
					<view class="statusItem" v-if="item.payment_status!=1" :key="index">
						<view class="bankTitle">{{item.appeal_state}}</view>
						<view v-if="item.process_status==1&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="1">未开始</view>
						<view v-if="item.process_status==2&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="2">已提交资料</view>
						<view v-if="item.process_status==3&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="3">第一轮申诉</view>
						<view v-if="item.process_status==4&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="4">第二轮申诉</view>
						<view v-if="item.process_status==5&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="5">已成功</view>
						<view v-if="item.process_status==6&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="6">已失败</view>
						<view v-if="item.process_status==7&&item.payment_status!=1" class="defaultBtn checkBtn" @click="openProcess(item)"
						 data-target="Modal" data-id="7">已退款</view>
					</view>
				</template>
			</view> -->
		</view>
		<view class="project view" v-if="morders!=null&&morders.status == 2&&morders.is_evaluate==1&&order.order.payment_status==4">
			<view class="text-bold titleStyle">
				修复情况
			</view>
			<view class="margin-top-sm">
				信用管理师已提交审核
			</view>
			<view class="flex justify-end margin-top-sm" v-if="morders.verify_status == 0">
				<view class="submit nextbtn" style="background-color: rgb(139,139,139);margin-right: 15rpx;"
					@click="submitAudit(2)">
					审核不通过
				</view>
				<view class="submit nextbtn" style="background-color:#199A35;" @click="submitAudit(1)">
					审核通过
				</view>
			</view>
			<view class="flex justify-end margin-top-sm" v-if="morders.verify_status == 1&&morders.is_evaluate==1">
				<view class="submit nextbtn" style="background-color: rgb(139,139,139);margin-right: 15rpx;"
					@click="temporarily">
					暂不评价
				</view>
				<view class="submit nextbtn" style="background-color:#E3772D;" @click="DialogModal1 = true">
					评价
				</view>
			</view>
		</view>
		<view class="project view" v-if="morders!=null&&morders.is_evaluate==2">
			<view class="text-bold titleStyle">
				评价
			</view>
			<view class="" v-for="(item,index) in order.evaluate" :key="index">
				<view class="margin-top-sm flex align-center">
					星级评价：<sxRate :value="item.score" activeColor="#BB3720" :disabled="true" :max="5"></sxRate>
				</view>
				<view class="margin-top-xs">
					内容：{{item.content}}
				</view>
			</view>
		</view>
		<!-- 项目详情 -->
		<!-- <view class="cu-modal" :class="modalName == 'process' ? 'show' : ''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">项目进展详情</view>
					<view class="action" @tap="hideModal"><text class="cuIcon-close yellow"></text></view>
				</view>
				<view class="padding-xl">
					<view class="orderNumber">订单号: {{ order.order.order_sn }}</view>
					<view class="stateType">申述类型: {{openProject.appeal_state }}</view>
					<view class="stateType">服务费用: ￥{{ openProject.price }}</view>
					<view class="orderDetails">下单时间: {{ openProject.created_at }}</view>

					<view class="uni-steps">
						<view class="uni-steps__column">

							<view class="uni-steps__column-text-container">
								<view v-for="(item,index) in (openProject.process_status <= 5 ? process_status:process_status_two)" :key="index"
								 :class="['uni-steps__column-text']">
									<text :style="{color:item.id<=openProject.process_status? activeColor:deactiveColor}" :class="['uni-steps__column-title']">{{item.name}}</text>
								</view>
							</view>

							<view :class="['uni-steps__column-container']">
								<view v-for="(item,index) in (openProject.process_status <= 5 ? process_status:process_status_two)" :class="['uni-steps__column-line-item']"
								 :key="index">
									<view :class="['uni-steps__column-line','uni-steps__column-line--before']" :style="{backgroundColor:item.id<=openProject.process_status&&index!==0?activeColor:index===0?'transparent':deactiveColor}"></view>
									<view :class="['uni-steps__column-check']" v-if="(item.id==openProject.process_status)||(item.id<openProject.process_status)">
										<uni-icons :color="activeColor" type="checkbox-filled" size="14" v-if="(item.id==openProject.process_status)||(item.id<openProject.process_status)"></uni-icons>
										<uni-icons type="circle" size="14" v-else></uni-icons>
									</view>
									<view :class="['uni-steps__column-check']" v-else :style="{backgroundColor:item.id<openProject.process_status?activeColor:deactiveColor}">
										<uni-icons type="circle" size="14" style="background: #f8f8f8; color: #999999;"></uni-icons>
									</view>
									<view :class="['uni-steps__column-line',{'uni-steps__column-line--after':item.name != '已成功'}]" :style="{backgroundColor:item.id<openProject.process_status&&index!==process_status.length?activeColor:index===process_status.length?'transparent':deactiveColor}"></view>
								</view>
							</view>
						</view>
					</view>
					<view class="processBtn">
						<button class="default refundBtns" data-target="applyRefund" @click="applyRefund(openProject.sale_days)" v-if="openProject.sale_days<90">申请退款</button>
						<button open-type="contact" @contact="handleContact" class="default refundBtns" v-else>申请退款</button>
					</view>
				</view>
			</view>
		</view> -->
		<!-- 申请退款弹出框 -->
		<view class="cu-modal" :class="modalName == 'applyRefund' ? 'show' : ''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">提示</view>
					<view class="action" @tap="hideModal"><text class="cuIcon-close yellow" /></view>
				</view>
				<view class="padding-xl">根据协议，90天后才能申请退款</view>
			</view>
		</view>
		<!-- 信用修复协议 -->
		<view class="cu-modal" :class="modalName == 'pay' ? 'show' : ''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">信用修复协议</view>
					<view class="action" @tap="hideModal"><text class="cuIcon-close yellow" /></view>
				</view>
				<view class="padding-xl"><text style="text-align:left">{{configDataList.repair_agreement}}</text></view>
				<view class="cu-bar bg-white">
					<view class="action margin-0 flex-sub yellow solid-left" @tap="hideModal">取消</view>
					<view class="action margin-0 flex-sub  solid-left" @tap="pay">确定</view>
				</view>
			</view>
		</view>
		<!-- 取消订单 -->
		<view class="cu-modal" :class="modalName == 'cancelOrder' ? 'show' : ''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">订单提示</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close yellow" />
					</view>
				</view>
				<view class="padding-xl">确定取消订单吗？</view>
				<view class="cu-bar bg-white">
					<view class="action margin-0 flex-sub yellow solid-left" @tap="hideModal">取消</view>
					<view class="action margin-0 flex-sub  solid-left" @tap="cancelOrderOk">确定</view>
				</view>
			</view>
		</view>
		<!-- 是否支付 -->
		<view class="cu-modal" :class="modalName == 'ispay' ? 'show' : ''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">订单提示</view>
					<!-- <view class="action" @tap="hideModal">
						<text class="cuIcon-close yellow" />
					</view> -->
				</view>
				<view class="padding-xl">是否完成支付?</view>
				<view class="cu-bar bg-white">
					<!-- <view class="action margin-0 flex-sub yellow solid-left" @tap="hideModal">取消</view> -->
					<view class="action margin-0 flex-sub  solid-left" @tap="ispaytrue">已经完成支付</view>
				</view>
			</view>
		</view>
		<view class="cu-modal" :class="DialogModal1?'show':''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">用户评价</view>
					<view class="action" @tap="DialogModal1 = false">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<view class="padding-xl">
					<view class="flex">
						<text>星级评价：</text>
						<sxRate :value="rateScore" activeColor="#BB3720" @change="seleRate" :max="5"></sxRate>
					</view>
					<view class="cu-form-group margin-top">
						<textarea style="text-align: left;" maxlength="-1" @input="textareaAInput"
							placeholder="请输入评价内容"></textarea>
					</view>
				</view>
				<view class="cu-bar bg-white justify-end">
					<view class="action">
						<button class="cu-btn line-green text-green" @tap="DialogModal1 = false">取消</button>
						<button class="cu-btn bg-green margin-left" @tap="evaluation">确定</button>

					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import sxRate from '@/components/sx-rate/index.vue'
	import wybTable from '@/components/wyb-table/wyb-table.vue'
	import tTable from '@/components/t-table/t-table.vue';
	import tTh from '@/components/t-table/t-th.vue';
	import tTr from '@/components/t-table/t-tr.vue';
	import tTd from '@/components/t-table/t-td.vue';
	import uniSteps from '@/components/uni-steps/uni-steps.vue';
	import uniIcons from '@/components/uni-icons/uni-icons.vue'
	import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js'
	export default {
		components: {
			tTable,
			tTh,
			tTr,
			tTd,
			uniIcons,
			uniSteps,
			wybTable,
			sxRate
		},
		computed: {
			totalMoney() {
				let a = 0;
				if (this.order.order_project) {
					for (let b of this.order.order_project) {
						if (this.order_project_ids.indexOf(b.id + '') >= 0) {
							a += b.price;
						}
					}
				}
				return a;
			},
			orderproject() {
				let arr = []
				this.order.order_project.forEach(item => {
					if (item.payment_status == 1) {
						arr.push(item)
					}
				})
				console.log(arr)
				return arr.length
			}

		},
		data() {
			return {
				imgList: [],
				showbtn: false,
				old: {
					scrollTop: 0
				},
				configDataList: [], // 全局配置文件
				activeColor: '#f5cc57',
				deactiveColor: '#999999',
				order: {
					order: {
						real_price: '',
						payment_amount: ''
					}
				},
				modalName: "",
				id: '',
				gonggao: false,
				order_project_ids: [],
				openProject: {},
				payment_status: '',
				status: "",
				headers: [{
					label: '管理机构',
					key: 'appeal_state'
				}, {
					label: '逾期次数',
					key: 'overdue_num'
				}, {
					label: '总金额',
					key: 'price'
				}, {
					label: '支付状态',
					key: 'payment_status_text'
				}, {
					label: '流程状态',
					key: 'process_status_text'
				}, {
					label: '账户类型',
					key: 'account_type_text'
				}, {
					label: '状态异常修复费用',
					key: 'account_status_price_text'
				}, {
					label: '五级分类修复费用',
					key: 'five_categories_price_text'
				}, {
					label: '服务费用',
					key: 'service_price_text'
				}],
				order_sn_num: "",
				morders: {},
				managers: {},
				DialogModal1: false,
				textContent: '',
				rateScore: 1
			};
		},
		async onLoad(option) {
			this.id = option.id;
			this.payment_status = option.payment_status
		},
		mounted() {
			this.configData()
		},
		onShow() {
			// this.$request.post("/api/payment/getWebPayResult", {
			// 	trade_sn: res.data.trade_sn
			// }).then(data => {
			// 	console.log(data)
			// 	if (data.code == 200) {
			// 		window.location.href = "https://t25.9026.com/miniprogram/index.html"
			// 	}
			// }).catch(err => {
			// 	console.log(err)
			// })
			this.getdatalist()
		},
		methods: {
			playphone() {
				uni.makePhoneCall({
					phoneNumber: this.configDataList.phone
				})
			},
			getdatalist: async function() {
				let res = await this.$request.post('/api/order/orderDetail', {
					order_id: this.id,
					project_is_pay: 0 // 全部获取 前端控制
				}, true);
				if (res.code === 200) {
					this.order = res.data;
					console.log(this.order, ">>>>>>>>>>>>>>>>>>>")
					this.morders = res.data.order.morders
					this.managers = res.data.order.managers
					this.imgList = this.order.credit_image_urls
				} else {
					uni.showModal({
						title: '错误信息',
						content: res.message,
						showCancel: false
					});
				}
			},
			againOrder() {
				uni.showModal({
					title: "提示",
					content: "是否重新提交评估?",
					success: (res) => {
						if (res.confirm) {
							this.$request.post("/api/order/orderHandle", {
								order_id: this.order.order.id,
								handle_type: 1
							}).then(data => {
								if (data.code == 200) {
									uni.navigateBack({
										delta: 1
									})
								}
							}).catch(err => {

							})
						}
					}
				})
			},
			delOrder() {
				uni.showModal({
					title: "提示",
					content: "你确定要删除吗?",
					success: (res) => {
						if (res.confirm) {
							this.$request.post("/api/order/orderHandle", {
								order_id: this.order.order.id,
								handle_type: 2
							}).then(data => {
								if (data.code == 200) {
									uni.navigateBack({
										delta: 1
									})
								}
							}).catch(err => {})
						}
					}
				})
			},
			checkboxChange2(e) {
				this.show = !this.show
				console.log(this.show)
			},
			async ispaytrue() {
				this.modalName = ''
				let res = await this.$request.post("/api/payment/getWebPayResult", {
					trade_sn: this.order_sn_num
				}, false)
				if (res.code == 200) {
					uni.redirectTo({
						url: "paysource?id=" + this.id + "&payment_status=" + this.order.order.payment_status
					})
				} else {
					uni.showToast({
						title: "支付失败",
						icon: "none",
						duration: 1000
					})
					setTimeout(() => {
						uni.navigateBack({
							delta: 1
						})
					}, 1000)
				}
			},
			async submitorder() {
				// if (!this.show) {
				// 	uni.showToast({
				// 		title: "请先同意协议",
				// 		icon: "none"
				// 	})
				// 	return false
				// }
				if (this.$util.is_weixin()) {
					let res = await this.$request.post('/api/payment/payPlaceOrder', {
						order_id: this.order.order.id,
						plat_type: 1
					}, true);
					if (res.code == 200) {
						this.modalName = 'ispay'
						this.order_sn_num = res.data.trade_sn
						if (typeof WeixinJSBridge == "undefined") {
							if (document.addEventListener) {
								document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady, false);
							} else if (document.attachEvent) {
								document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady);
								document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady);
							}
						} else {
							this.onBridgeReady(res)
						}
					} else {
						uni.showModal({
							title: '错误信息',
							content: res.message,
							showCancel: false
						});
					}
				} else {
					let res = await this.$request.post("/api/payment/wbePayPlaceOrder", {
						order_id: this.order.order.id
					})

					if (res.code == 200) {
						this.modalName = 'ispay'
						this.order_sn_num = res.data.trade_sn
						window.location.href = res.data.mweb_url
					}
				}
			},
			copy(content) {
				const result = h5Copy(content)
				if (result === false) {
					uni.showToast({
						title: '复制失败',
						icon: "none"
					})
				} else {
					uni.showToast({
						title: '复制成功',
						icon: 'none'
					})
				}
			},
			configData: async function() {
				let res = await this.$request.post('/api/SystemConfig/getSysteConfig');
				console.log(res);
				if (res.code == 200) {
					this.configDataList = res.data
				} else {
					uni.showToast({
						title: '错误信息',
						content: res.message,
						showCancel: false
					})
				}
			},
			openProcess: function(item) {
				console.log(item)
				this.openProject = item;
				this.modalName = 'process';
			},
			checkboxChange: function(e) {
				this.order_project_ids = e.detail.value;
			},
			cancelOrder: function() {
				this.modalName = 'cancelOrder'
				console.log(this.modalName)
			},
			cancelOrderOk: async function() {
				let res = await this.$request.post('/api/order/cancelOrder', {
					order_id: this.id
				});
				if (res.code == 200) {
					this.hideModal();
					uni.showToast({
						title: '订单取消成功',
						icon: "none",
						duration: 1000
					})
					setTimeout(() => {
						uni.navigateBack({
							delta: 1
						})
					}, 1000)
				} else {
					uni.showToast({
						title: res.message,
						showCancel: false
					})
				}
			},
			async submitAudit(verify_status) {
				let res = await this.$request.post("api/order/managerOrderVerify", {
					id: this.morders.id,
					verify_status: verify_status
				})
				if (res.code == 200) {
					this.morders.verify_status = verify_status
				}
			},
			async previewPDF(pdfurl) {
				uni.navigateTo({
					url: "preview?url=" + pdfurl
				})
				let res = await this.$request.post('/api/order/readPdf', {
					order_id: this.id,
				}, true);
			},
			//关闭公告框
			close() {
				this.gonggao = false;
			},
			//打开公告栏
			showgg(e, index) {
				this.modalName = e.currentTarget.dataset.target;
				this.id = e.currentTarget.dataset.id;
			},
			//滚动时触发
			scroll(e) {
				this.old.scrollTop = e.detail.scrollTop
			},
			payBox() {
				console.log(this.order.order)
				this.modalName = 'pay'
			},
			temporarily() {
				uni.navigateBack()
			},
			async evaluation() {
				if (this.textContent == '') {
					this.DialogModal1 = false
					uni.showToast({
						title: "请输入评价内容",
						icon: "none"
					})
					return false
				}
				let res = await this.$request.post('api/order/orderEvaluate', {
					order_id: this.morders.id,
					content: this.textContent,
					score: this.rateScore
				})
				if (res.code == 200) {
					this.DialogModal1 = false
					this.morders.is_evaluate = 2
				}
			},
			textareaAInput(e) {
				this.textContent = e.detail.value
			},
			seleRate(e) {
				this.rateScore = e
			},
			onBridgeReady: function(res) {
				WeixinJSBridge.invoke(
					'getBrandWCPayRequest', {
						"appId": res.data.appId,
						"timeStamp": res.data.timeStamp,
						"nonceStr": res.data.nonceStr,
						"package": res.data.package,
						"signType": res.data.signType,
						"paySign": res.data.paySign
					},
					function(re) {
						if (re.err_msg == "get_brand_wcpay_request:ok") {
							uni.navigateTo({
								url: "paysource?id=" + this.id + "&payment_status=" + this.order.order
									.payment_status
							})
						}
					});
			},
			pay: async function(order) {
				this.hideModal();
				var me = this;
				console.log(this.order_project_ids, 'ids')
				let param = {
					order_id: this.id,
					order_project_ids: JSON.stringify(this.order_project_ids),
					plat_type: 1
				};
				if (this.$util.is_weixin()) {
					let res = await this.$request.post('/api/payment/payOrder', param, true);
					console.log(res, '支付')
					if (res.code == 200) {
						this.modalName = 'ispay'
						this.order_sn_num = res.data.trade_sn
						if (typeof WeixinJSBridge == "undefined") {
							if (document.addEventListener) {
								document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady, false);
							} else if (document.attachEvent) {
								document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady);
								document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady);
							}
						} else {
							this.onBridgeReady(res)
						}
					} else {
						uni.showModal({
							title: '错误信息',
							content: res.message,
							showCancel: false
						});
					}
				} else {
					let res = await this.$request.post("/api/payment/webPayOrder", {
						order_id: this.id,
						order_project_ids: JSON.stringify(this.order_project_ids)
					})
					if (res.code == 200) {
						this.modalName = 'ispay'
						this.order_sn_num = res.data.trade_sn
						window.location.href = res.data.mweb_url
					}
				}
			},
			ViewImage(e) {
				uni.previewImage({
					urls: this.imgList,
					current: e.currentTarget.dataset.url
				});
			},
			ChooseImage() {
				let me = this;
				uni.chooseImage({
					count: 100, //默认9
					sizeType: ['original'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: async function(res) {
						let data = await me.$request.upload('/api/common/uploadImg', res.tempFilePaths[0], {});
						if (data.code != 200) {
							uni.showModal({
								title: '错误信息',
								content: data.message,
								showCancel: false
							});
							return;
						}
						let imgUrl = data.data.file_url
						let resOrder = await me.$request.post('/api/order/updateOrder', {
							order_id: me.order.order.id,
							credit_image_urls: JSON.stringify([imgUrl])
						}, false);
						if (resOrder.code != 200) {
							uni.showModal({
								title: '错误信息',
								content: resOrder.message,
								showCancel: false
							});
							return;
						}
						me.imgList = resOrder.data.credit_image_urls;
					}
				});
			},
			// 点击查看征信报告
			reportTbales(urls) {
				uni.previewImage({
					urls: urls //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
				});
			},
			// 点击查看征信报告
			reportTbale(url) {
				uni.previewImage({
					urls: [url] //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
				});
			},
			hideModal(e) {
				this.modalName = null;
			},
			// 申请退款
			applyRefund(sale_days) {
				console.log(sale_days)
				if (sale_days < 90) {
					this.modalName = 'applyRefund'
				} else {

				}
				// console.log('申请退k');
				// this.modalName = e.currentTarget.dataset.target;
			}

		}
	};
</script>

<style>
	page {
		background: #f5f5f5;
	}

	.titleStyle {
		display: flex;
		/* justify-content: center; */
		align-items: center;
	}

	.titleStyle::before {
		content: '';
		width: 6rpx;
		height: 40rpx;
		background: #000;
		display: inline-block;
		margin-right: 10rpx;
	}

	.main {
		width: 90vw;
		padding: 5vw;
		height: auto;
		/* margin-bottom: 20px; */
	}

	.nextbtn {
		background-color: rgb(251, 198, 0);
		color: #fff;
		width: 200rpx;
		/* padding: 20rpx; */
		font-size: 24rpx;
		height: 48rpx;
		text-align: center;
		border-radius: 50rpx;
		line-height: 48rpx;
	}

	.main .view {
		width: 90vw;
		height: auto;
		background: #fff;
		border-radius: 8px;
		padding: 14px;
		font-size: 14px;
		color: #8c8e96;
		margin-bottom: 5vw;
	}

	.top-box .title {
		width: 100%;
		height: 40px;
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #eee;
	}

	.top-box .time {
		width: 100%;
		/* line-height: 30px; */
		display: flex;
		/* justify-content: space-between; */
		align-items: center;
		padding: 10px 0;
		border-bottom: 1px solid #eee;
	}

	.time image {
		width: 70px;
		height: 70px;
		background: #eee;
	}

	.time .price {
		position: absolute;
		right: 40rpx;
		/* top: 152rpx; */
		width: auto;
		height: 30px;
		line-height: 30px;
		padding: 0 10px;
		color: #ed462f;
	}

	.top-box .btns {
		width: 100%;
		/* height: 44px; */
	}

	.btns .btn {
		width: auto;
		height: 80rpx;
		/* line-height: 30px; */
		/* margin: 7px 10px; */
		padding: 7px 10px;
		/* border: 1px solid #f5cc57; */
		/* color: #f5cc57; */
		/* float: right; */
		border-radius: 5px;
		border-bottom: 1px solid #eee;
	}

	.scroll-view_H {
		width: 90vw;
		height: auto;
		background: #fff;
		border-radius: 8px;
		padding: 14px;
		font-size: 14px;
		color: #8c8e96;
		margin-bottom: 5vw;
	}

	.table .tableContent {
		width: 700px;
	}

	.table .tbaleTitle {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		color: #f5cc57;
	}

	.table .tbaleTitle .log {
		width: 6.4vw;
		height: 4.8vh;
	}

	.table .tbaleTitle>text {
		padding-left: 10px;
	}

	.table .tableHeade {
		display: flex;
		height: 30px;
		background: #f5cc57;
		color: #ffffff;
		justify-content: space-around;
		align-items: center;
	}

	.info .info-title {
		font-size: 30rpx;
		color: #555864;
		font-family: PingFangSC-Regular, sans-serif;
	}

	.info .assessResult,
	.customerRequire,
	.suggest {
		border-bottom: 1px solid #d8d8d8;
		padding: 10px 0;
		word-wrap: break-word;
		word-break: normal;
	}

	.legal .legalTitle {
		font-size: 30rpx;
		margin-top: 15px;
		text-align: center;
	}

	.legal .legalContent {
		text-align: left;
	}

	.project .projectContent {
		border-bottom: 1px solid #d8d8d8;
	}

	.project .projectContent .projectItem {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 15px 0;
	}

	.projectItem .checkbox-content {
		padding-left: 10px;
	}

	.sum {
		text-align: right;
		padding-bottom: 10px;
		/* padding-right: 20px; */
	}

	.sum .money {
		color: red;
	}

	.btnAll {
		display: flex;
		justify-content: flex-end;
	}

	.btnItem {
		/* width: 110rpx; */
		height: 50rpx;
		line-height: 50rpx;
		text-align: center;
		color: #979797;
		font-size: 24rpx;
		border: 1px solid #979797;
		border-radius: 5px;
		margin: 15px 10px;
		padding: 0 5px;
	}

	.blueBtn {
		border: 1px solid #00a3dd !important;
		color: #00a3dd !important;
		background: #ffffff;
	}

	.blueBtn::after {
		border: none;
	}

	.yellowBtn {
		border: 1px solid #f5cc57 !important;
		background-color: #f5cc57;
		color: #fff !important;
		width: 200rpx !important;
		border-radius: 100rpx !important;
	}

	.projectContentStatus .statusItem {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 5vh;
		margin: 5px 0;
	}

	.defaultBtn {
		width: 123px;
		text-align: center;
		line-height: 30px;
		border: 1px solid #979797;
		color: #979797;
		border-radius: 5px;
		margin: 15px 10px;
		padding: 0 5px;
	}

	.checkBtn {
		border: 1px solid #ed462f;
		color: #ed462f;
	}

	.successBtn {
		border: 1px solid #f5cc57;
		color: #f5cc57;
	}

	.refundBtn {
		width: 123px;
		height: 30px;
		line-height: 30px;
		color: #979797;
		border: 1px solid #979797;
		border-radius: 5px;
		padding: 5px;
	}

	.refundBtns {
		display: inline-block;
		width: 65px;
		height: 26px;
		line-height: 25px;
		text-align: center;
		font-size: 23rpx;
		color: #979797;
		border: 1px solid #979797;
		border-radius: 5px;
		padding: 5px;
		background: #ffffff;
		padding: 0;
		margin: 0;
	}

	.refundBtns::after {
		border: none;
	}

	.btnItem {
		width: 110rpx;
		height: 50rpx;
		line-height: 50rpx;
		text-align: center;
		color: #979797;
		font-size: 24rpx;
		border: 1px solid #979797;
		border-radius: 5px;
		margin: 15px 10px;
		padding: 0 5px;
	}

	/* 状态颜色 */
	.status {
		color: #f5cc57;
	}

	.statusTwo {
		color: #ed462f;
	}

	.statusThree {
		color: #00b563;
	}

	.statusFour {
		color: #00a3dd;
	}

	/* 弹出公告框样式 */
	.bg {
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, 0.3);
		position: fixed;
		top: 0;
		left: 0;
	}

	.bg .gonggaobox {
		width: calc(90vw - 30px);
		height: auto;
		padding: 15px;
		background: #fff;
		border-radius: 8px;
		margin: 20% 5vw;
	}

	.gonggaobox .title {
		width: 100%;
		height: 50px;
		line-height: 50px;
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #eee;
	}

	.title .name1 {
		width: 60%;
		height: 50px;
		text-align: center;
		color: #555864;
	}

	.title .close {
		width: 20%;
		height: 50px;
		text-align: center;
		color: #f5cc57;
	}

	.gonggaobox .txt {
		padding: 15px;
		text-indent: 20px;
		color: #555864;
	}

	.orderNumber,
	.stateType,
	.orderDetails {
		text-align: left;
		color: #8c8e96;
		font-size: 14px;
	}

	.processBtn {
		margin-top: 10px;
		text-align: right;
	}

	.yellow {
		color: #f5cc57;
	}

	/* 复选框颜色 */
	checkbox .wx-checkbox-input.wx-checkbox-input-checked {
		color: #fff !important;
		background: #f5cc57 !important;
		border: 1px solid #f5cc57 !important;
	}





	.uni-steps {
		/* #ifndef APP-NVUE */
		display: flex;
		width: 100%;
		/* #endif */
		/* #ifdef APP-NVUE */
		flex: 1;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__row {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__column {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row-reverse;
	}

	.uni-steps__row-text-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	.uni-steps__column-text-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		flex: 1;
	}

	.uni-steps__row-text {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		flex: 1;
		flex-direction: column;
	}

	.uni-steps__column-text {
		padding: 6px 0px;
		/* 		border-bottom-style: solid;
		border-bottom-width: 1px; */
		border-bottom-color: $uni-border-color;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__row-title {
		font-size: $uni-font-size-base;
		line-height: 16px;
		text-align: center;
	}

	.uni-steps__column-title {
		font-size: $uni-font-size-base;
		text-align: left;
		line-height: 18px;
		font-family: PingFangSC-Regular, sans-serif;
	}

	.uni-steps__row-desc {
		font-size: 12px;
		line-height: 14px;
		text-align: center;
	}

	.uni-steps__column-desc {
		font-size: $uni-font-size-sm;
		text-align: left;
		line-height: 18px;
	}

	.uni-steps__row-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	.uni-steps__column-container {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		width: 30px;
		flex-direction: column;
	}

	.uni-steps__row-line-item {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		flex-direction: row;
		flex: 1;
		height: 14px;
		line-height: 14px;
		align-items: center;
		justify-content: center;
	}

	.uni-steps__column-line-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		flex: 1;
		align-items: center;
		justify-content: center;
	}

	.uni-steps__row-line {
		flex: 1;
		height: 1px;
		background-color: $uni-text-color-grey;
	}

	.uni-steps__column-line {
		width: 1px;
		background-color: $uni-text-color-grey;
	}

	.uni-steps__row-line--after {
		transform: translateX(1px);
	}

	.uni-steps__column-line--after {
		flex: 1;
		transform: translate(0px, 1px);
	}

	.uni-steps__row-line--before {
		transform: translateX(-1px);
	}

	.uni-steps__column-line--before {
		height: 6px;
		transform: translate(0px, -1px);
	}

	.uni-steps__row-circle {
		width: 5px;
		height: 5px;
		border-radius: 100px;
		background-color: $uni-text-color-grey;
		margin: 0px 3px;
	}

	.uni-steps__column-circle {
		width: 5px;
		height: 5px;
		border-radius: 100px;
		background-color: $uni-text-color-grey;
		margin: 4px 0px 5px 0px;
	}

	.uni-steps__row-check {
		margin: 0px 6px;
	}

	.uni-steps__column-check {
		height: 14px;
		line-height: 14px;
		margin: 2px 0px;
	}

	.upload {
		background: #fff;
		margin: 0;
	}
</style>
