| @@ -6,35 +6,33 @@ Component({ | |||
| properties: { | |||
| list: { | |||
| value: [], | |||
| type: Array, | |||
| }, | |||
| type: Array | |||
| } | |||
| }, | |||
| /** | |||
| * 组件的初始数据 | |||
| */ | |||
| data: { | |||
| swiperCurrent: 0, | |||
| swiperCurrent: 0 | |||
| }, | |||
| /** | |||
| * 组件的方法列表 | |||
| */ | |||
| ready(){ | |||
| }, | |||
| ready() {}, | |||
| methods: { | |||
| swiperChange: function (e) { | |||
| swiperChange: function(e) { | |||
| this.setData({ | |||
| swiperCurrent: e.detail.current | |||
| }) | |||
| }); | |||
| }, | |||
| gotobannerdetail:function(e){ | |||
| console.log("我要点击进入banner详情页面") | |||
| gotobannerdetail: function(e) { | |||
| console.log("我要点击进入banner详情页面"); | |||
| console.log(e.currentTarget.dataset.id); | |||
| wx.navigateTo({ | |||
| url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}`, | |||
| }) | |||
| url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}` | |||
| }); | |||
| } | |||
| } | |||
| }) | |||
| }); | |||
| @@ -31,11 +31,7 @@ var config = { | |||
| * 优惠券详情 | |||
| */ | |||
| couponDetail: "/wxCoupon/detail", | |||
| /** | |||
| * bannerlist优惠券的详情页面 | |||
| */ | |||
| bannercoupondetai:"/wxCoupon/detailC", | |||
| /** | |||
| * 业态查询 | |||
| */ | |||
| @@ -37,7 +37,7 @@ | |||
| </view> --> | |||
| <!-- 优惠券 --> | |||
| <navigator wx:for="{{data.coupons}}" wx:key="{{index}}" url="/pages/coupon/detail/index?couponChannelId=iambannercoupon&couponId={{item.id}}"> | |||
| <navigator wx:for="{{data.coupons}}" wx:key="{{index}}" url="/pages/coupon/detail/index?couponChannelId={{item.id}}&couponId={{item.couponId}}"> | |||
| <!-- 首页优惠券列表页面 --> | |||
| <view class="coupons1"> | |||
| <view class="coupons1-img"> | |||
| @@ -24,9 +24,9 @@ Page({ | |||
| onLoad(options) { | |||
| let that = this; | |||
| console.log(options); | |||
| console.log(options.couponChannelId); | |||
| console.log(options.couponId); | |||
| console.log("传的变量的名字叫Id"); | |||
| console.log("couponChannelId" + options.couponChannelId); | |||
| console.log("couponId" + options.couponId); | |||
| console.log("传的变量的名字叫couponId"); | |||
| /** | |||
| * 首页banner detail couponlist传过来的值 | |||
| * iambannercoupon | |||
| @@ -43,32 +43,17 @@ Page({ | |||
| // // this.orderFunc(); | |||
| // } | |||
| // else { | |||
| if (options.couponChannelId == "iambannercoupon") { | |||
| that.setData({ | |||
| couponId: options.couponId | |||
| }); | |||
| /** | |||
| * 待解决 | |||
| */ | |||
| var parmer = { | |||
| url: config.api.bannercoupondetai, | |||
| data: { | |||
| couponId: options.couponId | |||
| } | |||
| }; | |||
| } else { | |||
| that.setData({ | |||
| couponChannelId: options.couponChannelId, | |||
| couponId: options.couponId | |||
| }); | |||
| var parmer = { | |||
| url: config.api.couponDetail, | |||
| data: { | |||
| couponChannelId: options.couponChannelId | |||
| } | |||
| }; | |||
| } | |||
| // } | |||
| that.setData({ | |||
| couponChannelId: options.couponChannelId, | |||
| couponId: options.couponId | |||
| }); | |||
| var parmer = { | |||
| url: config.api.couponDetail, | |||
| data: { | |||
| couponChannelId: options.couponChannelId | |||
| } | |||
| }; | |||
| Http.get(parmer).then(res => { | |||
| console.log(res); | |||
| console.log("details"); | |||
| @@ -234,14 +219,11 @@ Page({ | |||
| if (res.errMsg == "requestPayment:ok") { | |||
| wx.showToast({ | |||
| title: "购买成功", | |||
| duration: 2500 | |||
| duration: 2500, | |||
| }); | |||
| /** | |||
| * 用户支付成功以后跳转到券包列表 | |||
| */ | |||
| wx.redirectTo({ | |||
| url: '/pages/couponorder/index/index', | |||
| }) | |||
| } | |||
| }, | |||
| @@ -256,21 +238,6 @@ Page({ | |||
| // var url = res.data.url; | |||
| // console.log("get url", url); | |||
| if (res.errMsg == "requestPayment:ok") { | |||
| wx.showModal({ | |||
| title: "提示", | |||
| content: "支付成功" | |||
| }); | |||
| // if (url) { | |||
| // setTimeout(function () { | |||
| // wx.redirectTo({ | |||
| // url: "/pages" + url | |||
| // }); | |||
| // }, 2000); | |||
| // } else { | |||
| // setTimeout(() => { | |||
| // wx.navigateBack(); | |||
| // }, 2000); | |||
| // } | |||
| } else { | |||
| wx.showToast({ | |||
| title: "支付失败", | |||
| @@ -40,8 +40,8 @@ Page({ | |||
| }); | |||
| }); | |||
| } | |||
| util.barcode("barcode", options.quancode, 680, 100); | |||
| util.qrcode("qrcode", options.quancode, 400, 400); | |||
| util.barcode("barcode", options.quancode, 510, 100); | |||
| util.qrcode("qrcode", options.quancode,350, 350); | |||
| }, | |||
| phone: function() { | |||
| let that = this; | |||
| @@ -16,7 +16,7 @@ | |||
| <text>有效期至:</text> | |||
| <text>{{expiredTime}}</text> | |||
| </view> | |||
| <view class="panel"> | |||
| <!-- <view class="panel"> | |||
| <view class="barcode"> | |||
| <canvas canvas-id="barcode" /> | |||
| </view> | |||
| @@ -27,8 +27,27 @@ | |||
| <canvas canvas-id="qrcode" /> | |||
| </view> | |||
| <view class="barnum"><text>兑换码:</text>{{code}}</view> | |||
| </view> --> | |||
| <view class="zhuangtai"> | |||
| <image wx:if="{{data.couponOrderStatus==1}}" src="./../../../assets/img/wm01.jpg"></image> | |||
| <image wx:if="{{data.couponOrderStatus==2}}" src="./../../../assets/img/wm02.jpg"></image> | |||
| <image wx:if="{{data.couponOrderStatus==3}}" src="./../../../assets/img/wm03.jpg"></image> | |||
| <view class="panel" wx:if="{{data.couponOrderStatus==0}}"> | |||
| <view class="barcode"> | |||
| <canvas canvas-id="barcode" /> | |||
| </view> | |||
| <view class="qrcode"> | |||
| <canvas canvas-id="qrcode" /> | |||
| </view> | |||
| <view class="barnum buy"><text>兑换码:</text>{{code}}</view> | |||
| </view> | |||
| </view> | |||
| <view class="posi"> | |||
| <view class="tit"> | |||
| 适用门店 | |||
| @@ -2,17 +2,16 @@ | |||
| padding-bottom: 10rpx; | |||
| } | |||
| .panel { | |||
| display: flex; | |||
| flex-direction: column; | |||
| justify-content: space-between; | |||
| align-items: stretch; | |||
| box-sizing: border-box; | |||
| width: 710rpx; | |||
| margin-top: 40rpx; | |||
| .panel,.zhuangtai image{ | |||
| width: 510rpx; | |||
| height: 581rpx; | |||
| display: block; | |||
| border-radius: 10rpx; | |||
| background-color: #fff; | |||
| margin: 30rpx auto 0; | |||
| margin: 22rpx auto 0; | |||
| padding: 30rpx 0; | |||
| position: relative; | |||
| z-index: 10000000000; | |||
| } | |||
| .pane2{ | |||
| background: #fff; | |||
| @@ -24,58 +23,55 @@ | |||
| margin: 40rpx auto 0; | |||
| } | |||
| .buy { | |||
| background: #fff; | |||
| height: 88rpx; | |||
| width: 98%; | |||
| margin: 30rpx auto 0; | |||
| color: #7e7e7e; | |||
| line-height: 88rpx; | |||
| border-radius: 16rpx; | |||
| border: 1px solid #eee; | |||
| } | |||
| .barcode { | |||
| display: flex; | |||
| height: 100rpx; | |||
| flex-direction: column; | |||
| justify-content: center; | |||
| align-items: center; | |||
| width: 510rpx; | |||
| margin: 0 auto; | |||
| } | |||
| .barnum { | |||
| width: 670rpx; | |||
| height: 46rpx; | |||
| line-height: 46rpx; | |||
| font-size: 30rpx; | |||
| font-size: 24rpx; | |||
| text-align: center; | |||
| letter-spacing: 2rpx; | |||
| white-space: nowrap; | |||
| color: #999; | |||
| color: #7f7f7f; | |||
| } | |||
| .barnum text { | |||
| color: #333; | |||
| color: #767676; | |||
| } | |||
| .barcode > canvas { | |||
| width: 680rpx; | |||
| width: 510rpx; | |||
| height: 100rpx; | |||
| } | |||
| .qrcode { | |||
| height: 370rpx; | |||
| position: relative; | |||
| height: 350rpx; | |||
| width: 350rpx; | |||
| display: flex; | |||
| flex-direction: column; | |||
| justify-content: flex-end; | |||
| align-items: center; | |||
| margin: 0 auto; | |||
| } | |||
| .qrcode image{ | |||
| position: absolute; | |||
| width: 160rpx; | |||
| height: 160rpx; | |||
| right:0; | |||
| bottom: 0; | |||
| top: 0; | |||
| left: 0; | |||
| margin: auto; | |||
| z-index: 1000000000; | |||
| border-radius:50%; | |||
| } | |||
| .qrcode > canvas { | |||
| position: relative; | |||
| width: 400rpx; | |||
| height: 400rpx; | |||
| width: 350rpx; | |||
| height: 350rpx; | |||
| } | |||
| .coupon_detail { | |||
| padding: 0 20rpx; | |||
| } | |||
| @@ -152,7 +148,6 @@ | |||
| width: 100%; | |||
| display: flex; | |||
| flex-direction: column; | |||
| margin-top: 50rpx; | |||
| background: #fff; | |||
| border-bottom: 20rpx solid #f5f5f5; | |||
| border-top: 20rpx solid #f5f5f5; | |||
| @@ -75,13 +75,13 @@ Component({ | |||
| if (key == 0) { | |||
| var param = { | |||
| pageNum: pageNum, | |||
| pageSize: 8, | |||
| pageSize: 16, | |||
| targetAd: 1 | |||
| }; | |||
| } else { | |||
| var param = { | |||
| pageNum: pageNum, | |||
| pageSize: 8, | |||
| pageSize: 16, | |||
| business: key, | |||
| targetAd: 1 | |||
| }; | |||
| @@ -1,3 +1,3 @@ | |||
| .index-coupons{ | |||
| height:2036rpx; | |||
| height:820rpx; | |||
| } | |||
| @@ -22,8 +22,6 @@ Page({ | |||
| var scene = decodeURIComponent(options.scene); | |||
| if (app.globalData.token && app.globalData.token != null) { | |||
| } else { | |||
| // 由于是网络请求,可能会在 Page.onLoad 之后才返回 | |||
| // 所以此处加入 callback 以防止这种情况 | |||
| wx.login({ | |||
| success: ({ code }) => { | |||
| console.log(code); | |||
| @@ -106,9 +106,6 @@ Page({ | |||
| duration: 2500 | |||
| }); | |||
| } | |||
| wx.navigateBack({ | |||
| delta: 2 | |||
| }); | |||
| }, | |||
| fail: res => { | |||
| that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | |||
| @@ -117,25 +114,7 @@ Page({ | |||
| }, | |||
| complete: res => { | |||
| console.log(res); | |||
| console.log("支付完成"); | |||
| // var url = res.data.url; | |||
| // console.log("get url", url); | |||
| if (res.errMsg == "requestPayment:ok") { | |||
| wx.showModal({ | |||
| title: "提示", | |||
| content: "支付成功" | |||
| }); | |||
| // if (url) { | |||
| // setTimeout(function () { | |||
| // wx.redirectTo({ | |||
| // url: "/pages" + url | |||
| // }); | |||
| // }, 2000); | |||
| // } else { | |||
| // setTimeout(() => { | |||
| // wx.navigateBack(); | |||
| // }, 2000); | |||
| // } | |||
| } else { | |||
| wx.showToast({ | |||
| title: "支付失败", | |||
| @@ -38,7 +38,7 @@ | |||
| --> | |||
| <!-- | |||
| orderStatus | |||
| 0 | |||
| 1 | |||
| 只有支付完成的时 | |||
| 才显示兑换码 | |||
| --> | |||
| @@ -35,17 +35,7 @@ Page({ | |||
| gotopay:function(e){ | |||
| console.log("orderId"+e.currentTarget.dataset.id); | |||
| wx.navigateTo({ | |||
| url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&flag='pay'`, | |||
| success: function(res){ | |||
| // success | |||
| }, | |||
| fail: function() { | |||
| // fail | |||
| }, | |||
| complete: function() { | |||
| // complete | |||
| } | |||
| }) | |||
| url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&flag='pay'`}) | |||
| }, | |||
| getList(key, pageNum) { | |||
| let that = this; | |||
| @@ -59,13 +49,13 @@ Page({ | |||
| if (key == 'all') { | |||
| var variable = { | |||
| pageNum: pageNum, | |||
| pageSize: 5, | |||
| pageSize: 15, | |||
| paymentType:0 | |||
| }; | |||
| } else { | |||
| var variable = { | |||
| pageNum: pageNum, | |||
| pageSize: 5, | |||
| pageSize: 15, | |||
| orderStatus: key, | |||
| paymentType:0 | |||
| }; | |||
| @@ -9,18 +9,22 @@ | |||
| 2 已过期 | |||
| 3 已经退款 | |||
| --> | |||
| <view class="panel"> | |||
| <view class="barcode"> | |||
| <canvas canvas-id="barcode" /> | |||
| <view class="zhuangtai"> | |||
| <image wx:if="{{couponorderstatus==1}}" src="./../../assets/img/wm01.jpg"></image> | |||
| <image wx:if="{{couponorderstatus==2}}" src="./../../assets/img/wm02.jpg"></image> | |||
| <image wx:if="{{couponorderstatus==3}}" src="./../../assets/img/wm03.jpg"></image> | |||
| <view class="panel" wx:if="{{couponorderstatus==0}}"> | |||
| <view class="barcode"> | |||
| <canvas canvas-id="barcode" /> | |||
| </view> | |||
| <view class="qrcode"> | |||
| <canvas canvas-id="qrcode" /> | |||
| </view> | |||
| <view class="barnum buy"><text>兑换码:</text>{{code}}</view> | |||
| </view> | |||
| <view class="qrcode"> | |||
| <canvas canvas-id="qrcode" /> | |||
| <image wx:if="{{couponorderstatus==1}}" src="./../../assets/img/wm01.jpg"></image> | |||
| <image wx:if="{{couponorderstatus==2}}" src="./../../assets/img/wm02.jpg"></image> | |||
| <image wx:if="{{couponorderstatus==3}}" src="./../../assets/img/wm03.jpg"></image> | |||
| </view> | |||
| <view class="barnum buy"><text>兑换码:</text>{{code}}</view> | |||
| </view> | |||
| <view class="gou"> | |||
| <view class="mai">购买须知:</view> | |||
| <view class="remark">{{remark}}</view> | |||
| @@ -32,8 +32,9 @@ page { | |||
| margin-top: 16rpx; | |||
| text-align: center; | |||
| } | |||
| .panel { | |||
| width: 600rpx; | |||
| .panel,.zhuangtai image{ | |||
| width: 510rpx; | |||
| height: 581rpx; | |||
| border-radius: 10rpx; | |||
| background-color: #fff; | |||
| margin: 22rpx auto 0; | |||
| @@ -41,6 +42,7 @@ page { | |||
| position: relative; | |||
| z-index: 10000000000; | |||
| } | |||
| .pane2 { | |||
| background: #fff; | |||
| opacity: 0.6; | |||
| @@ -84,18 +86,6 @@ page { | |||
| justify-content: flex-end; | |||
| align-items: center; | |||
| } | |||
| .qrcode image{ | |||
| position: absolute; | |||
| width: 160rpx; | |||
| height: 160rpx; | |||
| right:0; | |||
| bottom: 0; | |||
| top: 0; | |||
| left: 0; | |||
| margin: auto; | |||
| z-index: 1000000000; | |||
| border-radius:50%; | |||
| } | |||
| .qrcode > canvas { | |||
| width: 350rpx; | |||
| @@ -125,7 +115,6 @@ page { | |||
| line-height: 88rpx; | |||
| border-radius: 16rpx; | |||
| border: 1px solid #eee; | |||
| margin-top:40rpx; | |||
| } | |||
| .gou{ | |||
| width: 87%; | |||