Browse Source

投票页跳转图片

yfso 3 năm trước cách đây
mục cha
commit
e88090ca61
3 tập tin đã thay đổi với 86 bổ sung14 xóa
  1. 34 0
      components/dialogPanel/dialogPanel.vue
  2. 1 1
      manifest.json
  3. 51 13
      pages/index/vote-detail/index.vue

+ 34 - 0
components/dialogPanel/dialogPanel.vue

xqd
@@ -0,0 +1,34 @@
+<template>
+	<view class="dialog-panel" v-if="isShow">
+		对话框
+	</view>
+</template>
+
+<script>
+	export default{
+		name: "dialog-panel",
+		data(){
+			return {
+				isShow:false
+			}
+		},
+		methods:{
+			show(){
+				this.isShow = true
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.dialog-panel{
+		position: fixed;
+		z-index: 13;
+		top:0;left: 0;right:0;bottom:0;
+		margin: auto;
+		width: 600rpx;
+		height: 650rpx;
+		background-color: #fff;
+		border-radius: 20rpx;
+	}
+</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",

+ 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},
@@ -183,7 +196,7 @@
 				resource_type: '',
 				//跳转h5和小程序
 				jump_type: '',
-				jump_config: '',
+				jump_config: 'https://zhengda.oss-cn-chengdu.aliyuncs.com/ihg/images/微信截图_20221219162756.png',
 				//跳转vip小程序获得投票数
 				vipRewardTicketNum: '',
 				//活动id
@@ -339,11 +352,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() //获取当前时间
@@ -479,6 +497,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)
+							}
+						})
+					}
+				})
 			}
 		}
 	}
@@ -716,22 +754,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;
 			}
 		}