|
|
@@ -138,32 +138,36 @@ export default {
|
|
|
ghsInfo({shopId: shopId}).then(res => {
|
|
|
let ghsId = res.data.id
|
|
|
that.option.ghsId = ghsId
|
|
|
- that.productDetail(id,shopId,ghsId)
|
|
|
+ that.productDetail(id,shopId)
|
|
|
})
|
|
|
}else{
|
|
|
that.$msg('二维码有问题')
|
|
|
}
|
|
|
}else{
|
|
|
- let id = this.option.id ? parseInt(this.option.id) : 0
|
|
|
- let ghsId = this.option.ghsId ? parseInt(this.option.ghsId) : 0
|
|
|
- let shopId = this.option.shopId ? parseInt(this.option.shopId) : 0
|
|
|
- if(shopId > 0){
|
|
|
- that.productDetail(id, shopId, ghsId)
|
|
|
- } else if(ghsId > 0 && shopId == 0){
|
|
|
+ if(this.option.ghsId){
|
|
|
this.isShare = false
|
|
|
- getGhsDataApi({id: ghsId}).then(res => {
|
|
|
+ getGhsDataApi({id: this.option.ghsId}).then(res => {
|
|
|
if(res.code == 1){
|
|
|
let shopId = res.data.shopId ? res.data.shopId : 0
|
|
|
- that.productDetail(id, shopId, ghsId)
|
|
|
+ that.productDetail(this.option.id,shopId)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if(this.option.shopId){
|
|
|
+ ghsInfo({shopId: this.option.shopId}).then(res => {
|
|
|
+ let ghsId = res.data.id;
|
|
|
+ that.option.ghsId = ghsId
|
|
|
+ that.productDetail(this.option.id,this.option.shopId)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- productDetail(id, shopId, ghsId){
|
|
|
+ productDetail(id,shopId){
|
|
|
let that = this
|
|
|
- getGhsProductDetail({ id: id, ghsId:ghsId}).then(res => {
|
|
|
+ let ghsId = this.option.ghsId ? this.option.ghsId : 0
|
|
|
+ getGhsProductDetail({ id: id,ghsId:ghsId}).then(res => {
|
|
|
if (!this.$util.isEmpty(res.data)){
|
|
|
+
|
|
|
this.productInfo = res.data
|
|
|
let content = res.data.picTextGoods ? res.data.picTextGoods.content || "[]" : "[]";
|
|
|
this.previewContent = typeof content === "string" ? JSON.parse(content) : content || [];
|