| | |
| | | </template> |
| | | <script> |
| | | import { getGoodsDetail } from "@/api/goods"; |
| | | import {getSts} from '@/api/file' |
| | | export default { |
| | | name: "goodsDetail", |
| | | data() { |
| | |
| | | initGoods(id) { |
| | | getGoodsDetail(id).then((res) => { |
| | | this.goods = res.result; |
| | | if (this.goods.goodsVideo != null && this.goods.goodsVideo !== '') { |
| | | getSts().then(res => { |
| | | console.log('--------------->',this.goods.goodsVideo.indexOf('http')!== -1) |
| | | if (this.goods.goodsVideo !== null && this.goods.goodsVideo.indexOf('http')=== -1) { |
| | | this.goods.goodsVideo = res.data.endpoint+'/'+this.goods.goodsVideo; |
| | | } |
| | | }) |
| | | } |
| | | if (this.goods.goodsGalleryList != null && this.goods.goodsGalleryList.length > 0) { |
| | | getSts().then(res => { |
| | | this.goods.goodsGalleryList = this.goods.goodsGalleryList.map((item) => { |
| | | if (item !== null&&item.indexOf('http')===-1) { |
| | | return res.data.endpoint+'/'+item; |
| | | }else { |
| | | return item; |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | let that = this; |
| | | res.result.skuList.forEach(function (sku, index, array) { |
| | | that.skuData.push({ |