wangcz 7 жил өмнө
parent
commit
2e82431dae

+ 1 - 1
components/store/ComponentInfo.vue

@@ -11,7 +11,7 @@
           </div>
           <div class="property-value">{{property.value ? property.value : '-'}}</div>
         </li>
-        <li v-if="!commodity.uuid || !component.properties || component.properties.length === 0" class="text-info">
+        <li v-if="!component.properties || component.properties.length === 0" class="text-info">
           <!--<i class="fa fa-smile-o fa-lg"></i> 暂无参数信息-->
           <span class="info">卖家上传的产品暂无参数,请 <a @click="goLink">联系卖家</a> 了解具体详情</span>
         </li>

+ 13 - 1
store/shop.js

@@ -49,10 +49,22 @@ export const actions = {
           return axios.get(`/api/commodity/component/${commodity.uuid}`)
             .then(response => {
               commit('storeInfo/GET_COMPONENT_SUCCESS', response.data)
-              return findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
+              return findStoreInfoFromUuid({ commit }, { uuid: commodity.storeid })
             }, err => {
               commit('storeInfo/GET_COMPONENT_FAILURE', err)
             })
+        } else if (commodity.storeid === process.env.pcbId && commodity.productid) {
+            return axios.get(`/api/product/kind/pcbproperty/${commodity.productid}`)
+              .then(response => {
+                let listData = {properties: []}
+                response.data.forEach(val => {
+                  listData.properties.push({value: val[0].value, property: {labelCn: val[1].labelCn}})
+                })
+                commit('storeInfo/GET_COMPONENT_SUCCESS', listData)
+                return findStoreInfoFromUuid({ commit }, {uuid: commodity.storeid})
+              }, err => {
+                commit('storeInfo/GET_COMPONENT_FAILURE', err)
+              })
         } else {
           // 如果是非标,清除上一次请求带出的器件信息
           commit('storeInfo/GET_COMPONENT_SUCCESS', {})