zxl
3 天以前 9d2dab0d2d715e89013c4dbc702d04224bfe7ecc
商品打标签
1个文件已修改
17 ■■■■■ 已修改文件
manager/src/views/goods/goods-info/goodsDetail.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/views/goods/goods-info/goodsDetail.vue
@@ -30,6 +30,12 @@
               </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">
@@ -153,11 +159,13 @@
</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, // 预览图片模态框
@@ -198,8 +206,17 @@
  },
  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) => {