6
0
Fork 0

select specs

develop
panliang 2023-03-17 22:38:36 +08:00
parent 219ff8a170
commit 10b3db109e
3 changed files with 18 additions and 8 deletions

View File

@ -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'

View File

@ -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) {

View File

@ -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() {