Bläddra i källkod

Merge remote-tracking branch 'origin/master'

puyao 1 vecka sedan
förälder
incheckning
7cbc9107a5

+ 4 - 0
api/storeOrder.js

@@ -73,6 +73,10 @@ let request = new Request().http
  export function getOrderCount() {
  	 return request('/app/storeOrder/getOrderCount',null,'GET');
  } 
+ //查询多个订单物流信息
+ export function getExpresslist(data) {
+ 	 return request('/app/storeOrder/getExpressMulti',data,'POST','application/json;charset=UTF-8');
+ }
  
  
  

+ 2 - 2
common/request.js

@@ -2,8 +2,8 @@
 export default class Request {
 	http(router, data = {}, method,contentType) {
 		let that = this;
-		let path =  'http://192.168.10.122:7014';
-		// let path = 'https://api.zxfh.cdwjyyh.com'; 
+		// let path =  'http://192.168.10.122:7014';
+		let path = 'https://api.zxfh.cdwjyyh.com'; 
 		uni.setStorageSync('requestPath',path)
 		// uni.showLoading({
 		// 	title: '加载中'

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "互联网医院",
-    "appid" : "__UNI__DBD2079",
+    "appid" : "__UNI__D138114",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 21 - 2
pages/auth/login.vue

@@ -5,7 +5,7 @@
       <view class="force-login__content y-f">
         <view class="logo">
         	<view class="logo-img">
-        		<image  src="../../static/logo.png"></image>
+        		<image  src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250310/aeb776c6aa174d7c94181e5fd212e0f1.png"></image>
         	</view>
         	<view class="title">芳华佳选</view>
         </view>
@@ -84,12 +84,15 @@ export default {
 	},
 	methods: {
 		handleAgree(){
+			console.log(123)
+			
 			if(!this.isAgreement){
 			  	uni.showToast({
 			  		icon:'none',
 			  		title: "请先同意协议后再登录",
 			  	});
 			}
+			
 		},
 		 
 		checkWeixin(){
@@ -110,13 +113,28 @@ export default {
 			//在微信公众号请求用户网页授权之前,开发者需要先到公众平台官网中的“开发 - 接口权限 - 网页服务 - 网页帐号 - 网页授权获取用户基本信息”的配置选项中,修改授权回调域名。请注意,这里填写的是域名(是一个字符串),而不是URL,因此请勿加 http:// 等协议头; 
 			//http://shequ.natapp1.cc/#/pages/index/index?deviceId=8
 			var appId="wx19c8813ffc33d1cb";
-			var url="http://192.168.10.122:7014";
+			var url="https://api.zxfh.cdwjyyh.com";
 			window.location.href ='https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appId+'&redirect_uri=' +encodeURIComponent(url+"/#/pages/auth/wxLogin") +'&response_type=code&scope=snsapi_userinfo&state=JeffreySu-954&connect_redirect=1#wechat_redirect';
 			//console.log('https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appId+'&redirect_uri=' +encodeURIComponent("http://shequ.natapp1.cc/#/pages/index/index?deviceId="+this.deviceId) +'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect')
 			// redirect_uri是授权成功后,跳转的url地址,微信会帮我们跳转到该链接,并且通过?的形式拼接code
 		},
 		handleAgreement(){
 			this.isAgreement=!this.isAgreement;
+			console.log(545454)
+			uni.requestSubscribeMessage({
+					tmplIds: ['K0RUbGggwYz7V4yjtJjFVXtthnx4hOJgHvr7RNOyRSE','5ZSzz2nPmJo9EuenZa78mQPScoOMc84LnEfEpV0-i04'], // 模板ID列表,从微信公众平台获取
+					success(res) {
+					  console.log('订阅消息成功', res);
+					  if(res.errMsg=='requestSubscribeMessage:ok'){
+						  console.log('订阅消息成功11111');
+					  }
+					  // 根据返回的 res 处理后续逻辑,例如显示成功消息给用户
+					},
+					fail(err) {
+					  console.error('订阅消息失败', err);
+					  // 处理失败情况,例如提示用户重新尝试或检查权限设置
+					}
+			 });
 		},
 		openH5(url){
 			var requestPath = uni.getStorageSync('requestPath');
@@ -222,6 +240,7 @@ export default {
 		},
 		// 微信用户手机号登录
 		phoneLogin(e) {
+			
 			var that=this;
 			if(!this.isAgreement){
 				uni.showToast({

+ 5 - 3
pages/home/index.vue

@@ -72,15 +72,17 @@
 		<!-- 在线问诊、处方查询 -->
 		<view class="online-inquiry">
 			<view class="item" @click="navTo('/pages_shopping/shopping/productSalesList')" >
-				<image  class="bg-img" src="../../static/images/banner1.png" mode=""></image>
+				<!-- <image  class="bg-img" src="../../static/images/banner1.png" mode=""></image> -->
+				<image class="bg-img" src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250320/f2d3ba32a9344dc79b4df7c228189243.png" mode=""></image>
 				<!-- <view class="inner">
 					<text class="title">用药榜</text>
 					<text class="sub-title"></text>
-					<image src="../../static/images/doctor.png" mode=""></image>
+					<image src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250320/f2d3ba32a9344dc79b4df7c228189243.png" mode=""></image>
 				</view> -->
 			</view>
 			<view class="item"  @click="navTo('/pages_user/user/userShareList')">
-				<image class="bg-img" src="../../static/images/banner2.png" mode=""></image>
+				<!-- <image class="bg-img" src="../../static/images/banner2.png" mode=""></image> -->
+				<image class="bg-img" src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20250320/0a47b5c6b5fb43eab0b4426d5db27471.png" mode=""></image>
 				<!-- <view class="inner">
 					<text class="title">分享榜</text>
 					<text class="sub-title"></text>

+ 3 - 1
pages/shopping/cart.vue

@@ -84,8 +84,10 @@
 			}	
 		},
 		onLoad() {
+			// this.getCarts();
+		},
+		onShow() {
 			this.getCarts();
- 
 		},
 		onReachBottom() {
 			this.$refs.product.getGoodsProducts();

+ 16 - 6
pages/shopping/confirmPackageOrder.vue

@@ -51,12 +51,19 @@
 				</view>
 				<!-- 小计 -->
 				<view class="sub-total">
-					<text class="label">合计:</text>
+					<text class="label" style="color: #666;">合计:</text>
 					<view class="price">
 						<text class="unit">¥</text>
 						<text class="num" v-if="package.payMoney!=null">{{package.payMoney.toFixed(2)}}</text>
 					</view>
 				</view>
+				<view class="sub-total" style="height: 30rpx; ">
+					<text class="label" style="color: #bdbdbd;">邮费:</text>
+					<view class="price">
+						<text class="unit">¥</text>
+						<text class="num" v-if="postMoney!=null">{{postMoney.toFixed(2)}}</text>
+					</view>
+				</view>
 			</view>
 			 
 			<view class="points" @click="openCoupon()">
@@ -151,22 +158,23 @@
 					orderKey:null,
 					addressId:null,
 					mark:null,
-				}
-				
+				},
+				postMoney:''
 			}
 		},
 		onLoad(option) {
 			this.packageId=option.packageId;
 			this.companyUserId=option.companyUserId;
-			this.confirmPackageOrder();
 			uni.$on('updateAddress', (e) => {
 				this.address=e;
 				this.form.addressId=e.id;
+				that.form.address=e.province+e.city+e.district+e.detail
 			})
+			this.confirmPackageOrder();
 			this.getWeixinTemps();
 		},
 		onShow() {
-			
+			this.confirmPackageOrder();
 		},
 		methods: {
 			getWeixinTemps:function(){
@@ -197,13 +205,15 @@
 				})
 			},
 			confirmPackageOrder(){
-				let data = {packageId:this.packageId,couponUserId:this.couponUserId};
+				let data = {packageId:this.packageId,couponUserId:this.couponUserId,userAddressId:this.form.addressId};
 				confirmPackageOrder(data).then(
 					res => {
 						if(res.code==200){
 							 this.form.orderKey=res.orderKey;
 							 this.address=res.address;
 							 this.package=res.package;
+							 this.postMoney=res.postMoney
+							 console.log(this.postMoney)
 							 if(res.address!=null){
 								 this.form.addressId=res.address.id;
 							 }

+ 39 - 8
pages/shopping/paymentOrder.vue

@@ -162,7 +162,8 @@
 				user:null,
 				checkTimer: null, // 轮询定时器 ID
 				maxRetryCount: 10, // 最大轮询次数(可选)
-				retryCount: 0      // 当前轮询次数(可选)
+				retryCount: 0  ,// 当前轮询次数(可选)
+				timeoutTimer:null//总轮询定时器
 			}
 		},
 		onLoad(option) {
@@ -291,6 +292,7 @@
 
 			},
 			otherPayOrder(){
+				
 			var that=this;
 			console.log(that.order.id)
 			var sum=that.order.id
@@ -299,6 +301,7 @@
 				})
 			},
 			payOrder(){
+				
 				var data = {orderId:this.order.id,payType:this.order.payType};
 				var that=this;
 				uni.showLoading();
@@ -321,23 +324,40 @@
                    },
                    envVersion: 'release', // 开发版 develop,体验版 trial,正式环境传 release
                    success(res) {
+					   
                      uni.showLoading({
                        title:"查询支付结果中...",
 					   
                      })
+					 // 定义计时总变量
+					     let timeoutFlag = false;
+						 const timeoutTimer = setTimeout(() => {
+						         timeoutFlag = true;
+						         clearInterval(that.checkTimer);
+						         uni.hideLoading();
+						         uni.showToast({
+						             title: '支付状态查询超时',
+						             icon: 'none'
+						         });
+						         uni.redirectTo({
+						             url: '/pages_user/user/storeOrderDetail?id=' + that.order.id
+						         });
+						     }, 10000); // 总时长10秒
 					 // 启动定时器并保存 ID
 					   that.checkTimer = setInterval(() => {
 						 const data = { orderId: that.order.id };
 						 checkpayment(data).then(res => {
+							  if (timeoutFlag) return; // 如果已超时则不再处理
 						   if (res.code == 200) {
 							 if (res.status == 1) {
 							   // 跳转前清除定时器
 							   clearInterval(that.checkTimer);
-							   uni.navigateTo({
+							    clearTimeout(timeoutTimer);
+							   uni.redirectTo({
 								 url: '/pages_user/user/storeOrderDetail?id=' + that.order.id
 							   });
 							 }
-							 // else{
+							 // else if{
 								//  setTimeout(()=>{
 								// 	 clearInterval(that.checkTimer);
 								// 	 uni.navigateTo({
@@ -345,18 +365,29 @@
 								// 	 });
 								//  },10000)
 							 // }
+						   }else{
+							   // 接口异常时清除定时器
+								   clearInterval(that.checkTimer);
+								   clearTimeout(timeoutTimer);
+								   uni.hideLoading();
+								   uni.showToast({
+									   title: '查询异常:' + res.msg,
+									   icon: 'none'
+								   });
 						   }
 						 });
 					   }, 4000);
-					 // setTimeout(()=>{
-						//  that.otherPayOrder()
-					 // },4000)
+					  // 页面卸载时清理定时器(重要!)
+					     that.$once('hook:beforeDestroy', () => {
+					         clearInterval(that.checkTimer);
+					         clearTimeout(timeoutTimer);
+					     });
                      console.log('结果结果',res)
-// 接口调用成功的回调函数
+					 // 接口调用成功的回调函数
                    },
                    fail(res) {
 					   if (that.checkTimer) clearInterval(that.checkTimer);
-// 接口调用失败的回调函数
+					   // 接口调用失败的回调函数
                    }
                  })
 								 // var result=JSON.parse(res.result);

+ 2 - 2
pages/user/index.vue

@@ -153,10 +153,10 @@
 				<view style="padding-bottom: 20rpx;">
 					<view @tap="loginOUt" class="log-out x-c" >退出登录</view>
 				</view>
-				<!-- <view class="banner">
+				<view class="banner">
 					<image src="https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20221125/71ddd95044bb46d5b27e19a5f61cf5ab.png"></image>
 					<view class="tel_btn" @click="callService()"></view>
-				</view> -->
+				</view>
 				<view class="like-product">
 					<likeProduct  ref="product" />
 				</view>

+ 2 - 2
pages_company/index.vue

@@ -16,14 +16,14 @@
 			<view class="used-tools">
 				<view class="title">常用工具</view>
 				<view class="tools-list">
-					<view class="item" @click="toCreateOrder()">
+					<!-- <view class="item" @click="toCreateOrder()">
 						<image src="../static/images/order.png" mode=""></image>
 						<text class="text">商品制单</text>
 					</view>
 					<view class="item" @click="toCreateCoupon()">
 						<image src="../static/images/icon_coupon.png" mode=""></image>
 						<text class="text">制单优惠券</text>
-					</view>
+					</view> -->
 					<view class="item" @click="toPay()">
 						<image src="../static/images/money.png" mode=""></image>
 						<text class="text">微信收款</text>

+ 6 - 1
pages_company/storeProductPackageDetails.vue

@@ -162,7 +162,12 @@
 		},
 		onShow() {
 			console.log("onshow")
-			if(this.utils.isLogin()){
+			// if(this.utils.isLogin()){
+			// 	console.log(123)
+			// 	this.getOrderCount();
+			// }
+			if(uni.getStorageSync('AppToken')){
+				console.log(123)
 				this.getOrderCount();
 			}
 			this.getStoreProductPackageDetails();

+ 36 - 4
pages_user/user/otherPaymentOrder.vue

@@ -66,7 +66,8 @@
 				user:null,
 				checkTimer: null, // 轮询定时器 ID
 				maxRetryCount: 10, // 最大轮询次数(可选)
-				retryCount: 0      // 当前轮询次数(可选)
+				retryCount: 0      ,// 当前轮询次数(可选)
+				timeoutTimer:null//总轮询定时器
 			}
 		},
 		onLoad(option) {
@@ -146,15 +147,32 @@
 									 uni.showLoading({
 									   title:"查询支付结果中..."
 									 })
+									 // 定义计时总变量
+									     let timeoutFlag = false;
+										 const timeoutTimer = setTimeout(() => {
+												 timeoutFlag = true;
+												 clearInterval(that.checkTimer);
+												 uni.hideLoading();
+												 uni.showToast({
+													 title: '支付状态查询超时',
+													 icon: 'none'
+												 });
+												 uni.redirectTo({
+													 url: '/pages_user/user/storeOrderDetail?id=' + that.order.id
+												 });
+											 }, 10000); // 总时长10秒
 									// 启动定时器并保存 ID
 									  that.checkTimer = setInterval(() => {
 										 const data = { orderId: that.order.id };
 										 checkpayment(data).then(res => {
+											 if (timeoutFlag) return; // 如果已超时则不再处理
 										   if (res.code == 200) {
-											 if (res.status == 3) {
+											 if (res.status == 1) {
 											   // 跳转前清除定时器
+											   
 											   clearInterval(that.checkTimer);
-											   uni.navigateTo({
+											   clearTimeout(timeoutTimer);
+											   uni.redirectTo({
 												 url: '/pages_user/user/storeOrderDetail?id=' + that.order.id
 											   });
 											 }
@@ -167,10 +185,24 @@
 												//  },10000)
 												 
 											 // }
-										   }
+										   }else{
+									   // 接口异常时清除定时器
+										   clearInterval(that.checkTimer);
+										   clearTimeout(timeoutTimer);
+										   uni.hideLoading();
+										   uni.showToast({
+											   title: '查询异常:' + res.msg,
+											   icon: 'none'
+										   });
+											}
 										 });
 									  }, 4000);
 									 console.log(res)
+									 // 页面卸载时清理定时器(重要!)
+									    that.$once('hook:beforeDestroy', () => {
+									        clearInterval(that.checkTimer);
+									        clearTimeout(timeoutTimer);
+									    });
 									// 接口调用成功的回调函数
 								   },
 								   fail(res) {

+ 15 - 10
pages_user/user/pay.vue

@@ -125,25 +125,30 @@
                   })
 				 // 启动定时器并保存 ID
 				   that.checkTimer = setInterval(() => {
-							 const data = { orderId: result.payCode };
+							 const data = { payCode: result.payCode };
 							 checkpayment(data).then(res => {
 							   if (res.code == 200) {
 								   console.log(res)
+								   // uni.showLoading({
+								   //   title:"查询支付结果中..."
+								   // })
 								 if (res.status == 1) {
 								   // 跳转前清除定时器
+								   
 								   clearInterval(that.checkTimer);
-								   uni.navigateTo({
+								   uni.redirectTo({
 									  url: './success'
 								   });
-								 }else{
-									 setTimeout(()=>{
-										 clearInterval(that.checkTimer);
-										 	uni.showToast({
-										 		icon:'none',
-										 		title: "用户未支付",
-										 	});
-									 },10000)
 								 }
+								 // else{
+									//  setTimeout(()=>{
+									// 	 clearInterval(that.checkTimer);
+									// 	 	uni.showToast({
+									// 	 		icon:'none',
+									// 	 		title: "用户未支付",
+									// 	 	});
+									//  },10000)
+								 // }
 							   }
 							 });
 				   }, 4000);

+ 41 - 5
pages_user/user/storeOrderDelivery.vue

@@ -13,14 +13,20 @@
 				</view>
 				<!-- 运单号 -->
 				<view class="waybill-number">
+					<view class="itemlistall">
+						<view v-for="(item,index) in ExpressMulti" :key="index" @click="xuanze(index)"
+						 :class="actexpress==index?'itemlist itemact':'itemlist' " >
+							物流{{index+1}}</view>
+					</view>
+					
 					<view class="inner">
 						<view class="num-box">
 							<text class="text">运单号</text>
-							<text class="text">{{deliveryId}}</text>
-							<view class="copy" @click="copyOrderSn(deliveryId)">复制</view>
+							<text class="text">{{expressList.LogisticCode}}</text>
+							<view class="copy" @click="copyOrderSn(expressList.LogisticCode)">复制</view>
 						</view>
 						<view class="kf-box">
-							<text class="text">{{express.name}}</text>
+							<text class="text">{{expressList.ShipperName}}</text>
 							<!-- <text class="text">客服电话:95311</text> -->
 						</view>
 					</view>
@@ -56,7 +62,7 @@
 </template>
 
 <script>
-	import {getMyStoreOrderById,cancelOrder,getExpress} from '@/api/storeOrder'
+	import {getMyStoreOrderById,cancelOrder,getExpress,getExpresslist} from '@/api/storeOrder'
 	export default {
 		data() {
 			return {
@@ -65,13 +71,31 @@
 				deliveryId:null,
 				express:{},
 				expressList:[],
+				ExpressMulti:[],
+				actexpress:0
 			};
 		},
 		onLoad(option) {
 			this.orderId=option.orderId;
-			this.getExpress();
+			// this.getExpress();
+			this.getExpresslists()
 		},
 		methods: {
+			xuanze(index){
+				this.actexpress=index
+				this.getExpresslists()
+			},
+			getExpresslists(){
+				var data={orderId:this.orderId};
+				getExpresslist(data).then(res => {
+					if(res.code==200){
+						this.ExpressMulti=res.data
+						this.expressList=res.data[this.actexpress]
+						console.log(this.expressList)
+						console.log(this.ExpressMulti)
+					}
+				})
+			},
 			getExpress(){
 				var data={orderId:this.orderId};
 				
@@ -118,6 +142,18 @@
 </script>
 
 <style lang="scss">
+	.itemlistall{
+		display: flex;
+	}
+	.itemlist{
+		background-color: #fff;
+		margin: 10rpx;
+		padding: 10rpx 30rpx;
+		border-radius: 10rpx;
+	}
+	.itemact{
+		color: #2BC7B9;
+	}
 	.top-cont{
 		width: 100%;
 		height: 336upx;

BIN
static/logo.png