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 9ef0192..5d3b249 100644 Binary files a/assets/img/bg.png and b/assets/img/bg.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/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/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/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/components/coupons/index.wxss b/components/coupons/index.wxss index dd00517..7996467 100644 --- a/components/coupons/index.wxss +++ b/components/coupons/index.wxss @@ -19,12 +19,14 @@ width: 248rpx; height: 184rpx; overflow: hidden; - border-radius: 10rpx; + border: 1px solid #f8f8f8; + border-radius: 10rpx; } .coupons-img image { width: 100%; height: 100%; + border-radius: 10rpx; } .coupons-info { @@ -32,8 +34,8 @@ } .coupons-info-name { - font-size: 28rpx; - color: #000000; + font-size: 30rpx; + color: #343434; letter-spacing: 0; line-height: 38rpx; } @@ -41,7 +43,7 @@ padding: 32rpx 0 0; } .i{ - font-size: 20rpx; + font-size: 24rpx; font-style: normal; } .coupons-info-price-p { @@ -49,14 +51,17 @@ font-size: 36rpx; color: #f96563; line-height: 50rpx; + font-weight: 600; } .tit{ - margin-top: 32rpx; + 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; @@ -103,18 +108,19 @@ line-height: 50rpx !important; } .subtitle { - font-size: 22rpx; - color: #333; - font-weight: 100; + font-size: 24rpx; + color: #6f6f6f; text-align: left; - overflow: hidden; + 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; diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 59f319a..2bfc31b 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -132,6 +132,14 @@ Page({ 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: "领取达到上限", @@ -164,6 +172,7 @@ Page({ mask: false }); } + if (err.code == "4003") { wx.showToast({ title: "卡券已作废", @@ -237,10 +246,21 @@ Page({ image: "./../../../assets/img/success.png", duration: 2000, mask: false, - success:function(){ - wx.redirectTo({ - url: `/pages/order/detail/index?orderId=${that.data.orderId}`, - }) + success: function() { + wx.showLoading({ + title: "加载中..." + }); + + setTimeout(function() { + wx.hideLoading(); + }, 1600); + setTimeout(() => { + wx.redirectTo({ + url: `/pages/order/detail/index?orderId=${ + that.data.orderId + }` + }); + }, 1600); } }); diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index 8b8f0f3..692d7b3 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -7,7 +7,8 @@ {{data.title}}限购{{data.useLimitQuantity}}件 - 剩余时间:{{endtime}} + 剩余时间:{{endtime}} + 当次有效 剩余件数:{{data.remainInventory}}件 diff --git a/pages/coupon/detail/index.wxss b/pages/coupon/detail/index.wxss index 3eedffd..dc66612 100644 --- a/pages/coupon/detail/index.wxss +++ b/pages/coupon/detail/index.wxss @@ -170,9 +170,9 @@ } .notes view:nth-child(2)>text { - font-size: 28rpx; + font-size: 26rpx; color: #a9a9a9; - line-height: 56rpx; + line-height: 45rpx; } .spot { diff --git a/pages/couponorder/index/index.js b/pages/couponorder/index/index.js index a1243bf..16d6d9f 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: { @@ -70,10 +69,7 @@ Page({ }).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() { diff --git a/pages/index/index.js b/pages/index/index.js index 8e9d363..0a96413 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -20,6 +20,10 @@ Page({ onLoad: function(options) { var that = this; var scene = decodeURIComponent(options.scene); + }, + + onShow:function(){ + let that = this; if (app.globalData.token && app.globalData.token != null) { } else { wx.login({ diff --git a/pages/index/rushToBuy/index.wxml b/pages/index/rushToBuy/index.wxml index 9e9eef7..891c75e 100644 --- a/pages/index/rushToBuy/index.wxml +++ b/pages/index/rushToBuy/index.wxml @@ -1,5 +1,5 @@ - 限时抢购查看更多> + 限时抢购查看更多 diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index 7492a4c..d172b34 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -25,10 +25,16 @@ Page({ // 2 已过期 // 3 已经退款 console.log(e); - + wx.navigateTo({ - url: `/pages/orderquanma/index?quancode=${e.currentTarget.dataset.quancode}&title=${e.currentTarget.dataset.title}&subtitle=${e.currentTarget.dataset.subtitle}&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${e.currentTarget.dataset.couponorderstatus}`, - }) + url: `/pages/orderquanma/index?quancode=${ + e.currentTarget.dataset.quancode + }&title=${e.currentTarget.dataset.title}&subtitle=${ + e.currentTarget.dataset.subtitle + }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ + e.currentTarget.dataset.couponorderstatus + }` + }); console.log(e.currentTarget.dataset.quancode); console.log(e.currentTarget.dataset.couponorderstatus); }, @@ -42,7 +48,7 @@ Page({ this.setData({ orderId: options.orderId - }) + }); Http.get({ url: config.api.orderDetail, @@ -104,11 +110,22 @@ Page({ title: "购买成功", duration: 2000, image: "./../../../assets/img/success.png", - mask:false, - success:function(){ - wx.redirectTo({ - url: `/pages/order/detail/index?orderId=${that.data.orderId}`, - }) + 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); } }); } @@ -136,12 +153,13 @@ Page({ }); } else { // 免费券 - that.payOrderUpdate(orderId, "0", 1) // 支付成功 + that + .payOrderUpdate(orderId, "0", 1) // 支付成功 .then(res => { wx.showToast({ title: "支付成功", duration: 2000, - image: "./../../../assets/img/success.png", + image: "./../../../assets/img/success.png" }); }); } @@ -152,14 +170,14 @@ Page({ payOrderUpdate: (orderId, payOrderId, status, reason) => { // 支付成功 Http.post({ - url: config.api.payOrderUpdate, - data: { - payOrderId: payOrderId, - orderId: orderId, - status: status, - reason: reason - } - }) + url: config.api.payOrderUpdate, + data: { + payOrderId: payOrderId, + orderId: orderId, + status: status, + reason: reason + } + }) .then(res => { console.log("payOrderUpdate then", res); // wx.showToast({ @@ -206,4 +224,4 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function() {} -}); \ No newline at end of file +}); diff --git a/pages/order/index/index.wxss b/pages/order/index/index.wxss index e64d3af..5da4ce1 100644 --- a/pages/order/index/index.wxss +++ b/pages/order/index/index.wxss @@ -43,6 +43,7 @@ display: flex; justify-content: space-between; padding: 0 4%; + margin-top: 8rpx; } .info { @@ -50,7 +51,6 @@ } .info view:nth-child(1) { - margin-top: 20rpx; margin-bottom: 15rpx; } @@ -59,7 +59,7 @@ } .info view:nth-child(1) text:nth-child(2) { - color: #ffae00; + color: #f96563; font-size: 24rpx; }