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

项目日志:12.30 订单详情优化

gubai 3 éve
szülő
commit
eba36c6bb0

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

xqd xqd
@@ -493,8 +493,10 @@
 					if(this.productDetail.product_attr[k].attr == attr){
 						const price = this.productDetail.product_attr[k].price;
 						const integral = this.productDetail.product_attr[k].integral;
+						const stock = this.productDetail.product_attr[k].stock;
 						this.productDetail.price = price;
 						this.productDetail.integral = integral;
+						this.productDetail.stock = stock
 						break;
 					}
 				}
@@ -529,11 +531,20 @@
 				}
 				const selectedIds = resArr.join(':');
 				console.log(this.productDetail.integral);
-				uni.navigateTo({
-					url: `/pages/my/integral/integralOrder?product_id=${this.productDetail.id}&attr=${selectedIds}&integral=${this.productDetail.integral}&attrName=${this.showProductAttr}`
-				})
-				this.Recipientclose()
+				console.log(this.productDetail.stock);
+				if(this.productDetail.stock >=1 ){
+					uni.navigateTo({
+						url: `/pages/my/integral/integralOrder?product_id=${this.productDetail.id}&attr=${selectedIds}&integral=${this.productDetail.integral}&attrName=${this.showProductAttr}`
+					})
+					this.Recipientclose()
+				}else{
+					uni.showToast({
+						icon:'none',
+						title:'库存不足'
+					})
+				}
 			},
+			
 			Recipientopen() {
 				this.$refs.Recipient.open('bottom')
 			},

+ 23 - 1
pages/login/login.vue

xqd xqd xqd
@@ -57,7 +57,13 @@
 				</view>
 
 				<view class="popup-login-text">
-					<view>登录即代表已阅读并同意<text style="color: #FF6200;">服务协议、隐私协议</text></view>
+					<view style="display: flex;align-items: center;justify-content: center;">
+						<text>登录即代表已阅读并同意</text>
+						<view style="color: #FF6200;display: flex;align-items: center;justify-content: center;">
+							<view @click="goAgreement">服务协议</view>
+							<view @click="goPrivacy">、隐私协议</view>
+						</view>
+					</view>
 				</view>
 			</view>
 		</u-popup>
@@ -106,6 +112,21 @@
 				}
 			},
 
+			//服务协议
+			goAgreement() {
+				console.log(111);
+				uni.navigateTo({
+					url: '/pages/my/protocol/UserAgreement'
+				})
+			},
+
+			//隐私协议
+			goPrivacy() {
+				console.log(222);
+				uni.navigateTo({
+					url: '/pages/my/protocol/PrivacyPolicy'
+				})
+			},
 
 			//关闭遮罩层
 			closeMask() {
@@ -316,6 +337,7 @@
 		.logintype {
 			position: relative;
 			top: -8rpx;
+
 			text {
 				font-size: 28rpx;
 				font-family: PingFang-SC-Medium, PingFang-SC;

+ 23 - 1
pages/login/youyue.vue

xqd xqd
@@ -91,7 +91,13 @@
 				</view>
 		
 				<view class="popup-login-text">
-					<view>登录即代表已阅读并同意<text style="color: #FF6200;">服务协议、隐私协议</text></view>
+					<view style="display: flex;align-items: center;justify-content: center;">
+						<text>登录即代表已阅读并同意</text>
+						<view style="color: #FF6200;display: flex;align-items: center;justify-content: center;">
+							<view @click="goAgreement">服务协议</view>
+							<view @click="goPrivacy">、隐私协议</view>
+						</view>
+					</view>
 				</view>
 			</view>
 		</u-popup>
@@ -143,6 +149,22 @@
 			
 		},
 		methods: {
+			//服务协议
+			goAgreement() {
+				console.log(111);
+				uni.navigateTo({
+					url: '/pages/my/protocol/UserAgreement'
+				})
+			},
+			
+			//隐私协议
+			goPrivacy() {
+				console.log(222);
+				uni.navigateTo({
+					url: '/pages/my/protocol/PrivacyPolicy'
+				})
+			},
+			
 			// 跳转其他小程序
 			goOther() {
 				this.jumpHAppID(this.jump_type, this.jump_config)

+ 108 - 19
pages/map/hotel-book/index.vue

xqd xqd xqd xqd
@@ -82,7 +82,12 @@
 <script>
 	export default {
 		data() {
-			return {
+			return {
+				//用户信息
+				admin:'',
+				//跳转h5,小程序,其他页面
+				jump_type_vip: '',
+				jump_config_vip: {},
 				//轮播图
 				info: [],
 				//自定义导航栏
@@ -111,6 +116,10 @@
 		},
 		onReady: function(res) {
 			this.videoContext = uni.createVideoContext('myVideo')
+		},
+		
+		onShow() {
+			this.admin = this.$store.getters.userInfo
 		},
 
 		onLoad(params) {
@@ -124,7 +133,18 @@
 				this.hotel = params;
 				this.hotel_id = params.hotel_id;
 				this.getDetail()
-			}			
+			}
+			//vip跳转
+			this.advise = this.$store.getters.allset.add_member
+			this.jump_type_vip = this.advise.value.map_jump_type
+			if (this.jump_type_vip == 1) {
+				this.jump_config_vip = this.advise.value.map_h5_url
+			} else if (this.jump_type_vip == 2) {
+				this.jump_config_vip.appid = this.advise.value.map_appid
+				this.jump_config_vip.path = this.advise.value.map_path
+			} else if (this.jump_type_vip == 3) {
+				this.jump_config_vip = this.advise.value.map_other_path
+			}
 		},
 		
 		methods: {
@@ -190,23 +210,92 @@
 			},
 
 			// 跳转其他小程序
-			goJoin() {
-				wx.navigateToMiniProgram({
-					appId: 'wx255b58f0992b3c53', //appid
-					path: 'newUIMain/enrollment/enrollment', //path
-					extraData: { //参数
-						foo: 'bar'
-					},
-					// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
-					success(res) {
-						console.log('成功')
-						// 打开成功
-					},
-					fail(e) {
-						console.log(e, '失败')
-					}
-				})
-			},
+			// goJoin() {
+			// 	wx.navigateToMiniProgram({
+			// 		appId: 'wx255b58f0992b3c53', //appid
+			// 		path: 'newUIMain/enrollment/enrollment', //path
+			// 		extraData: { //参数
+			// 			foo: 'bar'
+			// 		},
+			// 		// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
+			// 		success(res) {
+			// 			console.log('成功')
+			// 			// 打开成功
+			// 		},
+			// 		fail(e) {
+			// 			console.log(e, '失败')
+			// 		}
+			// 	})
+			// },
+			
+			// 跳转其他小程序
+			goJoin() {
+				let _this = this
+				this.jumpHAppID(this.jump_type_vip, this.jump_config_vip)
+			},
+			
+			// 跳转其他小程序
+			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 _this = this
+					let obj = urls;
+					console.log(obj, '----->obj');
+					wx.navigateToMiniProgram({
+						appId: `${obj.appid}`, //appid
+						path: `${obj.path}`, //path
+						extraData: { //参数
+							foo: 'bar'
+						},
+						// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
+						success(res) {
+							let page = '/pages/map/map'
+							let user_id = ''
+							if (_this.admin != null) {
+								user_id = _this.admin.id
+							} else {
+								user_id = 0
+							}
+							_this.$api.my.userMemberAdd({
+								user_id,
+								page,
+							}).then(res => {
+								console.log(res.data);
+							})
+							// 打开成功
+						},
+						fail(e) {
+							console.log(e, '失败')
+						}
+					})
+				} else if (id == 3) {
+					uni.redirectTo({
+						url: urls,
+						fail: (err) => {
+							uni.reLaunch({
+								url: urls
+							})
+						}
+					})
+				}
+			},
+			
+			
+			
+			
+			
 			// 跳转首页
 			goIndex() {
 				uni.reLaunch({

+ 2 - 1
pages/map/map.scss

xqd
@@ -234,7 +234,8 @@ page {
 				}
 				&.on{
 					background-color: #FF6200;
-					color:#fff;
+					color:#fff;
+					border: 2rpx solid #FF6200;
 				}
 			}
 			

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

xqd
@@ -193,8 +193,8 @@
 			this.Data.attr = op.attr
 			this.integral = op.integral
 			this.attrName= op.attrName		
-			await this.getProductDetail(op.product_id)
 			await this.init()
+			await this.getProductDetail(op.product_id)
 		},
 		methods: {
 			//初始化

+ 16 - 6
pages/my/myorders/orderDetail.vue

xqd xqd xqd xqd xqd
@@ -23,7 +23,7 @@
 
 		<view class="midBox">
 			<!-- 物流信息 -->
-			<view class="logistics" v-if="goodsDet.express_type == 1">
+			<view class="logistics" v-if="goodsDet.express_type == 1 && status == 3 ? true : goodsDet.express_type == 1 && status == 4 ? true : false ">
 				<view class="logisticsTitle">物流信息</view>
 				<view class="logisticsMsg"><text>快递公司</text><text
 						style="margin-left: 26rpx;">{{goodsDet.express_company}}</text></view>
@@ -80,11 +80,11 @@
 					</view>
 
 					<!-- 门店联系方式 -->
-					<view class="deliveryicon" v-if="goodsDet.express_type ==2">
+					<view class="deliveryicon" v-if="goodsDet.express_type =='2'">
 						<image src="/static/icon/phone.png"></image>
 						<text>门店联系方式</text>
 					</view>
-					<view class="deliverytext"  style="margin-bottom: 24rpx;" v-if="goodsDet.express_type ==2">
+					<view class="deliverytext"  style="margin-bottom: 24rpx;" v-if="goodsDet.express_type =='2'">
 						<text>{{hotelDet.phone}}</text>
 					</view>
 				</view>
@@ -191,7 +191,7 @@
 					type: "gcj02",
 					latitude: parseFloat(this.hotelDet.latitude), // 纬度,浮点数,范围为90 ~ -90
 					longitude: parseFloat(this.hotelDet.longitude), // 经度,浮点数,范围为180 ~ -180。
-					scale: 6, // 地图缩放级别,整形值,范围从1~28。默认为最大
+					scale: 12, // 地图缩放级别,整形值,范围从1~28。默认为最大
 					name: name, // 位置名
 					address: address, // 地址详情说明
 				})
@@ -214,9 +214,14 @@
 					this.status = res.data.status
 					this.express_type = res.data.express_type
 					this.goodsDet = res.data
-					this.productImg = JSON.parse(res.data.img_urls)
+					console.log(this.goodsDet,'----->this.goodsDet');
 					this.source_type = res.data.source_type
 					this.integral = res.data.integral
+					if(res.data.product_type == 3){
+						this.productImg  = res.data.img_urls
+					}else{
+						this.productImg = JSON.parse(res.data.img_urls)
+					}
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
 						this.hotelDetail(this.goodsDet.hotel_id)
 					}
@@ -232,9 +237,14 @@
 					this.status = res.data.status
 					this.express_type = res.data.express_type
 					this.goodsDet = res.data
-					this.productImg = JSON.parse(res.data.img_urls)
+					console.log(this.goodsDet,'------>this.goodsDet');
 					this.source_type = res.data.source_type
 					this.integral = res.data.integral
+					if(res.data.product_type == 3){
+						this.productImg  = res.data.img_urls
+					}else{
+						this.productImg = JSON.parse(res.data.img_urls)
+					}
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
 						this.hotelDetail(this.goodsDet.hotel_id)
 					}

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

xqd xqd xqd
@@ -41,6 +41,7 @@
 					<view>订单号:{{item.order_no}}</view>
 
 					<view v-if="item.status == 1 && item.is_virtual == 0">待兑换</view>
+					<view v-if="item.status == 1 && item.is_virtual == 1">待兑换</view>
 					<view v-if="item.status == 2 && item.is_virtual == 0 && item.express_type == 1">待发货</view>
 					<view v-if="item.status == 2 && item.is_virtual == 0 && item.express_type == 2">待核销</view>
 					<view v-if="item.status == 3 && item.is_virtual == 0 && item.express_type == 1">待收货</view>
@@ -80,7 +81,7 @@
 					<!-- <view class="btnitem" v-if="item.status == 1">
 						<text>取消</text>
 					</view> -->
-					<view class="btnitem" v-if="item.status == 1" @click.stop="exchangePrize(item.draw_record_id,item.is_virtual)">
+					<view class="btnitem" v-if="item.status == 1" @click.stop="exchangePrize(item.draw_record_id,item.is_virtual,item.product_id)">
 						<text>兑换</text>
 					</view>
 					<view @click.stop="takeOver(item.id)" class="btnitem"
@@ -281,17 +282,17 @@
 			},
 			
 			//跳转奖品兑换
-			exchangePrize(id,is_virtual){
+			exchangePrize(id,is_virtual,product_id){
 				let isPhy = ''
 				if(is_virtual == 0){
 					isPhy = 1
 					uni.navigateTo({
-						url:`/pages/my/prize/exchangePrize?id=${id}&isPhy=${isPhy}`
+						url:`/pages/my/prize/exchangePrize?id=${id}&isPhy=${isPhy}&product_id=${product_id}`
 					})
 				}else{
 					isPhy = 2
 					uni.navigateTo({
-						url:`/pages/my/prize/exchangePrize?id=${id}&isPhy=${isPhy}`
+						url:`/pages/my/prize/exchangePrize?id=${id}&isPhy=${isPhy}&product_id=${product_id}`
 					})
 				}
 				

+ 4 - 10
pages/my/prize/exchangePrize.vue

xqd xqd
@@ -203,23 +203,17 @@
 		async onLoad(o) {
 			if (o.id) {
 				this.id = o.id
+				this.product_id = o.product_id
 				console.log(this.id,'---->订单id');
 				this.isPhy = o.isPhy
 				if (this.isPhy == 1) {
 					//实物奖品
+					await this.init(this.product_id)
 					await this.getPrizeList(0)
-					if(this.product_id){
-						this.init(this.Data.product_id)
-						console.log(1111);
-					}
-
 				} else {
 					//虚拟奖品
+					await this.init(this.product_id)
 					await this.getPrizeList(1)
-					if(this.product_id){
-						this.init(this.Data.product_id)
-						console.log(222);
-					}
 				}
 			}
 		},
@@ -242,7 +236,7 @@
 					this.formData.type = '门店自提'
 					this.Data.express_type = 2
 					await this.goLocation()
-					await this.getHotel(this.Data.product_id)
+					await this.getHotel(this.product_id)
 
 				}
 			},

+ 32 - 30
pages/my/prize/prize.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -34,7 +34,7 @@
 		</view>
 
 
-		<view style="margin-bottom: 60rpx;margin-top: 24rpx;">
+		<view style="padding-bottom: 60rpx;margin-top: 24rpx; background-color: #fff; ">
 			<!-- 实物奖品 -->
 			<view class="prizeList" :style="{'--height':ListHeight+'rpx'}"
 				v-if="isActive == 0  && PhysicalPrizes.length > 0  ">
@@ -44,7 +44,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="goExchangePhy(item.id,item.product_id)">
 						<text>立即兑换</text>
 					</view>
 					<view class="alreadyBtn" v-if="item.status == 3">
@@ -59,7 +59,7 @@
 				<view class="ListItem" v-for="(item,index) in VirtualPrizes" :key="index">
 					<view class="title"><text>{{item.name}}</text></view>
 					<view class='data'><text>{{item.exchange_start_time}}--{{item.exchange_end_time}}</text></view>
-					<view class="instantBtn" v-if="item.status == 1" @click="goExchangeVir(item.id)">
+					<view class="instantBtn" v-if="item.status == 1" @click="goExchangeVir(item.id,item.product_id)">
 						<text>立即兑换</text>
 					</view>
 					<view class="alreadyBtn" v-if="item.status == 2">
@@ -76,33 +76,35 @@
 			</view>
 
 			<!-- 中奖记录 -->
-			<view class="prizeList" :style="{'--height':ListHeight+'rpx'}"
+			<view class="prizeList" :style="{'--height':ListHeight+'rpx'}" style="padding-bottom: 40rpx;"
 				v-if="isActive == 2 && prizeRecord.length > 0 ">
 				<view class="ListItem" v-for="(item,index) in prizeRecord" :key="index">
 					<view style="display: flex; justify-content: space-between;">
-						<view class="title"><text>{{item.name}}</text> </view>
-						<view class='data' style="flex:none;"><text>{{item.created_at}}</text></view>
+						<view class="title"><text>{{item.name || '积分奖品'}}</text> </view>
 					</view>
 					<view class="content"><text>{{item.remark||'无'}}</text></view>
+					<view class='data'>
+						<text>{{item.created_at}}</text>
+					</view>
 				</view>
 			</view>
 		</view>
 
 		<!-- 已经到底啦 -->
-		<view class="home-bottom" style="margin-top: 88rpx;padding-bottom: 60rpx;"  v-if="isActive == 0  && PhysicalPrizes.length > 0  " >
-			<uni-load-more :status="status" color="#CCCCCC"
-				:content-text="contentText" />
+		<view class="home-bottom" style="margin-top: 88rpx;padding-bottom: 60rpx;"
+			v-if="isActive == 0  && PhysicalPrizes.length > 0  ">
+			<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText" />
 		</view>
-		
-		<view class="home-bottom" style="margin-top: 88rpx;padding-bottom: 60rpx;" v-if="isActive == 1  && VirtualPrizes.length > 0  " >
-			<uni-load-more  :status="status" color="#CCCCCC"
-				:content-text="contentText" />
+
+		<view class="home-bottom" style="margin-top: 88rpx;padding-bottom: 60rpx;"
+			v-if="isActive == 1  && VirtualPrizes.length > 0  ">
+			<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText" />
 		</view>
-		<view class="home-bottom" style="margin-top: 88rpx;padding-bottom: 60rpx;" v-if="isActive == 2  && prizeRecord.length > 0  " >
-			<uni-load-more  :status="status" color="#CCCCCC"
-				:content-text="contentText" />
+		<view class="home-bottom" style="margin-top: 88rpx;padding-bottom: 60rpx;"
+			v-if="isActive == 2  && prizeRecord.length > 0  ">
+			<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText" />
 		</view>
-		
+
 	</view>
 </template>
 
@@ -154,11 +156,11 @@
 				this.getPrizeList(1)
 			})
 		},
-		
+
 		onUnload() {
 			uni.$emit('refreshOrderNum')
 		},
-		
+
 		onReachBottom() {
 			// 触底的时候请求数据,即为上拉加载更多
 			var allTotal = this.page * this.pagesize
@@ -203,8 +205,8 @@
 					console.log('已加载全部数据')
 					this.status = "noMore"
 				}
-			}else if(this.isActive ==0) {
-				console.log(allTotal,'实物');
+			} else if (this.isActive == 0) {
+				console.log(allTotal, '实物');
 				if (allTotal < this.totalElementsPhy) {
 					//this.totalElements为请求数据的总条数。只要现有条数小于总条数就就执行一下代码
 					this.allListItem = false;
@@ -224,7 +226,7 @@
 					console.log('已加载全部数据')
 					this.status = "noMore"
 				}
-			} 
+			}
 		},
 
 		methods: {
@@ -243,7 +245,7 @@
 						this.VirtualPrizes = res.data.data
 						this.totalElementsVir = res.data.total
 						this.pagesize = res.data.per_page
-						console.log(this.totalElementsVir,'虚拟');
+						console.log(this.totalElementsVir, '虚拟');
 					}
 				})
 			},
@@ -265,7 +267,7 @@
 				if (index <= 1) {
 					this.page = 1
 					this.isActive = index
-					console.log(this.isActive,'------->this.isActive');
+					console.log(this.isActive, '------->this.isActive');
 					this.getPrizeList(index)
 				} else {
 					this.page = 1
@@ -274,15 +276,15 @@
 				}
 			},
 			// 实物立即兑换
-			goExchangePhy(id) {
+			goExchangePhy(id, product_id) {
 				uni.navigateTo({
-					url: `/pages/my/prize/exchangePrize?id=${id}&isPhy=1`
+					url: `/pages/my/prize/exchangePrize?id=${id}&isPhy=1&product_id=${product_id}`
 				})
 			},
 			// 虚拟立即兑换
-			goExchangeVir(id) {
+			goExchangeVir(id, product_id) {
 				uni.navigateTo({
-					url: `/pages/my/prize/exchangePrize?id=${id}&isPhy=2`
+					url: `/pages/my/prize/exchangePrize?id=${id}&isPhy=2&product_id=${product_id}`
 				})
 			},
 		},
@@ -389,15 +391,15 @@
 		background: $bgColor;
 		box-shadow: 0px 4rpx 24rpx -10rpx rgba(101, 95, 90, 0.3);
 		border-radius: 12rpx;
-		padding: 0rpx 28rpx 0 32rpx;
+		padding: 0rpx 30rpx 0rpx;
 		box-sizing: border-box;
 
 		.ListItem {
 			width: 690rpx;
-			height: 160rpx;
 			border-bottom: #F0F0F0 solid 0.5rpx;
 			position: relative;
 			padding-top: 35rpx;
+			padding-bottom: 35rpx;
 			box-sizing: border-box;
 
 			.title {

+ 3 - 3
setting.js

xqd
@@ -1,10 +1,10 @@
 /**
  * Created by JianJia.Zhou<jianjia.zhou> on 2022/3/18.
  */
-const IS_DEV = process.env.NODE_ENV === 'development1'
+const IS_DEV = process.env.NODE_ENV === 'development'
 
-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 = {