소스 검색

解决样式消失问题

Yannay 2 달 전
부모
커밋
78302c9971

+ 13 - 5
pages/orderDetailNew/components/orderDetailNewView.vue

@@ -5,8 +5,7 @@
5 5
             <pageOne @handleNextClick="handleNextClick" :orderDetail="detail" :orderId="orderId" />
6 6
         </view>
7 7
         <view class="page-item" v-show="activeIndex === 1">
8
-            <pageTwo @handleNextClick="handleNextClick" :orderDetail="detail" :orderId="orderId"
9
-                :followUpList="followUpList" />
8
+            <pageTwo @handleNextClick="handleNextClick" :orderDetail="detail" :orderId="orderId" :followUpList="followUpList" />
10 9
         </view>
11 10
         <view class="page-item" v-show="activeIndex === 2">
12 11
             <pageThree @handleNextClick="handleNextClick" :orderDetail="detail" @handleNeedSave="handleNeedSave"
@@ -68,7 +67,7 @@ export default {
68 67
             //订单细节
69 68
             orderDetail: {},
70 69
             // 跟进记录
71
-            followUpList: {},
70
+            followUpList: [],
72 71
         }
73 72
     },
74 73
     name: 'OrderDetailNewView',
@@ -253,8 +252,17 @@ export default {
253 252
         async getFollowUpList() {
254 253
             try {
255 254
                 const res = await uni.$u.api.getDuplicateOrderFollowListByClueId({ clueId: this.orderDetail.clueId });
256
-                console.log('这里是跟进记录', res)
257
-                this.followUpList = res.data || [];
255
+                const data = res.data || {};
256
+
257
+                const followUpList = [];
258
+                for (const key in data) {
259
+                    const element = data[key];
260
+                    followUpList.push(...element)
261
+                }
262
+                this.followUpList = followUpList;
263
+
264
+
265
+
258 266
             } catch (error) {
259 267
                 console.error("获取跟进记录失败:", error);
260 268
                 uni.$u.toast("获取跟进记录失败");

+ 75 - 9
pages/orderDetailNew/components/pageTwo.vue

@@ -32,7 +32,7 @@
32 32
                             type="textarea" placeholder="请输入拍图技巧" rows="3" class="checklist-textarea" />
33 33
                         <!-- 上传图片按钮 -->
34 34
                         <view v-if="selectedCheckbox.includes('photo技巧')" class="upload-btn-container">
35
-                            <div class="upload-btn" @click="getImageUrl('')">
35
+                            <div class="upload-btn" @click="handleUpload('photoTips')">
36 36
                                 <u-icon name="camera" size="32rpx" color="#108cff"></u-icon>
37 37
                                 <text class="upload-btn-text">上传图片</text>
38 38
                             </div>
@@ -55,7 +55,7 @@
55 55
                             type="textarea" placeholder="请输入备注信息" rows="3" class="checklist-textarea" />
56 56
                         <!-- 上传图片按钮 -->
57 57
                         <view v-if="selectedCheckbox.includes('face2face')" class="upload-btn-container">
58
-                            <div class="upload-btn" @click="getImageUrl('')">
58
+                            <div class="upload-btn" @click="handleUpload('face2faceNotes')">
59 59
                                 <u-icon name="camera" size="32rpx" color="#108cff"></u-icon>
60 60
                                 <text class="upload-btn-text">上传图片</text>
61 61
                             </div>
@@ -143,9 +143,10 @@ export default {
143 143
             default: '',
144 144
         },
145 145
         followUpList: {
146
-            type: Object,
147
-            default: () => { },
148
-        }
146
+            type: Array,
147
+            default: () => [],
148
+        },
149
+
149 150
     },
150 151
     watch: {
151 152
         orderDetail: {
@@ -157,12 +158,22 @@ export default {
157 158
             },
158 159
             deep: true,
159 160
         },
161
+        followUpList: {
162
+            handler(newVal) {
163
+                if (newVal) {
164
+                    this.followUpListInner = newVal.map(item => (item.content || ''));
160 165
 
166
+                    //判断内容是否含有上面的三个选择
167
+                    this.checkFollowUpContent();
168
+                }
169
+            },
170
+            deep: true,
171
+        },
161 172
     },
162
-
163 173
     components: {
164 174
         picComp
165 175
     },
176
+
166 177
     data() {
167 178
         return {
168 179
             selectedCheckbox: [],
@@ -185,12 +196,10 @@ export default {
185 196
             detailImages: [],// 高清细节图数组
186 197
             // 绑定订单相关
187 198
             bindList: [],// 待绑定的图片列表,
199
+            followUpListInner: [],// 跟进记录数组
188 200
         };
189 201
     },
190 202
     methods: {
191
-
192
-
193
-
194 203
         // 价格输入回调
195 204
         onPriceInput(e) {
196 205
             // 确保价格是数字且不小于0
@@ -249,6 +258,63 @@ export default {
249 258
                 form: result,
250 259
             })
251 260
         },
261
+        checkFollowUpContent() {
262
+            // 检查跟进记录是否包含上面的三个选择
263
+            this.followUpListInner.forEach(item => {
264
+                console.log('这里是跟进记录', item)
265
+                // 判断内容是否含有联系师傅,师傅拍图技巧,到达客户面对面,如果包含的话就上面对应的box就打上对勾
266
+                if (item.includes('联系师傅')) {
267
+                    this.selectedCheckbox.push('contact师傅');
268
+                    // 联系师傅的手机号,已:为分割,取后面的内容
269
+                    const phone = item.split('联系师傅:')[1] || '';
270
+                    this.formData.contactPhone = phone;
271
+                }
272
+                if (item.includes('师傅拍图技巧')) {
273
+                    this.selectedCheckbox.push('photo技巧');
274
+                    // 师傅拍图技巧的内容,已:为分割,取后面的内容
275
+                    const photoTips = item.split('师傅拍图技巧:')[1] || '';
276
+                    this.formData.photoTips = photoTips;
277
+                }
278
+                if (item.includes('到达客户面对面')) {
279
+                    this.selectedCheckbox.push('face2face');
280
+                    // 到达客户面对面的内容,已:为分割,取后面的内容
281
+                    const face2faceNotes = item.split('到达客户面对面:')[1] || '';
282
+                    this.formData.face2faceNotes = face2faceNotes;
283
+                }
284
+            })
285
+        },
286
+
287
+        // 处理上传图片,上传图片的话就赋值给对应的数组
288
+        async handleUpload(field) {
289
+            uni.chooseImage({
290
+                count: 9, // 最多选择1张
291
+                sizeType: ['compressed'], // 压缩图片
292
+                sourceType: ['album', 'camera'], // 从相册选择或拍照
293
+                success: async (res) => {
294
+                    const tempFilePath = res.tempFilePaths
295
+                    console.log('上传的图片路径:', tempFilePath)
296
+                    // 把blob数组上传到服务器,然后返回路径
297
+                    try {
298
+                        const res = await Promise.all(tempFilePath.map(filePath => uni.$u.api.uploadFile(filePath)));
299
+                        console.log('上传的图片路径数组是:', res.map(item => item.data.fileUrl))
300
+                        // 把返回的路径赋值给对应的数组
301
+                        if (field == 'photoTips') {
302
+                            this.photoTipsImages = [...this.photoTipsImages, ...res.map(item => item.data.fileUrl)];
303
+                        } else if (field == 'face2face') {
304
+                            this.face2faceImages = [...this.face2faceImages, ...res.map(item => item.data.fileUrl)];
305
+                        } 
306
+                    } catch (error) {
307
+                        console.error('上传失败:', error);
308
+                        uni.$u.toast('上传失败');
309
+                    }
310
+                },
311
+                fail: (err) => {
312
+                    console.error('选择图片失败:', err)
313
+                }
314
+            })
315
+        },
316
+
317
+
252 318
 
253 319
 
254 320
 

+ 24 - 24
pages/orderDetailNew/mixin/imgUploadAndDownLoad.js

@@ -138,29 +138,29 @@ export default {
138 138
             this.bindList = [];
139 139
         },
140 140
         //选择图图片》上传》返回路径,适用于page2选项里面的上传图片
141
-        // getImageUrl() {
142
-        //     uni.chooseImage({
143
-        //         count: 9, // 最多选择1张
144
-        //         sizeType: ['compressed'], // 压缩图片
145
-        //         sourceType: ['album', 'camera'], // 从相册选择或拍照
146
-        //         success: async (res) => {
147
-        //             const tempFilePath = res.tempFilePaths
148
-        //             console.log('上传的图片路径:', tempFilePath)
149
-        //             // 把blob数组上传到服务器,然后返回路径
150
-        //             try {
151
-        //                 const res = await Promise.all(tempFilePath.map(filePath => uni.$u.api.uploadFile(filePath)));
152
-        //                 console.log('上传的图片路径数组是:', res.map(item => item.data.fileUrl))
153
-        //                 // 把数组返回给调用者
154
-        //                 return res.map(item => item.data.fileUrl)
155
-        //             } catch (error) {
156
-        //                 console.error('上传失败:', error);
157
-        //                 uni.$u.toast('上传失败');
158
-        //             }
159
-        //         },
160
-        //         fail: (err) => {
161
-        //             console.error('选择图片失败:', err)
162
-        //         }
163
-        //     })
164
-        // }
141
+        getImageUrl() {
142
+            uni.chooseImage({
143
+                count: 9, // 最多选择1张
144
+                sizeType: ['compressed'], // 压缩图片
145
+                sourceType: ['album', 'camera'], // 从相册选择或拍照
146
+                success: async (res) => {
147
+                    const tempFilePath = res.tempFilePaths
148
+                    console.log('上传的图片路径:', tempFilePath)
149
+                    // 把blob数组上传到服务器,然后返回路径
150
+                    try {
151
+                        const res = await Promise.all(tempFilePath.map(filePath => uni.$u.api.uploadFile(filePath)));
152
+                        console.log('上传的图片路径数组是:', res.map(item => item.data.fileUrl))
153
+                        // 把数组返回给调用者
154
+                        return res.map(item => item.data.fileUrl)
155
+                    } catch (error) {
156
+                        console.error('上传失败:', error);
157
+                        uni.$u.toast('上传失败');
158
+                    }
159
+                },
160
+                fail: (err) => {
161
+                    console.error('选择图片失败:', err)
162
+                }
163
+            })
164
+        }
165 165
     }
166 166
 }

+ 210 - 11
pages/pagereceivecenter/pagereceivecenter.vue

@@ -1,9 +1,9 @@
1 1
 <script>
2
-import orderCard from "./compounts/orderCard.vue";
2
+// import orderCard from "./compounts/orderCard.vue";
3 3
 
4 4
 export default {
5 5
     components: {
6
-        orderCard,
6
+        // orderCard,
7 7
     },
8 8
     data() {
9 9
         return {
@@ -18,9 +18,9 @@ export default {
18 18
     onLoad() {
19 19
         //初始调用
20 20
         this.getOrderList();
21
-        uni.navigateTo({
22
-            url: `/pages/orderDetailNew/index?orderId=5464&item=测试发单&type=undefined&clueId=1973381744953516033`,
23
-        })
21
+        // uni.navigateTo({
22
+        //     url: `/pages/orderDetailNew/index?orderId=5464&item=测试发单&type=undefined&clueId=1973381744953516033`,
23
+        // })
24 24
     },
25 25
     methods: {
26 26
         //获取列表数据
@@ -83,12 +83,13 @@ export default {
83 83
             }
84 84
         },
85 85
 
86
+        
86 87
         //滑动加载
87 88
         scrolltolower() {
88 89
             console.log('到底了');
89
-            if (this.orderList.length >= this.page.total) {
90
-                return uni.$u.toast('没有更多了');
91
-            }
90
+            // if (this.orderList.length >= this.page.total) {
91
+            //     return uni.$u.toast('没有更多了');
92
+            // }
92 93
             this.page.pageNum++;
93 94
             this.getOrderList();
94 95
         },
@@ -104,12 +105,64 @@ export default {
104 105
         <view class="scrollViewContainer">
105 106
             <scroll-view class="scrollView" scroll-y @scrolltolower="scrolltolower">
106 107
                 <transition-group name="order-move" tag="div">
107
-                    <orderCard v-for="item in orderList" :key="item.receiptId + item.id" :order="item"
108
+                    <!-- <orderCard v-for="item in orderList" :key="item.receiptId + item.id" :order="item"
108 109
                         @handleBtnClick="handleBtnClick">
109
-                    </orderCard>
110
+                    </orderCard> -->
111
+                    <view class="orderCard" v-for="item in orderList"  :key="item.receiptId + item.id">
112
+                        <view class="bandAndPrice">
113
+                            <view class="bandName">{{ item.itemBrand || '暂无品牌' }}</view>
114
+                            <view class="price">¥{{ item.priceRange }}</view>
115
+                        </view>
116
+
117
+                        <view class="mainLind">
118
+                            <view class="mainLindImg">
119
+                                <image :src="'/static/acceptOrder/orderCardPic.jpg'" alt="" />
120
+                            </view>
121
+                            <view class="mainLindInfo">
122
+                                <view class="itemName">{{ item.item || '暂无项目' }}</view>
123
+                                <view>发单人:{{ item.createNickName || '未知' }}</view>
124
+                                <view>{{ item.sendDate || '暂无时间' }}</view>
125
+                            </view>
126
+                        </view>
127
+
128
+                        <view class="tags">
129
+                            <view class="tag" v-for="(tag, index) in item.tags" :key="index"
130
+                                :style="{ backgroundColor: tag.color, opacity: 0.8 }">
131
+                                {{ tag.name }}</view>
132
+
133
+                        </view>
134
+
135
+                        <view class="Btns">
136
+
137
+                            <view class="btnGroup"
138
+                                v-if="item && (item.status == '1' || item.status == null || item.status === undefined)">
139
+                                <view class="card-button" @click="handleBtnClick('acceptOrder', item)">立即接单</view>
140
+                                <view class=" card-button isBusy" @click="handleBtnClick('isBusy', item)">在忙</view>
141
+                            </view>
142
+
143
+                            <view class="btnGroup"
144
+                                v-if="item && (item.status == '2' || item.status == null || item.status === undefined)">
145
+                                <view class="card-button willFollow" @click="handleBtnClick('willFollow', item)">待跟进
146
+                                </view>
147
+                                <view class="card-button isBusy" @click="handleBtnClick('tag', item)">打标签</view>
148
+                            </view>
149
+
150
+                            <view class="btnGroup"
151
+                                v-if="item && (item.status == '3' || item.status == null || item.status === undefined)">
152
+                                <view class="card-button share" @click="handleBtnClick('share', item)">一键分享</view>
153
+                            </view>
154
+
155
+                            <view class="btnGroup"
156
+                                v-if="item && (item.status == '4' || item.status == null || item.status === undefined)">
157
+                                <view class="card-button oneFollow" @click="handleBtnClick('oneFollow', item)">待跟进
158
+                                </view>
159
+                            </view>
160
+
161
+                        </view>
162
+                    </view>
110 163
                 </transition-group>
111 164
                 <view class="hasMore">
112
-                    {{ orderList.length >= page.total ? '没有更多了~' : '向下滑动加载更多~' }}
165
+                    <!-- {{ orderList.length >= page.total ? '没有更多了~' : '向下滑动加载更多~' }} -->
113 166
                 </view>
114 167
             </scroll-view>
115 168
         </view>
@@ -152,4 +205,150 @@ export default {
152 205
 .order-move-move {
153 206
     transition: transform 0.5s ease;
154 207
 }
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+/* 订单卡片主容器 */
219
+.orderCard {
220
+    box-sizing: border-box;
221
+    width: 95%;
222
+    background-color: #fff;
223
+    margin: 20rpx auto;
224
+    border-radius: 20rpx;
225
+    padding: 20rpx;
226
+}
227
+
228
+/* 品牌和价格区域 */
229
+.orderCard .bandAndPrice {
230
+    display: flex;
231
+    justify-content: space-between;
232
+    align-items: center;
233
+}
234
+
235
+/* 品牌名称 */
236
+.orderCard .bandAndPrice .bandName {
237
+    font-size: 20rpx;
238
+    font-weight: 700;
239
+    border: 2px solid #2563EB;
240
+    padding: 6rpx 12rpx;
241
+    border-radius: 15rpx;
242
+    background-color: #EFF6FF;
243
+    color: #2563EB;
244
+}
245
+
246
+/* 价格 */
247
+.orderCard .bandAndPrice .price {
248
+    font-size: 30rpx;
249
+    font-weight: 700;
250
+}
251
+
252
+/* 主要内容行 */
253
+.orderCard .mainLind {
254
+    margin-top: 10rpx;
255
+    display: flex;
256
+    justify-content: space-between;
257
+    align-items: center;
258
+    gap: 20rpx;
259
+}
260
+
261
+/* 主要内容行图片容器 */
262
+.orderCard .mainLind .mainLindImg image {
263
+    width: 150rpx;
264
+    height: 150rpx;
265
+    border-radius: 20rpx;
266
+}
267
+
268
+/* 主要内容行信息容器 */
269
+.orderCard .mainLind .mainLindInfo {
270
+    flex: 1;
271
+    display: flex;
272
+    flex-direction: column;
273
+    gap: 10rpx;
274
+    font-size: 24rpx;
275
+    color: #6b7280;
276
+}
277
+
278
+/* 商品名称 */
279
+.orderCard .mainLind .mainLindInfo .itemName {
280
+    font-size: 30rpx;
281
+    font-weight: 700;
282
+    color: #374751;
283
+}
284
+
285
+/* 标签区域 */
286
+.orderCard .tags {
287
+    display: flex;
288
+    gap: 10rpx;
289
+}
290
+
291
+/* 单个标签 */
292
+.orderCard .tags .tag {
293
+    font-size: 20rpx;
294
+    font-weight: 700;
295
+    padding: 6rpx 12rpx;
296
+    border-radius: 15rpx;
297
+    background-color: #EFF6FF;
298
+    color: #fff;
299
+}
300
+
301
+/* 按钮区域 */
302
+.orderCard .Btns {
303
+    margin-top: 10rpx;
304
+}
305
+
306
+/* 按钮组 */
307
+.orderCard .Btns .btnGroup {
308
+    display: flex;
309
+    justify-content: space-between;
310
+    align-items: center;
311
+    gap: 20rpx;
312
+}
313
+
314
+/* 卡片按钮基础样式 */
315
+.orderCard .Btns .btnGroup .card-button {
316
+    font-size: 24rpx;
317
+    font-weight: 700;
318
+    border: 2rpx solid #2563EB;
319
+    padding: 6rpx 12rpx;
320
+    border-radius: 15rpx;
321
+    background-color: #2563EB;
322
+    color: #fff;
323
+    width: 45%;
324
+    text-align: center;
325
+    cursor: pointer;
326
+    height: 60rpx;
327
+    line-height: 60rpx;
328
+}
329
+
330
+/* 忙碌状态按钮 */
331
+.orderCard .Btns .btnGroup .card-button.isBusy {
332
+    background-color: #fff;
333
+    color: #6B7280;
334
+    border-color: #6B7280;
335
+}
336
+
337
+/* 待跟进状态按钮 */
338
+.orderCard .Btns .btnGroup .card-button.willFollow {
339
+    background-color: #EFF6FF;
340
+    color: #2563EB;
341
+}
342
+
343
+/* 分享按钮 */
344
+.orderCard .Btns .btnGroup .card-button.share {
345
+    width: 100%;
346
+}
347
+
348
+/* 单独跟进按钮 */
349
+.orderCard .Btns .btnGroup .card-button.oneFollow {
350
+    width: 100%;
351
+    background-color: #EFF6FF;
352
+    color: #2563EB;
353
+}
155 354
 </style>