| | |
| | | <FormItem label="商品卖点"> |
| | | {{ goods.sellingPoint }} |
| | | </FormItem> |
| | | <FormItem label="抽成比例"> |
| | | {{ goods.commission }}% |
| | | </FormItem> |
| | | <FormItem label="商品参数"> |
| | | <div v-if="goods.goodsParamsDTOList && goods.goodsParamsDTOList.length" v-for="(item,index) in goods.goodsParamsDTOList" :key="index"> |
| | | <div style="margin-bottom: 10px; display: flex; align-items: center;" > |
| | |
| | | </div> |
| | | </div> |
| | | </FormItem> |
| | | <FormItem label="商品标签"> |
| | | <span v-for="(item ,index) in goodsTag" :key="index"> |
| | | {{index === goodsTag.length - 1 ? item.tagName: item.tagName +"," }} |
| | | </span> |
| | | |
| | | </FormItem> |
| | | </div> |
| | | <h4>商品交易信息</h4> |
| | | <div class="form-item-view"> |
| | | <FormItem label="计量单位"> {{ goods.goodsUnit }}</FormItem> |
| | | <FormItem label="销售模式"> |
| | | {{ goods.salesModel === "RETAIL" ? "零售型" : "批发型" }} |
| | | <span v-if="goods.salesModel ==='RETAIL'">零售型</span> |
| | | <span v-else-if="goods.salesModel ==='PRESALE'">预售</span> |
| | | <span v-else-if="goods.salesModel ==='WHOLESALE'">批发型</span> |
| | | <span v-else>其他类型</span> |
| | | |
| | | <!-- {{ goods.salesModel === "RETAIL" ? "零售型" : "批发型" }}--> |
| | | </FormItem> |
| | | <FormItem label="销售规则" v-if="goods.salesModel !== 'RETAIL'"> |
| | | <Table |
| | |
| | | controls |
| | | class="player" |
| | | :src="goods.goodsVideo" |
| | | width="200" |
| | | height="180" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="商品规格"> |
| | |
| | | </template> |
| | | <script> |
| | | import { getGoodsDetail } from "@/api/goods"; |
| | | import {getGoodSTagById} from "@/api/goods-tag" |
| | | import {getSts} from '@/api/file' |
| | | export default { |
| | | name: "goodsDetail", |
| | | data() { |
| | | return { |
| | | goodsTag:[], |
| | | goods: {}, // 商品信息 |
| | | previewGoodsPicture: "", // 预览图片 |
| | | goodsPictureVisible: false, // 预览图片模态框 |
| | |
| | | }, |
| | | mounted() { |
| | | this.initGoods(this.$route.query.id); |
| | | this.getGoodSTagById(this.$route.query.id); |
| | | |
| | | }, |
| | | methods: { |
| | | getGoodSTagById(id){ |
| | | getGoodSTagById(id).then(res =>{ |
| | | if (res.code === 200){ |
| | | this.goodsTag = res.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({ |