Forráskód Böngészése

新增更新强制重启,添加轮播图广告页

1410417013 6 hónapja
szülő
commit
95bc41fdbd
5 módosított fájl, 175 hozzáadás és 39 törlés
  1. 27 0
      App.vue
  2. 66 0
      my/guanggao/index.vue
  3. 5 0
      pages.json
  4. 32 17
      pages/index/shop/confirmOrder.vue
  5. 45 22
      pages/index/shop/payOrder.vue

+ 27 - 0
App.vue

@@ -1,6 +1,33 @@
 <script>
 export default {
 	onLaunch: function () {
+		console.log('检测',wx.canIUse('getUpdateManager'))
+		// 检测小程序更新
+		  if (wx.canIUse('getUpdateManager')) {
+		    const updateManager = wx.getUpdateManager();
+		        // 仅保留监听,无需手动调用checkForUpdate
+		        updateManager.onCheckForUpdate((res) => {
+		          console.log('检查更新结果:', res.hasUpdate); // 关键日志
+		          if (res.hasUpdate) {
+		            // 2. 监听新版本下载完成
+		            updateManager.onUpdateReady(() => {
+		              wx.showModal({
+		                title: '更新提示',
+		                content: '新版本已准备好,是否重启?',
+		                success: (res) => {
+		                  if (res.confirm) updateManager.applyUpdate();
+		                }
+		              });
+		            });
+		            // 3. 监听下载失败
+		            updateManager.onUpdateFailed(() => {
+		              wx.showToast({ title: '新版本下载失败', icon: 'none' });
+		            });
+		          }
+		        });
+		        // 主动触发检查(部分场景需手动调用)
+		        updateManager.checkForUpdate(); // 关键:手动触发检查
+		  }
 		// setInterval((d) => {
 		// 	//定时器,定时去调取聊天未读消息
 		// 	let userId = uni.getStorageSync('userId')

+ 66 - 0
my/guanggao/index.vue

@@ -0,0 +1,66 @@
+<template>
+	<view>
+		<view class="">
+			<view class="margin-lr margin-top" style="position: relative;border-radius: 10upx;overflow: hidden;">
+				<image :src="image" style="width: 100%;height: 467px;" @click="clickImg"></image>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				image:'',
+			}
+		},
+		onLoad(option) {
+			console.log(option.tu)
+			this.image=option.tu
+		},
+		methods: {
+			//点击放大图片
+			clickImg(){
+				wx.previewImage({
+					urls: [this.image], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
+					current:'', // 当前显示图片的http链接,默认是第一个
+					success: function(res) {},
+					fail: function(res) {},
+					complete: function(res) {},
+				})
+			},
+			
+		},
+		computed: {
+
+		}
+	}
+</script>
+
+<style>
+	.bg {
+		background-color: #FFFFFF;
+	}
+
+	.btn {
+		width: 100%;
+		height: 88upx;
+		background: linear-gradient(0deg, #af8262 0%, #cab49c 100%);
+		border-radius: 44upx;
+		text-align: center;
+		line-height: 88upx;
+		margin-top: 40upx;
+		font-size: 34upx;
+		font-weight: 600;
+		color: #402321;
+	}
+
+	.active {
+		border: 1px solid #cab49c !important;
+		border-radius: ;
+	}
+
+	
+</style>

+ 5 - 0
pages.json

@@ -331,6 +331,11 @@
 					"style": {
 						"navigationBarTitleText": "投诉详情"
 					}
+				},{
+					"path": "guanggao/index",
+					"style": {
+						"navigationBarTitleText": ""
+					}
 				},
 				{
 					"path": "vip/index",

+ 32 - 17
pages/index/shop/confirmOrder.vue

@@ -534,7 +534,7 @@ export default {
 		  		this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
 		  	}
 		  }
-		  
+		  this.getvipMoney()
 		  let totalMoney =0
 		  if(this.Vipmoney.canReduceFlag=='1'){
 		  			  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
@@ -559,6 +559,17 @@ export default {
 				console.log(res, '会员立减',data)
 				if (res.code == 0 && res.data) {
 					this.Vipmoney=res.data
+					let totalMoney =0
+					if(this.Vipmoney.canReduceFlag=='1'){
+								  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
+					}else{
+								  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
+					}
+					if (totalMoney <= 0) {
+						this.totalPrice12 = 0.01
+					} else {
+						this.totalPrice12 = totalMoney
+					}
 				}
 			})
 		},
@@ -871,15 +882,19 @@ export default {
 				this.getDistance()
 			}
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(
-					parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
-				).toFixed(2)
+				this.packType=1
+				this.ispackType =false
+				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
+				this.getvipMoney()
 			} else {
+				this.packType=1
+				this.ispackType =false
 				if(this.packType==1){
 					this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 				}else{
 					this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
 				}
+				this.getvipMoney()
 			}
 			let totalMoney =0
 			if(this.Vipmoney.canReduceFlag=='1'){
@@ -1253,25 +1268,25 @@ export default {
 							this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
 						}
 					}
-					
+					this.getvipMoney()
+					// let totalMoney =0
+					// if(this.Vipmoney.canReduceFlag=='1'){
+					// 			  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
+					// }else{
+					// 			  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
+					// }
+					// if (totalMoney <= 0) {
+					// 	this.totalPrice12 = 0.01
+					// } else {
+					// 	this.totalPrice12 = totalMoney
+					// }
 
 					// console.log(this.dataList)
-					this.getvipMoney()
+					
 					this.getCouponList()
 					this.getHuoList()
 					this.detCoupon()
 					this.getDistance()
-					let totalMoney =0
-					if(this.Vipmoney.canReduceFlag=='1'){
-								  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
-					}else{
-								  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
-					}
-					if (totalMoney <= 0) {
-						this.totalPrice12 = 0.01
-					} else {
-						this.totalPrice12 = totalMoney
-					}
 				}
 				// 加载提示关闭
 				uni.hideLoading()

+ 45 - 22
pages/index/shop/payOrder.vue

@@ -501,9 +501,9 @@ export default {
 		  console.log("开关状态:", this.ispackType);
 		  // 可在此处添加业务逻辑(如保存状态到缓存、调用接口等)
 		  if (this.ispackType) {
-			this.packType=0
+		  			this.packType=0
 		  } else {
-			this.packType=1
+		  			this.packType=1
 		  }
 		  console.log("堂食或:packType", this.packType);
 		  if (this.orderType == 2) {
@@ -515,15 +515,14 @@ export default {
 		  		this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
 		  	}
 		  }
+		  this.getvipMoney()
 		  let totalMoney =0
 		  if(this.Vipmoney.canReduceFlag=='1'){
-			  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
+		  			  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
 		  }else{
-			  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
+		  			  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
 		  }
 		  
-		  
-		  
 		  if (totalMoney <= 0) {
 		  	this.totalPrice12 = 0.01
 		  } else {
@@ -541,6 +540,18 @@ export default {
 				console.log(res, '会员立减')
 				if (res.code == 0 && res.data) {
 					this.Vipmoney=res.data
+					let totalMoney =0
+					if(this.Vipmoney.canReduceFlag=='1'){
+								  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
+					}else{
+								  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
+					}
+					if (totalMoney <= 0) {
+						this.totalPrice12 = 0.01
+					} else {
+						this.totalPrice12 = totalMoney
+					}
+					this.getCouponList()
 				}
 			})
 		},
@@ -810,6 +821,7 @@ export default {
 					this.getOrderList()
 					// this.getQishou()
 				}
+				
 			})
 		},
 		goBack() {
@@ -863,13 +875,19 @@ export default {
 			}
 
 			if (this.orderType == 2) {
+				this.packType=1
+				this.ispackType =false
 				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
+				this.getvipMoney()
 			} else {
+				this.packType=1
+				this.ispackType =false
 				if(this.packType==1){
 					this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 				}else{
 					this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
 				}
+				this.getvipMoney()
 			}
 			let totalMoney =0
 			if(this.Vipmoney.canReduceFlag=='1'){
@@ -1026,15 +1044,20 @@ export default {
 		// 获取优惠券列表
 		getCouponList() {
 			console.log(this.totalPrice)
-			console.log(this.dataList.packMoney)
+			console.log(this.dataList.shopId)
+			let minMoney =
+				this.orderType == 2
+					? parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
+					: parseFloat(this.totalPrice).toFixed(2)
 			let data = {
 				shopId: this.dataList.shopId,
 				page: 1,
 				limit: 20,
-				minMoney:
-					this.orderType == 2 ? parseFloat(this.totalPrice * 1).toFixed(2) * 1 + this.paotuiMoney * 1 + this.dabaoMoney * 1 : parseFloat(this.totalPrice * 1).toFixed(2)
+				minMoney:minMoney
+					
 			}
 			this.$Request.get('/app/coupon/selectUserCouponList', data).then((res) => {
+				console.log(res,'优惠券')
 				if (res.code == 0) {
 					this.couponList = res.data.list
 					if (this.coupon) {
@@ -1189,26 +1212,26 @@ export default {
 							this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
 						}
 					}
+					this.getvipMoney()
+					// let totalMoney =0
+					// if(this.Vipmoney.canReduceFlag=='1'){
+					// 			  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
+					// }else{
+					// 			  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
+					// }
 					
+					// if (totalMoney <= 0) {
+					// 	this.totalPrice12 = 0.01
+					// } else {
+					// 	this.totalPrice12 = totalMoney
+					// }
 					console.log(this.dataList)
 
-					this.getvipMoney()
+					// this.getvipMoney()
 					this.getCouponList()
 					this.getHuoList()
 					this.detCoupon()
 					this.getDistance()
-					let totalMoney =0
-					if(this.Vipmoney.canReduceFlag=='1'){
-								  totalMoney = parseFloat(this.totalPrice1 -(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
-					}else{
-								  totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2) 
-					}
-					
-					if (totalMoney <= 0) {
-						this.totalPrice12 = 0.01
-					} else {
-						this.totalPrice12 = totalMoney
-					}
 					
 				}
 			})