Commit 698e493b by 朱继来

调整sku接口

parent a27bbd7b
......@@ -288,12 +288,15 @@ Class AddOrderController extends Controller
{
if ($request->isMethod('post')) {
$url = Config('website.search-skuid');
$data['sku_id'] = $request->input('sku_id');
$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 (!empty($response['data']['data'])) {
return ['errcode' => 0, 'errmsg' => '', 'data' => $response['data']['data'][$data['sku_id']]];
if (!empty($response['data'])) {
return ['errcode' => 0, 'errmsg' => '', 'data' => $response['data']];
} else {
return ['errcode' => -1, 'errmsg' => '未找SKU信息'];
}
......
......@@ -52,7 +52,8 @@ return [
// 查询SKUID接口
// 'search-skuid' => 'http://footstone.liexin.net/webapi/sku_list',
'search-skuid' => 'http://www.liexin.com/v3/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',
......
......@@ -222,7 +222,7 @@
type: 'post',
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,9 +236,9 @@
$('.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);
$('.stock').text(data.goods_number);
$('.moq').text(data.min_buy);
$('.mpq').text(data.min_mpq);
if (goods_type == 1) {
var status = data.goods_status;
......@@ -258,8 +258,8 @@
$('.goods_type').val(data.goods_type);
//阶梯价格
if (data.ladder_price != null) {
var len = data.ladder_price.length;
if (data.tiered != null) {
var len = data.tiered.length;
if (len > 0) {
var html = '';
var str = '';
......@@ -267,16 +267,16 @@
for (var i = 0; i < len; i++) {
if (i == 0) {
if (goods_type == 1) {
str = '<td>$<span class="goods-min-price-us">'+data.ladder_price[i]['price_us']+'</span></td>';
str = '<td>$<span class="goods-min-price-us">'+data.tiered[i]['price_us']+'</span></td>';
}
html += '<tr><td><span class="goods-min-num">'+data.ladder_price[i]['purchases']+'</span></td><td>¥<span class="goods-min-price">'+data.ladder_price[i]['price_cn']+'</span></td>'+str+'</tr>';
html += '<tr><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>'+str+'</tr>';
} else {
if (goods_type == 1) {
str = '<td>$<span>'+data.ladder_price[i]['price_us']+'</span></td>';
str = '<td>$<span>'+data.tiered[i]['price_us']+'</span></td>';
}
html += '<tr><td><span>'+data.ladder_price[i]['purchases']+'</span></td><td>¥<span>'+data.ladder_price[i]['price_cn']+'</span></td>'+str+'</tr>';
html += '<tr><td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span>'+data.tiered[i]['price_cn']+'</span></td>'+str+'</tr>';
}
}
......
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