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