@@ -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": { | |||
@@ -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; | |||
} | |||
@@ -1 +0,0 @@ | |||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#cbc8c2" d="M22.311657 420.524612c-10.023284 8.991792-17.588587 22.285562-17.588587 37.752836 0 27.185152 22.001083 49.212842 49.155537 49.212842l98.397031 0 0 467.197608c0 27.213805 22.00006 49.15656 49.155537 49.15656l163.104775 0c27.127847 0 49.15349-21.971407 49.15349-49.15656l0-196.72857 196.708104 0 0 196.72857c0 27.185152 21.912056 49.15656 49.127907 49.15656l163.073052 0c27.158547 0 49.157583-21.942755 49.157583-49.15656l0-467.197608 98.367355 0c27.211758 0 49.154513-22.026666 49.154513-49.212842 0-15.46625-7.504928-28.760021-18.822694-37.752836-168.776961-142.224212-488.427118-420.36907-488.427118-420.36907S192.293049 278.3004 22.311657 420.524612zM432.279842 64.149019" /></svg> |
@@ -1 +0,0 @@ | |||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#0ac4ff" d="M22.311657 420.524612c-10.023284 8.991792-17.588587 22.285562-17.588587 37.752836 0 27.185152 22.001083 49.212842 49.155537 49.212842l98.397031 0 0 467.197608c0 27.213805 22.00006 49.15656 49.155537 49.15656l163.104775 0c27.127847 0 49.15349-21.971407 49.15349-49.15656l0-196.72857 196.708104 0 0 196.72857c0 27.185152 21.912056 49.15656 49.127907 49.15656l163.073052 0c27.158547 0 49.157583-21.942755 49.157583-49.15656l0-467.197608 98.367355 0c27.211758 0 49.154513-22.026666 49.154513-49.212842 0-15.46625-7.504928-28.760021-18.822694-37.752836-168.776961-142.224212-488.427118-420.36907-488.427118-420.36907S192.293049 278.3004 22.311657 420.524612zM432.279842 64.149019" /></svg> |
@@ -1 +0,0 @@ | |||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#cbc8c2" d="M512 535.272727c141.963636 0 256-114.036364 256-256S730.763636 0 512 0c-214.109091 0-256 137.309091-256 279.272727s114.036364 256 256 256z m232.727273 23.272728H279.272727C151.272727 558.545455 46.545455 663.272727 46.545455 791.272727s104.727273 232.727273 232.727272 232.727273h465.454546c128 0 232.727273-104.727273 232.727272-232.727273s-104.727273-232.727273-232.727272-232.727272z" /></svg> |
@@ -1 +0,0 @@ | |||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#0ac4ff" d="M512 535.272727c141.963636 0 256-114.036364 256-256S730.763636 0 512 0c-214.109091 0-256 137.309091-256 279.272727s114.036364 256 256 256z m232.727273 23.272728H279.272727C151.272727 558.545455 46.545455 663.272727 46.545455 791.272727s104.727273 232.727273 232.727272 232.727273h465.454546c128 0 232.727273-104.727273 232.727272-232.727273s-104.727273-232.727273-232.727272-232.727272z" /></svg> |
@@ -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}` | |||
}); | |||
} | |||
} | |||
}) | |||
}); |
@@ -20,11 +20,12 @@ | |||
<view class="coupons-btn"> | |||
<!-- 优惠券价格 --> | |||
<view class="coupons-info-price"> | |||
<view class="coupons-info-name subtitle sy">剩余: {{data.remainInventory}}</view> | |||
<view class="coupons-info-name sy">剩余: {{data.remainInventory}}</view> | |||
<!-- <text class="coupons-info-price-o"><text class='i'>¥</text>{{data.priceStr}}</text> --> | |||
</view> | |||
<i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr==0}}" data-date='{{data}}'>领取</i-button> | |||
<i-button i-class="coupons-btn-gm" wx:elif="{{data.salePriceStr!=0}}" data-date='{{data}}'>购买</i-button> | |||
<i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr==0&&data.remainInventory!=0}}" data-date='{{data}}'>领取</i-button> | |||
<i-button i-class="coupons-btn-gm" wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0}}" data-date='{{data}}'>购买</i-button> | |||
<i-button i-class="coupons-btn-gms" wx:if="{{data.remainInventory==0}}" data-date='{{data}}'>已售罄</i-button> | |||
</view> | |||
<view class="coupons-border"></view> | |||
</view> |
@@ -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%; | |||
} | |||
@@ -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: { | |||
@@ -37,7 +37,7 @@ | |||
</view> --> | |||
<!-- 优惠券 --> | |||
<navigator wx:for="{{data.coupons}}" wx:key="{{index}}" url="/pages/coupon/detail/index?couponChannelId=iambannercoupon&couponId={{item.couponId}}"> | |||
<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"> | |||
@@ -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; | |||
} | |||
@@ -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" | |||
}); | |||
} | |||
} | |||
@@ -7,7 +7,8 @@ | |||
<view class='coupons_info'> | |||
<view> | |||
<text>{{data.title}}<text>限购{{data.useLimitQuantity}}件</text></text> | |||
<text>剩余时间:<text>{{day}}天</text><text>{{hour}}小时</text><text>{{minute}}分钟</text></text> | |||
<text wx:if="{{data.endTime!=undefined&&data.type!=5}}">剩余时间:<text>{{endtime}}</text></text> | |||
<text wx:if="{{data.type==5}}"><text>当次有效</text></text> | |||
<text>剩余件数:<text>{{data.remainInventory}}件</text></text> | |||
</view> | |||
<view> | |||
@@ -25,6 +26,7 @@ | |||
<text>{{data.merchantName}}</text> | |||
<text>{{data.addr}}{{data.buildingName}}{{data.floorName}}</text> | |||
</view> | |||
<image bindtap='phone' class="tel" src="./../../../assets/img/tel.jpg" mode="widthFix" /> | |||
</view> | |||
<!-- <view> | |||
<text>更多适用门店</text> | |||
@@ -41,7 +43,8 @@ | |||
</view> | |||
</view> | |||
<view class="buy-view app-border-top"> | |||
<button bindtap='orderFunc' class='buy' wx:if="{{data.salePriceStr!=0}}">立即购买</button> | |||
<button bindtap='orderFunc' class='buy' wx:elif="{{data.salePriceStr==0}}">免费领取</button> | |||
<button bindtap='orderFunc' class='buy' wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0}}">立即支付</button> | |||
<button bindtap='orderFunc' class='buy' wx:elif="{{data.salePriceStr==0&&data.remainInventory!=0}}">免费领取</button> | |||
<button class='buy' wx:elif="{{data.remainInventory==0}}" style="background:#999;color: #fff;">免费领取</button> | |||
</view> | |||
</view> |
@@ -8,11 +8,6 @@ | |||
padding-bottom: 120rpx; | |||
} | |||
.coupons-body { | |||
flex: 1; | |||
/* overflow: auto; */ | |||
} | |||
.banner { | |||
width: 100%; | |||
height: 465rpx; | |||
@@ -39,7 +34,7 @@ | |||
.coupons_info view:nth-child(1) text { | |||
font-size: 30rpx; | |||
margin-top: 3%; | |||
margin-top: 6%; | |||
} | |||
.coupons_info view:nth-child(1) text:nth-child(1) text { | |||
@@ -80,6 +75,7 @@ | |||
} | |||
.posi { | |||
position: relative; | |||
width: 92%; | |||
display: flex; | |||
flex-direction: column; | |||
@@ -166,19 +162,17 @@ | |||
.notes view:nth-child(2) { | |||
width: 92%; | |||
height: 400rpx; | |||
padding: 0 4%; | |||
padding: 2% 4%; | |||
background: #fff; | |||
border-bottom: 1rpx solid #f5f5f5; | |||
display: flex; | |||
flex-direction: column; | |||
padding-top: 2%; | |||
} | |||
.notes view:nth-child(2)>text { | |||
font-size: 28rpx; | |||
font-size: 26rpx; | |||
color: #a9a9a9; | |||
line-height: 56rpx; | |||
line-height: 45rpx; | |||
} | |||
.spot { | |||
@@ -196,7 +190,7 @@ | |||
background: #fff; | |||
position: fixed; | |||
padding-top: 10rpx; | |||
height:98rpx; | |||
height: 98rpx; | |||
bottom: 0rpx; | |||
left: 0; | |||
right: 0; | |||
@@ -212,3 +206,13 @@ | |||
line-height: 88rpx; | |||
border-radius: 6rpx; | |||
} | |||
.tel { | |||
position: absolute; | |||
right: 50rpx; | |||
top: 0; | |||
bottom: 0; | |||
margin: auto; | |||
width: 50rpx; | |||
height: 50rpx; | |||
z-index:1000000; | |||
} |
@@ -40,15 +40,15 @@ 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; | |||
console.log(that.data); | |||
if (that.data.data.merchantLinkPhone) { | |||
wx.makePhoneCall({ | |||
phoneNumber: that.data.data.merchantLinkPhone //仅为示例,并非真实的电话号码 | |||
phoneNumber: that.data.data.merchantLinkPhone | |||
}); | |||
} | |||
} | |||
@@ -1,6 +1,8 @@ | |||
<view class="container page"> | |||
<view class="coupon_detail clearfix"> | |||
<image class="fl" src="{{data.coverImg}}" mode="widthFix" /> | |||
<view class="fl wmfl"> | |||
<image src="{{data.coverImg}}" /> | |||
</view> | |||
<view class="fr"> | |||
<text class="title">{{data.title}}</text> | |||
<view class="time">{{data.subTitle}}</view> | |||
@@ -16,24 +18,21 @@ | |||
<text>有效期至:</text> | |||
<text>{{expiredTime}}</text> | |||
</view> | |||
<view class="pane2" wx:if="{{data.couponOrderStatus==1}}"> | |||
<image src="./../../../assets/img/shiyong.jpg" mode="widthFix"></image> | |||
</view> | |||
<view class="pane2" wx:if="{{data.couponOrderStatus==2}}"> | |||
<image src="./../../../assets/img/guoqi.jpg" mode="widthFix"></image> | |||
</view> | |||
<view class="pane2" wx:if="{{data.couponOrderStatus==3}}"> | |||
<image src="./../../../assets/img/tui.jpg" mode="widthFix"></image> | |||
</view> | |||
<view class="panel" wx:if="{{data.couponOrderStatus==0}}"> | |||
<view class="barcode"> | |||
<canvas canvas-id="barcode" /> | |||
</view> | |||
<view class="qrcode"> | |||
<canvas canvas-id="qrcode" /> | |||
<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 class="barnum"><text>兑换码:</text>{{code}}</view> | |||
</view> | |||
<view class="posi"> | |||
<view class="tit"> | |||
适用门店 | |||
@@ -46,7 +45,7 @@ | |||
<text>{{data.merchantName}}</text> | |||
<text>{{data.addr}}{{data.buildingName}}{{data.floorName}}</text> | |||
</view> | |||
<image bindtap='phone' class="tel" src="../../../../assets/img/tel.gif" mode="widthFix" /> | |||
<image bindtap='phone' class="tel" src="./../../../assets/img/tel.jpg" mode="widthFix" /> | |||
</view> | |||
</view> | |||
<view class='note'> | |||
@@ -57,7 +56,7 @@ | |||
<view wx:if="{{data.couponOrderStatus==3}}"><text>退款时间</text><text>{{updateDate}}</text></view> | |||
<view><text>订单编号</text><text>{{data.orderId}}</text></view> | |||
<view><text>手机号</text><text>2018.05.25</text></view> | |||
<!-- <view><text>手机号</text><text>2018.05.25</text></view> --> | |||
<view><text>实付金额</text><text>{{data.couponPrice/100}}元</text></view> | |||
</view> | |||
<view class='notes' style="border-bottom:0"> | |||
@@ -65,13 +64,7 @@ | |||
<text>购买须知</text> | |||
</view> | |||
<view> | |||
<text><text class='spot'></text>有效期2018.01.16 至 2018.09.20</text> | |||
<text><text class='spot'></text>除特价酒水及特价菜外全场通用</text> | |||
<text><text class='spot'></text>无需预约,消费g高峰时可能需要等位</text> | |||
<text><text class='spot'></text>没人最多购买2张</text> | |||
<text><text class='spot'></text>不可使用包间</text> | |||
<text><text class='spot'></text>堂食外带均可,可免费打包</text> | |||
<text><text class='spot'></text>每桌限用2张</text> | |||
<text><text class='spot'></text>{{data.remark}}</text> | |||
</view> | |||
</view> | |||
</view> |
@@ -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; | |||
@@ -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 }) { | |||
@@ -6,12 +6,12 @@ | |||
<view> | |||
<view class="nocoupon" wx:if="{{list.length==0}}"> | |||
<image src="./../../../assets/img/cou.png" mode="widthFix" /> | |||
<text>暂无优惠券可用</text> | |||
<text>暂无优惠券哦</text> | |||
<navigator url="/pages/index/index" open-type="switchTab" hover-class="other-navigator-hover"> | |||
<button>去领券</button> | |||
</navigator> | |||
</view> | |||
<view class='section' wx:for='{{list}}' wx:key='{{index}}' bindtap="gotouse" data-quancode="{{item.id}}"> | |||
<view class='detail_msg'> | |||
<view class='logo'> | |||
@@ -30,5 +30,8 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"> | |||
<image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}} | |||
</view> | |||
</view> | |||
</view> |
@@ -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; | |||
} |
@@ -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" | |||
}); | |||
} | |||
); | |||
} | |||
}) | |||
}); |
@@ -1,5 +1,10 @@ | |||
<view class='registerd'> | |||
<image src='http://f.cdn.cloudolphin.com/banner_logo.jpg' mode='widthFix'></image> | |||
<button class="btn" hover-class='bg_color' wx:if="{{canIUse}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">授权手机号</button> | |||
<view wx:else>请升级微信版本</view> | |||
<view class="login-body"> | |||
<view class="login-logo"> | |||
<image src="{{mallImgUrl}}"></image> | |||
</view> | |||
<view class="login-btn"> | |||
<!-- <i-button i-class="login-btn-login" bind:click="getPhoneNumber">微信登陆</i-button> --> | |||
<button open-type="getPhoneNumber" wx:if="{{canIUse}}" class="login-btn-login" bindgetphonenumber="getPhoneNumber">授权手机号</button> | |||
<view wx:else>请升级微信版本</view> | |||
</view> | |||
</view> |
@@ -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; | |||
} |
@@ -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" | |||
}) | |||
}) | |||
}, | |||
}) | |||
}); | |||
} | |||
); | |||
} | |||
}); |
@@ -1,15 +1,6 @@ | |||
<!-- <view class='userinfo'> | |||
<image src='http://f.cdn.cloudolphin.com/banner_logo.jpg' mode='widthFix'></image> | |||
<button class="weui-btn" hover-class='bg_color' wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">头像昵称授权登录</button> | |||
<view wx:else>请升级微信版本</view> | |||
</view> --> | |||
<view class="login-body"> | |||
<view class="login-logo"> | |||
<image src="../../assets/img/logo.png"></image> | |||
<image src="{{mallImgUrl}}"></image> | |||
</view> | |||
<view class="login-btn"> | |||
<!-- <i-button i-class="login-btn-login" bind:click="getPhoneNumber">微信登陆</i-button> --> | |||
@@ -16,12 +16,13 @@ Component({ | |||
tabs: [], | |||
list: [], | |||
flag: "", | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content:"", | |||
return_list: [], | |||
current: 0, | |||
current_scroll: 0, | |||
pageNum: 1, // 设置加载的第几次,默认是第一次 | |||
pageSize: 10, //返回数据的个数 | |||
searchLoading: false, //"上拉加载"的变量,默认false,隐藏 | |||
searchLoadingComplete: false, //“没有数据”的变量,默认false,隐藏 | |||
allow_load: true // 是否允许继续加载标识 默认 true 允许,false 加载完成 | |||
}, | |||
@@ -67,21 +68,21 @@ Component({ | |||
// 券list获取 | |||
if (that.data.allow_load) { | |||
wx.showLoading({ | |||
title: "飞速加载中" | |||
}); | |||
that.setData({ | |||
loading:true, | |||
content:'小主,我在玩命加载中...' | |||
}) | |||
// 根据 key == 0 区分全部或其它tab,决定是否传参数 business | |||
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 | |||
}; | |||
@@ -92,11 +93,10 @@ Component({ | |||
data: param | |||
}).then(res => { | |||
console.log(res); | |||
/** | |||
* 加载完成 | |||
*/ | |||
if (pageNum >= res.data.pages) { | |||
// wx.showToast({ | |||
// title: "加载完成喽", | |||
// icon: "success" | |||
// }); | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
@@ -113,10 +113,21 @@ Component({ | |||
}); | |||
}); | |||
setTimeout(function() { | |||
wx.hideLoading(); | |||
}, 1000); | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
} else { | |||
console.info("allow_load==false 已禁止加载"); | |||
that.setData({ | |||
loading:true, | |||
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
}) | |||
setTimeout(function(){ | |||
that.setData({ | |||
loading:false, | |||
}) | |||
},1400) | |||
} | |||
}; | |||
@@ -134,7 +145,7 @@ Component({ | |||
url: config.api.businessList, | |||
data: { | |||
pageNum: 1, | |||
pageSize: 10, | |||
pageSize: 15, | |||
type: 1 | |||
} | |||
}).then(res => { | |||
@@ -2,5 +2,6 @@ | |||
<i-tabs current="{{current_scroll}}" scroll bindchange="handleChangeScroll"> | |||
<i-tab wx:for="{{tabs}}" wx:key="unique" key="{{item.id}}" title="{{item.title}}"></i-tab> | |||
</i-tabs> | |||
<c-coupons wx:for="{{list}}" paramAtoB="{{scrollHeight}}" wx:key="unique" data="{{item}}" /> | |||
<c-coupons wx:for="{{list}}" paramAtoB="{{loading}}" wx:key="unique" data="{{item}}" /> | |||
<view class="loading" wx:if="{{loading}}"><image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view> | |||
</view> |
@@ -0,0 +1,16 @@ | |||
.index-coupons{ | |||
height:820rpx; | |||
} | |||
.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; | |||
} |
@@ -20,10 +20,12 @@ 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 { | |||
// 由于是网络请求,可能会在 Page.onLoad 之后才返回 | |||
// 所以此处加入 callback 以防止这种情况 | |||
wx.login({ | |||
success: ({ code }) => { | |||
console.log(code); | |||
@@ -43,7 +45,7 @@ Page({ | |||
url: config.api.bannerlist, | |||
data: { | |||
pageNum: 1, | |||
pageSize: 10 | |||
pageSize: 5 | |||
} | |||
}).then(res => { | |||
that.setData({ | |||
@@ -36,13 +36,15 @@ Component({ | |||
gotodetail: function(e) { | |||
console.log(e); | |||
console.log("出错啦 大哥"); | |||
console.log(e.currentTarget.dataset.id); | |||
console.log(e.currentTarget.dataset.targetad); | |||
console.log(e.currentTarget.dataset); | |||
wx.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${ | |||
e.currentTarget.dataset.id | |||
}&couponId=${e.currentTarget.dataset.couponId} | |||
}&targetAd=${e.currentTarget.dataset.targetad}` | |||
e.currentTarget.dataset.couponchannelid | |||
}&couponId=${ | |||
e.currentTarget.dataset.couponid | |||
}&targetAd=${ | |||
e.currentTarget.dataset.targetad | |||
}` | |||
}); | |||
} | |||
}, | |||
@@ -1,8 +1,8 @@ | |||
<view class="index-rushToBuy"> | |||
<view class="index-rushToBuy-title">限时抢购<text bindtap="gotomore">查看更多></text></view> | |||
<view class="index-rushToBuy-title">限时抢购<text bindtap="gotomore">查看更多</text></view> | |||
<scroll-view scroll-x class="index-scroll-view"> | |||
<view class="commodity" wx:for="{{list}}" wx:key="unique"> | |||
<view bindtap="gotodetail" data-id="{{item.id}}" data-targetAd="{{item.targetAd}}"> | |||
<view bindtap="gotodetail" data-couponChannelId="{{item.id}}" data-couponId="{{item.couponId}}" data-targetAd="{{item.targetAd}}"> | |||
<image class="commodity-img" src="{{item.coverImg}}" /> | |||
<view class="commodity-info"> | |||
<view class="commodity-info-name">{{item.title}}</view> | |||
@@ -14,7 +14,7 @@ | |||
.index-rushToBuy-title text{ | |||
float: right; | |||
margin-right: 20rpx; | |||
color: #f96563; | |||
color: #a8adb4; | |||
font-size: 26rpx; | |||
} | |||
.index-scroll-view { | |||
@@ -37,12 +37,10 @@ | |||
.index-scroll-view .commodity:last-child{ | |||
margin-right: 30rpx; | |||
} | |||
.index-scroll-view .commodity-img { | |||
height: 213rpx; | |||
} | |||
.index-scroll-view .commodity-img image{ | |||
width: 100%; | |||
height: 100%; | |||
.commodity-img{ | |||
display: block; | |||
width: 355rpx; | |||
height: 213rpx; | |||
} | |||
.index-scroll-view .commodity-info { | |||
@@ -1,21 +1,28 @@ | |||
let app = getApp() | |||
var config = require("../../config/config.js"); | |||
const Http = require("../../utils/HttpBasics"); | |||
Page({ | |||
data: { | |||
}, | |||
getPhoneNumber: function (e) { | |||
console.log(e.detail.errMsg) | |||
console.log(e.detail.iv) | |||
console.log(e.detail.encryptedData) | |||
data: {}, | |||
getPhoneNumber: function(e) { | |||
console.log(e.detail.errMsg); | |||
console.log(e.detail.iv); | |||
console.log(e.detail.encryptedData); | |||
wx.navigateBack({ | |||
delta: 1 | |||
}) | |||
}); | |||
}, | |||
onLoad() { | |||
}, | |||
onLogin: function () { | |||
console.log("登陆"); | |||
let that = this; | |||
console.log(config.weapp.AppId) | |||
Http.get({ | |||
url: config.api.marketicon, | |||
data: { | |||
appId: config.weapp.AppId | |||
} | |||
}).then(res=>{ | |||
console.log(res.data.mallImgUrl); | |||
that.setData({ | |||
mallImgUrl: res.data.mallImgUrl | |||
}); | |||
}) | |||
} | |||
}) | |||
}); |
@@ -1,6 +1,6 @@ | |||
<view class="login-body"> | |||
<view class="login-logo"> | |||
<image src="../../assets/img/logo.png"></image> | |||
<image src="{{mallImgUrl}}"></image> | |||
</view> | |||
<view class="login-btn"> | |||
<!-- <i-button i-class="login-btn-login" bind:click="getPhoneNumber">微信登陆</i-button> --> | |||
@@ -14,6 +14,7 @@ | |||
.login-logo>image { | |||
width: 100%; | |||
height: 100%; | |||
border-radius: 16rpx; | |||
} | |||
.login-btn { | |||
@@ -19,57 +19,25 @@ Page({ | |||
*/ | |||
powerDrawer: function(e) { | |||
// var currentStatu = e.currentTarget.dataset.statu; | |||
// couponOrderStatus | |||
// 0 未使用 | |||
// 1 已使用 | |||
// 2 已过期 | |||
// 3 已经退款 | |||
console.log(e); | |||
wx.navigateTo({ | |||
url: `/pages/youhuiquanma/index?quancode=${e.currentTarget.dataset.quancode}&title=${e.currentTarget.dataset.title}&subtitle=${e.currentTarget.dataset.subtitle}&remark=${e.currentTarget.dataset.remark}`, | |||
}) | |||
// console.log(e.currentTarget.dataset.statu); | |||
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); | |||
// this.utils(currentStatu, e.currentTarget.dataset.quancode); | |||
console.log(e.currentTarget.dataset.couponorderstatus); | |||
}, | |||
// utils: function(currentStatu, quancode) { | |||
// /* 动画部分 */ | |||
// // 第1步:创建动画实例 | |||
// var animation = wx.createAnimation({ | |||
// duration: 200, //动画时长 | |||
// timingFunction: "linear", //线性 | |||
// delay: 0 //0则不延迟 | |||
// }); // 第2步:这个动画实例赋给当前的动画实例 | |||
// this.animation = animation; // 第3步:执行第一组动画 | |||
// animation.opacity(0).step(); // 第4步:导出动画对象赋给数据对象储存 | |||
// this.setData({ | |||
// animationData: animation.export() | |||
// }); // 第5步:设置定时器到指定时候后,执行第二组动画 | |||
// setTimeout( | |||
// function() { | |||
// // 执行第二组动画 | |||
// animation.opacity(1).step(); // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 | |||
// this.setData({ | |||
// animationData: animation | |||
// }); //关闭 | |||
// if (currentStatu == "close") { | |||
// this.setData({ | |||
// showModalStatus: false | |||
// }); | |||
// } | |||
// }.bind(this), | |||
// 20 | |||
// ); | |||
// // 显示 | |||
// if (currentStatu == "open") { | |||
// this.setData({ | |||
// showModalStatus: true | |||
// }); | |||
// this.data.flag++; | |||
// console.log(this.data.flag); | |||
// util.barcode("barcode" + this.data.flag, quancode, 500, 100); | |||
// util.qrcode("qrcode" + this.data.flag, quancode, 350, 350); | |||
// this.setData({ | |||
// flag: this.data.flag | |||
// }); | |||
// } | |||
// }, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
@@ -80,7 +48,7 @@ Page({ | |||
this.setData({ | |||
orderId: options.orderId | |||
}) | |||
}); | |||
Http.get({ | |||
url: config.api.orderDetail, | |||
@@ -140,12 +108,27 @@ Page({ | |||
if (res.errMsg == "requestPayment:ok") { | |||
wx.showToast({ | |||
title: "购买成功", | |||
duration: 2500 | |||
duration: 2000, | |||
image: "./../../../assets/img/success.png", | |||
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 => { | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2); // 支付失败 | |||
@@ -154,30 +137,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 | |||
}); | |||
} | |||
@@ -188,11 +153,13 @@ Page({ | |||
}); | |||
} else { | |||
// 免费券 | |||
that.payOrderUpdate(orderId, "0", 1) // 支付成功 | |||
that | |||
.payOrderUpdate(orderId, "0", 1) // 支付成功 | |||
.then(res => { | |||
wx.showToast({ | |||
title: "支付成功", | |||
duration: 3000 | |||
duration: 2000, | |||
image: "./../../../assets/img/success.png" | |||
}); | |||
}); | |||
} | |||
@@ -203,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({ | |||
@@ -257,4 +224,4 @@ Page({ | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function() {} | |||
}); | |||
}); |
@@ -29,10 +29,23 @@ | |||
<text>适用门店</text> | |||
<text class="fr">{{order.merchantName}}</text> | |||
</view> | |||
<view wx:if="{{order.orderStatus==1}}" data-title="{{order.title}}" data-subtitle="{{order.subTitle}}" data-remark="{{order.remark}}" data-quancode="{{order.id}}" bindtap="powerDrawer" data-statu="open"> | |||
<view> | |||
<text>兑换码:</text> | |||
<text>{{order.id}}</text> | |||
<!-- | |||
couponOrderStatus | |||
0 未使用 | |||
1 已使用 | |||
2 已过期 | |||
3 已经退款 | |||
--> | |||
<!-- | |||
orderStatus | |||
1 | |||
只有支付完成的时 | |||
才显示兑换码 | |||
--> | |||
<view wx:if="{{order.orderStatus==1}}" data-couponOrderStatus="{{order.couponOrderStatus}}" data-title="{{order.title}}" data-subtitle="{{order.subTitle}}" data-remark="{{order.remark}}" data-quancode="{{order.couponOrderId}}" bindtap="powerDrawer"> | |||
<view style="width:86%;clear: both;"> | |||
<text>兑换码</text> | |||
<text class="fr">{{order.couponOrderId}}</text> | |||
</view> | |||
<view> | |||
<image class="spcode" src="./../../../assets/img/spcode.png" mode="widthFix"></image> | |||
@@ -56,18 +69,3 @@ | |||
<button bindtap='orderFunc' data-couponChannelId="{{order.id}}" class='buy'>立即支付</button> | |||
</view> | |||
</view> | |||
<!--mask--> | |||
<view class="drawer_screen" data-title="{{order.title}}" data-subtitle="{{order.subTile}}}" data-remark="{{order.remark}}" data-quancode="{{order.id}}" wx:if="{{showModalStatus}}" bindtap="powerDrawer" data-statu="close"></view> | |||
<view animation="{{animationData}}" class="drawer_box" wx:if="{{showModalStatus}}"> | |||
<view class="panel"> | |||
<view class="barcode"> | |||
<canvas canvas-id="barcode{{flag+1}}" /> | |||
</view> | |||
<view class="qrcode"> | |||
<canvas canvas-id="qrcode{{flag+1}}" /> | |||
</view> | |||
<view class="barnum"><text>兑换码:</text>{{data.id}}</view> | |||
</view> | |||
</view> |
@@ -287,6 +287,7 @@ radio { | |||
} | |||
.barnum { | |||
width: 88%; | |||
height: 46rpx; | |||
line-height: 46rpx; | |||
font-size: 32rpx; | |||
@@ -23,7 +23,9 @@ Page({ | |||
current: "", | |||
current_scroll: "1", | |||
page: 1, | |||
allow_load: true | |||
allow_load: true, | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content:"", | |||
}, | |||
onLoad(e) { | |||
this.getList(e.id, 1); | |||
@@ -35,23 +37,11 @@ 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; | |||
console.log(key); | |||
/** | |||
* key==0 | |||
* 不发送该字段 | |||
@@ -72,23 +62,31 @@ Page({ | |||
} | |||
if (that.data.allow_load) { | |||
wx.showLoading({ | |||
title: "加载中" | |||
}); | |||
that.setData({ | |||
loading:true, | |||
content:'小主,我在玩命加载中...' | |||
}) | |||
Http.get({ | |||
url: config.api.orderList, | |||
data: variable | |||
}).then(res => { | |||
console.log(res); | |||
console.log("姐姐的订单列表"); | |||
setTimeout(function() { | |||
wx.hideLoading(); | |||
}, 1200); | |||
if (pageNum >= res.data.pages) { | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
} | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
/** | |||
* 先赋值后渲染页面 | |||
* concat 不会改变原数组值 | |||
@@ -99,7 +97,6 @@ Page({ | |||
list: that.data.list | |||
}); | |||
for(let i=0; i<that.data.list.length; i++){ | |||
console.log(i); | |||
that.setData({ | |||
createDate:util.fmtDate(that.data.list[i].createDate) | |||
}) | |||
@@ -107,6 +104,15 @@ Page({ | |||
}); | |||
} else { | |||
console.log("加载完成allow_load设置成false"); | |||
that.setData({ | |||
loading:true, | |||
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
}) | |||
setTimeout(function(){ | |||
that.setData({ | |||
loading:false, | |||
}) | |||
},1400) | |||
} | |||
}, | |||
handleChange({ detail }) { | |||
@@ -124,13 +130,10 @@ Page({ | |||
}, | |||
onReachBottom: function() { | |||
var that = this; | |||
console.log(that.data.page); | |||
that.data.page++; | |||
console.log(that.data.page); | |||
that.setData({ | |||
page: that.data.page | |||
}); | |||
console.info("after++ " + that.data.page); | |||
that.getList(that.data.current_scroll, that.data.page); | |||
} | |||
}); |
@@ -11,9 +11,9 @@ | |||
<view class='info'> | |||
<view> | |||
<text>{{item.title}}</text> | |||
<text wx:if="{{item.orderStatus==0}}">等待付款</text> | |||
<text wx:if="{{item.orderStatus==0}}">待付款</text> | |||
<text wx:if="{{item.orderStatus==1}}">已付款</text> | |||
<text wx:if="{{item.orderStatus==2}}">订单取消</text> | |||
<text wx:if="{{item.orderStatus==2}}">已过期</text> | |||
</view> | |||
<view>{{item.subTitle}}</view> | |||
<view> | |||
@@ -26,11 +26,22 @@ | |||
<text>¥{{item.salePrice/100}}</text> | |||
<text>¥{{item.price/100}}</text> | |||
</view> | |||
<view class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||
<text wx:if="{{item.orderStatus==1}}">查看详情</text> | |||
<text wx:if="{{item.orderStatus==0}}">支付</text> | |||
<text wx:if="{{item.orderStatus==2}}">支付</text> | |||
<!-- | |||
orderStatus | |||
0待付款 | |||
1完成 | |||
2取消 | |||
--> | |||
<view wx:if="{{item.orderStatus==1}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||
<text>查看详情</text> | |||
</view> | |||
<view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | |||
<text>支付</text> | |||
</view> | |||
<view wx:if="{{item.orderStatus==2}}" style="background:#999;opacity: .6;" class="btn"> | |||
<text>已过期</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="dingdan" wx:if="{{list.length==0}}"> | |||
@@ -38,4 +49,7 @@ | |||
<text>暂无订单</text> | |||
</view> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"> | |||
<image src="./../../../assets/img/loading.gif" mode="widthFix"></image>{{content}} | |||
</view> | |||
</view> |
@@ -20,7 +20,7 @@ | |||
.detail_msg { | |||
width: 92%; | |||
height: 220rpx !important; | |||
height: 200rpx !important; | |||
background: #fff; | |||
display: flex; | |||
margin: 0 4%; | |||
@@ -29,9 +29,11 @@ | |||
} | |||
.logo { | |||
width: 248rpx; | |||
width: 350rpx; | |||
height: 184rpx; | |||
border-radius: 30rpx; | |||
border: 1px solid #f8f8f8; | |||
border-radius: 16rpx; | |||
overflow: hidden; | |||
} | |||
.logo image { | |||
@@ -43,6 +45,7 @@ | |||
display: flex; | |||
justify-content: space-between; | |||
padding: 0 4%; | |||
margin-top: 8rpx; | |||
} | |||
.info { | |||
@@ -50,28 +53,33 @@ | |||
} | |||
.info view:nth-child(1) { | |||
margin-top: 20rpx; | |||
margin-bottom: 15rpx; | |||
} | |||
.info view:nth-child(1) text { | |||
font-size: 30rpx; | |||
/* width: 340rpx; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; */ | |||
} | |||
.info view:nth-child(1) text:nth-child(2) { | |||
color: #ffae00; | |||
color: #f96563; | |||
font-size: 24rpx; | |||
/* width: 340rpx; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; */ | |||
} | |||
.info view:nth-child(2), | |||
.info view:nth-child(3) { | |||
.info view:nth-child(2), .info view:nth-child(3) { | |||
color: #f96563; | |||
font-size: 24rpx; | |||
padding-left: 4%; | |||
} | |||
.info view:nth-child(2) text, | |||
.info view:nth-child(3) text { | |||
.info view:nth-child(2) text, .info view:nth-child(3) text { | |||
font-size: 22rpx; | |||
color: #b8b8b8; | |||
} | |||
@@ -109,7 +117,7 @@ | |||
bottom: 0; | |||
margin: auto; | |||
right: 20rpx; | |||
width: 200rpx; | |||
width: 180rpx; | |||
height: 60rpx; | |||
line-height: 60rpx; | |||
text-align: center; | |||
@@ -124,17 +132,35 @@ | |||
font-size: 28rpx; | |||
color: #fff; | |||
} | |||
.dingdan{ | |||
.dingdan { | |||
margin-top: 200rpx; | |||
} | |||
.dingdan text { | |||
display: block; | |||
text-align: center; | |||
font-size: 30rpx; | |||
color: #999; | |||
color: #00c0ff; | |||
} | |||
.dingdan image { | |||
display: block; | |||
width: 100rpx; | |||
margin: 0 auto 16rpx; | |||
} | |||
.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; | |||
} |
@@ -22,7 +22,8 @@ Page({ | |||
code:options.quancode, | |||
title:options.title, | |||
subtitle:options.subtitle, | |||
remark:options.remark | |||
remark:options.remark, | |||
couponorderstatus:options.couponorderstatus | |||
}) | |||
}, | |||
@@ -0,0 +1,32 @@ | |||
<view class="couponbg"> | |||
<image src="./../../assets/img/bg.png"></image> | |||
<view class="title">{{title}}</view> | |||
<view class="subtitle">{{subtitle}}</view> | |||
<!-- | |||
couponorderstatus | |||
0 未使用 | |||
1 已使用 | |||
2 已过期 | |||
3 已经退款 | |||
--> | |||
<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> | |||
<view class="gou"> | |||
<view class="mai">购买须知:</view> | |||
<view class="remark">{{remark}}</view> | |||
</view> | |||
</view> |
@@ -3,7 +3,6 @@ page { | |||
} | |||
.couponbg { | |||
position: relative; | |||
height: 100%; | |||
width: 100%; | |||
} | |||
.couponbg image { | |||
@@ -17,7 +16,7 @@ page { | |||
right: 0; | |||
margin: auto; | |||
z-index: -19999; | |||
border-radius: 20rpx; | |||
border-radius: 26rpx; | |||
} | |||
.title { | |||
font-size: 33rpx; | |||
@@ -33,15 +32,17 @@ page { | |||
margin-top: 16rpx; | |||
text-align: center; | |||
} | |||
.panel { | |||
width: 600rpx; | |||
.panel,.zhuangtai image{ | |||
width: 510rpx; | |||
height: 581rpx; | |||
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; | |||
opacity: 0.6; | |||
@@ -78,7 +79,8 @@ page { | |||
} | |||
.qrcode { | |||
height: 380rpx; | |||
position: relative; | |||
height: 360rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-end; | |||
@@ -113,17 +115,17 @@ page { | |||
line-height: 88rpx; | |||
border-radius: 16rpx; | |||
border: 1px solid #eee; | |||
margin-top:40rpx; | |||
} | |||
.gou{ | |||
padding-left: 80rpx; | |||
color: #878d95; | |||
padding-top:30rpx; | |||
font-size: 30rpx; | |||
width: 87%; | |||
margin: 0 auto; | |||
color: #878d95; | |||
font-size: 26rpx; | |||
padding-bottom:74rpx; | |||
} | |||
.mai{ | |||
color: #666; | |||
color: #333; | |||
} | |||
.remark{ | |||
padding-top: 37rpx; | |||
padding-top: 17rpx; | |||
} |
@@ -26,9 +26,9 @@ | |||
</view> | |||
<button class='deleteButton' bindtap='unbindCarBtn' data-car='{{item.carNumber}}'>解绑</button> | |||
</view> | |||
<view class='orderBox' wx:if='{{item.remainingFee}}'> | |||
<view class='orderBox' wx:if='{{item.stopFee.remainingFee}}'> | |||
<view class='priceBox'> | |||
<text>{{'待支付金额:¥'+item.remainingFee}}</text> | |||
<text>待缴金额:¥{{item.stopFee.remainingFee}}</text> | |||
</view> | |||
<view class='payBox'> | |||
<navigator target="miniProgram" open-type="navigate" app-id="wx192b7d2e8dcbefd0" path="" extra-data="{{item.extraData}}" version="release"> | |||
@@ -92,7 +92,7 @@ color: transparent; | |||
} | |||
.bottonBox{ | |||
width: 750rpx; | |||
margin-top: 75rpx; | |||
margin-top: 26rpx; | |||
} | |||
.textStyle{ | |||
background-color: white; | |||
@@ -153,7 +153,7 @@ color: transparent; | |||
.detail{ | |||
width: 32rpx; | |||
height: 32rpx; | |||
right: 50rpx; | |||
right: 34rpx; | |||
top: 32rpx; | |||
position: absolute; | |||
} | |||
@@ -13,7 +13,9 @@ Page({ | |||
allow_load: true, | |||
day: "", | |||
hour: "", | |||
minute: "" | |||
minute: "", | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content:"", | |||
}, | |||
/** | |||
@@ -30,13 +32,17 @@ Page({ | |||
* 判断用户是否加载完成 | |||
*/ | |||
if (that.data.allow_load) { | |||
wx.showLoading({ | |||
title: "加载中" | |||
}); | |||
// wx.showLoading({ | |||
// title: "加载中" | |||
// }); | |||
that.setData({ | |||
loading:true, | |||
content:'小主,我在玩命加载中...' | |||
}) | |||
setTimeout(function() { | |||
wx.hideLoading(); | |||
}, 1200); | |||
// setTimeout(function() { | |||
// wx.hideLoading(); | |||
// }, 1200); | |||
Http.get({ | |||
url: config.api.couponChannelList, | |||
data: { | |||
@@ -45,56 +51,58 @@ Page({ | |||
targetAd: 2 | |||
} | |||
}).then(res => { | |||
console.log(res); | |||
//当前时间与优惠券下架时间做计算 | |||
console.log(that.data.day); | |||
if (page >= res.data.pages) { | |||
// wx.showToast({ | |||
// title: "加载完成喽", | |||
// icon: "success" | |||
// }); | |||
that.setData({ | |||
allow_load: false | |||
}); | |||
} | |||
that.data.list = that.data.list.concat(res.data.list); | |||
that.setData({ | |||
list: that.data.list | |||
}); | |||
/** | |||
* 页面上显示的时间 | |||
*/ | |||
console.log(that.data.list); | |||
for (let i = 0; i < that.data.list.length; i++) { | |||
console.log(that.data.list[i].endTime); | |||
var startTime = util.fmtDate(that.data.list[i].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(month, day, hour, minute, second); | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
} else { | |||
setTimeout(function() { | |||
that.setData({ | |||
loading:false, | |||
}) | |||
}, 1400); | |||
/** | |||
* 页面上显示的时间 | |||
*/ | |||
that.data.list = that.data.list.concat(res.data.list); | |||
that.setData({ | |||
month: month, | |||
day: day, | |||
hour: hour, | |||
minute: minute | |||
list: that.data.list | |||
}); | |||
console.log(that.data.list); | |||
for (let i = 0; i < that.data.list.length; i++) { | |||
var startTime = util.fmtDate(that.data.list[i].endTime); | |||
util.timechuo(startTime); | |||
console.log(util.timechuo(startTime)); | |||
/** | |||
* 修改list的endtime | |||
* 渲染到页面 | |||
*/ | |||
var endtime = 'list[' + i + '].endtime' | |||
that.setData({ | |||
[endtime]: util.timechuo(startTime) | |||
}); | |||
} | |||
} | |||
}); | |||
} else { | |||
console.info("allow_load==false 已禁止加载"); | |||
that.setData({ | |||
loading:true, | |||
content:"^_^再拉裤子就掉啦ʅ(´◔౪◔)ʃ" | |||
}) | |||
setTimeout(function(){ | |||
that.setData({ | |||
loading:false, | |||
}) | |||
},1400) | |||
} | |||
}; | |||
if (app.globalData.token && app.globalData.token != null) { | |||
@@ -118,16 +126,7 @@ Page({ | |||
wx.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${ | |||
e.currentTarget.dataset.couponchannelid | |||
}&couponId=${e.currentTarget.dataset.couponId}`, | |||
success: function(res) { | |||
// success | |||
}, | |||
fail: function() { | |||
// fail | |||
}, | |||
complete: function() { | |||
// complete | |||
} | |||
}&couponId=${e.currentTarget.dataset.couponid}` | |||
}); | |||
}, | |||
/** | |||
@@ -1,7 +1,7 @@ | |||
<!-- 限时抢购 查看更多对应的页面 --> | |||
<view class='flashSale'> | |||
<view wx:for="{{list}}" class='flashSaleItemWrap' data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}" data-targetAd="{{item.targetAd}}" bindtap="gotodetail" | |||
wx:key="index"> | |||
<view wx:for="{{list}}" class='flashSaleItemWrap' data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}" data-targetAd="{{item.targetAd}}" | |||
bindtap="gotodetail" wx:key="index"> | |||
<view class='flashSaleItem'> | |||
<view class='flashSaleItemTop'> | |||
<view class='flashSaleItemTopL'> | |||
@@ -19,14 +19,17 @@ | |||
</view> | |||
</view> | |||
<view class='flashSaleItemBottom'> | |||
<view class='flashSaleItemBottomTop'><text class='remainingTime'>剩余时间:</text><text class='realRemainingTime'>{{day}}天 {{hour}}小时{{minute}}分钟</text></view> | |||
<view class='flashSaleItemBottomTop'> | |||
<text class='remainingTime'>剩余时间:</text> | |||
<text class='realRemainingTime'>{{item.endtime}}</text> | |||
</view> | |||
<view class='flashSaleItemBottomBottm'> | |||
<view class="view1"><text class="remainingNumber">剩余件数:</text><text class='realnumber'>{{item.remainInventory}}件</text></view> | |||
<view class='buy' wx:if="{{item.priceStr!=0}}">购买</view> | |||
<view class='buy' wx:if="{{item.priceStr!=0}}">领取</view> | |||
<view class='buy' wx:if="{{item.salePriceStr!=0}}">购买</view> | |||
<view class='buy' wx:if="{{item.salePriceStr==0}}">领取</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="loading" wx:if="{{loading}}"><image src="./../../assets/img/loading.gif" mode="widthFix"></image>{{content}}</view> | |||
</view> |
@@ -1,49 +1,69 @@ | |||
.flashSale{ | |||
.flashSale { | |||
width: 100%; | |||
height: 100%; | |||
background: #fff; | |||
} | |||
.flashSaleItemWrap{ | |||
.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; | |||
} | |||
.flashSaleItemWrap { | |||
width: 100%; | |||
height: 410rpx; | |||
border-top: 1rpx solid #ededed; | |||
border-bottom: 10rpx solid #f8f8f8; | |||
} | |||
.flashSaleItem{ | |||
.flashSaleItem { | |||
width: 90%; | |||
height: 410rpx; | |||
display: flex; | |||
flex-direction: column; | |||
background: #fff; | |||
margin: 0 auto; | |||
flex-direction: column; | |||
background: #fff; | |||
margin: 0 auto; | |||
} | |||
.flashSaleItemTop{ | |||
.flashSaleItemTop { | |||
display: flex; | |||
padding-top: 28rpx; | |||
flex-direction:row; | |||
flex-direction: row; | |||
padding-bottom: 25rpx; | |||
border-bottom: 1rpx solid #ededed; | |||
} | |||
.flashSaleItemTopL{ | |||
.flashSaleItemTopL { | |||
flex: 1; | |||
} | |||
.food{ | |||
.food { | |||
width: 248rpx; | |||
border-radius: 10rpx; | |||
height: 184rpx; | |||
} | |||
.flashSaleItemTopR{ | |||
.flashSaleItemTopR { | |||
flex: 2; | |||
flex-direction: column; | |||
margin-left: 20rpx; | |||
} | |||
.flashSaleItemTopRTop{ | |||
.flashSaleItemTopRTop { | |||
display: flex; | |||
flex-direction: column; | |||
} | |||
.foodname{ | |||
.foodname { | |||
font-size: 32rpx; | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
@@ -52,65 +72,77 @@ | |||
width: 406rpx; | |||
overflow: hidden; | |||
} | |||
.small{ | |||
.small { | |||
font-size: 24rpx; | |||
color: #00C0FF; | |||
color: #00c0ff; | |||
margin-top: 15rpx; | |||
} | |||
.flashSaleItemTopRBottom{ | |||
.flashSaleItemTopRBottom { | |||
margin-top: 24rpx; | |||
} | |||
.presentPrice{ | |||
.presentPrice { | |||
font-size: 36rpx; | |||
color: #f96563; | |||
} | |||
.originalPrice{ | |||
.originalPrice { | |||
margin-left: 20rpx; | |||
color:#B4B4B4; | |||
color: #b4b4b4; | |||
text-decoration: line-through; | |||
font-size: 24rpx; | |||
} | |||
.flashSaleItemBottom{ | |||
margin-top: 20rpx; | |||
position: relative; | |||
.flashSaleItemBottom { | |||
margin-top: 20rpx; | |||
position: relative; | |||
} | |||
.remainingTime{ | |||
.remainingTime { | |||
font-size: 28rpx; | |||
color: #B4B4B4; | |||
color: #b4b4b4; | |||
} | |||
.realRemainingTime{ | |||
.realRemainingTime { | |||
margin-left: 10rpx; | |||
color:#f96563; | |||
color: #f96563; | |||
font-size: 28rpx; | |||
} | |||
.flashSaleItemBottomBottm{ | |||
.flashSaleItemBottomBottm { | |||
display: flex; | |||
flex-direction: row; | |||
} | |||
.view1{ | |||
.view1 { | |||
width: 550rpx; | |||
display: block; | |||
} | |||
.remainingNumber{ | |||
.remainingNumber { | |||
font-size: 28rpx; | |||
color: #B4B4B4; | |||
color: #b4b4b4; | |||
} | |||
.realnumber{ | |||
.realnumber { | |||
margin-left: 10rpx; | |||
color: #f96563; | |||
font-size: 28rpx; | |||
} | |||
.buy{ | |||
.buy { | |||
position: absolute; | |||
top: 34rpx; | |||
bottom: 0; | |||
right: 20rpx; | |||
width:114rpx; | |||
width: 114rpx; | |||
height: 50rpx; | |||
line-height: 50rpx; | |||
text-align: center; | |||
background: #00C0FF; | |||
background: #00c0ff; | |||
color: #fff; | |||
border-radius: 10rpx; | |||
font-size: 28rpx; | |||
} | |||
} |
@@ -3,13 +3,12 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
user: { | |||
avatar: | |||
"http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" | |||
} | |||
// user: { | |||
// avatar: | |||
// "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" | |||
// } | |||
}, | |||
navigateTo() { | |||
console.log("object"); | |||
wx.navigateTo({ | |||
url: `/pages/login/index` | |||
}); | |||
@@ -1,18 +0,0 @@ | |||
<view class="couponbg"> | |||
<image src="./../../assets/img/bg.png"></image> | |||
<view class="title">{{title}}</view> | |||
<view class="subtitle">{{subtitle}}</view> | |||
<view class="panel"> | |||
<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="gou"> | |||
<view class="mai">购买须知:</view> | |||
<view class="remark">{{remark}}</view> | |||
</view> | |||
</view> |
@@ -97,9 +97,9 @@ class HttpBasics { | |||
resolve(res.data); | |||
} else { | |||
wx.hideLoading(); | |||
wx.showToast({ | |||
title: res.data.message | |||
}); | |||
// wx.showToast({ | |||
// title: res.data.message | |||
// }); | |||
reject(res.data); | |||
} | |||
} else { | |||