Authored by weiqingting

提交订单

  1 +{{> layout/simple-header}}
  2 +<div class="order-save-page yoho-page clearfix">
  3 +{{# orderSave}}
  4 + <div class="order-edit">
  5 + <div class="order-title">
  6 + <ul>
  7 + <li>查看购物车</li>
  8 + <li class="active">填写订单</li>
  9 + <li class="end">付款,完成购买</li>
  10 + </ul>
  11 + </div>
  12 +
  13 + <div class="order-edit-main">
  14 + <h2 class="title">请填写并核对以下信息</h2>
  15 + <div class="order-content">
  16 + <div class="order-selection address-list">
  17 + <h2>收货地址:<span>[修改]</span></h2>
  18 + <div class="address-list-inner">
  19 + <ul class="exist-address-list">
  20 + {{#each hasAddress}}
  21 + <li class="has-exist-address">
  22 + <input class="radio" type="radio" name="exist-address" id="{{id}}" {{#if checked}}checked{{/if}}/>
  23 + <label for="{{id}}">
  24 + <strong>{{user}}</strong>
  25 + <span>{{address}}</span>
  26 + <b class="default-address">设为默认地址</b>
  27 + <div class="order-modify-btn">
  28 + <span class="address-modify">[修改]</span>
  29 + <span class="address-del">[删除]</span>
  30 + </div>
  31 + </label>
  32 + </li>
  33 + {{/each}}
  34 +
  35 + <li class="use-new-address">
  36 + <input class="radio add-address" type="radio" name="exist-address" id=""/>
  37 + <label for="">使用新地址</label>
  38 + </li>
  39 + </ul>
  40 +
  41 + <div class="address-manage hide">
  42 + <ul>
  43 + <li>
  44 + <span class="address-legend"><i>*</i>收货人姓名:</span>
  45 + <input type="text" name="name" class="name text-input"/>
  46 + <span>请填写您的真实姓名,最多5个汉字</span>
  47 + </li>
  48 + <li>
  49 + <span class="address-legend"><i>*</i>省市:</span>
  50 + <select name="province" id="" class="text-input">
  51 + <option>请选择省份</option>
  52 + </select>
  53 + <select name="city" id="" class="text-input">
  54 + <option>请选择城市</option>
  55 + </select>
  56 + <select name="county" id="" class="text-input">
  57 + <option>请选择区县</option>
  58 + </select>
  59 + <input type="text" name="address" class="text-input"/>
  60 + <span>标'*'的为支持加急送的地区,请输入收货的详细地址</span>
  61 + </li>
  62 + <li>
  63 + <span class="address-legend"><i>*</i>手机号码:</span>
  64 + <input type="text" name="phone" class="text-input"/>
  65 + <span>填写正确手机号便于接收发货和收货通知</span>
  66 + </li>
  67 + <li>
  68 + <span class="address-legend">固定电话:</span>
  69 + <div class="address-tel-input">
  70 + <input type="text" name="tel-code" class="tel-lengend text-input"/>
  71 + <input type="text" name="tel" class="text-input"/>
  72 +
  73 + </div>
  74 + <span>如:010-12345678,固话和手机号至少填一项</span>
  75 + </li>
  76 + <li>
  77 + <span class="address-legend">电子邮件:</span>
  78 + <input type="text" name="mail" class="text-input"/>
  79 + <span>用来接收订单提醒邮件,便于您及时了解订单状态</span>
  80 + </li>
  81 + <li>
  82 + <span class="address-legend">邮编:</span>
  83 + <input type="text" name="code" class="text-input"/>
  84 + <span>请填写准确的邮编,以确保商品尽快送达</span>
  85 + </li>
  86 + </ul>
  87 + </div>
  88 + <span class="save-btn">保存并送到这个地址</span>
  89 + </div>
  90 + </div>
  91 +
  92 +
  93 +
  94 + <div class="order-selection pay-time">
  95 + <h2>支付及送货时间:<span class="switch-pay-modify">[修改]</span></h2>
  96 + <ul>
  97 + <li>付款方式:在线支付</li>
  98 + <li>送货时间:只工作日送货(双休日、节假日不用送)</li>
  99 + <li>送货前联系我:否</li>
  100 + </ul>
  101 +
  102 + <div class="pay-time-modify hide">
  103 + <h3>支付方式</h3>
  104 +
  105 + <ul>
  106 + <li class="pay-dashed-hr pay-recommend">
  107 + <div class="pay-type-legend">
  108 + <input checked class="radio" name="pay-type" type="radio" id=""/>
  109 + <label for="">在线支付(推荐)</label>
  110 + </div>
  111 + <span class="pay-type-legend">查看支持在线支付的银行和平台</span>
  112 + <div class="support-type hide">
  113 + <h4>支持以下支付平台在线支付:</h4>
  114 + <ul>
  115 + {{#each supportLine}}
  116 +
  117 + <li><img src="{{src}}" alt=""/></li>
  118 + {{/each}}
  119 + </ul>
  120 + <h4>支持以下银行在线支付:</h4>
  121 + <ul>
  122 + {{#each supportBank}}
  123 + <li><img src="{{src}}" alt=""/></li>
  124 + {{/each}}
  125 + </ul>
  126 + </div>
  127 + </li>
  128 +
  129 + <li>
  130 + <input class="radio" name="pay-type" type="radio" id=""/>
  131 + <label for="">付款方式:货到付款</label>
  132 + <span>注:订单中有限量商品、预售商品、化妆品或者订单金额超过10000元不可以选择货到付款。</span>
  133 + </li>
  134 + </ul>
  135 +
  136 + <h3>送货时间</h3>
  137 + <ul>
  138 + <li>
  139 + <input checked class="radio" name="pay-time-radio" type="radio" id=""/>
  140 + <label for="">只工作日送货(双休日、节假日不送)</label>
  141 + </li>
  142 +
  143 + <li>
  144 + <input class="radio" name="pay-time-radio" type="radio" id=""/>
  145 + <label for="">工作日、双休日和节假日均送货</label>
  146 + </li>
  147 +
  148 + <li class="pay-dashed-hr">
  149 + <input class="radio" name="pay-time-radio" type="radio" id=""/>
  150 + <label for="">只双休日、节假日送货(工作时间不送货)</label>
  151 + </li>
  152 +
  153 + <li class="pay-dashed-hr pay-type-tips">声明:我们会努力按照您指定的时间配送,但因为天气、交通等各类因素影响,您的订单有可能会有延误现象,敬请谅解!</li>
  154 +
  155 + <li>
  156 + <span>送货前是否联系:</span>
  157 + <input class="radio" name="call-me" type="radio" id=""/>
  158 + <label for="">是</label>
  159 + <input checked class="radio" name="call-me" type="radio" id=""/>
  160 + <label for="">否</label>
  161 + </li>
  162 + </ul>
  163 +
  164 + <span class="pay-btn">确定</span>
  165 + </div>
  166 + </div>
  167 +
  168 + <div class="order-selection select-express">
  169 + <h2>选择快递:</h2>
  170 + {{#each carriagelist}}
  171 + <div class="express-list">
  172 + <input class="radio" type="radio" name="carriagegroup" id="common-{id}" value="{{value}}"/>
  173 + <label for="common-express">{{name}}:&nbsp;&nbsp;运费 {{value}} {{desc}}</label>
  174 + </div>
  175 + {{/each}}
  176 + <div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。</div>
  177 + </div>
  178 + </div>
  179 + </div>
  180 + </div>
  181 + <div class="order-pay">
  182 + <div class="pay-wapper">
  183 + <table>
  184 + <thead>
  185 + <tr>
  186 + <th style="width:40%;">
  187 + 商品信息
  188 + </th>
  189 + <th style="width:10%;">单价(元)</th>
  190 + <th style="width:10%;">返YOHO币</th>
  191 + <th style="width:10%;">数量</th>
  192 + <th style="width:10%;">小计(元)</th>
  193 + <th style="width:20%;">商品总价(元)</th>
  194 + </tr>
  195 + </thead>
  196 + <tbody>
  197 + {{#each orderProducts}}
  198 + <tr>
  199 + <td>
  200 + <div class="pay-pro">
  201 + <a class="pay-pro-icon" href="{{href}}"><img src="{{src}}" /></a>
  202 + <p class="pay-pro-info">
  203 + <a href="#">{{name}}</a>
  204 + <span>颜色:蓝色 尺码:L</span>
  205 + </p>
  206 + </div>
  207 + </td>
  208 + <td>{{price}}</td>
  209 + <td>{{coin}}</td>
  210 + <td>{{count}}</td>
  211 + <td></td>
  212 + <td></td>
  213 + </tr>
  214 + {{/each}}
  215 + </tbody>
  216 + </table>
  217 + <!--YOHO-->
  218 + <div class="play-content clearfix">
  219 + <div class="play-left">
  220 + <dl class="play-piao-pan pan">
  221 + <dt>索要发票</dt>
  222 + <dd>
  223 + <div class="play-pan">
  224 + <ul>
  225 + <li><label>发票抬头 :</label><input type="text" class="textbox" id="piaodesc" /></li>
  226 + <li><label>发票类型 :</label> <select class="dropdown" id="piaotype">
  227 + <option value="-1">请选择</option>
  228 + {{#each piaotypes}}
  229 + <option value="{{value}}">{{name}}</option>
  230 + {{/each}}
  231 + </select> </li>
  232 + </ul>
  233 + </div>
  234 + </dd>
  235 + </dl>
  236 + <dl class="play-remark-pan pan">
  237 + <dt>添加备注信息</dt>
  238 + <dd>
  239 + <div class="play-pan">
  240 + <textarea class="textbox" id="notedesc"></textarea>
  241 + <p class="note">声明:备注中有关收货人信息、支付方式、配送方式、发票信息等购买要求一律以上面的选择为准,备注无效。</p>
  242 + <p>是否打印价格:
  243 + <input name="isPP" id="isPPY" type="radio" value="Y" checked="">
  244 + <label for="isPPY">是</label>
  245 + <input name="isPP" id="isPPN" type="radio" value="N">
  246 + <label for="isPPN">否</label>
  247 + (如:送朋友的商品可不打印价格哦!)
  248 + </p>
  249 + </div>
  250 + </dd>
  251 + </dl>
  252 + </div>
  253 + <div class="play-right">
  254 + <ul class="play-total">
  255 + <li><label>发票抬头:</label>+¥<em>0.00</em></li>
  256 + <li><label>活动:</label>-¥<em>0.00</em></li>
  257 + <li class="red"><label>运费:</label>+¥<em>0.00</em></li>
  258 + <li><label>优惠券支付<a href="javascript:void(0);" to="play-juan-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
  259 + <li><label>使用YOHO币<a href="javascript:void(0);" to="play-bi-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
  260 + </ul>
  261 + <dl class="play-juan-pan pan">
  262 + <dt>使用优惠卷支付</dt>
  263 + <dd>
  264 + <div class="play-pan">
  265 + <p class="strong">请选择您要使用的优惠券: </p>
  266 + <p class="strong orange">(OUTLET商品除免邮券外不可使用优惠券)</p>
  267 + <p class="strong orange">(订单中使用优惠券将不赠送商品返还的YOHO币)</p>
  268 + <div class="play-juan">
  269 + <ul>
  270 + <li>
  271 + <input name="juangroup" type="radio" value="">
  272 + <label>直接输入优惠码: </label>
  273 + <input type="text" class="textbox" id="juancode" />
  274 + </li>
  275 + {{#each juanlist}}
  276 + <li>
  277 + <input name="juangroup" type="radio" value="{{value}}">
  278 + <label>{{name}} </label>
  279 + </li>
  280 + {{/each}}
  281 + </ul>
  282 +
  283 + </div>
  284 +
  285 + <p class="errtip red"></p>
  286 + <div class="btn-group clearfix">
  287 + <input type="button" class="ok" value="确定" id="juansubmit"/>
  288 + <input type="button" class="cancel" value="取消"/>
  289 + </div>
  290 + </div>
  291 + </dd>
  292 + </dl>
  293 + <dl class="play-bi-pan pan">
  294 + <dt>使用YOHO币支付</dt>
  295 + <dd>
  296 + <div class="play-pan">
  297 + <div class="strong">
  298 + 使用YOHO币支付:
  299 + <input type="text" class="textbox" id="biprice" />
  300 +
  301 + </div>
  302 + <p >
  303 + 您目前有YOHO币 <em class="strong">100</em>
  304 + </p>
  305 + <div class="btn-group clearfix">
  306 + <input type="button" class="ok" value="确定" id="bisubmit"/>
  307 + <input type="button" class="cancel" value="取消"/>
  308 + </div>
  309 + </div>
  310 + </dd>
  311 + </dl>
  312 + </div>
  313 + </div>
  314 + </div>
  315 +
  316 + <div class="to-play">
  317 + <p>您需要实际支付金额:<em>0.00</em>元</p>
  318 + <div class="btn-group clearfix">
  319 + <input type="button" class="submit" value="确定"/>
  320 + </div>
  321 + </div>
  322 + </div>
  323 +{{/ orderSave}}
  324 +</div>
  325 +{{> layout/footer}}
@@ -96,9 +96,18 @@ @@ -96,9 +96,18 @@
96 </script> 96 </script>
97 {{/if}} 97 {{/if}}
98 98
  99 +<<<<<<< HEAD
99 {{!-- 品牌页 --}} 100 {{!-- 品牌页 --}}
100 {{#if brandsHomePage}} 101 {{#if brandsHomePage}}
101 <script> 102 <script>
102 seajs.use('js/brand/index'); 103 seajs.use('js/brand/index');
103 </script> 104 </script>
  105 +=======
  106 +
  107 +{{!-- 订单保存--}}
  108 +{{#if orderSavePage}}
  109 +<script>
  110 + seajs.use('js/order/save');
  111 +</script>
  112 +>>>>>>> feature/order-save
104 {{/if}} 113 {{/if}}
  1 +/**
  2 + * @description: 地址管理
  3 + * @author: chenglong.wang@yoho.cn
  4 + */
  5 +
  6 +var $ = require('yoho.jquery');
  7 +
  8 +var isProvinceChecked = false;
  9 +
  10 +var $addressManage = $('.address-manage'),
  11 + $province = $addressManage.find('.text-input[name="province"]'),
  12 + $city = $addressManage.find('.text-input[name="city"]'),
  13 + $county = $addressManage.find('.text-input[name="county"]'),
  14 + $selectList = $addressManage.find('.text-input[name="province"], .text-input[name="city"]'),
  15 + $addressList = $('.address-list'),
  16 + $name = $addressManage.find('.text-input[name="name"]'),
  17 + $phone = $addressManage.find('.text-input[name="phone"]'),
  18 + $telCode = $addressManage.find('.text-input[name="code-tel"]'),
  19 + $tel = $addressManage.find('.text-input[name="tel"]'),
  20 + $mail = $addressManage.find('.text-input[name="mail"]'),
  21 + $address = $addressManage.find('.text-input[name="address"]'),
  22 + $code = $addressManage.find('.text-input[name="code"]'),
  23 + $saveBtn = $('.save-btn');
  24 +
  25 +function structureOption($obj, data) {
  26 +
  27 + var key,
  28 + optionHtml,
  29 + defaultOption;
  30 +
  31 + for (key in data) {
  32 +
  33 + if (data[key].checked) {
  34 + optionHtml += '<option selected value="' + data[key].value + '">' + data[key].name + '</option>';
  35 + } else {
  36 + optionHtml += '<option value="' + data[key].value + '">' + data[key].name + '</option>';
  37 + }
  38 +
  39 +
  40 + }
  41 +
  42 + $obj.html(optionHtml);
  43 +
  44 + if ($obj.attr('name') === 'province') {
  45 + defaultOption = '<option value="0">请选择省份</option>';
  46 + } else if ($obj.attr('name') === 'city') {
  47 + defaultOption = '<option value="0">请选择城市</option>';
  48 + } else if ($obj.attr('name') === 'county') {
  49 + defaultOption = '<option value="0">请选择区县</option>';
  50 + }
  51 + $obj.prepend($(defaultOption));
  52 +
  53 +}
  54 +/**
  55 + * @description: 改函数会返回地址信息
  56 + * d {Object} type: 'getProvince'获取省 type: 'getCity'获取城市 type: 'getCounty'获取县
  57 + * id: 0 && type: 'getProvince' 获取所有省,默认没有选中项
  58 + * id !== 0 && type: 'getProvince' 获取所有省,默认选中用户所在的省
  59 + */
  60 +function getAddress(d, callback) {
  61 +
  62 + var $obj,
  63 + url;
  64 +
  65 + if (d.type === 'getProvince') {
  66 + url = 'getProvince';
  67 +
  68 + $obj = $province;
  69 + } else if (d.type === 'getCity') {
  70 + url = 'getCity';
  71 +
  72 + $obj = $city;
  73 + } else if (d.type === 'getCounty') {
  74 + url = 'getCounty';
  75 +
  76 + $obj = $county;
  77 + }
  78 + $.ajax({
  79 + type: 'post',
  80 + url: '/order/save/' + url,
  81 + dataType: 'json',
  82 + data: {
  83 + id: d.id
  84 + }
  85 + }).then(function(data) {
  86 +
  87 + structureOption($obj, data);
  88 +
  89 + if (typeof callback === 'function') {
  90 + callback();
  91 + }
  92 +
  93 + }).fail(function() {
  94 +
  95 + //todo
  96 + });
  97 +}
  98 +
  99 +function getUserInfo(id) {
  100 + $.ajax({
  101 + type: 'post',
  102 + url: 'getUserInfo',
  103 + data: {
  104 + id: id
  105 + }
  106 + }).then(function(data) {
  107 + var key;
  108 +
  109 + for (key in data) {
  110 +
  111 + if (data.hasOwnProperty(key)) {
  112 + if (!!data[key]) {
  113 + eval('$' + key).val(data[key]);
  114 + }
  115 + }
  116 + }
  117 +
  118 + }).fail(function() {
  119 +
  120 + });
  121 +}
  122 +
  123 +//添加地址
  124 +exports.newAddress = function(id) {
  125 +
  126 + var pId = id !== 'undefined' ? id : 0;
  127 +
  128 + if (!!pId) {
  129 + getUserInfo();
  130 + }
  131 +
  132 + //获取省
  133 + getAddress({
  134 + id: pId,
  135 + type: 'getProvince'
  136 + }, function() {
  137 +
  138 + var provinceId = $province.val();
  139 +
  140 + if (provinceId !== '0') {
  141 +
  142 + //如果获取的省有默认选中项则获取市
  143 + getAddress({
  144 + id: provinceId,
  145 + type: 'getCity'
  146 + }, function() {
  147 +
  148 + var cityId = $city.val();
  149 +
  150 + //如果获取的市有默认选中项则获取县
  151 + if (cityId !== '0') {
  152 + getAddress({
  153 + id: cityId,
  154 + type: 'getCounty'
  155 + });
  156 + }
  157 + });
  158 + }
  159 + });
  160 +
  161 + $selectList.change(function() {
  162 + var $this = $(this);
  163 +
  164 + if ($this.attr('name') === 'province') {
  165 + getAddress({
  166 + id: $this.val(),
  167 + type: 'getCity'
  168 + }, function() {
  169 + isProvinceChecked = true;
  170 + });
  171 + }
  172 +
  173 + if ($this.attr('name') === 'city' && isProvinceChecked) {
  174 + getAddress({
  175 + id: $this.val(),
  176 + type: 'getCounty'
  177 + });
  178 + }
  179 + });
  180 +};
  181 +
  182 +//修改地址
  183 +exports.modifyAddress = function() {
  184 +
  185 + $addressList.click(function(event) {
  186 + var $this = $(event.target),
  187 + id = $this.closest('li').find('.radio').attr('id');
  188 +
  189 + if ($this.hasClass('address-modify')) {
  190 + $addressManage.removeClass('hide');
  191 + exports.newAddress(id);
  192 + } else if ($this.hasClass('address-del')) {
  193 +
  194 + $.ajax({
  195 + type: 'post',
  196 + url: '/order/save/addressDel',
  197 + data: {
  198 + id: id
  199 + }
  200 + }).then(function(data) {
  201 +
  202 + if (!!data.status) {
  203 + $this.closest('li').remove();
  204 + }
  205 + }).fail(function() {
  206 +
  207 + //todo
  208 + });
  209 + } else if ($this.hasClass('default-address')) {
  210 +
  211 + // 设为默认地址
  212 + $.ajax({
  213 + type: 'post',
  214 + url: '/order/save/defaultAddress',
  215 + data: {
  216 + id: id
  217 + }
  218 + }).then(function(data) {
  219 +
  220 + if (!!data.status) {
  221 + $this.remove();
  222 + }
  223 + }).fail(function() {
  224 +
  225 + //todo
  226 + });
  227 + }
  228 + });
  229 +};
  230 +
  231 +exports.saveAddress = function() {
  232 + $saveBtn.click(function() {
  233 +
  234 + var name = $name.val(),
  235 + province = $province.val(),
  236 + city = $city.val(),
  237 + county = $county.val(),
  238 + address = $address.val(),
  239 + phone = $phone.val(),
  240 + telCode = $telCode.val(),
  241 + tel = $tel.val(),
  242 + mail = $mail.val(),
  243 + code = $code.val(),
  244 + id = new Date();
  245 +
  246 + $.ajax({
  247 + type: 'post',
  248 + url: '/order/save/addressSave',
  249 + data: {
  250 + name: name,
  251 + province: province,
  252 + city: city,
  253 + county: county,
  254 + address: address,
  255 + phone: phone,
  256 + tel: tel,
  257 + telCode: telCode,
  258 + mail: mail,
  259 + code: code,
  260 + id: id * 1
  261 + }
  262 + }).then(function(data) {
  263 +
  264 + var addressStr;
  265 +
  266 + if (!!data.status) {
  267 + addressStr = '<li>' +
  268 + '<input class="radio" type="radio" name="address" id="' + id * 1 + '" />' +
  269 + '<label for="' + id * 1 + '">' +
  270 + '<strong>' + name + '</strong>' +
  271 + '<span>' + address + '</span>' +
  272 + '<a href="javascript:void(0);">设为默认地址</a>' +
  273 + '<div class="order-modify-btn">' +
  274 + '<span class="address-modify">[修改]</span>' +
  275 + '<span class="address-del">[删除]</span>' +
  276 + '</div>' +
  277 + '</label>' +
  278 + '</li>';
  279 +
  280 + $('.use-new-address').before($(addressStr));
  281 + }
  282 + }).fail(function() {
  283 +
  284 + //todo
  285 + });
  286 + });
  287 +};
  1 +/**
  2 + * @description: 订单保存
  3 + * @time: 2015/12/21
  4 + */
  5 +
  6 +var $ = require('yoho.jquery');
  7 +
  8 +var address = require('./address');
  9 +
  10 +var Order = {
  11 + /*业务数据(人民币)*/
  12 + Data: {
  13 + product: 0,//商品价格
  14 + activity: 0,//活动
  15 + carriage: 0,//邮费
  16 + juan: 0,//优惠卷
  17 + yohocoin: 0//YOHO币
  18 + },
  19 + /*view 交互*/
  20 + UI: {
  21 + e: {
  22 + $pan: $('.pan'),
  23 + $jc: $('#juancode'),
  24 + $bp: $('#biprice'),
  25 + $statistics: $('li', '.play-total'),
  26 + $tobi: $('p em', '.play-bi-pan .play-pan'),
  27 + $cancel: $('.cancel', '.btn-group'),
  28 + $total: $('em', '.to-play'),
  29 + $tbody: $('table tbody', '.pay-wapper'),
  30 +
  31 + //请填写并核对一下信息
  32 + $orderSelectionSave: $('.address-list h2 span'),
  33 + $addAddress: $('.add-address'),
  34 + $addressManage: $('.address-manage'),
  35 + $spanPayTypeLegend: $('span.pay-type-legend'),
  36 + $supportType: $('.support-type'),
  37 + $existAddressList: $('.exist-address-list').find('li'),
  38 + $existAddress: $('.exist-address-list').find('input[name="exist-address"]'),
  39 + $payTimeModify: $('.pay-time-modify'),
  40 + $switchPayModify: $('.switch-pay-modify')
  41 + },
  42 + init: function() {
  43 + var e = this.e,
  44 + d = Order.Data,
  45 + c = Order.Common;
  46 +
  47 + /*初始化产品价格*/
  48 + e.$tbody.find('tr').each(function(index) {
  49 + var td = $(this).find('td');
  50 + var len = e.$tbody.find('tr').length;
  51 + var subtotal = parseFloat(td.eq(1).html()) * parseInt(td.eq(3).html());
  52 +
  53 + td.eq(4).html(c.strFixed(subtotal));
  54 + d.product += subtotal;
  55 + if (!index) {
  56 + td.last().attr('rowspan', len);
  57 + } else {
  58 + td.last().remove();
  59 + }
  60 + if (index === len - 1) {
  61 + e.$tbody.find('tr').eq(0).find('td').last().html('<strong>' + c.strFixed(d.product) + '</strong>');
  62 + }
  63 + });
  64 +
  65 +
  66 +
  67 + /*初始化价格*/
  68 + this.render();
  69 +
  70 + /*点击pan dt 打开dd*/
  71 + e.$pan.find('dt').click(function() {
  72 + var pan = $(this).parent('dl.pan');
  73 +
  74 + if (pan.find('dd').is(':hidden')) {
  75 + c.winShow(pan);
  76 + } else {
  77 + c.winHide(pan);
  78 + }
  79 +
  80 + });
  81 +
  82 + /*使用优惠卷支付 下面的文本框*/
  83 + e.$jc.on('focus change', function(event) {
  84 + var radio = $(this).prev('label').prev(':radio');
  85 +
  86 + if (event.type === 'focus') {
  87 + radio.attr('checked', true);
  88 + } else {
  89 + radio.val($(this).val());
  90 + }
  91 +
  92 + });
  93 +
  94 + /*使用YOHO币支付*/
  95 + e.$bp.data('tobi', e.$tobi.html());
  96 + e.$bp.on('keyup change', function() {
  97 + var bi = c.enterNUM($(this).val(), $(this).data('tobi'));
  98 +
  99 + $(this).val(bi);
  100 + });
  101 +
  102 + /*取消关闭小窗口*/
  103 + e.$cancel.click(function() {
  104 + var pan = $(this).parents('.pan');
  105 +
  106 + c.winHide(pan);
  107 + });
  108 +
  109 + e.$statistics.slice(3, 5).find('a').click(function() {
  110 + var pan = $('.' + $(this).attr('to'));
  111 +
  112 + c.winShow(pan);
  113 + });
  114 +
  115 +
  116 + //请填写并核对一下信息
  117 + e.$orderSelectionSave.click(function() {
  118 +
  119 + if (!$(this).data('expand')) {
  120 + $('.address-list-inner').addClass('hide');
  121 +
  122 + $(this).data('expand', 'expand').text('[不保存并关闭]');
  123 +
  124 + } else {
  125 + $('.address-list-inner').removeClass('hide');
  126 +
  127 + $(this).removeData('expand').text('[修改]');
  128 + }
  129 +
  130 + });
  131 +
  132 +
  133 + //支付及送货时间
  134 + e.$switchPayModify.click(function() {
  135 +
  136 + if (e.$payTimeModify.hasClass('hide')) {
  137 + e.$payTimeModify.removeClass('hide');
  138 + $(this).text('[不保存并关闭]');
  139 + } else {
  140 + e.$payTimeModify.addClass('hide');
  141 + $(this).text('[修改]');
  142 + }
  143 + });
  144 +
  145 + e.$spanPayTypeLegend.click(function() {
  146 + $(this).toggleClass('active');
  147 +
  148 + e.$supportType.toggleClass('hide');
  149 + });
  150 +
  151 + $(document).on('click', '.exist-address-list li', function() {
  152 +
  153 + e.$existAddressList.removeClass('active');
  154 + $(this).addClass('active');
  155 +
  156 + e.$existAddress.removeAttr('checked');
  157 + $(this).find('input[name="exist-address"]').attr('checked', 'checked');
  158 +
  159 + if ($(this).hasClass('use-new-address')) {
  160 + e.$addressManage.removeClass('hide');
  161 + }
  162 + });
  163 + },
  164 +
  165 + //渲染价格明细
  166 + render: function() {
  167 + var e = this.e,
  168 + d = Order.Data,
  169 + c = Order.Common;
  170 + var i = 0;
  171 +
  172 + e.$total.html('0.00');
  173 + e.$statistics.find('em').html('0.00');
  174 + e.$statistics.slice(3, 5).hide();
  175 +
  176 + $.each(d, function(key) {
  177 + if (d.hasOwnProperty(key)) {
  178 + if (d[key]) {
  179 + e.$statistics.eq(i).show().find('em').html(c.strFixed(d[key]));
  180 + }
  181 + }
  182 + i++;
  183 + });
  184 + e.$total.html(c.strFixed(c.calucate()));
  185 +
  186 + }
  187 + },
  188 + /*公共方法*/
  189 + Common: {
  190 + enterNUM: function(str1, str2) {
  191 + str1 = str1.replace(/[^\d]/g, '');
  192 + if (str1 && str2) {
  193 + str1 = parseInt(str1);
  194 + str2 = parseInt(str2);
  195 + if (str1 > str2) {
  196 + str1 = str2;
  197 + }
  198 + }
  199 + return str1;
  200 + },
  201 + calucate: function() {
  202 + var p = Order.Data;
  203 +
  204 + $.each(Order.Data, function(key, index) {
  205 + p[key] = parseFloat(Order.Data[key]);
  206 + });
  207 + return p.product - p.activity + p.carriage - p.juan - p.yohocoin;
  208 + },
  209 + winShow: function(pan) {
  210 + pan.find('dt').show();
  211 + pan.find('dd').show();
  212 + if (pan.attr('class').match(/(-bi-)|(-juan-)/g)) {
  213 + pan.find('dt').hide();
  214 + }
  215 + },
  216 + winHide: function(pan) {
  217 + pan.find('dt').show();
  218 + pan.find('dd').hide();
  219 + },
  220 + strFixed: function(str) {
  221 + return parseFloat(str).toFixed(2);
  222 + }
  223 + },
  224 + /*业务逻辑*/
  225 + Bll: {
  226 + e: {
  227 + $juanok: $('#juansubmit'),
  228 + $juantip: $('.errtip', '.play-juan-pan'),
  229 + $biok: $('#bisubmit'),
  230 + $carriageGroup: $('input[name="carriagegroup"]')
  231 + },
  232 + init: function() {
  233 + var e = this.e,
  234 + d = Order.Data,
  235 + c = Order.Common,
  236 + u = Order.UI;
  237 + var options;
  238 +
  239 + e.$carriageGroup.change(function() {
  240 + d.carriage = parseFloat($(this).val());
  241 + u.render();
  242 + });
  243 + /*点击 优惠卷支付 确认按钮*/
  244 + e.$juanok.click(function() {
  245 + var code = $('input[name="juangroup"]:checked').val();
  246 + var pan = $(this).parents('.pan');
  247 +
  248 + if (code) {
  249 + options = {
  250 + url: '/Order/save/priceByCode',
  251 + type: 'post',
  252 + data: {
  253 + code: code
  254 + },
  255 + success: function(data) {
  256 + if (data.code === 200) {
  257 + if (data.price) {
  258 + d.juan = data.price;
  259 + Order.UI.render();
  260 + c.winHide(pan);
  261 + return;
  262 + }
  263 + u.render();
  264 + }
  265 + e.$juantip.html(data.msg);
  266 + },
  267 + error: function() {
  268 + e.$juantip.html('网络出现错误~');
  269 + }
  270 + };
  271 +
  272 + $.ajax(options);
  273 + }
  274 + });
  275 + /*点击 YOHO币支付 确认按钮*/
  276 + e.$biok.click(function() {
  277 + var pan = $(this).parents('.pan');
  278 +
  279 + d.yohocoin = parseFloat(u.e.$bp.val()) / 100;
  280 + u.render();
  281 + c.winHide(pan);
  282 + return;
  283 + });
  284 + }
  285 + }
  286 +};
  287 +
  288 +Order.Data.activity = 0;
  289 +Order.Data.carriage = 0;
  290 +
  291 +Order.UI.init();
  292 +Order.Bll.init();
  293 +
  294 +
  295 +address.newAddress();
  296 +address.modifyAddress();
  297 +address.saveAddress();
@@ -82,4 +82,8 @@ a:focus { @@ -82,4 +82,8 @@ a:focus {
82 } 82 }
83 } 83 }
84 84
  85 +<<<<<<< HEAD
85 @import "home/index", "product/index", "guang/index", "passport/index", "error"; 86 @import "home/index", "product/index", "guang/index", "passport/index", "error";
  87 +=======
  88 +@import "home/index", "product/index", "guang/index", "passport/index", "order/index";
  89 +>>>>>>> feature/order-save
  1 +$order: sprite-map("order/save/*.png", $spacing: 10px);
  2 +
  3 +@import "save";
  4 +@import "pay";
  1 +.order-pay{
  2 + font-size: 12px;
  3 + line-height: 150%;
  4 + .pay-wapper{
  5 + border: 1px solid #ccc;
  6 + }
  7 + table{
  8 + width: 100%;
  9 + td{
  10 + border: 1px solid #ccc;
  11 + border-left: 0 none;
  12 + padding: 10px;
  13 + text-align: center;
  14 + }
  15 + }
  16 + thead{
  17 + background: #000;
  18 + th{
  19 + height: 32px;
  20 + line-height: 32px;
  21 + color: #fff;
  22 + vertical-align: middle;
  23 + text-align: center;
  24 + font-weight: bold;
  25 + }
  26 + .clo1{
  27 + width: 10%;
  28 + }
  29 + .clo2{
  30 + width: 20%;
  31 + }
  32 + .clo4{
  33 + width: 40%;
  34 + }
  35 + }
  36 + .pay-pro{
  37 + .pay-pro-icon{
  38 + float: left;
  39 + display: inline;
  40 + width: 60px;
  41 + height: 60px;
  42 + display: block;
  43 + }
  44 + .pay-pro-info{
  45 + color: #999;
  46 + margin-left:70px;
  47 + padding-top: 15px;
  48 + text-align: left;
  49 + a{
  50 + color: #468fa2;
  51 + text-decoration: none;
  52 + display: block;
  53 + &:hover{
  54 + text-decoration: underline;
  55 + }
  56 + }
  57 + }
  58 + }
  59 + .play-content{
  60 + padding: 10px;
  61 + .red{
  62 + color: #e8044f!important;
  63 + }
  64 + .orange{
  65 + color: #f60!important;
  66 + }
  67 + .strong{
  68 + font-weight: bold;
  69 + color: #000;
  70 + }
  71 + .pan{
  72 + dt{
  73 + width: 105px;
  74 + height: 30px;
  75 + padding: 0px 0px 0px 30px;
  76 + line-height: 30px;
  77 + text-align: left;
  78 + border: 0px;
  79 + color: #fff;
  80 + display: inline-block;
  81 + cursor: pointer;
  82 + background: url(http://static.yohobuy.com/images/btn_openclose.png) no-repeat 0px -60px;
  83 + margin-bottom:5px;
  84 + }
  85 + dd{
  86 + display: none;
  87 + border: 1px #ccc solid;
  88 + padding: 10px 15px;
  89 + margin-bottom: 10px;
  90 + }
  91 + }
  92 + .textbox{
  93 + height: 20px;
  94 + line-height: 20px;
  95 + color: #333;
  96 + border: 1px #c9c9c9 solid;
  97 + vertical-align: top;
  98 + }
  99 + .dropdown{
  100 + height: 20px;
  101 + line-height: 20px;
  102 + color: #333;
  103 + border: 1px #c9c9c9 solid;
  104 + vertical-align: top;
  105 + }
  106 + .btn-group{
  107 + text-align: right;
  108 + input{
  109 + display: inline-block;
  110 + background: none;
  111 + border: 1px solid #ccc;
  112 + border-radius: 2px;
  113 + height: 20px;
  114 + }
  115 + .ok{
  116 + background-color: #000;
  117 + color:#fff;
  118 + }
  119 + }
  120 + .play-left{
  121 + float: left;
  122 + width: 405px;
  123 + .pan{
  124 + text-align: left;
  125 + dt{
  126 + color: #000;
  127 + background: url(http://static.yohobuy.com/images/btn_openclose.png) no-repeat 0px 0px;
  128 + }
  129 + }
  130 +
  131 + }
  132 + .play-piao-pan{
  133 + li{
  134 + height: 25px;
  135 + padding: 10px 0px;
  136 + line-height: 22px;
  137 + label{
  138 + width: 65px;
  139 + display: inline-block;
  140 + }
  141 + .textbox{
  142 + width: 200px;
  143 + }
  144 + }
  145 + }
  146 + .play-remark-pan{
  147 + .textbox{
  148 + width: 369px;
  149 + height: 70px;
  150 + }
  151 + .note{
  152 + padding: 5px 0;
  153 + color: #999;
  154 + }
  155 + }
  156 + .play-right{
  157 + float: right;
  158 + width: 50%;
  159 + width: 405px;
  160 + .play-total{
  161 + text-align: right;
  162 + padding-bottom: 20px;
  163 + label{
  164 + padding-right: 10px;
  165 + }
  166 + em{
  167 + width: 80px;
  168 + text-align: left;
  169 + display: inline-block;
  170 + }
  171 + a{
  172 + color: #468fa2;
  173 + text-decoration: underline;
  174 + }
  175 + }
  176 + .pan{
  177 + text-align: right;
  178 + }
  179 +
  180 + }
  181 + .play-juan-pan{
  182 + dd{
  183 + text-align: left;
  184 + }
  185 +
  186 + .play-juan{
  187 + padding: 10px 0;
  188 + .textbox{
  189 + width: 70px;
  190 + }
  191 + }
  192 +
  193 + }
  194 + .play-bi-pan{
  195 + dd{
  196 + text-align: right;
  197 + }
  198 + .textbox{
  199 + width: 70px;
  200 + }
  201 + p{
  202 + padding: 10px 0;
  203 + }
  204 +
  205 + }
  206 +
  207 + }
  208 + .to-play{
  209 + p{
  210 + padding: 10px 0px;
  211 + font-size: 14px;
  212 + text-align: right;
  213 + color: #000;
  214 + em{
  215 + color: #e8044f;
  216 + font-size: 24px;
  217 + }
  218 + }
  219 + .btn-group{
  220 + padding: 10px 0px 40px 0px;
  221 + .submit{
  222 + float: right;
  223 + width: 133px;
  224 + height: 33px;
  225 + padding: 0px;
  226 + text-align: center;
  227 + border: 0px;
  228 + line-height: 33px;
  229 + font-size: 14px;
  230 + color: #fff;
  231 + font-weight: bold;
  232 + background: url(http://static.yohobuy.com/images/btns.png) no-repeat 0px -33px;
  233 + display: inline-block;
  234 + cursor: pointer;
  235 + }
  236 + }
  237 + }
  238 +
  239 +}
  1 +.order-save-page {
  2 + width: 990px;
  3 + margin: 40px auto;
  4 +
  5 + // 填写订单
  6 + .order-edit {
  7 + width: 100%;
  8 + position: relative;
  9 + margin-bottom: 35px;
  10 +
  11 + &:before {
  12 + content: '';
  13 + display: block;
  14 + background: sprite($order, cart_logo) no-repeat;
  15 + width: image-width(sprite-file($order, cart_logo));
  16 + height: image-height(sprite-file($order, cart_logo));
  17 + }
  18 +
  19 + .order-title {
  20 + ul {
  21 + display: block;
  22 + background: sprite($order, cartnew_flow) no-repeat;
  23 + width: image-width(sprite-file($order, cartnew_flow));
  24 + height: image-height(sprite-file($order, cartnew_flow));
  25 + position: absolute;
  26 + right: 0;
  27 + top: 0;
  28 +
  29 + li {
  30 + display: block;
  31 + width: 33.33333333%;
  32 + float: left;
  33 + font-size: 12px;
  34 + color: #999;
  35 + height: 50px;
  36 + line-height: 50px;
  37 +
  38 + &.active {
  39 + color: #333;
  40 + text-align: center;
  41 + &:after {
  42 + display: block;
  43 + content: '';
  44 + background: sprite($order, cart_flow_black) no-repeat;
  45 + width: image-width(sprite-file($order, cart_flow_black));
  46 + height: image-height(sprite-file($order, cart_flow_black));
  47 + position: absolute;
  48 + left: 50%;
  49 + margin-left: image-width(sprite-file($order, cart_flow_black))/(-2);
  50 + top: 0;
  51 + }
  52 + }
  53 + &.end {
  54 + text-align: right;
  55 + }
  56 + }
  57 + }
  58 + }
  59 +
  60 + .order-edit-main {
  61 + border: 1px solid #ccc;
  62 + margin-top: 30px;
  63 +
  64 + h2.title {
  65 + height: 30px;
  66 + line-height: 30px;
  67 + background: #000000;
  68 + color: #fff;
  69 + font-size: 12px;
  70 + text-indent: 15px;
  71 + }
  72 +
  73 + .order-content {
  74 + padding: 5px 30px;
  75 + font-size: 12px;
  76 + color: #333;
  77 +
  78 +
  79 + //public
  80 + .order-selection {
  81 +
  82 + border-bottom: 1px dashed #ccc;
  83 + padding: 15px 0;
  84 +
  85 + h2 {
  86 + font-size: 14px;
  87 + color: #000;
  88 +
  89 + span {
  90 + color: #e8044f;
  91 + text-decoration: underline;
  92 + cursor: pointer;
  93 + }
  94 + }
  95 +
  96 + }
  97 + //end
  98 +
  99 + .address-list {
  100 + ul {
  101 + padding: 15px 0;
  102 +
  103 + li {
  104 + padding: 10px 0;
  105 +
  106 + strong {
  107 + font-weight: bold;
  108 + margin-right: 15px;
  109 + }
  110 +
  111 + input.radio {
  112 + margin: 0;
  113 + vertical-align: middle;
  114 + }
  115 +
  116 + }
  117 + .order-modify-btn {
  118 + display: inline-block;
  119 + float: right;
  120 + color: #e8044f;
  121 + width: 80px;
  122 + padding-right: 20px;
  123 + height: auto;
  124 + overflow: hidden;
  125 +
  126 + span {
  127 + text-decoration: underline;
  128 + cursor: pointer;
  129 +
  130 + float: right;
  131 +
  132 + &.address-modify {
  133 + float: left;
  134 + }
  135 + }
  136 + }
  137 +
  138 + &.exist-address-list {
  139 +
  140 + li {
  141 + border: 1px solid #fff;
  142 + padding-left: 15px;
  143 +
  144 + &.active {
  145 + background: #dbedf7;
  146 + border: 1px solid #8fb8e0;
  147 + }
  148 +
  149 + &.has-exist-address {
  150 + .default-address {
  151 + color: #468fa2;
  152 + text-decoration: underline;
  153 + cursor: pointer;
  154 + }
  155 + }
  156 + }
  157 + }
  158 + }
  159 + }
  160 +
  161 + .address-manage {
  162 + border-top: 1px dashed #ccc;
  163 +
  164 + li {
  165 +
  166 + height: 25px;
  167 + line-height: 25px;
  168 +
  169 + .address-legend {
  170 + width: 80px;
  171 + text-align: right;
  172 + display: inline-block;
  173 +
  174 + color: #333;
  175 +
  176 + i {
  177 + color: #e8044f;
  178 + }
  179 + }
  180 +
  181 + .text-input {
  182 + height: 25px;
  183 + line-height: 25px;
  184 + width: 180px;
  185 + padding: 0;
  186 + border: 1px solid #ccc;
  187 + @include box-sizing();
  188 + }
  189 + select.text-input {
  190 + width: 100px;
  191 + }
  192 +
  193 + .address-tel-input {
  194 + width: 180px;
  195 + text-align: center;
  196 + display: inline-block;
  197 + height: 25px;
  198 + line-height: 25px;
  199 +
  200 + input {
  201 + text-align: left;
  202 + float: right;
  203 + width: 120px;
  204 +
  205 + &.tel-lengend {
  206 + float: left;
  207 + width: 40px;
  208 + }
  209 + }
  210 + }
  211 + }
  212 + }
  213 +
  214 + @each $class in save-btn, pay-btn {
  215 + .#{$class} {
  216 + background: sprite($order, $class) no-repeat;
  217 + width: image-width(sprite-file($order, $class));
  218 + height: image-height(sprite-file($order, $class));
  219 + line-height: image-height(sprite-file($order, $class));
  220 + display: block;
  221 + font-size: 14px;
  222 + color: #fff;
  223 + font-weight: bold;
  224 + text-indent: 25px;
  225 + cursor: pointer;
  226 +
  227 +
  228 + }
  229 + }
  230 +
  231 + .pay-time {
  232 +
  233 + ul {
  234 + padding: 15px;
  235 +
  236 + li {
  237 + margin: 10px 0;
  238 +
  239 + input.radio {
  240 + margin: 0;
  241 + vertical-align: middle;
  242 + }
  243 + }
  244 + }
  245 +
  246 + .pay-time-modify {
  247 +
  248 + h3 {
  249 + height: 25px;
  250 + line-height: 25px;
  251 + border: 1px solid #e6e6e6;
  252 + background: #efefef;
  253 + text-indent: 25px;
  254 + position: relative;
  255 +
  256 + &:after {
  257 + content: '';
  258 + display: block;
  259 + width: 11px;
  260 + height: 11px;
  261 + background: image_url('order/roundgreybtn.gif');
  262 + position: absolute;
  263 + top: 7px;
  264 + left: 8px;
  265 + }
  266 + }
  267 +
  268 + .pay-dashed-hr {
  269 + border-bottom: 1px dashed #ccc;
  270 + padding-bottom: 10px;
  271 + }
  272 +
  273 + .pay-type-tips {
  274 + color: #999;
  275 + }
  276 +
  277 + div.pay-type-legend {
  278 + width: 130px;
  279 + display: inline-block;
  280 + padding: 0;
  281 + text-indent: 0;
  282 + }
  283 + span.pay-type-legend {
  284 + margin: 0;
  285 + color: #468fa2;
  286 + cursor: pointer;
  287 +
  288 + &:after {
  289 + content: '';
  290 + width: 12px;
  291 + height: 12px;
  292 + background: image_url('order/icon_arrow.png');
  293 + display: inline-block;
  294 + @include transition(transform .3s);
  295 + }
  296 +
  297 + &.active {
  298 + &:after {
  299 + @include rotate(180deg);
  300 + }
  301 + }
  302 + }
  303 +
  304 + .support-type {
  305 + display: block;
  306 + margin-left: 130px;
  307 + border-left: 1px dashed #ccc;
  308 + font-size: 12px;
  309 +
  310 + h4 {
  311 + padding: 10px 0 10px 15px;
  312 + }
  313 +
  314 + ul {
  315 + height: auto;
  316 + overflow: hidden;
  317 + margin: 0;
  318 + padding: 0;
  319 +
  320 + li {
  321 + display: block;
  322 + float: left;
  323 + width: 105px;
  324 + height: 30px;
  325 + border: 1px solid #ccc;
  326 + margin: 0 0 10px 15px;
  327 +
  328 + img {
  329 + display: block;
  330 + width: 100%;
  331 + height: 100%;
  332 + overflow: hidden;
  333 + }
  334 + }
  335 + }
  336 + }
  337 +
  338 + .pay-recommend {
  339 + font-size: 0;
  340 +
  341 + .pay-type-legend, .support-type {
  342 + font-size: 12px;
  343 + }
  344 + }
  345 + }
  346 + }
  347 +
  348 + .select-express {
  349 +
  350 + border-bottom: none;
  351 +
  352 + .express-list {
  353 + padding-left: 15px;
  354 + margin: 10px 0;
  355 +
  356 + input.radio {
  357 + margin: 0;
  358 + vertical-align: middle;
  359 + }
  360 + }
  361 +
  362 + .express-tips {
  363 + color: #999;
  364 + }
  365 + }
  366 +
  367 + }
  368 + }
  369 + }
  370 +
  371 + //
  372 + .order-pay {
  373 + width: 100%;
  374 + }
  375 +}
  1 +<?php
  2 +
  3 +use Action\AbstractAction;
  4 +
  5 +class SaveController extends AbstractAction
  6 +{
  7 + /**
  8 + * 订单确认
  9 + */
  10 + public function indexAction()
  11 + {
  12 + $src="http://img04.static.yohobuy.com/thumb/2015/08/25/08/012622ad14f32470d56a0b1da5d533a7e2-0060x0060-2-goodsimg.jpg";
  13 + $data = array(
  14 + 'orderSavePage' => true,
  15 + 'orderSave'=>array(
  16 + 'hasAddress' => array(
  17 + array(
  18 + 'user' => '王成龙',
  19 + 'address' => '江苏省南京市建邺区嘉陵江东街18号,国家广告产业园5栋17楼,YOHO 18605269243',
  20 + 'checked' => true,
  21 + 'id' => 100
  22 + )
  23 + ),
  24 + 'supportLine' => array(
  25 + array(
  26 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  27 + ),
  28 + array(
  29 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  30 + ),
  31 + array(
  32 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  33 + ),
  34 + array(
  35 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  36 + ),
  37 + array(
  38 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  39 + ),
  40 + array(
  41 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  42 + ),
  43 + array(
  44 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  45 + ),
  46 + array(
  47 + 'src' => 'http://static.yohobuy.com/images/pay/icon/zhifubao.png'
  48 + )
  49 + ),
  50 + 'supportBank' => array(
  51 + array(
  52 + 'src' => 'http://static.yohobuy.com/images/bankico/BOC.gif'
  53 + ),
  54 + array(
  55 + 'src' => 'http://static.yohobuy.com/images/bankico/BOC.gif'
  56 + )
  57 + ),
  58 + 'carriagelist'=>array(
  59 + array('name'=>'普通快递','value'=>'0.00',"desc"=>''),
  60 + array('name'=>'普通快递','value'=>'5.00',"desc"=>'(仅支持顺丰可配送的地区)')
  61 + ),
  62 + 'orderProducts'=>array(
  63 + array('name' =>"Eight Guys 破洞束口牛仔裤",'tip'=>"颜色:蓝色 尺码:L",'src'=>$src,'href'=>'','price'=>'179.00','coin'=>'0','count'=>'1'),
  64 + array('name' =>"Eight Guys 破洞束口牛仔裤",'tip'=>"颜色:蓝色 尺码:L",'src'=>$src,'href'=>'','price'=>'179.00','coin'=>'0','count'=>'1')
  65 + ),
  66 + 'piaotypes'=>array(
  67 + array('name'=>'个人','value'=>'001'),
  68 + array('name'=>'公司','value'=>'002')
  69 + ),
  70 + 'juanlist'=>array(
  71 + array('name'=>'YOHOXXXXXX优惠卷','value'=>'001'),
  72 + array('name'=>'爽1111优惠卷','value'=>'002')
  73 + )
  74 + )
  75 + );
  76 +
  77 + $this->_view->display('index', $data);
  78 + }
  79 +
  80 + /*获取优惠卷的面额*/
  81 + public function priceByCodeAction()
  82 + {
  83 + $result = array();
  84 +
  85 + do {
  86 +
  87 + $result=array(
  88 + 'code'=>200,
  89 + 'msg'=>'成功',//卷不存在,过期等等
  90 + 'price'=>'10'
  91 + );
  92 + } while (false);
  93 +
  94 + $this->echoJson($result);
  95 + }
  96 +
  97 + //获取省级联动ajax
  98 + //省
  99 + public function getProvinceAction()
  100 + {
  101 + $data = array(
  102 + array(
  103 + 'name' => '111省',
  104 + 'value' => 11,
  105 + 'checked' => true
  106 + ),
  107 + array(
  108 + 'name' => '222省',
  109 + 'value' => 22
  110 + ),
  111 + array(
  112 + 'name' => '333省',
  113 + 'value' => 33
  114 + )
  115 + );
  116 +
  117 + $this->echoJson($data);
  118 + }
  119 +
  120 + //市
  121 + public function getCityAction()
  122 + {
  123 + $data = array(
  124 + array(
  125 + 'name' => '111市',
  126 + 'value' => 11
  127 + ),
  128 + array(
  129 + 'name' => '222市',
  130 + 'value' => 22,
  131 + 'checked' => true
  132 + ),
  133 + array(
  134 + 'name' => '333市',
  135 + 'value' => 33
  136 + )
  137 + );
  138 +
  139 + $this->echoJson($data);
  140 + }
  141 +
  142 + //县
  143 + public function getCountyAction()
  144 + {
  145 + $data = array(
  146 + array(
  147 + 'name' => '111县',
  148 + 'value' => 11
  149 + ),
  150 + array(
  151 + 'name' => '222县',
  152 + 'value' => 22
  153 + ),
  154 + array(
  155 + 'name' => '333县',
  156 + 'value' => 33,
  157 + 'checked' => true
  158 + )
  159 + );
  160 +
  161 + $this->echoJson($data);
  162 + }
  163 +
  164 + //修改地址
  165 + public function getUserInfoAction()
  166 + {
  167 + $data = array(
  168 + 'name' => '王成龙',
  169 + 'phone' => '18605269243',
  170 + 'address' => '江陵江东街',
  171 + 'tel' => false,
  172 + 'telCode' => false,
  173 + 'mail' => false,
  174 + 'code' => '210000'
  175 + );
  176 +
  177 + $this->echoJson($data);
  178 + }
  179 +
  180 + //删除地址
  181 + public function addressDelAction()
  182 + {
  183 + $data = array(
  184 + 'status' => true
  185 + );
  186 +
  187 + $this->echoJson($data);
  188 + }
  189 +
  190 + //保存地址
  191 + public function addressSaveAction()
  192 + {
  193 + $data = array(
  194 + 'status' => true
  195 + );
  196 +
  197 + $this->echoJson($data);
  198 + }
  199 +
  200 + //设为默认地址
  201 + public function defaultAddressAction()
  202 + {
  203 + $data = array(
  204 + 'status' => true
  205 + );
  206 +
  207 + $this->echoJson($data);
  208 + }
  209 +}
@@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application" @@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application"
4 ;;website library 4 ;;website library
5 application.library = ROOT_PATH "/library" 5 application.library = ROOT_PATH "/library"
6 ;;模块配置 6 ;;模块配置
7 -application.modules = "Index,Product,Passport" 7 +application.modules = "Index,Product,Passport,Order"
8 ;;加载 8 ;;加载
9 application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php" 9 application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
10 ;;view文件的扩展名 10 ;;view文件的扩展名