|
@@ -2,7 +2,7 @@
|
|
|
* @Author: PoJun
|
|
|
* @Date: 2023-09-28 10:38:11
|
|
|
* @LastEditors: PoJun
|
|
|
- * @LastEditTime: 2024-04-27 22:10:30
|
|
|
+ * @LastEditTime: 2024-05-08 19:58:36
|
|
|
* @Message: 供应商详情页面
|
|
|
-->
|
|
|
<template>
|
|
@@ -43,18 +43,18 @@
|
|
|
:border="false"
|
|
|
:cellStyle="{ padding: '15px' }"
|
|
|
></uv-cell>
|
|
|
- <uv-cell
|
|
|
- title="产品"
|
|
|
- :value="item.product"
|
|
|
- :border="false"
|
|
|
- :cellStyle="{ padding: '15px' }"
|
|
|
- ></uv-cell>
|
|
|
- <uv-cell
|
|
|
- title="优势产品"
|
|
|
- :value="item.superiorProduct"
|
|
|
- :border="false"
|
|
|
- :cellStyle="{ padding: '15px' }"
|
|
|
- ></uv-cell>
|
|
|
+ <uv-cell
|
|
|
+ title="产品分类"
|
|
|
+ :value="showProductNames(item.product)"
|
|
|
+ :border="false"
|
|
|
+ :cellStyle="{ padding: '15px' }"
|
|
|
+ ></uv-cell>
|
|
|
+ <uv-cell
|
|
|
+ title="优势产品"
|
|
|
+ :value="item.superiorProduct"
|
|
|
+ :border="false"
|
|
|
+ :cellStyle="{ padding: '15px' }"
|
|
|
+ ></uv-cell>
|
|
|
<uv-cell title="营业执照" :border="false" :cellStyle="{ padding: '15px' }">
|
|
|
<uv-album
|
|
|
v-if="item.businessLicense"
|
|
@@ -90,7 +90,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getSupplierInfo, getMySupplierInfo } from "@/config/http.js";
|
|
|
+import { getSupplierInfo, getMySupplierInfo, getProductsTreeNoAuth } from "@/config/http.js";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -108,6 +108,12 @@ export default {
|
|
|
getImageUrl(id) {
|
|
|
return process.env.VUE_APP_BASE_API + `/files/${id}/show_image`;
|
|
|
},
|
|
|
+ async getProductsList() {
|
|
|
+ if (!this.vuex_products.length) {
|
|
|
+ const data = await getProductsTreeNoAuth();
|
|
|
+ this.$uv.vuex("vuex_products", data ? data : []);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
getImages() {
|
|
@@ -125,10 +131,29 @@ export default {
|
|
|
return ids.map(v => this.getImageUrl(v));
|
|
|
};
|
|
|
},
|
|
|
+ showProductNames() {
|
|
|
+ return (rv = []) => {
|
|
|
+ if (!rv || !rv.length) return "";
|
|
|
+ let names = [];
|
|
|
+ this.vuex_products.map(item => {
|
|
|
+ let itemNs = [];
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ item.children.map(v => {
|
|
|
+ if (rv.includes(v.id)) {
|
|
|
+ itemNs.push(v.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ names = names.concat(itemNs);
|
|
|
+ });
|
|
|
+ return names.join(",");
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
this.showBtn = e.id ? false : true;
|
|
|
this.initPage(e.id);
|
|
|
+ this.getProductsList();
|
|
|
},
|
|
|
onReady() {
|
|
|
uni.$on("refreshSupplierDetail", () => {
|