<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
<van-dialog id="van-dialog" />
<loading wx:if="{{loading}}"></loading>
<view wx:if="{{loadFlag}}">
	<!--公司信息-->
	<view class="detail-top" data-item="{{item}}" bind:tap="toDetail">
		<image class="scan-image" fit="fill" src="{{imageUrl+'/detail_sale_order.png'}}"></image>
		<view style="display: flex;margin:20rpx 20rpx">
			<!-- 头像 -->
			<open-data type="userAvatarUrl" class='wx-avatar'></open-data>
			<view style="margin-left: 30rpx;">
				<view class="cp-class">{{companyName}} <dk-tag style="margin-left: 20rpx;" type="primary" padding="0 10rpx" height="30rpx" color="linear-gradient(77.62deg, #CAA977 12.58%, #FFDA7A 85.49%),conic-gradient(from 154.5deg at 29.17% -8.33%, #FFE8BA -0.56deg, rgba(255, 230, 165, 0) 0.26deg, rgba(227, 184, 73, 0.34) 17.37deg, rgba(240, 187, 253, 0.23) 347.83deg, rgba(186, 234, 255, 0.38) 353.78deg, #FFE8BA 359.44deg, rgba(255, 230, 165, 0) 360.26deg);" textColor="#1B365D" radius="10rpx" fontSize="9px" value="{{gradeCode == 'STD'?$t['std']:$t['pro']}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
				</view>
				<view class="staff-class">{{cpManager + (cpPhone?(' | ' + cpPhone):'')}}</view>
				<view class="end-date-class" wx:if="{{gradeCode != 'STD' && !upgradeFlag}}">{{$t['cpEndDate'] + '：' + cpEndDate}}</view>
				<view class="staff-count-class" wx:if="{{gradeCode != 'STD'}}">{{'手机端授权：' + wxMaxNum + '个，电脑端授权' + (webMaxNum?webMaxNum:0) + '个' }}</view>
				<view class="staff-count-class" wx:if="{{gradeCode == 'STD'}}">{{'手机端授权：' + wxMaxNum + '个(额外购买)'}}</view>
			</view>
		</view>
	</view>

	<!--活动（专业版）-->
	<view class="func" wx:if="{{gradeCode != 'STD'}}">
		<view style="display:flex;flex-wrap: wrap;">
			<view class="{{(curentAdItem && curentAdItem.itemId == item.itemId)?'func-card-selected':'func-card'}}" wx:for="{{activityTable}}" wx:for-item="item" wx:key="index" data-item="{{item}}" catchtap="chooseAdItem">
				<!-- 标题 -->
				<view class="card-title">{{item.activityItemName}}
				</view>
				<!-- 价格-->
				<dk-cell fontSize="16" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.stdPrice}}"></dk-cell>
				<!-- 描述-->
				<view class="card-desc">{{item.activityItemDescribe}}
				</view>
			</view>
		</view>
	</view>

	<!--活动（标准版）-->
	<view class="func" wx:if="{{gradeCode == 'STD'}}">
		<view style="display:flex;flex-wrap: wrap;">
			<view class="func-card-std" wx:for="{{activityTable}}" wx:for-item="item" wx:key="index" data-item="{{item}}">
				<!-- 标题 -->
				<view class="card-title-std">{{item.activityItemName}}
				</view>
				<!-- 价格-->
				<dk-cell fontSize="19" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.wxPrice}}"></dk-cell>
				<!-- 授权-->
				<view class="card-desc-std">
					<view>{{$t['userAuthorize']}}</view>
					<van-stepper integer="{{true}}" value="{{ summaryInfo.wxMaxNum}}" min="0" bind:change="changeUserSTD" />
				</view>
			</view>

			<!--VIP报表-->
			<view wx:if="{{showVip}}" class="{{chooseVipFlag?'func-card-vip-std-selected':'func-card-vip-std'}}" wx:for="{{vipTable}}" wx:for-item="item" wx:key="index" data-item="{{item}}" catchtap="chooseVipItem">
				<!-- 标题 -->
				<view class="card-title-std">{{item.activityItemName}}
				</view>
				<!-- 价格-->
				<dk-cell fontSize="19" center="center" contentFontWeight="700" contentColor="#FF7B1A" content="{{item.wxPrice}}"></dk-cell>
				<!-- 描述-->
				<view class="card-desc">{{item.activityItemDescribe}}
				</view>
			</view>
		</view>
	</view>

	<!--用户数-->
	<view class="card-class" wx:if="{{gradeCode != 'STD'}}">
		<!--用户数量-->
		<van-cell border="{{ false }}" title-class="cell_title">
			<view slot="title" style="display: flex;">
				<view>用户数量</view>
				<view style="font-size: 10px;">(包含手机和电脑授权)</view>
			</view>
			<van-stepper value="{{staffCount.maxNum}}" integer="{{true}}" min="0" max="{{1000}}" data-type="all" bind:change="changeStaffCount" />
		</van-cell>
		<van-cell border="{{ false }}" title="额外购买授权">
		</van-cell>
		<!--手机用户数-->
		<van-cell border="{{ false }}" title-class="cell_title">
			<view slot="title" style="display: flex;">
				<view>手机端授权</view>
				<view wx:if="{{curentAdItem && curentAdItem.wxPrice}}" style="display: flex;font-size: 10px;">
					（<dk-cell fontSize="10" left="5rpx" height="50rpx" contentColor="#e00808" content="{{curentAdItem.wxPrice}}"></dk-cell>/个）
				</view>
			</view>
			<van-stepper value="{{staffCount.wxMaxNum}}" integer="{{true}}" min="0" max="{{1000}}" data-type="wx" bind:change="changeStaffCount" />
		</van-cell>
		<!--电脑用户数-->
		<van-cell border="{{ false }}" title-class="cell_title">
			<view slot="title" style="display: flex;">
				<view>电脑端授权</view>
				<view wx:if="{{curentAdItem && curentAdItem.webPrice}}" style="display: flex;font-size: 10px;">
					（<dk-cell fontSize="10" left="5rpx" height="50rpx" contentColor="#e00808" content="{{ curentAdItem.webPrice }}"></dk-cell>/个）
				</view>
			</view>
			<van-stepper value="{{staffCount.webMaxNum}}" integer="{{true}}" min="0" max="{{1000}}" data-type="web" bind:change="changeStaffCount" />
		</van-cell>
	</view>

	<!--合计（专业版）-->
	<view class="summary-class" wx:if="{{gradeCode != 'STD'}}">
		<view class="summary-item-class">订单详情：</view>
		<view class="summary-item-class">{{summaryInfo.amountInfo}}</view>
		<view class="summary-item-class">截止日期：{{summaryInfo.endDate}}</view>
		<view class="summary-item-class" wx:if="{{staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum}}">{{summaryInfo.staffInfo}}</view>
		<view class="summary-item-class" style="display: flex;justify-content: flex-end;" wx:if="{{staffCount.maxNum || staffCount.webMaxNum || staffCount.wxMaxNum}}">
			折合<dk-cell fontSize="14" left="5rpx" fontWeight="bold" height="45rpx" contentColor="#FF7B1A" content="{{summaryInfo.priceInfo}}"></dk-cell>/天/授权</view>
	</view>

	<!--合计（标准版）-->
	<view class="summary-class" wx:if="{{gradeCode == 'STD'}}">
		<view class="summary-item-class">订单详情：</view>
		<view class="summary-item-class">{{summaryInfo.amountInfo}}</view>
		<view class="summary-item-class" style="display: flex;">截止日期：<view style="color:#FF7B1A">{{summaryInfo.userEndDate}}</view>
		</view>
		<view class="summary-item-class" style="display: flex;justify-content: flex-end;" wx:if="{{summaryInfo.wxMaxNum}}">
			折合<dk-cell fontSize="14" left="5rpx" fontWeight="bold" height="45rpx" contentColor="#FF7B1A" content="{{summaryInfo.priceInfo}}"></dk-cell>/天/授权</view>
	</view>

	<!--注册须知-->
	<view class="notice-class" wx:if="{{gradeCode != 'STD'}}">
		<view class="notice-item-class" style="font-size: 16px;font-weight: bold;">{{noticeInfo.title}}</view>
		<view class="notice-item-class">{{noticeInfo.cpName}}</view>
		<view class="notice-item-class">{{noticeInfo.contact}}</view>
		<view class="notice-item-class">{{noticeInfo.cpSize}}</view>
		<view class="notice-item-class" style="display: flex;">
			<van-checkbox shape="square" value="{{readFlag}}" label-class="checkbox-class" bind:change="handleChangeCheckbox">我已阅读并同意</van-checkbox>
			<view style="color: #CE9965;">《注册须知》</view>
			<view style="color: #CE9965;">《免责条款》</view>
		</view>
	</view>

	<view style="height: 200rpx;"></view>
</view>

<!--  保存 -->
<dk-save-button btnAutoWidthFlag="{{true}}" buttonList="{{buttonSaveList}}" bind:open="handleSave"></dk-save-button>