2 Commits 5fa0da34cb ... c3c2c31338

Author SHA1 Message Date
  gubai c3c2c31338 项目日志: 12.16 合并 2 years ago
  gubai e4858cbb14 项目日志: 12.16 扫描核销 2 years ago

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

xqd xqd xqd xqd
@@ -139,7 +139,7 @@
 			<view class="purchase" v-if="produceType == 1" @click="goIntegralOrder">
 				<view class="purchase-btn">立即购买</view>
 			</view>
-			<view class="purchase" v-if="produceType == 2"  @click="selectSpecs(product_id)">
+			<view class="purchase" v-if="produceType == 2"  @click="selectSpecs(product_id,flavorIsActive)">
 				<view class="purchase-btn">立即兑换</view>
 				<!-- <view class="purchase-btn">确认</view> -->
 			</view>
@@ -403,10 +403,25 @@
 			// 	this.specs.pack=name
 			// 	console.log(this.specs.pack);
 			// },
-			// 选择规格
-			selectSpecs(id){
+			// 立即兑换
+			selectSpecs(id,flavorIsActive){
+				const resArr = [];
+				outer: for(const k in this.flavorIsActive){	
+					inner: for(const i in this.attr_groups){
+						if(this.attr_groups[i].attr_group_name == k){
+							laster: for(const l in this.attr_groups[i].attr_list){
+								if(this.attr_groups[i].attr_list[l].attr_name == this.flavorIsActive[k]){
+									resArr.push(this.attr_groups[i].attr_list[l].attr_id);
+									break inner;
+								}
+							}
+						}
+					}
+				}
+				const selectedIds = resArr.join(':');
+				console.log(this.productDetail.integral);
 				uni.navigateTo({
-					url:'/pages/my/integral/integralOrder?product_id='+id
+					url:`/pages/my/integral/integralOrder?product_id=${this.productDetail.id}&attr=${selectedIds}&integral=${this.productDetail.integral}`
 				})
 				this.Recipientclose()
 			},
@@ -424,16 +439,7 @@
 				this.current1 = e.detail.current;
 			},
 			//积分兑换
-			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
-				// })
+			goProductChange(id,flavorIsActive){
 				const resArr = [];
 				outer: for(const k in this.flavorIsActive){	
 					inner: for(const i in this.attr_groups){
@@ -449,7 +455,7 @@
 				}
 				const selectedIds = resArr.join(':');
 				uni.navigateTo({
-					url:`/pages/my/integral/integralOrder?product_id=${this.productDetail.id}&attr=${selectedIds}`
+					url:`/pages/my/integral/integralOrder?product_id=${this.productDetail.id}&attr=${selectedIds}&integral=${this.productDetail.integral}`
 				})
 
 			},

+ 10 - 8
pages/index/index.vue

xqd xqd xqd xqd
@@ -114,7 +114,7 @@
 			<image style="width: 690rpx;height: 156rpx;border-radius: 79rpx;" :src="advInsetImg.img" mode=""></image>
 		</view>
 		<!-- 酒店推荐 -->
-		<view class="home-hotel home-special-area">
+		<view class="home-hotel home-special-area" v-if="false">
 			<view class="home-special-area-left">
 				<text>西区优品</text>
 				<view class="text-shadow"></view>
@@ -124,7 +124,7 @@
 		</view>
 
 		<!-- 酒店推荐图片 -->
-		<view class="home-hotel-img" >
+		<view class="home-hotel-img" v-if="false">
 			<view class="home-hotel-img-content" v-if="isDevelopment">
 				<template v-for="(item,index) in goodsList" >
 					<view v-if="item.status==1" class="home-hotel-img-content-item" :key="index"
@@ -318,15 +318,15 @@
 		onLoad() {
 			this.getGoodsList()
 			this.getAllSet()
-			// this.isDevelopment = process.env.NODE_ENV === 'development';
+			// this.isDevelopment = process.env.NODE_ENV === 'development';
 			this.isDevelopment = true;
 			//用户访问
-			this.getUserVisits()
-			
-			uni.navigateTo({
-				url: "/pages/goods/goods-lucky/index"
-			})
+			this.getUserVisits()
 			
+			// uni.navigateTo({
+			// 	url: "/pages/goods/goods-lucky/index"
+			// })
+
 		},
 		methods: {
 			// **************** Data ***************//
@@ -688,6 +688,8 @@
 								this.$store.dispatch('user/token', token)
 								// 获取活动列表
 								this.getList()
+								//用户访问
+								this.getUserVisits()
 							})
 						})
 					}

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

xqd xqd xqd xqd
@@ -67,11 +67,11 @@
 				<text>产品信息</text>
 			</view>
 			<view class="shopCard">
-				<image :src="productDetail.cover_img?productDetail.cover_img:'http://t9.9026.com/imgs/Kudosbg.png'">
+				<image :src="productDetail.cover_img">
 				</image>
 				<view style="margin-left: 24rpx;">
 					<text class="name">{{productDetail.name}}</text>
-					<text class="tag">礼盒装 </text>
+					<!-- <text class="tag">礼盒装 </text> -->
 				</view>
 			</view>
 			<view class="shopNumber">
@@ -80,12 +80,12 @@
 			</view>
 			<view class="shopNumber">
 				<text>积分</text>
-				<text>{{productDetail.integral}}积分</text>
+				<text>{{integral}}积分</text>
 			</view>
 			<view style="width: 694rpx;height: 4rpx;border: 2rpx solid #F2F2F2;margin-top: 38rpx;"></view>
 			<view class="shopNumber">
 				<text>合计</text>
-				<text>{{productDetail.integral}}积分</text>
+				<text>{{integral}}积分</text>
 			</view>
 		</view>
 		<!-- 兑换按钮 -->
@@ -151,6 +151,8 @@
 		},
 		data() {
 			return {
+				//积分
+				integral:'',
 				//选中激活样式
 				activeIndex: '',
 				activeIndex2: '',
@@ -205,6 +207,8 @@
 		onLoad(op) {
 			console.log(op, "产品id")
 			this.Data.product_id = op.product_id
+			this.Data.attr= op.attr
+			this.integral = op.integral
 			this.getProductDetail(op.product_id)
 		},
 		methods: {

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

xqd xqd xqd xqd
@@ -106,14 +106,14 @@
 				<text>件数</text>
 				<text>1件</text>
 			</view>
-			<view class="shopNumber" v-if="false">
+			<view class="shopNumber" v-if="source_type == 3">
 				<text>积分</text>
-				<text>2000积分</text>
+				<text>{{integral}}积分</text>
 			</view>
 			<view style="width: 694rpx;height: 4rpx;border: 2rpx solid #F2F2F2;margin-top: 38rpx;"></view>
-			<view class="shopNumber" v-if="false">
+			<view class="shopNumber" v-if="source_type == 3">
 				<text>合计</text>
-				<text>2000积分</text>
+				<text>{{integral}}积分</text>
 			</view>
 		</view>
 	</view>
@@ -123,6 +123,10 @@
 	export default {
 		data() {
 			return {
+				//积分
+				integral:'',
+				//订单产品来源
+				source_type:'',
 				//订单号
 				order_no:'',
 				//门店详情
@@ -180,6 +184,8 @@
 					this.status = res.data.status
 					this.express_type = res.data.express_type
 					this.goodsDet = res.data
+					this.source_type = res.data.source_type
+					this.integral = res.data.integral
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
 						this.hotelDetail(this.goodsDet.hotel_id)
 					}
@@ -195,6 +201,8 @@
 					this.status = res.data.status
 					this.express_type = res.data.express_type
 					this.goodsDet = res.data
+					this.source_type = res.data.source_type
+					this.integral = res.data.integral
 					if (this.goodsDet.express_type == 2 && this.goodsDet.hotel_id) {
 						this.hotelDetail(this.goodsDet.hotel_id)
 					}

+ 56 - 35
pages/my/myorders/orders.vue

xqd xqd xqd xqd xqd xqd
@@ -23,17 +23,18 @@
 				</view>
 			</view>
 		</view>
-		<view>
+		<view style="background-color: #f9f9f9;">
 			<view class="card" v-for="(item,index) in orderList" :key="index" @click="goOrderDetail(item.id)">
 				<view class="toptitle">
 					<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 && 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>
 					<view v-if="item.status == 3 && item.is_virtual == 1">待核销</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 == 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>
@@ -41,19 +42,25 @@
 					<image :src="item.img_urls"></image>
 					<view style="margin-left: 24rpx;">
 						<text class="name">{{item.product_name}}</text>
-						<!-- <text class="tag">礼盒装 2000积分</text> -->
+						<text class="tag" v-if="item.source_type == 3">{{item.integral}}积分</text>
 					</view>
 				</view>
 				<view class="points">
 					<text class="totalName" style="margin-right: 50rpx;">共{{item.product_num}}件</text>
-					<text class="totalName" v-if="item.integral != 0">共计:</text>
-					<text class="totalContent" v-if="item.integral !=0">2000积分</text>
+					<text class="totalName" v-if="item.source_type == 3">共计:</text>
+					<text class="totalContent" v-if="item.source_type == 3">{{item.integral}}积分</text>
 				</view>
 				<view class="btn">
-					<view class="btnitem" @click.stop="openVFcode" v-if="item.status == 3 && item.is_virtual == 1">
+					<view class="btnitem" @click.stop="openVFcode(item.check_qrcode)"
+						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">
+					<view class="btnitem" @click.stop="openVFcode(item.check_qrcode)"
+						v-if="item.status == 3 && item.is_virtual == 0&&item.express_type == 2">
+						<text>核销码</text>
+					</view>
+					<view class="btnitem" @click.stop="openVFcode(item.check_qrcode)"
+						v-if="item.status ==2 && item.is_virtual == 0&&item.express_type == 2">
 						<text>核销码</text>
 					</view>
 					<view class="btnitem" v-if="item.status == 1">
@@ -80,7 +87,7 @@
 				<view class="title"><text>核销码</text></view>
 				<view style="margin-left:30rpx;width: 580rpx;height: 2rpx;background: #F0F0F0;"></view>
 				<view class="img">
-					<image :src="qrcode"></image>
+					<image :src="check_qrcode"></image>
 				</view>
 				<view class="btn">
 					<view class="cancel" @click="closeVFcode"><text>取消</text></view>
@@ -98,7 +105,7 @@
 		data() {
 			return {
 				//核销码
-				qrcode: 12231231, //二维码内容(扫码识别后需要访问的网址)
+				check_qrcode: '', //二维码内容(扫码识别后需要访问的网址)
 				// 搜索
 				search: '',
 				// 分段器标题
@@ -195,13 +202,11 @@
 				})
 			},
 			// 打开弹出层
-			openVFcode() {
+			openVFcode(check_qrcode) {
+				console.log(check_qrcode, '----->check_qrcode');
+				this.check_qrcode = check_qrcode
 				this.$refs.popup.open()
 
-
-
-
-
 			},
 			// 关闭弹出层
 			closeVFcode() {
@@ -209,27 +214,43 @@
 			},
 			// 保存图片
 			handleDownImg() {
-				this.$refs.popup.close()
-				// const that = this;
-				// uni.downloadFile({
-				//     url:'网络路径',
-				//     success: res => {
-				//         if (res.statusCode === 200) {
-				//             uni.saveImageToPhotosAlbum({
-				//                 filePath: res.tempFilePath,
-				//                 success: function() {
-				//                     this.tools.toast('保存成功');
-				// 		this.$refs.popup.close()
-				//                 },
-				//                 fail: function() {
-				//                     this.tools.toast('保存失败,请稍后重试');
-				//                 }
-				//             });
-				//         } else {
-				//             this.tools.toast('下载失败');
-				//         }
-				//     }
-				// });
+				uni.showLoading({
+					title: "保存中..."
+				})
+				const that = this;
+				uni.downloadFile({
+					url: that.check_qrcode,
+					success: res => {
+						if (res.statusCode === 200) {
+							uni.hideLoading()
+							uni.saveImageToPhotosAlbum({
+								filePath: res.tempFilePath,
+								success: function() {
+									uni.showToast({
+										title: '已保存到相册',
+										icon: 'success',
+										duration: 2000
+									})
+									this.$refs.popup.close()
+								},
+								fail: function() {
+									uni.showToast({
+										title: '保存失败,请稍后重试',
+										icon: 'none',
+										duration: 2000
+									})
+								}
+							});
+						} else {
+							uni.hideLoading()
+							uni.showToast({
+								title: '下载失败',
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					}
+				});
 			},
 		},
 	}

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

xqd
@@ -431,7 +431,8 @@
 					})
 					this.coverImg = this.prizeDetail[0].img_urls
 					this.Data.order_id = this.prizeDetail[0].order_id
-					this.product_id = this.prizeDetail[0].product_id
+					this.Data.product_id = this.prizeDetail[0].product_id
+					this.product_id = this.Data.product_id 
 					console.log(this.product_id,'----->this.product_id');
 					
 					if (this.isPhy == 2) {

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

xqd
@@ -68,16 +68,16 @@
 			}
 		},
 		onLoad(o) {
-			if(o.order_id){
-				this.order_id = o.order_id
+			if(o.order_no){
+				this.order_no = o.order_no
 				this.orderDetail()
 			}
 		},
 		methods:{
 			//订单详情
 			orderDetail(){
-				this.$api.orders.getOrderDetail({
-					order_id:this.order_id
+				this.$api.orders.confirmOrderDetail({
+					order_no:this.order_no
 				}).then(res=>{
 					this.items = res.data
 					this.FormData.name = res.data.receiver

+ 13 - 8
pages/my/verification/verification.vue

xqd xqd
@@ -37,14 +37,14 @@
 					<image  :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" >礼盒装 2000积分</text>
+						<text class="tag" v-if="item.source_type == 3" >{{item.integral}}积分</text>
 					</view>
 				</view>
 				<view class="points" v-if="item.source_type == 3" >
 					<text class="totalName">共计:</text>
-					<text class="totalContent">2000积分</text>
+					<text class="totalContent">{{item.integral}}积分</text>
 				</view>
-				<view class="btn" @click.stop="goOrderVF(item.id)" v-if="item.status == 3">
+				<view class="btn" @click.stop="goOrderVF(item.order_no)" v-if="item.status == 3">
 					<text>核销</text>
 				</view>
 			</view>
@@ -127,18 +127,23 @@
 				})
 			},
 			// 跳转核销订单
-			goOrderVF(id){
+			goOrderVF(order_no){
 				uni.navigateTo({
-					url:'/pages/my/verification/orderVerification?order_no='+id
+					url:'/pages/my/verification/orderVerification?order_no='+order_no
 				})
 			},
 			// 扫码
 			scanCode(){
 				uni.scanCode({
 					success: function (res) {
-						console.log(res);
-						console.log('条码类型:' + res.scanType);
-						console.log('条码内容:' + res.result);
+						if(res.scanType == 'QR_CODE'){
+							uni.navigateTo({
+								url:'/pages/my/verification/orderVerification?order_no='+res.result
+							})
+						}
+						// console.log(res);
+						// console.log('条码类型:' + res.scanType);
+						// console.log('条码内容:' + res.result);
 					}
 				});
 			}

+ 4 - 2
setting.js

xqd
@@ -2,8 +2,10 @@
  * Created by JianJia.Zhou<jianjia.zhou> on 2022/3/18.
  */
 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 = {
   // 版本