guhongwei 2 rokov pred
rodič
commit
779e9ae286

+ 10 - 4
src/components/orderParts/detail/parts/card-3.vue

@@ -28,7 +28,7 @@
                   </el-col>
                   <el-col :span="24"> X{{ spec.num }} </el-col>
                   <el-col :span="24">
-                    <span class="spanfour" style="color: blue; cursor: pointer" @click="toUrl(goods.url)"> 查看商品来源:{{ goods.source }}</span>
+                    <span class="spanfour" style="color: blue; cursor: pointer" @click="toUrl(goods)"> 查看商品来源:{{ goods.source }}</span>
                   </el-col>
                   <el-col :span="24"> {{ form.is_afterSale == true ? '已申请售后' : '未申请售后' }} </el-col>
                 </el-col>
@@ -73,6 +73,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('goods');
 export default {
   name: 'card-1',
   props: {
@@ -92,10 +93,15 @@ export default {
     this.search();
   },
   methods: {
+    ...mapActions(['fetch']),
     search() {},
-    toUrl(url) {
-      if (url) window.open(url, '_blank');
-      else this.$message.error('该商品还未添加来源网址,无法跳转');
+    async toUrl(goods) {
+      let res = await this.fetch(goods._id);
+      if (this.$checkRes(res)) {
+        let data = res.data;
+        if (data.url) window.open(data.url, '_blank');
+        else this.$message.error('该商品还未添加来源网址,无法跳转');
+      }
     },
     getActLength() {
       return _.get(this.total_detail, 'act.length');