合同上如何加入姓名、手机、身份证等等 云合同

在合同模板上传之前,先占好位置,命名自由

格式:#{}


如何替换内容,在“根据模版生成合同 ”这步骤上加入



完整案例:米拓

<!--<?php
$action=$_M[form][action];
$name=$_M[form][name];
$tel=$_M[form][tel];
$certifyNum=$_M[form][certifyNum];
$info=$_M[form][info];
$price=substr($_M[form][price], 0, -3);
$price2=$price/6;//每期费用

$price3=$_M[form][price3];//每期费用

$user_name = get_met_cookie('metinfo_member_name');
$user_id = get_met_cookie('metinfo_member_id');
//取得云合同:用户ID、印样ID,合同ID


//电话
$user_rs1=DB::get_one("SELECT tel FROM ".$_M['table']['user']." WHERE id='$user_id'");
//真实姓名
$user_rs2=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=100");
//身份证号码
$user_rs3=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=121");

//签署合同
if($action=="play"){

	if(!$name || !$tel || !$certifyNum){
		//echo "参数错误!";die;
		header("Location: /shop/order_user.php?lang=cn&info=参数错误"); die;
	}
	
	//给会员更新手机、身份证,真实姓名信息
	      //电话
			$query1 = "UPDATE ".$_M[table][user]." SET tel='$tel' WHERE id='$user_id'";
			DB::query($query1);
	      //真实姓名
			$query2 = "UPDATE ".$_M[table][user_list]." SET info='$name' WHERE listid='$user_id' AND paraid=100";
			DB::query($query2);
	      //身份证号码
			$query3 = "UPDATE ".$_M[table][user_list]." SET info='$certifyNum' WHERE listid='$user_id' AND paraid=121";
			DB::query($query3);
	
	
////获取长效令牌
	  $appId="2018042010495200018";//应用APPID
	  $appKey="qve1enjqG0qDei";


		$curl = curl_init();

		curl_setopt_array($curl, array(
		  CURLOPT_URL => "https://api.yunhetong.com/api/auth/login",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,
		  CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_SSL_VERIFYHOST => false,
			    CURLOPT_HEADER => true,//false时,取得code
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "POST",
		  CURLOPT_POSTFIELDS => "{\n\"appId\":\"$appId\",\n\"appKey\":\"$appKey\"\n}",
		  CURLOPT_HTTPHEADER => array(
			"cache-control: no-cache",
			"content-type: application/json"
		  ),
		));

		$response = curl_exec($curl);
		$err = curl_error($curl);

		curl_close($curl);

		if ($err) {
		  echo "cURL Error #:" . $err.die;
		} else {
		    //echo $response;
				$headArr = explode("\r\n", $response);
				foreach ($headArr as $loop) {
					if(strpos($loop, "token") !== false){
					   $token = trim(substr($loop, 6));
					   //$token = trim($loop);
					}
					if(strpos($loop, "code") !== false){
					   //$code = trim(substr($loop, 6));
					   $rp = trim($loop);
					}
				}
		}
			$arr = json_decode($rp, true);
			$code = $arr['code'];//code=200 说明成功
			$msg = $arr['msg'];
			//不成功
			if($code!="200" || !$token){
				header("Location: /shop/order_user.php?lang=cn&info=获取长效令牌,原因:".$msg); die;
				//print_r( "获取长效令牌,原因:".$msg).die;
			}

//print_r($code).die;

//用户ID  存在了就不用再生成
$user_rs71=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=122");	
if(!$user_rs71['info']){
//创建个人用户
		$userName = $name;////用户姓名(最长 15 字符)成采南
		$identityRegion = 0;////身份地区:0 大陆,1 香港,2 台湾,3 澳门
		$certifyNum = $certifyNum;////身份证号码,应用内唯一 520181198002175907
		$phoneRegion = 0;////手机号地区:0 大陆,1 香港、澳门,2 台湾
		$phoneNo = $tel;//手机号:1.大陆,首位为 1,长度 11 位纯数字;2.香港、澳门,长度为 8 的纯数字;3.台湾,长度为 10 的纯数字
		$caType = "B1";//证书类型:A1 CFCA 场景,A2 CFCA 长效,B1  ZJCA 场景,B2 ZJCA 长效

		$curl2 = curl_init();
		curl_setopt_array($curl2, array(
		  CURLOPT_URL => "https://api.yunhetong.com/api/user/person",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,
		  CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_SSL_VERIFYHOST => false,
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "POST",
		  CURLOPT_POSTFIELDS => "{\n\"caType\": \"$caType\",\n\"certifyNum\": \"$certifyNum\",\n\"identityRegion\": \"$identityRegion\",\n\"phoneNo\": \"$phoneNo\",\n\"phoneRegion\": \"$phoneRegion\",\n\"userName\": \"$userName\"\n}",
		  CURLOPT_HTTPHEADER => array(
			"cache-control: no-cache",
			"content-type: application/json",
			"token: $token"
		  ),
		));

		$response2 = curl_exec($curl2);
		$err2 = curl_error($curl2);

		curl_close($curl2);

		if ($err2) {
		    echo "cURL Error #:" . $err2.die;
		} else {
		    //echo $response2;
			$arr2 = json_decode($response2, true);
			$code2 = $arr2['code'];//code=200 说明成功
			$msg2 = $arr2['msg'];
			
			// 直接下载合同   认证号码(身份证)已经存  说明这个人已经生成合同一次,已经记录了他的信息
                 if($code2==20207){//20207 直接下载合同  
							//合同下载
                                //取出合同ID
                                $user_rs4=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=124");
					            $contractId=$user_rs4['info'];
					            if(!$contractId){
									header("Location: /shop/order_user.php?lang=cn&info=错误:合同ID不存在,请与管理员联系!"); die;
								}
					
//									$curl7 = curl_init();
//
//									curl_setopt_array($curl7, array(
//									  CURLOPT_URL => "https://api.yunhetong.com/api/contract/download/0/$contractId",
//									  CURLOPT_RETURNTRANSFER => true,
//									  CURLOPT_ENCODING => "",
//									  CURLOPT_MAXREDIRS => 10,
//									  CURLOPT_TIMEOUT => 30,
//											CURLOPT_SSL_VERIFYPEER => false,
//											CURLOPT_SSL_VERIFYHOST => false,
//									  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
//									  CURLOPT_CUSTOMREQUEST => "GET",
//									   //CURLOPT_POSTFIELDS => "{\n\"idType\": \"0\",\n\"idContent\": \"$contractId\",\n\"signerId\": \"$signerId\",\n\"moulageId\": \"$moulageId\"\n}",
//									  CURLOPT_HTTPHEADER => array(
//										"cache-control: no-cache",
//										"content-type: application/json",
//										"token: $token"
//									  ),
//									));
//
//									$response7 = curl_exec($curl7);
//									$err7 = curl_error($curl7);
//
//									curl_close($curl7);
//
//									if ($err7) {
//									    //echo "cURL Error #:" . $err7.die;
//										header("Location: /shop/order_user.php?lang=cn&info=错误:".$err7); die;
//									} else {
//										//echo $response7;
//										$arr7 = json_decode($response7, true);
//										$code7 = $arr7['code'];//code=200 说明成功
//										$msg7 = $arr7['msg'];
//										$data7 = $arr7['data'];
//										//$data7 = $contractId;
//											//不成功
//											if($code7!=200){
//												header("Location: /shop/order_user.php?lang=cn&info=合同下载失败,原因:".$msg7); die;
//												//print_r( "合同下载失败,原因:".$msg7).die;
//											}else{
//												//print_r("合同下载成功!");
//												header("Location: https://api.yunhetong.com/api/auth/download/$data7"); 
//											}
//
//									}
					 die;
				}
				//不成功
				if($code2!=200){
					//{$_SERVER['PHP_SELF']}?lang=cn
					header("Location: /shop/order_user.php?lang=cn&info=创建个人用户失败,原因:".$msg2.$code2); die;
					//echo "创建个人用户失败,原因:".$msg2;die;
					//print_r( "创建个人用户失败,原因:".$msg2);die;
				}
			
			$signerId = $arr2['data']['signerId'];

		}
	      //记录用户 云合同用户ID  122
			$query11 = "UPDATE ".$_M[table][user_list]." SET info='$signerId' WHERE listid='$user_id' AND paraid=122";
			DB::query($query11);


 //      $signerId=60;
 //      echo $signerId;
	
}else{
	$signerId=$user_rs71['info'];//云合同用户ID
	
	
}
//印模ID  存在了就不用再生成
$user_rs72=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=123");	
if(!$user_rs72['info']){
//创建个人印模
		$curl3 = curl_init();

		curl_setopt_array($curl3, array(
		  CURLOPT_URL => "https://api.yunhetong.com/api/user/personMoulage",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,
		  CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_SSL_VERIFYHOST => false,
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "POST",
		   CURLOPT_POSTFIELDS => "{\n\"signerId\": \"$signerId\",\n\"borderType\": \"B2\",\n\"fontFamily\": \"F1\"\n}",
		  CURLOPT_HTTPHEADER => array(
			"cache-control: no-cache",
			"content-type: application/json",
			"token: $token"
		  ),
		));

		$response3 = curl_exec($curl3);
		$err3 = curl_error($curl3);

		curl_close($curl3);

		if ($err3) {
			header("Location: /shop/order_user.php?lang=cn&info=错误:".$err3); die;
		  //echo "cURL Error #:" . $err3.die;
		} else {
		   // echo $response3;
			$arr3 = json_decode($response3, true);
			$code3 = $arr3['code'];//code=200 说明成功
			$msg3 = $arr3['msg'];
				//不成功
				if($code3!=200){
					header("Location: /shop/order_user.php?lang=cn&info=创建个人印模失败,原因:".$msg3); die;
					//print_r( "创建个人印模失败,原因:".$msg3).die;
				}
			
			$moulageId = $arr3['data']['moulageId'];
		}
	      //记录用户 云合同印模ID  122
			$query12 = "UPDATE ".$_M[table][user_list]." SET info='$moulageId' WHERE listid='$user_id' AND paraid=123";
			DB::query($query12);
	
//$moulageId=82;
////print_r($moulageId);
}else{
	$moulageId=$user_rs72['info'];//云合同印模ID
}
	
	
	
//合同ID  存在了就不用再生成
$user_rs73=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=124");	
if(!$user_rs73['info']){
//根据模版生成合同
			$data4 = array(  
				'contractTitle'=>'测试',  //合同标题
				'templateId'=>'TEM1001348',//合同模板编号
				'contractData' => array(  
						'${info1}'=>$name, //姓名 
						'${info2}'=>$certifyNum,//身份证号
						'${info3}'=>$tel,  //联系手机
						'${info4}'=>$name,//姓名
						'${info5}'=>$tel,//联系手机

						'${c1}'=>'成人培训',  //培训课程
						'${c2}'=>'一个考期', //培训周期/课时
						'${c3}'=>$price, //培训总费用(元)  
						'${c4}'=>'0', //其中现金首付金额(元)
						'${c5}'=>$price3,  //分期支付金额(元)
						'${c6}'=>'6', //分期期数

						'${t1}'=>date('Y',time()),//年
						'${t2}'=>date('m',time()),//月
						'${t3}'=>date('d',time())//日
					  )
			  );
			$data4_json = json_encode($data4);
			$url="https://api.yunhetong.com/api/contract/templateContract";

			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $url);
			curl_setopt($ch, CURLOPT_HTTPHEADER, array('cache-control: no-cache','Content-Type: application/json','token: '.$token));
			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
			curl_setopt($ch, CURLOPT_POSTFIELDS,$data4_json);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
				curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
				$response4 = curl_exec($ch);
				$err4 = curl_error($ch);
			curl_close($ch);
	
		if ($err4) {
			header("Location: /shop/order_user.php?lang=cn&info=错误:".$err4); die;
		  //echo "cURL Error #:" . $err4.die;
		} else {
		   // echo $response4;
			$arr4 = json_decode($response4, true);
			$code4 = $arr4['code'];//code=200 说明成功
			$msg4 = $arr4['msg'];
				//不成功
				if($code4!=200){
					header("Location: /shop/order_user.php?lang=cn&info=生成合同失败,原因:".$msg4); die;
					//print_r( "生成合同失败,原因:".$msg4).die;
				}
			$contractId = $arr4['data']['contractId'];
			$contractId=str_replace(",","",number_format($contractId));
		}

	      //记录用户 云合同合同ID  124
			$query13 = "UPDATE ".$_M[table][user_list]." SET info='$contractId' WHERE listid='$user_id' AND paraid=124";
			DB::query($query13);

		 // print_r($contractId);
		//$contractId="1804232025535010";
}else{
	$contractId=$user_rs73['info'];//云合同合同ID
	
									$curl7 = curl_init();

									curl_setopt_array($curl7, array(
									  CURLOPT_URL => "https://api.yunhetong.com/api/contract/download/0/$contractId",
									  CURLOPT_RETURNTRANSFER => true,
									  CURLOPT_ENCODING => "",
									  CURLOPT_MAXREDIRS => 10,
									  CURLOPT_TIMEOUT => 30,
											CURLOPT_SSL_VERIFYPEER => false,
											CURLOPT_SSL_VERIFYHOST => false,
									  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
									  CURLOPT_CUSTOMREQUEST => "GET",
									   //CURLOPT_POSTFIELDS => "{\n\"idType\": \"0\",\n\"idContent\": \"$contractId\",\n\"signerId\": \"$signerId\",\n\"moulageId\": \"$moulageId\"\n}",
									  CURLOPT_HTTPHEADER => array(
										"cache-control: no-cache",
										"content-type: application/json",
										"token: $token"
									  ),
									));

									$response7 = curl_exec($curl7);
									$err7 = curl_error($curl7);

									curl_close($curl7);

									if ($err7) {
									    //echo "cURL Error #:" . $err7.die;
										header("Location: /shop/order_user.php?lang=cn&info=错误:".$err7); die;
									} else {
										//echo $response7;
										$arr7 = json_decode($response7, true);
										$code7 = $arr7['code'];//code=200 说明成功
										$msg7 = $arr7['msg'];
										$data7 = $arr7['data'];
										//$data7 = $contractId;
											//不成功
											if($code7!=200){
												header("Location: /shop/order_user.php?lang=cn&info=合同下载失败,原因:".$msg7); die;
												//print_r( "合同下载失败,原因:".$msg7).die;
											}else{
												//print_r("合同下载成功!");
												header("Location: https://api.yunhetong.com/api/auth/download/$data7"); 
											}

									}
	die;
	
}
	
//添加签署者

		$curl5 = curl_init();

		curl_setopt_array($curl5, array(
		  CURLOPT_URL => "https://api.yunhetong.com/api/contract/signer",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,



		  CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_SSL_VERIFYHOST => false,
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "POST",
		   //CURLOPT_POSTFIELDS => "{\n\"contractTitle\": \"$contractTitle\",\n\"templateId\": \"$templateId\"\n}",
			 CURLOPT_POSTFIELDS => "{\"idType\": \"0\",\n\"idContent\": \"$contractId\",\n\"signers\": [{\"signerId\": \"$signerId\",\n\"signPositionType\": \"1\",\n\"positionContent\": \"73488\",\n\"signValidateType\": \"0\"}\n]\n}",
		  CURLOPT_HTTPHEADER => array(
			"cache-control: no-cache",
			"content-type: application/json",
			"token: $token"
		  ),
		));

		$response5 = curl_exec($curl5);
		$err5 = curl_error($curl5);

		curl_close($curl5);

		if ($err5) {
			header("Location: /shop/order_user.php?lang=cn&info=错误:".$err5); die;
		  //echo "cURL Error #:" . $err5.die;
		} else {
		    //echo $response5;
			$arr5 = json_decode($response5, true);
			$code5 = $arr5['code'];//code=200 说明成功
			$msg5 = $arr5['msg'];

		}
		//不成功
		if($code5!=200){
			header("Location: /shop/order_user.php?lang=cn&info=添加签署者失败,原因:".$msg5); die;
			//print_r( "添加签署者失败,原因:".$msg5).die;
		}

         // print_r($code5);


//合同签署
		$curl6 = curl_init();

		curl_setopt_array($curl6, array(
		  CURLOPT_URL => "https://api.yunhetong.com/api/contract/sign",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,
		  CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_SSL_VERIFYHOST => false,
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "POST",
		   CURLOPT_POSTFIELDS => "{\n\"idType\": \"0\",\n\"idContent\": \"$contractId\",\n\"signerId\": \"$signerId\",\n\"moulageId\": \"$moulageId\"\n}",
		  CURLOPT_HTTPHEADER => array(
			"cache-control: no-cache",
			"content-type: application/json",
			"token: $token"
		  ),
		));

		$response6 = curl_exec($curl6);
		$err6 = curl_error($curl6);

		curl_close($curl6);

		if ($err6) {
			header("Location: /shop/order_user.php?lang=cn&info=错误:".$err6); die;
		  //echo "cURL Error #:" . $err6.die;
		} else {
		   // echo $response6;
			$arr6 = json_decode($response6, true);
			$code6 = $arr6['code'];//code=200 说明成功
			$msg6 = $arr6['msg'];

		}
		//不成功
		if($code6!=200){
			header("Location: /shop/order_user.php?lang=cn&info=合同签署失败,原因:".$msg6); die;
			//print_r( "合同签署失败,原因:".$msg6).die;
//		}else{
//			print_r("合同签署成功,合同编码:".$contractId);
		}


         // print_r($code6);

//合同下载

       // $contractId="1804241101415029";

		$curl7 = curl_init();

		curl_setopt_array($curl7, array(
		  CURLOPT_URL => "https://api.yunhetong.com/api/contract/download/0/$contractId",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,
		  CURLOPT_TIMEOUT => 30,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_SSL_VERIFYHOST => false,
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "GET",
		   //CURLOPT_POSTFIELDS => "{\n\"idType\": \"0\",\n\"idContent\": \"$contractId\",\n\"signerId\": \"$signerId\",\n\"moulageId\": \"$moulageId\"\n}",
		  CURLOPT_HTTPHEADER => array(
			"cache-control: no-cache",
			"content-type: application/json",
			"token: $token"
		  ),
		));

		$response7 = curl_exec($curl7);
		$err7 = curl_error($curl7);

		curl_close($curl7);

		if ($err7) {
			header("Location: /shop/order_user.php?lang=cn&info=错误:".$err7); die;
		  //echo "cURL Error #:" . $err7.die;
		} else {
		    //echo $response7;
			$arr7 = json_decode($response7, true);
			$code7 = $arr7['code'];//code=200 说明成功
			$msg7 = $arr7['msg'];
			$data7 = $arr7['data'];
				//不成功
				if($code7!=200){
					header("Location: /shop/order_user.php?lang=cn&info=合同下载失败,原因:".$msg7); die;
					//print_r( "合同下载失败,原因:".$msg7).die;
				}else{
					//print_r("合同下载成功!");
					//header("Location: /shop/order_user.php?lang=cn&info=合同签署成功,可以支付了!"); die;
					header("Location: https://api.yunhetong.com/api/auth/download/$data7"); 
				}
              
		}
}
echo <<<EOT
-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>签署合同 分期支付</title>
<link rel="stylesheet" href="/templates/metx5/layui/css/layui.css">
<script src="/templates/metx5/layui/layui.js"></script>
</head>
<body>
<!--
EOT;
//合同ID存在,说明已经生成合同,可以直接支付
$user_rs5=DB::get_one("SELECT info FROM ".$_M['table']['user_list']." WHERE listid='$user_id' AND paraid=124");
$contractId=$user_rs5['info'];
if($contractId==9){
echo <<<EOT
-->
<img src="{$webpath}pay3.jpg" width="100%"/>
<!--
EOT;
}else{
echo <<<EOT
-->
<h1 style="color: red">{$info}</h1>
<div class="modal fade modal-primary" id="addr-edit-modal" aria-hidden="true" aria-labelledby="addr-edit-modal" role="dialog" tabindex="-1">
	<div class="modal-dialog modal-center modal-sm">
		<div class="modal-content">
			<form action="{$_SERVER['PHP_SELF']}?lang=cn" class="addr-edit-form layui-form" method="post">
			     <input type="hidden" name="price" value="{$price}">
				 <input type="hidden" name="price3" value="{$price2}">
				<div class="modal-body">
				          分期付款,需要签署云合同,请填写合法真实的身份证信息!
						  <hr class="layui-bg-red">
						  <div class="layui-form-item">
							<label class="layui-form-label">真实姓名</label>
							<div class="layui-input-block">
							  <input type="text" name="name" required value="{$user_rs2['info']}" lay-verify="required" placeholder="请输入真实姓名" autocomplete="off" class="layui-input">
							</div>
						  </div>
							<div class="layui-form-item">
							<label class="layui-form-label">手机号码</label>
							<div class="layui-input-block">
							  <input type="text" name="tel" required value="{$user_rs1['tel']}" lay-verify="required|phone|number" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
							</div>
						  </div>
							<div class="layui-form-item">
							<label class="layui-form-label">身份证号码</label>
							<div class="layui-input-block">
							  <input type="text" name="certifyNum" required value="{$user_rs3['info']}" lay-verify="required|identity" placeholder="请输入身份证号码" autocomplete="off" class="layui-input">
							</div>
						  </div>
						  <div class="layui-form-item">
							<label class="layui-form-label">分期费用</label>
							<div class="layui-input-block">
									<table class="layui-table">
									  <colgroup>
										<col width="100">
										<col>
									  </colgroup>
									  <thead>
										<tr>
										  <th>名称</th>
										  <th>内容</th>
										</tr> 
									  </thead>
									  <tbody>
										<tr>
										  <td>总费用</td>
										  <td>{$price}元</td>
										</tr>
										<tr>
										  <td>分期期数</td>
										  <td>6期</td>
										</tr>
										<tr>
										  <td>每期费用</td>
										  <td>{$price2}元</td>
										</tr>
									  </tbody>
									</table>
							  
							</div>
						  </div>
						  <div class="layui-form-item">
							<div class="layui-input-block">
							  <button class="layui-btn" name="action" value="play" lay-submit lay-filter="formDemo">签署合同 分期支付</button>
							</div>
						  </div>
				</div>
			</form>
		</div>
	</div>
</div>
<script>
layui.use(['form', 'laydate'], function(){
  var form = layui.form
  ,laydate = layui.laydate;
  
  
  //自定义验证规则
  form.verify({
    title: function(value){
      if(value.length < 5){
        return '标题至少得5个字符啊';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });
  
  //监听指定开关
  form.on('switch(switchTest)', function(data){
    layer.msg('开关checked:'+ (this.checked ? 'true' : 'false'), {
      offset: '6px'
    });
    layer.tips('温馨提示:请注意开关状态的文字可以随意定义,而不仅仅是ON|OFF', data.othis)
  });
  
  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });
  
  
});
</script>
<!--
EOT;
}
echo <<<EOT
-->
</body>
</html>
<!--
EOT;
?>-->


版权声明:本文为haibo0668原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/haibo0668/article/details/80090344

智能推荐

Rtthread学习笔记(十三)RT-Thread Studio开启硬件看门狗Watchdog

一、开启硬件看门狗Watchdog 1、配置RT-Thread Settings 2、开启stm32f1xx_hal_conf.h中的宏定义 3.使用RT接口函数初始化硬件看门狗...

TYVJ 4864 天天去哪吃 || 清北学堂金秋杯大奖赛

题目描述: 记录一下i这个值上次出现的位置在哪里,就是pre...

java反编译

jvm 把Boolean类型的值flag当做int类型处理。​​​ Foo.java: 由 class 文件生成 jasm 文件:java -jar asmtools.jar jdis Foo.class > Foo.jasm  修改jasm文件: 执行反编译: java -jar jd-gui-1.6.6.jar File 打开Foo.class文件:b修改为2 重新执行java...

【学习笔记】03-v-html的学习和示例

v-html的认识和使用 示例: 显示结果: 注意:v-html是有复制的...

Java实现在线考试系统(系统介绍)

1.和现在有的考试系统有以下几种优势: a.和现在有的系统比较起来,本系统有科目、章节、老师、学生、班级等信息的管理,还有批阅试卷查看已批阅试卷等。传统的考试系统划分并不细,业务功能简单。 b.和学校的考试系统还有外面的考试系统比较起来,本系统是B/S结构,学校的考试系统一般为C/S结构,性能方面不如B/S结构,并且C/S接口需要安装客户端,客户端压力很大,我的系统只需要电脑具有浏览器,在同一局域...

猜你喜欢

计算机视觉--多视几何初步尝试

基础矩阵的原理 K和K’分别是两个相机的参数矩阵。p和p’是X在平面π的坐标表示。所以可以得出 具体计算过程 代码: #!/usr/bin/env python coding: utf-8 from PIL import Image from numpy import * from pylab import * import numpy as np from imp ...

java初学者怎么学习才可以快速入门

java初学者怎么学习才可以快速入门 一、了解JAVA 我们要知道:Java是由Sun Microsystems公司于1995年5月推出的Java面向对象程序设计语言。 Java之父:詹姆斯·高斯林 1.1 java的三个体系 Java SE(Java Platform Standard Edition)。Java SE 以前称为 J2SE。它允许开发和部署在桌面、服务器、嵌入式环境...

字段属性之主键&增删改查&自增长&唯一键约束

字段属性之主键&自增长&唯一键约束 主键 主键:primary key 主要的键 一张表中只有一个字段可以使用对应的键,用来唯一的约束该字段里面的数据,不能重复,这种称之为主键 一张表只能最多一个主键 增加主键 SQL操作中有多种方式增加主键大体分为三种 1.在创建表的时候直接在字段之后跟primary key关键字(主键本身不允许为空) 优点:非常直接:缺点:只能使用一个字段作为...

linux下 基于libmad的socket多用户mp3音频在线播放服务器

在众多大神的帮助下,这个在线播放流媒体服务器终于完成啦。。。。 这个mp3流媒体服务器设计的思路是,服务器程序server用多线程实现和多个客户端的通信(这是必然的),然后发送给客户端当前的音频列表公客户端选择,之后根据k客户端的选择给多个客户端传输相应mp3文件的数据,同时,客户端进行实时地音频解码并播放。 关于libmad开源mp3音频解码库的使用,见上一篇博客吧。。。。 在服务器程序这一端,...

Nginx

Nginx Nginx简介: Nginx是一个高性能的http和反向代理服务器,特点是有内存少,并发能力强,事实上Nginx的并发能力确实在同类型网页服务器中表现较好, Nginx用作web服务器:Nginx可以作为静态页面的web服务器,同时还支持CGI语言,但不支持java,java程序只能通过Tomcat配合完成。Nginx专为性能优化而开发,性能是其最重要的考量,实现上非常注重效率,能经受...