|
|
@@ -135,36 +135,32 @@ export default {
|
|
|
ghsInfo({shopId: shopId}).then(res => {
|
|
|
let ghsId = res.data.id
|
|
|
that.option.ghsId = ghsId
|
|
|
- that.productDetail(id,shopId)
|
|
|
+ that.productDetail(id,shopId,ghsId)
|
|
|
})
|
|
|
}else{
|
|
|
that.$msg('二维码有问题')
|
|
|
}
|
|
|
}else{
|
|
|
- if(this.option.ghsId){
|
|
|
+ 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){
|
|
|
this.isShare = false
|
|
|
- getGhsDataApi({id: this.option.ghsId}).then(res => {
|
|
|
+ getGhsDataApi({id: ghsId}).then(res => {
|
|
|
if(res.code == 1){
|
|
|
let shopId = res.data.shopId ? res.data.shopId : 0
|
|
|
- that.productDetail(this.option.id,shopId)
|
|
|
+ that.productDetail(id, shopId, ghsId)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- 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){
|
|
|
+ productDetail(id, shopId, ghsId){
|
|
|
let that = this
|
|
|
- let ghsId = this.option.ghsId ? this.option.ghsId : 0
|
|
|
- getGhsProductDetail({ id: id,ghsId:ghsId}).then(res => {
|
|
|
+ getGhsProductDetail({ id: id, ghsId:ghsId}).then(res => {
|
|
|
if (!this.$util.isEmpty(res.data)){
|
|
|
-
|
|
|
this.productInfo = res.data
|
|
|
|
|
|
let newArr = [];
|