...
|
...
|
@@ -32,8 +32,8 @@ module.exports = { |
|
|
* @param result
|
|
|
*/
|
|
|
onAddToCart: (result)=> {
|
|
|
// TODO: 库存不足
|
|
|
// TODO: 商品已下架
|
|
|
// TODO: 库存不足 后台暂未实现
|
|
|
// TODO: 商品已下架 后台暂未实现
|
|
|
if (result.code === 200) {
|
|
|
this.cartCount = result.data.goods_count;
|
|
|
this.showFeatureSelector = false;
|
...
|
...
|
@@ -91,6 +91,7 @@ module.exports = { |
|
|
},
|
|
|
created() {
|
|
|
const self = this;
|
|
|
const pid = app.data('pid');
|
|
|
|
|
|
// 显示商品特征选择组件
|
|
|
this.$on('feature.close', function() {
|
...
|
...
|
@@ -98,13 +99,13 @@ module.exports = { |
|
|
});
|
|
|
|
|
|
// 读取基础数据
|
|
|
$.get(`/product/product_${app.data('pid')}_${app.data('goodsId')}.json`).then((result) => {
|
|
|
$.get(`/product/product_${pid}.json`).then((result) => {
|
|
|
// TODO: 异常处理
|
|
|
this.entity = result;
|
|
|
return result;
|
|
|
}).then((result)=> {
|
|
|
// 读取商品详情
|
|
|
return $.get('/product/product/intro.json', {skn: result.productPriceBo.productSkn});
|
|
|
return $.get(`/product/product/intro_${pid}.json`, {skn: result.productPriceBo.productSkn});
|
|
|
}).then(result => {
|
|
|
this.intro = result;
|
|
|
}).fail(err => {
|
...
|
...
|
|