mounted() {
this.getProductInfo()//获取完成传参
let that = this;
uni.$on("windowClose", (res) => {
that.windowclose(res)
})
},
//获取商品详情
async getProductInfo() {
try {
const result = await this.$API.goods.getProductInfo(this.id);
if (result.status === 200) {
uni.$emit("skuListArray",result.data)
this.skuList = result.data.productValue
this.storeInfo = result.data.storeInfo;
this.contaniner = result.data.storeInfo.description;
this.firstSuk = result.data.productValue[0].suk;
} else {
uni.showToast({
title: "该商品不存在",
duration: 2000,
});
uni.switchTab({
url: "/pages/index/index",
fail(e) {
console.log(e)
}
})
}
} catch (e) {
//TODO handle the exception
}
},
//子组件
mounted () {
let that = this;
uni.$on("skuListArray", function(res){
console.log(res,"接受到了")
})
uni.$on("activeIndex",(index)=>{
that.optSku(index)
})
},
//更新
updata(res) {
console.log(res,'aaa')
this.skuList = res.productValue;
this.shopname = res.storeInfo.store_name;
this.isgoods = res.storeInfo.is_goods;
}
0 个回复