shish il y a 1 mois
Parent
commit
f6655e79be
2 fichiers modifiés avec 54 ajouts et 48 suppressions
  1. 32 27
      ghsApp/src/admin/clear/customInfo.vue
  2. 22 21
      hdApp/src/admin/clear/info.vue

+ 32 - 27
ghsApp/src/admin/clear/customInfo.vue

@@ -93,12 +93,10 @@
 								<!-- 部分销:备注式小字,独立一行自然换行 -->
 								<view v-if="showOrderClearLinks(s)" class="order-clear-remark" @click.stop>
 									<text class="order-clear-remark__label">总共{{ s.orderClearList.length }}个结账单:</text>
-									<text
-										v-for="(bill, billIndex) in s.orderClearList"
-										:key="billIndex"
-										class="order-clear-remark__link"
-										@click.stop="goClearBill(bill)"
-									><text v-if="billIndex > 0" class="order-clear-remark__sep">、</text>{{ bill.clearSn ? bill.clearSn : ('结账单' + (billIndex + 1)) }}<text v-if="Number(bill.amount)>0" class="order-clear-remark__amt">销¥{{ parseFloat(bill.amount) }}</text></text>
+									<block v-for="(bill, billIndex) in s.orderClearList" :key="billIndex">
+										<text v-if="billIndex > 0" class="order-clear-remark__sep">、</text>
+										<text class="order-clear-remark__link" @click.stop="goClearBill(bill)">{{ bill.clearSn ? bill.clearSn : ('结账单' + (billIndex + 1)) }}</text>
+									</block>
 								</view>
 							</view>
 						</view>
@@ -312,26 +310,31 @@ export default {
 			}
 			return order.orderClearList.length > 1
 		},
-		/** 部分销订单:跳转对应结账单详情 */
+		/** 部分销订单:redirectTo 替换当前页,不压入页面栈 */
 		goClearBill(item) {
-			const id = item && item.clearId ? item.clearId : 0
-			if (!id) {
+			const id = Number(item && item.clearId ? item.clearId : 0)
+			if (!id || id === Number(this.detailInfo.id)) {
 				return
 			}
-			this.pageTo({ url: '/admin/clear/customInfo', query: { id } })
+			this.pageTo({ url: '/admin/clear/customInfo', query: { id }, type: 2 })
 		},
 		async init() {
-			const { id } = this.option;
+			const id = Number(this.option && this.option.id ? this.option.id : 0)
 			if (!id) {
-				return;
+				return
 			}
-			const { data } = await getCustomDetail(id);
-			this.detailInfo = data;
-			let customName = data.customName ? data.customName : ''
-			let name = data.ghsShopName ? data.ghsShopName : '';
-			let num = data.num ? data.num : 0
-			let price = data.actPrice ? parseFloat(data.actPrice) : 0
-			this.title = name+' '+customName+' '+num+'笔 ¥'+price
+			await this.loadClearDetail(id)
+		},
+		/** 按结账单 id 拉取详情并刷新本页 */
+		async loadClearDetail(id) {
+			const { data } = await getCustomDetail(id)
+			this.detailInfo = data || {}
+			const customName = data.customName ? data.customName : ''
+			const name = data.ghsShopName ? data.ghsShopName : ''
+			const num = data.num ? data.num : 0
+			const price = data.actPrice ? parseFloat(data.actPrice) : 0
+			this.title = name + ' ' + customName + ' ' + num + '笔 ¥' + price
+			uni.pageScrollTo({ scrollTop: 0, duration: 200 })
 		}
 	}
 };
@@ -454,26 +457,28 @@ export default {
 						margin-bottom: 0;
 					}
 					.order-clear-remark {
-						margin-top: 12upx;
-						line-height: 1.6;
+						margin-top: 20upx;
+						line-height: 2;
 						word-break: break-all;
 					}
+					.order-clear-remark__label,
+					.order-clear-remark__link,
+					.order-clear-remark__sep {
+						display: inline;
+					}
 					.order-clear-remark__label {
-						font-size: 26upx;
+						font-size: 30upx;
 						color: #999;
 					}
 					.order-clear-remark__link {
-						font-size: 26upx;
+						font-size: 30upx;
 						color: #3385ff;
 						font-weight: normal;
 					}
 					.order-clear-remark__sep {
-						font-size: 26upx;
+						font-size: 30upx;
 						color: #999;
 					}
-					.order-clear-remark__amt {
-						margin-left: 6upx;
-					}
 				}
 			}
 		}

+ 22 - 21
hdApp/src/admin/clear/info.vue

@@ -63,12 +63,10 @@
 								<!-- 部分销:备注式小字,独立一行自然换行 -->
 								<view v-if="showOrderClearLinks(s)" class="order-clear-remark" @click.stop>
 									<text class="order-clear-remark__label">总共{{ s.orderClearList.length }}个结账单:</text>
-									<text
-										v-for="(bill, billIndex) in s.orderClearList"
-										:key="billIndex"
-										class="order-clear-remark__link"
-										@click.stop="goClearBill(bill)"
-									><text v-if="billIndex > 0" class="order-clear-remark__sep">、</text>{{ bill.clearSn ? bill.clearSn : ('结账单' + (billIndex + 1)) }}<text v-if="Number(bill.amount)>0" class="order-clear-remark__amt">销¥{{ parseFloat(bill.amount) }}</text></text>
+									<block v-for="(bill, billIndex) in s.orderClearList" :key="billIndex">
+										<text v-if="billIndex > 0" class="order-clear-remark__sep">、</text>
+										<text class="order-clear-remark__link" @click.stop="goClearBill(bill)">{{ bill.clearSn ? bill.clearSn : ('结账单' + (billIndex + 1)) }}</text>
+									</block>
 								</view>
 							</view>
 						</view>
@@ -176,13 +174,13 @@ export default {
 			}
 			return order.orderClearList.length > 1
 		},
-		/** 部分销订单:跳转对应结账单详情 */
+		/** 部分销订单:redirectTo 替换当前页,不压入页面栈 */
 		goClearBill(item) {
-			const id = item && item.clearId ? item.clearId : 0
-			if (!id) {
+			const id = Number(item && item.clearId ? item.clearId : 0)
+			if (!id || id === Number(this.detailInfo.id)) {
 				return
 			}
-			this.pageTo({ url: '/admin/clear/info', query: { id } })
+			this.pageTo({ url: '/admin/clear/info', query: { id }, type: 2 })
 		},
 		cancelFn(info){
 			if(this.notLogin()){
@@ -239,9 +237,10 @@ export default {
 		},
 		getInfo(id){
 			let that = this
-			getDetail({id}).then(res=>{
-				if(res.code == 1){
-					that.detailInfo = res.data
+			getDetail({ id }).then(res => {
+				if (res.code == 1) {
+					that.detailInfo = res.data || {}
+					uni.pageScrollTo({ scrollTop: 0, duration: 200 })
 				}
 			})
 		}
@@ -365,26 +364,28 @@ export default {
 						margin-bottom: 0;
 					}
 					.order-clear-remark {
-						margin-top: 12upx;
-						line-height: 1.6;
+						margin-top: 20upx;
+						line-height: 2;
 						word-break: break-all;
 					}
+					.order-clear-remark__label,
+					.order-clear-remark__link,
+					.order-clear-remark__sep {
+						display: inline;
+					}
 					.order-clear-remark__label {
-						font-size: 26upx;
+						font-size: 30upx;
 						color: #999;
 					}
 					.order-clear-remark__link {
-						font-size: 26upx;
+						font-size: 30upx;
 						color: #3385ff;
 						font-weight: normal;
 					}
 					.order-clear-remark__sep {
-						font-size: 26upx;
+						font-size: 30upx;
 						color: #999;
 					}
-					.order-clear-remark__amt {
-						margin-left: 6upx;
-					}
 				}
 			}
 		}