Commit 6e3a293a by 朱继来

Merge branch 'master' of http://119.23.72.7/zhujilai/Order into zjl_self_express_20181030

parents 9a0da6d4 bc69f462
......@@ -288,19 +288,15 @@ Class AddOrderController extends Controller
{
if ($request->isMethod('post')) {
$url = Config('website.search-skuid');
$data['sku_id'] = $request->input('sku_id');
$goods_type = $request->input('goods_type');
$data['id'] = $request->input('sku_id');
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$response = json_decode(curlApi($url, $data, 'POST'), true);
if ($goods_type == 1) {
$goods_info = $response['data']['sku'];
} else {
$goods_info = $response['data'];
}
if (!empty($goods_info)) {
return ['errcode' => 0, 'errmsg' => '', 'data' => $goods_info];
if (!empty($response['data'])) {
return ['errcode' => 0, 'errmsg' => '', 'data' => $response['data']];
} else {
return ['errcode' => -1, 'errmsg' => '未找SKU信息'];
}
......
......@@ -51,8 +51,9 @@ return [
'check-user-url' => 'http://member.liexin.net/list',
// 查询SKUID接口
'search-skuid' => 'http://footstone.liexin.net/webapi/goods_details',
// 'search-skuid' => 'http://footstone.liexin.net/webapi/sku_list',
// 'search-skuid' => 'http://www.liexin.com/v3/sku/list',
'search-skuid' => 'http://api.liexin.com/goods/detail',
// 新增SKU入口
'add-sku-url' => 'http://footstone.liexin.net/manage/addsku',
......
......@@ -220,9 +220,9 @@
$.ajax({
url: '/ajax/getSku',
type: 'post',
data: {sku_id : sku_id.trim(), goods_type: goods_type},
data: {sku_id : sku_id.trim()},
dataType: 'json',
success: function (resp) {
success: function (resp) { console.log(resp)
if (resp.errcode != 0) {
layer.msg(resp.errmsg);
return false;
......@@ -236,74 +236,77 @@
$('.goods_name').text(data.goods_name);
$('.brand_name').text(data.brand_name);
$('.supplier_name').text(data.supplier_name);
$('.stock').text(data.stock);
$('.moq').text(data.moq);
$('.mpq').text(data.mpq);
if (goods_type == 1) {
var status = data.goods_status;
} else {
var status = data.status;
}
switch (status) {
case 0: status_val = '待入库'; break;
case 1: status_val = '审核通过(上架)'; break;
case 3: status_val = '下架'; break;
case 4: status_val = '删除'; break;
}
$('.stock').text(data.goods_number);
$('.moq').text(data.min_buy);
$('.mpq').text(data.min_mpq);
// if (goods_type == 1) {
// var status = data.goods_status;
// } else {
// var status = data.status;
// }
// switch (status) {
// case 0: status_val = '待入库'; break;
// case 1: status_val = '审核通过(上架)'; break;
// case 3: status_val = '下架'; break;
// case 4: status_val = '删除'; break;
// }
status_val = data.is_buy ? '是' : '否';
$('.status').text(status_val);
$('.goods_id').val(data.goods_id);
$('.goods_type').val(data.goods_type);
//阶梯价格
if (data.ladder_price != null) {
if (data.ladder_price.constructor == String) { //如果阶梯价为字符串,则转换为数字
var price_arr = eval(data.ladder_price);
} else {
var price_arr = data.ladder_price;
}
var len = price_arr.length;
if (data.tiered != null) {
var len = data.tiered.length;
if (len > 0) {
var html = '';
html += '<tr><th>阶梯</th><th>RMB价格</th>';
if (data.ac_type == 1) {
html += '<th>活动价</th>';
}
if (goods_type == 1) {
html += '<th>USD价格</th>';
}
html += '</tr>';
for (var i = 0; i < len; i++) {
html += '<tr>';
if (i == 0) {
if (data.ac_type) {
html += '<td><span class="goods-min-num">'+price_arr[i]['purchases']+'</span></td><td>¥<span class="goods-min-price price-line">'+price_arr[i]['price_cn']+'</span><td>¥<span>'+price_arr[i]['price_ac']+'</span></td>';
html += '<td><span class="goods-min-num">'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="goods-min-price price-line">'+data.tiered[i]['price_cn']+'</span><td>¥<span>'+data.tiered[i]['price_ac']+'</span></td>';
} else {
html += '<td><span class="goods-min-num">'+price_arr[i]['purchases']+'</span></td><td>¥<span class="goods-min-price">'+price_arr[i]['price_cn']+'</span></td>';
html += '<td><span class="goods-min-num">'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="goods-min-price">'+data.tiered[i]['price_cn']+'</span></td>';
}
if (goods_type == 1) {
html += '<td>$<span class="goods-min-price-us">'+price_arr[i]['price_us']+'</span></td>';
html += '<td>$<span class="goods-min-price-us">'+data.tiered[i]['price_us']+'</span></td>';
}
} else {
if (data.ac_type) {
html += '<td><span>'+price_arr[i]['purchases']+'</span></td><td>¥<span class="price-line">'+price_arr[i]['price_cn']+'</span></td><td>¥<span>'+price_arr[i]['price_ac']+'</span></td>';
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="price-line">'+data.tiered[i]['price_cn']+'</span></td><td>¥<span>'+data.tiered[i]['price_ac']+'</span></td>';
} else {
html += '<td><span>'+price_arr[i]['purchases']+'</span></td><td>¥<span>'+price_arr[i]['price_cn']+'</span></td>';
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span>'+data.tiered[i]['price_cn']+'</span></td>';
}
if (goods_type == 1) {
html += '<td>$<span>'+price_arr[i]['price_us']+'</span></td>';
html += '<td>$<span>'+data.tiered[i]['price_us']+'</span></td>';
}
}
html += '</tr>';
}
if (data.ac_type == 1) {
$('.ladder_price_table tr:eq(0)').append('<th>活动价</th>')
}
$('.ladder_price_table tr:gt(0)').remove();
$('.ladder_price_table').append(html);
// $('.ladder_price_table tr:gt(0)').remove();
$('.ladder_price_table').empty().append(html);
}
}
}
......@@ -334,7 +337,7 @@
return false;
}
if (type == 0) {
if (type == 3 || type == 4) {
layer.msg('仅支持联营商品下单,请在自营订单中下单');
return false;
}
......
......@@ -301,7 +301,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>状态</span>
<span>是否能购买</span>
<span class="status"></span>
</div>
</div>
......@@ -310,10 +310,10 @@
<div class="sku-info-right">
<table class="table table-hover ladder_price_table">
<tr>
<!-- <tr>
<th>阶梯</th>
<th>RMB价格</th>
</tr>
</tr> -->
</table>
</div>
......
......@@ -320,7 +320,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>状态</span>
<span>是否能购买</span>
<span class="status"></span>
</div>
</div>
......@@ -329,11 +329,11 @@
<div class="sku-info-right">
<table class="table table-hover ladder_price_table">
<tr>
<!-- <tr>
<th>阶梯</th>
<th>RMB价格</th>
<th>USD价格</th>
</tr>
</tr> -->
</table>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment