From 1d782559b682f7eb7a374c2e8017ff65cb941e52 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 24 九月 2024 17:25:18 +0800
Subject: [PATCH] Merge remote-tracking branch 'remote-v2/master-2.0' into master-2.0

---
 pages/order/order.vue |   78 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 74 insertions(+), 4 deletions(-)

diff --git a/pages/order/order.vue b/pages/order/order.vue
index fb97ae7..606db74 100644
--- a/pages/order/order.vue
+++ b/pages/order/order.vue
@@ -93,6 +93,49 @@
 			uni.stopPullDownRefresh()
 		},
 		methods: {
+			
+			
+			openbrand(item) {
+				console.log(item)
+				//也要判断一下是否重复进入
+				//判断堆栈,如果是店铺,就直接返回
+				//或者是:从商铺到列表再到详情,再到商铺,这种也不行
+				const pages = getCurrentPages();
+				console.log('toShopping', pages)
+				if (pages && pages.length >= 2) {
+					if (pages[pages.length - 2].route === "sub_pages/customer/shop/shop") {
+						uni.navigateBack()
+						return
+					}
+				}
+				if (pages && pages.length >= 3) {
+					if (pages[pages.length - 3].route === "sub_pages/customer/shop/shop" &&
+						pages[pages.length - 2].route === "sub_pages/customer/trade/list"
+					) {
+						uni.navigateBack({
+							delta: 2
+						})
+						return
+					}
+				}
+			
+				if (pages.length >= 10) {
+					//直接强制购物车
+					uni.reLaunch({
+						url: '/sub_pages/customer/shop/shop?id=' + (item.supplierId || '')
+					})
+				} else {
+					uni.navigateTo({
+						url: '/sub_pages/customer/shop/shop?id=' + (item.supplierId || '')
+					})
+				}
+			
+			},
+			toFlowerDetail(item) {
+				uni.navigateTo({
+					url: `/sub_pages/customer/trade/detail?id=${item.flowerId}`
+				})
+			},
 			getList_after() {
 				var nowdate = new Date().getTime() - 1000 * 60 * 5
 				var change = false
@@ -123,6 +166,31 @@
 					url: '/pages/order/order-detail?id=' + item.id
 				})
 			},
+			
+			async copyOrder(item){
+				console.log(item)
+				await this.$message.confirm('是否确定再来一单')
+				// 发送请求
+				this.$message.showLoading()
+				const {
+					code,
+					data,
+					msg
+				} = await this.$http.request('get', '/api/customer/order/copyOrder', {
+					params: {
+						id: item.id,
+					}
+				})
+				this.$message.hideLoading()
+				if (code === 0) {
+					//微信接口
+					if(msg&&msg!=""){
+						this.$message.showToast(msg)
+					}
+				
+				}
+			},
+			
 			toDetailSaleInfo(dto, flower) {
 				console.log('flower', dto, flower)
 				uni.navigateTo({
@@ -410,15 +478,17 @@
 				<view class="flower-info m-b-5 m-t-8 br-4" v-for="(item,j) of dto.items" :key="j">
 					<!-- <view class="line-gray"></view> -->
 
-					<view class="supplier-name ">
+					<view class="supplier-name " @click.stop="openbrand(item)" >
 						<image class="icon-dp br-4" src="/static/common/icon-dp.png"></image>
 						{{ item.supplierName }}
 					</view>
-					<view class="flex m-t-12 flex-wrap-normal">
+					<view class="flex m-t-12 flex-wrap-normal" >
 						<image class="flower-img img100 m-r-6" :src="item.flowerCover"
 							@click="previewImg(item.flowerCover)">
 						</image>
-						<view class="flex1">
+						<!-- <view class="flex1" @click.stop="toFlowerDetail(item)"> -->
+						<view class="flex1" @click.stop="toDetail(dto)">
+							
 							<view class=" flex">
 								<view class="title flex flex1">
 									<!-- <span class="level">{{ item.flowerCategory }}</span> -->
@@ -505,7 +575,7 @@
 					</view>
 
 
-
+					<!-- <view class="button button-0 m-l-a m-r-15" @click="copyOrder(dto)">再来一单</view> -->
 					<view class="button button-1 m-l-a m-r-0" @click="toDetail(dto)">查看详情</view>
 				</view>
 			</view>

--
Gitblit v1.9.3