0000
This commit is contained in:
70
pages/washCodeDetail/washCodeDetail.js
Normal file
70
pages/washCodeDetail/washCodeDetail.js
Normal file
@@ -0,0 +1,70 @@
|
||||
var e = getApp(), i = require("../../utils/login.js"), t = require("../../utils/common.js");
|
||||
|
||||
Page({
|
||||
data: {
|
||||
showLoding: !0,
|
||||
info: {},
|
||||
id: ""
|
||||
},
|
||||
onLoad: function(t) {
|
||||
var o = this;
|
||||
wx.showLoading({
|
||||
title: ""
|
||||
}), this.setData({
|
||||
id: t.id || 1
|
||||
}), i.pageStart(e).then(function(e) {
|
||||
o.getList();
|
||||
});
|
||||
},
|
||||
getList: function() {
|
||||
var o = this;
|
||||
wx.showLoading({
|
||||
title: ""
|
||||
}), i.request(e.globalData.config.carwashcoupon.details, {
|
||||
id: this.data.id
|
||||
}, !0).then(function(e) {
|
||||
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
||||
title: "提示",
|
||||
content: e.message
|
||||
}), !1;
|
||||
e.data.starttime = t.changeTimeyear(new Date(1e3 * e.data.starttime)), e.data.deadline = t.changeTimeyear(new Date(1e3 * e.data.deadline)),
|
||||
o.setData({
|
||||
info: e.data,
|
||||
showLoding: !1
|
||||
}, function() {});
|
||||
}).catch(function(e) {
|
||||
wx.hideLoading();
|
||||
});
|
||||
},
|
||||
isSubmit: !1,
|
||||
received: function() {
|
||||
if (this.isSubmit) return !1;
|
||||
var t = this;
|
||||
this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request(e.globalData.config.carwashcoupon.receive, {
|
||||
id: t.data.id,
|
||||
token: t.data.info.token
|
||||
}, !0).then(function(e) {
|
||||
console.log("receiveddqta", e), wx.hideLoading(), t.isSubmit = !1, console.log("recief"),
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: e.message,
|
||||
success: function(e) {
|
||||
e.confirm && wx.redirectTo({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
}
|
||||
});
|
||||
}).catch(function(e) {
|
||||
wx.hideLoading(), t.isSubmit = !1, console.log("提示提示提示提示", e), 201 == e.code && wx.showModal({
|
||||
title: "提示",
|
||||
content: e.message,
|
||||
success: function(e) {
|
||||
if (!e.confirm) return console.log("弹窗取消"), !1;
|
||||
wx.redirectTo({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
6
pages/washCodeDetail/washCodeDetail.json
Normal file
6
pages/washCodeDetail/washCodeDetail.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"page-loding": "../../template/pageLoding/pageLoding"
|
||||
},
|
||||
"navigationBarTitleText": "聚美汽服"
|
||||
}
|
||||
27
pages/washCodeDetail/washCodeDetail.wxml
Normal file
27
pages/washCodeDetail/washCodeDetail.wxml
Normal file
@@ -0,0 +1,27 @@
|
||||
<view class="container">
|
||||
<page-loding wx:if="{{showLoding}}"></page-loding>
|
||||
<image class="login-bg" mode="widthFix" src="/img/login-bg.png"></image>
|
||||
<view class="yellow-bg"></view>
|
||||
<image class="car" src="/img/car.png"></image>
|
||||
<view class="text-inner">
|
||||
<view class="page-title">领取洗车码</view>
|
||||
<view class="code">{{info.name}}</view>
|
||||
<view class="use-location"> 本洗车码可在以下网点使用 <view class="list">
|
||||
<view class="item" wx:for="{{info.agent}}">{{item.t_name}}</view>
|
||||
</view>
|
||||
<view class="time">有效期:{{info.starttime}} - {{info.deadline}}</view>
|
||||
</view>
|
||||
<view bindtap="received" class="btn" wx:if="{{info.token}}">立即领取</view>
|
||||
<view class="tips">领取后在洗车码页面中查看</view>
|
||||
<view class="howTOuse">
|
||||
<view class="title">如何使用洗车码</view>
|
||||
<view class="text">
|
||||
<text>1、打开微信扫一扫
|
||||
2、扫描洗车机上的二维码
|
||||
3、点击“洗车码”图标
|
||||
4、选择要使用的洗车码
|
||||
5、点击最下方按钮,启动机器</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
162
pages/washCodeDetail/washCodeDetail.wxss
Normal file
162
pages/washCodeDetail/washCodeDetail.wxss
Normal file
@@ -0,0 +1,162 @@
|
||||
.container {
|
||||
background: #fff;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container,.login-bg {
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.yellow-bg {
|
||||
background: #f5c82e;
|
||||
height: 83vh;
|
||||
transform: rotateZ(-45deg);
|
||||
transform-origin: right top;
|
||||
width: 187vw;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.car,.yellow-bg {
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.car {
|
||||
height: 643rpx;
|
||||
width: 557rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 192rpx;
|
||||
left: 50%;
|
||||
position: fixed;
|
||||
top: 180rpx;
|
||||
transform: translateX(-50%);
|
||||
width: 192rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background-color: #1baa1c;
|
||||
border: 1px solid #218721;
|
||||
border-radius: 10rpx;
|
||||
color: #fff;
|
||||
font-size: 33rpx;
|
||||
height: 95rpx;
|
||||
line-height: 95rpx;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
width: 485rpx;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.btn,.text-inner {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.text-inner {
|
||||
height: 100vh;
|
||||
left: 0;
|
||||
padding: 46rpx;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
z-index: 12;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
color: #000;
|
||||
font-size: 44rpx;
|
||||
margin-bottom: 34rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.code {
|
||||
align-items: center;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
font-size: 33rpx;
|
||||
height: 95rpx;
|
||||
justify-content: center;
|
||||
margin: 0 auto 16rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.code,.use-location {
|
||||
background: #f1f1f1;
|
||||
box-sizing: border-box;
|
||||
color: #666;
|
||||
width: 485rpx;
|
||||
}
|
||||
|
||||
.use-location {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 18rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
margin: 0 auto 18rpx;
|
||||
padding: 20rpx 26rpx;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.use-location .list {
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.use-location .list .item {
|
||||
display: block;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.use-location .list .item::before {
|
||||
background: #666;
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
display: inline-block;
|
||||
height: 22rpx;
|
||||
margin-right: 8rpx;
|
||||
width: 22rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 22rpx;
|
||||
margin-top: 52rpx;
|
||||
}
|
||||
|
||||
.tips {
|
||||
color: #666;
|
||||
font-size: 26rpx;
|
||||
margin: 20rpx 0 60rpx;
|
||||
opacity: .7;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.howTOuse {
|
||||
background-color: #fff;
|
||||
border-radius: 18rpx;
|
||||
box-sizing: border-box;
|
||||
color: #333;
|
||||
font-size: 33rpx;
|
||||
height: 363rpx;
|
||||
opacity: .8;
|
||||
padding: 14rpx 34rpx;
|
||||
width: 660rpx;
|
||||
z-index: 12;
|
||||
}
|
||||
|
||||
.howTOuse .title {
|
||||
color: #000;
|
||||
font-size: 44rpx;
|
||||
margin-bottom: 4rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
text {
|
||||
line-height: 52rpx;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user