Jelajahi Sumber

优惠卷修改

tyb 1 Minggu lalu
induk
melakukan
56fd0c0bbe

+ 21 - 21
config/api.js

@@ -1,35 +1,35 @@
-// 以下是业务服务器API地址 
-//  var WxApiRoot = 'http://127.0.0.1:8081/wx/';  
+// 以下是业务服务器API地址
+//  var WxApiRoot = 'http://127.0.0.1:8081/wx/';
 // uat环境使用
-//  var WxApiRoot = 'https://uat.jzmall.lifejingzhi.com/wx/'; 
- 
-//新版,宅洁士  
-var WxApiRoot='https://mall.zhaijieshi.cc/wx/'; 
-   
-   
+//  var WxApiRoot = 'https://uat.jzmall.lifejingzhi.com/wx/';
+
+//新版,宅洁士
+var WxApiRoot='https://mall.zhaijieshi.cc/wx/';
+
+
 module.exports = {
   IndexUrl: WxApiRoot + 'home/index', //首页数据接口
   AboutUrl: WxApiRoot + 'home/about', //介绍信息
-  
+
   CatalogList: WxApiRoot + 'catalog/index', //分类目录全部分类数据接口
   CatalogCurrent: WxApiRoot + 'catalog/current', //分类目录当前分类数据接口
 
-  AuthLoginByWeixin: WxApiRoot + 'auth/login_by_weixin', //微信登录--并注册 
+  AuthLoginByWeixin: WxApiRoot + 'auth/login_by_weixin', //微信登录--并注册
   AuthLogout: WxApiRoot + 'auth/logout', //账号登出
   AuthRegister: WxApiRoot + 'auth/register', //账号注册
-  AuthReset: WxApiRoot + 'auth/reset', //账号密码重置 
+  AuthReset: WxApiRoot + 'auth/reset', //账号密码重置
   AuthBindPhone: WxApiRoot + 'auth/bindPhone', //绑定微信手机号
   AuthDenPhone: WxApiRoot + 'auth/denPhone', //微信手机号解密
   AuthCert:WxApiRoot + 'auth/certification',//实名认证
   AuthIsCert:WxApiRoot + 'auth/iscertification',//是否实名认证
 	AuthInfo:WxApiRoot + 'auth/info',//拿手机
-	
+
   GoodsCount: WxApiRoot + 'goods/count', //统计商品总数
   GoodsList: WxApiRoot + 'goods/list', //获得商品列表
   GoodsList_a2: WxApiRoot + 'goods/list_a2', //获得商品列表
   GoodsCategory: WxApiRoot + 'goods/category', //获得分类数据
   GoodsDetail: WxApiRoot + 'goods/detail', //获得商品的详情
-  GoodsRelated: WxApiRoot + 'goods/related', //商品详情页的关联商品(大家都在看) 
+  GoodsRelated: WxApiRoot + 'goods/related', //商品详情页的关联商品(大家都在看)
   GoodsL1Category:WxApiRoot+'goods/categoryGoods',//类目下所有商品
   GoodsCoupon:WxApiRoot+'goods/couponGoods',//返回优惠券绑定的商品
 
@@ -127,9 +127,9 @@ module.exports = {
   PetIndex:WxApiRoot+"pet/index",//获取宠物保险所有拼音
   PetBreed:WxApiRoot+"pet/breed",//获取宠物品类
 
-  OrderBookGetShop:WxApiRoot+"orderbook/getShop",//根据经纬度获取门店 
+  OrderBookGetShop:WxApiRoot+"orderbook/getShop",//根据经纬度获取门店
   OrderCheckAddress:WxApiRoot+"orderbook/checkAddress",//收货地址校验
-  OrderBookDefaultAddress:WxApiRoot+"address/default",//获取默认用户地址 
+  OrderBookDefaultAddress:WxApiRoot+"address/default",//获取默认用户地址
   getDefaultCityShop: WxApiRoot + 'address/getDefaultCityShop', //小程序默认系统地址
 
   ActivityOngoing:WxApiRoot+"assistance/ongoing",//当前存在的助力活动
@@ -158,7 +158,7 @@ module.exports = {
   prepayMember:WxApiRoot + 'member/prepayMember', //POST 准备购买会员,提交给微信生成订单
   payMemberNotify:WxApiRoot + 'member/payMember-notify', //微信支付通知 POST
 
-  
+
   RefBcodeInfo:WxApiRoot + 'referee/refBcodeInfo', //根据输入的引荐码查询信息
 
 
@@ -173,16 +173,16 @@ module.exports = {
   RefereeCashoutApply:WxApiRoot+'referee/cashout',//提现申请
   RefereeCashoutAuthCheck:WxApiRoot+'referee/authCheck',//实名认证检查
   RefereeCashoutAuth:WxApiRoot+'referee/auth',//实名认证
-  
+
   RefereeMemberPoster:WxApiRoot+'qrcode/createMemberPoster',//生成会员卡赠送海报
-  RefereeMemberCardReceive:WxApiRoot+'member/cardReceive',//会员卡领取 
+  RefereeMemberCardReceive:WxApiRoot+'member/cardReceive',//会员卡领取
 
   GetMemberAd:WxApiRoot+'ad/getMemberAd',//会员活动广告接口
 
   EveryDayStock:WxApiRoot+'/orderbook/everyDayStock',//单次卡库存
   checkRecommend:WxApiRoot+'order/checkRecommend',//推荐码
 	CPQrCode:WxApiRoot+'cp/qrCode',//获取加企微的活码
-	
+
   getTradeOrderList:WxApiRoot +'customerRerutnApi/getTradeOrderList',//工单详情,传bookDetailId
   getConsoultType:WxApiRoot +'customerRerutnApi/getConsoultType',//企业回访数据
   saveVisitBatch:WxApiRoot +'customerRerutnApi/saveVisitBatch',//提交企业回访数据
@@ -203,6 +203,6 @@ module.exports = {
 	getOrderInfo:WxApiRoot +'order/getOrderInfo',//获取订单信息
 	customerBook:WxApiRoot +'order/customerBook',//	客户预约
 	getBooked:WxApiRoot + 'orderbook/getBooked',
-	
-
+	getCouponPackageOne:WxApiRoot + 'coupon/getCouponPackageOne', //查询未被领取的卡卷包
+	couponPackageReceive:WxApiRoot + 'coupon/couponPackageReceive', //卡卷包领取
 };

+ 2 - 2
pages/ucenter/couponGoods/couponGoods.js

@@ -7,7 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    couponName: '',
+    coupon: '',
     goodsList: [],
     couponId: 0,
     addressInfo: {}
@@ -42,7 +42,7 @@ Page({
         if (res.errno === 0) {
           that.setData({
             goodsList: res.data.list,
-            couponName: res.data.couponName
+            coupon: res.data.coupon
           });
           if (res.data.list.length == 0)
             wx.navigateTo({ 

+ 5 - 1
pages/ucenter/couponGoods/couponGoods.wxml

@@ -1,6 +1,10 @@
 <view class="container">
   <view class="cate-nav"> 
-        <view class="name">优惠券:{{couponName}}</view>  
+        <view class="name">优惠券:{{coupon.name}}</view>
+				<view class="desc" wx:if="{{coupon.voucherType==3}}">商品兑换件数:{{coupon.goodsNum}} 件</view>   
+				<view class="desc" wx:if="{{coupon.voucherType!=3}}">
+				{{coupon.discount}}{{coupon.voucherType==1?'元':'折'}} | 满{{coupon.min}}元可用
+				</view>  
   </view> 
     <view class="cate-item"> 
       <view class="b" wx:if="{{goodsList.length>0}}">

+ 10 - 0
pages/ucenter/couponGoods/couponGoods.wxss

@@ -50,6 +50,16 @@
   width: auto;
 }
 
+.desc {
+  display: block;
+  height: 84rpx;
+  padding: 0 20rpx;
+  line-height: 84rpx;
+  color: #333;
+	font-size: 35rpx;
+	font-weight: bold;
+  width: auto;
+}
 .cate-nav .item.active .name {
  color: #09afff;
  border-bottom: 2px solid  #09afff;

+ 60 - 5
pages/ucenter/couponList/couponList.js

@@ -33,7 +33,10 @@ Page({
       },
     ],
     totalList: [],
-    options: '' //页面参数
+		options: '', //页面参数
+		showTc:false,
+		couponPackage:{},
+		coupon:{}
   },
 
   /**
@@ -44,7 +47,8 @@ Page({
       this.setData({
         options: options
       });
-    }
+		}
+		console.log(3)
     console.info(options)
     let scene = options.scene;
 
@@ -69,14 +73,36 @@ Page({
   exchange(options) {
     let that = this;
     if (options.scene) {
+			console.log(2000)
       let scene = decodeURIComponent(options.scene);
       var couponId, fraId;
       if (scene && scene.indexOf("fraId") >= 0) {
         //fraId,加盟商id:优惠券id    加盟商发的优惠券 
         var paras = scene.split(",")[1];
         fraId = paras.split(":")[0];
-        couponId = paras.split(":")[1];  
-      } else {
+				couponId = paras.split(":")[1]; 
+      } else  if (scene && scene.indexOf("pkSn") >= 0) {
+					//卡卷包领取 
+					console.log(3000)
+					console.log(scene)
+					var paras = scene.split(",")[1];
+					let pkSn = paras.split(";")[0];
+					
+					//查询可领取卡包券
+					util.request(api.getCouponPackageOne, {
+						pkSn: pkSn
+					}, "GET").then(res => {
+						if (res.errno == 0) {
+							this.setData({
+								showTc:true,
+								couponPackage:res.data.couponPackage,
+								coupon:res.data.coupon
+							})
+						} else util.showErrorToast(res.errmsg);
+						this.getCouponList();
+					})
+					return;
+			}	else  {
         // id,12;type,0
         var paras = scene.split(";");
         console.info(paras)
@@ -375,7 +401,36 @@ Page({
 
     this.getCouponList();
   },
-
+	closePupCoupon(){
+		this.setData({
+			showTc:false
+		})
+	},
+	drawDown(){
+			console.log('卡券包领取')
+			let that=this
+			util.request(api.couponPackageReceive, {
+				pkSn: that.data.couponPackage.pkSn
+			}, "POST").then(res => {
+				if (res.errno == 0) {
+					wx.showToast({
+						title: '领取成功,已发放至您的账户',
+						icon: 'none'
+					})
+					this.setData({
+						showTc:false,
+					})
+					this.getCouponList();
+				} else {
+					wx.showToast({
+						title: res.errmsg,
+						icon: 'none'
+					})
+				}
+				
+			})
+			
+	}
 
 
 })

+ 19 - 1
pages/ucenter/couponList/couponList.wxml

@@ -138,4 +138,22 @@
 
     <view class="no-list" wx:if="{{couponList==0}}">没有更多了</view>
   </view>
-</view>
+</view>
+
+<view class="pup-up-coupon"  bindtap="closePupCoupon" wx:if='{{showTc}}'>
+		<view class="tc" catchtap="drawDown">
+		<view class="pkName">{{couponPackage.pkName}}</view>
+		<view class="num">{{couponPackage.pkNumber}}</view>
+		<view class="box">
+		<!-- <view class="money">7.9<span>折</span></view> -->
+			<view class="{{coupon.voucherType==3?'couponName':'money'}}">{{coupon.voucherType==3?coupon.name:coupon.discount}}
+			<span wx:if="{{coupon.voucherType!=3}}">{{coupon.voucherType==1?'元':'折'}}</span>
+			</view>
+			<view class="couponNameDesc">{{coupon.voucherType==3?'无门槛立即兑换':'满'+coupon.min+'元可用'}}</view> 
+		<!-- <view class="couponName">测试2兑换券</view>
+		<view class="couponNameDesc">无门槛立即兑换</view> -->
+	  </view>
+		</view>
+    <!-- <icon bindtap="closePupCoupon" class="icon-small close-icon" type="cancel" color="rgb(178,187,182)" size="25"/> -->
+		
+	</view>

+ 93 - 1
pages/ucenter/couponList/couponList.wxss

@@ -485,4 +485,96 @@ margin:10rpx;
   background: #4E4E4E;
   color: #fff;
   /* border: 2rpx solid #09AFFF; */
-}
+}
+
+.pup-up-coupon{
+  width: 100vw;
+  height: 100vh;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
+}
+.pup-up-coupon image{ /* 设不设都行 */	
+  width: 550rpx;
+	height: 550rpx;
+	border-radius: 10rpx;
+}
+.pup-up-coupon .close-icon{
+  position: absolute;
+  right: 360rpx;
+  top: 70%;
+}
+
+.tc{
+	font-family:'阿里巴巴普惠体 2 55 Regular';
+	width: 550rpx;
+	height: 550rpx;
+	background-image: url('https://jzmall.lifejingzhi.com/file/jzmall/weixin/yhj.png');
+	background-size:cover;
+	background-repeat: no-repeat;
+	background-position: center;
+}
+.pkName{
+	text-align: center;
+	font-weight: bold;
+	color: #862B0B;
+	line-height: 55rpx;
+}
+.num{
+	text-align: center;
+	font-weight: bold;
+	color: #802003;
+	line-height: 100rpx;
+	font-size: 55rpx;
+}
+.money{
+	display: flex;
+	flex-wrap: wrap;
+	align-items: center;
+	width: 170rpx;
+	color: #FEFAFA;
+	font-weight: bold;
+	font-size: 80rpx;
+	margin-left: 70rpx;
+	/* margin-top: 55rpx; */
+}
+
+.money>span{
+	color: #FEFAFA;
+	font-weight: bold;
+	font-size: 30rpx;
+	padding-top: 30rpx;
+}
+.couponName{
+	display: flex;
+	flex-wrap: wrap;
+	align-items: center;
+	color: #FEFAFA;
+	font-weight: bold;
+	width: 150rpx;
+	font-size: 45rpx;
+	margin-left: 70rpx;
+}
+.couponNameDesc{
+	display: flex;
+	flex-wrap: wrap;
+	align-items: center;
+	color: #FEFAFA;
+	font-weight: bold;
+	width: 250rpx;
+	height: 240rpx;
+	font-size: 35rpx;
+	margin-left: 20rpx;
+}
+
+.box{
+	width: 510rpx;
+	height: 240rpx;
+	display: flex;
+	justify-content: space-between;
+}