Browse Source

Merge branch 'master' of ssh://git.9026.com:2212/gubai/IHG

gubai 2 năm trước cách đây
mục cha
commit
1e4f536fb1

+ 151 - 0
components/dialogPanel/dialogPanel.vue

xqd
@@ -0,0 +1,151 @@
+<template>
+	<uni-popup ref="main" type="center">
+		<view class="pop">
+			<view class="title"><text>识别下方二维码即可购买</text></view>
+			<view style="margin-left:30rpx;width: 580rpx;height: 2rpx;background: #F0F0F0;"></view>
+			<view class="img">
+				<image :src="imgUrl" mode="aspectFit"/>
+			</view>
+			<view class="btn">
+				<view class="cancel" @click="$refs.main.close()"><text>取消</text></view>
+				<view class="download" @click="saveImg"><text>保存图片</text></view>
+			</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script>
+	export default{
+		name: "dialog-panel",
+		data(){
+			return {
+				imgUrl:""
+			}
+		},
+		methods:{
+			show(arg){
+				this.imgUrl = arg
+				this.$refs.main.open()
+			},
+			saveImg(){
+				uni.getImageInfo({
+					src: this.imgUrl,
+					success:(res)=>{
+						uni.saveImageToPhotosAlbum({
+							filePath: res.path,
+							success(_) {
+								uni.showToast({
+									title: '已保存到相册',
+									icon: 'success',
+									duration: 2000
+								})
+							},
+							fail(err){
+								console.log(err)
+							}
+						})
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	$pageColor:#F9F9F9;
+	$bgColor:#FFFFFF;
+	@mixin flexlayout {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	.pop {
+		width: 640rpx;
+		height: 740rpx;
+		background: #FFFFFF;
+		border-radius: 20rpx;
+		padding-top: 32rpx;
+		box-sizing: border-box;
+	
+		.title {
+			@include flexlayout();
+			margin-bottom: 32rpx;
+	
+			text {
+				font-size: 34rpx;
+				font-family: PingFangSC-Medium, PingFang SC;
+				font-weight: 500;
+				color: #000;
+			}
+		}
+	
+		.img {
+			margin-left: 48rpx;
+			width: 544rpx;
+			height: 484rpx;
+			background: $bgColor;
+			border-radius: 12rpx;
+			@include flexlayout();
+			margin-bottom: 32rpx;
+	
+			image {
+				width: 420rpx;
+				height: 440rpx;
+				border-radius: 12rpx;
+			}
+		}
+	
+		.textfont {
+			margin-left: 30rpx;
+			margin-bottom: 40rpx;
+			@include flexlayout();
+			width: 572rpx;
+			height: 106rpx;
+	
+			text {
+				text-align: center;
+				font-size: 34rpx;
+				font-weight: 400;
+				color: #828282;
+			}
+		}
+	
+		.btn {
+			width: 100%;
+			height: 110rpx;
+			display: flex;
+			align-items: center;
+	
+			.cancel {
+				@include flexlayout();
+				width: 50%;
+				height: 100%;
+				border-top: #E5E5E5 solid 1rpx;
+				border-right: #E5E5E5 solid 1rpx;
+	
+				text {
+					font-size: 32rpx;
+					font-family: PingFangSC-Medium, PingFang SC;
+					font-weight: 500;
+					color: #666666;
+				}
+			}
+	
+			.download {
+				border-top: #E5E5E5 solid 1rpx;
+				// border-left:#E5E5E5 solid 0.3rpx;
+				@include flexlayout();
+				height: 100%;
+				width: 50%;
+	
+				text {
+					font-size: 32rpx;
+					font-family: PingFangSC-Medium, PingFang SC;
+					font-weight: 500;
+					color: #FF7119;
+				}
+			}
+		}
+	}
+	
+</style>

+ 1 - 1
manifest.json

xqd
@@ -1,6 +1,6 @@
 {
     "name" : "hotel_uni",
-    "appid" : "__UNI__807A871",
+    "appid" : "__UNI__9140D70",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 2 - 2
pages/goods/goods-detail/index.vue

xqd xqd
@@ -378,6 +378,7 @@
 			},
 			// 获取商品详情
 			getProductDetail(product_id, init = false) {
+				this.$store.commit("tab/SET_SELECTEDHOTELId", 0)
 				this.$api.product.getProductDetail({
 					product_id: product_id
 				}).then(res => {
@@ -551,8 +552,7 @@
 		},
 		watch: {
 			selectedHotelId(newValue) {
-				console.log(newValue)
-				this.getHotelDetail(newValue);
+				newValue && this.getHotelDetail(newValue);
 			}
 		}
 	}

+ 51 - 13
pages/index/vote-detail/index.vue

xqd xqd xqd xqd xqd
@@ -150,14 +150,27 @@
 			</view>
 		</uni-popup>
 		
-		<Poster :activity_project_id='activity_project_id'  ref="poster" :name="voteDetail.project_name" :title="voteDetail.activity.title"/>
-		
+		<Poster :activity_project_id='activity_project_id'  ref="poster" :name="voteDetail.project_name" :title="voteDetail.activity.title"/>
+		<!-- 弹出层/核销码 -->
+		<uni-popup ref="dialogPanel" type="center">
+			<view class="pop">
+				<view class="title"><text>识别下方二维码即可购买</text></view>
+				<view style="margin-left:30rpx;width: 580rpx;height: 2rpx;background: #F0F0F0;"></view>
+				<view class="img">
+					<image :src="jump_config" mode="aspectFit"/>
+				</view>
+				<view class="btn">
+					<view class="cancel" @click="$refs.dialogPanel.close()"><text>取消</text></view>
+					<view class="download" @click="saveImg"><text>保存图片</text></view>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
 	// import HchPoster from "@/components/hch-poster/hch-poster.vue"
-	import Poster from "./poster.vue";
+	import Poster from "./poster.vue";
 	
 	export default {
 		components:{Poster},
@@ -192,7 +205,7 @@
 				resource_type: '',
 				//跳转h5和小程序
 				jump_type: '',
-				jump_config: '',
+				jump_config: 'https://zhengda.oss-cn-chengdu.aliyuncs.com/ihg/images/微信截图_20221219162756.png',
 				//跳转vip小程序获得投票数
 				vipRewardTicketNum: '',
 				//活动id
@@ -363,11 +376,16 @@
 			},
 
 			//轮播图跳转h5或者小程序和内部页面
-			goSwiperSmall() {
-				this.$utils.jump({
-					jump_type: this.jump_type,
-					jump_config: this.jump_config
-				})
+			goSwiperSmall() {
+				if(this.jump_type==3 && this.jump_config.substr(0, 7) != '/pages/'){
+					console.log(this.jump_config)
+					this.$refs.dialogPanel.open()
+				}else{
+					this.$utils.jump({
+						jump_type: this.jump_type,
+						jump_config: this.jump_config
+					})
+				}
 			},
 			cancelTime(i, j) {
 				let nowtime = new Date() //获取当前时间
@@ -581,6 +599,26 @@
 					qrcodeUrl: this.voteDetail.qrcode_url,
 				})
 				console.log(this.voteDetail)
+			},
+			saveImg(){
+				uni.getImageInfo({
+					src: this.jump_config,
+					success:(res)=>{
+						uni.saveImageToPhotosAlbum({
+							filePath: res.path,
+							success(_) {
+								uni.showToast({
+									title: '已保存到相册',
+									icon: 'success',
+									duration: 2000
+								})
+							},
+							fail(err){
+								console.log(err)
+							}
+						})
+					}
+				})
 			}
 		}
 	}
@@ -818,22 +856,22 @@
 				font-size: 34rpx;
 				font-family: PingFangSC-Medium, PingFang SC;
 				font-weight: 500;
-				color: #FF7119;
+				color: #000;
 			}
 		}
 
 		.img {
 			margin-left: 48rpx;
 			width: 544rpx;
-			height: 306rpx;
+			height: 440rpx;
 			background: $bgColor;
 			border-radius: 12rpx;
 			@include flexlayout();
 			margin-bottom: 32rpx;
 
 			image {
-				width: 544rpx;
-				height: 306rpx;
+				width: 420rpx;
+				height: 440rpx;
 				border-radius: 12rpx;
 			}
 		}

+ 17 - 5
pages/map/map.vue

xqd xqd xqd
@@ -178,6 +178,8 @@
 		</view>
 		<view style="height: 110rpx;"></view>
 		<tab-bar></tab-bar>
+		<!-- 弹出层/核销码 -->
+		<dialogPanel ref="dialogPanel"/>
 	</view>
 </template>
 
@@ -186,12 +188,14 @@
 	import HchPosition from '../../components/hch-position/hch-position.vue'
 	import MyNav from "@/components/my-nav/my-nav.vue"
 	import scrollHotel from "./scrollHotel.vue"
+	import dialogPanel from "@/components/dialogPanel/dialogPanel.vue"
 	export default {
 		components: {
 			TabBar,
 			HchPosition,
 			MyNav,
-			scrollHotel
+			scrollHotel,
+			dialogPanel
 		},
 		data() {
 			return {
@@ -484,10 +488,18 @@
 					return;
 				}
 				const hotel = this.hotelList[index];
-
-				uni.navigateTo({
-					url: `/pages/map/hotel-book/index?hotel_id=${hotel.id}&latitude=${hotel.latitude}&longitude=${hotel.longitude}&name=${hotel.name}&address=${hotel.address}`
-				})
+				if(hotel.buy_jump_type == 1 || hotel.buy_jump_type == 2){
+					this.$utils.jump({
+						jump_type: hotel.buy_jump_type,
+						jump_config: hotel.buy_jump_config
+					})
+				}else if(hotel.buy_jump_type == 3){
+					this.$refs.dialogPanel.show(hotel.buy_jump_config);
+				}else if(hotel.buy_jump_type == 4){
+					uni.navigateTo({
+						url: `/pages/map/hotel-book/index?hotel_id=${hotel.id}&latitude=${hotel.latitude}&longitude=${hotel.longitude}&name=${hotel.name}&address=${hotel.address}`
+					})
+				}
 			},
 			//返回上一级
 			returnBtn() {