select specs
parent
219ff8a170
commit
10b3db109e
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
ENV = 'production'
|
||||
|
||||
#VUE_APP_BASE_API = 'https://jiqu-library.peidikeji.cn/api'
|
||||
VUE_APP_BASE_API = 'https://jiqu-library.abcdefg.fun/api'
|
||||
VUE_APP_BASE_API = 'https://jiqu-library.peidikeji.cn/api'
|
||||
#VUE_APP_BASE_API = 'https://jiqu-library.abcdefg.fun/api'
|
||||
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ export default {
|
|||
async cartClick(e) {
|
||||
this.productId = e.id;
|
||||
this.number = 1;
|
||||
this.skuId = '';
|
||||
await this.getProducts();
|
||||
this.show = true;
|
||||
},
|
||||
|
|
@ -154,7 +155,11 @@ export default {
|
|||
async getProducts() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const resData = await this.$api.get(`/v1/store/${this.mid}/product-spu/${this.productId}`);
|
||||
const params = {}
|
||||
if (this.skuId) {
|
||||
params.sku_id = this.skuId
|
||||
}
|
||||
const resData = await this.$api.get(`/v1/store/${this.mid}/product-spu/${this.productId}`, { params });
|
||||
this.products = resData;
|
||||
this.skuId = this.products?.sku.id;
|
||||
this.sku = this.products?.sku
|
||||
|
|
@ -220,9 +225,10 @@ export default {
|
|||
// 选择sku, 更新价格
|
||||
handleSkuSelect(e) {
|
||||
this.skuId = e.sku_id
|
||||
this.$api.get(`/v1/store/${this.mid}/product-sku/${e.sku_id}`).then(res => {
|
||||
this.sku = res
|
||||
})
|
||||
this.getProducts()
|
||||
// this.$api.get(`/v1/store/${this.mid}/product-sku/${e.sku_id}`).then(res => {
|
||||
// this.sku = res
|
||||
// })
|
||||
},
|
||||
handleBack() {
|
||||
if (getCurrentPages().length > 1) {
|
||||
|
|
|
|||
|
|
@ -576,7 +576,11 @@
|
|||
async getProducts() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const resData = await this.$api.get(`/v1/product/products/${this.productId}`);
|
||||
const params = {}
|
||||
if (this.skuId) {
|
||||
params.sku_id = this.skuId
|
||||
}
|
||||
const resData = await this.$api.get(`/v1/product/products/${this.productId}`, { params });
|
||||
this.products = resData;
|
||||
this.skuId = this.products?.sku.id
|
||||
|
||||
|
|
@ -614,7 +618,7 @@
|
|||
//sku改变
|
||||
onChangeSku(e) {
|
||||
this.skuId = e.sku_id;
|
||||
this.getProdutsku();
|
||||
this.getProducts();
|
||||
},
|
||||
//、
|
||||
async getProdutsku() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue