浏览代码

共富券

m 1 年之前
父节点
当前提交
03dd9df480
共有 2 个文件被更改,包括 67 次插入7 次删除
  1. 32 4
      src/packageGoods/order/detail.vue
  2. 35 3
      src/packagePrize/prize/index.vue

+ 32 - 4
src/packageGoods/order/detail.vue

@@ -95,7 +95,8 @@
 					<view class="card" v-if="item.useLink">
 						<view class="card-left">使用链接:</view>
 						<view class="ells-one card-center">{{item.useLink}}</view>
-						<view class="card-right" @click="copyUseLink(item.useLink)">复制</view>
+						<view class="card-right" v-if="!item.quanxiaole" @click="copyUseLink(item.useLink)">复制</view>
+						<view class="card-right" v-if="item.quanxiaole" @click="openWindow(item.useLink)">使用</view>
 					</view>
 					<view class="cardList" v-for="(items,indexs) in item.cardList" :key="indexs">
 						<view class="card">
@@ -165,6 +166,7 @@
 	import $http from '@/utils/request.js'
 	import appId from '@/config/appId.js'
 	import Auth from '../../components/auth/auth.vue'
+// import { log } from 'console'
 	export default {
 		components: {
 			Auth
@@ -211,7 +213,14 @@
 							ele.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/170';
 						});
 					});
-					this.deliverList = res.data.deliverList;
+					this.deliverList = res.data.deliverList;
+					let list = res.data.items;
+					list.map(item=>{
+						item.quanxiaole = 0;
+						if(item.useLink.indexOf('https://es-recharge.0x00.tech/coupon')>-1){
+							item.quanxiaole = 1;
+						}
+					})
 					this.list = res.data.items
 				}).catch(() => {
 					uni.hideLoading();
@@ -223,7 +232,26 @@
 					url: `/packagePrize/goods/detail?id=${ item.goodsId }`
 				})
 			},
-
+            openWindow(obj){
+			    let couponReceiveIdArr = obj.split('=');
+				let couponReceiveId = couponReceiveIdArr[1];
+				if(couponReceiveId){
+					  let path = `pages/user/voucherCenter/voucherCenter?couponReceiveId=${couponReceiveId}`;
+					  wx.navigateToMiniProgram({
+					  			   appId:'wxcf5741c1d906fcf2',
+					  			   path: path,
+					  			   // extraData: {
+					  			   //   foo: 'bar'
+					  			   // },
+					  			   envVersion: 'trial',
+					  			   success(res) {
+					  			 	  // console.log(res)
+					  			     // 打开成功
+					  			   }
+					  })
+				}
+				
+			},
 			cancelOrder() {
 				let orderId = this.orderId
 				uni.showModal({
@@ -247,7 +275,7 @@
 					}
 				})
 			},
-
+            
 			payOrder() {
 				let _this = this
 				let payIng = false

+ 35 - 3
src/packagePrize/prize/index.vue

@@ -696,11 +696,43 @@
 			},
 
 			toPrizeGoods(item) {
-				uni.navigateTo({
-					url: `/packagePrize/goods/detail?id=${ item.goodsId }`
+				 if(item.useLink){
+					let useLink = item.useLink;
+					let couponReceiveIdArr = useLink.split('=');
+					let couponReceiveId = couponReceiveIdArr[1];
+					if(couponReceiveId&&useLink.indexOf('https://es-recharge.0x00.tech/coupon')>-1){
+						this.openWindow(couponReceiveId);
+					}else{
+						uni.navigateTo({
+							url: `/packagePrize/goods/detail?id=${ item.goodsId }`
+						})
+					}
+				}else{
+					uni.navigateTo({
+						url: `/packagePrize/goods/detail?id=${ item.goodsId }`
+					})
+				}
+				
+				
+			},
+			openWindow(couponReceiveId){ 
+				let path = `pages/user/voucherCenter/voucherCenter?couponReceiveId=${couponReceiveId}`;
+				// console.log(path)
+				// return;
+				wx.navigateToMiniProgram({
+							   appId:'wxcf5741c1d906fcf2',
+							   path: path,
+							   // extraData: {
+							   //   foo: 'bar'
+							   // },
+							   envVersion: 'trial',
+							   success(res) {
+							 	  // console.log(res)
+							     // 打开成功
+							   }
 				})
+				
 			},
-			
 			toDrawShow(item) {
 				this.drawShow = true
 				this.drawId = item.id