Просмотр исходного кода

添加短信验证码登录 修改订单详情扩展字段

wenjie 9 месяцев назад
Родитель
Сommit
718a400c73

+ 3 - 3
components/zs-img/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="zs-img-box">
-			<image class="img1" v-if="!isError" :class="'lazy' + elIndex" :style="{width,height,borderRadius:radius == 'full'?'16rpx':'16rpx 16rpx 0 0' }" :src="url1" :mode='mode' @error="error"></image>
-			<image v-else  :style="{width,height,borderRadius:radius == 'full'?'16rpx':'16rpx 16rpx 0 0' }" :src="defaultSrc" :mode='mode'></image>
+			<image class="img1 image" v-if="!isError" :class="'lazy' + elIndex" :style="{width,height,borderRadius:radius == 'full'?'16rpx':'16rpx 16rpx 0 0' }" :src="url1" :mode='mode' @error="error"></image>
+			<image class="image" v-else  :style="{width,height,borderRadius:radius == 'full'?'16rpx':'16rpx 16rpx 0 0' }" :src="defaultSrc" :mode='mode'></image>
 	</view>
 </template>
 
@@ -90,7 +90,7 @@
 <style lang="scss" scoped>
 	.zs-img-box{
 		position: relative;
-		image{
+		.image{
 			vertical-align: bottom;
 			will-change: transform
 		}

+ 16 - 14
hotel/search.vue

@@ -148,9 +148,18 @@
 						</view>
 					</view>
 					<view class="box" v-else-if="active == 1">
+						<view class="sub-title mb28">
+							价格 <text class="price-range">{{`¥${priceValue[0]}~¥${priceValue[1]}`}}</text>
+						</view>
+						<zs-slider class="zs-slider" ref="slider" v-model="priceValue" :min="0" :max="2500" :step="10" :blockWidth="40" @end="moveEnd" />
+						<view class="price-tab-box">
+							<view class="price-tab" :class="[index%3!=0?'ml20':'',item.max == curPrice?'active':'']" v-for="(item,index) in priceList" :key="index" @click="choosePrice(item)">
+								¥{{item.min}}{{ item.max == 2500?'以上': '-'+item.max}}
+							</view>
+						</view>
 					
 						<view class="sub-title">
-							星级(可多选)
+							星级/钻级
 						</view>
 						<view class="choose-tab-box">
 							<view class="tab" :class="[index%3!=0?'ml20':'',query.filter.star.indexOf(item.id) != -1?'active':'']" v-for="(item,index) in starList" :key="item.id" @click="chooseTab(item,1)">
@@ -162,15 +171,7 @@
 								</view>
 							</view>
 						</view>
-						<view class="sub-title mb28">
-							价格区间 <text class="price-range">{{`¥${priceValue[0]}~¥${priceValue[1]}`}}</text>
-						</view>
-						<zs-slider class="zs-slider" ref="slider" v-model="priceValue" :min="0" :max="2500" :step="10" :blockWidth="40" @end="moveEnd" />
-						<view class="price-tab-box">
-							<view class="price-tab" :class="[index%3!=0?'ml20':'',item.max == curPrice?'active':'']" v-for="(item,index) in priceList" :key="index" @click="choosePrice(item)">
-								¥{{item.min}}{{ item.max == 2500?'以上': '-'+item.max}}
-							</view>
-						</view>
+						
 					</view>
 			<!-- 		<view class="radio-box" v-else-if="active == 2">
 						<view class="radio" v-for="item in areaList" :key="item.code" @click="chooseTab(item,2)">
@@ -304,25 +305,25 @@
 						id:2,
 						// label:'二星级',
 						// data:[2,6]
-						label:'二星级及以下',
+						label:'2钻/星及以下',
 						desc:'经济',
 						data:[1,0,2,6]
 					},
 					{
 						id:3,
-						label:'三星级',
+						label:'3钻/星',
 						desc:'舒适',
 						data:[3,7]
 					},
 					{
 						id:4,
-						label:'四星级',
+						label:'4钻/星',
 						desc:'高档',
 						data:[4,8]
 					},
 					{
 						id:5,
-						label:'五星级',
+						label:'5钻/星',
 						desc:'豪华',
 						data:[5,9]
 					},
@@ -878,6 +879,7 @@
 		.sub-title{
 			font-size: 28rpx;
 			font-weight: bold;
+			margin-top: 20rpx;
 			// margin: 20rpx 0;
 			.price-range{
 				font-weight: 300;

+ 60 - 0
login/login/bind.vue

@@ -0,0 +1,60 @@
+<template>
+	<view class="bind">
+		<view class="text-box">
+			<view class="title">
+				您尚未绑定微信,绑定登录更便捷
+			</view>
+			<view class="desc">
+				点击下方按钮绑定您的微信账号
+			</view>
+		</view>
+		
+		<button class="wx-login" @click="bind">绑定微信</button>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		methods: {
+			bind() {
+				uni.login({
+					provider: 'weixin',
+					success(r) {
+						console.log(r.code);
+					}
+				})
+			}
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+.bind{
+	.text-box{
+		margin-top: 300rpx;
+		text-align: center;
+		.title{
+			font-weight: bold;
+			font-size: 32rpx;
+			color: #181818;
+		}
+		.desc{
+			font-size: 24rpx;
+			color: #999999;
+			margin-top: 24rpx;
+		}
+	}
+	.wx-login {
+		width: 690rpx;
+		height: 96rpx;
+		line-height: 96rpx;
+		border-radius: 48rpx;
+		font-size: 32rpx;
+		font-weight: bold;
+		background: #0C6FFE;
+		color: #fff;
+		margin-top: 300rpx;
+	}
+}
+</style>

+ 45 - 38
login/login/otherLogin.vue

@@ -186,47 +186,54 @@
 					});
 					const inviteUserId = uni.getStorageSync('inviteCode') == 'undefined' ? null : uni.getStorageSync('inviteCode')
 					getLoginToken({phoneNum:this.userInfo.phoneNum,platformType:1,inviteUserId}).then(res=>{
-						let userInfo = this.userInfo
-						userInfo.loginToken = res.content
-						if(res.state != 'Success') return
-						validLogin(this.userInfo).then(res=>{
-							uni.hideLoading()
-							if(res.state == 'Success'){
-								uni.setStorageSync('isAuth', res.content
-									.isAuth) //登录状态
-								uni.setStorageSync('token', res.content
-									.token) //登录状态
-								uni.setStorageSync('refreshToken', res.content
-									.refreshToken) //refreshToken
-								getUserDetail().then(res => {
-									uni.setStorageSync('userInfo', JSON.stringify(res.content))
-									if(this.redirect){
-										uni.reLaunch({
-											// url:`${this.redirect}?scene=${this.scene}&id=${this.id}`
-											url:`${this.redirect}?${this.params}`
-										})
-									}else{
-										uni.reLaunch({
-											url: '../../pages/index/index'
+						uni.login({
+							provider: 'weixin',
+							success(r) {
+								let userInfo = that.userInfo
+								userInfo.loginToken = res.content
+								userInfo.scene = inviteUserId
+								userInfo.jsCode = r.code
+								if(res.state != 'Success') return
+								validLogin(userInfo).then(res=>{
+									uni.hideLoading()
+									if(res.state == 'Success'){
+										uni.setStorageSync('isAuth', res.content
+											.isAuth) //登录状态
+										uni.setStorageSync('token', res.content
+											.token) //登录状态
+										uni.setStorageSync('refreshToken', res.content
+											.refreshToken) //refreshToken
+										getUserDetail().then(res => {
+											uni.setStorageSync('userInfo', JSON.stringify(res.content))
+											if(that.redirect){
+												uni.reLaunch({
+													// url:`${that.redirect}?scene=${that.scene}&id=${that.id}`
+													url:`${that.redirect}?${that.params}`
+												})
+											}else{
+												uni.reLaunch({
+													url: '../../pages/index/index'
+												})
+											}
+											// if (res.content.isAuth == 1) {
+											// 	if(that.redirect && that.redirect !=  "undefined"){
+											// 		uni.reLaunch({
+											// 			// url:`${that.redirect}?scene=${that.scene}&id=${that.id}`
+											// 			url:`${that.redirect}?${that.params}`
+											// 		})
+											// 	}else{
+											// 		uni.switchTab({
+											// 			url: '../../pages/index/index'
+											// 		})
+											// 	}
+											// } else { //未实名认证
+											// 	that.show = true
+											// }
 										})
+										
+										
 									}
-									// if (res.content.isAuth == 1) {
-									// 	if(that.redirect && that.redirect !=  "undefined"){
-									// 		uni.reLaunch({
-									// 			// url:`${that.redirect}?scene=${that.scene}&id=${that.id}`
-									// 			url:`${that.redirect}?${that.params}`
-									// 		})
-									// 	}else{
-									// 		uni.switchTab({
-									// 			url: '../../pages/index/index'
-									// 		})
-									// 	}
-									// } else { //未实名认证
-									// 	that.show = true
-									// }
 								})
-								
-								
 							}
 						})
 					})

+ 6 - 6
my/order/detail.vue

@@ -240,7 +240,7 @@
 					充值账号
 				</view>
 				<view class="value">
-					{{JSON.parse(info.goodsList[0].extend).account}}
+					{{info.goodsList[0].extend.account}}
 				</view>
 			</view>
 			
@@ -387,9 +387,9 @@
 				return (this.info.createTime + 1000*60*30) - new Date().getTime()
 			},
 			payTime(){
-				if(this.info.goodsList[0].extend&&!JSON.parse(this.info.goodsList[0].extend).hasOwnProperty('account')){
-					if(JSON.parse(this.info.goodsList[0].extend).hasOwnProperty('notifyOrderInfo')){
-						return JSON.parse(this.info.goodsList[0].extend).notifyOrderInfo.payTime
+				if(this.info.goodsList[0].extend&&!this.info.goodsList[0].extend.hasOwnProperty('account')){
+					if(this.info.goodsList[0].extend.hasOwnProperty('notifyOrderInfo')){
+						return this.info.goodsList[0].extend.notifyOrderInfo.payTime
 					}else{
 						return '-'
 					}
@@ -533,7 +533,7 @@
 				uni.showLoading({
 					title: '取消中'
 				})
-				let obj = JSON.parse(this.info.goodsList[0].extend)
+				let obj = this.info.goodsList[0].extend
 				cancelOrder(obj).then(res=>{
 					if(res.state == 'Success'){
 						uni.showToast({
@@ -548,7 +548,7 @@
 			pay(){
 				let that = this
 				if(this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
-					let {xjOrderId,tradeId} = JSON.parse(this.info.goodsList[0].extend)
+					let {xjOrderId,tradeId} = this.info.goodsList[0].extend
 					uni.navigateToMiniProgram({
 					   appId:"wx0d252f6ed9755862", // 滴滴加油小程序appId
 					   path: `packageA/pages/open-energy-pay/index?orderId=${xjOrderId}&tradeId=${tradeId}`, // 滴滴加油收银台页面地址,需要拼接orderId和tradeId

+ 8 - 8
my/order/hotel/detail.vue

@@ -3,11 +3,11 @@
 		<zs-skeleton type="orderDetail" :loading="pageLoading"></zs-skeleton>
 			<view class="status-box">
 				<view class="text-box">
-					<view class="status" v-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus=='待付款'&&!isNotTime">
+					<view class="status" v-if="info.goodsList[0].extend.orderInfo.orderStatus=='待付款'&&!isNotTime">
 						等待支付,剩余<u-count-down :time="closeTime" format="mm:ss" @finish="finish"></u-count-down>
 					</view>
 					<view class="status" v-else>
-						{{JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus}}
+						{{info.goodsList[0].extend.orderInfo.orderStatus}}
 					</view>
 					<!-- <view class="notice" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND'">
 						订单已取消。正在为您操作退款,预计1~7个工作日原路退回到
@@ -58,7 +58,7 @@
 					</view>
 				</view>
 				
-				<view class="notice" v-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus!='待付款'">
+				<view class="notice" v-if="info.goodsList[0].extend.orderInfo.orderStatus!='待付款'">
 					{{info.goodsList[0].goodsInfo.hotelInfo.cancelRule}}
 				</view>
 			</view>
@@ -175,7 +175,7 @@
 						{{info.orderNo}}
 					</view>
 				</view>
-				<view class="item" v-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus!='待付款'&&JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus!='已取消'">
+				<view class="item" v-if="info.goodsList[0].extend.orderInfo.orderStatus!='待付款'&&info.goodsList[0].extend.orderInfo.orderStatus!='已取消'">
 					<view class="label">
 						付款方式
 					</view>
@@ -193,7 +193,7 @@
 					</view>
 				</view>
 				
-				<view class="item" v-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus!='待付款'&&JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus!='已取消'">
+				<view class="item" v-if="info.goodsList[0].extend.orderInfo.orderStatus!='待付款'&&info.goodsList[0].extend.orderInfo.orderStatus!='已取消'">
 					<view class="label">
 						支付时间
 					</view>
@@ -229,7 +229,7 @@
 				<button type="default" :loading="btnLoading" v-if="!info.payment.transferAll" class="pay-btn" @click="cancelReply" >取消退款</button>
 			</template> -->
 			
-			<view class="btn-box" v-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus == '待付款'">
+			<view class="btn-box" v-if="info.goodsList[0].extend.orderInfo.orderStatus == '待付款'">
 				<!-- <button class="cancel-btn" @click="cancel" :loading="btnLoading">
 					取消订单
 				</button> -->
@@ -238,7 +238,7 @@
 				</button>
 			</view>
 			
-			<view class="btn-box" v-else-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus == '待确认'||JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus == '已确认'||JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus == '已完成'||JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus == '酒店确认中'">
+			<view class="btn-box" v-else-if="info.goodsList[0].extend.orderInfo.orderStatus == '待确认'||info.goodsList[0].extend.orderInfo.orderStatus == '已确认'||info.goodsList[0].extend.orderInfo.orderStatus == '已完成'||info.goodsList[0].extend.orderInfo.orderStatus == '酒店确认中'">
 				<button class="cancel-btn" @click="cancel(1)" :loading="btnLoading">
 					取消订单
 				</button>
@@ -247,7 +247,7 @@
 				</button>
 			</view>
 			
-			<view class="btn-box" v-else-if="JSON.parse(info.goodsList[0].extend).orderInfo.orderStatus == '已取消'">
+			<view class="btn-box" v-else-if="info.goodsList[0].extend.orderInfo.orderStatus == '已取消'">
 				<button class="book-btn" @click="handleRoom">
 					再次预定 
 				</button>

+ 1 - 1
my/order/signUp/signUpDetail.vue

@@ -14,7 +14,7 @@
 				</view>
 			</view>
 			
-			<view class="content progress"  v-if="info.goodsList[0].goodsState == 'APPLY_REFUND' || info.goodsList[0].goodsState == 'REFUNDED'"  @click="refundDetail">
+			<view class="content progress"  v-if="info.goodsList[0].goodsState == 'APPLY_REFUND' || info.goodsList[0].goodsState == 'REFUNDED'||info.goodsList[0].goodsState == 'APPLY_REFUNDING'"  @click="refundDetail">
 				<view class="progress-title">
 					退款进度
 				</view>

+ 6 - 0
pages.json

@@ -354,6 +354,12 @@
 						"navigationBarTitleText": "手机号登录"
 					}
 				},
+				{
+					"path": "login/bind",
+					"style": {
+						"navigationBarTitleText": "绑定微信"
+					}
+				},
 				{
 					"path": "login/xieyi",
 					"style": {

+ 9 - 9
pages/index/index.vue

@@ -49,9 +49,9 @@
 						
 						<view class="store-item" v-for="(item,index) in list" :key="index">
 							<view @click="goGoodsDetail(item)">
-								<zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode="widthFix"></zs-img>
+								<zs-img :src="item.cover[0]" width="344rpx" height="344rpx" :radius="item.productType=='Web'?'full':'half'" mode="widthFix"></zs-img>
 								<!-- <zs-img :src="item.goodsVos[0].goodsImg" width="344rpx" height="344rpx" mode=""></zs-img> -->
-								<view class="info">
+								<view class="info" v-if="item.productType!='Web'">
 									<view class="title">
 										<!-- <view class="tag">
 											今日特惠
@@ -69,9 +69,9 @@
 									<view class="price-box">
 										<view class="left">
 											<text class="price" v-if="item.salePrice">
-											¥{{(item.salePrice/100).toFixed(2)}}
+											¥{{(item.salePrice/100).toFixed(2)}} {{item.productType=='PetrolStation'?'/L':''}}
 											</text>
-											<text class="label" v-if="(item.labelType=='Place'||item.productType=='MovieTicket')&&item.salePrice">
+											<text class="label" v-if="(item.productType=='Scenic'||item.productType=='Hotel'||item.productType=='Cinema'||item.productType=='MovieTicket'||item.productType=='Restaurant'||item.productType=='Shop')&&item.salePrice">
 											</text>
 											<text class="old-price" v-if="item.originalPrice">
@@ -102,8 +102,8 @@
 						<view class="store-item" v-for="(item,index) in list1" :key="index">
 				
 							<view  @click="goGoodsDetail(item)">
-								<zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode="widthFix"></zs-img>
-								<view class="info">
+								<zs-img :src="item.cover[0]" width="344rpx" height="344rpx" :radius="item.productType=='Web'?'full':'half'" mode="widthFix"></zs-img>
+								<view class="info" v-if="item.productType!='Web'">
 									<view class="title">
 									<!-- 	<view class="tag">
 											今日特惠
@@ -123,7 +123,7 @@
 											<text class="price" v-if="item.salePrice">
 											¥{{(item.salePrice/100).toFixed(2)}} {{item.productType=='PetrolStation'?'/L':''}}
 											</text>
-											<text class="label" v-if="(item.labelType=='Place'||item.productType=='MovieTicket')&&item.salePrice">
+											<text class="label" v-if="(item.productType=='Scenic'||item.productType=='Hotel'||item.productType=='Cinema'||item.productType=='MovieTicket'||item.productType=='Restaurant'||item.productType=='Shop')&&item.salePrice">
 											</text>
 											<text class="old-price" v-if="item.originalPrice">
@@ -145,6 +145,7 @@
 										</view>
 									</view>
 								</view>
+								
 							</view>
 						</view>
 					</view>
@@ -180,8 +181,6 @@
 				city:'定位中',
 				status: 'more',
 				current:0,
-				bannerList:['https://alipic.lanhuapp.com/XDSlicePNGMAX2f4cb415a269b2e935c7a97da9077db4d78ddb8306ac44ec1e10274387048a22.png',
-				'https://alipic.lanhuapp.com/XDSlicePNGMAX2f4cb415a269b2e935c7a97da9077db4d78ddb8306ac44ec1e10274387048a22.png'],
 				discountsList: [],//菜单
 				advList:[],
 				advList1:[],
@@ -326,6 +325,7 @@
 				// uni.setStorageSync('shopInfo', JSON.stringify(item))
 				let url = ''
 				if (item.productType === 'Web') {
+					url = item.meta.url
 				    console.log('链接');
 				} else if (item.productType === 'Recharge') {
 					url = '/detail/virtualGoods/index'