Authored by uedxwg

订单ul重构

9.08 KB | W: | H:

9.05 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.28 KB | W: | H:

7.16 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -6,26 +6,21 @@
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload'),
// Hammer = require('yoho.hammer'),
Handlebars = require('yoho.handlebars'),
tip = require('../plugin/tip'),
loading = require('../plugin/loading'),
order = require('./order-info');
var dispatchModeHammer,
dispatchTimeHammer,
$invoice = $('.invoice'),
$price = $('.price-cal'),
var $invoice = $('.invoice'),
$couponUse = $('.coupon-use.used'),
$addressWrap = $('.address-wrap'),
$coinCheck = $('.coin-check'),
$coinUsed = $('.coin .used'),
$subBlock = $('.sub-block'),
payType,
// priceTmpl = Handlebars.compile($('#tmpl-price').html()),
queryString = $.queryString(),
orderInfo = order.orderInfo,
isSubmiting;
isSubmiting,
dispatchInfo;
require('../common');
... ... @@ -72,7 +67,7 @@ isLimitGood() && (function() {
var data = getQueryParam();
data['type'] = 'limitcode';
data.type = 'limitcode';
a.push(data);
orderInfo('skuList', JSON.stringify(a));
... ... @@ -94,12 +89,6 @@ function dispacthTapEvt(e) {
$cur.addClass('chosed');
}
// dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);
// dispatchModeHammer.on('tap', dispacthTapEvt);
// dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);
// dispatchTimeHammer.on('tap', dispacthTapEvt);
$('.checkbox').on('touchstart', function() {
var $this = $(this);
... ... @@ -139,7 +128,6 @@ function orderCompute() {
skuList: isLimitGood() ? orderInfo('skuList') : undefined
}
}).then(function(res) {
var priceHtml;
if ($.type(res) !== 'object') {
window.location.reload();
... ... @@ -153,12 +141,6 @@ function orderCompute() {
$coinCheck.find('em').show();
$coinUsed.show();
}
// priceHtml = priceTmpl({
// cartPayData: res.promotion_formula_list,
// price: res.last_order_amount
// });
// $price.html(priceHtml);
}
}).fail(function() {
window.location.reload();
... ... @@ -305,7 +287,6 @@ $('.pay-mode').on('click', 'li', function() {
orderInfo('paymentTypeId', $this.data('pay-id'));
orderInfo('paymentType', $this.data('pay-type'));
payType = $this.data('pay-type');
// submitOrder();
});
$('form').on('submit', function() {
... ... @@ -339,8 +320,15 @@ $subBlock.on('touchstart', 'i', function() {
});
$('.bill a').on('touchstart', function(){
$('.bill a').on('touchstart', function() {
orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id'));
orderInfo('paymentType', $('.delivery-time .icon-cb-radio').data('id'));
submitOrder();
})
\ No newline at end of file
});
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.info-phone').html(phoneHidden($('.info-phone').html()));
... ...
... ... @@ -40,3 +40,11 @@ $confim.on('touchend', '.confim', function() {
orderInfo('address', null);
}
});
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.tel').each(function(index) {
$('.tel').eq(index).html(phoneHidden($('.tel').html()));
});
... ...
... ... @@ -208,3 +208,19 @@ if (chinaAddressList) {
tip.show('获取省市区列表失败');
});
}
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.phone').html(phoneHidden($('.phone').html()));
$('.phone').on('touchend', function() {
$(this).css('display', 'none');
$('input[name = "mobile"]').attr('type', 'text');
});
$('input[name = "mobile"]').on('blur', function() {
$('.phone').css('display', 'block');
$('input[name = "mobile"]').attr('type', 'hidden');
});
\ No newline at end of file
... ...
... ... @@ -215,10 +215,10 @@
margin-bottom: 10rem / $pxConvertRem;
}
.dispatch .sub-block:first-child {
border-bottom: 1px solid #f7f7f7;
margin-bottom: 15rem / $pxConvertRem;
}
// .dispatch .sub-block:first-child {
// border-bottom: 1px solid #f7f7f7;
// margin-bottom: 15rem / $pxConvertRem;
// }
// .dispatch-mode li,
// .dispatch-time li {
... ...
... ... @@ -171,7 +171,16 @@
border: none;
-webkit-appearance: none;
}
p{
position: absolute;
top: 0;
right: pxToRem(40px);
width: pxToRem(360px);
height: pxToRem(88px);
color: #444;
padding: 0;
border: none;
}
.address {
height: pxToRem(88px) * 2;
}
... ...
... ... @@ -8,7 +8,7 @@
height: pxToRem(28px);
margin-left: pxToRem(50px);
background: image-url('product/service.png') no-repeat;
background-size: cover;
background-size: 100% auto;
}
.detail{
margin-bottom: 1px;
... ...
... ... @@ -18,14 +18,12 @@
<i class="iconfont">&#xe616;</i>
</h3>
<ul>
<li>
<span>在线支付 (推荐)</span>
<i class="right iconfont {{#if isSelected}}icon-cb-radio{{else}}icon-radio{{/if}}" data-id="1"></i>
</li>
<li>
<span>货到付款</span>
<i class="right iconfont {{#if isSelected}}icon-cb-radio{{else}}icon-radio{{/if}}" data-id="2"></i>
{{#each dispatchMode}}
<li {{#if isSelected}}class="chosed"{{/if}}>
<span>{{name}}</span>
<i class="right iconfont {{#if isSelected}}icon-cb-radio{{else}}icon-radio{{/if}}" data-id="{{id}}"></i>
</li>
{{/each}}
</ul>
</div>
<div class="sub-block delivery-id">
... ... @@ -46,7 +44,7 @@
<div class="sub-block delivery-time">
<h3>
<p>送货时间</p>
<span>只在工作日送</span>
<span>工作日、双休日和节假日均送货</span>
<i class="iconfont">&#xe616;</i>
</h3>
<ul>
... ...
... ... @@ -9,7 +9,8 @@
</label>
<label class="mobile">
手机号码
<input type="text" name="mobile" value="{{address.mobile}}">
<p class="phone">{{address.mobile}}</p>
<input type="hidden" name="mobile" value="{{address.mobile}}">
</label>
<label class="area">
省市区
... ...
... ... @@ -329,7 +329,6 @@ class IndexController extends AbstractAction
$this->setTitle('确认订单');
$this->setNavHeader('确认订单', $returnUrl, false); // 不显示右上角home按钮
$this->_view->display('order-ensure', $data);
}
... ...