1
0

2 コミット 7fd462fa3e ... 9a8d4d94c1

作者 SHA1 メッセージ 日付
  gubai 9a8d4d94c1 项目日志: 12.15 合并 2 年 前
  gubai a3c006f8e2 项目日志: 12.15 积分兑换 2 年 前

+ 14 - 1
api/my/my.js

xqd xqd
@@ -87,6 +87,18 @@ export function delMessage(data) {
 	)
 }
 
+
+//用户访问
+export function userVisits(data) {
+	return request.post(
+		`users/visits`,
+		data
+	)
+}
+
+
+
+
 export default {
 	allRegion,
 	myLogin,
@@ -98,5 +110,6 @@ export default {
 	userInfo,
 	userMemberAdd,
 	UserUploadFile,
-	delMessage
+	delMessage,
+	userVisits
 }

+ 1 - 1
manifest.json

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

+ 3 - 2
pages.json

xqd xqd xqd
@@ -1,7 +1,6 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 
-
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -10,6 +9,7 @@
 				"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
+
 		{
 			"path": "pages/index/active-list/index",
 			"style": {
@@ -266,8 +266,9 @@
 				"navigationBarTitleText": "兑换详情",
 				"enablePullDownRefresh": false
 			}
-
+		
 		},
+
 		{
 			"path": "pages/my/Kudos/Kudos",
 			"style": {

+ 10 - 4
pages/goods/goods-detail/index.vue

xqd xqd
@@ -97,7 +97,7 @@
 			<view class="buy-btn-right" @click="$refs.codePurchase.open()" v-if="produceType==1">
 				<text>立即购买</text>
 			</view>
-			<view v-if="produceType==2" class="buy-btn-right" @click="goProductChange(product_id)">
+			<view v-if="produceType==2" class="buy-btn-right" @click="goProductChange(product_id,flavorIsActive)">
 				<text>立即兑换</text>
 			</view>
 		</view>
@@ -400,10 +400,16 @@
 				this.current1 = e.detail.current;
 			},
 			//积分兑换
-			goProductChange(id){
-				uni.navigateTo({
-					url:'/pages/my/integral/integralOrder?product_id='+id
+			goProductChange(id,flavorIsActive){
+				console.log(flavorIsActive,'------flavorIsActive');
+				let arr = []
+				Object.keys(flavorIsActive).forEach(key =>{
+					arr.push(flavorIsActive[key])
 				})
+				console.log(arr);
+				// uni.navigateTo({
+				// 	url:'/pages/my/integral/integralOrder?product_id='+id
+				// })
 			},
 			// 跳转积分兑换
 			goIntegralOrder(id){

+ 1 - 0
pages/goods/goods.vue

xqd
@@ -248,6 +248,7 @@
 				box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.04);
 				border-radius: 12rpx;
 				margin-bottom: 26rpx;
+				overflow: hidden;
 
 				.home-hotel-img-content-item-img {
 					width: 332rpx;

+ 2 - 1
pages/index/index.scss

xqd xqd
@@ -194,7 +194,7 @@
 	.home-banner {
 		height: 640rpx;
 		padding: 0 30rpx;
-		padding-top: 64rpx;
+		padding-top: 40rpx;
 
 		.home-banner-img {
 			position: relative;
@@ -265,6 +265,7 @@
 				box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.04);
 				border-radius: 12rpx;
 				margin-bottom: 26rpx;
+				overflow: hidden;
 				// &:nth-child(2n+1){
 				// 	// position: relative;
 				// 	top: -33px;

+ 90 - 87
pages/index/index.vue

xqd xqd xqd xqd xqd xqd
@@ -98,7 +98,7 @@
 
 		<movable-area class="movableArea">
 			<movable-view class="movableView" direction="all" x="630rpx" y="700rpx">
-				<view class="img-IHg" @click="$utils.jumpJoinVip()">
+				<view class="img-IHg" @click="goJoin()">
 					<image style="width: 64rpx; height: 58rpx; " src="/static/icon/vip.png" mode=""></image>
 				</view>
 			</movable-view>
@@ -126,14 +126,6 @@
 		<!-- 酒店推荐图片 -->
 		<view class="home-hotel-img">
 			<view class="home-hotel-img-content">
-				<!-- <view @click="produceDetail(item.id)" class="home-hotel-img-content-item" v-for="(item,index) in goodsList" :key="index"
-					:style="{marginTop:item.marginTop || 0 }">
-					<image class="home-hotel-img-content-item-img"
-						:class="item.short?'home-hotel-img-content-item-img': 'homel-hotel-img-content-item-img-long' "
-						:src="item.cover_img" mode=""></image>
-					<view class="text">
-						<text class="text-top">{{item.name}}</text>
-				</view> -->
 				<view  class="home-hotel-img-content-item" v-for="(item,index) in goodsList" :key="index"
 					:style="{marginTop:item.marginTop || 0 }" 
 					@click="goToProduct(item.id)">
@@ -323,6 +315,9 @@
 		onLoad() {
 			this.getGoodsList()
 			this.getAllSet()
+			
+			//用户访问
+			this.getUserVisits()
 		},
 		methods: {
 			// **************** Data ***************//
@@ -521,51 +516,27 @@
 					}
 				})
 			},	
-			//跳转方法
-			jumpHAppID(id, urls) {
-				if (id == 1) {
-					const url = urls; // 跳转的外链
-					const navtitle = 'H5'; // 这个标题是你自己可以设置的
-					uni.navigateTo({
-						// 跳转到webview页面
-						url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
-						success: () => {
-							console.log('成功')
-						},
-						fail: (e) => {
-							console.log(e, "失败")
-						}
-					});
-				} else if (id == 2) {
-					let obj = JSON.parse(urls);
-					wx.navigateToMiniProgram({
-						appId: `${obj.appid}`, //appid
-						path: `${obj.path}`, //path
-						extraData: { //参数
-							foo: 'bar'
-						},
-						// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
-						success(res) {
-							console.log('成功')
-							// 打开成功
-						},
-						fail(e) {
-							console.log(e, '失败')
-						}
-					})
-				} else if (id == 3) {
-					uni.redirectTo({
-						url: urls,
-						fail:(err)=>{
-							uni.reLaunch({
-								url: urls
-							})
-						}
-					})
+			
+			
+			//获取当前页面路径
+			getPageUrl() {
+				const pages = getCurrentPages();
+				console.log(pages,'--------->pages')
+				if(pages.length==1){
+					const currentPage = pages[0];
+					let pageUrl = `/${currentPage.route}`;
+					return pageUrl
+					console.log('当前页面url:', pageUrl);
+				}else{
+					const currentPage = pages[pages.length - 1];
+					let pageUrl = `/${currentPage.route}`;
+					return pageUrl
+					console.log('当前页面url:', pageUrl);
 				}
 			},
 			// 跳转其他小程序
 			goJoin() {
+				let _this = this
 				wx.navigateToMiniProgram({
 					appId: 'wx255b58f0992b3c53', //appid
 					path: 'newUIMain/enrollment/enrollment', //path
@@ -574,7 +545,21 @@
 					},
 					// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
 					success(res) {
-						console.log('成功')
+						let page = _this.getPageUrl()
+						let user_id = ''
+						if (_this.admin != null) {
+							user_id = _this.admin.id
+						} else {
+							user_id = 0
+						}
+						console.log('成功', page)
+						_this.$api.my.userMemberAdd({
+							user_id,
+							page,
+						}).then(res => {
+							console.log(res.data);
+						})
+			
 						// 打开成功
 					},
 					fail(e) {
@@ -582,43 +567,61 @@
 					}
 				})
 			},
-			// 跳转到h5页面
-			goH5() {
-				let inset = this.advertisInset[0].jump_type
-				let inserPath = this.advertisInset[0].jump_config
-				//跳转h5
-				if (inset == 1) {
-					const url = inserPath; // 跳转的外链
-					const navtitle = 'H5'; // 这个标题是你自己可以设置的
-					uni.navigateTo({
-						// 跳转到webview页面
-						url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
-						success: () => {
-							console.log('成功')
-						},
-						fail: (e) => {
-							console.log(e, "失败")
-						}
-					});
-				} else if (inset == 2) {
-					let obj = JSON.parse(inserPath);
-					wx.navigateToMiniProgram({
-						appId: `${obj.appid}`, //appid
-						path: `${obj.path}`, //path
-						extraData: { //参数
-							foo: 'bar'
-						},
-						// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
-						success(res) {
-							console.log('成功')
-							// 打开成功
-						},
-						fail(e) {
-							console.log(e, '失败')
-						}
-					})
-				}
+			
+			//用户访问
+			getUserVisits(){
+				this.$api.my.userVisits({
+					page:'/pages/index/index'
+				}).then(res=>{
+					console.log(res.data);
+				})
 			},
+			
+			
+			
+			//跳转方法
+			// jumpHAppID(id, urls) {
+			// 	if (id == 1) {
+			// 		const url = urls; // 跳转的外链
+			// 		const navtitle = 'H5'; // 这个标题是你自己可以设置的
+			// 		uni.navigateTo({
+			// 			// 跳转到webview页面
+			// 			url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
+			// 			success: () => {
+			// 				console.log('成功')
+			// 			},
+			// 			fail: (e) => {
+			// 				console.log(e, "失败")
+			// 			}
+			// 		});
+			// 	} else if (id == 2) {
+			// 		let obj = JSON.parse(urls);
+			// 		wx.navigateToMiniProgram({
+			// 			appId: `${obj.appid}`, //appid
+			// 			path: `${obj.path}`, //path
+			// 			extraData: { //参数
+			// 				foo: 'bar'
+			// 			},
+			// 			// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
+			// 			success(res) {
+			// 				console.log('成功')
+			// 				// 打开成功
+			// 			},
+			// 			fail(e) {
+			// 				console.log(e, '失败')
+			// 			}
+			// 		})
+			// 	} else if (id == 3) {
+			// 		uni.redirectTo({
+			// 			url: urls,
+			// 			fail:(err)=>{
+			// 				uni.reLaunch({
+			// 					url: urls
+			// 				})
+			// 			}
+			// 		})
+			// 	}
+			// },
 			goToProduct(id){
 				uni.navigateTo({
 					url:`/pages/goods/goods-detail/index?id=${id}&type=1`

+ 176 - 123
pages/map/map.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -7,7 +7,7 @@
 				<view class="search-loupe" @click="search.openId=search.openId==-2?0:-2">
 					<image style="width: 32rpx;height: 32rpx;" src="/static/icon/search02.png" mode=""></image>
 				</view>
-				<view class="search-area-all">
+				<view class="search-area-all">
 					<template v-for="(item, index) in search.content"  >
 						<view v-if="index<2" :class="search.openId!=item.id?'search-area':'search-areaClick'" 
 						:key="item.id" @click="openSelector(item.id)">
@@ -18,19 +18,19 @@
 							<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
 								mode="">
 							</image>
-						</view>
-					</template>
-					<view :class="search.openId!=-1?'search-area':'search-areaClick'" @click="openSelector(-1)">
-						<text>更多筛选</text>
-						<image v-if="search.openId!=-1" style="width: 16rpx;height: 10rpx;" src="/static/icon/down01.png"
-							mode="">
-						</image>
-						<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
-							mode="">
-						</image>
+						</view>
+					</template>
+					<view :class="search.openId!=-1?'search-area':'search-areaClick'" @click="openSelector(-1)">
+						<text>更多筛选</text>
+						<image v-if="search.openId!=-1" style="width: 16rpx;height: 10rpx;" src="/static/icon/down01.png"
+							mode="">
+						</image>
+						<image v-else style="width: 16rpx;height: 10rpx;" src="/static/icon/up01.png"
+							mode="">
+						</image>
 					</view>
 				</view>
-				<image style=" flex: none; width: 52rpx;height: 46rpx;" src="/static/icon/vip.png" mode=""></image>
+				<image @click="goJoin"  style=" flex: none; width: 52rpx;height: 46rpx;" src="/static/icon/vip.png" mode=""></image>
 			</view>
 			<view class="search-detail" style="z-index:9" v-if="search.openId==-2">
 				<u-input placeholder="输入酒店/城市名称搜索酒店" border='none' :value="search.text" @input="syncSearchInput">
@@ -68,7 +68,7 @@
 		
 			<!-- 筛选-->
 			<view class="search-detail" style="z-index: 9;" v-if="search.openId==-1">
-				<view class="partner">
+				<view class="partner">
 					<template v-for="(item,index) in search.content">
 						<view class="partner-top" v-if="index >= 2" @click="search.partner=item.id==search.partner?0:item.id" :key="item.id">
 							<text>{{item.name}}</text>
@@ -78,8 +78,8 @@
 								mode=""></image>
 						</view>
 						<view class="partner-main" v-if="search.partner==item.id">
-							<uni-data-checkbox multiple 
-								:value="search.selected"
+							<uni-data-checkbox multiple 
+								:value="search.selected"
 								@input="syncSelected"
 								:localdata="item.sub"
 								emptyText="无"
@@ -91,6 +91,7 @@
 						<view class="search-detail-btn-left" @click="cancelSearch">
 							<text>取消</text>
 						</view>
+
 						<view class="search-detail-btn-right" @click="confirmSearch">
 							<text>确认</text>
 						</view>
@@ -136,11 +137,11 @@
 						<view class="inner">
 							<view class="address-detail-main">
 								<view class="address-detail-main-left">
-									<text class="title">{{item.name}}</text>
-									<view class="content" :style="{opacity: item.label?1:0}">
-										<template v-if="item.label">
-											<text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
-										</template>
+									<text class="title">{{item.name}}</text>
+									<view class="content" :style="{opacity: item.label?1:0}">
+										<template v-if="item.label">
+											<text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
+										</template>
 									</view>
 									<view class="bottom" :style="{opacity: item.min_price?1:0}">
 										<text class="bottom-left">¥</text>
@@ -181,10 +182,10 @@
 						<view class="address-detail-main">
 							<view class="address-detail-main-left">
 								<text class="title">{{item.name}}</text>
-								<view class="content" :style="{opacity: item.label?1:0}">
-									<template v-if="item.label">
-										<text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
-									</template>
+								<view class="content" :style="{opacity: item.label?1:0}">
+									<template v-if="item.label">
+										<text v-for="(v,k) in item.label.split(',')" :key="k">{{v}}</text>
+									</template>
 								</view>
 								<view class="bottom"  :style="{opacity: item.min_price?1:0}">
 									<text class="bottom-left">¥</text>
@@ -254,8 +255,8 @@
 					openId:0,
 					isSearch:false,
 					selected:[],
-					currentSelected:[],
-					partner:0,
+					currentSelected:[],
+					partner:0,
 					checkedselected:[],
 				},
 				areaList: [],
@@ -285,6 +286,9 @@
 				}
 			}
 		},
+		onShow() {
+			this.admin = this.$store.getters.userInfo
+		},
 		onLoad(e) {
 			const {hotel_id,category_ids} = e;
 			this.beginConfig.hotel_id = hotel_id;
@@ -300,32 +304,32 @@
 				}
 			})
 		},
-		methods: {
-			syncSearchInput(e){
-				this.search.text = e
-			},
-			syncSelected(e){
-				if(this.search.checkedselected.length > e.length){
-					const resArr = this.$utils.arrayDiff(this.search.checkedselected, e)
-					const tempSet = new Set(this.search.selected);
-					resArr.forEach(i=>{
-						tempSet.delete(i)
-					})
-					this.search.selected = Array.from(tempSet);
-				}else{
-					this.search.selected = Array.from(new Set([...this.search.selected, ...e]));
-				}		
-				this.search.checkedselected = e;
-				console.log(this.search.selected)
-			},
-			checked(id) {
-				if(this.search.selected.includes(id)){
-					const tempSet = new Set(this.search.selected)
-					tempSet.delete(id)
-					this.search.selected = Array.from(tempSet)
-				}else{
-					this.search.selected.push(id)
-				}
+		methods: {
+			syncSearchInput(e){
+				this.search.text = e
+			},
+			syncSelected(e){
+				if(this.search.checkedselected.length > e.length){
+					const resArr = this.$utils.arrayDiff(this.search.checkedselected, e)
+					const tempSet = new Set(this.search.selected);
+					resArr.forEach(i=>{
+						tempSet.delete(i)
+					})
+					this.search.selected = Array.from(tempSet);
+				}else{
+					this.search.selected = Array.from(new Set([...this.search.selected, ...e]));
+				}		
+				this.search.checkedselected = e;
+				console.log(this.search.selected)
+			},
+			checked(id) {
+				if(this.search.selected.includes(id)){
+					const tempSet = new Set(this.search.selected)
+					tempSet.delete(id)
+					this.search.selected = Array.from(tempSet)
+				}else{
+					this.search.selected.push(id)
+				}
 			},
 			confirmSearch(){
 				this.search.currentSelected = Object.assign(this.search.selected);
@@ -395,51 +399,51 @@
 			  return s;
 			},
 			//-------------------------------------
-			requestHotelPage(tempobj){
-				tempobj.page = tempobj.page + 1;
-				this.$api.hotel.getHotelList({
-					...tempobj,
-				}).then(res => {
-					const tempHotelList = res.data.data.map(item=>{
-						item.logo = this.$utils.toHttps(item.logo);
-						return {
-							...item, 
-							marker:{
-								id:item.id,
-								latitude: item.latitude,
-								longitude: item.longitude,
-								width:'34rpx',
-								height:'40rpx',
-								iconPath:'../../static/icon/late02.png' ,
-								active: {
-									width: '90rpx',
-									height: '100rpx',
-									iconPath: item.logo,
-								},
-								noActive:{
-									width:'34rpx',
-									height:'40rpx',
-									iconPath:'../../static/icon/late02.png' ,
-								},
-								callout1: {
-									content:item.name,
-									borderRadius: 10,
-									padding: 10,
-									display: "ALWAYS",
-								},
-							}
-						}
-						this.hotelList.map(item=>{
-							item.distanceToMe=this.space(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
-							return item;
-						})
-						
-					})
-					this.hotelList.push(...tempHotelList)
-					if(res.data.data.length >= 15){
-						this.requestHotelPage(tempobj);
-					}
-				})
+			requestHotelPage(tempobj){
+				tempobj.page = tempobj.page + 1;
+				this.$api.hotel.getHotelList({
+					...tempobj,
+				}).then(res => {
+					const tempHotelList = res.data.data.map(item=>{
+						item.logo = this.$utils.toHttps(item.logo);
+						return {
+							...item, 
+							marker:{
+								id:item.id,
+								latitude: item.latitude,
+								longitude: item.longitude,
+								width:'34rpx',
+								height:'40rpx',
+								iconPath:'../../static/icon/late02.png' ,
+								active: {
+									width: '90rpx',
+									height: '100rpx',
+									iconPath: item.logo,
+								},
+								noActive:{
+									width:'34rpx',
+									height:'40rpx',
+									iconPath:'../../static/icon/late02.png' ,
+								},
+								callout1: {
+									content:item.name,
+									borderRadius: 10,
+									padding: 10,
+									display: "ALWAYS",
+								},
+							}
+						}
+						this.hotelList.map(item=>{
+							item.distanceToMe=this.space(this.latitude,this.longitude,item.latitude,item.longitude).toFixed(1);
+							return item;
+						})
+						
+					})
+					this.hotelList.push(...tempHotelList)
+					if(res.data.data.length >= 15){
+						this.requestHotelPage(tempobj);
+					}
+				})
 			},
 			getList(islocal = false) {
 				const tempobj = {type: 1,page: 1,};
@@ -447,13 +451,13 @@
 					this.search.currentSelected.forEach((item,index) => {
 						tempobj[`category_ids[${index}]`] = item
 					})
-				}
-				if(this.latitude&&this.longitude){
-					tempobj['latitude'] = this.latitude;
-					tempobj['longitude'] = this.longitude;
-				}
-				if(this.search.text){
-					tempobj['name'] = this.search.text;
+				}
+				if(this.latitude&&this.longitude){
+					tempobj['latitude'] = this.latitude;
+					tempobj['longitude'] = this.longitude;
+				}
+				if(this.search.text){
+					tempobj['name'] = this.search.text;
 				}
 				this.$api.hotel.getHotelList({
 					...tempobj,
@@ -495,23 +499,23 @@
 					})	
 					// this.hotelList.sort((prev,next)=>{
 					// 	return prev.distanceToMe-next.distanceToMe;
-					// })
-					if(islocal){
-						this.$refs.map.goLocation(this.latitude,this.longitude)
-					}
-					setTimeout(()=>{
-						if(!this.beginConfig.hotel_id){
-							this.$refs.map.markertap({markerId: this.hotelList[0].id},true,this.search.isSearch)
-							this.beginConfig.hotel_id = 0
-							this.search.isSearch = false
-						}else{	
-							this.localToMark(this.beginConfig.hotel_id);
-							// this.$refs.map.markertap({markerId: this.beginConfig.hotel_id})	
-							this.beginConfig.hotel_id = 0
-						}
-					}, 300)
-					if(res.data.data.length >= 15){
-						this.requestHotelPage(tempobj)
+					// })
+					if(islocal){
+						this.$refs.map.goLocation(this.latitude,this.longitude)
+					}
+					setTimeout(()=>{
+						if(!this.beginConfig.hotel_id){
+							this.$refs.map.markertap({markerId: this.hotelList[0].id},true,this.search.isSearch)
+							this.beginConfig.hotel_id = 0
+							this.search.isSearch = false
+						}else{	
+							this.localToMark(this.beginConfig.hotel_id);
+							// this.$refs.map.markertap({markerId: this.beginConfig.hotel_id})	
+							this.beginConfig.hotel_id = 0
+						}
+					}, 300)
+					if(res.data.data.length >= 15){
+						this.requestHotelPage(tempobj)
 					}
 				})
 			},
@@ -596,8 +600,57 @@
 				setTimeout(()=>{
 					this.scrollData.spa = false;
 				}, 10)
-			}
-		},
+			},
+			//获取当前页面路径
+			getPageUrl() {
+				const pages = getCurrentPages();
+				console.log(pages,'--------->pages')
+				if(pages.length==1){
+					const currentPage = pages[0];
+					let pageUrl = `/${currentPage.route}`;
+					return pageUrl
+					console.log('当前页面url:', pageUrl);
+				}else{
+					const currentPage = pages[pages.length - 1];
+					let pageUrl = `/${currentPage.route}`;
+					return pageUrl
+					console.log('当前页面url:', pageUrl);
+				}
+			},
+			// 跳转其他小程序
+			goJoin() {
+				let _this = this
+				wx.navigateToMiniProgram({
+					appId: 'wx255b58f0992b3c53', //appid
+					path: 'newUIMain/enrollment/enrollment', //path
+					extraData: { //参数
+						foo: 'bar'
+					},
+					// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
+					success(res) {
+						let page = _this.getPageUrl()
+						let user_id = ''
+						if (_this.admin != null) {
+							user_id = _this.admin.id
+						} else {
+							user_id = 0
+						}
+						console.log('成功', page)
+						_this.$api.my.userMemberAdd({
+							user_id,
+							page,
+						}).then(res => {
+							console.log(res.data);
+						})
+			
+						// 打开成功
+					},
+					fail(e) {
+						console.log(e, '失败')
+					}
+				})
+			},
+		}
 	}
 </script>
 

+ 15 - 1
pages/msg/msg.vue

xqd xqd
@@ -17,7 +17,7 @@
 
 		<!-- 消息列表 -->
 		<view class="msgListBox">
-			<view class="childBox" v-for="(item,index) in messageList" :key="index" >
+			<view class="childBox" v-for="(item,index) in messageList" :key="index"  @click="jumpPage(item.type,item.relation_id)" >
 				<view class="childBox-top" >{{item.title}}</view>
 				<view  class="childBox-content" >
 					<text>{{item.content}}</text>
@@ -94,6 +94,20 @@
 			this.getMessageList()
 		},
 		methods: {
+			
+			//跳转消息详情页面
+			jumpPage(type,id){
+				if(type>2){
+					uni.navigateTo({
+						url:'/pages/my/prize/prize'
+					})
+				}else{
+					uni.navigateTo({
+						url:'/pages/index/active-detail/index?id='+id
+					})
+				}
+			},
+			
 			// 搜索防抖
 			searchText:util.debounce(function(){
 				if(this.search !=''){

+ 2 - 1
pages/my/integral/integral.vue

xqd xqd
@@ -47,7 +47,7 @@
 							:src="item.cover_img" mode=""></image>
 						<view class="text">
 							<text class="text-top">{{item.name}}</text>
-							<text class="text-main">{{item.hotel.name}}</text>
+							<!-- <text class="text-main">{{item.hotel.name}}</text> -->
 						</view>
 					</view>
 				
@@ -265,6 +265,7 @@
 						box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.04);
 						border-radius: 12rpx;
 						margin-bottom: 26rpx;
+						overflow: hidden;
 			
 						.home-hotel-img-content-item-img {
 							width: 332rpx;

+ 5 - 1
pages/my/myorders/orderDetail.vue

xqd xqd xqd
@@ -3,10 +3,12 @@
 		<!-- 标题栏 -->
 		<view class="nav">
 			<view class="orderStatus" v-if="status == 2 && is_virtual == 0">待发货</view>
-			<view class="orderStatus" v-if="status == 3 && is_virtual == 0">待收货</view>
+			<view class="orderStatus" v-if="status == 3 && is_virtual == 0 && express_type == 1">待收货</view>
 			<view class="orderStatus" v-if="status == 3 && is_virtual == 1">待核销</view>
+			<view class="orderStatus" v-if="status == 3 && is_virtual == 0 && express_type == 2">待核销</view>
 			<view class="orderStatus" v-if="status == 4 && is_virtual == 0">已完成</view>
 			<view class="orderStatus" v-if="status == 4 && is_virtual == 1">已核销</view>
+			<view class="orderStatus" v-if="status == 4 && is_virtual == 0 && express_type == 2 ">已核销</view>
 		</view>
 
 		<view class="midBox">
@@ -131,6 +133,7 @@
 				status: '',
 				//实物:0虚拟奖品:1
 				is_virtual: '',
+				express_type: '',
 			}
 		},
 		onLoad(o) {
@@ -171,6 +174,7 @@
 				}).then(res => {
 					this.is_virtual = res.data.is_virtual
 					this.status = res.data.status
+					this.express_type = res.data.express_type
 					this.goodsDet = res.data
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
 						this.hotelDetail(this.goodsDet.hotel_id)

+ 9 - 4
pages/my/myorders/orders.vue

xqd xqd xqd
@@ -29,11 +29,13 @@
 					<view>订单号:{{item.order_no}}</view>
 
 					<view v-if="item.status == 1 && item.is_virtual == 0">待兑换</view>
-					<view v-if="item.status == 2 && item.is_virtual == 0">待发货</view>
-					<view v-if="item.status == 3 && item.is_virtual == 0">待收货</view>
+					<view v-if="item.status == 2 && item.is_virtual == 0 && item.express_type == 1">待发货</view>
+					<view v-if="item.status == 3 && item.is_virtual == 0 && item.express_type == 1">待收货</view>
 					<view v-if="item.status == 3 && item.is_virtual == 1">待核销</view>
-					<view v-if="item.status == 4 && item.is_virtual == 0">已完成</view>
+					<view v-if="item.status == 3 && item.is_virtual == 0 && item.express_type == 2">待核销</view>
+					<view v-if="item.status == 4 && item.is_virtual == 0 && item.express_type == 1" >已完成</view>
 					<view v-if="item.status == 4 && item.is_virtual == 1">已核销</view>
+					<view v-if="item.status == 4 && item.is_virtual == 0 && item.express_type == 2">已核销</view>
 				</view>
 				<view class="shopCard">
 					<image :src="item.img_urls"></image>
@@ -51,6 +53,9 @@
 					<view class="btnitem" @click.stop="openVFcode" v-if="item.status == 3 && item.is_virtual == 1">
 						<text>核销码</text>
 					</view>
+					<view class="btnitem" @click.stop="openVFcode" v-if="item.status == 3 && item.is_virtual == 0&&item.express_type == 2">
+						<text>核销码</text>
+					</view>
 					<view class="btnitem" v-if="item.status == 1">
 						<text>取消</text>
 					</view>
@@ -58,7 +63,7 @@
 						<text>兑换</text>
 					</view>
 					<view @click.stop="takeOver(item.id)" class="btnitem"
-						v-if="item.status == 3 && item.is_virtual == 0">
+						v-if="item.status == 3 && item.is_virtual == 0 && item.express_type == 1">
 						<text>确认收货</text>
 					</view>
 				</view>

+ 197 - 8
pages/my/prize/exchangeDetail.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -15,9 +15,22 @@
 			</view>
 		</view>
 		<!-- 加入会员 -->
-		<view class="bottomCard" @click="goOther">
-			<image src="/static/icon/Kudosbg.png"></image>
-			<view class="content">
+		<view class="bottomCard">
+			<!-- 广告图 -->
+			<view class="home-banner">
+				<view class="home-banner-img" v-if="in_page==3 && type == 1" @click="goOtherPage(jump_type,jump_config)">
+					<image style="width: 100%; height: 492rpx; border-radius: 12rpx;" :src="advData.img" mode="" ></image>
+				</view>
+				<view class="home-banner-img" v-if="in_page==3 && type == 2">
+					<image class="banner-img" v-if="!isOpenVideo" @click="openVideoPlay"
+						style="width: 100%; height: 492rpx; border-radius: 12rpx;" :src="videoCoverImg" mode=""></image>
+					<video class="baner-video" id="myVideo" ref="myVideo"
+						style="width: 100%; height: 492rpx;border-radius: 12rpx; " :src="videoSrc" controls
+						:enable-progress-gesture="false">
+					</video>
+				</view>
+			</view>
+			<view class="content" @click="goJoin">
 				<text>立即加入IHG会员</text>
 				<image src="/static/icon/right.png"></image>
 			</view>
@@ -30,11 +43,104 @@
 	export default {
 		data() {
 			return {
-
+				admin:'',
+				isOpenVideo:false,
+				jump_type:'',
+				jump_config:'',
+				advData:'',
+				advertis:'',
+				in_page:'',
+				type:'',
+				videoCoverImg:'',
+				videoSrc:''
 			}
 		},
+		onReady: function(res) {
+			this.videoContext = uni.createVideoContext('myVideo')
+		},
+		onLoad() {
+			this.getAdvertis()
+			this.admin = this.$store.getters.userInfo
+		},
 
 		methods: {
+			//广告图
+			getAdvertis(){
+				this.$api.document.allSet().then(res => {
+					this.advertis = res.data.advertises.filter(item => {
+						return item.in_page == 3
+					})
+					this.advData = this.advertis[0];
+					console.log(this.advData.img,'------>this.advData');
+					if (this.advertis[0].type == 1) {
+						this.in_page = 3
+						this.type = 1
+						this.jump_type= this.advData.jump_type
+						this.jump_config=this.advData.jump_config
+					} else if (this.advertis[0].type == 2) {
+						this.in_page = 3
+						this.type = 2
+						this.videoCoverImg = this.advertis[0].video_cover
+						this.videoSrc = this.advertis[0].video
+					}
+				})
+			},
+			//点击视频封面图片,播放视频
+			openVideoPlay() {
+				this.isOpenVideo = !this.isOpenVideo
+				this.videoContext.play()
+			},
+			
+			//跳转方法
+			jumpHAppID(id, urls) {
+				if (id == 1) {
+					const url = urls; // 跳转的外链
+					const navtitle = 'H5'; // 这个标题是你自己可以设置的
+					uni.navigateTo({
+						// 跳转到webview页面
+						url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
+						success: () => {
+							console.log('成功')
+						},
+						fail: (e) => {
+							console.log(e, "失败")
+						}
+					});
+				} else if (id == 2) {
+					let obj = JSON.parse(urls);
+					wx.navigateToMiniProgram({
+						appId: `${obj.appid}`, //appid
+						path: `${obj.path}`, //path
+						extraData: { //参数
+							foo: 'bar'
+						},
+						// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
+						success(res) {
+							console.log('成功')
+							// 打开成功
+						},
+						fail(e) {
+							console.log(e, '失败')
+						}
+					})
+				} else if (id == 3) {
+					uni.redirectTo({
+						url: urls,
+						fail:(err)=>{
+							uni.reLaunch({
+								url: urls
+							})
+						}
+					})
+				}
+			},
+			
+			//点击图片跳转
+			goOtherPage(id,url){
+				this.jumpHAppID(id,url)
+			},
+			
+			
 			// 返回首页
 			goBack() {
 				uni.reLaunch({
@@ -47,8 +153,25 @@
 					url: '/pages/my/myorders/orders'
 				})
 			},
+			//获取当前页面路径
+			getPageUrl() {
+				const pages = getCurrentPages();
+				console.log(pages,'--------->pages')
+				if(pages.length==1){
+					const currentPage = pages[0];
+					let pageUrl = `/${currentPage.route}`;
+					return pageUrl
+					console.log('当前页面url:', pageUrl);
+				}else{
+					const currentPage = pages[pages.length - 1];
+					let pageUrl = `/${currentPage.route}`;
+					return pageUrl
+					console.log('当前页面url:', pageUrl);
+				}
+			},
 			// 跳转其他小程序
-			goOther() {
+			goJoin() {
+				let _this = this
 				wx.navigateToMiniProgram({
 					appId: 'wx255b58f0992b3c53', //appid
 					path: 'newUIMain/enrollment/enrollment', //path
@@ -57,14 +180,28 @@
 					},
 					// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
 					success(res) {
-						console.log('成功')
+						let page = _this.getPageUrl()
+						let user_id = ''
+						if (_this.admin != null) {
+							user_id = _this.admin.id
+						} else {
+							user_id = 0
+						}
+						console.log('成功', page)
+						_this.$api.my.userMemberAdd({
+							user_id,
+							page,
+						}).then(res => {
+							console.log(res.data);
+						})
+			
 						// 打开成功
 					},
 					fail(e) {
 						console.log(e, '失败')
 					}
 				})
-			}
+			},
 		}
 	}
 </script>
@@ -152,6 +289,7 @@
 		background: $bgColor;
 		margin-left: 30rpx;
 		margin-top: 64rpx;
+		position: relative;
 
 		image {
 			width: 690rpx;
@@ -161,7 +299,8 @@
 		.content {
 			width: 690rpx;
 			height: 92rpx;
-			position: relative;
+			position: absolute;
+			bottom: 0;
 			margin-top:-9rpx;
 			border:1rpx solid;
 			@include flexlayout();
@@ -179,4 +318,54 @@
 			}
 		}
 	}
+	
+	
+	.home-banner {
+		// height: 640rpx;
+		// padding: 0 30rpx;
+		// padding-top: 64rpx;
+	
+		.home-banner-img {
+			position: relative;
+			width: 100%;
+	
+			// height: 100%;
+			.baner-video {
+				position: absolute;
+				top: 0;
+				left: 0;
+			}
+	
+			.banner-img {
+				position: absolute;
+				top: 0;
+				left: 0;
+				z-index: 9;
+			}
+	
+			.img-clean {
+				position: absolute;
+				right: 28rpx;
+				top: 30rpx;
+				z-index: 99;
+			}
+	
+			.img-IHg {
+				width: 84rpx;
+				height: 84rpx;
+				background-color: #fff;
+				box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
+				border-radius: 50%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				position: fixed;
+				top: 1030rpx;
+				right: 30rpx;
+				z-index: 99;
+	
+			}
+		}
+	}
+	
 </style>

+ 1 - 1
pages/my/prize/prize.vue

xqd
@@ -37,7 +37,7 @@
 					<view class="alreadyBtn" v-if="item.status == 2">
 						<text>已兑换</text>
 					</view>
-					<view class="instantBtn" v-if="item.status == 1" @click="goExchangePhy(item.id)">
+					<view class="instantBtn" v-if="item.status == 1" @click="goExchangeVir(item.id)">
 						<text>立即兑换</text>
 					</view>
 					<view class="instantBtn" v-if="item.status == 3" >

+ 66 - 48
pages/my/verification/orderVerification.vue

xqd xqd xqd xqd xqd
@@ -12,21 +12,7 @@
 				</uni-forms-item>
 				<uni-forms-item label="兑换时间" labelWidth="150rpx">
 					<uni-easyinput v-model="FormData.date" placeholder="请输入兑换时间" />
-				</uni-forms-item>
-				
-				<!-- <uni-forms-item label="兑换时间" labelWidth="150rpx">
-					<view class="date">
-						<picker mode="date" :value="FormData.date" :start="startDate" :end="endDate"
-							@change="bindDateChange">
-							<view class="uni-input" >
-								<text v-if="FormData.date==''||FormData.date==null"
-									style="color: #999999 ;">选择兑换时间</text>
-								<text v-if="FormData.date!=''">{{FormData.date}}</text>
-							</view>
-						</picker>
-					</view>
-				</uni-forms-item> -->
-				
+				</uni-forms-item>				
 			</uni-forms>
 		</view>
 		
@@ -34,16 +20,17 @@
 		<view class="card" >
 			<view class="toptitle">
 				<view>洲际天堂大饭店</view>
-				<view>未核销</view>
+				<view v-if="items.status == 3">未核销</view>
+				<view v-if="items.status == 4">已核销</view>
 			</view>
 			<view class="shopCard">
-				<image  src="/static/icon/Kudosbg.png"></image>
+				<image  :src="items.img_urls"></image>
 				<view style="margin-left: 24rpx;">
-					<text class="name">端午佳节五香肉粽子,仅限前</text>
-					<text class="tag">礼盒装 2000积分</text>
+					<text class="name">{{items.product_name}}</text>
+					<text class="tag" v-if="items.source_type == 3">礼盒装 2000积分</text>
 				</view>
 			</view>
-			<view class="points">
+			<view class="points" v-if="items.source_type == 3">
 				<text class="totalName">共计:</text>
 				<text class="totalContent">2000积分</text>
 			</view>
@@ -65,10 +52,13 @@
 <script>
 	export default{
 		data(){
-			const currentDate = this.getDate({
-				format: true
-			})
 			return{
+				//订单号
+				order_no:'',
+				//订单详情
+				items:'',
+				//订单id
+				order_id:'',
 				// 表单数据
 				FormData:{
 					name:'',
@@ -77,17 +67,29 @@
 				},
 			}
 		},
-		computed: {
-			startDate() {
-				return this.getDate('start');
-			},
-			endDate() {
-				return this.getDate('end');
+		onLoad(o) {
+			if(o.order_id){
+				this.order_id = o.order_id
+				this.orderDetail()
 			}
 		},
 		methods:{
+			//订单详情
+			orderDetail(){
+				this.$api.orders.getOrderDetail({
+					order_id:this.order_id
+				}).then(res=>{
+					this.items = res.data
+					this.FormData.name = res.data.receiver
+					this.FormData.contact = res.data.phone
+					this.FormData.date = res.data.created_at
+					this.order_no = res.data.order_no
+				})
+			},
+			
 			// 核销订单
 			verificationOrder(){
+				let _this = this
 				uni.showModal({
 					title: '提示',
 					content: '是否核销订单',
@@ -95,33 +97,49 @@
 					confirmColor:'#FF6200',
 					success: function (res) {
 						if (res.confirm) {
-							console.log('用户点击确定');
+							_this.$api.orders.confirmOrder({
+								order_no:_this.order_no
+							}).then(res=>{
+								if(res.code == 0){
+									uni.showToast({
+										icon:'none',
+										title:'核销成功'
+									})
+									_this.orderDetail()
+									
+								}else{
+									uni.showToast({
+										icon:'none',
+										title:res.msg
+									})
+								}
+							})
 						} else if (res.cancel) {
 							console.log('用户点击取消');
 						}
 					}
 				});
 			},
-			// 选择兑换时间
-			bindDateChange: function(e) {
-				this.FormData.date=e.detail.value
-			},
+			// // 选择兑换时间
+			// bindDateChange: function(e) {
+			// 	this.FormData.date=e.detail.value
+			// },
 			// 获取时间
-			getDate(type) {
-				const date = new Date();
-				let year = date.getFullYear();
-				let month = date.getMonth() + 1;
-				let day = date.getDate();
+			// getDate(type) {
+			// 	const date = new Date();
+			// 	let year = date.getFullYear();
+			// 	let month = date.getMonth() + 1;
+			// 	let day = date.getDate();
 			
-				if (type === 'start') {
-					year = year - 60;
-				} else if (type === 'end') {
-					year = year + 2;
-				}
-				month = month > 9 ? month : '0' + month;
-				day = day > 9 ? day : '0' + day;
-				return `${year}-${month}-${day}`;
-			}
+			// 	if (type === 'start') {
+			// 		year = year - 60;
+			// 	} else if (type === 'end') {
+			// 		year = year + 2;
+			// 	}
+			// 	month = month > 9 ? month : '0' + month;
+			// 	day = day > 9 ? day : '0' + day;
+			// 	return `${year}-${month}-${day}`;
+			// }
 		},
 	}
 </script>

+ 20 - 58
pages/my/verification/verification.vue

xqd xqd xqd xqd
@@ -26,76 +26,30 @@
 					</view>
 			</view>
 		</view>
-		
-		<!-- 未核销列表 -->
-		<view v-if="isActive === 0">
-			<view class="card" v-for="item in orderList" >
-				<view class="toptitle">
-					<view>洲际天堂大饭店</view>
-					<view>未核销</view>
-				</view>
-				<view class="shopCard">
-					<image  src="/static/icon/Kudosbg.png"></image>
-					<view style="margin-left: 24rpx;">
-						<text class="name">端午佳节五香肉粽子,仅限前</text>
-						<text class="tag">礼盒装 2000积分</text>
-					</view>
-				</view>
-				<view class="points">
-					<text class="totalName">共计:</text>
-					<text class="totalContent">2000积分</text>
-				</view>
-				<view class="btn" @click="goOrderVF">
-					<text>核销</text>
-				</view>
-			</view>
-		</view>
-		<!-- 已核销列表 -->
-		<view v-if="isActive === 1">
-			<view class="card" v-for="item in orderList" @click="goDetail">
-				<view class="toptitle">
-					<view>洲际天堂大饭店</view>
-					<view>未核销</view>
-				</view>
-				<view class="shopCard">
-					<image  src="/static/icon/Kudosbg.png"></image>
-					<view style="margin-left: 24rpx;">
-						<text class="name">端午佳节五香肉粽子,仅限前</text>
-						<text class="tag">礼盒装 2000积分</text>
-					</view>
-				</view>
-				<view class="points">
-					<text class="totalName">共计:</text>
-					<text class="totalContent">2000积分</text>
-				</view>
-				<view class="btn" v-if="false">
-					<text>核销</text>
-				</view>
-			</view>
-		</view>
-		<!-- 我的列表 -->
-		<view v-if="isActive === 2" >
-			<view class="card" v-for="item in orderList" @click="goDetail">
+		<view>
+			<view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.id)" >
 				<view class="toptitle">
 					<view>洲际天堂大饭店</view>
-					<view>未核销</view>
+					<view v-if="item.status == 3">未核销</view>
+					<view v-if="item.status == 4">已核销</view>
 				</view>
 				<view class="shopCard">
-					<image  src="http://t9.9026.com/imgs/Kudosbg.png"></image>
+					<image  :src="item.img_urls"></image>
 					<view style="margin-left: 24rpx;">
-						<text class="name">端午佳节五香肉粽子,仅限前</text>
-						<text class="tag">礼盒装 2000积分</text>
+						<text class="name">{{item.product_name}}</text>
+						<text class="tag" v-if="item.source_type == 3" >礼盒装 2000积分</text>
 					</view>
 				</view>
-				<view class="points">
+				<view class="points" v-if="item.source_type == 3" >
 					<text class="totalName">共计:</text>
 					<text class="totalContent">2000积分</text>
 				</view>
-				<view class="btn" v-if="false">
+				<view class="btn" @click.stop="goOrderVF(item.id)" v-if="item.status == 3">
 					<text>核销</text>
 				</view>
 			</view>
 		</view>
+
 		<!-- 已经到底啦 -->
 		<view class="home-bottom">
 			<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText"/>
@@ -128,6 +82,13 @@
 			this.getMyOrder(1)
 		},
 		methods:{
+			
+			// 跳转订单详情
+			goOrderDetail(id) {
+				uni.navigateTo({
+					url: '/pages/my/myorders/orderDetail?id=' + id
+				})
+			},
 			// 获取订单列表
 			getMyOrder(type){
 				this.$api.orders.getOrderList({
@@ -165,9 +126,9 @@
 				})
 			},
 			// 跳转核销订单
-			goOrderVF(){
+			goOrderVF(id){
 				uni.navigateTo({
-					url:'/pages/my/verification/orderVerification'
+					url:'/pages/my/verification/orderVerification?order_id='+id
 				})
 			},
 			// 跳转核销详情
@@ -180,6 +141,7 @@
 			scanCode(){
 				uni.scanCode({
 					success: function (res) {
+						console.log(res);
 						console.log('条码类型:' + res.scanType);
 						console.log('条码内容:' + res.result);
 					}

+ 2 - 2
setting.js

xqd
@@ -2,8 +2,8 @@
  * Created by JianJia.Zhou<jianjia.zhou> on 2022/3/18.
  */
 const IS_DEV = process.env.NODE_ENV === 'development1'
-// const URL = 'https://t9.9026.com'
-const URL = 'https://ihg.9026.com'
+const URL = 'https://t9.9026.com'
+// const URL = 'https://ihg.9026.com'
 
 module.exports = {
   // 版本