XSLu08042 1 月之前
父節點
當前提交
3f8da4438f

+ 6 - 0
api/myStoreOrder.js

@@ -112,3 +112,9 @@ export function orderPrescription(id) {
  export function selectCacheAddress(data) {
  export function selectCacheAddress(data) {
  	 return request('/app/userAddress/selectCacheAddress',data,'POST','application/json;charset=UTF-8');
  	 return request('/app/userAddress/selectCacheAddress',data,'POST','application/json;charset=UTF-8');
  }
  }
+ export function selectPayInfo(data) {
+ 	 return request('/store/app/storeOrder/selectPayInfo',data,'POST','application/json;charset=UTF-8');
+ }
+ export function checkPrescribe(data) {
+ 	 return request('/store/app/storeOrder/checkPrescribe',data,'POST','application/json;charset=UTF-8');
+ }

+ 5 - 5
common/request.js

@@ -6,8 +6,8 @@ export default class Request {
 		// var path=uni.getStorageSync('requestPath')
 		// var path=uni.getStorageSync('requestPath')
 
 
 		var path = 'https://storeuserapp.bjyjbao.com'; //正式
 		var path = 'https://storeuserapp.bjyjbao.com'; //正式
-		// var path = "http://kd8f396b.natappfree.cc"
-		// var path = "http://192.168.10.126:8113"
+		// var path = "http://ga54cea4.natappfree.cc"
+		// var path = "http://192.168.10.196:8113"
 		let token="";
 		let token="";
 		let type = 0
 		let type = 0
 		if(url!=null){
 		if(url!=null){
@@ -46,11 +46,11 @@ export default class Request {
 				data: data,
 				data: data,
 				method: method,
 				method: method,
 				success: (res) => {
 				success: (res) => {
-					//收到开发者服务器成功返回的回调函数
-					if(res.data.code==401){//没有权限直接退出到登录界面
+					//收到开发者服务器成功返回的回调函数,36672没有openid
+					if(res.data.code==401 || res.data.code==36672){//没有权限直接退出到登录界面,
 						let pages = getCurrentPages();
 						let pages = getCurrentPages();
 						let url = pages[ pages.length - 1]; //当前页页面实例
 						let url = pages[ pages.length - 1]; //当前页页面实例
-						console.log(url)
+						uni.removeStorageSync('AppToken')
 						//如果登录界面已打开,自动关闭
 						//如果登录界面已打开,自动关闭
 						if(url!=undefined&&url.route=="pages/auth/login"){
 						if(url!=undefined&&url.route=="pages/auth/login"){
 							resolve(res.data)
 							resolve(res.data)

+ 3 - 0
pages_company/api/companyOrder.js

@@ -55,4 +55,7 @@ let request = new Request().http
 
 
  export function cacheSquareInformation(data) {
  export function cacheSquareInformation(data) {
  	 return request('/hospital580/app/cacheSquareInformation',data,'POST','application/json;charset=UTF-8');
  	 return request('/hospital580/app/cacheSquareInformation',data,'POST','application/json;charset=UTF-8');
+ }
+ export function cachePayInfo(data) {
+ 	 return request('/store/app/storeOrder/cachePayInfo',data,'POST','application/json;charset=UTF-8');
  }
  }

+ 1 - 5
pages_company/auth/login.vue

@@ -40,11 +40,7 @@ export default {
 	 				 });
 	 				 });
 					 uni.setStorageSync('companyUserId',res.user.userId);
 					 uni.setStorageSync('companyUserId',res.user.userId);
 					 uni.setStorageSync('CompanyUserToken',res.companyUserToken);
 					 uni.setStorageSync('CompanyUserToken',res.companyUserToken);
-					 //写入TOKEN
-					 uni.navigateBack({
-						delta:1,//返回层数,2则上上页
-					 })
-					 uni.navigateTo({
+					 uni.redirectTo({
 					 	url: '/pages_company/index'
 					 	url: '/pages_company/index'
 					 }) 
 					 }) 
 	 				
 	 				

+ 33 - 24
pages_company/order/cart.vue

@@ -76,6 +76,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import {checkPrescribe} from '@/api/myStoreOrder.js'
 	import {createSalesOrder} from '../api/companyOrder.js'
 	import {createSalesOrder} from '../api/companyOrder.js'
 	import {getCarts,cartNum,delCart} from '@/pages_shopping/api/product.js'
 	import {getCarts,cartNum,delCart} from '@/pages_shopping/api/product.js'
 	// import likeProduct from '@/components/likeProduct.vue'
 	// import likeProduct from '@/components/likeProduct.vue'
@@ -252,7 +253,7 @@
 						}else{
 						}else{
 							uni.showToast({
 							uni.showToast({
 								icon:'none',
 								icon:'none',
-								title: "请求失败",
+								title: res.msg,
 							});
 							});
 						}
 						}
 					},
 					},
@@ -295,22 +296,7 @@
 				this.changeCartNum(item)
 				this.changeCartNum(item)
 			},
 			},
 			// 结算
 			// 结算
-			submit() {
-				console.log("请选择商品111")
-				// let selectCarts = this.carts
-				//   .filter(item => item.list.some(listItem => listItem.checked === true))
-				//   .map(item => ({
-				//     storeId: item.list[0].storeId || "",
-				//     cartIds: item.list.filter(it=>it.checked == true).map(it => it.id).join(","),
-				//   }));
-				// if(selectCarts.length==0){
-				// 	uni.showToast({
-				// 		icon:'none',
-				// 		title: "请选择商品",
-				// 	});
-				// 	return;
-				// }
-				// var data={token:uni.getStorageSync('CompanyUserToken'),data:selectCarts}
+			async submit() {
 				const selectCarts = [
 				const selectCarts = [
 				  ...new Set(
 				  ...new Set(
 				    this.carts
 				    this.carts
@@ -328,6 +314,8 @@
 					});
 					});
 					return;
 					return;
 				}
 				}
+				const flag = await this.checkPrescribe()
+				if(!flag) return;
 				var data={token:uni.getStorageSync('CompanyUserToken'),cateIds:selectCarts.join(',')}
 				var data={token:uni.getStorageSync('CompanyUserToken'),cateIds:selectCarts.join(',')}
 				createSalesOrder(data).then(
 				createSalesOrder(data).then(
 					res => {
 					res => {
@@ -338,7 +326,7 @@
 						}else{
 						}else{
 							uni.showToast({
 							uni.showToast({
 								icon:'none',
 								icon:'none',
-								title: "请求失败",
+								title: res.msg,
 							});
 							});
 						}
 						}
 					},
 					},
@@ -350,17 +338,39 @@
 					url: '../shopping/productDetails?productId='+item.productId
 					url: '../shopping/productDetails?productId='+item.productId
 				})
 				})
 			},
 			},
+			checkPrescribe() {
+				let selectCartsArry = this.carts
+				  .filter(item => item.list.some(listItem => listItem.checked === true))
+				  .map(item => ({
+				    storeId: item.list[0].storeId || "",
+				    data: {
+				      type: "cart",
+				      cartIds: item.list.filter(it=>it.checked == true).map(it => it.id).join(","),
+				    }
+				  }));
+				return new Promise((resolve, reject) => {
+					checkPrescribe(selectCartsArry).then(res=>{
+						if(res.code==200) {
+							resolve(true);
+						} else {
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+							resolve(false); 
+						}
+					}).catch(err => {
+						resolve(false); 
+					})
+				})
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-	page {
-		height: 100%;
-	}
 	.content{
 	.content{
-		height: 100%;
-		padding: 20upx;
+		padding: 20upx 20upx 120upx 20upx;
 		.shopbox {
 		.shopbox {
 			background: #FFFFFF;
 			background: #FFFFFF;
 			border-radius: 16rpx;
 			border-radius: 16rpx;
@@ -435,7 +445,6 @@
 						font-weight: 500;
 						font-weight: 500;
 						color: #999999;
 						color: #999999;
 						margin-top: 22upx;
 						margin-top: 22upx;
-						line-height: 1;
 					}
 					}
 					.price-num{
 					.price-num{
 						display: flex;
 						display: flex;

+ 267 - 74
pages_company/order/confirmCompanyOrder.vue

@@ -7,7 +7,6 @@
 					<view class="name-box">
 					<view class="name-box">
 						<text class="text name">添加收货地址</text>
 						<text class="text name">添加收货地址</text>
 					</view>
 					</view>
-					</vie>
 				</view>
 				</view>
 				<view class="arrow-box">
 				<view class="arrow-box">
 					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow_gray.png" mode=""></image>
 					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow_gray.png" mode=""></image>
@@ -29,24 +28,27 @@
 			</view>
 			</view>
 			<!-- 药品列表 -->
 			<!-- 药品列表 -->
 			<view class="goods-list">
 			<view class="goods-list">
-				<view v-for="(item,index) in carts" :key="index" class="item" @click="showDetail(item)">
-					<view class="img-box">
-						<image :src="source=='audit'?item.image : item.productAttrImage||item.productImage" mode="aspectFill"></image>
-					</view>
-					<view class="info-box">
-						<view>
-							<view class="name-box ellipsis2">
-								<view class="myotctxt" style="margin-right: 10rpx;" v-show="item.productType" :style="{background:_background(item.productType)}">{{$getDictLabelName("storeProductType",item.productType)}}</view>
-								{{ item.commonName&&item.commonName!=='-'?item.commonName:item.productName }}
-							</view>
-							<view class="spec ellipsis2">{{item.productAttrName}}</view>
+				<view v-for="(store,i) in cartsGroupedArray" :key="store.storeId">
+					<view class="storename">{{store.storeName}}</view>
+					<view v-for="(item,index) in store.items" :key="index" class="item" @click="showDetail(item)">
+						<view class="img-box">
+							<image :src="source=='audit'?item.image : item.productAttrImage||item.productImage" mode="aspectFill"></image>
 						</view>
 						</view>
-						<view class="price-num">
-							<view class="price">
-								<text class="unit">¥</text>
-								<text class="num">{{item.price?item.price.toFixed(2):'0.00'}}</text>
+						<view class="info-box">
+							<view>
+								<view class="name-box ellipsis2">
+									<view class="myotctxt" style="margin-right: 10rpx;" v-show="item.productType" :style="{background:_background(item.productType)}">{{$getDictLabelName("storeProductType",item.productType)}}</view>
+									{{ item.commonName&&item.commonName!=='-'?item.commonName:item.productName }}
+								</view>
+								<view class="spec ellipsis2">{{item.productAttrName}}</view>
+							</view>
+							<view class="price-num">
+								<view class="price">
+									<text class="unit">¥</text>
+									<text class="num">{{item.price?item.price.toFixed(2):'0.00'}}</text>
+								</view>
+								<view class="num">x{{item.cartNum}}</view>
 							</view>
 							</view>
-							<view class="num">x{{item.cartNum}}</view>
 						</view>
 						</view>
 					</view>
 					</view>
 				</view>
 				</view>
@@ -59,7 +61,45 @@
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			 
+			<view class="pay-type-title">支付方式</view>
+			<view class="pay-type">
+				<radio-group @change="payTypeChange">
+					<view class="item">
+						<view class="left" >
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/wecha_pay.png" mode=""></image>
+							<text class="text">全款支付</text>
+						</view>
+						<label>
+							<radio :value="1"  :checked="payType=='1'" />
+						</label>
+					</view>
+					<view class="item">
+						<view class="left" >
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/pay_de.png" mode=""></image>
+							<view>
+								<text class="text">先定后付</text>
+								<view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
+							</view>
+						</view>
+						<label>
+							<radio  :value="2" :checked="payType=='2'" />
+						</label>
+					</view>
+					<view class="item">
+						<view class="left">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/pay_1.png" mode=""></image>
+							<text class="text">货到付款</text>
+						</view>
+						<label>
+							<radio  :value="3" :checked="payType=='3'"/>
+						</label>
+					</view>
+				</radio-group>
+			</view> 
+			<view class="pay-type-title" v-show="payType=='2'">定金金额</view>
+			<view class="pay-type" v-show="payType=='2'">
+				<input type="text" v-model="editAmount" placeholder="请输入定金金额" class="intxt" maxlength="8" />
+			</view> 
 		</view>
 		</view>
 		<!-- 底部按钮 -->
 		<!-- 底部按钮 -->
 		<view class="btn-foot">
 		<view class="btn-foot">
@@ -84,18 +124,23 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<modal v-if="inputShow" title="实收金额" confirm-text="保存" cancel-text="取消" @cancel="cancelUpdateMoney" @confirm="confirm">
 		<modal v-if="inputShow" title="实收金额" confirm-text="保存" cancel-text="取消" @cancel="cancelUpdateMoney" @confirm="confirm">
-			<input type="text" v-model="inputTxt" placeholder="请输入实收金额" class="intxt" maxlength="8" />
+			<view class="x-f">
+				<text style="color: #000;">实收金额:</text>
+				<input type="text" v-model="inputTxt" placeholder="请输入实收金额" class="intxt" maxlength="8" />
+			</view>
 		</modal>
 		</modal>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	import {getSalesOrder,getSalesOrders,updateSalseOrderMoney,sharePrepare,changeListDetail,salesVoucherCacheAddress,checkPrescriptionDrug} from '../api/companyOrder.js'
+	import {checkPrescribe} from '@/api/myStoreOrder.js'
+	import {getSalesOrder,getSalesOrders,updateSalseOrderMoney,sharePrepare,changeListDetail,salesVoucherCacheAddress,checkPrescriptionDrug,cachePayInfo} from '../api/companyOrder.js'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
 				inputShow:false,
 				inputShow:false,
 				inputTxt:null,
 				inputTxt:null,
+				editAmount:null,
 				orderKey:null,
 				orderKey:null,
 				price:{
 				price:{
 					payPrice:0.00,
 					payPrice:0.00,
@@ -114,6 +159,9 @@
 				showBtn: false,
 				showBtn: false,
 				isPrescribe: false,
 				isPrescribe: false,
 				answerMedicine: {},
 				answerMedicine: {},
+				payType: 1,
+				payTypeKey: '',
+				cartsGroupedArray: []
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
@@ -133,17 +181,12 @@
 		onLoad(option) {
 		onLoad(option) {
 			this.source = option.source || ''
 			this.source = option.source || ''
 			uni.hideShareMenu()
 			uni.hideShareMenu()
-			// this.disabled = true
 			if(this.source == 'audit') {
 			if(this.source == 'audit') {
-				// uni.hideShareMenu()
-				// this.disabled = true
 				this.auditId = option.auditId || ''
 				this.auditId = option.auditId || ''
 				this.sharePrepare()
 				this.sharePrepare()
 				this.getDetail()
 				this.getDetail()
 			} else {
 			} else {
 				this.orderKey=option.orderKey;
 				this.orderKey=option.orderKey;
-				// uni.showShareMenu()
-				// uni.hideShareMenu()
 				this.getSalesOrder();
 				this.getSalesOrder();
 			} 
 			} 
 			uni.$on('updateAddress', (e) => {
 			uni.$on('updateAddress', (e) => {
@@ -156,7 +199,7 @@
 		onShareAppMessage(res) {
 		onShareAppMessage(res) {
 			return {
 			return {
 				title: "互易享",
 				title: "互易享",
-				path: '/pages_company/order/confirmOrder?orderKey='+this.orderKey+'&companyUserId='+this.companyUserId+"&dataKey="+this.dataKey,
+				path: '/pages_company/order/confirmOrder?orderKey='+this.orderKey+'&companyUserId='+this.companyUserId+"&dataKey="+this.dataKey+'&payTypeKey='+this.payTypeKey+'&payType='+this.payType+'&editAmount='+this.editAmount,
 				imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 				imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}
 			}
 			
 			
@@ -165,12 +208,41 @@
 			uni.$off('updateAddress')
 			uni.$off('updateAddress')
 		},
 		},
 		methods: {
 		methods: {
+			payTypeChange(e){
+				this.payType=e.detail.value;
+			},
+			savePayInfo() {
+				const cateIds = this.carts.map(it=>it.id).join(',')
+				return new Promise((resolve, reject) => {
+					const param = {
+						payType:this.payType,
+						userId:uni.getStorageSync('companyUserId'),
+						cateIds: cateIds
+					}
+					cachePayInfo(param).then(res=>{
+						if(res.code==200){
+							this.payTypeKey = res.dataKey
+							resolve(res); // 成功回调
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							})
+							reject(res); // 失败回调
+						}
+					}).catch(err => {
+						reject(err);
+					})
+				})
+			},
 			openAddress(){
 			openAddress(){
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages_user/address'
 					url: '/pages_user/address'
 				})
 				})
 			},
 			},
-			handleShare() {
+			async handleShare() {
+				const flag = await this.checkPrescribe()
+				if(!flag) return;
 				if(!this.addressId) {
 				if(!this.addressId) {
 					uni.showToast({
 					uni.showToast({
 						title: '请选择地址',
 						title: '请选择地址',
@@ -178,45 +250,59 @@
 					})
 					})
 					return
 					return
 				}
 				}
+				if (this.payType == 2 && !this.isValidAmount(this.editAmount)) {
+					uni.showToast({
+						icon: 'none',
+						title: "请输入正确的金额,且必须大于0"
+					});
+					return;
+				}
+				
 				const param = {
 				const param = {
 					addressId:this.addressId,
 					addressId:this.addressId,
 					companyUserId:uni.getStorageSync('companyUserId')
 					companyUserId:uni.getStorageSync('companyUserId')
 				}
 				}
 				this.saveCacheAddress(param)
 				this.saveCacheAddress(param)
 			},
 			},
-			saveCacheAddress(param,type) {
+			async saveCacheAddress(param,type) {
 				uni.showLoading({
 				uni.showLoading({
 					title: '保存中'
 					title: '保存中'
 				})
 				})
-				salesVoucherCacheAddress(param).then(res=>{
-					uni.hideLoading()
-					if(res.code ==200) {
-						this.dataKey = res.dataKey
-						if(type==1) {
-							this.confirmUpdateMoney()
-						} else {
-							if(this.isPrescribe) {
-								uni.navigateTo({
-									url: '/pages_company/order/editUserOrderPrescribe?orderKey='+this.orderKey+'&companyUserId='+this.companyUserId+"&dataKey="+this.dataKey+'&answerMedicine='+encodeURIComponent(JSON.stringify(this.answerMedicine)),
-								})
+				try {
+					await this.savePayInfo();
+					salesVoucherCacheAddress(param).then(res=>{
+						uni.hideLoading()
+						if(res.code ==200) {
+							this.dataKey = res.dataKey
+							if(type==1) {
+								this.confirmUpdateMoney()
 							} else {
 							} else {
-								uni.showToast({
-									title: '提交成功,去分享吧',
-									icon: 'none'
-								})
-								this.dataKey = res.dataKey
-								this.disabled = false
-								uni.showShareMenu()
+								if(this.isPrescribe) {
+									uni.navigateTo({
+										url: '/pages_company/order/editUserOrderPrescribe?orderKey='+this.orderKey+'&companyUserId='+this.companyUserId+"&dataKey="+this.dataKey+'&payTypeKey='+this.payTypeKey+'&payType='+this.payType+'&editAmount='+this.editAmount+'&answerMedicine='+encodeURIComponent(JSON.stringify(this.answerMedicine)),
+									})
+								} else {
+									uni.showToast({
+										title: '提交成功,去分享吧',
+										icon: 'none'
+									})
+									this.dataKey = res.dataKey
+									this.disabled = false
+									uni.showShareMenu()
+								}
 							}
 							}
+							
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none'
+							})
 						}
 						}
-						
-					} else {
-						uni.showToast({
-							title: res.msg,
-							icon: 'none'
-						})
-					}
-				})
+					})
+				} catch (error) {
+					uni.hideLoading()
+					console.error('保存失败:', error)
+				}
 			},
 			},
 			checkPrescriptionDrug() {
 			checkPrescriptionDrug() {
 				this.showBtn = false
 				this.showBtn = false
@@ -236,7 +322,9 @@
 					}
 					}
 				})
 				})
 			},
 			},
-			openUpdateMoney(){
+			async openUpdateMoney(){
+				const flag = await this.checkPrescribe()
+				if(!flag) return;
 				if(this.auditMoney) {
 				if(this.auditMoney) {
 					uni.showModal({
 					uni.showModal({
 						title: '提示',
 						title: '提示',
@@ -258,22 +346,6 @@
 				this.inputShow = false
 				this.inputShow = false
 			},
 			},
 			confirm() {
 			confirm() {
-				// if(parseFloat(this.inputTxt)>0){
-				// 	if(this.addressId) {
-				// 		const param = {
-				// 			addressId:this.addressId,
-				// 			companyUserId:uni.getStorageSync('companyUserId')
-				// 		}
-				// 		this.saveCacheAddress(param,1)
-				// 	} else {
-				// 		this.confirmUpdateMoney()
-				// 	}
-				// } else {
-				// 	uni.showToast({
-				// 		icon:'none',
-				// 		title: "价格应大于0",
-				// 	});
-				// }
 				this.confirmUpdateMoney()
 				this.confirmUpdateMoney()
 			},
 			},
 			confirmUpdateMoney(){
 			confirmUpdateMoney(){
@@ -318,7 +390,7 @@
 				else{
 				else{
 					uni.showToast({
 					uni.showToast({
 						icon:'none',
 						icon:'none',
-						title: "价格应大于0",
+						title: "金额必须大于0",
 					});
 					});
 				}
 				}
 			},
 			},
@@ -341,6 +413,10 @@
 							});
 							});
 							that.price.totalPrice=res.totalMoney
 							that.price.totalPrice=res.totalMoney
 							this.productIds =  this.carts&&this.carts.length> 0?this.carts.map(item=>item.productId).join(','):'';
 							this.productIds =  this.carts&&this.carts.length> 0?this.carts.map(item=>item.productId).join(','):'';
+							const grouped = this.groupByStoreId(this.carts);
+							
+							// 转换为数组形式(如果需要)
+							this.cartsGroupedArray = Object.values(grouped);
 							this.checkPrescriptionDrug()
 							this.checkPrescriptionDrug()
 						}else{
 						}else{
 							uni.showToast({
 							uni.showToast({
@@ -375,11 +451,23 @@
 				let that = this
 				let that = this
 				changeListDetail(this.auditId).then(res=>{
 				changeListDetail(this.auditId).then(res=>{
 					if(res.code==200){
 					if(res.code==200){
-						that.carts=res.data.preparedProductInfoVoList;
+						const carts = res.data&&res.data.preparedProductInfoVoList? res.data&&res.data.preparedProductInfoVoList: [];
+						if(carts&&carts.length>0) {
+							that.carts = carts.map(it=>({
+								...it,
+								id:it.cartId
+							}))
+						} else {
+							that.carts = []
+						}
 						that.price.payPrice = res.data.totalAmount
 						that.price.payPrice = res.data.totalAmount
 						that.price.totalPrice=res.data.money
 						that.price.totalPrice=res.data.money
 						that.orderKey = res.data.createOrderKey
 						that.orderKey = res.data.createOrderKey
 						that.productIds =  that.carts&&that.carts.length> 0?that.carts.map(item=>item.productId).join(','):'';
 						that.productIds =  that.carts&&that.carts.length> 0?that.carts.map(item=>item.productId).join(','):'';
+						const grouped = that.groupByStoreId(that.carts);
+						
+						// 转换为数组形式(如果需要)
+						that.cartsGroupedArray = Object.values(grouped);
 						that.checkPrescriptionDrug()
 						that.checkPrescriptionDrug()
 					}else{
 					}else{
 						uni.showToast({
 						uni.showToast({
@@ -388,7 +476,64 @@
 						});
 						});
 					}
 					}
 				})
 				})
-			}
+			},
+			isValidAmount(amount) {
+				// 1. 必须是数字或数字字符串
+				const num = parseFloat(amount);
+				if (isNaN(num)) return false;
+				
+				// // 2. 必须大于0
+				if (num <= 0) return false;
+				
+				// 3. 最多两位小数(可选)
+				const str = String(amount).trim();
+				if (!/^\d+(\.\d{1,2})?$/.test(str)) return false;
+				
+				return true;
+			},
+			groupByStoreId(carts) {
+			  return carts.reduce((acc, item) => {
+			    const storeId = item.storeId;
+			    
+			    // 如果该 storeId 不存在,初始化数组
+			    if (!acc[storeId]) {
+			      acc[storeId] = {
+			        storeId: storeId,
+			        storeName: item.storeName,
+			        items: []
+			      };
+			    }
+			    
+			    // 将商品添加到对应店铺
+			    acc[storeId].items.push(item);
+			    
+			    return acc;
+			  }, {});
+			},
+			checkPrescribe() {
+				let selectCarts = this.cartsGroupedArray.map(item => ({
+				    storeId: item.storeId || "",
+				    data: {
+				      type: "cart",
+				      cartIds: item.items.map(it => it.id).join(","),
+				    }
+				  }));
+				return new Promise((resolve, reject) => {
+					checkPrescribe(selectCarts).then(res=>{
+						if(res.code==200) {
+							resolve(true);
+						} else {
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+							resolve(false); 
+						}
+					}).catch(err => {
+						resolve(false); 
+					})
+				})
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>
@@ -689,5 +834,53 @@
 			}
 			}
 		}
 		}
 	}
 	}
+	.pay-type-title{
+		margin-top: 20upx;
+		font-size: 30upx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #222222;
+	}
+	.pay-type{
+		box-sizing: border-box;
+		background: #FFFFFF;
+		border-radius: 16upx;
+		margin-top: 20upx;
+		padding: 20rpx 30rpx;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		.item{
+			padding: 15upx 0upx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			.left{
+				display: flex;
+				align-items: center;
+				image{
+					width: 44upx;
+					height: 44upx;
+					margin-right: 20upx;
+				}
+				.text{
+					font-size: 30upx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #222222;
+				}
+			}
+		}
+	}
+	.storename {
+		font-family: PingFang SC;
+		font-weight: bold;
+		font-size: 30rpx;
+		color: #111;
+		overflow: hidden;
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		padding-top: 30rpx;
+	}
 </style>
 </style>
  
  

+ 18 - 3
pages_company/order/confirmOrder.vue

@@ -35,7 +35,7 @@
 			 
 			 
 		</view>
 		</view>
 		<!-- 底部按钮 -->
 		<!-- 底部按钮 -->
-		<view class="btn-foot">
+		<view class="btn-foot" v-if="carts&&carts.length>0">
 			<view class="right">
 			<view class="right">
 				<view class="total">
 				<view class="total">
 					<text class="label">实付金额:</text>
 					<text class="label">实付金额:</text>
@@ -80,7 +80,10 @@
 				address: null,
 				address: null,
 				companyUserId: null,
 				companyUserId: null,
 				dataKey: '',
 				dataKey: '',
-				dataPrescribeKey:''
+				dataPrescribeKey:'',
+				payTypeKey: '',
+				payType: '',
+				editAmount: null
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
@@ -103,11 +106,18 @@
 			this.dataPrescribeKey = option.dataPrescribeKey||'';
 			this.dataPrescribeKey = option.dataPrescribeKey||'';
 			this.dataKey=option.dataKey;
 			this.dataKey=option.dataKey;
 			this.companyUserId=option.companyUserId;
 			this.companyUserId=option.companyUserId;
+			this.payTypeKey=option.payTypeKey||'';
+			this.payType=option.payType||'';
+			this.editAmount = option.editAmount||null
 		},
 		},
 		onShow() {
 		onShow() {
 			this.$isLogin().then(res => {
 			this.$isLogin().then(res => {
 				if(res){
 				if(res){
 					this.getOrderCount();
 					this.getOrderCount();
+				}else{
+					uni.navigateTo({
+						url:'/pages/auth/login'
+					})
 				}
 				}
 			})
 			})
 			this.getSalesOrder();
 			this.getSalesOrder();
@@ -119,6 +129,10 @@
 						uni.navigateTo({
 						uni.navigateTo({
 							url: '/pages_user/shopping/storeOrder?status=0'
 							url: '/pages_user/shopping/storeOrder?status=0'
 						})
 						})
+					}else{
+						uni.navigateTo({
+							url:'/pages/auth/login'
+						})
 					}
 					}
 				})
 				})
 			},
 			},
@@ -146,6 +160,7 @@
 			getSalesOrder(item){
 			getSalesOrder(item){
 				var that=this;
 				var that=this;
 				var data={createOrderKey:this.orderKey}
 				var data={createOrderKey:this.orderKey}
+				that.price.totalPrice = 0
 				getSalesOrder(data).then(
 				getSalesOrder(data).then(
 					res => {
 					res => {
 						if(res.code==200){
 						if(res.code==200){
@@ -183,7 +198,7 @@
 									const companyId = res.companyId ||''
 									const companyId = res.companyId ||''
 									const companyUserId = res.companyUserId ||''
 									const companyUserId = res.companyUserId ||''
 									uni.navigateTo({
 									uni.navigateTo({
-										url: '/pages_shopping/confirmCreateOrder?companyId='+companyId+"&companyUserId="+companyUserId+"&dataKey="+this.dataKey+"&dataPrescribeKey="+this.dataPrescribeKey+"&createOrderKey="+this.orderKey +'&confirmParam='+encodeURIComponent(JSON.stringify(confirmParam))
+										url: '/pages_shopping/confirmCreateOrder?companyId='+companyId+"&companyUserId="+companyUserId+"&dataKey="+this.dataKey+"&dataPrescribeKey="+this.dataPrescribeKey+"&createOrderKey="+this.orderKey+"&payTypeKey="+this.payTypeKey+'&editAmount='+this.editAmount+'&payType='+this.payType +'&confirmParam='+encodeURIComponent(JSON.stringify(confirmParam))
 									})
 									})
 									// uni.navigateTo({
 									// uni.navigateTo({
 									// 	url: '/pages_shopping/confirmCreateOrder?type=buy&cartIds='+res.cartIds.toString()+"&companyId="+res.companyId+"&companyUserId="+res.companyUserId+"&createOrderKey="+this.orderKey
 									// 	url: '/pages_shopping/confirmCreateOrder?type=buy&cartIds='+res.cartIds.toString()+"&companyId="+res.companyId+"&companyUserId="+res.companyUserId+"&createOrderKey="+this.orderKey

+ 10 - 3
pages_company/order/editUserOrderPrescribe.vue

@@ -249,18 +249,22 @@
 				companyUserId: '',
 				companyUserId: '',
 				dataKey: '',
 				dataKey: '',
 				dataPrescribeKey: '',
 				dataPrescribeKey: '',
-				isShowShare: false
+				isShowShare: false,
+				payTypeKey:'',
+				payType:'',
+				editAmount: null
 			}
 			}
 		},
 		},
 		onShareAppMessage(res) {
 		onShareAppMessage(res) {
 			return {
 			return {
 				title: "互易享",
 				title: "互易享",
-				path: '/pages_company/order/confirmOrder?orderKey='+this.orderKey+'&companyUserId='+this.companyUserId+"&dataPrescribeKey="+this.dataPrescribeKey+'&dataKey='+this.dataKey,
+				path: '/pages_company/order/confirmOrder?orderKey='+this.orderKey+'&companyUserId='+this.companyUserId+"&dataPrescribeKey="+this.dataPrescribeKey+'&dataKey='+this.dataKey+"&payTypeKey="+this.payTypeKey+'&payType='+this.payType+'&editAmount='+this.editAmount,
 				imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 				imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 			}
 			}
 			
 			
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
+			this.editAmount = option.editAmount||null
 			// this.orderId=option.orderId
 			// this.orderId=option.orderId
 			uni.hideShareMenu()
 			uni.hideShareMenu()
 			this.isShowShare = false
 			this.isShowShare = false
@@ -268,7 +272,10 @@
 			this.answerMedicine = option.answerMedicine ? JSON.parse(decodeURIComponent(option.answerMedicine)):[];
 			this.answerMedicine = option.answerMedicine ? JSON.parse(decodeURIComponent(option.answerMedicine)):[];
 			this.orderKey = option.orderKey
 			this.orderKey = option.orderKey
 			this.companyUserId = option.companyUserId
 			this.companyUserId = option.companyUserId
-			this.dataKey = option.dataKey
+			this.dataKey = option.dataKey||''
+			this.payTypeKey = option.payTypeKey||''
+			this.payType = option.payType||''
+		
 			this.getPatientList();
 			this.getPatientList();
 			uni.$on('refreshPatient', () => {
 			uni.$on('refreshPatient', () => {
 				this.getPatientList()
 				this.getPatientList()

+ 0 - 1
pages_company/order/productList.vue

@@ -428,7 +428,6 @@
 					font-family: PingFang SC;
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-weight: 500;
 					color: #999999;
 					color: #999999;
-					line-height: 1;
 					margin-top: 26upx;
 					margin-top: 26upx;
 					display: block;
 					display: block;
 				}
 				}

+ 2 - 2
pages_company/storeOrderDetail.vue

@@ -171,8 +171,8 @@
 						</view>
 						</view>
 						<view class="item">
 						<view class="item">
 							<text class="label">支付方式</text>
 							<text class="label">支付方式</text>
-							<text class="text" v-if="order.payType==1">微信支付</text>
-							<text class="text" v-if="order.payType==2">物流代收</text>
+							<text class="text" v-if="order.payType==1">全款支付</text>
+							<text class="text" v-if="order.payType==2">先定后付</text>
 						</view>
 						</view>
 						<view   class="item">
 						<view   class="item">
 							<text class="label">支付金额</text>
 							<text class="label">支付金额</text>

+ 1 - 1
pages_order/packageOrderDetails.vue

@@ -89,7 +89,7 @@
 						<view class="item">
 						<view class="item">
 							<text class="label">支付方式</text>
 							<text class="label">支付方式</text>
 							<text class="text" v-if="order.payType==1">全款支付</text>
 							<text class="text" v-if="order.payType==1">全款支付</text>
-							<text class="text" v-if="order.payType==2">物流代收</text>
+							<text class="text" v-if="order.payType==2">先定后付</text>
 							<text class="text" v-if="order.payType==3">货到付款</text>
 							<text class="text" v-if="order.payType==3">货到付款</text>
 						</view>
 						</view>
 						<view   class="item">
 						<view   class="item">

+ 5 - 2
pages_order/packageOrderPay.vue

@@ -65,7 +65,7 @@
 				</view>
 				</view>
 				<view class="item">
 				<view class="item">
 					<view class="left">
 					<view class="left">
-						<text class="label">物流代收:</text>
+						<text class="label">先定后付:</text>
 					</view>
 					</view>
 					<view class="right">
 					<view class="right">
 						<text class="text">{{payRemain}}</text>
 						<text class="text">{{payRemain}}</text>
@@ -96,7 +96,10 @@
 					<view class="item"  v-if="checkPayType('2')" >
 					<view class="item"  v-if="checkPayType('2')" >
 						<view class="left" >
 						<view class="left" >
 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/pay_de.png" mode=""></image>
 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/pay_de.png" mode=""></image>
-							<text class="text">物流代收</text>
+							<view>
+								<text class="text">先定后付</text>
+								<view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
+							</view>
 						</view>
 						</view>
 						<label>
 						<label>
 							<text v-show="payType==2" class="text" style="margin-right: 14rpx;">赠送积分:{{integral}}</text>
 							<text v-show="payType==2" class="text" style="margin-right: 14rpx;">赠送积分:{{integral}}</text>

+ 2 - 2
pages_order/storeOrderDetail.vue

@@ -141,8 +141,8 @@
 						</view>
 						</view>
 						<view class="item">
 						<view class="item">
 							<text class="label">支付方式</text>
 							<text class="label">支付方式</text>
-							<text class="text" v-if="order.payType==1">微信支付</text>
-							<text class="text" v-if="order.payType==2">物流代收</text>
+							<text class="text" v-if="order.payType==1">全款支付</text>
+							<text class="text" v-if="order.payType==2">先定后付</text>
 						</view>
 						</view>
 						<view   class="item">
 						<view   class="item">
 							<text class="label">订单金额</text>
 							<text class="label">订单金额</text>

+ 13 - 3
pages_shopping/cart.vue

@@ -77,6 +77,7 @@
 
 
 <script>
 <script>
 	import {getCarts,cartNum,delCart} from './api/product.js'
 	import {getCarts,cartNum,delCart} from './api/product.js'
+	import {checkPrescribe} from '@/api/myStoreOrder.js'
 	// import likeProduct from '@/components/likeProduct.vue'
 	// import likeProduct from '@/components/likeProduct.vue'
 	export default {
 	export default {
 		// components: {
 		// components: {
@@ -311,8 +312,17 @@
 					});
 					});
 					return;
 					return;
 				}
 				}
-				uni.navigateTo({
-					url: './confirmOrder?type=cart&confirmParam='+ encodeURIComponent(JSON.stringify(selectCarts))
+				checkPrescribe(selectCarts).then(res=>{
+					if(res.code==200) {
+						uni.navigateTo({
+							url: './confirmOrder?type=cart&confirmParam='+ encodeURIComponent(JSON.stringify(selectCarts))
+						})
+					} else {
+						uni.showToast({
+							icon:'none',
+							title: res.msg,
+						});
+					}
 				})
 				})
 			},
 			},
 			showProduct(item){
 			showProduct(item){
@@ -331,6 +341,7 @@
 	.content{
 	.content{
 		height: 100%;
 		height: 100%;
 		padding: 20upx;
 		padding: 20upx;
+		position: relative;
 		.shopbox {
 		.shopbox {
 			background: #FFFFFF;
 			background: #FFFFFF;
 			border-radius: 16rpx;
 			border-radius: 16rpx;
@@ -405,7 +416,6 @@
 						font-weight: 500;
 						font-weight: 500;
 						color: #999999;
 						color: #999999;
 						margin-top: 22upx;
 						margin-top: 22upx;
-						line-height: 1;
 					}
 					}
 					.price-num{
 					.price-num{
 						display: flex;
 						display: flex;

+ 73 - 13
pages_shopping/confirmCreateOrder.vue

@@ -7,7 +7,6 @@
 					<view class="name-box">
 					<view class="name-box">
 						<text class="text name">添加收货地址</text>
 						<text class="text name">添加收货地址</text>
 					</view>
 					</view>
-					</vie>
 				</view>
 				</view>
 				<view class="arrow-box">
 				<view class="arrow-box">
 					<image
 					<image
@@ -200,7 +199,7 @@
 <script>
 <script>
 	import {getWeixinOrderTemps} from '@/api/common'
 	import {getWeixinOrderTemps} from '@/api/common'
 
 
-	import { confirm, computed, create,selectCacheAddress } from '@/api/myStoreOrder.js'
+	import { confirm, computed, create,selectCacheAddress,editPayTypeByCombinationId } from '@/api/myStoreOrder.js'
 	import {getMyEnableCouponList} from './api/coupon'
 	import {getMyEnableCouponList} from './api/coupon'
 	import popupBottom from '@/components/px-popup-bottom.vue'
 	import popupBottom from '@/components/px-popup-bottom.vue'
 
 
@@ -240,7 +239,12 @@
 				},
 				},
 				confirmParam: [],
 				confirmParam: [],
 				dataKey: '',
 				dataKey: '',
-				dataPrescribeKey:''
+				dataPrescribeKey:'',
+				payTypeKey: '',
+				payType: '',
+				editAmount:null,
+				creatData: {},
+				combinationOrderId: ''
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
@@ -263,7 +267,9 @@
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
-			console.log('option.dataKey',option.confirmParam)
+			this.editAmount=option.editAmount||null;
+			this.payType=option.payType||'';
+			this.payTypeKey = option.payTypeKey||'';
 			this.dataKey =  option.dataKey||'';
 			this.dataKey =  option.dataKey||'';
 			this.dataPrescribeKey = option.dataPrescribeKey||'';
 			this.dataPrescribeKey = option.dataPrescribeKey||'';
 			this.form.createOrderKey = option.createOrderKey;
 			this.form.createOrderKey = option.createOrderKey;
@@ -455,9 +461,30 @@
 				})
 				})
 
 
 			},
 			},
-			createOrder() {
+			async createOrder() {
+				let that = this;
+				if(that.payType==2&&this.combinationOrderId) {
+					await this.editPayTypeByCombinationId(this.combinationOrderId)
+					if (that.creatData.some(item => item.order.isPrescribe) == 1) {
+						setTimeout(function() {
+							let orderIds = that.creatData.filter(item => item.order.isPrescribe == 1).map(
+								it => it.order.id)
+							orderIds = orderIds.join(',')
+							uni.redirectTo({
+								url: "/pages_shopping/prescribe?orderId=" + encodeURIComponent(orderIds)+"&dataPrescribeKey="+that.dataPrescribeKey+"&companyUserId="+that.form.companyUserId +"&dataKey="+that.dataKey+'&payTypeKey='+that.payTypeKey+'&payType='+that.payType+'&editAmount='+that.editAmount+"&combinationOrderId=" + encodeURIComponent(that.combinationOrderId)
+							})
+						}, 200);
+					} else {
+						setTimeout(function() {
+							uni.redirectTo({
+								url: '/pages_shopping/paymentOrder?payTypeKey='+that.payTypeKey+"&companyUserId="+that.form.companyUserId+'&payType='+that.payType+'&editAmount='+that.editAmount+'&combinationOrderId=' +
+									encodeURIComponent(that.combinationOrderId)
+							})
+						}, 200);
+					}
+					return
+				}
 				const mark = this.carts.map(item => item.markinfo)
 				const mark = this.carts.map(item => item.markinfo)
-				var that = this;
 				var data = null;
 				var data = null;
 				var tuiUserId = uni.getStorageSync('tuiUserId');
 				var tuiUserId = uni.getStorageSync('tuiUserId');
 				uni.showLoading({
 				uni.showLoading({
@@ -481,7 +508,7 @@
 						orderKeys: this.form.createOrderKey ? [this.form.createOrderKey] : this.form.orderKey,
 						orderKeys: this.form.createOrderKey ? [this.form.createOrderKey] : this.form.orderKey,
 						addressId: this.form.addressId,
 						addressId: this.form.addressId,
 						useIntegral: this.form.useIntegral,
 						useIntegral: this.form.useIntegral,
-						payType: 1,
+						payType: this.payType || 1,
 						appId: getApp().globalData.appId,
 						appId: getApp().globalData.appId,
 					};
 					};
 				} else {
 				} else {
@@ -495,7 +522,7 @@
 						orderKeys: this.form.createOrderKey ? [this.form.createOrderKey] : this.form.orderKey,
 						orderKeys: this.form.createOrderKey ? [this.form.createOrderKey] : this.form.orderKey,
 						addressId: this.form.addressId,
 						addressId: this.form.addressId,
 						useIntegral: this.form.useIntegral,
 						useIntegral: this.form.useIntegral,
-						payType: 1,
+						payType:this.payType || 1,
 						appId: getApp().globalData.appId,
 						appId: getApp().globalData.appId,
 						dataKey: this.dataKey
 						dataKey: this.dataKey
 					};
 					};
@@ -507,23 +534,27 @@
 					data.dataKey = this.dataKey;
 					data.dataKey = this.dataKey;
 				}
 				}
 				create(data).then(
 				create(data).then(
-					res => {
+					async res => {
 						uni.hideLoading()
 						uni.hideLoading()
 						if (res.code == 200) {
 						if (res.code == 200) {
-							uni.hideLoading()
+							that.creatData = res.data
+							if(that.payType==2) {
+								this.combinationOrderId = res.data[0].order.combinationOrderId
+								await this.editPayTypeByCombinationId(res.data[0].order.combinationOrderId)
+							}
 							if (res.data.some(item => item.order.isPrescribe) == 1) {
 							if (res.data.some(item => item.order.isPrescribe) == 1) {
 								setTimeout(function() {
 								setTimeout(function() {
 									let orderIds = res.data.filter(item => item.order.isPrescribe == 1).map(
 									let orderIds = res.data.filter(item => item.order.isPrescribe == 1).map(
 										it => it.order.id)
 										it => it.order.id)
 									orderIds = orderIds.join(',')
 									orderIds = orderIds.join(',')
 									uni.redirectTo({
 									uni.redirectTo({
-										url: "/pages_shopping/prescribe?orderId=" + orderIds+"&dataPrescribeKey="+that.dataPrescribeKey+"&companyUserId="+that.form.companyUserId +"&dataKey="+that.dataKey+"&combinationOrderId=" + encodeURIComponent(res.data[0].order.combinationOrderId)
+										url: "/pages_shopping/prescribe?orderId=" + encodeURIComponent(orderIds)+"&dataPrescribeKey="+that.dataPrescribeKey+"&companyUserId="+that.form.companyUserId +"&dataKey="+that.dataKey+'&payTypeKey='+that.payTypeKey+'&payType='+that.payType+'&editAmount='+that.editAmount+"&combinationOrderId=" + encodeURIComponent(res.data[0].order.combinationOrderId)
 									})
 									})
 								}, 200);
 								}, 200);
 							} else {
 							} else {
 								setTimeout(function() {
 								setTimeout(function() {
 									uni.redirectTo({
 									uni.redirectTo({
-										url: '/pages_shopping/paymentOrder?combinationOrderId=' +
+										url: '/pages_shopping/paymentOrder?payTypeKey='+that.payTypeKey+"&companyUserId="+that.form.companyUserId+'&payType='+that.payType+'&editAmount='+that.editAmount+'&combinationOrderId=' +
 											encodeURIComponent(res.data[0].order.combinationOrderId)
 											encodeURIComponent(res.data[0].order.combinationOrderId)
 									})
 									})
 								}, 200);
 								}, 200);
@@ -544,6 +575,7 @@
 							// }
 							// }
 							return;
 							return;
 						} else {
 						} else {
+							uni.hideLoading()
 							if (res.code == 501) {
 							if (res.code == 501) {
 								uni.showToast({
 								uni.showToast({
 									icon: 'none',
 									icon: 'none',
@@ -570,7 +602,35 @@
 				uni.navigateTo({
 				uni.navigateTo({
 					url: '/pages_user/address'
 					url: '/pages_user/address'
 				})
 				})
-			}
+			},
+			editPayTypeByCombinationId(combinationOrderId) {
+				return new Promise((resolve, reject) => {
+			        const param = {
+			            combinationOrderId: combinationOrderId,
+			            payType: this.payType,
+						editAmount: this.editAmount == 'null' ? 0 : parseFloat(this.editAmount||0)
+			        };
+			        uni.showLoading();
+			        editPayTypeByCombinationId(param).then(
+			            res => {
+			                uni.hideLoading();
+			                if (res.code == 200) {
+			                    resolve(res);  // 成功
+			                } else {
+			                    uni.showToast({
+			                        icon: 'none',
+			                        title: res.msg,
+			                    });
+			                    reject(res);  // 失败
+			                }
+			            },
+			            rej => {
+			                uni.hideLoading();
+			                reject(rej);
+			            }
+			        );
+			    });
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 0 - 1
pages_shopping/home/productList.vue

@@ -421,7 +421,6 @@
 					font-family: PingFang SC;
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-weight: 500;
 					color: #999999;
 					color: #999999;
-					line-height: 1;
 					margin-top: 26upx;
 					margin-top: 26upx;
 					display: block;
 					display: block;
 				}
 				}

+ 3 - 3
pages_shopping/payOrder.vue

@@ -15,7 +15,7 @@
 				<view class="item">
 				<view class="item">
 					<view class="left">
 					<view class="left">
 						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
 						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
-						<text class="text">微信支付</text>
+						<text class="text">全款支付</text>
 					</view>
 					</view>
 					<label>
 					<label>
 						<checkbox disabled value="" :checked="wxPay" />
 						<checkbox disabled value="" :checked="wxPay" />
@@ -38,7 +38,7 @@
 				</view>
 				</view>
 				<view class="item">
 				<view class="item">
 					<text class="label">支付方式</text>
 					<text class="label">支付方式</text>
-					<text class="text">微信支付</text>
+					<text class="text">全款支付</text>
 				</view>
 				</view>
 				 
 				 
 			</view>
 			</view>
@@ -57,7 +57,7 @@
 			return {
 			return {
 				payLimitTime:null,
 				payLimitTime:null,
 				order:null,
 				order:null,
-				// 默认选中微信支付
+				// 默认选中全款支付
 				wxPay: true,
 				wxPay: true,
 			}
 			}
 		},
 		},

+ 340 - 192
pages_shopping/paymentOrder.vue

@@ -1,150 +1,167 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
-		<view class="inner">
-			<!-- 时间、价格 -->
-			<view class="time-price">
-				<text class="time">请在{{payLimitTime}}前完成支付</text>
-				<view class="price-box">
-					<text class="unit">¥</text>
-					<text class="num" >{{payMoney.toFixed(2)}}</text>
+		<template v-if="order">
+			<view class="inner">
+				<!-- 时间、价格 -->
+				<view class="time-price">
+					<text class="time">请在{{payLimitTime}}前完成支付</text>
+					<view class="price-box">
+						<text class="unit">¥</text>
+						<text class="num" >{{payMoney?payMoney:'0.00'}}</text>
+					</view>
+					<text class="desc" v-if="payType==2">代收金额{{payDelivery?payDelivery.toFixed(2):'0.00'}},请您在收到快递后支付尾款给快递人员。</text>
+					<text class="desc" v-if="payType==3">货到付款金额{{payDelivery?payDelivery.toFixed(2):'0.00'}},请您在收到快递后支付给快递人员。</text>
 				</view>
 				</view>
-				<text class="desc" v-if="payType==2">代收金额{{payDelivery.toFixed(2)}},请您在收到快递后支付尾款给快递人员。</text>
-				<text class="desc" v-if="payType==3">货到付款金额{{payDelivery.toFixed(2)}},请您在收到快递后支付给快递人员。</text>
-			</view>
-			<!-- 支付方式 -->
-			<view class="pay-type">
-				<view class="title">支付方式</view>
-				<!-- 改价订单只能选择微信支付和物流代收 -->
-				<radio-group  @change="payTypeChange" v-if="order.isEditMoney!=null&&order.isEditMoney==1">
-					<view class="item"  >
-						<view class="left"  >
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
+				<!-- 支付方式 -->
+				<view class="pay-type">
+					<view class="title">支付方式</view>
+					<!-- 改价订单只能选择微信支付和先定后付(物流代收) -->
+					<radio-group  @change="payTypeChange" v-if="order.isEditMoney!=null&&order.isEditMoney==1">
+						<view class="item"  >
+							<view class="left"  >
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
+								<text class="text">全款支付</text>
+							</view>
+							<label>
+								<radio :value="1" :checked="order.payType=='1'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio :value="1" :checked="order.payType=='1'" />
-						</label>
-					</view>
-					<view class="item"  >
-						<view class="left">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
-							<text class="text">物流代收</text>
+						<view class="item"  >
+							<view class="left">
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
+								<view>
+									<text class="text">先定后付</text>
+									<view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
+								</view>
+							</view>
+							<label>
+								<radio  :value="2" :checked="order.payType=='2'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio  :value="2" :checked="order.payType=='2'" />
-						</label>
-					</view>
-				</radio-group>
-				 
-				<radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==3">
-					<view class="item"  >
-						<view class="left" >
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
+					</radio-group>
+					 
+					<radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==3">
+						<view class="item"  >
+							<view class="left" >
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
+								<text class="text">全款支付</text>
+							</view>
+							<label>
+								<radio :value="1" :checked="order.payType=='1'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio :value="1" :checked="order.payType=='1'" />
-						</label>
-					</view>
-					<view class="item" >
-						<view class="left">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
-							<text class="text">物流代收</text>
+						<view class="item">
+							<view class="left">
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
+								<view>
+									<text class="text">先定后付</text>
+									<view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
+								</view>
+							</view>
+							<label>
+								<radio  :value="2" :checked="order.payType=='2'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio  :value="2" :checked="order.payType=='2'" />
-						</label>
-					</view>
-					<!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
-					<view class="item">
-						<view class="left">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
-							<text class="text">货到付款</text>
+						<!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
+						<view class="item">
+							<view class="left">
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
+								<text class="text">货到付款</text>
+							</view>
+							<label>
+								<radio  :value="3" :checked="order.payType=='3'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio  :value="3" :checked="order.payType=='3'" />
-						</label>
-					</view>
-				</radio-group>
-				<radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==2">
-					<view class="item" v-if="payType==1||payType==4" >
-						<view class="left" >
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
+					</radio-group>
+					<radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&& order.orderCreateType==2">
+						<view class="item" v-if="payType==1||payType==4" >
+							<view class="left" >
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
+								<text class="text">全款支付</text>
+							</view>
+							<label>
+								<radio :value="1" :checked="order.payType=='1'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio :value="1" :checked="order.payType=='1'" />
-						</label>
-					</view>
-					<view class="item" v-if="payType==2||payType==4">
-						<view class="left" >
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
-							<text class="text">物流代收</text>
+						<view class="item" v-if="payType==2||payType==4">
+							<view class="left" >
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_de.png" mode=""></image>
+								<view>
+									<text class="text">先定后付</text>
+									<view style="font-size: 26rpx; font-family: PingFang SC; font-weight: 500;color: #666666;;">可支付部分定金,剩余订单金额货到付款</view>
+								</view>
+							</view>
+							<label>
+								<radio  :value="2" :checked="order.payType=='2'" />
+							</label>
 						</view>
 						</view>
-						<label>
-							<radio  :value="2" :checked="order.payType=='2'" />
-						</label>
-					</view>
-					<!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
+						<!-- v-if="user!=null&&user.level==1 " 2026.2.9注释-->
+						<view class="item">
+							<view class="left">
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
+								<text class="text">货到付款</text>
+							</view>
+							<label>
+								<radio  :value="3" :checked="order.payType=='3'" />
+							</label>
+						</view>
+					</radio-group>
+					<radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&&(order.orderCreateType==1)">
+						<view class="item"  >
+							<view class="left" >
+								<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
+								<text class="text">全款支付</text>
+							</view>
+							<label>
+								<radio :value="1" checked />
+							</label>
+						</view>
+					</radio-group>
+				</view>
+				<view class="order-info" v-show="payType=='2'">
+					<view class="title" style="margin-bottom: 20rpx;">定金金额</view>
+					<view>
+						<u--input type="text" v-model="editAmount" placeholder="请输入定金金额" class="intxt" maxlength="8"></u--input>
+					</view> 
+				</view> 
+				<!-- 订单详情查看 -->
+				<view class="order-info">
+					<view class="title">订单信息</view>
 					<view class="item">
 					<view class="item">
-						<view class="left">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/pay_1.png" mode=""></image>
-							<text class="text">货到付款</text>
+						<text class="label">订单编号</text>
+						<view class="sn-box">
+							<view class="text" v-if="!combinationOrderId">{{orderCode}}</view>
+							<view v-else>
+								<view class="text" v-for="item in order.orderCodes" :key="item">{{item}}</view>
+							</view>
+							<view class="copy-btn" @click="copyOrderSn(orderCode)">复制</view>
 						</view>
 						</view>
-						<label>
-							<radio  :value="3" :checked="order.payType=='3'" />
-						</label>
 					</view>
 					</view>
-				</radio-group>
-				<radio-group @change="payTypeChange" v-else-if="order.orderCreateType!=null&&(order.orderCreateType==1)">
-					<view class="item"  >
-						<view class="left" >
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
-						</view>
-						<label>
-							<radio :value="1" checked />
-						</label>
+					<view class="item">
+						<text class="label">下单时间</text>
+						<text class="text">{{order.createTime}}</text>
 					</view>
 					</view>
-				</radio-group>
-			</view>
-			<!-- 订单详情查看 -->
-			<view class="order-info">
-				<view class="title">订单信息</view>
-				<view class="item">
-					<text class="label">订单编号</text>
-					<view class="sn-box">
-						<view class="text" v-if="!combinationOrderId">{{orderCode}}</view>
-						<view v-else>
-							<view class="text" v-for="item in order.orderCodes" :key="item">{{item}}</view>
-						</view>
-						<view class="copy-btn" @click="copyOrderSn(orderCode)">复制</view>
+					<view class="item">
+						<text class="label">订单金额</text>
+						<text class="text" v-if="order!=null">{{order.payPrice.toFixed(2)}}</text>
 					</view>
 					</view>
+					 
+					<!-- <view class="item">
+						<text class="label">支付方式</text>
+						<text class="text">全款支付</text>
+					</view> -->
+					 
 				</view>
 				</view>
-				<view class="item">
-					<text class="label">下单时间</text>
-					<text class="text">{{order.createTime}}</text>
-				</view>
-				<view class="item">
-					<text class="label">订单金额</text>
-					<text class="text" v-if="order!=null">{{order.payPrice.toFixed(2)}}</text>
-				</view>
-				 
-				<!-- <view class="item">
-					<text class="label">支付方式</text>
-					<text class="text">微信支付</text>
+				
+			</view>
+			<view class="btn-box">
+				<view class="btn" @click="payOrder()">去支付</view>
+				<!-- <view class="other-btn" >
+					亲友代付
+					<button  class="share" data-name="shareBtn" open-type="share">分享</button>
 				</view> -->
 				</view> -->
-				 
 			</view>
 			</view>
-			
-		</view>
-		<view class="btn-box">
-			<view class="btn" @click="payOrder()">去支付</view>
-			<!-- <view class="other-btn" >
-				亲友代付
-				<button  class="share" data-name="shareBtn" open-type="share">分享</button>
-			</view> -->
-		</view>
+		</template>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -152,7 +169,7 @@
 	import {getUserInfo} from '@/api/user'
 	import {getUserInfo} from '@/api/user'
 	
 	
 	import {getStoreConfig} from './api/common.js'
 	import {getStoreConfig} from './api/common.js'
-	import {editPayType,pay,getStoreOrderById,payByCombinationId,getStoreOrderByCombinationId,editPayTypeByCombinationId} from '@/api/myStoreOrder.js'
+	import {editPayType,pay,getStoreOrderById,payByCombinationId,getStoreOrderByCombinationId,editPayTypeByCombinationId,selectPayInfo} from '@/api/myStoreOrder.js'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -167,25 +184,32 @@
 				combinationOrderId: '',
 				combinationOrderId: '',
 				orderCode: "",
 				orderCode: "",
 				// 需要开处方的订单id
 				// 需要开处方的订单id
-				prescribeOrder: ""
+				prescribeOrder: "",
+				payTypeKey: '',
+				companyUserId: '',
+				editAmount: '',
+				payMethod: ''
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
+			this.payMethod=option.payMethod||'';
+			this.payTypeKey = option.payTypeKey||'';
+			this.companyUserId = option.companyUserId||'';
 			this.combinationOrderId = option.combinationOrderId ? decodeURIComponent(option.combinationOrderId) : ''
 			this.combinationOrderId = option.combinationOrderId ? decodeURIComponent(option.combinationOrderId) : ''
 			this.orderId=option.orderId ? JSON.parse(option.orderId) : '';
 			this.orderId=option.orderId ? JSON.parse(option.orderId) : '';
-			uni.showShareMenu({
-				withShareTicket:true,
-				//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
-				menus:["shareAppMessage"] //不设置默认发送给朋友
-			})
+			// uni.showShareMenu({
+			// 	withShareTicket:true,
+			// 	//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
+			// 	menus:["shareAppMessage"] //不设置默认发送给朋友
+			// })
 		},
 		},
 		onShow() {
 		onShow() {
 			this.$isLogin().then(res => {
 			this.$isLogin().then(res => {
 				if(res){
 				if(res){
 					if(this.combinationOrderId) {
 					if(this.combinationOrderId) {
-						this.getStoreOrderByCombinationId()
+						this.getStoreOrderByCombinationId(1)
 					} else {
 					} else {
-						this.getStoreOrderById();
+						this.getStoreOrderById(1);
 					}
 					}
 					this.getStoreConfig();
 					this.getStoreConfig();
 					this.getUserInfo();
 					this.getUserInfo();
@@ -197,15 +221,15 @@
 			})
 			})
 		},
 		},
 		//发送给朋友
 		//发送给朋友
-		onShareAppMessage(res) {
-			const combinationOrderId = this.combinationOrderId ? `&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
-			return {
-				title: "帮TA支付",
-				path: '/pages_shopping/user/otherPaymentOrder?orderId='+this.orderId + combinationOrderId,
-				imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
-			}
+		// onShareAppMessage(res) {
+		// 	const combinationOrderId = this.combinationOrderId ? `&combinationOrderId=${encodeURIComponent(this.combinationOrderId)}` : ''
+		// 	return {
+		// 		title: "帮TA支付",
+		// 		path: '/pages_shopping/user/otherPaymentOrder?orderId='+this.orderId + combinationOrderId,
+		// 		imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
+		// 	}
 			
 			
-		},
+		// },
 		methods: {
 		methods: {
 			getUserInfo(){
 			getUserInfo(){
 				getUserInfo().then(
 				getUserInfo().then(
@@ -224,6 +248,30 @@
 					rej => {}
 					rej => {}
 				);
 				);
 			},
 			},
+			getPayInfo() {
+				const param = {
+					dataKey:this.payTypeKey,
+					userId: this.companyUserId,
+				}
+				selectPayInfo(param).then(res => {
+					if(res.code==200){
+							this.payType=res.data.payType;
+							this.order.payType=res.data.payType;
+							if(this.combinationOrderId) {
+								this.editPayTypeByCombinationId(res.data.payType)
+							}else {
+								this.editPayType(res.data.payType)
+							}
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
 			getStoreConfig(){
 			getStoreConfig(){
 				getStoreConfig().then(
 				getStoreConfig().then(
 					res => {
 					res => {
@@ -237,6 +285,9 @@
 				
 				
 			},
 			},
 			payTypeChange(e){
 			payTypeChange(e){
+				if(e.detail.value ==2) {
+					this.editAmount = this.editAmount || this.order.payPrice
+				}
 				if(this.combinationOrderId) {
 				if(this.combinationOrderId) {
 					this.editPayTypeByCombinationId(e.detail.value)
 					this.editPayTypeByCombinationId(e.detail.value)
 				}else {
 				}else {
@@ -255,7 +306,7 @@
 					}
 					}
 				});
 				});
 			},
 			},
-			getStoreOrderById(){
+			getStoreOrderById(type){
 				var data = {orderId:this.orderId};
 				var data = {orderId:this.orderId};
 				var that=this;
 				var that=this;
 				uni.showLoading();
 				uni.showLoading();
@@ -275,9 +326,15 @@
 									this.order.payType=1;
 									this.order.payType=1;
 								}
 								}
 							}
 							}
+							this.editAmount = this.order.payMoney
+							this.payType = this.order.payType
 							if(that.order.paid!=1) {
 							if(that.order.paid!=1) {
 								// 1支付成功就不用调用这个接口
 								// 1支付成功就不用调用这个接口
-								this.editPayType(this.order.payType)
+								if(type==1&&this.payTypeKey) {
+									this.getPayInfo()
+								} else {
+									this.editPayType(this.order.payType)
+								}
 							}
 							}
 							
 							
 						}else{
 						}else{
@@ -291,12 +348,24 @@
 				);
 				);
 				
 				
 			},
 			},
-			editPayType(payType){
-				var data = {orderId:this.orderId,payType:payType};
+			async editPayType(payType){
+				let data = {}
+				if(payType==2) {
+					if (!this.isValidAmount(this.editAmount)) {
+						uni.showToast({
+							icon: 'none',
+							title: "请输入正确的金额,且必须大于0"
+						});
+						return;
+					}
+					data = {editAmount:this.editAmount,orderId:this.orderId,payType:payType};
+				} else {
+					data = {orderId:this.orderId,payType:payType};
+				}
 				var that=this;
 				var that=this;
 				uni.showLoading();
 				uni.showLoading();
-				editPayType(data).then(
-					res => {
+				return new Promise((resolve, reject) => {
+					editPayType(data).then(res => {
 						if(res.code==200){
 						if(res.code==200){
 							console.log(res);
 							console.log(res);
 							uni.hideLoading();
 							uni.hideLoading();
@@ -304,18 +373,21 @@
 							//this.payType=this.order.payType
 							//this.payType=this.order.payType
 							this.payMoney=this.order.payMoney;
 							this.payMoney=this.order.payMoney;
 							this.payDelivery=this.order.payDelivery;
 							this.payDelivery=this.order.payDelivery;
+							this.payType = payType
+							resolve(res); // 成功回调
 						}else{
 						}else{
 							uni.showToast({
 							uni.showToast({
 								icon:'none',
 								icon:'none',
 								title: res.msg,
 								title: res.msg,
 							});
 							});
+							reject(res); // 失败回调
 						}
 						}
-					},
-					rej => {}
-				);
-				
+					}).catch(err => {
+						reject(err);
+					});
+				})
 			},
 			},
-			getStoreOrderByCombinationId() {
+			getStoreOrderByCombinationId(type) {
 				var data = {combinationId:this.combinationOrderId};
 				var data = {combinationId:this.combinationOrderId};
 				var that=this;
 				var that=this;
 				uni.showLoading();
 				uni.showLoading();
@@ -336,8 +408,13 @@
 								}
 								}
 							}
 							}
 							that.prescribeOrder = res.prescribeOrder;
 							that.prescribeOrder = res.prescribeOrder;
-							this.editPayTypeByCombinationId(this.order.payType)
-							
+							this.editAmount = this.order.payMoney
+							this.payType = this.order.payType
+							if(type==1&&this.payTypeKey) {
+								this.getPayInfo()
+							} else {
+								this.editPayTypeByCombinationId(this.order.payType)
+							}
 						}else{
 						}else{
 							uni.showToast({
 							uni.showToast({
 								icon:'none',
 								icon:'none',
@@ -349,13 +426,24 @@
 				);
 				);
 			},
 			},
 			editPayTypeByCombinationId(payType){
 			editPayTypeByCombinationId(payType){
-				var data = {combinationOrderId:this.combinationOrderId,payType:payType};
-				var that=this;
+				let data ={}
+				if(payType==2) {
+					if (!this.isValidAmount(this.editAmount)) {
+						uni.showToast({
+							icon: 'none',
+							title: "请输入正确的金额,且必须大于0"
+						});
+						return;
+					}
+					data = {editAmount: this.editAmount,combinationOrderId:this.combinationOrderId,payType:payType};
+				} else {
+					data = {combinationOrderId:this.combinationOrderId,payType:payType};
+				}
+				let that = this
 				uni.showLoading();
 				uni.showLoading();
-				editPayTypeByCombinationId(data).then(
-					res => {
+				return new Promise((resolve, reject) => {
+					editPayTypeByCombinationId(data).then(res => {
 						if(res.code==200){
 						if(res.code==200){
-							console.log(res);
 							uni.hideLoading();
 							uni.hideLoading();
 							that.order=res.order;
 							that.order=res.order;
 							that.orderCode = res.order.orderCodes ? res.order.orderCodes.join(',') : "";
 							that.orderCode = res.order.orderCodes ? res.order.orderCodes.join(',') : "";
@@ -363,24 +451,36 @@
 							this.payMoney=this.order.payMoney;
 							this.payMoney=this.order.payMoney;
 							this.payDelivery=this.order.payDelivery;
 							this.payDelivery=this.order.payDelivery;
 							that.prescribeOrder = res.prescribeOrder;
 							that.prescribeOrder = res.prescribeOrder;
+							this.payType = payType
+							console.log('this.order.payMoney==',this.payMoney,this.order.payMoney);
+							resolve(res); // 成功回调
 						}else{
 						}else{
 							uni.showToast({
 							uni.showToast({
 								icon:'none',
 								icon:'none',
 								title: res.msg,
 								title: res.msg,
 							});
 							});
+							reject(res); // 失败回调
 						}
 						}
-					},
-					rej => {}
-				);
-				
+					}).catch(err => {
+						reject(err);
+					})
+				})
 			},
 			},
-			payOrder(){
+			async payOrder(){
 				if(this.combinationOrderId) {
 				if(this.combinationOrderId) {
+					if(this.order.payType==2&&this.payMoney!=this.editAmount){
+						await this.editPayTypeByCombinationId(this.order.payType)
+						uni.hideLoading();
+					}
 					let data = {combinationOrderId:this.combinationOrderId,payType:this.order.payType,appId: getApp().globalData.appId};
 					let data = {combinationOrderId:this.combinationOrderId,payType:this.order.payType,appId: getApp().globalData.appId};
+					if(this.order.payType==2) {
+						data = {editAmount:this.editAmount,combinationOrderId:this.combinationOrderId,payType:this.order.payType,appId: getApp().globalData.appId};
+					}
 					let that=this;
 					let that=this;
 					uni.showLoading();
 					uni.showLoading();
 					payByCombinationId(data).then(
 					payByCombinationId(data).then(
 						res => {
 						res => {
+							uni.hideLoading();
 							if(res.code==200){
 							if(res.code==200){
 								this.payfun(res)
 								this.payfun(res)
 							}else{
 							}else{
@@ -393,7 +493,14 @@
 						rej => {}
 						rej => {}
 					);
 					);
 				} else {
 				} else {
+					if(this.order.payType==2&&this.payMoney!=this.editAmount){
+						await this.editPayType(this.order.payType)
+						uni.hideLoading();
+					}
 					let data = {orderId:this.order.id,payType:this.order.payType,appId: getApp().globalData.appId};
 					let data = {orderId:this.order.id,payType:this.order.payType,appId: getApp().globalData.appId};
+					if(this.order.payType==2) {
+						data = {editAmount:this.editAmount,orderId:this.order.id,payType:this.order.payType,appId: getApp().globalData.appId};
+					}
 					let that=this;
 					let that=this;
 					uni.showLoading();
 					uni.showLoading();
 					pay(data).then(
 					pay(data).then(
@@ -415,31 +522,58 @@
 				const that = this
 				const that = this
 				console.log(res.result);
 				console.log(res.result);
 				if(res.payType==1||res.payType==2){
 				if(res.payType==1||res.payType==2){
-					 uni.requestPayment({
-						provider: 'wxpay',
-						timeStamp: res.result.timeStamp,
-						nonceStr: res.result.nonceStr,
-						// package: res.result.packageValue,
-						package: res.result.packageStr,
-						signType: res.result.signType,
-						paySign: res.result.paySign,
-						success: function(res) {
-							 uni.hideLoading();
-							  uni.redirectTo({
-								url:"/pages_shopping/success?order="+JSON.stringify(that.order)
-							  }) 
-						},
-						fail: function(err) {
-							uni.showToast({
-								icon:'none',
-								title:'fail:' + JSON.stringify(err),
-							});
-							console.log('fail:' + JSON.stringify(err));
-							uni.hideLoading();
-						}
-					 });
+					if(res.type&&res.type=='yb') {
+						let prePayTn = JSON.parse(res.data.prePayTn)
+						uni.requestPayment({
+							provider: 'wxpay',
+							timeStamp: prePayTn.timeStamp,
+							nonceStr: prePayTn.nonceStr,
+							package: prePayTn.package,
+							signType: prePayTn.signType,
+							paySign: prePayTn.paySign,
+							success: function(res) {
+								 uni.hideLoading();
+								  uni.redirectTo({
+									url:"/pages_shopping/success?order="+JSON.stringify(that.order)
+								  }) 
+							},
+							fail: function(err) {
+								uni.showToast({
+									icon:'none',
+									title:'fail:' + JSON.stringify(err),
+								});
+								console.log('fail:' + JSON.stringify(err));
+								uni.hideLoading();
+							}
+						});
+					} else {
+						uni.requestPayment({
+							provider: 'wxpay',
+							timeStamp: res.result.timeStamp,
+							nonceStr: res.result.nonceStr,
+							// package: res.result.packageValue,
+							package: res.result.packageStr,
+							signType: res.result.signType,
+							paySign: res.result.paySign,
+							success: function(res) {
+								 uni.hideLoading();
+								  uni.redirectTo({
+									url:"/pages_shopping/success?order="+JSON.stringify(that.order)
+								  }) 
+							},
+							fail: function(err) {
+								uni.showToast({
+									icon:'none',
+									title:'fail:' + JSON.stringify(err),
+								});
+								console.log('fail:' + JSON.stringify(err));
+								uni.hideLoading();
+							}
+						});
+					}
 				}
 				}
 				else if(res.payType==3){
 				else if(res.payType==3){
+					// 货到付款
 					 uni.hideLoading();
 					 uni.hideLoading();
 					 // 能支付的订单表示已经开过处方了
 					 // 能支付的订单表示已经开过处方了
 					 // if(that.order.isPrescribe){
 					 // if(that.order.isPrescribe){
@@ -458,6 +592,20 @@
 						}) 
 						}) 
 					 // }
 					 // }
 				}
 				}
+			},
+			isValidAmount(amount) {
+				// 1. 必须是数字或数字字符串
+				const num = parseFloat(amount);
+				if (isNaN(num)) return false;
+				
+				// // 2. 必须大于0
+				if (num <= 0) return false;
+				
+				// 3. 最多两位小数(可选)
+				const str = String(amount).trim();
+				if (!/^\d+(\.\d{1,2})?$/.test(str)) return false;
+				
+				return true;
 			}
 			}
 		}
 		}
 	}
 	}

+ 7 - 2
pages_shopping/prescribe.vue

@@ -249,14 +249,19 @@
 				hasMore: true,
 				hasMore: true,
 				dataKey: '',
 				dataKey: '',
 				dataPrescribeKey:'',
 				dataPrescribeKey:'',
-				companyUserId:''
+				companyUserId:'',
+				payTypeKey: '',
+				payType: ''
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
 			this.companyUserId = option.companyUserId ||''
 			this.companyUserId = option.companyUserId ||''
 			this.dataKey = option.dataKey || ''
 			this.dataKey = option.dataKey || ''
 			this.dataPrescribeKey = option.dataPrescribeKey || ''
 			this.dataPrescribeKey = option.dataPrescribeKey || ''
-			this.orderId=option.orderId
+			this.orderId=decodeURIComponent(option.orderId);
+			this.payTypeKey = option.payTypeKey ||''
+			this.payType = option.payType || ''
+			
 			if(this.dataPrescribeKey) {
 			if(this.dataPrescribeKey) {
 				this.getSquareInformation()
 				this.getSquareInformation()
 				this.cacheOrderPrescription()
 				this.cacheOrderPrescription()

+ 0 - 1
pages_shopping/productList.vue

@@ -289,7 +289,6 @@
 					font-family: PingFang SC;
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-weight: 500;
 					color: #999999;
 					color: #999999;
-					line-height: 1;
 					margin-top: 26upx;
 					margin-top: 26upx;
 				}
 				}
 			 
 			 

+ 0 - 1
pages_shopping/shopping/activityDetails.vue

@@ -254,7 +254,6 @@ export default {
 								font-family: PingFang SC;
 								font-family: PingFang SC;
 								font-weight: 500;
 								font-weight: 500;
 								color: #999999;
 								color: #999999;
-								line-height: 1;
 								margin-top: 26upx;
 								margin-top: 26upx;
 							}
 							}
 						 
 						 

+ 1 - 1
pages_shopping/user/otherPaymentOrder.vue

@@ -16,7 +16,7 @@
 					<view class="item"   >
 					<view class="item"   >
 						<view class="left"  >
 						<view class="left"  >
 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/wecha_pay.png" mode=""></image>
 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
+							<text class="text">全款支付</text>
 						</view>
 						</view>
 						<label>
 						<label>
 							<radio :value="1" checked  />
 							<radio :value="1" checked  />

+ 1 - 1
pages_user/shopping/paymentOrderRemain.vue

@@ -16,7 +16,7 @@
 					<view class="item"   >
 					<view class="item"   >
 						<view class="left"  >
 						<view class="left"  >
 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/wecha_pay.png" mode=""></image>
-							<text class="text">微信支付</text>
+							<text class="text">全款支付</text>
 						</view>
 						</view>
 						<label>
 						<label>
 							<radio :value="1" checked  />
 							<radio :value="1" checked  />

+ 2 - 2
pages_user/shopping/storeOrderDetail.vue

@@ -174,8 +174,8 @@
 						</view>
 						</view>
 						<view class="item">
 						<view class="item">
 							<text class="label">支付方式</text>
 							<text class="label">支付方式</text>
-							<text class="text" v-if="order.payType==1">微信支付</text>
-							<text class="text" v-if="order.payType==2">物流代收</text>
+							<text class="text" v-if="order.payType==1">全款支付</text>
+							<text class="text" v-if="order.payType==2">先定后付</text>
 						</view>
 						</view>
 						<view   class="item">
 						<view   class="item">
 							<text class="label">订单金额</text>
 							<text class="label">订单金额</text>