提交 a3f09fff 编写于 作者: G gongfuxiang

商品详情接口调整

上级 0db84533
......@@ -499,6 +499,7 @@ Page({
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: (res) => {
if (res.data.code == 0) {
var spec_type = res.data.data.spec_type;
var spec_count = spec.length;
var index = (spec_count > 0) ? spec_count : 0;
if(index < sku_count)
......@@ -512,9 +513,9 @@ Page({
temp_data[i]['value'][k]['is_dont'] = '';
var temp_value = temp_data[i]['value'][k]['name'];
var temp_status = false;
for(var t in res.data.data)
for(var t in spec_type)
{
if(res.data.data[t] == temp_value)
if(spec_type[t] == temp_value)
{
temp_status = true;
break;
......@@ -581,10 +582,11 @@ Page({
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: (res) => {
if (res.data.code == 0) {
var spec_base = res.data.data.spec_base;
this.setData({
goods_spec_base_price: res.data.data.price,
goods_spec_base_original_price: res.data.data.original_price,
goods_spec_base_inventory: res.data.data.inventory,
goods_spec_base_price: spec_base.price,
goods_spec_base_original_price: spec_base.original_price,
goods_spec_base_inventory: spec_base.inventory,
});
} else {
app.showToast(res.data.msg);
......
......@@ -454,6 +454,7 @@ Page({
dataType: 'json',
success: res => {
if (res.data.code == 0) {
var spec_type = res.data.data.spec_type;
var spec_count = spec.length;
var index = spec_count > 0 ? spec_count : 0;
if (index < sku_count) {
......@@ -463,8 +464,8 @@ Page({
temp_data[i]['value'][k]['is_dont'] = '';
var temp_value = temp_data[i]['value'][k]['name'];
var temp_status = false;
for (var t in res.data.data) {
if (res.data.data[t] == temp_value) {
for (var t in spec_type) {
if (spec_type[t] == temp_value) {
temp_status = true;
break;
}
......@@ -524,10 +525,11 @@ Page({
dataType: 'json',
success: res => {
if (res.data.code == 0) {
var spec_base = res.data.data.spec_base;
this.setData({
goods_spec_base_price: res.data.data.price,
goods_spec_base_original_price: res.data.data.original_price,
goods_spec_base_inventory: res.data.data.inventory
goods_spec_base_price: spec_base.price,
goods_spec_base_original_price: spec_base.original_price,
goods_spec_base_inventory: spec_base.inventory
});
} else {
app.showToast(res.data.msg);
......
......@@ -479,6 +479,7 @@ Page({
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var spec_type = res.data.data.spec_type;
var spec_count = spec.length;
var index = (spec_count > 0) ? spec_count : 0;
if(index < sku_count)
......@@ -492,9 +493,9 @@ Page({
temp_data[i]['value'][k]['is_dont'] = '';
var temp_value = temp_data[i]['value'][k]['name'];
var temp_status = false;
for(var t in res.data.data)
for(var t in spec_type)
{
if(res.data.data[t] == temp_value)
if(spec_type[t] == temp_value)
{
temp_status = true;
break;
......@@ -560,10 +561,11 @@ Page({
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var spec_base = res.data.data.spec_base;
this.setData({
goods_spec_base_price: res.data.data.price,
goods_spec_base_original_price: res.data.data.original_price,
goods_spec_base_inventory: res.data.data.inventory,
goods_spec_base_price: spec_base.price,
goods_spec_base_original_price: spec_base.original_price,
goods_spec_base_inventory: spec_base.inventory,
});
} else {
app.showToast(res.data.msg);
......
......@@ -479,6 +479,7 @@ Page({
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var spec_type = res.data.data.spec_type;
var spec_count = spec.length;
var index = (spec_count > 0) ? spec_count : 0;
if(index < sku_count)
......@@ -492,9 +493,9 @@ Page({
temp_data[i]['value'][k]['is_dont'] = '';
var temp_value = temp_data[i]['value'][k]['name'];
var temp_status = false;
for(var t in res.data.data)
for(var t in spec_type)
{
if(res.data.data[t] == temp_value)
if(spec_type[t] == temp_value)
{
temp_status = true;
break;
......@@ -560,10 +561,11 @@ Page({
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var spec_base = res.data.data.spec_base;
this.setData({
goods_spec_base_price: res.data.data.price,
goods_spec_base_original_price: res.data.data.original_price,
goods_spec_base_inventory: res.data.data.inventory,
goods_spec_base_price: spec_base.price,
goods_spec_base_original_price: spec_base.original_price,
goods_spec_base_inventory: spec_base.inventory,
});
} else {
app.showToast(res.data.msg);
......
......@@ -496,6 +496,7 @@ Page({
data: { "id": this.data.goods.id, "spec": JSON.stringify(spec) },
dataType: 'json',
success: (res) => {
var spec_type = res.data.data.spec_type;
if (res.data.code == 0) {
var spec_count = spec.length;
var index = (spec_count > 0) ? spec_count : 0;
......@@ -510,9 +511,9 @@ Page({
temp_data[i]['value'][k]['is_dont'] = '';
var temp_value = temp_data[i]['value'][k]['name'];
var temp_status = false;
for(var t in res.data.data)
for(var t in spec_type)
{
if(res.data.data[t] == temp_value)
if(spec_type[t] == temp_value)
{
temp_status = true;
break;
......@@ -578,10 +579,11 @@ Page({
dataType: 'json',
success: (res) => {
if (res.data.code == 0) {
var spec_base = res.data.data.spec_base;
this.setData({
goods_spec_base_price: res.data.data.price,
goods_spec_base_original_price: res.data.data.original_price,
goods_spec_base_inventory: res.data.data.inventory,
goods_spec_base_price: spec_base.price,
goods_spec_base_original_price: spec_base.original_price,
goods_spec_base_inventory: spec_base.inventory,
});
} else {
app.showToast(res.data.msg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册