Prechádzať zdrojové kódy

项目日志: 12.21 核销订单详情

gubai 3 rokov pred
rodič
commit
32b14c0dea

+ 1 - 1
pages/index/vote-detail/index.vue

xqd
@@ -129,7 +129,7 @@
 					<text v-if="isVoteNum && is_prize==0 ">今日投票数还有 {{userCanVoteNum}} 次
 						点击再次投票可再次为本项目投票也可为其他项目投票</text>
 					<text v-if="is_prize==1">恭喜你中奖了!
-						获得了{{prizeProduct}}{{prizeProduct.indexOf('积分')==-1?'':',请尽快领取'}}</text>
+						获得了{{prizeProduct}}{{prizeProduct.indexOf('积分')==-1?',请尽快领取':''}}</text>
 				</view>
 				<view class="btn">
 					<view v-if="is_prize==0" class="cancel"

+ 23 - 30
pages/login/login.vue

xqd
@@ -120,38 +120,31 @@
 				this.modal.show = true
 			},
 			// 获取头像
-			handleChooseAvatar(e) {
+			handleChooseAvatar({detail}) {
 				let _this = this
-				console.log(e.detail, '------>e.detail');
-				this.modal.avatar = e.detail.avatarUrl
-				// uni.uploadFile({
-				// 	url:'https://t9.9026.com/static/image',
-				// 	fillPath:_this.modal.avatar,
-				// 	formData:{
-				// 		'user':'text'
-				// 	},
-				// 	success:(res)=>{
-				// 		console.log(res);
-				// 	}
-				// })
+				// this.modal.avatar = detail.avatarUrl
+				uni.getFileSystemManager().readFile({
+				  filePath:detail.avatarUrl, // 选择图片返回的相对路径
+				  encoding: 'base64', // 编码格式
+				  success: res => { // 成功的回调
+				    uni.uploadFile({
+				      url: _this.$setting.BASE_URL + '/v1/user/uploadFile',
+				      // filePath: 'data:image/png;base64,' + res.data,
+				      filePath: detail.avatarUrl,
+				      name: 'file',
+				      success({ data }) {
+				        const res = JSON.parse(data)
+				        const { url } = res.data
+				        _this.modal.avatar = url
+				        console.log('-->data', _this.modal.avatar)
+				      }
+				    })
+				    // this.modal.avatar = detail.avatarUrl
+				    // console.log('data:image/png;base64,' + res.data)
+				  }
+				})
+				
 				
-				// uni.getFileSystemManager().readFile({
-				// 	filePath: e.detail.avatarUrl, //选择图片返回的相对路径
-				// 	encoding: 'base64', //编码格式
-				// 	success: res => { //成功的回调
-				// 		console.log(res);
-				// 		this.imgBase64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
-				// 		this.$api.my.UserUploadFile({
-				// 			file:this.imgBase64 
-				// 		}).then(res=>{
-				// 			console.log(res.data,'------->res.data');
-				// 		})
-						
-				// 	},
-				// 	fail: (e) => {
-				// 		console.log("图片转换失败");
-				// 	}
-				// })
 			},
 			//获取昵称
 			handleChangeNickname(res) {

+ 22 - 15
pages/login/youyue.vue

xqd
@@ -121,21 +121,28 @@
 				this.modal.show = true
 			},
 			// 微信获取头像
-			handleChooseAvatar(e) {
-				console.log(e.detail, '------>e.detail');
-				this.modal.avatar = e.detail.avatarUrl
-				// uni.getFileSystemManager().readFile({
-				// 	filePath: e.detail.avatarUrl, //选择图片返回的相对路径
-				// 	encoding: 'base64', //编码格式
-				// 	success: res => { //成功的回调
-				// 		console.log(res);
-				// 		this.imgBase64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
-				// 		this.modal.avatar = this.imgBase64
-				// 	},
-				// 	fail: (e) => {
-				// 		console.log("图片转换失败");
-				// 	}
-				// })
+			handleChooseAvatar({detail}) {
+				let _this = this
+				uni.getFileSystemManager().readFile({
+				  filePath:detail.avatarUrl, // 选择图片返回的相对路径
+				  encoding: 'base64', // 编码格式
+				  success: res => { // 成功的回调
+				    uni.uploadFile({
+				      url: _this.$setting.BASE_URL + '/v1/user/uploadFile',
+				      // filePath: 'data:image/png;base64,' + res.data,
+				      filePath: detail.avatarUrl,
+				      name: 'file',
+				      success({ data }) {
+				        const res = JSON.parse(data)
+				        const { url } = res.data
+				        _this.modal.avatar = url
+				        console.log('-->data', _this.modal.avatar)
+				      }
+				    })
+				    // this.modal.avatar = detail.avatarUrl
+				    // console.log('data:image/png;base64,' + res.data)
+				  }
+				})
 			},
 			handleChangeNickname(res) {
 				this.modal.nickname = res.detail.value

+ 12 - 5
pages/msg/msg.vue

xqd xqd
@@ -32,7 +32,7 @@
 							<text class="slot-button-text" style="color: red;">删除</text>
 						</view>
 					</template>
-					<view class="childBox" @click="jumpPage(item.type,item.relation_id)">
+					<view class="childBox" @click="jumpPage(item.type,item.relation_id,item.product_type)">
 						<view class="childBox-top">{{item.title}}</view>
 						<view class="childBox-content">
 							<text>{{item.content}}</text>
@@ -123,11 +123,18 @@
 			
 			
 			//跳转消息详情页面
-			jumpPage(type,id){
+			jumpPage(type,id,product_type){
 				if(type>2){
-					uni.navigateTo({
-						url:'/pages/my/prize/prize'
-					})
+					if(product_type == 1){
+						uni.navigateTo({
+							url:'/pages/my/prize/prize?product_type='+product_type
+						})
+					}else if(product_type == 2 ){
+						uni.navigateTo({
+							url:'/pages/my/prize/prize?product_type='+product_type
+						})
+					}
+					
 				}else{
 					uni.navigateTo({
 						url:'/pages/index/active-detail/index?id='+id

+ 26 - 3
pages/my/my.vue

xqd
@@ -185,9 +185,32 @@
 				})
 			},
 			// 微信获取头像
-			handleChooseAvatar(e) {
-				console.log(e.detail);
-				this.modal.avatar = e.detail.avatarUrl
+			handleChooseAvatar({detail}) {
+				// console.log(e.detail);
+				// this.modal.avatar = e.detail.avatarUrl
+				let _this = this
+				uni.getFileSystemManager().readFile({
+				  filePath:detail.avatarUrl, // 选择图片返回的相对路径
+				  encoding: 'base64', // 编码格式
+				  success: res => { // 成功的回调
+				    uni.uploadFile({
+				      url: _this.$setting.BASE_URL + '/v1/user/uploadFile',
+				      // filePath: 'data:image/png;base64,' + res.data,
+				      filePath: detail.avatarUrl,
+				      name: 'file',
+				      success({ data }) {
+				        const res = JSON.parse(data)
+				        const { url } = res.data
+				        _this.modal.avatar = url
+				        console.log('-->data', _this.modal.avatar)
+				      }
+				    })
+				    // this.modal.avatar = detail.avatarUrl
+				    // console.log('data:image/png;base64,' + res.data)
+				  }
+				})
+				
+				
 			},
 			handleChangeNickname(res) {
 				this.modal.nickname = res.detail.value

+ 47 - 12
pages/my/myorders/orderDetail.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -9,6 +9,16 @@
 			<view class="orderStatus" v-if="status == 4 && is_virtual == 0 && express_type == 1 ">已完成</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 class="nav-write" v-if="status == 4 && is_virtual == 1">
+				<text>核销时间:</text>
+				<text>{{goodsDet.complete_time}}</text>
+			</view>
+			<view class="nav-write" v-if="status == 4 && is_virtual == 0 && express_type == 2">
+				<text>核销时间:</text>
+				<text>{{goodsDet.complete_time}}</text>
+			</view>
+
 		</view>
 
 		<view class="midBox">
@@ -88,6 +98,15 @@
 				</view>
 				<view class="copyorder" @click="copyOrder(goodsDet.order_no)">复制</view>
 			</view>
+
+			<view class="myorder" style="margin-top: 68rpx;">
+				<view class="orderTitle">核销信息</view>
+				<view class="orderMsg"><text>核销员</text><text style="margin-left: 54rpx;">{{goodsDet.staff.user.nickname}}</text>
+				</view>
+				<view class="orderMsg"><text>核销时间</text><text style="margin-left: 26rpx;">{{goodsDet.complete_time}}</text>
+				</view>
+			</view>
+
 		</view>
 
 		<!-- 产品信息 -->
@@ -96,10 +115,11 @@
 				<text>产品信息</text>
 			</view>
 			<view class="shopCard">
-				<image :src="goodsDet.img_urls"></image>
+				<image v-if="goodsDet.product_type == 3 " :src="goodsDet.img_urls"></image>
+				<image v-if="goodsDet.product_type != 3 " style="border-radius: 12rpx;" :src="productImg[0]"></image>
 				<view style="margin-left: 24rpx;">
 					<text class="name">{{goodsDet.product_name}}</text>
-					<!-- <text class="tag">礼盒装 2000积分</text> -->
+					<text class="tag" v-if="source_type == 3">{{goodsDet.integral}}积分</text>
 				</view>
 			</view>
 			<view class="shopNumber">
@@ -123,12 +143,14 @@
 	export default {
 		data() {
 			return {
+				//产品图片
+				productImg: '',
 				//积分
-				integral:'',
+				integral: '',
 				//订单产品来源
-				source_type:'',
+				source_type: '',
 				//订单号
-				order_no:'',
+				order_no: '',
 				//门店详情
 				hotelDet: '',
 				//订单详情
@@ -148,7 +170,7 @@
 				this.order_id = o.id
 				this.orderDeatil()
 			}
-			if(o.order_no){
+			if (o.order_no) {
 				this.order_no = o.order_no
 				this.getConfirmOrderDetail()
 			}
@@ -175,15 +197,16 @@
 					this.hotelDet = res.data
 				})
 			},
-			
-			getConfirmOrderDetail(){
+
+			getConfirmOrderDetail() {
 				this.$api.orders.confirmOrderDetail({
-					order_no:this.order_no
-				}).then(res=>{
+					order_no: this.order_no
+				}).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
+					this.productImg = JSON.parse(res.data.img_urls)
 					this.source_type = res.data.source_type
 					this.integral = res.data.integral
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
@@ -191,7 +214,7 @@
 					}
 				})
 			},
-			
+
 			//订单详情
 			orderDeatil() {
 				this.$api.orders.getOrderDetail({
@@ -201,6 +224,7 @@
 					this.status = res.data.status
 					this.express_type = res.data.express_type
 					this.goodsDet = res.data
+					this.productImg = JSON.parse(res.data.img_urls)
 					this.source_type = res.data.source_type
 					this.integral = res.data.integral
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
@@ -246,7 +270,7 @@
 
 	.nav {
 		width: 750rpx;
-		height: 108rpx;
+		// height: 108rpx;
 		background: $bgColor;
 		border-radius: 0px 0px 16rpx 16rpx;
 		padding: 32rpx 0 0 28rpx;
@@ -260,6 +284,17 @@
 		}
 	}
 
+	//核销时间
+	.nav-write {
+		background-color: #FFFFFF;
+		color: #333333;
+		font-size: 40rpx;
+		margin-top: 32rpx;
+		padding-bottom: 36rpx;
+	}
+
+
+
 	.midBox {
 		margin-top: 24rpx;
 		width: 750rpx;

+ 32 - 40
pages/my/myorders/orders.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -23,14 +23,14 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="msg-null" v-if="orderList.length == 0 ">
 			<image src="https://t9.9026.com/imgs/dataNull.png" style="width: 394rpx;height: 396rpx;" mode=""></image>
 			<view class="msg-null-text">
 				<text>暂无数据</text>
 			</view>
 		</view>
-		
+
 		<view style="background-color: #f9f9f9;" v-if="orderList.length > 0 ">
 			<view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.id)">
 				<view class="toptitle">
@@ -47,7 +47,9 @@
 					<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>
+					<image v-if="item.product_type != 3 " :src="JSON.parse(item.img_urls)[0]"></image>
+					<image v-if="item.product_type == 3 " :src="item.img_urls"></image>
+
 					<view style="margin-left: 24rpx;">
 						<text class="name">{{item.product_name}}</text>
 						<text class="tag" v-if="item.source_type == 3">{{item.integral}}积分</text>
@@ -85,7 +87,7 @@
 			</view>
 		</view>
 		<!-- 已经到底啦 -->
-		<view class="home-bottom"  v-if="orderList.length > 0 ">
+		<view class="home-bottom" v-if="orderList.length > 0 ">
 			<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText" />
 		</view>
 
@@ -143,7 +145,7 @@
 			//确定收货
 			takeOver(id) {
 				uni.showLoading({
-					title:'加载中'
+					title: '加载中'
 				})
 				this.$api.orders.confirmReceipt({
 					order_id: id
@@ -230,40 +232,29 @@
 					title: "保存中..."
 				})
 				const that = this;
-				console.log(this.check_qrcode, '---->check_qrcode');
 				uni.downloadFile({
 					url: that.check_qrcode,
 					success: res => {
 						if (res.statusCode === 200) {
-							uni.getFileSystemManager().readFile({
-								filePath: res.tempFilePath, //选择图片返回的相对路径
-								encoding: 'base64', //编码格式
-								success: res => { //成功的回调
-									console.log(res);
-									// that.imgBase64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
-									that.imgBase64 = res.data //不加上这串字符,在页面无法显示的哦
-									uni.hideLoading()
-									uni.saveImageToPhotosAlbum({
-										filePath: that.imgBase64,
-										success: function() {
-											uni.showToast({
-												title: '已保存到相册',
-												icon: 'success',
-												duration: 2000
-											})
-											that.$refs.popup.close()
-										},
-										fail: function() {
-											uni.showToast({
-												title: '保存失败,请稍后重试',
-												icon: 'none',
-												duration: 2000
-											})
-										}
-									});
-
+							uni.hideLoading()
+							uni.saveImageToPhotosAlbum({
+								filePath: res.tempFilePath,
+								success: function() {
+									uni.showToast({
+										title: '已保存到相册',
+										icon: 'success',
+										duration: 2000
+									})
+									that.$refs.popup.close()
 								},
-							})
+								fail: function() {
+									uni.showToast({
+										title: '保存失败,请稍后重试',
+										icon: 'none',
+										duration: 2000
+									})
+								}
+							});
 						} else {
 							uni.hideLoading()
 							uni.showToast({
@@ -275,7 +266,7 @@
 					}
 				});
 			},
-		},
+		}
 	}
 </script>
 
@@ -299,21 +290,22 @@
 		padding-top: 80rpx;
 		background-color: #f9f9f9;
 	}
-	
-	
-	.msg-null{
+
+
+	.msg-null {
 		padding-top: 60rpx;
 		display: flex;
 		flex-direction: column;
 		align-items: center;
 		justify-content: center;
-		.msg-null-text{
+
+		.msg-null-text {
 			margin-top: 40rpx;
 			font-size: 28rpx;
 			color: #333;
 		}
 	}
-	
+
 
 
 	::v-deep .segmented-control__text {

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

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

+ 26 - 6
pages/my/verification/orderVerification.vue

xqd xqd xqd xqd xqd
@@ -19,20 +19,20 @@
 		<!-- 商品信息 -->
 		<view class="card" >
 			<view class="toptitle">
-				<view>洲际天堂大饭店</view>
+				<view>{{hotelName}}</view>
 				<view v-if="items.status == 3">未核销</view>
 				<view v-if="items.status == 4">已核销</view>
 			</view>
 			<view class="shopCard">
-				<image  :src="items.img_urls"></image>
+				<image style="border-radius: 12rpx;"  :src="productImg[0]"></image>
 				<view style="margin-left: 24rpx;">
 					<text class="name">{{items.product_name}}</text>
-					<text class="tag" v-if="items.source_type == 3">礼盒装 2000积分</text>
+					<text class="tag" v-if="items.source_type == 3"> {{items.integral}}积分</text>
 				</view>
 			</view>
 			<view class="points" v-if="items.source_type == 3">
 				<text class="totalName">共计:</text>
-				<text class="totalContent">2000积分</text>
+				<text class="totalContent">{{items.integral}}积分</text>
 			</view>
 			<view class="btn" >
 				<text>核销</text>
@@ -40,8 +40,8 @@
 		</view>
 		
 		<!-- 核销订单按钮 -->
-		<view class="bottombtn">
-			<view class="btnitem" @click="verificationOrder">
+		<view class="bottombtn" @click="verificationOrder">
+			<view class="btnitem">
 				<text>核销订单</text>
 			</view>
 		</view>
@@ -53,6 +53,10 @@
 	export default{
 		data(){
 			return{
+				//产品图片
+				productImg:'',
+				//酒店名称
+				hotelName:'',
 				//订单号
 				order_no:'',
 				//订单详情
@@ -84,6 +88,17 @@
 					this.FormData.contact = res.data.phone
 					this.FormData.date = res.data.created_at
 					this.order_no = res.data.order_no
+					this.productImg = JSON.parse(res.data.img_urls)
+					//酒店详情
+					this.hotelDetail(res.data.hotel_id)
+				})
+			},
+			//酒店详情
+			hotelDetail(id){
+				this.$api.hotel.getHotelDetail({
+					hotel_id:id
+				}).then(res=>{
+					this.hotelName = res.data.name
 				})
 			},
 			
@@ -106,6 +121,11 @@
 										title:'核销成功'
 									})
 									_this.orderDetail()
+									setTimeout(()=>{
+										uni.redirectTo({
+											url:'/pages/my/verification/verification?type='+2
+										})
+									},500)
 									
 								}else{
 									uni.showToast({

+ 10 - 4
pages/my/verification/verification.vue

xqd xqd xqd
@@ -35,7 +35,7 @@
 		</view>
 		
 		
-		<view  v-if="orderList.length > 0 ">
+		<view  v-if="orderList.length > 0 " style="background-color: #f9f9f9;">
 			<view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.order_no)" >
 				<view class="toptitle">
 					<view>{{item.hotel.name}}</view>
@@ -43,7 +43,9 @@
 					<view v-if="item.status == 4">已核销</view>
 				</view>
 				<view class="shopCard">
-					<image  :src="item.img_urls"></image>
+					<image v-if="item.product_type != 3 " :src="JSON.parse(item.img_urls)[0]"></image>
+					<image  v-if="item.product_type == 3 "  :src="item.img_urls"></image>
+					
 					<view style="margin-left: 24rpx;">
 						<text class="name">{{item.product_name}}</text>
 						<text class="tag" v-if="item.source_type == 3" >{{item.integral}}积分</text>
@@ -88,8 +90,12 @@
 				orderList:[],
 			}
 		},
-		onLoad() {
-			this.getMyOrder(1)
+		onLoad(o) {
+			if(o.type == 2){
+				this.checked(o.type)
+			}else{
+				this.getMyOrder(1)
+			}
 		},
 		methods:{