qlg.tsgz.moe/static/app/js/order_con.js
2019-09-06 23:53:10 +08:00

110 lines
6.0 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
var html = '<div class="ad"><p>' + data.status + '</p></div><div class="address clearfix"><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"><p>发票信息</p><p>发票抬头 ' + data.invoiceClient + '</p></div><div class="shop_info"><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 clearfix"><div class="jf_jf">积分</div><div class="jf_p">奖励积分<o>' + data.orderScore + '</o>点</div></div><a href="tel:' + data.shopTel + '" class="lxmj"><img src="../img/phone1.png" /><p>联系卖家 </p></a><div class="info"><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) {           //异常处理;  
// alert(type);      
}
}); 
$('.con').on('tap', '.row_title', function() {
var shopId = $(this).attr('data-shopId');
mui.openWindow({
url: 'storeout.html',
id: 'storeout.html' + 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, //等待框背景区域高度,默认根据内容自动计算合适高度
// ......
}
}
})
})
})