Compare commits
No commits in common. "feature" and "master" have entirely different histories.
14
app.js
@ -1,16 +1,6 @@
|
|||||||
var t = require("./utils/login.js");
|
var t = require("./utils/login.js");
|
||||||
|
|
||||||
// 引入
|
|
||||||
require("./utils/xstat.js");
|
|
||||||
|
|
||||||
|
|
||||||
App({
|
App({
|
||||||
xstatConfig: {
|
|
||||||
appKey: wx.getAccountInfoSync().miniProgram.appId, // 自动获取 小程序appid
|
|
||||||
debug: true, //是否打开调试模式
|
|
||||||
// 上报地址
|
|
||||||
LOG_URL: 'https://t-jm.v0750.com/send',
|
|
||||||
},
|
|
||||||
onLaunch: function(e) {
|
onLaunch: function(e) {
|
||||||
console.log("options", e), this.globalData.options = e, t.getLogin(this, !0);
|
console.log("options", e), this.globalData.options = e, t.getLogin(this, !0);
|
||||||
try {
|
try {
|
||||||
@ -28,12 +18,12 @@ App({
|
|||||||
onShow: function(e) {
|
onShow: function(e) {
|
||||||
console.log("onshowwwwwwwoptions", e);
|
console.log("onshowwwwwwwoptions", e);
|
||||||
var o = e.scene;
|
var o = e.scene;
|
||||||
[ 1011, 1012, 1013, 1024, 1047, 1048, 1049 ].indexOf(o) > -1 && (console.log("扫码进入的"),
|
[ 1011, 1012, 1013, 1024, 1047, 1048, 1049 ].indexOf(o) > -1 && (console.log("扫码进入的"),
|
||||||
t.getDevicecode(this, e));
|
t.getDevicecode(this, e));
|
||||||
},
|
},
|
||||||
computeNavigateBarHeight: function(t) {
|
computeNavigateBarHeight: function(t) {
|
||||||
var e = wx.getMenuButtonBoundingClientRect(), o = e.bottom + 6, i = t.windowHeight, n = e.top, a = e.height;
|
var e = wx.getMenuButtonBoundingClientRect(), o = e.bottom + 6, i = t.windowHeight, n = e.top, a = e.height;
|
||||||
i < 10 && (i = t.windowHeight, a = o - (n = t.statusBarHeight)), o < 10 && (console.log("更新"),
|
i < 10 && (i = t.windowHeight, a = o - (n = t.statusBarHeight)), o < 10 && (console.log("更新"),
|
||||||
o = 68, /iPhone X|MI 8|PAAM00|COR-AL00/.test(t.model) ? o = 88 : /iPhone/.test(t.model) && (o = 64));
|
o = 68, /iPhone X|MI 8|PAAM00|COR-AL00/.test(t.model) ? o = 88 : /iPhone/.test(t.model) && (o = 64));
|
||||||
var s = t.windowWidth;
|
var s = t.windowWidth;
|
||||||
this.globalData.screen_data = {
|
this.globalData.screen_data = {
|
||||||
|
82
app.json
@ -1,51 +1,37 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/mall/mall",
|
"pages/mall/mall",
|
||||||
"pages/goodsDetails/goodsDetails",
|
"pages/goodsDetails/goodsDetails",
|
||||||
"pages/orderDetails/orderDetails",
|
"pages/orderDetails/orderDetails",
|
||||||
"pages/map/map",
|
"pages/map/map",
|
||||||
"pages/orderPaySuccess/orderPaySuccess",
|
"pages/orderPaySuccess/orderPaySuccess",
|
||||||
"pages/orderPay/orderPay",
|
"pages/orderPay/orderPay",
|
||||||
"pages/goodsSearch/goodsSearch",
|
"pages/goodsSearch/goodsSearch",
|
||||||
"pages/orderIndex/orderIndex",
|
"pages/orderIndex/orderIndex",
|
||||||
"pages/orderList/orderList",
|
"pages/orderList/orderList",
|
||||||
"pages/myAddress/myAddress",
|
"pages/myAddress/myAddress",
|
||||||
"pages/addAddress/addAddress",
|
"pages/addAddress/addAddress",
|
||||||
"pages/voucher/voucher",
|
"pages/voucher/voucher",
|
||||||
"pages/listDetail/listDetail",
|
"pages/listDetail/listDetail",
|
||||||
"pages/register/register",
|
"pages/register/register",
|
||||||
"pages/singleStart/singleStart",
|
"pages/singleStart/singleStart",
|
||||||
"pages/myDiscount/myDiscount",
|
"pages/myDiscount/myDiscount",
|
||||||
"pages/washCodeList/washCodeList",
|
"pages/washCodeList/washCodeList",
|
||||||
"pages/washCodeDetail/washCodeDetail",
|
"pages/washCodeDetail/washCodeDetail",
|
||||||
"pages/login/login",
|
"pages/login/login",
|
||||||
"pages/user/user",
|
"pages/user/user",
|
||||||
"pages/webview/webview",
|
"pages/webview/webview"
|
||||||
"pages/wangdian/wangdian",
|
],
|
||||||
"pages/duiquan/duiquan",
|
"window": {
|
||||||
"pages/refund/refund",
|
"backgroundTextStyle": "light",
|
||||||
"pages/washing/washing",
|
"navigationBarBackgroundColor": "#fff",
|
||||||
"pages/OnlineCarHailing/OnlineCarHailing"
|
"navigationBarTitleText": "聚美汽服",
|
||||||
],
|
"navigationBarTextStyle": "black"
|
||||||
"window": {
|
|
||||||
"backgroundTextStyle": "light",
|
|
||||||
"navigationBarBackgroundColor": "#fff",
|
|
||||||
"navigationBarTitleText": "聚美汽服",
|
|
||||||
"navigationBarTextStyle": "black"
|
|
||||||
},
|
|
||||||
"permission": {
|
|
||||||
"scope.address": {
|
|
||||||
"desc": "获取您的通讯地址"
|
|
||||||
},
|
},
|
||||||
"scope.userLocation": {
|
"permission": {
|
||||||
"desc": "你的位置信息将用于定位效果展示"
|
"scope.address": { "desc": "获取您的通讯地址" },
|
||||||
}
|
"scope.userLocation": { "desc": "你的位置信息将用于定位效果展示" }
|
||||||
},
|
},
|
||||||
"lazyCodeLoading": "requiredComponents",
|
"requiredPrivateInfos": ["chooseAddress", "getLocation", "chooseLocation"]
|
||||||
"requiredPrivateInfos": [
|
|
||||||
"chooseAddress",
|
|
||||||
"getLocation",
|
|
||||||
"chooseLocation"
|
|
||||||
]
|
|
||||||
}
|
}
|
BIN
img/car.png
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 428 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
83
img/iconfont.svg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
img/login-bg.png
Executable file → Normal file
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 712 KiB |
BIN
img/logo2.jpeg
Normal file
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 21 KiB |
@ -1,118 +0,0 @@
|
|||||||
// pages/OnlineCarHailing/OnlineCarHailing.js
|
|
||||||
var t = require("../../utils/login.js");
|
|
||||||
|
|
||||||
Page({
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
onSubmitToGroup(e) {
|
|
||||||
const mobile = e.detail.value.code
|
|
||||||
if (!mobile) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请输入手机号码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 手机号格式验证
|
|
||||||
if (!/^1[3-9]\d{9}$/.test(mobile)) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请输入正确的手机号码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 二次确认
|
|
||||||
wx.showModal({
|
|
||||||
title: '确认提示',
|
|
||||||
content: '确定要将此手机号设置为网约车用户吗?',
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
wx.showLoading({
|
|
||||||
title: '提交中...'
|
|
||||||
})
|
|
||||||
|
|
||||||
t.request('/miniprogram/user/onlineCarHailing', { mobile }, !0).then((res) => {
|
|
||||||
wx.hideLoading()
|
|
||||||
if (res.code == 200) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '设置成功',
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
wx.navigateBack()
|
|
||||||
}, 1500)
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message || '设置失败',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
<view class="contain">
|
|
||||||
<view class="content">
|
|
||||||
<view class="title">设置网约车用户</view>
|
|
||||||
<form bindsubmit="onSubmitToGroup">
|
|
||||||
<input class="input" name="code" auto-focus placeholder="请填写用户手机号码"/>
|
|
||||||
<button class="button" form-type="submit" type="primary">设置网约车用户</button>
|
|
||||||
</form>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
@ -1,25 +0,0 @@
|
|||||||
.contain {
|
|
||||||
box-sizing: border-box;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 60rpx 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 36rpx;
|
|
||||||
line-height: 1;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
margin: 40rpx 0;
|
|
||||||
padding: 22rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 2rpx solid #eee;
|
|
||||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
@ -1,13 +1,11 @@
|
|||||||
<template name="pageList">
|
<template name="pageList">
|
||||||
<view class="index-href-box">
|
<view class="index-href-box">
|
||||||
<view bindtap="toPage" class="item" data-needlogin="{{item.needlogin}}" data-refresh="{{item.refresh}}" data-showimg="{{item.showimg}}" data-url="{{item.url}}" data-phone="{{item.phone}}" wx:for="{{urlList}}" wx:key="index">
|
<view bindtap="toPage" class="item" data-needlogin="{{item.needlogin}}" data-refresh="{{item.refresh}}" data-showimg="{{item.showimg}}" data-url="{{item.url}}" wx:for="{{urlList}}" wx:key="index">
|
||||||
<view class="item_b" style="background-image:url({{item.img}}) ;">
|
<view class="btn">
|
||||||
<!-- <view class="btn">
|
<image class="video" src="../../img/video.png" wx:if="{{item.img=='video'}}"></image>
|
||||||
<image class="video" src="../../img/video.png" wx:if="{{item.img=='video'}}"></image>
|
<text class="iconfont icon-{{item.img}}" wx:else></text>
|
||||||
<text class="iconfont icon-{{item.img}}" wx:else></text>
|
|
||||||
</view> -->
|
|
||||||
<view class="name">{{item.name}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="name">{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,124 +0,0 @@
|
|||||||
var e = getApp(), t = require("../../utils/login.js");
|
|
||||||
|
|
||||||
Page({
|
|
||||||
data: {
|
|
||||||
pic: "https://jm-static.v0750.com/image/dui.jpg",
|
|
||||||
tips: "温馨提示:\n1、请在30分钟内完成兑换,超时作废\n2、请在兑换完成后,在本页面点击\"确认兑换\"\n3、兑换成功后,将在3个工作日内发放奖品",
|
|
||||||
code: ''
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
t.request('/miniprogram/coupons', {}, !0).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
this.setData({
|
|
||||||
tips: res.data.tips,
|
|
||||||
pic: res.data.pic
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
toScan: function () {
|
|
||||||
e.globalData.needJumpUrl = !1;
|
|
||||||
var a = this;
|
|
||||||
wx.scanCode({
|
|
||||||
success: function (i) {
|
|
||||||
console.log(i), wx.showLoading({
|
|
||||||
title: ""
|
|
||||||
}), e.globalData.qrcode = i.result, t.request("/miniprogram/identify", i, !0).then(function (t) {
|
|
||||||
console.log("data", t), wx.hideLoading();
|
|
||||||
// 保存设备编号
|
|
||||||
getApp().globalData.devicecode = t.data.devicecode || getApp().globalData.devicecode;
|
|
||||||
a.startup();
|
|
||||||
}).catch(function (e) {
|
|
||||||
wx.hideLoading();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 启动
|
|
||||||
startup: function () {
|
|
||||||
if (getApp().globalData.devicecode) {
|
|
||||||
// 已扫码,启动机器
|
|
||||||
t.request('/miniprogram/machine/carwashcodestartup', { devicecode: getApp().globalData.devicecode, washcode: this.data.code }, !0).then((startRes) => {
|
|
||||||
if (startRes.code == 200) {
|
|
||||||
wx.showToast({ title: startRes.message || '启动成功', icon: 'success' });
|
|
||||||
// 跳转到洗车券列表页面
|
|
||||||
wx.redirectTo({
|
|
||||||
url: "/pages/washing/washing"
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.redirectTo({
|
|
||||||
url: "/pages/washCodeList/washCodeList"
|
|
||||||
});
|
|
||||||
wx.showToast({ title: startRes.message || '启动失败', icon: 'none' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 未扫码,提示
|
|
||||||
wx.showToast({
|
|
||||||
title: '请先扫码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSubmitToGroup(e) {
|
|
||||||
const code = e.detail.value.code
|
|
||||||
if (!code) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请输入券码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
wx.showLoading({
|
|
||||||
title: '兑换中...'
|
|
||||||
})
|
|
||||||
t.request('/miniprogram/coupons/importDouyin', { code: code }, !0).then((res) => {
|
|
||||||
wx.hideLoading()
|
|
||||||
if (res.code == 200) {
|
|
||||||
|
|
||||||
// 在当前页面记下券码
|
|
||||||
this.setData({
|
|
||||||
code: res.data.code
|
|
||||||
})
|
|
||||||
|
|
||||||
wx.showModal({
|
|
||||||
title: '兑换成功',
|
|
||||||
content: '是否立即使用?',
|
|
||||||
success: (result) => {
|
|
||||||
if (result.confirm) {
|
|
||||||
// 判断是否已扫码
|
|
||||||
if (getApp().globalData.devicecode) {
|
|
||||||
|
|
||||||
wx.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "你当前将要使用的机器编号是:".concat(getApp().globalData.devicecode, ",确认开机吗?"),
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
// 用户点击了确认按钮,执行开机操作
|
|
||||||
this.startup();
|
|
||||||
} else {
|
|
||||||
// 用户点击了取消按钮,跳转到洗车券列表页面
|
|
||||||
wx.navigateTo({ url: '/pages/washCodeList/washCodeList' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// 未扫码,打开扫码页面
|
|
||||||
this.toScan(); // 调用toScan方法,跳转到扫码页面
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
wx.navigateTo({ url: '/pages/washCodeList/washCodeList' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message || '兑换失败',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
<view class="contain">
|
|
||||||
<image src="{{pic}}" mode="widthFix" class="pic"></image>
|
|
||||||
<view class="content">
|
|
||||||
<view class="title">请输入券码</view>
|
|
||||||
<form bindsubmit="onSubmitToGroup">
|
|
||||||
<input class="input" name="code" auto-focus placeholder="支持抖音/美团/聚美券码"/>
|
|
||||||
<button class="button" form-type="submit" type="primary">立即兑换</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<text class="tips">
|
|
||||||
{{tips}}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
@ -1,37 +0,0 @@
|
|||||||
.contain {
|
|
||||||
box-sizing: border-box;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #fafafa;
|
|
||||||
}
|
|
||||||
.pic {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 60rpx 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 36rpx;
|
|
||||||
line-height: 1;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
margin: 30rpx 0;
|
|
||||||
padding: 0 22rpx;
|
|
||||||
height: 88rpx;
|
|
||||||
line-height: 88rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 2rpx solid #eee;
|
|
||||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tips {
|
|
||||||
color: #999;
|
|
||||||
line-height: 2;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
@ -4,6 +4,8 @@
|
|||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"page-header": "./pageHeader/pageHeader",
|
"page-header": "./pageHeader/pageHeader",
|
||||||
|
"kefu-box": "./kefuBox/kefuBox",
|
||||||
|
"match-wrap": "./matchWrap/matchWrap",
|
||||||
"shop-add": "./shopAdd/shopAdd",
|
"shop-add": "./shopAdd/shopAdd",
|
||||||
"recomond-list": "./recomondList/recomondList",
|
"recomond-list": "./recomondList/recomondList",
|
||||||
"page-bottom": "./pageBottom/pageBottom",
|
"page-bottom": "./pageBottom/pageBottom",
|
||||||
|
@ -3,8 +3,35 @@ var e = getApp(), t = require("../../utils/login.js");
|
|||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
showLoding: !0,
|
showLoding: !0,
|
||||||
urlList: [],
|
urlList: [ {
|
||||||
wangdianList: [],
|
img: "chongzhi",
|
||||||
|
name: "充值赠送",
|
||||||
|
url: "voucher/voucher",
|
||||||
|
needlogin: !0
|
||||||
|
}, {
|
||||||
|
img: "video",
|
||||||
|
name: "洗车教程",
|
||||||
|
url: "webview/webview?url=https://jmqf.v0750.com/video",
|
||||||
|
needlogin: !1
|
||||||
|
}, {
|
||||||
|
img: "xichequan",
|
||||||
|
name: "网点分布",
|
||||||
|
url: "map/map"
|
||||||
|
}, {
|
||||||
|
img: "huiyuanzhongxin",
|
||||||
|
name: "会员中心",
|
||||||
|
url: "user/user",
|
||||||
|
needlogin: !0
|
||||||
|
}, {
|
||||||
|
img: "youhuiquan1",
|
||||||
|
name: "洗车券",
|
||||||
|
url: "washCodeList/washCodeList"
|
||||||
|
}, {
|
||||||
|
img: "shangjiajiameng",
|
||||||
|
name: "招募合伙人",
|
||||||
|
url: "",
|
||||||
|
showimg: !0
|
||||||
|
} ],
|
||||||
servicetel: "",
|
servicetel: "",
|
||||||
notice: "",
|
notice: "",
|
||||||
noticeurl: null,
|
noticeurl: null,
|
||||||
@ -18,68 +45,39 @@ Page({
|
|||||||
shop: !1
|
shop: !1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bindViewTap: function () {
|
bindViewTap: function() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "../logs/logs"
|
url: "../logs/logs"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLoad: function () {
|
onLoad: function() {
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
});
|
});
|
||||||
var a = this;
|
var a = this;
|
||||||
// 获取地理位置
|
t.pageStart(e).then(function(t) {
|
||||||
wx.getLocation({
|
a.getData(), a.setData({
|
||||||
type: 'gcj02',
|
servicetel: e.globalData.servicetel,
|
||||||
success: function (res) {
|
isScan: !!e.globalData.devicecode
|
||||||
// 存储经纬度
|
});
|
||||||
wx.setStorageSync('latitude', res.latitude);
|
|
||||||
wx.setStorageSync('longitude', res.longitude);
|
|
||||||
e.globalData.latitude = res.latitude;
|
|
||||||
e.globalData.longitude = res.longitude;
|
|
||||||
// 获取网点列表
|
|
||||||
t.request('/miniprogram/branch/lists', {
|
|
||||||
latitude: res.latitude || '',
|
|
||||||
longitude: res.longitude || ''
|
|
||||||
}, !0).then(function (res) {
|
|
||||||
a.setData({
|
|
||||||
wangdianList: res.data || []
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fail: function () {
|
|
||||||
// 即使获取位置失败也加载网点列表,只是不传入经纬度参数
|
|
||||||
t.request('/miniprogram/branch/lists', {}, !0).then(function (res) {
|
|
||||||
a.setData({
|
|
||||||
wangdianList: res.data || []
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
complete: function () {
|
|
||||||
t.pageStart(e).then(function (t) {
|
|
||||||
a.getData();
|
|
||||||
a.setData({
|
|
||||||
servicetel: e.globalData.servicetel,
|
|
||||||
isScan: !!e.globalData.devicecode
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
// 获取首页数据
|
getData: function() {
|
||||||
t.request('/miniprogram/index/home', { method: 'GET' }, !0).then(function (e) {
|
var a = this;
|
||||||
a.setData({
|
t.request(e.globalData.config.home, {}, !0).then(function(e) {
|
||||||
|
a.data.urlList[1].url = e.data.tabStatus.shop ? "mall/mall" : "", a.setData({
|
||||||
banner: e.data.banner,
|
banner: e.data.banner,
|
||||||
|
user: e.data.user,
|
||||||
tmplIds: e.data.tmplIds,
|
tmplIds: e.data.tmplIds,
|
||||||
joinUs: e.data.joinUs,
|
joinUs: e.data.joinUs,
|
||||||
notice: e.data.notice,
|
notice: e.data.notice,
|
||||||
noticeurl: e.data.noticeurl,
|
noticeurl: e.data.noticeurl,
|
||||||
tabStatus: e.data.tabStatus,
|
tabStatus: e.data.tabStatus,
|
||||||
urlList: e.data.urlList
|
urlList: e.data.urlList
|
||||||
}, function () {
|
}, function() {
|
||||||
wx.hideLoading(), 0 == e.data.banner.length ? a.setData({
|
wx.hideLoading(), 0 == e.data.banner.length ? a.setData({
|
||||||
showLoding: !1
|
showLoding: !1
|
||||||
}) : setTimeout(function () {
|
}) : setTimeout(function() {
|
||||||
a.setData({
|
a.setData({
|
||||||
showLoding: !1
|
showLoding: !1
|
||||||
});
|
});
|
||||||
@ -87,53 +85,19 @@ Page({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getData: function () {
|
load: function(e) {
|
||||||
var a = this;
|
|
||||||
// 获取首页数据
|
|
||||||
t.request('/miniprogram/index/balance', {}, !0).then(function (e) {
|
|
||||||
a.setData({
|
|
||||||
user: e.data || [],
|
|
||||||
});
|
|
||||||
// 存储进度订单
|
|
||||||
wx.setStorageSync('progressorder', e.data.progressorder || []);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
load: function (e) {
|
|
||||||
console.log(e);
|
console.log(e);
|
||||||
},
|
|
||||||
openLocation: function(e) {
|
|
||||||
var latitude = Number(e.currentTarget.dataset.latitude);
|
|
||||||
var longitude = Number(e.currentTarget.dataset.longitude);
|
|
||||||
var name = e.currentTarget.dataset.name;
|
|
||||||
var address = e.currentTarget.dataset.address;
|
|
||||||
|
|
||||||
wx.openLocation({
|
|
||||||
latitude: latitude,
|
|
||||||
longitude: longitude,
|
|
||||||
name: name,
|
|
||||||
address: address,
|
|
||||||
scale: 18
|
|
||||||
});
|
|
||||||
var t = e.currentTarget.dataset.index, a = this.data.swiperWidth * e.detail.height / e.detail.width;
|
var t = e.currentTarget.dataset.index, a = this.data.swiperWidth * e.detail.height / e.detail.width;
|
||||||
this.data.banner[t].height = a, this.setData({
|
this.data.banner[t].height = a, this.setData({
|
||||||
swiperHeight: a
|
swiperHeight: a
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function() {
|
||||||
this.setData({
|
this.setData({
|
||||||
isScan: !!e.globalData.devicecode || this.data.isScan
|
isScan: !!e.globalData.devicecode || this.data.isScan
|
||||||
}), (this.getData(), this.isneedUpload = !1);
|
}), e.globalData.config && e.globalData.config.home && (this.getData(), this.isneedUpload = !1);
|
||||||
},
|
},
|
||||||
toPage: function (t) {
|
toPage: function(t) {
|
||||||
console.info(t);
|
|
||||||
|
|
||||||
// 增加打电话
|
|
||||||
if (t.currentTarget.dataset.phone) {
|
|
||||||
wx.makePhoneCall({
|
|
||||||
phoneNumber: "" + t.currentTarget.dataset.phone
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var a = t.currentTarget.dataset, i = a.url, o = a.needlogin, n = a.showimg;
|
var a = t.currentTarget.dataset, i = a.url, o = a.needlogin, n = a.showimg;
|
||||||
if (console.log("showImg", n), i) {
|
if (console.log("showImg", n), i) {
|
||||||
this.isneedUpload = !0;
|
this.isneedUpload = !0;
|
||||||
@ -146,23 +110,23 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
if (!n) return !1;
|
if (!n) return !1;
|
||||||
wx.previewImage({
|
wx.previewImage({
|
||||||
urls: [this.data.joinUs]
|
urls: [ this.data.joinUs ]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toScan: function () {
|
toScan: function() {
|
||||||
e.globalData.needJumpUrl = !1;
|
e.globalData.needJumpUrl = !1;
|
||||||
var a = this;
|
var a = this;
|
||||||
wx.scanCode({
|
wx.scanCode({
|
||||||
success: function (i) {
|
success: function(i) {
|
||||||
console.log(i), wx.showLoading({
|
console.log(i), wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), e.globalData.qrcode = i.result, t.request("/miniprogram/identify", i, !0).then(function (t) {
|
}), e.globalData.qrcode = i.result, t.request("https://jmqf.v0750.com/miniprogram/identify", i, !0).then(function(t) {
|
||||||
console.log("data", t), wx.hideLoading(), e.globalData.devicecode = t.data.devicecode || e.globalData.devicecode,
|
console.log("data", t), wx.hideLoading(), e.globalData.devicecode = t.data.devicecode || e.globalData.devicecode,
|
||||||
a.setData({
|
a.setData({
|
||||||
isScan: !!t.data.devicecode
|
isScan: !!t.data.devicecode
|
||||||
});
|
});
|
||||||
}).catch(function (e) {
|
}).catch(function(e) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -171,10 +135,10 @@ Page({
|
|||||||
isSubmit: !1,
|
isSubmit: !1,
|
||||||
isneedUpload: !1,
|
isneedUpload: !1,
|
||||||
isshowModal: !1,
|
isshowModal: !1,
|
||||||
needUpload: function () {
|
needUpload: function() {
|
||||||
this.isneedUpload = !0;
|
this.isneedUpload = !0;
|
||||||
},
|
},
|
||||||
toStart: function () {
|
toStart: function() {
|
||||||
e.globalData.needJumpUrl = !1, this.isneedUpload = !0;
|
e.globalData.needJumpUrl = !1, this.isneedUpload = !0;
|
||||||
var t = this;
|
var t = this;
|
||||||
if (console.log("this.isSubmit", this.isSubmit), this.isSubmit) return !1;
|
if (console.log("this.isSubmit", this.isSubmit), this.isSubmit) return !1;
|
||||||
@ -186,55 +150,55 @@ Page({
|
|||||||
content: "账户余额小于10元,是否立即充值?",
|
content: "账户余额小于10元,是否立即充值?",
|
||||||
confirmText: "去充值",
|
confirmText: "去充值",
|
||||||
cancelText: "立即启动",
|
cancelText: "立即启动",
|
||||||
success: function (e) {
|
success: function(e) {
|
||||||
e.confirm ? (wx.navigateTo({
|
e.confirm ? (wx.navigateTo({
|
||||||
url: "/pages/voucher/voucher"
|
url: "/pages/voucher/voucher"
|
||||||
}), t.isneedUpload = !0) : t.startup();
|
}), t.isneedUpload = !0) : t.startup();
|
||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function(e) {
|
||||||
console.log("fail:", e);
|
console.log("fail:", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else t.startup();
|
} else t.startup();
|
||||||
},
|
},
|
||||||
startup: function () {
|
startup: function() {
|
||||||
var a = this;
|
var a = this;
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "你当前将要使用的机器编号是:".concat(e.globalData.devicecode, ",确认开机吗?"),
|
content: "你当前将要使用的机器编号是:".concat(e.globalData.devicecode, ",确认开机吗?"),
|
||||||
success: function (i) {
|
success: function(i) {
|
||||||
i.confirm && (a.isSubmit = !0, wx.showLoading({
|
i.confirm && (a.isSubmit = !0, wx.showLoading({
|
||||||
title: "正在启动"
|
title: "正在启动"
|
||||||
}), t.request(e.globalData.config.machine.startup, {
|
}), t.request(e.globalData.config.machine.startup, {
|
||||||
washcode: a.data.selectID
|
washcode: a.data.selectID
|
||||||
}, !0).then(function (e) {
|
}, !0).then(function(e) {
|
||||||
a.isSubmit = !1, wx.hideLoading(), 200 == e.code && (wx.showModal({
|
a.isSubmit = !1, wx.hideLoading(), 200 == e.code && (wx.showModal({
|
||||||
title: "",
|
title: "",
|
||||||
content: e.message
|
content: e.message
|
||||||
}), a.data.tmplIds.length > 0 && a.requestSubscribeMessage(), wx.redirectTo({
|
}), a.data.tmplIds.length > 0 && a.requestSubscribeMessage(), wx.redirectTo({
|
||||||
url: "/pages/washing/washing"
|
url: "/pages/user/user"
|
||||||
}), a.isneedUpload = !0), 888 == e.code && (wx.navigateTo({
|
}), a.isneedUpload = !0), 888 == e.code && (wx.navigateTo({
|
||||||
url: "/pages/voucher/voucher"
|
url: "/pages/voucher/voucher"
|
||||||
}), a.isneedUpload = !0);
|
}), a.isneedUpload = !0);
|
||||||
}).catch(function (e) {
|
}).catch(function(e) {
|
||||||
a.isSubmit = !1, wx.hideLoading();
|
a.isSubmit = !1, wx.hideLoading();
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function(e) {
|
||||||
console.log("fail:", e);
|
console.log("fail:", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
requestSubscribeMessage: function () {
|
requestSubscribeMessage: function() {
|
||||||
wx.requestSubscribeMessage({
|
wx.requestSubscribeMessage({
|
||||||
tmplIds: this.data.tmplIds,
|
tmplIds: this.data.tmplIds,
|
||||||
success: function (e) {
|
success: function(e) {
|
||||||
console.log("requestSubscribeMessage", e), t.request("/miniprogram/index/newtmpl", e, !0).then(function (e) { }).catch(function (e) { });
|
console.log("requestSubscribeMessage", e), t.request("https://jmqf.v0750.com/miniprogram/index/newtmpl", e, !0).then(function(e) {}).catch(function(e) {});
|
||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function(e) {
|
||||||
console.log("requestSubscribeMessagefail", e);
|
console.log("requestSubscribeMessagefail", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShareAppMessage: function () { }
|
onShareAppMessage: function() {}
|
||||||
});
|
});
|
@ -5,6 +5,5 @@
|
|||||||
"my-money": "../../template/myMoney/myMoney",
|
"my-money": "../../template/myMoney/myMoney",
|
||||||
"head-swiper": "../../template/headSwiper/headSwiper",
|
"head-swiper": "../../template/headSwiper/headSwiper",
|
||||||
"page-loding": "../../template/pageLoding/pageLoding"
|
"page-loding": "../../template/pageLoding/pageLoding"
|
||||||
},
|
}
|
||||||
"navigationStyle":"custom"
|
|
||||||
}
|
}
|
@ -1,27 +1,15 @@
|
|||||||
<import src="../common/common.wxml"></import>
|
<import src="../common/common.wxml"></import>
|
||||||
<import src="../wangdianList/wangdianList.wxml"></import>
|
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<page-loding wx:if="{{showLoding}}"></page-loding>
|
<page-loding wx:if="{{showLoding}}"></page-loding>
|
||||||
<head-swiper banner="{{banner}}"></head-swiper>
|
<head-swiper banner="{{banner}}"></head-swiper>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
<my-money user="{{user}}"></my-money>
|
<my-money user="{{user}}"></my-money>
|
||||||
<view class="marquee-wrap" wx:if="{{notice}}">
|
<view class="marquee-wrap" wx:if="{{notice}}">
|
||||||
<view bindtap="toPage" class="marquee-content" data-refresh="1" data-url="{{noticeurl}}">
|
<view bindtap="toPage" class="marquee-content" data-refresh="1" data-url="{{noticeurl}}"> {{notice}} </view>
|
||||||
{{notice}}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<navigator class="washing" hoverClass="hover" url="/pages/washing/washing" wx:if="{{user.progressorder}}">
|
|
||||||
<view class="l">您有一笔洗车订单进行中...</view>
|
|
||||||
<view class="r">点击查看></view>
|
|
||||||
</navigator>
|
|
||||||
</view>
|
</view>
|
||||||
<template is="pageList" data="{{urlList:urlList}}"></template>
|
<template is="pageList" data="{{urlList:urlList}}"></template>
|
||||||
<template is="wangdianList" data="{{wangdianList:wangdianList}}"></template>
|
|
||||||
<service-tel></service-tel>
|
<service-tel></service-tel>
|
||||||
<view bindtap="toScan" class="scan-btn" wx:if="{{!isScan}}">
|
<view bindtap="toScan" class="scan-btn" wx:if="{{!isScan}}">扫码启动</view>
|
||||||
<view class="sha">扫码启动</view>
|
<view bindtap="toStart" class="scan-btn" wx:if="{{isScan}}">立即启动</view>
|
||||||
</view>
|
</view>
|
||||||
<view bindtap="toStart" class="scan-btn" wx:if="{{isScan}}">
|
|
||||||
<view class="sha">立即启动</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.money {
|
.money {
|
||||||
padding: 0 0 0;
|
padding: 34rpx 27rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.start-btn-box {
|
.start-btn-box {
|
||||||
@ -34,141 +34,4 @@
|
|||||||
|
|
||||||
.start-btn-box .scan-subscribe {
|
.start-btn-box .scan-subscribe {
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-list {
|
|
||||||
padding: 0 28rpx 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title {
|
|
||||||
line-height: 70rpx;
|
|
||||||
padding: 10rpx 0;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title .title_c {
|
|
||||||
font-size: 36rpx;
|
|
||||||
color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title .title_c .line {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 12rpx;
|
|
||||||
left: 18rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
width: 15%;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
background-color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title .more {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box {
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 20rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, .4);
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .title_c {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 36rpx;
|
|
||||||
line-height: 48rpx;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .title .ld {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 24rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
padding: 0 6rpx;
|
|
||||||
margin-left: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .tag, .index-wangdian-box .info .ads {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 2;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .jiqi {
|
|
||||||
font-size: 24rpx;
|
|
||||||
line-height: 2;
|
|
||||||
color: #37CE05;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .yingye {
|
|
||||||
position: absolute;
|
|
||||||
right: -20rpx;
|
|
||||||
top: -20rpx;
|
|
||||||
color: #fff;
|
|
||||||
background-color: #0056A3;
|
|
||||||
font-size: 22rpx;
|
|
||||||
padding: 0 12rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
border-radius: 0 0 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .dw {
|
|
||||||
position: absolute;
|
|
||||||
right: 20rpx;
|
|
||||||
bottom: 25rpx;
|
|
||||||
height: 120rpx;
|
|
||||||
width: 120rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #0056A3;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .info .dw .ico {
|
|
||||||
font-size: 80rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .xian {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
/* color: #fff; */
|
|
||||||
font-size: 22rpx;
|
|
||||||
height: 6rpx;
|
|
||||||
background-color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-box .xian .bili {
|
|
||||||
position: absolute;
|
|
||||||
height: 6rpx;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
display: block;
|
|
||||||
background-color: #37CE05;
|
|
||||||
}
|
|
||||||
|
|
||||||
.washing {
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 30rpx 0 0;
|
|
||||||
padding: 20rpx 28rpx;
|
|
||||||
display: flex;
|
|
||||||
background-color: #0056A3;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.washing .l {
|
|
||||||
flex: 1;
|
|
||||||
}
|
}
|
@ -28,7 +28,7 @@ Page({
|
|||||||
var n = Object.assign(this.userInfo, t, {
|
var n = Object.assign(this.userInfo, t, {
|
||||||
code: a
|
code: a
|
||||||
});
|
});
|
||||||
o.request('/miniprogram/index/authorization', n, !0).then(function(o) {
|
o.request(e.globalData.config.authorization, n, !0).then(function(o) {
|
||||||
if (wx.hideLoading(), console.log("toAuthorization", "app.globalData.needJumpUrl", e.globalData.needJumpUrl, o),
|
if (wx.hideLoading(), console.log("toAuthorization", "app.globalData.needJumpUrl", e.globalData.needJumpUrl, o),
|
||||||
200 != o.code) return wx.showModal({
|
200 != o.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
|
"match-list": "./matchList/matchList",
|
||||||
"recomond-list": "../goodsDetails/recomondList/recomondList",
|
"recomond-list": "../goodsDetails/recomondList/recomondList",
|
||||||
"page-loding": "../../template/pageLoding/pageLoding"
|
"page-loding": "../../template/pageLoding/pageLoding"
|
||||||
}
|
}
|
||||||
|
@ -1,110 +0,0 @@
|
|||||||
var t = require("../../utils/login.js");
|
|
||||||
|
|
||||||
Page({
|
|
||||||
data: {
|
|
||||||
userInfo: {
|
|
||||||
mobile: '',
|
|
||||||
uid: '',
|
|
||||||
givenamount: "0.00",
|
|
||||||
money: "0.00",
|
|
||||||
principal: "0.00",
|
|
||||||
}, // 用户查询结果
|
|
||||||
list: [], // 退款记录列表
|
|
||||||
showResult: false // 控制查询结果显示
|
|
||||||
},
|
|
||||||
|
|
||||||
onSubmitToGroup(e) {
|
|
||||||
const mobile = e.detail.value.code
|
|
||||||
if (!mobile) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请输入手机号码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 手机号格式验证
|
|
||||||
if (!/^1[3-9]\d{9}$/.test(mobile)) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请输入正确的手机号码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
wx.showLoading({
|
|
||||||
title: '查询中...'
|
|
||||||
})
|
|
||||||
|
|
||||||
t.request('/miniprogram/Refund/query', { mobile }, !0).then((res) => {
|
|
||||||
wx.hideLoading()
|
|
||||||
if (res.code == 200) {
|
|
||||||
this.setData({
|
|
||||||
userInfo: res.data.user,
|
|
||||||
list: res.data.list,
|
|
||||||
showResult: true
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message || '查询失败',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 线上退款
|
|
||||||
onSubmitToGroup1() {
|
|
||||||
wx.showModal({
|
|
||||||
title: '确认退款',
|
|
||||||
content: '确定退款,将清零用户赠送金额,退还本金',
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
wx.showLoading({
|
|
||||||
title: '退款中...'
|
|
||||||
})
|
|
||||||
if (!this.data.userInfo.recharge || !this.data.userInfo.token) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '退款信息不完整',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.request('/miniprogram/pay/refund', {token: this.data.userInfo.token}, !0).then((res) => {
|
|
||||||
wx.hideLoading()
|
|
||||||
if (res.code == 200) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '退款成功',
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
// 刷新页面数据
|
|
||||||
this.setData({
|
|
||||||
showResult: false,
|
|
||||||
userInfo: {
|
|
||||||
mobile: '',
|
|
||||||
uid: '',
|
|
||||||
givenamount: "0.00",
|
|
||||||
money: "0.00",
|
|
||||||
principal: "0.00"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message || '退款失败',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 线下退款
|
|
||||||
onSubmitToGroup2() {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请联系客服, 线下退款',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
<view class="contain">
|
|
||||||
<view class="content">
|
|
||||||
<view class="title">退款</view>
|
|
||||||
<form bindsubmit="onSubmitToGroup"> <!-- 查询前 -->
|
|
||||||
<input class="input" name="code" auto-focus placeholder="请填写用户手机号码"/>
|
|
||||||
<button class="button" form-type="submit" type="primary">查询用户订单</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- 显示用户信息 .userInfo -->
|
|
||||||
<view class="userInfo" wx:if="{{showResult && userInfo}}">
|
|
||||||
<view class="info">
|
|
||||||
<view>手机号:<text>{{userInfo.mobile}}</text></view>
|
|
||||||
<view>用户ID:<text>{{userInfo.uid}}</text></view>
|
|
||||||
<view class="balance-info">
|
|
||||||
<view class="balance-item">
|
|
||||||
<view class="label">总余额</view>
|
|
||||||
<view class="value r">{{userInfo.money}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="balance-item">
|
|
||||||
<view class="label">洗车金</view>
|
|
||||||
<view class="value g">{{userInfo.principal}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="balance-item">
|
|
||||||
<view class="label">赠送金额</view>
|
|
||||||
<view class="value b">{{userInfo.givenamount}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<block wx:if="{{showResult && userInfo}}">
|
|
||||||
<form bindsubmit="onSubmitToGroup1" wx:if="{{userInfo.refundType === 'online'}}"> <!-- 查询后 线上退款 -->
|
|
||||||
<view class="info">
|
|
||||||
<view>本金:<text class="r">{{userInfo.recharge.money || ''}}</text></view>
|
|
||||||
<view>赠送:{{userInfo.recharge.bonusamount || ''}}</view>
|
|
||||||
<view class="mt">订单号:{{userInfo.recharge.orderid || ''}}</view>
|
|
||||||
<view>充值时间:<text class="r">{{userInfo.recharge.date || ''}}</text></view>
|
|
||||||
<view>网点:<text class="r">{{userInfo.recharge.agent || ''}}</text></view>
|
|
||||||
</view>
|
|
||||||
<button class="button" form-type="submit" type="primary">线上退款</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<form bindsubmit="onSubmitToGroup2" wx:if="{{userInfo.refundType === 'offline'}}"> <!-- 查询后 线下退款 -->
|
|
||||||
<view class="info">
|
|
||||||
<view>本金:<text class="r">{{userInfo.recharge.money || ''}}</text></view>
|
|
||||||
<view>赠送:{{userInfo.recharge.bonusamount || ''}}</view>
|
|
||||||
<view class="mt">订单号:{{userInfo.recharge.orderid || ''}}</view>
|
|
||||||
<view>充值时间:<text class="r">{{userInfo.recharge.date || ''}}</text></view>
|
|
||||||
<view>网点:<text class="r">{{userInfo.recharge.agent || ''}}</text></view>
|
|
||||||
</view>
|
|
||||||
<button class="button" form-type="submit" type="warn">线下退款</button>
|
|
||||||
</form>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
@ -1,82 +0,0 @@
|
|||||||
.contain {
|
|
||||||
box-sizing: border-box;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 60rpx 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 36rpx;
|
|
||||||
line-height: 1;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
margin: 40rpx 0;
|
|
||||||
padding: 22rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 2rpx solid #eee;
|
|
||||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.userInfo {
|
|
||||||
padding-top: 22rpx;
|
|
||||||
border-top: 2rpx solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
padding: 22rpx 32rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 2rpx solid #eee;
|
|
||||||
box-shadow: 0 6rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
line-height: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .mt {
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .r {
|
|
||||||
color: #C13700;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .g {
|
|
||||||
color: #60BB46;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.balance-info {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
border-top: 2rpx solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.balance-item {
|
|
||||||
flex: 1;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.balance-item .label {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #666;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.balance-item .value {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.balance-item .b {
|
|
||||||
color: #0056A3;
|
|
||||||
}
|
|
@ -14,22 +14,22 @@ Page({
|
|||||||
showTips: !1,
|
showTips: !1,
|
||||||
approve: !0
|
approve: !0
|
||||||
},
|
},
|
||||||
onLoad: function (a) {
|
onLoad: function(a) {
|
||||||
var e = this;
|
var e = this;
|
||||||
this.setData({
|
this.setData({
|
||||||
type: a.type || "login"
|
type: a.type || "login"
|
||||||
}), o.pageStart(t).then(function (o) {
|
}), o.pageStart(t).then(function(o) {
|
||||||
console.log(t.globalData), e.setData({
|
console.log(t.globalData), e.setData({
|
||||||
protocol: t.globalData.protocol
|
protocol: t.globalData.protocol
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
input: function (t) {
|
input: function(t) {
|
||||||
this.data.info[t.currentTarget.dataset.name] = t.detail.value, this.setData({
|
this.data.info[t.currentTarget.dataset.name] = t.detail.value, this.setData({
|
||||||
info: this.data.info
|
info: this.data.info
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
bindsubmit: function (t) {
|
bindsubmit: function(t) {
|
||||||
if (console.log(t.detail.formId), this.data.issubmit) return !1;
|
if (console.log(t.detail.formId), this.data.issubmit) return !1;
|
||||||
this.setData({
|
this.setData({
|
||||||
issubmit: !0
|
issubmit: !0
|
||||||
@ -38,26 +38,26 @@ Page({
|
|||||||
});
|
});
|
||||||
var o = this;
|
var o = this;
|
||||||
"reset" == this.data.type ? this.submitForm() : wx.login({
|
"reset" == this.data.type ? this.submitForm() : wx.login({
|
||||||
success: function (t) {
|
success: function(t) {
|
||||||
console.log(t.code), wx.getUserInfo({
|
console.log(t.code), wx.getUserInfo({
|
||||||
success: function (a) {
|
success: function(a) {
|
||||||
o.submitForm(t.code, a);
|
o.submitForm(t.code, a);
|
||||||
},
|
},
|
||||||
fail: function () {
|
fail: function() {
|
||||||
o.submitForm(t.code);
|
o.submitForm(t.code);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: function (t) { }
|
fail: function(t) {}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
submitForm: function (a, e) {
|
submitForm: function(a, e) {
|
||||||
var i = this, n = {};
|
var i = this, n = {};
|
||||||
Object.assign(n, e, {
|
Object.assign(n, e, {
|
||||||
token: this.data.token,
|
token: this.data.token,
|
||||||
smscode: this.data.info.smscode,
|
smscode: this.data.info.smscode,
|
||||||
code: a
|
code: a
|
||||||
}), console.log(n), o.request(t.globalData.config.verify[i.data.type], n, !0).then(function (o) {
|
}), console.log(n), o.request(t.globalData.config.verify[i.data.type], n, !0).then(function(o) {
|
||||||
return wx.hideLoading(), i.setData({
|
return wx.hideLoading(), i.setData({
|
||||||
issubmit: !1
|
issubmit: !1
|
||||||
}), 200 == o.code && (i.setData({
|
}), 200 == o.code && (i.setData({
|
||||||
@ -70,40 +70,40 @@ Page({
|
|||||||
}), t.globalData.needJumpUrl = !1, !1) : void wx.navigateBack({
|
}), t.globalData.needJumpUrl = !1, !1) : void wx.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
}));
|
}));
|
||||||
}).catch(function (t) {
|
}).catch(function(t) {
|
||||||
i.setData({
|
i.setData({
|
||||||
issubmit: !1
|
issubmit: !1
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sendMsg: function () {
|
sendMsg: function() {
|
||||||
if ("" == this.data.info.mobile.trim()) return wx.showModal({
|
if ("" == this.data.info.mobile.trim()) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "请输入手机号码~"
|
content: "请输入手机号码~"
|
||||||
}), !1;
|
}), !1;
|
||||||
var a = this;
|
var a = this;
|
||||||
o.request('/miniprogram/verify/sms', {
|
o.request(t.globalData.config.verify.sms, {
|
||||||
mobile: a.data.info.mobile,
|
mobile: a.data.info.mobile,
|
||||||
type: a.data.type
|
type: a.data.type
|
||||||
}, !0).then(function (t) {
|
}, !0).then(function(t) {
|
||||||
console.log("daa", t), wx.showToast({
|
console.log("daa", t), wx.showToast({
|
||||||
title: "验证码已发送~",
|
title: "验证码已发送~",
|
||||||
icon: "none"
|
icon: "none"
|
||||||
}), a.setData({
|
}), a.setData({
|
||||||
token: t.data.token,
|
token: t.data.token,
|
||||||
countdowntime: t.data.countdowntime
|
countdowntime: t.data.countdowntime
|
||||||
}, function () {
|
}, function() {
|
||||||
a.timer = setInterval(function () {
|
a.timer = setInterval(function() {
|
||||||
if (0 == a.data.countdowntime) return clearInterval(a.timer), !1;
|
if (0 == a.data.countdowntime) return clearInterval(a.timer), !1;
|
||||||
a.data.countdowntime--, a.setData({
|
a.data.countdowntime--, a.setData({
|
||||||
countdowntime: a.data.countdowntime
|
countdowntime: a.data.countdowntime
|
||||||
});
|
});
|
||||||
}, 1e3);
|
}, 1e3);
|
||||||
});
|
});
|
||||||
}).catch(function (t) { });
|
}).catch(function(t) {});
|
||||||
},
|
},
|
||||||
timer: null,
|
timer: null,
|
||||||
showprovision: function () {
|
showprovision: function() {
|
||||||
this.setData({
|
this.setData({
|
||||||
showTips: !this.data.showTips
|
showTips: !this.data.showTips
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@ Page({
|
|||||||
var n = this;
|
var n = this;
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), e.request('/miniprogram/user', {}, !0).then(function(t) {
|
}), e.request(t.globalData.config.user.log, {}, !0).then(function(t) {
|
||||||
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
|
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: t.message
|
content: t.message
|
||||||
@ -56,70 +56,5 @@ Page({
|
|||||||
wx.makePhoneCall({
|
wx.makePhoneCall({
|
||||||
phoneNumber: "" + t.globalData.servicetel
|
phoneNumber: "" + t.globalData.servicetel
|
||||||
});
|
});
|
||||||
},
|
|
||||||
updateUserAvatar: function() {
|
|
||||||
var that = this;
|
|
||||||
wx.chooseMedia({
|
|
||||||
count: 1,
|
|
||||||
mediaType: ['image'],
|
|
||||||
sourceType: ['album', 'camera'],
|
|
||||||
success: function(res) {
|
|
||||||
wx.uploadFile({
|
|
||||||
url: 'https://t-jm.v0750.com/miniprogram/upload',
|
|
||||||
filePath: res.tempFiles[0].tempFilePath,
|
|
||||||
name: 'file',
|
|
||||||
success: function(uploadRes) {
|
|
||||||
var data = JSON.parse(uploadRes.data);
|
|
||||||
if (data.code == 200) {
|
|
||||||
e.request('/miniprogram/user/update', {
|
|
||||||
avatar: data.data.url
|
|
||||||
}, true).then(function(res) {
|
|
||||||
if (res.code == 200) {
|
|
||||||
that.getContent();
|
|
||||||
wx.showToast({
|
|
||||||
title: '头像更新成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
updateUserNickname: function() {
|
|
||||||
var that = this;
|
|
||||||
wx.showModal({
|
|
||||||
title: '修改昵称',
|
|
||||||
editable: true,
|
|
||||||
placeholderText: '请输入新昵称',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm && res.content) {
|
|
||||||
// 发送请求到后端,更新用户昵称
|
|
||||||
e.request('/miniprogram/user/update', {
|
|
||||||
nickname: res.content
|
|
||||||
}, true).then(function(res) {
|
|
||||||
if (res.code == 200) {
|
|
||||||
that.getContent();
|
|
||||||
wx.showToast({
|
|
||||||
title: '昵称更新成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -2,12 +2,12 @@
|
|||||||
<page-loding wx:if="{{showLoding}}"></page-loding>
|
<page-loding wx:if="{{showLoding}}"></page-loding>
|
||||||
<view class="page-top">
|
<view class="page-top">
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<view class="avatar" bindtap="updateUserAvatar">
|
<view class="avatar">
|
||||||
<image src="{{user.avatar}}"></image>
|
<image src="{{user.avatar}}"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="username" bindtap="updateUserNickname">{{user.nickname}}</view>
|
<view class="username">{{user.nickname}}</view>
|
||||||
<view class="tel">{{user.mobile}}</view>
|
<view class="tel">{{user.mobile}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
|
@ -44,7 +44,7 @@ Page({
|
|||||||
loading: !0
|
loading: !0
|
||||||
}), wx.showLoading({
|
}), wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), e.request('/miniprogram/recharge', {
|
}), e.request(t.globalData.config.recharge.init, {
|
||||||
page: this.data.page.next_page
|
page: this.data.page.next_page
|
||||||
}, !0).then(function (t) {
|
}, !0).then(function (t) {
|
||||||
if (wx.hideLoading(), a.setData({
|
if (wx.hideLoading(), a.setData({
|
||||||
@ -68,7 +68,7 @@ Page({
|
|||||||
var i = a.currentTarget.dataset.id;
|
var i = a.currentTarget.dataset.id;
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), e.request('/miniprogram/recharge/create', {
|
}), e.request(t.globalData.config.recharge.create, {
|
||||||
id: i
|
id: i
|
||||||
}, !0).then(function (t) {
|
}, !0).then(function (t) {
|
||||||
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
|
if (wx.hideLoading(), 200 != t.code) return wx.showModal({
|
||||||
@ -125,7 +125,7 @@ Page({
|
|||||||
title: ""
|
title: ""
|
||||||
});
|
});
|
||||||
var i = this;
|
var i = this;
|
||||||
e.request('/miniprogram/recharge/create', {
|
e.request(t.globalData.config.recharge.create, {
|
||||||
id: i.data.selectItemID
|
id: i.data.selectItemID
|
||||||
}, !0).then(function (t) {
|
}, !0).then(function (t) {
|
||||||
if (wx.hideLoading(), i.isSubmit = !1, 200 != t.code) return wx.showModal({
|
if (wx.hideLoading(), i.isSubmit = !1, 200 != t.code) return wx.showModal({
|
||||||
|
@ -1,162 +0,0 @@
|
|||||||
// pages/wangdian/wangdian.js
|
|
||||||
var t = require("../../utils/login.js");
|
|
||||||
|
|
||||||
Page({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
banner: [],
|
|
||||||
info: {},
|
|
||||||
jiqilist: [],
|
|
||||||
number: '',
|
|
||||||
machineCount: 0,
|
|
||||||
freeMachineCount: 0,
|
|
||||||
timer: null,
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoad(options) {
|
|
||||||
|
|
||||||
// 如果没有wx.getStorageSync('latitude') 或者 wx.getStorageSync('longitude') 则获取当前位置
|
|
||||||
if (!wx.getStorageSync('latitude') || !wx.getStorageSync('longitude')) {
|
|
||||||
wx.getLocation({
|
|
||||||
type: 'wgs84',
|
|
||||||
success: (res) => {
|
|
||||||
wx.setStorageSync('latitude', res.latitude);
|
|
||||||
wx.setStorageSync('longitude', res.longitude);
|
|
||||||
this.getBranchDetail();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setData({
|
|
||||||
number: options.number || ''
|
|
||||||
});
|
|
||||||
this.getBranchDetail();
|
|
||||||
this.getMachineList();
|
|
||||||
// 设置定时器,每10秒刷新一次机器状态
|
|
||||||
this.data.timer = setInterval(() => {
|
|
||||||
this.getMachineList();
|
|
||||||
}, 10000);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
// 页面卸载时清除定时器
|
|
||||||
if (this.data.timer) {
|
|
||||||
clearInterval(this.data.timer);
|
|
||||||
this.data.timer = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
// 页面卸载时清除定时器
|
|
||||||
if (this.data.timer) {
|
|
||||||
clearInterval(this.data.timer);
|
|
||||||
this.data.timer = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
},
|
|
||||||
// 获取网点详情信息
|
|
||||||
getBranchDetail() {
|
|
||||||
t.request('/miniprogram/branch/detail', {
|
|
||||||
number: this.data.number,
|
|
||||||
latitude: wx.getStorageSync('latitude'),
|
|
||||||
longitude: wx.getStorageSync('longitude'),
|
|
||||||
method: 'GET',
|
|
||||||
}, !0).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
this.setData({
|
|
||||||
banner: res.data.banner || [],
|
|
||||||
info: res.data.info || {},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取机器列表
|
|
||||||
getMachineList() {
|
|
||||||
|
|
||||||
t.request('/miniprogram/branch/machine', {
|
|
||||||
number: this.data.number,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
this.setData({
|
|
||||||
jiqilist: res.data || [],
|
|
||||||
});
|
|
||||||
// 计算机器数量, 与空闲机器数量 free machine
|
|
||||||
let machineCount = this.data.jiqilist.length;
|
|
||||||
let freeMachineCount = 0;
|
|
||||||
for (let i = 0; i < this.data.jiqilist.length; i++) {
|
|
||||||
if (this.data.jiqilist[i].devicestatus == 0) {
|
|
||||||
freeMachineCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 更新数据
|
|
||||||
this.setData({
|
|
||||||
machineCount,
|
|
||||||
freeMachineCount
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 打开地图导航
|
|
||||||
openLocation() {
|
|
||||||
if (this.data.info.latitude && this.data.info.longitude) {
|
|
||||||
wx.openLocation({
|
|
||||||
latitude: Number(this.data.info.latitude),
|
|
||||||
longitude: Number(this.data.info.longitude),
|
|
||||||
name: this.data.info.name,
|
|
||||||
address: this.data.info.address,
|
|
||||||
scale: 18
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
|
||||||
title: '暂无位置信息',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {
|
|
||||||
"service-tel": "../../template/serviceTel/serviceTel",
|
|
||||||
"my-money": "../../template/myMoney/myMoney",
|
|
||||||
"head-swiper": "../../template/headSwiper/headSwiper",
|
|
||||||
"page-loding": "../../template/pageLoding/pageLoding"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
<view class="container">
|
|
||||||
<page-loding wx:if="{{showLoding}}"></page-loding>
|
|
||||||
<head-swiper banner="{{banner}}"></head-swiper>
|
|
||||||
<view class="content info">
|
|
||||||
<view class="info">
|
|
||||||
<view class="title">
|
|
||||||
<view class="title_c">{{info.name}}</view>
|
|
||||||
<view class="ld" wx:for="{{info.service}}" wx:key="index_i" wx:for-item="s" style="background-color: {{s.color}};">{{s.label}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="tag">{{info.tags}}</view>
|
|
||||||
<view class="ads" bindtap="openLocation"><text class="iconfont icon-dingwei"></text>{{info.address}}</view>
|
|
||||||
<view class="ads yingye"><text class="iconfont icon-shijian"></text>{{info.businesshours || "24小时"}}</view>
|
|
||||||
<view class="dw" bindtap="openLocation">
|
|
||||||
<text class="ico iconfont icon-daohangdaohang"></text>
|
|
||||||
<view class="jl">{{info.distance}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="content">
|
|
||||||
<view class="index-wangdian-title">
|
|
||||||
<view class="more">空闲 {{freeMachineCount}}/{{machineCount}}台</view>
|
|
||||||
<view class="title_c">洗车机<view class="line"></view></view>
|
|
||||||
</view>
|
|
||||||
<view class="list">
|
|
||||||
<view class="jiqi" wx:for="{{jiqilist}}" wx:key="index" wx:for-item="i">
|
|
||||||
<view wx:if="{{i.devicestatus ==-1}}" class="j"> <!-- 禁用 -->
|
|
||||||
<view class="mac_state"><text>禁</text></view>
|
|
||||||
<text class="mac_id">{{i.number}}</text>
|
|
||||||
<view class="pa" wx:if="{{i.ispa}}">PA壶</view>
|
|
||||||
</view>
|
|
||||||
<view wx:elif="{{i.devicestatus == 1}}" class="w"> <!-- 使用中 -->
|
|
||||||
<view class="mac_state"><text>洗</text></view>
|
|
||||||
<text class="mac_id">{{i.number}}</text>
|
|
||||||
<view class="pa" wx:if="{{i.ispa}}">PA壶</view>
|
|
||||||
</view>
|
|
||||||
<view wx:elif="{{i.devicestatus == 0}}" class="x"> <!-- 空间 -->
|
|
||||||
<view class="mac_state"><text>闲</text></view>
|
|
||||||
<text class="mac_id">{{i.number}}</text>
|
|
||||||
<view class="pa" wx:if="{{i.ispa}}">PA壶</view>
|
|
||||||
</view>
|
|
||||||
<view wx:else class="d"> <!-- 离线 -->
|
|
||||||
<view class="mac_state"><text>离</text></view>
|
|
||||||
<text class="mac_id">{{i.number}}</text>
|
|
||||||
<view class="pa" wx:if="{{i.ispa}}">PA壶</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<service-tel></service-tel>
|
|
||||||
</view>
|
|
@ -1,173 +0,0 @@
|
|||||||
.content {
|
|
||||||
padding: 0 30rpx 30rpx;
|
|
||||||
margin-bottom: 40rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, .2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title {
|
|
||||||
line-height: 70rpx;
|
|
||||||
padding: 10rpx 0;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title .title_c {
|
|
||||||
font-size: 36rpx;
|
|
||||||
color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title .title_c .line {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 12rpx;
|
|
||||||
left: 14rpx;
|
|
||||||
height: 10rpx;
|
|
||||||
width: 10%;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
background-color: #0056A3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-wangdian-title .more {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #37CE05;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
position: relative;
|
|
||||||
padding-top: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .title_c {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 36rpx;
|
|
||||||
line-height: 48rpx;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .title .ld {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 24rpx;
|
|
||||||
line-height: 36rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
padding: 0 6rpx;
|
|
||||||
margin-left: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .tag, .info .ads {
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 2;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .jiqi {
|
|
||||||
font-size: 24rpx;
|
|
||||||
line-height: 2;
|
|
||||||
color: #37CE05;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .yingye {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .dw {
|
|
||||||
position: absolute;
|
|
||||||
right: 20rpx;
|
|
||||||
top: 35rpx;
|
|
||||||
height: 120rpx;
|
|
||||||
width: 120rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #0056A3;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info .dw .ico {
|
|
||||||
font-size: 80rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.list {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 20rpx 0 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list .jiqi {
|
|
||||||
flex-direction: column;
|
|
||||||
width: 22%;
|
|
||||||
margin: 20rpx 0 20rpx 0;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list .jiqi:nth-child(4n+4) {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mac_state {
|
|
||||||
width: 100rpx;
|
|
||||||
height: 100rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
font-size: 40rpx;
|
|
||||||
border: 10rpx solid #aaa;
|
|
||||||
box-sizing: border-box;
|
|
||||||
line-height: 80rpx;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.mac_state text {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mac_id {
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.jiqi .pa {
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -34rpx;
|
|
||||||
top: -15rpx;
|
|
||||||
padding: 2rpx 10rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.list .jiqi .x, .x .mac_state text {
|
|
||||||
color: #30b504;
|
|
||||||
}
|
|
||||||
|
|
||||||
.x .mac_state {
|
|
||||||
border-color: #30b504;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list .jiqi .j, .j .mac_state text {
|
|
||||||
color: #C13700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.j .mac_state {
|
|
||||||
border-color: #C13700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list .jiqi .w, .w .mac_state text {
|
|
||||||
color: #08AFDE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.w .mac_state {
|
|
||||||
border-color: #08AFDE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list .jiqi .d, .d .mac_state text {
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.list .jiqi .pa {
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #fff;
|
|
||||||
background-color: #f60;
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
<template name="wangdianList">
|
|
||||||
<view class="index-wangdian-list">
|
|
||||||
<view class="index-wangdian-title">
|
|
||||||
<view bindtap="toPage" class="more" data-refresh="1" data-url="map/map">全部网点></view>
|
|
||||||
<view class="title_c">离我最近<view class="line"></view></view>
|
|
||||||
</view>
|
|
||||||
<view class="index-wangdian-box" wx:for="{{wangdianList}}" wx:key="index" wx:for-item="item">
|
|
||||||
<view class="info" bindtap="toPage" data-refresh="1" data-url="wangdian/wangdian?number={{item.number}}">
|
|
||||||
<view class="title">
|
|
||||||
<view class="title_c">{{item.name}}</view>
|
|
||||||
<view class="ld" wx:for="{{item.service}}" wx:key="index_i" wx:for-item="s" style="background-color: {{s.color}};">{{s.label}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="tag">{{item.tags}}</view>
|
|
||||||
<view class="ads"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
|
|
||||||
<view class="jiqi">洗车机:闲{{item.free}}/{{item.machine}}台</view>
|
|
||||||
<view class="yingye">{{item.businesshours || '24小时'}}</view>
|
|
||||||
<view class="dw" catchtap="openLocation" data-latitude="{{item.latitude}}" data-longitude="{{item.longitude}}" data-name="{{item.name}}" data-address="{{item.address}}">
|
|
||||||
<text class="ico iconfont icon-daohangdaohang"></text>
|
|
||||||
<view class="jl">{{item.distance}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="xian">
|
|
||||||
<view class="bili" style="width:{{item.ratio}}"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
@ -6,59 +6,59 @@ Page({
|
|||||||
info: {},
|
info: {},
|
||||||
id: ""
|
id: ""
|
||||||
},
|
},
|
||||||
onLoad: function (t) {
|
onLoad: function(t) {
|
||||||
var o = this;
|
var o = this;
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), this.setData({
|
}), this.setData({
|
||||||
id: t.id || 0
|
id: t.id || 1
|
||||||
}), i.pageStart(e).then(function (e) {
|
}), i.pageStart(e).then(function(e) {
|
||||||
o.getList();
|
o.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getList: function () {
|
getList: function() {
|
||||||
var o = this;
|
var o = this;
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), i.request('/miniprogram/coupons/details', {
|
}), i.request(e.globalData.config.carwashcoupon.details, {
|
||||||
id: this.data.id
|
id: this.data.id
|
||||||
}, !0).then(function (e) {
|
}, !0).then(function(e) {
|
||||||
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: e.message
|
content: e.message
|
||||||
}), !1;
|
}), !1;
|
||||||
e.data.starttime = t.changeTimeyear(new Date(1e3 * e.data.starttime)), e.data.deadline = t.changeTimeyear(new Date(1e3 * e.data.deadline)),
|
e.data.starttime = t.changeTimeyear(new Date(1e3 * e.data.starttime)), e.data.deadline = t.changeTimeyear(new Date(1e3 * e.data.deadline)),
|
||||||
o.setData({
|
o.setData({
|
||||||
info: e.data,
|
info: e.data,
|
||||||
showLoding: !1
|
showLoding: !1
|
||||||
}, function () { });
|
}, function() {});
|
||||||
}).catch(function (e) {
|
}).catch(function(e) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isSubmit: !1,
|
isSubmit: !1,
|
||||||
received: function () {
|
received: function() {
|
||||||
if (this.isSubmit) return !1;
|
if (this.isSubmit) return !1;
|
||||||
var t = this;
|
var t = this;
|
||||||
this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request('/miniprogram/coupons/receive', {
|
this.isSubmit = !0, wx.showLoading(), console.log("received"), i.request(e.globalData.config.carwashcoupon.receive, {
|
||||||
id: t.data.id,
|
id: t.data.id,
|
||||||
token: t.data.info.token
|
token: t.data.info.token
|
||||||
}, !0).then(function (e) {
|
}, !0).then(function(e) {
|
||||||
console.log("receiveddqta", e), wx.hideLoading(), t.isSubmit = !1, console.log("recief"),
|
console.log("receiveddqta", e), wx.hideLoading(), t.isSubmit = !1, console.log("recief"),
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: e.message,
|
content: e.message,
|
||||||
success: function (e) {
|
success: function(e) {
|
||||||
e.confirm && wx.redirectTo({
|
e.confirm && wx.redirectTo({
|
||||||
url: "/pages/index/index"
|
url: "/pages/index/index"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(function (e) {
|
}).catch(function(e) {
|
||||||
wx.hideLoading(), t.isSubmit = !1, console.log("提示提示提示提示", e), 201 == e.code && wx.showModal({
|
wx.hideLoading(), t.isSubmit = !1, console.log("提示提示提示提示", e), 201 == e.code && wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: e.message,
|
content: e.message,
|
||||||
success: function (e) {
|
success: function(e) {
|
||||||
if (!e.confirm) return console.log("弹窗取消"), !1;
|
if (!e.confirm) return console.log("弹窗取消"), !1;
|
||||||
wx.redirectTo({
|
wx.redirectTo({
|
||||||
url: "/pages/index/index"
|
url: "/pages/index/index"
|
||||||
|
@ -10,21 +10,21 @@ Page({
|
|||||||
selectID: null,
|
selectID: null,
|
||||||
isScan: !1
|
isScan: !1
|
||||||
},
|
},
|
||||||
onLoad: function (a) {
|
onLoad: function(a) {
|
||||||
var i = this;
|
var i = this;
|
||||||
e.pageStart(t).then(function (e) {
|
e.pageStart(t).then(function(e) {
|
||||||
i.getList(), console.log("app.globalData.devicecode", t.globalData.user.money, t.globalData.devicecode),
|
i.getList(), console.log("app.globalData.devicecode", t.globalData.user.money, t.globalData.devicecode),
|
||||||
i.setData({
|
i.setData({
|
||||||
isScan: !!t.globalData.devicecode
|
isScan: !!t.globalData.devicecode
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function() {
|
||||||
this.isneedUpload && (this.getList(), this.isneedUpload = !1);
|
this.isneedUpload && (this.getList(), this.isneedUpload = !1);
|
||||||
},
|
},
|
||||||
onPullDownRefresh: function () { },
|
onPullDownRefresh: function() {},
|
||||||
onShareAppMessage: function () { },
|
onShareAppMessage: function() {},
|
||||||
toPage: function (t) {
|
toPage: function(t) {
|
||||||
var e = t.currentTarget.dataset.url;
|
var e = t.currentTarget.dataset.url;
|
||||||
e ? wx.navigateTo({
|
e ? wx.navigateTo({
|
||||||
url: "/pages/".concat(e)
|
url: "/pages/".concat(e)
|
||||||
@ -34,16 +34,7 @@ Page({
|
|||||||
duration: 2e3
|
duration: 2e3
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
selectItem: function (t) {
|
selectItem: function(t) {
|
||||||
|
|
||||||
|
|
||||||
// 1. 提示用户先绑定设备, isScan
|
|
||||||
if (!this.data.isScan) return wx.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先扫码设备~"
|
|
||||||
}), !1;
|
|
||||||
|
|
||||||
|
|
||||||
var e = t.currentTarget.dataset, a = (e.index, e.code);
|
var e = t.currentTarget.dataset, a = (e.index, e.code);
|
||||||
if (1 != e.available) return wx.showToast({
|
if (1 != e.available) return wx.showToast({
|
||||||
title: "该洗车券不可用~",
|
title: "该洗车券不可用~",
|
||||||
@ -54,39 +45,39 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
isloading: !1,
|
isloading: !1,
|
||||||
getList: function (i) {
|
getList: function(i) {
|
||||||
var o = this;
|
var o = this;
|
||||||
if (this.isloading) return !1;
|
if (this.isloading) return !1;
|
||||||
wx.showLoading(), this.setData({
|
wx.showLoading(), this.setData({
|
||||||
loading: !0
|
loading: !0
|
||||||
}), this.isloading = !0, e.request('/miniprogram/coupons/lists', { devicecode: t.globalData.devicecode }, !0).then(function (t) {
|
}), this.isloading = !0, e.request(t.globalData.config.carwashcoupon.lists, {}, !0).then(function(t) {
|
||||||
if (o.isloading = !1, o.setData({
|
if (o.isloading = !1, o.setData({
|
||||||
loading: !1
|
loading: !1
|
||||||
}), wx.hideLoading(), 200 != t.code) return wx.showModal({
|
}), wx.hideLoading(), 200 != t.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: t.message
|
content: t.message
|
||||||
}), !1;
|
}), !1;
|
||||||
t.data.data.map(function (t) {
|
t.data.list.map(function(t) {
|
||||||
t.starttime = a.changeTimeyear(new Date(1e3 * t.starttime)), t.deadline = a.changeTimeyear(new Date(1e3 * t.deadline));
|
t.starttime = a.changeTimeyear(new Date(1e3 * t.starttime)), t.deadline = a.changeTimeyear(new Date(1e3 * t.deadline));
|
||||||
}), o.setData({
|
}), o.setData({
|
||||||
list: t.data.data,
|
list: t.data.list,
|
||||||
user: t.data.user,
|
user: t.data.user,
|
||||||
showLoding: !1
|
showLoding: !1
|
||||||
});
|
});
|
||||||
}).catch(function (t) {
|
}).catch(function(t) {
|
||||||
o.isloading = !1, o.setData({
|
o.isloading = !1, o.setData({
|
||||||
loading: !1
|
loading: !1
|
||||||
}), wx.hideLoading();
|
}), wx.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
toScan: function () {
|
toScan: function() {
|
||||||
var a = this;
|
var a = this;
|
||||||
if (this.isSubmit) return !1;
|
if (this.isSubmit) return !1;
|
||||||
wx.scanCode({
|
wx.scanCode({
|
||||||
success: function (i) {
|
success: function(i) {
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: ""
|
title: ""
|
||||||
}), t.globalData.qrcode = i.result, e.request("/miniprogram/identify", i, !0).then(function (e) {
|
}), t.globalData.qrcode = i.result, e.request("https://jmqf.v0750.com/miniprogram/identify", i, !0).then(function(e) {
|
||||||
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
if (wx.hideLoading(), 200 != e.code) return wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: e.message
|
content: e.message
|
||||||
@ -94,7 +85,7 @@ Page({
|
|||||||
t.globalData.devicecode = e.data.devicecode || t.globalData.devicecode, a.setData({
|
t.globalData.devicecode = e.data.devicecode || t.globalData.devicecode, a.setData({
|
||||||
isScan: !!e.data.devicecode
|
isScan: !!e.data.devicecode
|
||||||
}), a.getList();
|
}), a.getList();
|
||||||
}).catch(function (t) {
|
}).catch(function(t) {
|
||||||
wx.hideLoading(), a.isSubmit = !1;
|
wx.hideLoading(), a.isSubmit = !1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -103,7 +94,7 @@ Page({
|
|||||||
isSubmit: !1,
|
isSubmit: !1,
|
||||||
isneedUpload: !1,
|
isneedUpload: !1,
|
||||||
isshowModal: !1,
|
isshowModal: !1,
|
||||||
toStart: function () {
|
toStart: function() {
|
||||||
var t = this;
|
var t = this;
|
||||||
return console.log("this.isSubmit", this.isSubmit), !this.isSubmit && (0 == this.data.list.length ? (wx.showModal({
|
return console.log("this.isSubmit", this.isSubmit), !this.isSubmit && (0 == this.data.list.length ? (wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
@ -113,28 +104,25 @@ Page({
|
|||||||
content: "请选择洗车券"
|
content: "请选择洗车券"
|
||||||
}), !1));
|
}), !1));
|
||||||
},
|
},
|
||||||
startup: function () {
|
startup: function() {
|
||||||
var a = this;
|
var a = this;
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "你当前将要使用的机器编号是:".concat(t.globalData.devicecode, ",确认开机吗?"),
|
content: "你当前将要使用的机器编号是:".concat(t.globalData.devicecode, ",确认开机吗?"),
|
||||||
success: function (i) {
|
success: function(i) {
|
||||||
i.confirm && (a.isSubmit = !0, wx.showLoading({
|
i.confirm && (a.isSubmit = !0, wx.showLoading({
|
||||||
title: "正在启动"
|
title: "正在启动"
|
||||||
}), e.request('/miniprogram/machine/carwashcodestartup', {
|
}), e.request(t.globalData.config.machine.carwashcodestartup, {
|
||||||
washcode: a.data.selectID
|
washcode: a.data.selectID
|
||||||
}, !0).then(function (t) {
|
}, !0).then(function(t) {
|
||||||
// 成功后返回提示
|
|
||||||
wx.showToast({ title: t.message || '启动成功', icon: 'success' });
|
|
||||||
// 成功后跳转
|
|
||||||
a.isSubmit = !1, wx.hideLoading(), 200 == t.code && wx.redirectTo({
|
a.isSubmit = !1, wx.hideLoading(), 200 == t.code && wx.redirectTo({
|
||||||
url: "/pages/washing/washing"
|
url: "/pages/user/user"
|
||||||
});
|
});
|
||||||
}).catch(function (t) {
|
}).catch(function(t) {
|
||||||
a.isSubmit = !1, wx.hideLoading();
|
a.isSubmit = !1, wx.hideLoading();
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
fail: function (t) {
|
fail: function(t) {
|
||||||
console.log("fail:", t);
|
console.log("fail:", t);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5,15 +5,11 @@
|
|||||||
<view bindtap="selectItem" class="{{item.available!=1?'item item-notavailable':selectID==item.code?'active item':'item'}}" data-available="{{item.available}}" data-code="{{item.code}}" wx:for="{{list}}" wx:key="index">
|
<view bindtap="selectItem" class="{{item.available!=1?'item item-notavailable':selectID==item.code?'active item':'item'}}" data-available="{{item.available}}" data-code="{{item.code}}" wx:for="{{list}}" wx:key="index">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="radio"></view>
|
<view class="radio"></view>
|
||||||
<view class="code">{{item.title}}</view>
|
<view class="code">{{item.code}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="location">可使用网点:<block wx:for="{{item.agent}}" wx:for-index="i" wx:for-item="s">{{s.t_name}}{{ i< item.agent.length-1?'、':''}}</block>
|
<view class="location">可使用网点:<block wx:for="{{item.agent}}" wx:for-index="i" wx:for-item="s">{{s.t_name+(i<item.agent.length-1?'、':'')}} </block>
|
||||||
<block wx:if="{{item.agent.length==0}}">不限</block>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="indate">有效期:{{item.starttime}} - {{item.deadline}}</view>
|
<view class="indate">有效期:{{item.starttime}} - {{item.deadline}}</view>
|
||||||
<view class="indate">兑换时间:{{item.created_at}}, 兑换码{{item.code}}</view>
|
|
||||||
<!-- 如果有note -->
|
|
||||||
<view class="indate" wx:if="{{item.note}}">{{item.note}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="no-content" wx:if="{{list.length==0&&!loading}}">
|
<view class="no-content" wx:if="{{list.length==0&&!loading}}">
|
||||||
|
@ -72,7 +72,6 @@
|
|||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
box-shadow: 0 0rpx 9rpx 4rpx hsla(0,0%,80%,.75);
|
box-shadow: 0 0rpx 9rpx 4rpx hsla(0,0%,80%,.75);
|
||||||
padding: 14rpx 20rpx 14rpx 14rpx;
|
padding: 14rpx 20rpx 14rpx 14rpx;
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.item .top {
|
.item .top {
|
||||||
|
@ -1,178 +0,0 @@
|
|||||||
var t = getApp(), e = require("../../utils/login.js");
|
|
||||||
|
|
||||||
Page({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
|
||||||
countdown: '',
|
|
||||||
agentname: '',
|
|
||||||
devicecode: '',
|
|
||||||
remainingTime: 0,
|
|
||||||
orderid: ''
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
|
||||||
var a = this;
|
|
||||||
e.request('/miniprogram/index/balance', {}, !0).then(function (res) {
|
|
||||||
if (!res.data || !res.data.progressorder) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '没有进行中的订单',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 3000
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
// 跳转到首页
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const orderInfo = res.data.progressorder;
|
|
||||||
const currentTime = Math.floor(Date.now() / 1000);
|
|
||||||
const remainingTime = Math.max(0, orderInfo.timestamp + orderInfo.siteoccupationTime * 60 - currentTime);
|
|
||||||
|
|
||||||
a.setData({
|
|
||||||
agentname: orderInfo.agentname,
|
|
||||||
devicecode: orderInfo.devicecode,
|
|
||||||
remainingTime: remainingTime,
|
|
||||||
orderid: orderInfo.id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (remainingTime > 0) {
|
|
||||||
a.countdown();
|
|
||||||
}
|
|
||||||
}).catch(function (err) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '获取订单信息失败',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
|
||||||
*/
|
|
||||||
onReady() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面显示
|
|
||||||
*/
|
|
||||||
onShow() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面隐藏
|
|
||||||
*/
|
|
||||||
onHide() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面卸载
|
|
||||||
*/
|
|
||||||
onUnload() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
|
||||||
*/
|
|
||||||
onPullDownRefresh() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
},
|
|
||||||
handleSettlement() {
|
|
||||||
wx.showModal({
|
|
||||||
title: '确认结算',
|
|
||||||
content: '确定要结算此次洗车订单吗?',
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
e.request('/miniprogram/machine/shutdown', {
|
|
||||||
orderid: this.data.orderid
|
|
||||||
}, true).then((res) => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
wx.showToast({
|
|
||||||
title: res.message || '结算成功',
|
|
||||||
icon: 'success',
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
wx.removeStorageSync('progressorder');
|
|
||||||
wx.redirectTo({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
});
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
}).catch((err) => {
|
|
||||||
// setTimeout(() => {
|
|
||||||
// wx.removeStorageSync('progressorder');
|
|
||||||
// wx.reLaunch({
|
|
||||||
// url: '/pages/index/index'
|
|
||||||
// });
|
|
||||||
// }, 2000);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
countdown() {
|
|
||||||
|
|
||||||
// 没有 Cannot read property 'remainingTime' of undefined
|
|
||||||
if (!this.data.remainingTime) {
|
|
||||||
this.setData({
|
|
||||||
countdown: '00:00'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (this.data.remainingTime <= 0) {
|
|
||||||
this.setData({
|
|
||||||
countdown: '00:00'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const minute = Math.floor(this.data.remainingTime / 60);
|
|
||||||
const second = this.data.remainingTime % 60;
|
|
||||||
const formattedMinute = minute < 10 ? '0' + minute : minute;
|
|
||||||
const formattedSecond = second < 10 ? '0' + second : second;
|
|
||||||
|
|
||||||
this.setData({
|
|
||||||
countdown: formattedMinute + ':' + formattedSecond,
|
|
||||||
remainingTime: this.data.remainingTime - 1
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(this.countdown, 1000);
|
|
||||||
},
|
|
||||||
})
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"usingComponents": {
|
|
||||||
"service-tel": "../../template/serviceTel/serviceTel"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
<view class="spinner">
|
|
||||||
<view class="time">
|
|
||||||
<text class="wangdian">{{agentname}}</text>
|
|
||||||
<text class="mactime">{{countdown}}</text>
|
|
||||||
<text class="macid">{{devicecode}}</text>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<view class="spinner-container container1">
|
|
||||||
<view class="circle1"></view>
|
|
||||||
<view class="circle2"></view>
|
|
||||||
<view class="circle3"></view>
|
|
||||||
<view class="circle4"></view>
|
|
||||||
</view>
|
|
||||||
<view class="spinner-container container2">
|
|
||||||
<view class="circle1"></view>
|
|
||||||
<view class="circle2"></view>
|
|
||||||
<view class="circle3"></view>
|
|
||||||
<view class="circle4"></view>
|
|
||||||
</view>
|
|
||||||
<view class="spinner-container container3">
|
|
||||||
<view class="circle1"></view>
|
|
||||||
<view class="circle2"></view>
|
|
||||||
<view class="circle3"></view>
|
|
||||||
<view class="circle4"></view>
|
|
||||||
</view>
|
|
||||||
<view class="spinner-container container4">
|
|
||||||
<view class="circle1"></view>
|
|
||||||
<view class="circle2"></view>
|
|
||||||
<view class="circle3"></view>
|
|
||||||
<view class="circle4"></view>
|
|
||||||
</view>
|
|
||||||
<view class="spinner-container container5">
|
|
||||||
<view class="circle1"></view>
|
|
||||||
<view class="circle2"></view>
|
|
||||||
<view class="circle3"></view>
|
|
||||||
<view class="circle4"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn">
|
|
||||||
<button type="primary" bindtap="handleSettlement">结 算 洗 车</button>
|
|
||||||
</view>
|
|
||||||
<service-tel></service-tel>
|
|
@ -1,167 +0,0 @@
|
|||||||
.btn {
|
|
||||||
padding: 80rpx 100rpx 40rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner {
|
|
||||||
margin: 200rpx auto 80rpx;
|
|
||||||
width: 400rpx;
|
|
||||||
height: 400rpx;
|
|
||||||
position: relative;
|
|
||||||
border-radius: 400rpx;
|
|
||||||
border: 10rpx solid green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner .time {
|
|
||||||
font-family: 'Consolas', 'Lucida Console', 'DejaVu Sans Mono', monospace;
|
|
||||||
position: absolute;
|
|
||||||
width: 400rpx;
|
|
||||||
height: 320rpx;
|
|
||||||
padding-top: 80rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner .time text {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.wangdian, .macid {
|
|
||||||
line-height: 2;
|
|
||||||
font-size: 40rpx;
|
|
||||||
}
|
|
||||||
.mactime {
|
|
||||||
font-size: 80rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container1 > view, .container2 > view, .container3 > view, .container4 > view, .container5 > view {
|
|
||||||
width: 20rpx;
|
|
||||||
height: 20rpx;
|
|
||||||
background-color: green;
|
|
||||||
border-radius: 100%;
|
|
||||||
position: absolute;
|
|
||||||
-webkit-animation: bouncedelay 2.2s infinite ease-in-out;
|
|
||||||
animation: bouncedelay 2.2s infinite ease-in-out;
|
|
||||||
-webkit-animation-fill-mode: both;
|
|
||||||
animation-fill-mode: both;
|
|
||||||
}
|
|
||||||
.spinner .spinner-container {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.container2 {
|
|
||||||
-webkit-transform: rotateZ(22.5deg);
|
|
||||||
transform: rotateZ(22.5deg);
|
|
||||||
}
|
|
||||||
.container3 {
|
|
||||||
-webkit-transform: rotateZ(45deg);
|
|
||||||
transform: rotateZ(45deg);
|
|
||||||
}
|
|
||||||
.container4 {
|
|
||||||
-webkit-transform: rotateZ(67.5deg);
|
|
||||||
transform: rotateZ(67.5deg);
|
|
||||||
}
|
|
||||||
.container5 {
|
|
||||||
-webkit-transform: rotateZ(90deg);
|
|
||||||
transform: rotateZ(90deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle1 { top: 0; left: 0; }
|
|
||||||
.circle2 { top: 0; right: 0; }
|
|
||||||
.circle3 { right: 0; bottom: 0; }
|
|
||||||
.circle4 { left: 0; bottom: 0; }
|
|
||||||
.container1 .circle1 {
|
|
||||||
-webkit-animation-delay: -2s;
|
|
||||||
animation-delay: -2s;
|
|
||||||
}
|
|
||||||
.container2 .circle1 {
|
|
||||||
-webkit-animation-delay: -1.9s;
|
|
||||||
animation-delay: -1.9s;
|
|
||||||
}
|
|
||||||
.container3 .circle1 {
|
|
||||||
-webkit-animation-delay: -1.8s;
|
|
||||||
animation-delay: -1.8s;
|
|
||||||
}
|
|
||||||
.container4 .circle1 {
|
|
||||||
-webkit-animation-delay: -1.7s;
|
|
||||||
animation-delay: -1.7s;
|
|
||||||
}
|
|
||||||
.container5 .circle1 {
|
|
||||||
-webkit-animation-delay: -1.6s;
|
|
||||||
animation-delay: -1.6s;
|
|
||||||
}
|
|
||||||
.container1 .circle2 {
|
|
||||||
-webkit-animation-delay: -1.5s;
|
|
||||||
animation-delay: -1.5s;
|
|
||||||
}
|
|
||||||
.container2 .circle2 {
|
|
||||||
-webkit-animation-delay: -1.4s;
|
|
||||||
animation-delay: -1.4s;
|
|
||||||
}
|
|
||||||
.container3 .circle2 {
|
|
||||||
-webkit-animation-delay: -1.3s;
|
|
||||||
animation-delay: -1.3s;
|
|
||||||
}
|
|
||||||
.container4 .circle2 {
|
|
||||||
-webkit-animation-delay: -1.2s;
|
|
||||||
animation-delay: -1.2s;
|
|
||||||
}
|
|
||||||
.container5 .circle2 {
|
|
||||||
-webkit-animation-delay: -1.1s;
|
|
||||||
animation-delay: -1.1s;
|
|
||||||
}
|
|
||||||
.container1 .circle3 {
|
|
||||||
-webkit-animation-delay: -1s;
|
|
||||||
animation-delay: -1s;
|
|
||||||
}
|
|
||||||
.container2 .circle3 {
|
|
||||||
-webkit-animation-delay: -0.9s;
|
|
||||||
animation-delay: -0.9s;
|
|
||||||
}
|
|
||||||
.container3 .circle3 {
|
|
||||||
-webkit-animation-delay: -0.8s;
|
|
||||||
animation-delay: -0.8s;
|
|
||||||
}
|
|
||||||
.container4 .circle3 {
|
|
||||||
-webkit-animation-delay: -0.7s;
|
|
||||||
animation-delay: -0.7s;
|
|
||||||
}
|
|
||||||
.container5 .circle3 {
|
|
||||||
-webkit-animation-delay: -0.6s;
|
|
||||||
animation-delay: -0.6s;
|
|
||||||
}
|
|
||||||
.container1 .circle4 {
|
|
||||||
-webkit-animation-delay: -0.5s;
|
|
||||||
animation-delay: -0.5s;
|
|
||||||
}
|
|
||||||
.container2 .circle4 {
|
|
||||||
-webkit-animation-delay: -0.4s;
|
|
||||||
animation-delay: -0.4s;
|
|
||||||
}
|
|
||||||
.container3 .circle4 {
|
|
||||||
-webkit-animation-delay: -0.3s;
|
|
||||||
animation-delay: -0.3s;
|
|
||||||
}
|
|
||||||
.container4 .circle4 {
|
|
||||||
-webkit-animation-delay: -0.2s;
|
|
||||||
animation-delay: -0.2s;
|
|
||||||
}
|
|
||||||
.container5 .circle4 {
|
|
||||||
-webkit-animation-delay: -0.1s;
|
|
||||||
animation-delay: -0.1s;
|
|
||||||
}
|
|
||||||
@-webkit-keyframes bouncedelay {
|
|
||||||
0%, 80%, 100% { -webkit-transform: scale(0.0) }
|
|
||||||
40% { -webkit-transform: scale(2.0) }
|
|
||||||
}
|
|
||||||
@keyframes bouncedelay {
|
|
||||||
0%, 80%, 100% {
|
|
||||||
transform: scale(0.0);
|
|
||||||
-webkit-transform: scale(0.0);
|
|
||||||
} 40% {
|
|
||||||
transform: scale(2.0);
|
|
||||||
-webkit-transform: scale(2.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
"minified": true,
|
"minified": true,
|
||||||
"enhance": false,
|
"enhance": false,
|
||||||
"ignoreDevUnusedFiles": false,
|
"ignoreDevUnusedFiles": false,
|
||||||
"ignoreUploadUnusedFiles": true,
|
"ignoreUploadUnusedFiles": false,
|
||||||
"showShadowRootInWxmlPanel": true,
|
"showShadowRootInWxmlPanel": true,
|
||||||
"packNpmRelationList": [],
|
"packNpmRelationList": [],
|
||||||
"babelSetting": {
|
"babelSetting": {
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
{
|
|
||||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
|
||||||
"projectname": "JMApp",
|
|
||||||
"setting": {
|
|
||||||
"compileHotReLoad": true,
|
|
||||||
"urlCheck": false
|
|
||||||
},
|
|
||||||
"condition": {
|
|
||||||
"miniprogram": {
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"name": "pages/washing/washing",
|
|
||||||
"pathName": "pages/washing/washing",
|
|
||||||
"query": "",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pages/washCodeDetail/washCodeDetail",
|
|
||||||
"pathName": "pages/washCodeDetail/washCodeDetail",
|
|
||||||
"query": "id=6",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "/pages/washCodeDetail/washCodeDetail",
|
|
||||||
"pathName": "/pages/washCodeDetail/washCodeDetail",
|
|
||||||
"query": "",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pages/refund/refund",
|
|
||||||
"pathName": "pages/refund/refund",
|
|
||||||
"query": "",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pages/OnlineCarHailing/OnlineCarHailing",
|
|
||||||
"pathName": "pages/OnlineCarHailing/OnlineCarHailing",
|
|
||||||
"query": "",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pages/wangdian/wangdian",
|
|
||||||
"pathName": "pages/wangdian/wangdian",
|
|
||||||
"query": "number=T1000126",
|
|
||||||
"launchMode": "default",
|
|
||||||
"scene": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libVersion": "3.3.4"
|
|
||||||
}
|
|
@ -3,7 +3,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
margin:0 0 0;
|
margin: 34rpx 27rpx 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
<view class="loader"></view>
|
<view class="loader"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image class="logo" src="/img/logo.png"></image>
|
<image class="logo" src="/img/logo2.jpeg"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
107
utils/login.js
@ -1,8 +1,8 @@
|
|||||||
var e = require("../@babel/runtime/helpers/typeof"), o = (require("./common.js"),
|
var e = require("../@babel/runtime/helpers/typeof"), o = (require("./common.js"),
|
||||||
null), a = null;
|
null), a = null;
|
||||||
|
|
||||||
function t() {
|
function t() {
|
||||||
return new Promise(function (e, o) {
|
return new Promise(function(e, o) {
|
||||||
return wx.login({
|
return wx.login({
|
||||||
success: e,
|
success: e,
|
||||||
fail: o
|
fail: o
|
||||||
@ -12,20 +12,7 @@ function t() {
|
|||||||
|
|
||||||
function n(a) {
|
function n(a) {
|
||||||
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
||||||
|
return wx.showLoading(), new Promise(function(n, c) {
|
||||||
// a 是否 https, 如果不是自动补全
|
|
||||||
if (!/^https/.test(a)) {
|
|
||||||
a = 'https://t-jm.v0750.com' + a;
|
|
||||||
}
|
|
||||||
|
|
||||||
// method 默认为 GET
|
|
||||||
let method = "POST";
|
|
||||||
if (t.method) {
|
|
||||||
method = t.method;
|
|
||||||
delete t.method;
|
|
||||||
}
|
|
||||||
|
|
||||||
return wx.showLoading(), new Promise(function (n, c) {
|
|
||||||
console.log("requestdevicecode", o.globalData.devicecode);
|
console.log("requestdevicecode", o.globalData.devicecode);
|
||||||
var i = Object.assign({}, {
|
var i = Object.assign({}, {
|
||||||
devicecode: o.globalData.devicecode
|
devicecode: o.globalData.devicecode
|
||||||
@ -39,8 +26,8 @@ function n(a) {
|
|||||||
Cookie: "_miucms_session=" + wx.getStorageSync("_miucms_session"),
|
Cookie: "_miucms_session=" + wx.getStorageSync("_miucms_session"),
|
||||||
token: wx.getStorageSync("session") || ""
|
token: wx.getStorageSync("session") || ""
|
||||||
},
|
},
|
||||||
method: method,
|
method: "POST",
|
||||||
success: function (o) {
|
success: function(o) {
|
||||||
var t = o.data;
|
var t = o.data;
|
||||||
if ("object" != e(t) && null != t) {
|
if ("object" != e(t) && null != t) {
|
||||||
t = t.replace("\ufeff", "");
|
t = t.replace("\ufeff", "");
|
||||||
@ -50,40 +37,40 @@ function n(a) {
|
|||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
var l = o.data;
|
var l = o.data;
|
||||||
switch (1 * l.code) {
|
switch (1 * l.code) {
|
||||||
case 200:
|
case 200:
|
||||||
case 888:
|
case 888:
|
||||||
n(l);
|
n(l);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 201:
|
case 201:
|
||||||
a.indexOf("carwashcoupon/receive") > -1 || wx.showModal({
|
a.indexOf("carwashcoupon/receive") > -1 || wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: l.message
|
content: l.message
|
||||||
}), c(l);
|
}), c(l);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 404:
|
case 404:
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "未找到当前接口"
|
content: "未找到当前接口"
|
||||||
}), c(l);
|
}), c(l);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 401:
|
case 401:
|
||||||
var s = getCurrentPages(), r = s[s.length - 1];
|
var s = getCurrentPages(), r = s[s.length - 1];
|
||||||
console.log(401, a), wx.redirectTo({
|
console.log(401, a), wx.redirectTo({
|
||||||
url: "/pages/login/login?fromPage=".concat(r.route)
|
url: "/pages/login/login?fromPage=".concat(r.route)
|
||||||
}), c(l);
|
}), c(l);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: l.message
|
content: l.message
|
||||||
}), c(l);
|
}), c(l);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function(e) {
|
||||||
wx.hideLoading(), console.log("reqest error", e), c("fail");
|
wx.hideLoading(), console.log("reqest error", e), c("fail");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -91,37 +78,37 @@ function n(a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function c(e, a) {
|
function c(e, a) {
|
||||||
console.log("appstart", e), o = a, n("https://t-jm.v0750.com/miniprogram", {
|
console.log("appstart", e), o = a, n("https://jmqf.v0750.com/miniprogram", {
|
||||||
code: e
|
code: e
|
||||||
}, !0).then(function (e) {
|
}, !0).then(function(e) {
|
||||||
var o = e.data;
|
var o = e.data;
|
||||||
console.log("总接口", o), a.globalData.user = o.user, wx.setStorageSync("session", o.user.session),
|
console.log("总接口", o), a.globalData.user = o.user, wx.setStorageSync("session", o.user.session),
|
||||||
a.globalData.isUserAuthorization = o.user > 0 ? 2 : 1, a.globalData.config = o.config,
|
a.globalData.isUserAuthorization = o.user > 0 ? 2 : 1, a.globalData.config = o.config,
|
||||||
a.globalData.servicetel = o.servicetel, a.globalData.canGetData = !0, a.globalData.protocol = o.protocol;
|
a.globalData.servicetel = o.servicetel, a.globalData.canGetData = !0, a.globalData.protocol = o.protocol;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
initial_url: "https://t-jm.v0750.com/miniprogram",
|
initial_url: "https://jmqf.v0750.com/miniprogram",
|
||||||
login: t,
|
login: t,
|
||||||
request: n,
|
request: n,
|
||||||
pageStart: function (e) {
|
pageStart: function(e) {
|
||||||
return new Promise(function (o, t) {
|
return new Promise(function(o, t) {
|
||||||
e.globalData.canGetData ? o() : a = setInterval(function () {
|
e.globalData.canGetData ? o() : a = setInterval(function() {
|
||||||
e.globalData.canGetData && (clearInterval(a), o());
|
e.globalData.canGetData && (clearInterval(a), o());
|
||||||
}, 1e3);
|
}, 1e3);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getLogin: function (e) {
|
getLogin: function(e) {
|
||||||
o = e, t().then(function (a) {
|
o = e, t().then(function(a) {
|
||||||
console.log("获取用户登录态成功!", a.code), o.globalData.code = a.code, c(a.code, e);
|
console.log("获取用户登录态成功!", a.code), o.globalData.code = a.code, c(a.code, e);
|
||||||
}).catch(function (o) {
|
}).catch(function(o) {
|
||||||
c(res.code, e);
|
c(res.code, e);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
baseUrl: "https://t-jm.v0750.com/",
|
baseUrl: "https://jmqf.v0750.com/",
|
||||||
getDevicecode: function (e, a) {
|
getDevicecode: function(e, a) {
|
||||||
o = e, n("https://t-jm.v0750.com/miniprogram/identify/reload", a, !0).then(function (e) {
|
o = e, n("https://jmqf.v0750.com/miniprogram/identify/reload", a, !0).then(function(e) {
|
||||||
var a = e.data;
|
var a = e.data;
|
||||||
console.log("onshow获取到的数据", a), o.globalData.devicecode = a.devicecode || o.globalData.devicecode;
|
console.log("onshow获取到的数据", a), o.globalData.devicecode = a.devicecode || o.globalData.devicecode;
|
||||||
});
|
});
|
||||||
|