thinkphp——支付宝-完成商品价格支付

1.到支付宝官网开发者中心下载相关接口文件,这里就不多说了。如下图:

然后是lib文件夹里面的四个文件,如下:

到时整合到tp里把他们四个重命名如下

2.新建一个控制器,什么名都行,如:KeyController.class.php内容如下

<span style="color:#009900;"><strong><span style="font-size:18px;"><?php
namespace Home\Controller;
use Think\Controller;
class KeyController extends Controller {
    //利用构造函数引入核心文件
    public function _initialize() {
        vendor('Alipay.Corefunction');
        vendor('Alipay.Md5function');
        vendor('Alipay.Notify');
        vendor('Alipay.Submit');   
    }
  //首页,用来展示商品页
    public function index(){
		//订单未付款的付款
		echo $order_id=I('order_id',0);
		echo '<br />';
		$order= D('Order')->find($order_id);
		echo $WIDout_trade_no1=$order['order_sn'];//订单号
		
		$order_sub=D('Order_sub');
		$sql="select a.sub_goods_name from jiuji_order_sub a join jiuji_order b on a.sub_order_sn=b.order_sn where b.order_id=$order_id";
		$oinfo=$order_sub->query($sql);
		foreach($oinfo as $k=>$v){
			$sub_goods_name.=$oinfo[$k]['sub_goods_name'].'..';
			}
		echo $WIDsubject1=$sub_goods_name;//对应商品名
		echo $WIDprice1=$order['order_amount'];//付款金额
		
		$user_consignee=D('User_consignee');
		$sql="select * from jiuji_user_consignee a join jiuji_order b on a.consignee_id=b.order_consignee_id where b.order_id=$order_id";
		$uinfo=$user_consignee->query($sql);
		foreach($uinfo as $k=>$v){
			echo $consignee_name=$uinfo[$k]['consignee_name'];
			echo $consignee_province1=$uinfo[$k]['consignee_province'];//省
			echo $consignee_city1=$uinfo[$k]['consignee_city'];//市
			echo $consignee_district1=$uinfo[$k]['consignee_district'];//区
			echo $consignee_address1=$uinfo[$k]['consignee_address'];//收货人详细地址
			echo $consignee_zipcode1=$uinfo[$k]['consignee_zipcode'];//收货人邮编
			echo $consignee_tel1=$uinfo[$k]['consignee_tel'];//电话号码
			echo $consignee_mobile1=$uinfo[$k]['consignee_mobile'];//手机号码
			}
		
		
		
		echo $WIDout_trade_no=$_GET['order_sn'];
		echo $WIDsubject=$_GET['sub_goods_name'];
		echo $WIDprice=$_GET['order_amount'];
		echo $WIDreceive_name=$_GET['consignee_name'];
		echo $consignee_province=$_GET['consignee_province'];
		echo $consignee_city=$_GET['consignee_city'];
		echo $consignee_district=$_GET['consignee_district'];
		echo $consignee_address=$_GET['consignee_address'];
		echo $WIDreceive_zip=$_GET['consignee_zipcode'];
		echo $WIDreceive_phone=$_GET['consignee_tel'];
		echo $WIDreceive_mobile=$_GET['consignee_mobile'];

		$this->assign('WIDout_trade_no',$WIDout_trade_no);
		$this->assign('WIDout_trade_no1',$WIDout_trade_no1);
		$this->assign('WIDsubject',$WIDsubject);
		$this->assign('WIDsubject1',$WIDsubject1);
		$this->assign('WIDprice',$WIDprice);
		$this->assign('WIDprice1',$WIDprice1);
		$this->assign('WIDreceive_name',$WIDreceive_name);
		$this->assign('WIDreceive_name1',$consignee_name);
		/*地址*/
		
		$this->assign('consignee_province',$consignee_province);
		$this->assign('consignee_province1',$consignee_province1);
		$this->assign('consignee_city',$consignee_city);
		$this->assign('consignee_city1',$consignee_city1);
		$this->assign('consignee_district',$consignee_district);
		$this->assign('consignee_district1',$consignee_district1);
		$this->assign('consignee_address',$consignee_address);
		$this->assign('consignee_address1',$consignee_address1);
		$this->assign('WIDreceive_zip',$WIDreceive_zip);
		$this->assign('WIDreceive_zip1',$consignee_zipcode1);
		$this->assign('WIDreceive_phone',$WIDreceive_phone);
		$this->assign('WIDreceive_phone1',$consignee_tel1);
		$this->assign('WIDreceive_mobile',$WIDreceive_mobile);
		$this->assign('WIDreceive_mobile1',$consignee_mobile1);
        $this->display();
    }
  /*  //订单页,我写死了的,可以根据自己需要进行修改
    public function order(){
        $type = I('get.type');
        if($type==1){
        $date = array('type'=>1,"price"=>'0.01',"name"=>"《火星救援》");
        }elseif($type==2){
        $date = array('type'=>2,"price"=>'0.01',"name"=>"《死神的精确度》");
        }elseif($type==3){
        $date = array('type'=>3,"price"=>'0.01',"name"=>"《寂寞是毒,也是解药》");
        }elseif($type==4){
        $date = array('type'=>4,"price"=>'0.01',"name"=>"《只要不忘了回家的路》");
        }elseif($type==5){
        $date = array('type'=>5,"price"=>'0.01',"name"=>"《异想星球 hello,我是托比小黑》");
        }elseif($type==6){
        $date = array('type'=>6,"price"=>'0.01',"name"=>"《张鸣说历史:大国的虚与实》");
        }
        $this->time = time();
        $this->assign("data",$date);
        $this->display();
    }*/
    //订单页点击提交,传递必要参数后开始支付,可自行修改
    public function payorder(){
        //传递数组配置
        $alipay_config=C('alipay_config');
        $alipay=C('alipay');
        /**************************请求参数**************************/
            //支付类型
        $payment_type = "1";        //必填,不能修改
        //服务器异步通知页面路径
     	$notify_url = "$alipay[notify_url]";
        //页面跳转同步通知页面路径
        $return_url = "$alipay[return_url]";
        //商户订单号
        $out_trade_no = $_POST['WIDout_trade_no'];
        //商户网站订单系统中唯一订单号,必填

        //订单名称
        $subject = $_POST['WIDsubject'];
        //必填

        //付款金额
        $price = $_POST['WIDprice'];
        //必填

        //商品数量
        $quantity = "1";
        //必填,建议默认为1,不改变值,把一次交易看成是一次下订单而非购买一件商品
        //物流费用
        $logistics_fee = "0.00";
        //必填,即运费
        //物流类型
        $logistics_type = "EXPRESS";
        //必填,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS)
        //物流支付方式
        $logistics_payment = "SELLER_PAY";
        //必填,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费)
        //订单描述

        $body = $_POST['WIDbody'];
        //商品展示地址
        $show_url = $_POST['WIDshow_url'];
        //需以http://开头的完整路径,如:http://www.商户网站.com/myorder.html

        //收货人姓名
        $receive_name = $_POST['WIDreceive_name'];
        //如:张三

        //收货人地址
        $receive_address = $_POST['WIDreceive_address'];
        //如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号

        //收货人邮编
        $receive_zip = $_POST['WIDreceive_zip'];
        //如:123456

        //收货人电话号码
        $receive_phone = $_POST['WIDreceive_phone'];
        //如:0571-88158090

        //收货人手机号码
        $receive_mobile = $_POST['WIDreceive_mobile'];
        /************************************************************/
    
        //构造要请求的参数数组,无需改动
            $parameter = array(
            "service" => "create_partner_trade_by_buyer",
            "partner" => trim($alipay_config['partner']),
            "seller_email" => trim($alipay_config['seller_email']),
            "payment_type"=> $payment_type,
            "notify_url"=> $notify_url,
            "return_url"=> $return_url,
            "out_trade_no"=> $out_trade_no,
            "subject"=> $subject,
            "price"=> $price,
            "quantity"=> $quantity,
            "logistics_fee"=> $logistics_fee,
            "logistics_type"=> $logistics_type,
            "logistics_payment"=> $logistics_payment,
            "body"=> $body,
            "show_url"=> $show_url,
            "receive_name"=> $receive_name,
            "receive_address"=> $receive_address,
            "receive_zip"=> $receive_zip,
            "receive_phone"=> $receive_phone,
            "receive_mobile"=> $receive_mobile,
            "_input_charset"=> trim(strtolower($alipay_config['input_charset']))
            );
          /*  //存入数据库订单信息 static为99是无效订单
            M('test')->add(array("orderid"=>$out_trade_no,"addtime"=>time(),"ordername"=>$subject,"orderprice"=>$price,"static"=>99));*/
            //建立请求
            $alipaySubmit = new \AlipaySubmit($alipay_config);
            //dump($alipaySubmit);die;
           $html_text = $alipaySubmit->buildRequestForm($parameter,"post", "确认");
            echo $html_text;
            }
    /******************************    服务器异步通知页面方法    *******************************/
    public function notifyurl(){
        //防止乱码
        header("Content-Type:text/html;charset=utf-8");
        //计算得出通知验证结果
        $alipay_config=C('alipay_config');
        $alipayNotify = new \AlipayNotify($alipay_config);
        $verify_result = $alipayNotify->verifyNotify();
        if($verify_result) {//验证成功
        //商户订单号
        logResult("订单编号:".$_POST['out_trade_no'].",状态".$_POST['trade_status']."");
        $out_trade_no = $_POST['out_trade_no'];
        //支付宝交易号
        $trade_no = $_POST['trade_no'];
        //交易状态
        $trade_status = $_POST['trade_status'];
        if($_POST['trade_status'] == 'WAIT_BUYER_PAY') {
        //该判断表示买家已在支付宝交易管理中产生了交易记录,但没有付款
        //判断该笔订单是否在商户网站中已经做过处理
        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
        //如果有做过处理,不执行商户的业务程序
                echo "success";//请不要修改或删除
                //调试用,写文本函数记录程序运行情况是否正常
                //获取支付宝的订单号后写入数据库,修改订单状态为0 待支付
               M('test')->where(array("orderid"=>$out_trade_no))->save(array("static"=>0,"lasttime"=>time(),'payid'=>$trade_no));
               //文本日志文件,这里的日志文件会在网站根目录生成一个log.txt文件
                logResult("这里是等待付款");
            }
        else if($_POST['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
        //该判断表示买家已在支付宝交易管理中产生了交易记录且付款成功,但卖家没有发货
        //判断该笔订单是否在商户网站中已经做过处理
        //买家支付后,修改状态为已支付代发货
        M('test')->where(array("orderid"=>$out_trade_no))->save(array("static"=>1,"lasttime"=>time()));
        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
        //如果有做过处理,不执行商户的业务程序
                echo "success";//请不要修改或删除
                //调试用,写文本函数记录程序运行情况是否正常
                logResult("支付完成!订单编号:".$out_trade_no.",状态".$_POST['trade_status']."");
            }
        else if($_POST['trade_status'] == 'WAIT_BUYER_CONFIRM_GOODS') {
        //该判断表示卖家已经发了货,但买家还没有做确认收货的操作
        //判断该笔订单是否在商户网站中已经做过处理
        //发货完成后会修改状态
        M('test')->where(array("orderid"=>$out_trade_no))->save(array("static"=>2,"lasttime"=>time()));
        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
        //如果有做过处理,不执行商户的业务程序
                echo "success";//请不要修改或删除
                //调试用,写文本函数记录程序运行情况是否正常
                logResult("发货完成,等待买家收货");
            }
        else if($_POST['trade_status'] == 'TRADE_FINISHED') {
        //该判断表示买家已经确认收货,这笔交易完成
        //判断该笔订单是否在商户网站中已经做过处理
        //买家收货后订单完成
        M('test')->where(array("orderid"=>$out_trade_no))->save(array("static"=>3,"lasttime"=>time()));
        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
        //如果有做过处理,不执行商户的业务程序
                echo "success";//请不要修改或删除
                //调试用,写文本函数记录程序运行情况是否正常
                logResult("交易完成!");
            }
            else {
        //其他状态判断
                echo "success";
                //调试用,写文本函数记录程序运行情况是否正常
                logResult ("错误");
            }
        }
        else {
            //验证失败
            echo "fail";
            //调试用,写文本函数记录程序运行情况是否正常
            logResult("验证失败");
        }
    }
    
    /*        页面跳转处理方法;        */
    public function returnurl(){
        $alipay_config=C('alipay_config');
         //计算得出通知验证结果
        $alipayNotify = new \AlipayNotify($alipay_config);
        $verify_result = $alipayNotify->verifyReturn();
        if($verify_result) {//验证成功
        //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
            //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表
       //商户订单号

	$out_trade_no = $_GET['out_trade_no'];

	//支付宝交易号

	$trade_no = $_GET['trade_no'];

	//交易状态
	$trade_status = $_GET['trade_status'];
          if($_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
			  echo $out_trade_no.'<br />';
			$order=D('Order');
			 //根据订单号查询订单id
			$oinfo=$order->where("order_sn='$out_trade_no'")->field('order_id')->find();
			echo $order_id=$oinfo['order_id'];		
		//判断该笔订单是否在商户网站中已经做过处理
		echo $sql="update jiuji_order set order_status=4 where order_id='$order_id'";
		echo '<br />';
		$rst=$order->execute($sql);
		//show_bug($rst);
		if($rst){
			echo "<script>alert('您已付款成功,等待发货');location.href='../Center/uorder'</script>";
		}else{
			echo '更新失败';	
		}
		
			//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
			//如果有做过处理,不执行商户的业务程序
    }
    else {
      echo "trade_status=".$_GET['trade_status'];
    }
		
	/*echo "验证成功<br />";
	echo "trade_no=".$trade_no;*/

	//——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
	
}
else {
    //验证失败
    //如要调试,请看alipay_notify.php页面的verifyReturn函数
    echo "验证失败";
}
       // $this->display();
}
}</span></strong></span>
3.模板里如下:

支付的配置信息如下:


index.html如下:

<span style="color:#009900;"><strong><span style="font-size:18px;"><?php
/* *
 * 功能:支付宝纯担保交易接口接口调试入口页面
 * 版本:3.3
 * 日期:2012-07-23
 * 说明:
 * 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
 */

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>支付宝纯担保交易接口接口</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
* {
	margin: 0;
	padding: 0;
}
ul, ol {
	list-style: none;
}
.title {
	color: #ADADAD;
	font-size: 14px;
	font-weight: bold;
	padding: 8px 16px 5px 10px;
}
.hidden {
	display: none;
}
.new-btn-login-sp {
	border: 1px solid #D74C00;
	padding: 1px;
	display: inline-block;
}
.new-btn-login {
	background-color: #ff8c00;
	color: #FFFFFF;
	font-weight: bold;
	border: medium none;
	width: 82px;
	height: 28px;
}
.new-btn-login:hover {
	background-color: #ffa300;
	width: 82px;
	color: #FFFFFF;
	font-weight: bold;
	height: 28px;
}
.bank-list {
	overflow: hidden;
	margin-top: 5px;
}
.bank-list li {
	float: left;
	width: 153px;
	margin-bottom: 5px;
}
#main {
	width: 750px;
	margin: 0 auto;
	font-size: 14px;
	font-family: '宋体';
}
#logo {
	background-color: transparent;
	background-image: url("../Key/images/new-btn-fixed.png");
	border: medium none;
	background-position: 0 0;
	width: 166px;
	height: 35px;
	float: left;
}
.red-star {
	color: #f00;
	width: 10px;
	display: inline-block;
}
.null-star {
	color: #fff;
}
.content {
	margin-top: 5px;
}
.content dt {
	width: 160px;
	display: inline-block;
	text-align: right;
	float: left;
}
.content dd {
	margin-left: 100px;
	margin-bottom: 5px;
}
#foot {
	margin-top: 10px;
}
.foot-ul li {
	text-align: center;
}
.note-help {
	color: #999999;
	font-size: 12px;
	line-height: 130%;
	padding-left: 3px;
}
.cashier-nav {
	font-size: 14px;
	margin: 15px 0 10px;
	text-align: left;
	height: 30px;
	border-bottom: solid 2px #CFD2D7;
}
.cashier-nav ol li {
	float: left;
}
.cashier-nav li.current {
	color: #AB4400;
	font-weight: bold;
}
.cashier-nav li.last {
	clear: right;
}
.alipay_link {
	text-align: right;
}
.alipay_link a:link {
	text-decoration: none;
	color: #8D8D8D;
}
.alipay_link a:visited {
	text-decoration: none;
	color: #8D8D8D;
}
</style>
</head>
<body text=#000000 bgColor=#ffffff leftMargin=0 topMargin=4>
<div id="main">
  <div id="head">
    <dl class="alipay_link">
      <a target="_blank" href="http://www.alipay.com/"><span>支付宝首页</span></a>| <a target="_blank" href="https://b.alipay.com/home.htm"><span>商家服务</span></a>| <a target="_blank" href="http://help.alipay.com/support/index_sh.htm"><span>帮助中心</span></a>
    </dl>
    <span class="title">支付宝纯担保交易接口快速通道</span> </div>
  <div class="cashier-nav">
    <ol>
      <li class="current">1、确认信息 →</li>
      <li>2、点击确认 →</li>
      <li class="last">3、确认完成</li>
    </ol>
  </div>
  <form name=alipayment action="{$smarty.const.__CONTROLLER__}/payorder" method=post target="_blank">
    <div id="body" style="clear:left">
      <dl class="content">
        <dt>商户订单号:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDout_trade_no" value="{$WIDout_trade_no}{$WIDout_trade_no1}" />
          <span>商户网站订单系统中唯一订单号,必填 </span> </dd>
        <dt>订单名称:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDsubject" value="{$WIDsubject}{$WIDsubject1}" />
          <span>必填 </span> </dd>
        <dt>付款金额:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDprice" value="{$WIDprice}{$WIDprice1}" />
          <span>必填 </span> </dd>
        <dt>商品展示地址:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDshow_url" value="http://www.yonglidong.cn/jiuji/shop" />
          <span>需以http://开头的完整路径,如:http://www.商户网站.com/myorder.html </span> </dd>
        <dt>收货人姓名:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDreceive_name" value="{$WIDreceive_name}{$WIDreceive_name1}"/>
          <span>如:张三 </span> </dd>
        <dt>收货人地址:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDreceive_address" value="{$consignee_province}{$consignee_city}{$consignee_district}{$consignee_address}{$consignee_province1}{$consignee_city1}{$consignee_district1}{$consignee_address1}" />
          <span>如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号 </span> </dd>
        <dt>收货人邮编:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDreceive_zip" value="{$WIDreceive_zip}{$WIDreceive_zip1}" />
          <span>如:123456 </span> </dd>
        <dt>收货人电话号码:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDreceive_phone" value="{$WIDreceive_phone}{$WIDreceive_phone1}" />
          <span>如:0571-88158090 </span> </dd>
        <dt>收货人手机号码:</dt>
        <dd> <span class="null-star">*</span>
          <input size="30" name="WIDreceive_mobile" value="{$WIDreceive_mobile}{$WIDreceive_mobile1}" />
          <span>如:13312341234</span> </dd>
        <dt></dt>
        <dd> <span class="new-btn-login-sp">
          <button class="new-btn-login" type="submit" style="text-align:center;">确 认</button>
          </span> </dd>
      </dl>
    </div>
  </form>
  <div id="foot">
    <ul class="foot-ul">
      <li><font class="note-help">如果您点击“确认”按钮,即表示您同意该次的执行操作。 </font></li>
      <li> 支付宝版权所有 2011-2015 ALIPAY.COM </li>
    </ul>
  </div>
</div>
</body>
</html></span></strong></span>

4.还有就是提交订单时,提交成功顺便跳到支付页面,所以订单控制器里如下:


附加,用户订单如下所示:

顺便再写一个,用户点击订单号查看商品和收货信息:

uorder_sub.html

<span style="color:#009900;"><strong><span style="font-size:18px;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="YONGDA v1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>用户中心_JIUJI商城 - Powered by JIUJI</title>
<link href="{$smarty.const.LOGO_URL}jiujilogo.ico" rel="shortcut icon">
<link href="{$smarty.const.CSS_URL}style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
{
literal
}
table {
	border: 1px solid #dddddd;
	border-collapse: collapse;
	width: 100%;
	margin: auto;
}
td {
	border: 1px solid #dddddd;
}
#consignee_addr {
	width: 450px;
}
{
/literal
}
</style>
</head>
<body>
<div class="block clearfix" style="position: relative; height: 98px;"> <a href="#" name="top"><img class="logo" alt="" src="{$smarty.const.IMG_URL}logo.gif" /></a>
  <div id="topNav" class="clearfix">
    <div style="float: left;"> <font id="ECS_MEMBERZONE">
      <div id="append_parent"></div>
      欢迎光临本店 
      {if $smarty.session.username}
      欢迎您:{$smarty.session.username} <a href="{$smarty.const.__MODULE__}/User/logout" style="color:red;" οnclick="if (confirm('确定要退出登录吗?')) return true; else return false;">退出登录</a> {else} <a href="{$smarty.const.__MODULE__}/User/login"> 登录</a> <a href="{$smarty.const.__MODULE__}/User/register">注册</a> {/if} </font> </div>
    <div style="float: right;"> <a href="{$smarty.const.__MODULE__}/Cart/showlist">查看购物车</a> | <a href="{$smarty.const.__MODULE__}/Center/index">用户中心</a> | <a href="#">标签云</a> | <a href="#">报价单</a> </div>
  </div>
  <div id="mainNav" class="clearfix">
    <ul>
      <li><a href="{$smarty.const.__MODULE__}/Index/index" class="cur">首页<span></span></a></li>
      {foreach $pcinfo as $k=>$v}
      <li><a href="{$smarty.const.__MODULE__}/Goods/showlist/category_id/{$v.category_id}" class="cur">{$v.category_name}<span></span></a></li>
      {/foreach}
      <li><a href="#" class="cur">留言板<span></span></a></li>
    </ul>
  </div>
</div>
<div class="header_bg">
  <div style="float: left; font-size: 14px; color:white; padding-left: 15px;"> </div>
  <form id="searchForm" method="get" action="{$smarty.const.__MODULE__}/Goods/search">
    <input name="keywords" id="keyword" type="text" />
    <input name="imageField" value=" " class="go" style="cursor: pointer; background: url('{$smarty.const.IMG_URL}sousuo.gif') no-repeat scroll 0% 0% transparent; width: 39px; height: 20px; border: medium none; float: left; margin-right: 15px; vertical-align: middle;" type="submit" />
  </form>
</div>
<div class="blank5"></div>
<div class="header_bg_b">
  <div class="f_r" style="padding-right: 10px;"> <img style="vertical-align: middle;" src="{$smarty.const.IMG_URL}biao3.gif"> <span class="cart" id="ECS_CARTINFO"> <a href="{$smarty.const.__MODULE__}/Cart/showlist" title="查看购物车">{$Number}</a></span> <a href="{$smarty.const.__MODULE__}/Cart/showlist"><img style="vertical-align: middle;" src="{$smarty.const.IMG_URL}biao7.gif"></a> </div>
</div>
<div class="block box">
  <div class="blank"></div>
  <div id="ur_here"> 当前位置: <a href="#">首页</a> <code>></code> 用户中心<code>></code> 我的订单 </div>
</div>
<div class="blank"></div>
<div class="blank"></div>
<div class="block clearfix">
  <div class="AreaL">
    <div class="box">
      <div class="box_1">
        <div class="userCenterBox">
          <div class="userMenu"> <a href=""><img src="{$smarty.const.IMG_URL}u1.gif" alt="" /> 欢迎页</a> <a href="{$smarty.const.__CONTROLLER__}/index"><img src="{$smarty.const.IMG_URL}u2.gif" alt="" /> 用户信息</a> <a class="curs" href="{$smarty.const.__CONTROLLER__}/uorder" ><img src="{$smarty.const.IMG_URL}u3.gif" alt="" /> 我的订单</a> <a href="{$smarty.const.__CONTROLLER__}/address"><img src="{$smarty.const.IMG_URL}u4.gif" alt="" /> 收货地址</a> <a href="#"><img src="{$smarty.const.IMG_URL}u6.gif" alt="" /> 我的留言</a><a href="#"><img src="{$smarty.const.IMG_URL}u11.gif" alt="" /> 我的评论</a> 
            <!--<a href="user.php?act=group_buy">我的团购</a>--> 
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="AreaR">
    <div class="box">
      <div class="box_1">
        <div class="userCenterBox boxCenterList clearfix" style=""> {*{if $smarty.session.username}*}
          <h5><span>我的订单</span></h5>
          <div class="blank"></div>
          <table class="table_a" border="1" width="100%">
            <tbody>
              <tr style="font-weight: bold;">
                <td>订单商品id</td>
                <td>订单id</td>
                <td>订单编号</td>
                <td>订单对应商品id</td>
                <td>订单对应商品名称</td>
                <td>商品单价</td>
                <td>商品数量</td>
                <td>商品价格小计</td>
              </tr>
            {foreach $subinfo as $k=>$v}
            <tr id="product1">
              <td>{$v.sub_id}</td>
              <td>{$v.sub_pid}</td>
              <td>{$v.sub_order_sn}</td>
              <td>{$v.sub_goods_id}</td>
              <td>{$v.sub_goods_name}</td>
              <td>{$v.sub_goods_price}</td>
              <td>{$v.sub_goods_buy_number}</td>
              <td>{$v.sub_goods_buy_sum}</td>
            </tr>
            {/foreach}
            <tr>
              <td colspan="20" style="text-align: center;"></td>
            </tr>
              </tbody>
            
          </table>
          <table cellpadding="5" cellspacing="5" width="99%" style="margin-top:50px;" class="table_a" border="1" width="100%">
          <tbody>
            <!-- <tr style="font-weight: bold;">
        </tr>
        <tr>
      </tr>-->
          {foreach $userinfo as $k=>$v}
          <tr id="product1">
            <td>收货人信息id</td>
            <td>{$v.consignee_id}</td>
            <td>收货人所属会员id</td>
            <td>{$v.consignee_u_id}</td>
            <td>收货人真实姓名</td>
            <td>{$v.consignee_name}</td>
            <td>收货人邮箱</td>
            <td>{$v.consignee_email}</td>
            <td>收货人省份</td>
            <td>{$v.consignee_province}</td>
            <td>收货人城市</td>
            <td>{$v.consignee_city}</td>
          </tr>
          <tr>
            <td>收货人地区</td>
            <td>{$v.consignee_district}</td>
            <td>收货人详细地址</td>
            <td>{$v.consignee_address}</td>
            <td>收货人邮编</td>
            <td>{$v.consignee_zipcode}</td>
            <td>收货人电话</td>
            <td>{$v.consignee_tel}</td>
            <td>收货人手机</td>
            <td>{$v.consignee_mobile}</td>
            <td>最佳收获时间</td>
            <td>{$v.consignee_best_time}</td>
          </tr>
          {/foreach}
          <tr>
            <td colspan="20" style="text-align: center;"></td>
          </tr>
          </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="blank"></div>
<div class="blank"></div>
<div class="block"> <a href="#" target="_blank" title="YONGDA商城"><img alt="YONGDA商城" src="{$smarty.const.IMG_URL}di.jpg" /></a>
  <div class="blank"></div>
</div>
<div class="blank"></div>
<div id="bottomNav" class="box block">
  <div class="bNavList clearfix"> <a href="#">免责条款</a> | <a href="#">隐私保护</a> | <a href="#">Powered by <strong><span style="color: rgb(51, 102, 255);">JIUJI</span></strong></a> | <a href="#">联系我们</a> | <a href="#">公司简介</a> | <a href="#">批发方案</a> | <a href="#">配送方式</a> </div>
</div>
<div id="footer">
  <div class="text"> © 2015 JIUJI版权所有,并保留所有权利。<br />
  </div>
</div>
</body>
</html></span></strong></span>

初学者如需购买thinkphp程序(包括前后台),加个人微信LBXZFR2013


微信扫描关注“公众号” 有惊喜

公众号ID“lbxzsan7378”



  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值