115 lines
7.3 KiB
JavaScript
115 lines
7.3 KiB
JavaScript
mui.plusReady(function() {
|
||
var token = localStorage.getItem('token');
|
||
var data_order_id = localStorage.getItem('data_order_id');
|
||
// //console.log(data_order_id)
|
||
mui.ajax(hyhUrl('app/Orders/getDetail'), {
|
||
headers: {
|
||
"HYH-Token": token
|
||
},
|
||
data: {
|
||
id: data_order_id
|
||
},
|
||
dataType: 'json', //服务器返回json格式数据
|
||
type: 'post', //HTTP请求类型
|
||
timeout: 10000, //超时时间设置为10秒;
|
||
success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
|
||
// //console.log(data.data.goodsFavoritesNum)
|
||
var data = toJson(data.data);
|
||
var html = '<div class="ad shadown_wai"><p>' + data.status + '</p></div><div class="address clearfix shadown_wai"><div class="add_l"><img src="../img/dingwei1.png" /></div><div class="add_r "><div class="add_r_t clearfix"><div class="add_r_t_l">收货人:' + data.userName + '</div><div class="add_r_t_r">' + data.userPhone + '</div></div><div class="add_r_b">收货地址:' + data.userAddress + '</div></div></div><div class="invoice_info shadown_wai"><p>发票信息</p><p>发票抬头 ' + data.invoiceClient + '</p></div><div class="shop_info shadown_wai"><div class="row_title" data-shopId="' + data.shopId + '"><div class="store_name">' + data.shopName + '</div></div><div class="row_con clearfix">';
|
||
$.each(data.goods, function() {
|
||
html += '<div class="row_block clearfix" data-goodsId="' + this.goodsId + '"><img src="' + hyhImgUrl(this.goodsImg) + '" /><div class="rcr clearfix"><div class="rcrc"><p>' + this.goodsName + ' </p><p class="leibie">' + this.goodsSpecNames + '</p></div><div class="rcrr"><p>¥' + this.goodsPrice + '</p><del>¥' + this.marketPrice + '</del><span>x' + this.goodsNum + '</span></div></div></div>'
|
||
});
|
||
|
||
// html += '<div class="cost"><div class="c1 clearfix"><div class="c1_l">商品总价</div><div class="c1_r">¥' + data.goodsMoney + '</div></div><div class="c1 clearfix"><div class="c1_l">运费(快递)</div><div class="c1_r">¥' + data.deliverMoney + '</div></div><div class="c2 clearfix"><div class="c1_l">订单总价</div><div class="c1_r">¥' + data.totalMoney + '</div></div></div><div class="cost"><div class="c2 clearfix"><div class="c1_l">实付款</div><div class="c1_r on">¥' + data.realTotalMoney + '</div></div></div></div></div><div class="jf_info shadown_wai clearfix"><div class="jf_jf">积分</div><div class="jf_p">奖励积分<o>' + data.orderScore + '</o>点</div></div><a href="tel:' + data.shopTel + '" class="lxmj shadown_wai"><img src="../img/phone1.png" /><p>联系卖家 </p></a><div class="info shadown_wai"><p>订单编号:' + data.orderNo + '</p><p>创建时间:' + data.createTime + '</p>';
|
||
html += '<div class="cost"><div class="c1 clearfix"><div class="c1_l">商品总价</div><div class="c1_r">¥' + data.goodsMoney + '</div></div><div class="c1 clearfix"><div class="c1_l">运费(快递)</div><div class="c1_r">¥' + data.deliverMoney + '</div></div><div class="c2 clearfix"><div class="c1_l">订单总价</div><div class="c1_r">¥' + data.totalMoney + '</div></div></div><div class="cost"><div class="c2 clearfix"><div class="c1_l">产品券</div><div class="c1_r on">¥' + data.productNum + '【税费:'+data.productTaxFee+',手续费:' +data.productHandlingFee+'】</div></div><div class="c2 clearfix"><div class="c1_l">优惠券</div><div class="c1_r on">¥' + data.couponsNum + '【税费:' +data.couponsHandlingFee+',手续费:'+data.couponsTaxFee+'】</div></div><div class="c2 clearfix"><div class="c1_l">旺旺券</div><div class="c1_r on">¥' + data.wangNum + '</div></div><div class="c2 clearfix"><div class="c1_l">现金</div><div class="c1_r on">¥' + data.moneyNum + '</div></div></div></div></div><a href="tel:' + data.shopTel + '" class="lxmj shadown_wai"><img src="../img/phone1.png" /><p>联系卖家 </p></a><div class="info shadown_wai"><p>订单编号:' + data.orderNo + '</p><p>创建时间:' + data.createTime + '</p>';
|
||
|
||
if(data.deliveryTime != null) {
|
||
html += '<p>发货时间:' + data.deliveryTime + '</p>'
|
||
}
|
||
if(data.deliveryTime != null) {
|
||
html += '<p>成交时间:' + data.receiveTime + '</p>'
|
||
}
|
||
|
||
html += '</div>';
|
||
|
||
$('.con').html(html);
|
||
},
|
||
error: function(xhr, type, errorThrown) { //异常处理;
|
||
// mui.alert(type);
|
||
}
|
||
});
|
||
|
||
$('.con').on('tap', '.row_title', function() {
|
||
var shopId = $(this).attr('data-shopId');
|
||
var url = 'storeout.html';
|
||
if(shopId==1){
|
||
// url='self_shop.html'
|
||
}
|
||
mui.openWindow({
|
||
url: url,
|
||
id: url+shopId,
|
||
styles: {
|
||
top: '0px', //新页面顶部位置
|
||
bottom: '0px', //新页面底部位置
|
||
width: '100%', //新页面宽度,默认为100%
|
||
height: '100%' //新页面高度,默认为100%
|
||
},
|
||
extras: {
|
||
shopId: shopId
|
||
// ..... //自定义扩展参数,可以用来处理页面间传值
|
||
},
|
||
createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
|
||
show: {
|
||
// autoShow: true, //页面loaded事件发生后自动显示,默认为true
|
||
// aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
|
||
// duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
|
||
// event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
|
||
// extras: {} //窗口动画是否使用图片加速
|
||
},
|
||
waiting: {
|
||
autoShow: true, //自动显示等待框,默认为true
|
||
title: '正在加载...', //等待对话框上显示的提示内容
|
||
options: {
|
||
// width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
|
||
// height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
|
||
// ......
|
||
}
|
||
}
|
||
})
|
||
|
||
})
|
||
$('.con').on('tap', '.row_block', function() {
|
||
var goodsId = $(this).attr('data-goodsId');
|
||
mui.openWindow({
|
||
url: 'details.html',
|
||
id: 'details.html' + goodsId,
|
||
styles: {
|
||
top: '0px', //新页面顶部位置
|
||
bottom: '0px', //新页面底部位置
|
||
width: '100%', //新页面宽度,默认为100%
|
||
height: '100%' //新页面高度,默认为100%
|
||
},
|
||
extras: {
|
||
data_id: goodsId
|
||
// ..... //自定义扩展参数,可以用来处理页面间传值
|
||
},
|
||
createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
|
||
show: {
|
||
// autoShow: true, //页面loaded事件发生后自动显示,默认为true
|
||
// aniShow: animationType, //页面显示动画,默认为”slide-in-right“;
|
||
// duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒;
|
||
// event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示
|
||
// extras: {} //窗口动画是否使用图片加速
|
||
},
|
||
waiting: {
|
||
autoShow: true, //自动显示等待框,默认为true
|
||
title: '正在加载...', //等待对话框上显示的提示内容
|
||
options: {
|
||
// width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度
|
||
// height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度
|
||
// ......
|
||
}
|
||
}
|
||
})
|
||
})
|
||
}) |