소스 검색

项目日志: 12.16 核销订单

gubai 2 년 전
부모
커밋
300781282c

+ 31 - 25
pages/goods/goods-detail/index.vue

xqd xqd xqd xqd
@@ -139,9 +139,9 @@
 			<view class="purchase" v-if="produceType == 1" @click="goIntegralOrder(product_id)">
 				<view class="purchase-btn">立即购买</view>
 			</view>
-			<view class="purchase" v-if="produceType == 2"  @click="selectSpecs">
-				<!-- <view class="purchase-btn">立即兑换</view> -->
-				<view class="purchase-btn">确认</view>
+			<view class="purchase" v-if="produceType == 2"  @click="selectSpecs(product_id)">
+				<view class="purchase-btn">立即兑换</view>
+				<!-- <view class="purchase-btn">确认</view> -->
 			</view>
 		</uni-popup>
 		<!-- 二维码购买 -->
@@ -351,8 +351,6 @@
 				this.$set(this.flavorIsActive, name, index)			
 				this.specs.flavor=name
 				if(Object.keys(this.flavorIsActive).length < this.sku.keys.length) return;
-
-
 				for(let index=0; index < this.sku.sku.length; index++){
 					const item = this.sku.sku[index];
 					let res = true;
@@ -363,27 +361,35 @@
 					}
 					if(res){
 						this.productDetail.price = item.price;
+						this.productDetail.integral = item.price
 						break;
 					}
-				}
-			},
-			// 重量切换
-			weightchecked(index,name) {
-				this.weightIsActive = index
-				this.specs.weight=name
-			},
-			// 包装切换
-			packchecked(index,name) {
-				this.packIsActive = index
-				this.specs.pack=name
+				}		
+						
 			},
+			// // 重量切换
+			// weightchecked(index,name) {
+			// 	this.weightIsActive = index
+			// 	this.specs.weight=name
+			// 	console.log(this.specs.weight);
+			// },
+			// // 包装切换
+			// packchecked(index,name) {
+			// 	this.packIsActive = index
+			// 	this.specs.pack=name
+			// 	console.log(this.specs.pack);
+			// },
 			// 选择规格
-			selectSpecs(){
-				this.specs.flavor='五仁'
-				this.specs.weight='50g'
-				this.specs.pack='礼盒'
-				console.log(this.specs)
-				this.specsText=this.specs.flavor+'--'+this.specs.weight+'--'+this.specs.pack
+			selectSpecs(id){
+				// this.specs.flavor='五仁'
+				// this.specs.weight='50g'
+				// this.specs.pack='礼盒'
+				// console.log(this.specs)
+				// this.specsText=this.specs.flavor+'--'+this.specs.weight+'--'+this.specs.pack
+				console.log(1111);
+				uni.navigateTo({
+					url:'/pages/my/integral/integralOrder?product_id='+id
+				})
 				this.Recipientclose()
 			},
 			Recipientopen() {
@@ -407,9 +413,9 @@
 					arr.push(flavorIsActive[key])
 				})
 				console.log(arr);
-				// uni.navigateTo({
-				// 	url:'/pages/my/integral/integralOrder?product_id='+id
-				// })
+				uni.navigateTo({
+					url:'/pages/my/integral/integralOrder?product_id='+id
+				})
 			},
 			// 跳转积分兑换
 			goIntegralOrder(id){

+ 28 - 16
pages/login/login.vue

xqd
@@ -92,25 +92,37 @@
 			},
 			// 获取头像
 			handleChooseAvatar(e) {
+				let _this = this
 				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.$api.my.UserUploadFile({
-							file:this.imgBase64 
-						}).then(res=>{
-							console.log(res.data,'------->res.data');
-						})
+				// uni.uploadFile({
+				// 	url:'https://t9.9026.com/static/image',
+				// 	fillPath:_this.modal.avatar,
+				// 	formData:{
+				// 		'user':'text'
+				// 	},
+				// 	success:(res)=>{
+				// 		console.log(res);
+				// 	}
+				// })
+				
+				// 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("图片转换失败");
-					}
-				})
+				// 	},
+				// 	fail: (e) => {
+				// 		console.log("图片转换失败");
+				// 	}
+				// })
 			},
 			//获取昵称
 			handleChangeNickname(res) {

+ 5 - 4
pages/my/integral/integralOrder.vue

xqd xqd xqd
@@ -220,12 +220,13 @@
 				return s // 单位千米
 			},
 			//门店列表
-			getHotel() {
+			getHotel(id) {
 				this.$api.hotel.getHotelList({
 					page: 1,
 					type: 2,
 					latitude: this.latitude,
-					longitude: this.longitude
+					longitude: this.longitude,
+					product_id:id
 				}).then(res => {
 					this.hotelList = res.data.data
 					this.hotelList.map(item => {
@@ -266,7 +267,7 @@
 							this.Data.express_type = 2
 							this.goLocation()
 							setTimeout(() => {
-								this.getHotel()
+								this.getHotel(id)
 							}, 1000)
 						}
 					} else {
@@ -432,7 +433,7 @@
 					this.Data.express_type = 2
 					this.goLocation()
 					setTimeout(() => {
-						this.getHotel()
+						this.getHotel(this.Data.product_id)
 					}, 1000)
 				}
 			},

+ 23 - 4
pages/my/myorders/orderDetail.vue

xqd xqd xqd xqd xqd
@@ -6,7 +6,7 @@
 			<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 == 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>
@@ -55,7 +55,7 @@
 						<text>收货地址</text>
 					</view>
 					<view class="deliverytext" v-if="goodsDet.express_type ==1">
-						<text>四川省 成都市 高新区 XXX小区 XXX号</text>
+						<text>{{goodsDet.area_text}} {{goodsDet.address}} </text>
 					</view>
 
 					<!-- 门店地址 -->
@@ -123,6 +123,8 @@
 	export default {
 		data() {
 			return {
+				//订单号
+				order_no:'',
 				//门店详情
 				hotelDet: '',
 				//订单详情
@@ -142,7 +144,10 @@
 				this.order_id = o.id
 				this.orderDeatil()
 			}
-
+			if(o.order_no){
+				this.order_no = o.order_no
+				this.getConfirmOrderDetail()
+			}
 		},
 
 		methods: {
@@ -166,7 +171,21 @@
 					this.hotelDet = res.data
 				})
 			},
-
+			
+			getConfirmOrderDetail(){
+				this.$api.orders.confirmOrderDetail({
+					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
+					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
+						this.hotelDetail(this.goodsDet.hotel_id)
+					}
+				})
+			},
+			
 			//订单详情
 			orderDeatil() {
 				this.$api.orders.getOrderDetail({

+ 16 - 9
pages/my/prize/exchangePrize.vue

xqd xqd xqd xqd
@@ -168,6 +168,8 @@
 				hotelList: [],
 				// 表单数据
 				Data: {
+					//奖品id
+					product_id:'',
 					order_id: '', //订单id
 					// 快递类型(1.快递发货 2.到店自提也是线下核销)
 					express_type: '',
@@ -213,12 +215,13 @@
 				return s // 单位千米
 			},
 			//门店列表
-			getHotel() {
+			getHotel(id) {
 				this.$api.hotel.getHotelList({
 					page: 1,
 					type: 2,
 					latitude: this.latitude,
-					longitude: this.longitude
+					longitude: this.longitude,
+					product_id:id
 				}).then(res => {
 					this.hotelList = res.data.data
 					this.hotelList.map(item => {
@@ -396,7 +399,7 @@
 					this.Data.express_type = 2
 					this.goLocation()
 					setTimeout(() => {
-						this.getHotel()
+						this.getHotel(this.product_id)
 					}, 1000)
 				}
 			},
@@ -423,19 +426,23 @@
 					is_virtual: type,
 					page: 0
 				}).then(res => {
+					this.prizeDetail = res.data.data.filter(item => {
+						return item.id == this.id
+					})
+					this.coverImg = this.prizeDetail[0].img_urls
+					this.Data.order_id = this.prizeDetail[0].order_id
+					this.product_id = this.prizeDetail[0].product_id
+					console.log(this.product_id,'----->this.product_id');
+					
 					if (this.isPhy == 2) {
 						this.isVerification = true
 						this.Data.express_type = 2
 						this.goLocation()
 						setTimeout(() => {
-							this.getHotel()
+							this.getHotel(this.product_id)
 						}, 1000)
 					}
-					this.prizeDetail = res.data.data.filter(item => {
-						return item.id == this.id
-					})
-					this.coverImg = this.prizeDetail[0].img_urls
-					this.Data.order_id = this.prizeDetail[0].order_id
+					
 				})
 			},
 		}

+ 8 - 4
pages/my/prize/prize.vue

xqd
@@ -34,15 +34,19 @@
 				<view class="ListItem" v-for="(item,index) in VirtualPrizes" :key="index">
 					<view class="title"><text>{{item.name}}</text></view>
 					<view class='data'><text>{{item.created_at}}</text></view>
-					<view class="alreadyBtn" v-if="item.status == 2">
-						<text>已兑换</text>
-					</view>
 					<view class="instantBtn" v-if="item.status == 1" @click="goExchangeVir(item.id)">
 						<text>立即兑换</text>
 					</view>
-					<view class="instantBtn" v-if="item.status == 3" >
+					<view class="alreadyBtn" v-if="item.status == 2">
+						<text>已兑换</text>
+					</view>
+					<view class="alreadyBtn" v-if="item.status == 3" >
 						<text>已过期</text>
 					</view>
+					<view class="alreadyBtn" v-if="item.status == 4" >
+						<text>未开始</text>
+					</view>
+					
 				</view>
 			</view>
 			

+ 6 - 11
pages/my/verification/verification.vue

xqd xqd xqd xqd
@@ -27,9 +27,9 @@
 			</view>
 		</view>
 		<view>
-			<view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.id)" >
+			<view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.order_no)" >
 				<view class="toptitle">
-					<view>洲际天堂大饭店</view>
+					<view>{{item.hotel.name}}</view>
 					<view v-if="item.status == 3">未核销</view>
 					<view v-if="item.status == 4">已核销</view>
 				</view>
@@ -62,6 +62,7 @@
 	export default{
 		data(){
 			return{
+				hotelName:'',
 				// 搜索
 				search:'',
 				// 分段器标题
@@ -84,9 +85,9 @@
 		methods:{
 			
 			// 跳转订单详情
-			goOrderDetail(id) {
+			goOrderDetail(order_no) {
 				uni.navigateTo({
-					url: '/pages/my/myorders/orderDetail?id=' + id
+					url: '/pages/my/myorders/orderDetail?order_no=' + order_no
 				})
 			},
 			// 获取订单列表
@@ -128,13 +129,7 @@
 			// 跳转核销订单
 			goOrderVF(id){
 				uni.navigateTo({
-					url:'/pages/my/verification/orderVerification?order_id='+id
-				})
-			},
-			// 跳转核销详情
-			goDetail(){
-				uni.navigateTo({
-					url:'/pages/my/verification/verificationDetail'
+					url:'/pages/my/verification/orderVerification?order_no='+id
 				})
 			},
 			// 扫码