diff --git a/app.json b/app.json index 5f383e0..7200a0c 100644 --- a/app.json +++ b/app.json @@ -4,7 +4,6 @@ "pages/passCar/choiceCar/choiceCar", "pages/bannerdetail/index", "pages/getuserinfo/index", - "pages/getphoneInfo/index", "pages/phoneinput/phoneinput", "pages/market/index", "pages/user/index", @@ -20,8 +19,9 @@ "pages/login/index", "pages/park/park", "pages/passCar/passCar", + "pages/getphoneInfo/index", "pages/addPark/addPark", - "pages/youhuiquanma/index", + "pages/orderquanma/index", "pages/passCar/couponList/couponList" ], "tabBar": { diff --git a/app.wxss b/app.wxss index 8d32e91..99e15d2 100644 --- a/app.wxss +++ b/app.wxss @@ -1,97 +1,105 @@ -@import 'weui.wxss'; +@import "weui.wxss"; @font-face { - font-family: 'iconfont'; /* project id 777313 */ - src: url('//at.alicdn.com/t/font_777313_jq7td4d3uab.eot'); - src: url('//at.alicdn.com/t/font_777313_jq7td4d3uab.eot?#iefix') format('embedded-opentype'), - url('//at.alicdn.com/t/font_777313_jq7td4d3uab.woff') format('woff'), - url('//at.alicdn.com/t/font_777313_jq7td4d3uab.ttf') format('truetype'), - url('//at.alicdn.com/t/font_777313_jq7td4d3uab.svg#iconfont') format('svg'); - } + font-family: "iconfont"; /* project id 777313 */ + src: url("//at.alicdn.com/t/font_777313_jq7td4d3uab.eot"); + src: url("//at.alicdn.com/t/font_777313_jq7td4d3uab.eot?#iefix") + format("embedded-opentype"), + url("//at.alicdn.com/t/font_777313_jq7td4d3uab.woff") format("woff"), + url("//at.alicdn.com/t/font_777313_jq7td4d3uab.ttf") format("truetype"), + url("//at.alicdn.com/t/font_777313_jq7td4d3uab.svg#iconfont") format("svg"); +} .iconfont { - font-family: "iconfont" !important; - font-size: 36rpx; - font-style: normal; - -webkit-font-smoothing: antialiased; - -webkit-text-stroke-width: 0.2rpx; - -moz-osx-font-smoothing: grayscale; + font-family: "iconfont" !important; + font-size: 36rpx; + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2rpx; + -moz-osx-font-smoothing: grayscale; } /* 定位 */ -.icon-dingweib:before { content: "\e652"; } +.icon-dingweib:before { + content: "\e652"; +} /* 三角 */ -.icon-choose:before { content: "\e601"; } +.icon-choose:before { + content: "\e601"; +} /* 右箭头 */ -.icon-right:before { content: "\e612"; } +.icon-right:before { + content: "\e612"; +} /* 边框 */ .app-border-top, .app-border-bottom { - position: relative; - width: 100%; + position: relative; + width: 100%; } .app-border-top::after, .app-border-bottom::after { - content: ''; - position: absolute; - background-color: #ddd; - display: block !important; - z-index: 1; - top: auto; - right: auto; - width: 100%; - height: 1rpx; - transform-origin: 50% 100%; - transform: scaleY(0.5); + content: ""; + position: absolute; + background-color: #ddd; + display: block !important; + z-index: 1; + top: auto; + right: auto; + width: 100%; + height: 1rpx; + transform-origin: 50% 100%; + transform: scaleY(0.5); } .app-border-top:last-child:after, .app-border-bottom:last-child::after { - display: none !important; + display: none !important; } .app-border-top::after { - top: 0; + top: 0; } .app-border-bottom::after { - bottom: 0; + bottom: 0; } .app-border-left, .app-border-right { - position: relative; - height: 100%; + position: relative; + height: 100%; } .app-border-left::before, .app-border-right::before { - content: ''; - position: absolute; - background-color: #ddd; - display: block; - z-index: 1; - top: 0; - bottom: 0; - height: 100%; - width: 1rpx; - transform-origin: 50% 100%; - transform: scaleX(0.5); + content: ""; + position: absolute; + background-color: #ddd; + display: block; + z-index: 1; + top: 0; + bottom: 0; + height: 100%; + width: 1rpx; + transform-origin: 50% 100%; + transform: scaleX(0.5); } .app-border-left::before { - left: 0; + left: 0; } .app-border-right::before { - right: 0; + right: 0; } -view{ - font-family: PingFangSC-Semibold; +view, +text { + font-family: PingFangSC-Semibold; } -page{ +page { width: 100%; height: 100%; + font-weight: 400; } - diff --git a/assets/img/bg.png b/assets/img/bg.png index 018744c..5d3b249 100644 Binary files a/assets/img/bg.png and b/assets/img/bg.png differ diff --git a/assets/img/fail.png b/assets/img/fail.png index 406cda1..698614a 100644 Binary files a/assets/img/fail.png and b/assets/img/fail.png differ diff --git a/assets/img/food.png b/assets/img/food.png deleted file mode 100644 index 8ee9b8b..0000000 Binary files a/assets/img/food.png and /dev/null differ diff --git a/assets/img/guoqi.jpg b/assets/img/guoqi.jpg deleted file mode 100644 index ddbfc91..0000000 Binary files a/assets/img/guoqi.jpg and /dev/null differ diff --git a/assets/img/guoqi.png b/assets/img/guoqi.png deleted file mode 100644 index c4f0fa9..0000000 Binary files a/assets/img/guoqi.png and /dev/null differ diff --git a/assets/img/home-n.svg b/assets/img/home-n.svg deleted file mode 100644 index f42bc5e..0000000 --- a/assets/img/home-n.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/img/home-y.svg b/assets/img/home-y.svg deleted file mode 100644 index 5747b94..0000000 --- a/assets/img/home-y.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/img/home0.png b/assets/img/home0.png deleted file mode 100644 index 09fad63..0000000 Binary files a/assets/img/home0.png and /dev/null differ diff --git a/assets/img/home1.png b/assets/img/home1.png deleted file mode 100644 index 0f1aab0..0000000 Binary files a/assets/img/home1.png and /dev/null differ diff --git a/assets/img/loading.gif b/assets/img/loading.gif new file mode 100644 index 0000000..d53de68 Binary files /dev/null and b/assets/img/loading.gif differ diff --git a/assets/img/pass0.png b/assets/img/pass0.png index f71cdcf..109c748 100644 Binary files a/assets/img/pass0.png and b/assets/img/pass0.png differ diff --git a/assets/img/pass1.png b/assets/img/pass1.png index e9291de..fc131a2 100644 Binary files a/assets/img/pass1.png and b/assets/img/pass1.png differ diff --git a/assets/img/shiyong.jpg b/assets/img/shiyong.jpg deleted file mode 100644 index d57f90e..0000000 Binary files a/assets/img/shiyong.jpg and /dev/null differ diff --git a/assets/img/success.png b/assets/img/success.png new file mode 100644 index 0000000..945dde7 Binary files /dev/null and b/assets/img/success.png differ diff --git a/assets/img/tel.jpg b/assets/img/tel.jpg new file mode 100644 index 0000000..773ec83 Binary files /dev/null and b/assets/img/tel.jpg differ diff --git a/assets/img/tel.gif b/assets/img/tel.png similarity index 100% rename from assets/img/tel.gif rename to assets/img/tel.png diff --git a/assets/img/tui.jpg b/assets/img/tui.jpg deleted file mode 100644 index 733f0c7..0000000 Binary files a/assets/img/tui.jpg and /dev/null differ diff --git a/assets/img/user-n.svg b/assets/img/user-n.svg deleted file mode 100644 index 5975a3d..0000000 --- a/assets/img/user-n.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/img/user-y.svg b/assets/img/user-y.svg deleted file mode 100644 index c11cdaf..0000000 --- a/assets/img/user-y.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/img/wm01.jpg b/assets/img/wm01.jpg new file mode 100644 index 0000000..c36df7d Binary files /dev/null and b/assets/img/wm01.jpg differ diff --git a/assets/img/wm02.jpg b/assets/img/wm02.jpg new file mode 100644 index 0000000..b6ad053 Binary files /dev/null and b/assets/img/wm02.jpg differ diff --git a/assets/img/wm03.jpg b/assets/img/wm03.jpg new file mode 100644 index 0000000..0840ef7 Binary files /dev/null and b/assets/img/wm03.jpg differ diff --git a/components/banner/index.js b/components/banner/index.js index 27376c7..ee42217 100644 --- a/components/banner/index.js +++ b/components/banner/index.js @@ -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}` + }); } } -}) +}); diff --git a/components/coupons/index.wxml b/components/coupons/index.wxml index ee55585..bf2d09f 100644 --- a/components/coupons/index.wxml +++ b/components/coupons/index.wxml @@ -20,11 +20,12 @@ - 剩余: {{data.remainInventory}} + 剩余: {{data.remainInventory}} - 领取 - 购买 + 领取 + 购买 + 已售罄 diff --git a/components/coupons/index.wxss b/components/coupons/index.wxss index 8d3d2aa..271e333 100644 --- a/components/coupons/index.wxss +++ b/components/coupons/index.wxss @@ -1,4 +1,5 @@ @import "../../app.wxss"; + .coupons { flex-direction: row; display: flex; @@ -6,6 +7,7 @@ position: relative; height: 184rpx; } + .coupons-border { height: 1rpx; /* width: 100%; */ @@ -15,16 +17,19 @@ position: absolute; bottom: 0; } + .coupons-img { width: 248rpx; height: 184rpx; overflow: hidden; + border: 1px solid #f8f8f8; border-radius: 10rpx; } .coupons-img image { width: 100%; height: 100%; + border-radius: 10rpx; } .coupons-info { @@ -32,27 +37,40 @@ } .coupons-info-name { - font-size: 28rpx; - color: #000000; + font-size: 30rpx; + color: #343434; letter-spacing: 0; line-height: 38rpx; } + .coupons-info-price { padding: 32rpx 0 0; } -.i{ - font-size: 20rpx; + +.i { + font-size: 24rpx; font-style: normal; } + .coupons-info-price-p { display: inline-block; font-size: 36rpx; color: #f96563; line-height: 50rpx; + font-weight: 600; } -.tit{ - margin-top: 32rpx; + +.tit { + margin-top: 14rpx; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 300rpx; + height: 40rpx; + font-weight: 600; + font-size: 30rpx; } + .coupons-info-price-o { display: block; text-align: center; @@ -91,26 +109,48 @@ padding: 0 !important; font-family: PingFangSC-Semibold; font-size: 28rpx; - color: #ffffff !important; + color: #fff !important; + letter-spacing: 0; + height: 50rpx !important; + width: 138rpx !important; + line-height: 50rpx !important; +} +.coupons-btn-gms { + background: #999!important; + border-radius: 10rpx !important; + opacity: .6; + margin: 0 !important; + padding: 0 !important; + font-family: PingFangSC-Semibold; + font-size: 28rpx; + color: #fff !important; letter-spacing: 0; height: 50rpx !important; width: 138rpx !important; line-height: 50rpx !important; } .subtitle { - font-size: 22rpx; - color: #333; - font-weight: 100; + font-size: 24rpx; + color: #6f6f6f; text-align: left; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 300rpx; + height: 40rpx; + margin-top: 8rpx; } + .coupons-info-manjian { - color: #fa7c7a; + color: #6f6f6f !important; + font-weight: normal; font-size: 20rpx; line-height: 34rpx; display: inline-block; } /**上拉加载更多**/ + .userinfo { display: flex; flex-direction: column; @@ -127,16 +167,21 @@ .userinfo-nickname { color: #aaa; } -.sy{ + +.sy { display: block; - text-align: center; + text-align: left; + width: 136rpx; + font-size: 24rpx; + color: #6f6f6f; + height: 40rpx; + margin-top: 8rpx; } + .usermotto { margin-top: 200px; } -/**/ - scroll-view { width: 100%; } diff --git a/config/config.js b/config/config.js index e788e02..5e5a995 100755 --- a/config/config.js +++ b/config/config.js @@ -1,7 +1,7 @@ var config = { - name: "富茂", + name: "富茂科技", url: "https://ciformall.youlane.cn/C/api", - //url: "http://fd1a0cab.ngrok.io/C/api", + // url: "http://fd1a0cab.ngrok.io/C/api", api: { /** * 接口用途:login @@ -23,14 +23,11 @@ var config = { * 检查用户手机授权状态 */ checkPhoneStatus: "/user/checkPhoneStatus", - /** - * 优惠券查询 - */ - couponList: "/wxCoupon/list", /** * 优惠券详情 */ couponDetail: "/wxCoupon/detail", + /** * 业态查询 */ @@ -119,7 +116,14 @@ var config = { /** * banner详情页面 */ - bannerDetail: "/wxCampaign/findById" + bannerDetail: "/wxCampaign/findById", + /** + * 授权个人信息 + * 和授权手机号 + * 和login页面 + * 页面的图标 + */ + marketicon:'/mall/getAppIcon' }, weapp: { diff --git a/pages/bannerdetail/index.wxml b/pages/bannerdetail/index.wxml index 8d94e04..333cecb 100644 --- a/pages/bannerdetail/index.wxml +++ b/pages/bannerdetail/index.wxml @@ -37,7 +37,7 @@ --> - + diff --git a/pages/bannerdetail/index.wxss b/pages/bannerdetail/index.wxss index 17f9b83..59b1183 100644 --- a/pages/bannerdetail/index.wxss +++ b/pages/bannerdetail/index.wxss @@ -1,4 +1,5 @@ @import "../../app.wxss"; + .coupons { width: 100%; background: #f6f6f6; @@ -25,7 +26,7 @@ height: 120rpx; display: flex; justify-content: space-between; - padding: 0 4%; + padding: 0 4% 4%; background: #fff; } @@ -36,7 +37,7 @@ .coupons_info view:nth-child(1) text { font-size: 30rpx; - margin-top: 3%; + margin-top: 10%; } .coupons_info view:nth-child(1) text:nth-child(1) text { @@ -141,14 +142,14 @@ color: #b8b8b8; padding-top: 10rpx; } + .notes view:nth-child(1) { width: 92%; height: 87rpx; padding: 0 4%; line-height: 87rpx; background: #fff; - border-bottom: 1rpx solid #f5f5f5; - border-top: 1rpx solid #f5f5f5; + /* border-top: 1rpx solid #f5f5f5; */ } .notes view:nth-child(1) text { @@ -159,7 +160,7 @@ .notes view:nth-child(2) { width: 92%; height: auto; - padding:4%; + padding: 0 4% 4%; background: #fff; border-bottom: 1rpx solid #f5f5f5; display: flex; @@ -187,7 +188,7 @@ background: #fff; position: fixed; padding-top: 10rpx; - height:98rpx; + height: 98rpx; bottom: 0rpx; left: 0; right: 0; @@ -205,6 +206,7 @@ text-align: center; border-radius: 6rpx; } + .coupons1-btn-gm { background: #00c0ff !important; border-radius: 10rpx !important; @@ -212,20 +214,22 @@ padding: 0 !important; font-family: PingFangSC-Semibold; font-size: 28rpx; - color: #ffffff !important; + color: #fff !important; letter-spacing: 0; height: 50rpx !important; width: 138rpx !important; line-height: 50rpx !important; } + .coupons1 { flex-direction: row; display: flex; padding: 30rpx; position: relative; height: 184rpx; - border:1px solid #eee; + border: 1px solid #eee; } + .coupons1-border { height: 1rpx; /* width: 100%; */ @@ -235,6 +239,7 @@ position: absolute; bottom: 0; } + .coupons1-img { width: 248rpx; height: 184rpx; @@ -253,26 +258,31 @@ .coupons1-info-name { font-size: 28rpx; - color: #000000; + color: #000; letter-spacing: 0; line-height: 38rpx; } + .coupons1-info-price { padding: 32rpx 0 0; } -.i{ + +.i { font-size: 20rpx; font-style: normal; } + .coupons1-info-price-p { display: inline-block; font-size: 36rpx; color: #f96563; line-height: 50rpx; } -.tit{ + +.tit { margin-top: 32rpx; } + .coupons1-info-price-o { display: block; text-align: center; @@ -300,6 +310,7 @@ .coupons1-btn { position: absolute; + width: 120rpx; top: 40rpx; right: 30rpx; } @@ -311,18 +322,25 @@ padding: 0 !important; font-family: PingFangSC-Semibold; font-size: 28rpx; - color: #ffffff !important; + color: #fff !important; letter-spacing: 0; height: 50rpx !important; width: 138rpx !important; line-height: 50rpx !important; } + .subtitle { font-size: 22rpx; color: #333; font-weight: 100; text-align: left; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 300rpx; + height: 40rpx; } + .coupons1-info-manjian { color: #fa7c7a; font-size: 20rpx; @@ -331,6 +349,7 @@ } /**上拉加载更多**/ + .userinfo { display: flex; flex-direction: column; @@ -347,10 +366,13 @@ .userinfo-nickname { color: #aaa; } -.sy{ + +.sy { display: block; text-align: center; + width: 120rpx!important; } + .usermotto { margin-top: 200px; } diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 01005c3..a65ec6c 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -13,81 +13,59 @@ Page({ hour: "", minute: "" }, + phone: function() { + let that = this; + console.log(that.data); + if (that.data.data.merchantLinkPhone) { + wx.makePhoneCall({ + phoneNumber: that.data.data.merchantLinkPhone + }); + } + }, onLoad(options) { let that = this; - console.log(options.couponChannelId); - console.log(options.couponId); - that.init(); + console.log(options); + console.log("couponChannelId" + options.couponChannelId); + console.log("couponId" + options.couponId); + console.log("传的变量的名字叫couponId"); + wx.showLoading({ + title: "加载中..." + }); + /** - * 首页banner detail couponlist传过来的值 - * iambannercoupon + * 暂时注销 + * this.orderFunc() */ - + // if (options.flag) { + // // this.orderFunc(); + // } + // else { + // } that.setData({ couponChannelId: options.couponChannelId, couponId: options.couponId }); - - wx.showLoading({ - title: "加载中..." - }); - - if (options.flag) { - console.log('111111111111111'+JSON.stringify(options)) - this.orderFunc(); - } else { - - if(options.couponChannelId=='iambannercoupon'){ - /** - * 待解决 - */ - var details ={ - couponChannelId: options.couponId - } - }else{ - var details ={ - couponChannelId: options.couponChannelId - } + var parmer = { + url: config.api.couponDetail, + data: { + couponChannelId: options.couponChannelId } - - Http.get({ - url: config.api.couponDetail, - data: details - }).then(res => { - console.log(res); - console.log("details") - //当前时间与优惠券下架时间做计算 - var startTime = util.fmtDate(res.data.endTime); - console.log(startTime); - var s1 = new Date(startTime.replace(/-/g, "/")); - var s2 = new Date(); - var runTime = parseInt((s1.getTime() - s2.getTime()) / 1000); - var year = Math.floor(runTime / 86400 / 365); - var runTime = runTime % (86400 * 365); - var month = Math.floor(runTime / 86400 / 30); - var runTime = runTime % (86400 * 30); - var day = Math.floor(runTime / 86400); - var runTime = runTime % 86400; - var hour = Math.floor(runTime / 3600); - var runTime = runTime % 3600; - var minute = Math.floor(runTime / 60); - var runTime = runTime % 60; - var second = runTime; - console.log(year, month, day, hour, minute, second); - that.setData({ - year: year, - month: month, - day: day, - hour: hour, - minute: minute - }); - console.log(that.data.day); - wx.hideLoading(); - that.setData({ - data: res.data - }); + }; + Http.get(parmer).then(res => { + console.log(res); + console.log("details"); + //当前时间与优惠券下架时间做计算 + var endTime = util.fmtDate(res.data.endTime); + util.timechuo(endTime); + that.setData({ + endtime: util.timechuo(endTime) }); - } + wx.hideLoading(); + that.setData({ + data: res.data + }); + }); + // } }, /** * 支付订单更新 @@ -193,7 +171,7 @@ Page({ this.initUsrCarList() // 领取 5.停车券 // TODO 选取用户下的车牌 - console.log(11111111111111111111111111111111) + console.log(1111111111111) } else { Http.post({ url: config.api.checkPhoneStatus, @@ -201,24 +179,88 @@ Page({ }) .then(res => { console.log(res); + console.log("姐姐在检查手机号是否授权的情况"); + var data = { + couponChannelId: "" + that.data.couponChannelId, + couponId: "" + that.data.couponId + }; + if (that.data.couponChannelId == null) { + var data = { + couponId: "" + that.data.couponId + }; + } /** * orderSave 下单 */ return Http.post({ url: config.api.orderSave, - data: { - couponChannelId: "" + that.data.couponChannelId, - couponId: "" + that.data.couponId - } + data: data }); }) .catch(err => { console.log(err); + console.log(that.data.couponChannelId); + console.log(that.data.couponId); + console.log("我即将要跳转到用户手机号授权的页面"); + if (err.code == "3000") { + wx.showToast({ + title: "库存不足", + image: "./../../../assets/img/fail.png", + duration: 2000, + mask: false + }); + } + if (err.code == "3001") { + wx.showToast({ + title: "领取达到上限", + image: "./../../../assets/img/fail.png", + duration: 2000, + mask: false + }); + } + if (err.code == "3002") { + wx.showToast({ + title: "订单失败", + image: "./../../../assets/img/fail.png", + duration: 2000, + mask: false + }); + } + if (err.code == "3003") { + wx.showToast({ + title: "订单不存在", + image: "./../../../assets/img/fail.png", + duration: 2000, + mask: false + }); + } + if (err.code == "3004") { + wx.showToast({ + title: "订单不存在", + image: "./../../../assets/img/fail.png", + duration: 2000, + mask: false + }); + } + + if (err.code == "4003") { + wx.showToast({ + title: "卡券已作废", + image: "./../../../assets/img/fail.png", + duration: 2000, + mask: false + }); + } + if (err.code == 11005) { // 用户手机未授权 + /** + * 将值传到用户手机号授权的页面 + * + */ wx.redirectTo({ url: - "../../getphoneInfo/index?couponChannelId=" + + "/pages/getphoneInfo/index?couponChannelId=" + that.data.couponChannelId + "&couponId=" + that.data.couponId @@ -228,9 +270,9 @@ Page({ // 用户手机已加密 wx.redirectTo({ url: - "../../phoneinput/phoneinput?couponChannelId=" + + "/pages/phoneinput/phoneinput?couponChannelId=" + that.data.couponChannelId + - "& couponId=" + + "&couponId=" + that.data.couponId }); } @@ -239,7 +281,8 @@ Page({ console.log(res); console.log("点击领取卡券一直在loading"); if (res != "undefined") { - const orderId = "" + res.data.id; + console.log(res); + let orderId = "" + res.data.id; that.setData({ orderId: orderId }); @@ -255,7 +298,6 @@ Page({ } }).then(res => { console.log(res); - /// Begin payment ---- var payOrderId = "" + res.data.payOrderId; wx.hideLoading(); @@ -266,20 +308,36 @@ Page({ signType: "MD5", paySign: res.data.paySign, success: res => { - console.log(res); - console.log("姐在检查付款异常"); that.payOrderUpdate(that.data.orderId, payOrderId, 1); // 支付成功 console.log(res); if (res.errMsg == "requestPayment:ok") { wx.showToast({ title: "购买成功", - duration: 2500 + image: "./../../../assets/img/success.png", + duration: 2000, + mask: false, + success: function() { + wx.showLoading({ + title: "加载中..." + }); + + setTimeout(function() { + wx.hideLoading(); + }, 1600); + setTimeout(() => { + wx.redirectTo({ + url: `/pages/order/detail/index?orderId=${ + that.data.orderId + }` + }); + }, 1600); + } }); - } - wx.navigateBack({ - delta: 2 - }); + /** + * 用户支付成功以后跳转到券包列表 + */ + } }, fail: res => { @@ -290,29 +348,12 @@ 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: "支付失败", image: "./../../../assets/img/fail.png", - duration: 1500, + duration: 2000, mask: false }); } @@ -331,7 +372,8 @@ Page({ that.payOrderUpdate(orderId, "0", 1); wx.showToast({ title: "领取成功", - duration: 3000 + duration: 3000, + image: "./../../../assets/img/success.png" }); } } diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 3161d67..f9888a0 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -7,7 +7,8 @@ {{data.title}}限购{{data.useLimitQuantity}}件 - 剩余时间:{{day}}天{{hour}}小时{{minute}}分钟 + 剩余时间:{{endtime}} + 当次有效 剩余件数:{{data.remainInventory}}件 @@ -25,6 +26,7 @@ {{data.merchantName}} {{data.addr}}{{data.buildingName}}{{data.floorName}} + 实付金额{{data.couponPrice/100}}元 @@ -65,13 +64,7 @@ 购买须知 - 有效期2018.01.16 至 2018.09.20 - 除特价酒水及特价菜外全场通用 - 无需预约,消费g高峰时可能需要等位 - 没人最多购买2张 - 不可使用包间 - 堂食外带均可,可免费打包 - 每桌限用2张 + {{data.remark}} \ No newline at end of file diff --git a/pages/couponorder/detail/index.wxss b/pages/couponorder/detail/index.wxss index c1a7818..8fe8f78 100644 --- a/pages/couponorder/detail/index.wxss +++ b/pages/couponorder/detail/index.wxss @@ -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{ + position: relative; + width: 510rpx; + height: 581rpx; + display: block; border-radius: 10rpx; background-color: #fff; - margin: 30rpx auto 0; + margin: 22rpx auto 0; + padding: 30rpx 0 0; + z-index: 10000000000; } .pane2{ background: #fff; @@ -24,47 +23,54 @@ margin: 40rpx auto 0; } +.buy { + background: #fff; + height: 88rpx; + width: 98%; + 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: 32rpx; + 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 > canvas { - width: 400rpx; - height: 400rpx; + width: 350rpx; + height: 350rpx; } - .coupon_detail { padding: 0 20rpx; } @@ -77,11 +83,17 @@ float: right; } -.coupon_detail image { +.coupon_detail .wmfl{ display: block; - width: 260rpx; - height: 100rpx; + width: 255rpx; + height: 184rpx; border-radius: 16rpx; + overflow: hidden; +} +.coupon_detail image { + display: block; + width: 100%; + height: 100%; } .coupon_detail .fr { @@ -141,10 +153,10 @@ width: 100%; display: flex; flex-direction: column; - margin-top: 50rpx; background: #fff; border-bottom: 20rpx solid #f5f5f5; border-top: 20rpx solid #f5f5f5; + position: relative; } .posi_logo { @@ -152,6 +164,7 @@ padding: 30rpx 4%; display: flex; position: relative; + z-index: 100; } .posi_logo view:nth-child(1) { @@ -168,6 +181,8 @@ } .posi_logo view:nth-child(2) { + position: relative; + z-index: 100; display: flex; flex-direction: column; flex: 8; @@ -202,10 +217,10 @@ margin: auto; width: 50rpx; height: 50rpx; + z-index:1000000; } .notes { - margin-top: 2%; border-top: 20rpx solid #f5f5f5; } @@ -225,7 +240,6 @@ .notes view:nth-child(2) { width: 92%; - height: 400rpx; padding: 0 4%; background: #fff; display: flex; diff --git a/pages/couponorder/index/index.js b/pages/couponorder/index/index.js index a1243bf..b718208 100644 --- a/pages/couponorder/index/index.js +++ b/pages/couponorder/index/index.js @@ -1,6 +1,5 @@ -const format = require("../../../utils/util.js"); +const util = require("../../../utils/util.js"); const config = require("../../../config/config.js"); -const app = getApp(); const Http = require("../../../utils/HttpBasics"); Page({ data: { @@ -26,7 +25,9 @@ Page({ current: "0", current_scroll: "0", page: 1, - allow_load: true + allow_load: true, + loading: true, //"上拉加载"的变量,默认false,隐藏 + content: "" }, onLoad() { this.getList(0, 0); @@ -39,17 +40,7 @@ Page({ wx.navigateTo({ url: `/pages/couponorder/detail/index?quancode=${ e.currentTarget.dataset.quancode - }`, - success: function(res) { - // success - console.log("点击跳转到券详情页面"); - }, - fail: function() { - // fail - }, - complete: function() { - // complete - } + }` }); }, getList(key, pageNum) { @@ -57,32 +48,36 @@ Page({ console.log(key); console.log(pageNum); if (that.data.allow_load) { - wx.showLoading({ - title: "加载中" + that.setData({ + loading: true, + content: "小主,我在玩命加载中..." }); Http.get({ url: config.api.couponOrderList, data: { pageNum: pageNum, - pageSize: 8, + pageSize: 6, couponOrderStatus: key } }).then(res => { console.log(res); res.data.list.map(file => { - file.expiredTime = format.formatTime( - file.expiredTime, - "yyyy-MM-dddd hh:mm:ss" - ); + file.expiredTime = util.fmtDate(file.expiredTime); }); - console.log("姐姐的订单列表"); setTimeout(function() { - wx.hideLoading(); - }, 1200); + that.setData({ + loading: false + }); + }, 1400); if (pageNum >= res.data.pages) { that.setData({ allow_load: false }); + setTimeout(function() { + that.setData({ + loading: false + }); + }, 1400); } /** * 先赋值后渲染页面 @@ -96,6 +91,15 @@ Page({ }); } else { console.log("加载完成allow_load设置成false"); + that.setData({ + loading: true, + content: "^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" + }); + setTimeout(function() { + that.setData({ + loading: false + }); + }, 1400); } }, handleChange({ detail }) { diff --git a/pages/couponorder/index/index.wxml b/pages/couponorder/index/index.wxml index 04ce5bf..340a8ec 100644 --- a/pages/couponorder/index/index.wxml +++ b/pages/couponorder/index/index.wxml @@ -6,12 +6,12 @@ - 暂无优惠券可用 + 暂无优惠券哦 - + + + {{content}} + \ No newline at end of file diff --git a/pages/couponorder/index/index.wxss b/pages/couponorder/index/index.wxss index 11c3bab..5680861 100644 --- a/pages/couponorder/index/index.wxss +++ b/pages/couponorder/index/index.wxss @@ -15,25 +15,23 @@ } .section { - margin-top: 2%; -} -.section:nth-of-type(1) { - margin-top: 30rpx; + position: relative; } .detail_msg { width: 92%; - height: 202rpx !important; + height: 186rpx !important; background: #fff; display: flex; - padding: 0 4%; - margin-top: 2%; + padding: 30rpx 4%; border-bottom: 1px solid #ededed; } .logo { width: 348rpx; height: 184rpx; + border: 1px solid #f8f8f8; + border-radius: 15rpx; } .logo image { @@ -70,16 +68,19 @@ } .btns { - width: 200rpx; + position: absolute; + top: 0; + right: 20rpx; + bottom: 0; + margin: auto; + width: 180rpx; height: 60rpx; line-height: 60rpx; text-align: center; background: #00c0ff; color: #fff; - float: right; border-radius: 15rpx; font-size: 28rpx; - margin-top: 20rpx; } .txt1 { @@ -92,21 +93,38 @@ color: #f96563; } -.nocoupon image{ +.nocoupon image { width: 203rpx; display: block; margin: 200rpx auto 0; } -.nocoupon text{ + +.nocoupon text { display: block; text-align: center; - font-size:30rpx; - color: #00C0FF; + font-size: 30rpx; + color: #00c0ff; } -.nocoupon button{ - background: #00C0FF; + +.nocoupon button { + background: #00c0ff; color: #fff; font-style: 30rpx; width: 70%; margin: 30rpx auto 0; } + +.loading { + text-align: center; + height: 80rpx; + line-height: 80rpx; + font-size: 26rpx; + color: #999; +} + +.loading image { + width: 40rpx; + height: 40rpx; + vertical-align: middle; + margin-right: 10rpx; +} diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index 5cc3912..f26ae5a 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -1,11 +1,11 @@ -var config = require('../../config/config.js'); +var config = require("../../config/config.js"); const Http = require("../../utils/HttpBasics"); var app = getApp(); Page({ data: { - canIUse: wx.canIUse('button.open-type.getPhoneNumber'), - couponChannelId: null, - couponId: null + canIUse: wx.canIUse("button.open-type.getPhoneNumber"), + couponChannelId: "", + couponId: "" }, onLoad: function(options) { var that = this; @@ -13,37 +13,59 @@ Page({ that.setData({ couponChannelId: options.couponChannelId, couponId: options.couponId - }) + }); + + Http.get({ + url: config.api.marketicon, + data: { + appId: config.weapp.AppId + } + }).then(res => { + console.log(res.data.mallImgUrl); + that.setData({ + mallImgUrl: res.data.mallImgUrl + }); + }); }, getPhoneNumber: function(e) { var that = this; var iv = e.detail.iv; var encryptedData = e.detail.encryptedData; Http.post({ - url: config.api.getUserPhone, - data: { - encryptedData: encryptedData, - iv: iv, - } - }) - .then(function(res) { - console.log(res); - app.globalData.phone = res.data.phone; - wx.showToast({ - title: res.data.msg, - icon: "success", - success: function(res) { - wx.redirectTo({ - url: '/pages/coupon/detail/index?couponChannelId='+ that.data.couponChannelId + '&couponId='+ that.data.couponId +'&flag=pay' - }) - } - }) - }, - function(error) { - wx.showToast({ - title: '请重新授权手机号', - icon: "none", - }) - }) + url: config.api.getUserPhone, + data: { + encryptedData: encryptedData, + iv: iv + } + }).then( + function(res) { + console.log(res); + console.log("这是用户授权手机号的结果"); + console.log(that.data.couponChannelId); + console.log(that.data.couponId); + console.log("这是从立即支付传回来的值 因为用户没有授权手机号"); + app.globalData.phone = res.data.phone; + wx.showToast({ + title: res.data.msg, + icon: "success", + success: function(res) { + wx.redirectTo({ + url: + "/pages/coupon/detail/index?couponChannelId=" + + that.data.couponChannelId + + "&couponId=" + + that.data.couponId + + "&flag=pay" + }); + } + }); + }, + function(error) { + wx.showToast({ + title: "请重新授权手机号", + icon: "none" + }); + } + ); } -}) \ No newline at end of file +}); diff --git a/pages/getphoneInfo/index.wxml b/pages/getphoneInfo/index.wxml index eb196bf..dacfea7 100755 --- a/pages/getphoneInfo/index.wxml +++ b/pages/getphoneInfo/index.wxml @@ -1,5 +1,10 @@ - - - - 请升级微信版本 + \ No newline at end of file diff --git a/pages/getphoneInfo/index.wxss b/pages/getphoneInfo/index.wxss index ca9cc5d..e4c5d9b 100755 --- a/pages/getphoneInfo/index.wxss +++ b/pages/getphoneInfo/index.wxss @@ -1,19 +1,35 @@ -.registerd image { - display: block; - width: 100%; +.login-body { + padding-top: 200rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; } -.registerd button { - background: #9d285c; - border-radius: 10rpx; - color: #fff; - height: 84rpx; - line-height: 84rpx; - margin: 30rpx auto 0; - width: 93%; - font-size: 28rpx; +.login-logo { + width: 283rpx; + height: 326rpx; } -.bg_color { - opacity: 0.6; +.login-logo>image { + width: 100%; + height: 100%; } + +.login-btn { + padding-top: 120rpx; + width: 504rpx; +} + +.login-btn .login-btn-login { + background: #00C0FF !important; + border-radius: 10rpx !important; + height: 88rpx !important; + margin: 0 !important; + padding: 0 !important; + font-family: PingFangSC-Semibold !important; + font-size: 36rpx !important; + color: #FFFFFF !important; + letter-spacing: 0.75rpx !important; + text-align: center; +} \ No newline at end of file diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index f671631..66a64b8 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -1,38 +1,51 @@ -var config = require('../../config/config.js'); +var config = require("../../config/config.js"); var app = getApp(); const Http = require("../../utils/HttpBasics"); Page({ data: { - canIUse: wx.canIUse('button.open-type.getUserInfo') + canIUse: wx.canIUse("button.open-type.getUserInfo") }, onLoad: function(options) { var that = this; + Http.get({ + url: config.api.marketicon, + data: { + appId: config.weapp.AppId + } + }).then(res => { + console.log(res.data.mallImgUrl); + that.setData({ + mallImgUrl: res.data.mallImgUrl + }); + }); }, bindGetUserInfo: function(e) { console.log(e); var iv = e.detail.iv; var encryptedData = e.detail.encryptedData; - console.log(iv) - console.log(encryptedData) + console.log(iv); + console.log(encryptedData); Http.post({ - url: config.api.getUserInfo, - data: { - encryptedData: encryptedData, - iv: iv, - } - }) - .then(function(res) { + url: config.api.getUserInfo, + data: { + encryptedData: encryptedData, + iv: iv + } + }).then( + function(res) { console.log(res); //返回主页 wx.switchTab({ - url: '/pages/index/index', - }) - }, function(error) { + url: "/pages/index/index" + }); + }, + function(error) { wx.showToast({ - title: '请授权个人信息', + title: "请授权个人信息", icon: "none" - }) - }) - }, -}) \ No newline at end of file + }); + } + ); + } +}); diff --git a/pages/getuserinfo/index.wxml b/pages/getuserinfo/index.wxml index a2e4a28..a92d189 100755 --- a/pages/getuserinfo/index.wxml +++ b/pages/getuserinfo/index.wxml @@ -1,15 +1,6 @@ - - -