Browse Source

Merge branch 'master' of http://192.168.10.18:3000/sooka_shop/sooka_consult_uniapp

付宇航 1 year ago
parent
commit
3d5a005611
2 changed files with 9 additions and 2 deletions
  1. 1 1
      pages/index/announcementDetails.vue
  2. 8 1
      pages/quotations/quotations.vue

+ 1 - 1
pages/index/announcementDetails.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="uni-wrap">
 		<uni-section class="mb-10" :title="annoDetail.announcementTitle" :sub-title="subTitle">
-			<view class="uni-common-mt" style="background: #fff; padding: 20rpx">
+			<view class="uni-common-mt article" style="background: #fff; padding: 20rpx">
 				<rich-text :nodes="annoDetail.announcementBody"></rich-text>
 			</view>
 		</uni-section>

+ 8 - 1
pages/quotations/quotations.vue

@@ -27,7 +27,7 @@
           <uni-td align="center">{{ item.productName }}
           </uni-td>
           <uni-td align="center">
-            <view class="name">{{ item.type }}</view>
+            <view class="name">{{ item.type}}</view>
           </uni-td>
           <uni-td align="center">{{ item.price }}
           </uni-td>
@@ -132,9 +132,16 @@ export default {
       uni.stopPullDownRefresh();
     },
     dataFormat(rows) {
+      // 创建一个映射对象,键是id,值是productName
+      const idToProductName = this.categories.reduce((acc, cur) => {
+        acc[cur.id] = cur.productName;
+        return acc;
+      }, {});
       return rows.map(item => {
         let date = new Date(item.createTime);
         item.createTime = date.toLocaleDateString('zh-CN', {dateStyle: 'short'});
+        // 使用映射对象将type的值从id转换为productName
+        item.type = idToProductName[item.type] || item.type;
         return item;
       });
     },