zxl
4 天以前 c1e567ddda7f65651179a8a73ca849b07b066b14
manager/src/views/goods/goods-info/goodsDetail.vue
@@ -143,6 +143,7 @@
</template>
<script>
import { getGoodsDetail } from "@/api/goods";
import {getSts} from '@/api/file'
export default {
  name: "goodsDetail",
  data() {
@@ -193,6 +194,26 @@
    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({