This commit is contained in:
XiaoMo 2025-04-09 23:29:51 +08:00
parent bb3f1aaa6e
commit b55e98d0b9
10 changed files with 253 additions and 290 deletions

View File

@ -39,6 +39,7 @@
"desc": "你的位置信息将用于定位效果展示"
}
},
"lazyCodeLoading": "requiredComponents",
"requiredPrivateInfos": [
"chooseAddress",
"getLocation",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 81 KiB

BIN
img/login-bg.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 KiB

After

Width:  |  Height:  |  Size: 135 KiB

View File

@ -3,104 +3,8 @@ var e = getApp(), t = require("../../utils/login.js");
Page({
data: {
showLoding: !0,
urlList: [ {
img: "https://jm-static.v0750.com/image/you.png",
name: "充值赠送",
dsc: "你的信任,我的回馈",
url: "voucher/voucher",
needlogin: !0
}, {
img: "https://jm-static.v0750.com/image/juan.png",
name: "我的卡券",
dsc:"卡券集中地",
url: "washCodeList/washCodeList",
needlogin: !0
}, {
img: "https://jm-static.v0750.com/image/xi.png",
name: "洗车教程",
dsc:"规范洗车,轻松安全",
url: "webview/webview?url=https://t-jm.v0750.com/video",
needlogin: !1
}, {
img: "https://jm-static.v0750.com/image/dui.png",
name: "团购兑换",
dsc:"抖音、美团",
url: "duiquan/duiquan",
needlogin: !0
}, {
img: "https://jm-static.v0750.com/image/member.png",
name: "会员中心",
dsc:"充值,消费明细",
url: "user/user",
needlogin: !0
}, {
img: "https://jm-static.v0750.com/image/kefu.png",
name: "联系客服",
dsc:"拨打客服电话",
url: "",
showimg: !0
} ],
wangdianList: [{
name:"三和大道店",
liangdian: [
{"name":"券","ys":"#FF6600"},
{"name":"PA壶","ys":"#37CE05"},
{"name":"人工帮洗","ys":"#0056A3"},
{"name":"轮胎打气","ys":"#08AFDE"},
],
tag:"冲水|泡沫|吸尘|吹气|洗手",
ads:"会城帝临南路18号",
yingye:"24小时",
juli:"12.68KM",
bili: "83%",
jiqi_zs: 12,
jiqi_kx: 10
},{
name:"三和大道店",
liangdian: [
{"name":"券","ys":"#FF6600"},
{"name":"PA壶","ys":"#37CE05"},
{"name":"人工帮洗","ys":"#0056A3"},
{"name":"轮胎打气","ys":"#08AFDE"},
],
tag:"冲水|泡沫|吸尘|吹气|洗手",
ads:"会城帝临南路18号",
yingye:"24小时",
juli:"12.68KM",
bili: "43%",
jiqi_zs: 12,
jiqi_kx: 5
},{
name:"三和大道店",
liangdian: [
{"name":"券","ys":"#FF6600"},
{"name":"PA壶","ys":"#37CE05"},
{"name":"人工帮洗","ys":"#0056A3"},
{"name":"轮胎打气","ys":"#08AFDE"},
],
tag:"冲水|泡沫|吸尘|吹气|洗手",
ads:"会城帝临南路18号",
yingye:"24小时",
juli:"12.68KM",
bili: "13%",
jiqi_zs: 12,
jiqi_kx: 5
},{
name:"三和大道店",
liangdian: [
{"name":"券","ys":"#FF6600"},
{"name":"PA壶","ys":"#37CE05"},
{"name":"人工帮洗","ys":"#0056A3"},
{"name":"轮胎打气","ys":"#08AFDE"},
],
tag:"冲水|泡沫|吸尘|吹气|洗手",
ads:"会城帝临南路18号",
yingye:"24小时",
juli:"12.68KM",
bili: "53%",
jiqi_zs: 12,
jiqi_kx: 5
}],
urlList: [],
wangdianList: [],
servicetel: "",
notice: "",
noticeurl: null,
@ -114,27 +18,58 @@ Page({
shop: !1
}
},
bindViewTap: function() {
bindViewTap: function () {
wx.navigateTo({
url: "../logs/logs"
});
},
onLoad: function() {
onLoad: function () {
wx.showLoading({
title: ""
});
var a = this;
t.pageStart(e).then(function(t) {
a.getData(), a.setData({
// 获取地理位置
wx.getLocation({
type: 'gcj02',
success: function(res) {
// 存储经纬度
wx.setStorageSync('latitude', res.latitude);
wx.setStorageSync('longitude', res.longitude);
e.globalData.latitude = res.latitude;
e.globalData.longitude = res.longitude;
// 获取网点列表
t.request('https://t-jm.v0750.com/miniprogram/branch/lists', {
latitude: res.latitude || '',
longitude: res.longitude || ''
}, !0).then(function(res) {
a.setData({
wangdianList: res.data || []
});
});
},
fail: function() {
// 即使获取位置失败也加载网点列表,只是不传入经纬度参数
t.request('https://t-jm.v0750.com/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() {
getData: function () {
var a = this;
t.request(e.globalData.config.home, {}, !0).then(function(e) {
// a.data.urlList[1].url = e.data.tabStatus.shop ? "mall/mall" : "", a.setData({
// 获取首页数据
t.request(e.globalData.config.home, {}, !0).then(function (e) {
a.setData({
banner: e.data.banner,
user: e.data.user,
@ -143,11 +78,11 @@ Page({
notice: e.data.notice,
noticeurl: e.data.noticeurl,
tabStatus: e.data.tabStatus,
// urlList: e.data.urlList
}, function() {
urlList: e.data.urlList
}, function () {
wx.hideLoading(), 0 == e.data.banner.length ? a.setData({
showLoding: !1
}) : setTimeout(function() {
}) : setTimeout(function () {
a.setData({
showLoding: !1
});
@ -155,19 +90,19 @@ Page({
});
});
},
load: function(e) {
load: function (e) {
console.log(e);
var t = e.currentTarget.dataset.index, a = this.data.swiperWidth * e.detail.height / e.detail.width;
this.data.banner[t].height = a, this.setData({
swiperHeight: a
});
},
onShow: function() {
onShow: function () {
this.setData({
isScan: !!e.globalData.devicecode || this.data.isScan
}), e.globalData.config && e.globalData.config.home && (this.getData(), this.isneedUpload = !1);
},
toPage: function(t) {
toPage: function (t) {
console.info(t);
var a = t.currentTarget.dataset, i = a.url, o = a.needlogin, n = a.showimg;
if (console.log("showImg", n), i) {
@ -181,23 +116,23 @@ Page({
} else {
if (!n) return !1;
wx.previewImage({
urls: [ this.data.joinUs ]
urls: [this.data.joinUs]
});
}
},
toScan: function() {
toScan: function () {
e.globalData.needJumpUrl = !1;
var a = this;
wx.scanCode({
success: function(i) {
success: function (i) {
console.log(i), wx.showLoading({
title: ""
}), e.globalData.qrcode = i.result, t.request("https://t-jm.v0750.com/miniprogram/identify", i, !0).then(function(t) {
}), e.globalData.qrcode = i.result, t.request("https://t-jm.v0750.com/miniprogram/identify", i, !0).then(function (t) {
console.log("data", t), wx.hideLoading(), e.globalData.devicecode = t.data.devicecode || e.globalData.devicecode,
a.setData({
isScan: !!t.data.devicecode
});
}).catch(function(e) {
}).catch(function (e) {
wx.hideLoading();
});
}
@ -206,10 +141,10 @@ Page({
isSubmit: !1,
isneedUpload: !1,
isshowModal: !1,
needUpload: function() {
needUpload: function () {
this.isneedUpload = !0;
},
toStart: function() {
toStart: function () {
e.globalData.needJumpUrl = !1, this.isneedUpload = !0;
var t = this;
if (console.log("this.isSubmit", this.isSubmit), this.isSubmit) return !1;
@ -221,28 +156,28 @@ Page({
content: "账户余额小于10元是否立即充值",
confirmText: "去充值",
cancelText: "立即启动",
success: function(e) {
success: function (e) {
e.confirm ? (wx.navigateTo({
url: "/pages/voucher/voucher"
}), t.isneedUpload = !0) : t.startup();
},
fail: function(e) {
fail: function (e) {
console.log("fail:", e);
}
});
} else t.startup();
},
startup: function() {
startup: function () {
var a = this;
wx.showModal({
title: "提示",
content: "你当前将要使用的机器编号是:".concat(e.globalData.devicecode, ",确认开机吗?"),
success: function(i) {
success: function (i) {
i.confirm && (a.isSubmit = !0, wx.showLoading({
title: "正在启动"
}), t.request(e.globalData.config.machine.startup, {
washcode: a.data.selectID
}, !0).then(function(e) {
}, !0).then(function (e) {
a.isSubmit = !1, wx.hideLoading(), 200 == e.code && (wx.showModal({
title: "",
content: e.message
@ -251,25 +186,25 @@ Page({
}), a.isneedUpload = !0), 888 == e.code && (wx.navigateTo({
url: "/pages/voucher/voucher"
}), a.isneedUpload = !0);
}).catch(function(e) {
}).catch(function (e) {
a.isSubmit = !1, wx.hideLoading();
}));
},
fail: function(e) {
fail: function (e) {
console.log("fail:", e);
}
});
},
requestSubscribeMessage: function() {
requestSubscribeMessage: function () {
wx.requestSubscribeMessage({
tmplIds: this.data.tmplIds,
success: function(e) {
console.log("requestSubscribeMessage", e), t.request("https://t-jm.v0750.com/miniprogram/index/newtmpl", e, !0).then(function(e) {}).catch(function(e) {});
success: function (e) {
console.log("requestSubscribeMessage", e), t.request("https://t-jm.v0750.com/miniprogram/index/newtmpl", e, !0).then(function (e) { }).catch(function (e) { });
},
fail: function(e) {
fail: function (e) {
console.log("requestSubscribeMessagefail", e);
}
});
},
onShareAppMessage: function() {}
onShareAppMessage: function () { }
});

View File

@ -59,12 +59,20 @@ Page({
},
updateUserAvatar: function() {
var that = this;
wx.getUserProfile({
desc: '用于更新您的头像',
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success: function(res) {
var userInfo = res.userInfo;
e.request('miniprogram/user/update', {
avatar: userInfo.avatarUrl
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('https://t-jm.v0750.com/miniprogram/user/update', {
avatar: data.data.url
}, true).then(function(res) {
if (res.code == 200) {
that.getContent();
@ -80,16 +88,21 @@ Page({
}
});
}
}
});
}
});
},
updateUserNickname: function() {
var that = this;
wx.getUserProfile({
desc: '用于更新您的昵称',
wx.showModal({
title: '修改昵称',
editable: true,
placeholderText: '请输入新昵称',
success: function(res) {
var userInfo = res.userInfo;
e.request('miniprogram/user/update', {
nickname: userInfo.nickName
if (res.confirm && res.content) {
e.request('https://t-jm.v0750.com/miniprogram/user/update', {
nickname: res.content
}, true).then(function(res) {
if (res.code == 200) {
that.getContent();
@ -105,6 +118,7 @@ Page({
}
});
}
}
});
}
});

View File

@ -5,97 +5,38 @@ Page({
* 页面的初始数据
*/
data: {
banner: [{
"subject": "安全",
"url": "",
"aid": 81,
"image": "https:\/\/jmqf.v0750.com\/attachment\/Zvt57TuJSUvkyhw-xGrY2l-d__Y-fiaMucgip5B4ELaVVGL3d_RgQwUIEt40NDI5"
}, {
"subject": "网约车",
"url": null,
"aid": 89,
"image": "https:\/\/jmqf.v0750.com\/attachment\/Zvt57TuJSUvkyhw-xGrY2l-d9_Y-fiaMucgip5B4ELbDBWWicKZgQwUIEt40NDI5"
}, {
"subject": "肇康店",
"url": "pages\/map\/map",
"aid": 88,
"image": "https:\/\/jmqf.v0750.com\/attachment\/Zvt57TuJSUvkyhw-xGrY2l-d9vY-fiaMucgip5B4ELaZUm6jcvdgQwUIEt40NDI5"
}],
info: {
name:"三和大道店",
liangdian: [
{"name":"券","ys":"#FF6600"},
{"name":"PA壶","ys":"#37CE05"},
{"name":"人工帮洗","ys":"#0056A3"},
{"name":"轮胎打气","ys":"#08AFDE"},
],
tag:"冲水|泡沫|吸尘|吹气|洗手",
ads:"会城帝临南路18号",
yingye:"24小时",
juli:"12.68KM",
bili: "83%",
jiqi_zs: 12,
jiqi_kx: 10
},
jiqilist: [
{
"id": "1840001",
"state": 1, //0:离线,1:空间,2:使用中,3:禁用
"isPA": 1, //用接PA壶,0:不要,1:可接
},{
"id": "1840002",
"state": 2,
"isPA": 1,
},{
"id": "1840003",
"state": 0,
"isPA": 1,
},{
"id": "1840004",
"state": 3,
"isPA": 1,
},{
"id": "1840005",
"state": 1,
"isPA": 0,
},{
"id": "1840006",
"state": 2,
"isPA": 0,
},{
"id": "1840007",
"state": 0,
"isPA": 1,
},{
"id": "1840008",
"state": 1,
"isPA": 0,
},{
"id": "1840009",
"state": 1,
"isPA": 0,
},{
"id": "1840010",
"state": 2,
"isPA": 1,
},{
"id": "1840011",
"state": 0,
"isPA": 0,
},{
"id": "1840012",
"state": 1,
"isPA": 1,
}
]
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);
},
/**
@ -117,13 +58,22 @@ Page({
*/
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;
}
},
/**
@ -145,5 +95,58 @@ Page({
*/
onShareAppMessage() {
},
// 获取网点详情信息
getBranchDetail() {
wx.request({
url: 'https://t-jm.v0750.com/miniprogram/branch/detail',
data: {
number: this.data.number,
latitude: wx.getStorageSync('latitude'),
longitude: wx.getStorageSync('longitude'),
},
method: 'GET',
success: (res) => {
if (res.data && res.data.code == 200) {
this.setData({
banner: res.data.data.banner || [],
info: res.data.data.info || {}
});
}
}
});
},
// 获取机器列表
getMachineList() {
wx.request({
url: 'https://t-jm.v0750.com/miniprogram/branch/machine',
data: {
number: this.data.number,
},
method: 'POST',
success: (res) => {
if (res.data && res.data.code == 200) {
this.setData({
jiqilist: res.data.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
});
}
}
});
},
})

View File

@ -5,49 +5,47 @@
<view class="info">
<view class="title">
<view class="title_c">{{info.name}}</view>
<view class="ld" wx:for="{{info.liangdian}}" wx:key="index_i" wx:for-item="item_l" style="background-color: {{item_l.ys}};">{{item_l.name}}</view>
<view class="ld" wx:for="{{info.service}}" wx:key="index_i" wx:for-item="s" style="background-color: {{s.color}};">{{s.name}}</view>
</view>
<view class="tag">{{info.tag}}</view>
<view class="ads"><text class="iconfont icon-dingwei"></text>{{info.ads}}</view>
<view class="ads yingye"><text class="iconfont icon-shijian"></text>{{info.yingye}}</view>
<view class="tag">{{info.tags}}</view>
<view class="ads"><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">
<text class="ico iconfont icon-daohangdaohang"></text>
<view class="jl">{{info.juli}}</view>
<view class="jl">{{info.distance}}</view>
</view>
</view>
</view>
<view class="content">
<view class="index-wangdian-title">
<view class="more">空闲 {{info.jiqi_kx}}/{{info.jiqi_zs}}台</view>
<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.state > 2}}" class="j"> <!-- 禁用 -->
<view wx:if="{{i.devicestatus ==-1}}" class="j"> <!-- 禁用 -->
<view class="mac_state"><text>禁</text></view>
<text class="mac_id">{{i.id}}</text>
<view class="pa" wx:if="{{i.isPA}}">PA壶</view>
<text class="mac_id">{{i.number}}</text>
<view class="pa" wx:if="{{i.ispa}}">PA壶</view>
</view>
<view wx:elif="{{i.state > 1}}" class="w"> <!-- 使用中 -->
<view wx:elif="{{i.devicestatus == 1}}" class="w"> <!-- 使用中 -->
<view class="mac_state"><text>洗</text></view>
<text class="mac_id">{{i.id}}</text>
<view class="pa" wx:if="{{i.isPA}}">PA壶</view>
<text class="mac_id">{{i.number}}</text>
<view class="pa" wx:if="{{i.ispa}}">PA壶</view>
</view>
<view wx:elif="{{i.state > 0}}" class="x"> <!-- 空间 -->
<view wx:elif="{{i.devicestatus == 0}}" class="x"> <!-- 空间 -->
<view class="mac_state"><text>闲</text></view>
<text class="mac_id">{{i.id}}</text>
<view class="pa" wx:if="{{i.isPA}}">PA壶</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.id}}</text>
<view class="pa" wx:if="{{i.isPA}}">PA壶</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>

View File

@ -4,23 +4,23 @@
<view bindtap="toPage" class="more" data-refresh="1" data-url="map/map">全部网点></view>
<view class="title_c">离我最近<view class="line"></view></view>
</view>
<view bindtap="toPage" class="index-wangdian-box" wx:for="{{wangdianList}}" wx:key="index" wx:for-item="item" data-refresh="1" data-url="wangdian/wangdian">
<view bindtap="toPage" class="index-wangdian-box" wx:for="{{wangdianList}}" wx:key="index" wx:for-item="item" data-refresh="1" data-url="wangdian/wangdian?number={{item.number}}">
<view class="info">
<view class="title">
<view class="title_c">{{item.name}}</view>
<view class="ld" wx:for="{{item.liangdian}}" wx:key="index_i" wx:for-item="item_l" style="background-color: {{item_l.ys}};">{{item_l.name}}</view>
<view class="ld" wx:for="{{item.service}}" wx:key="index_i" wx:for-item="s" style="background-color: {{s.color}};">{{s.name}}</view>
</view>
<view class="tag">{{item.tag}}</view>
<view class="ads"><text class="iconfont icon-dingwei"></text>{{item.ads}}</view>
<view class="jiqi">洗车机:闲{{item.jiqi_kx}}/{{item.jiqi_zs}}台</view>
<view class="yingye">{{item.yingye}}</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">
<text class="ico iconfont icon-daohangdaohang"></text>
<view class="jl">{{item.juli}}</view>
<view class="jl">{{item.distance}}</view>
</view>
</view>
<view class="xian">
<view class="bili" style="width:{{item.bili}}"></view>
<view class="bili" style="width:{{item.ratio}}"></view>
</view>
</view>
</view>

View File

@ -13,7 +13,7 @@
"minified": true,
"enhance": false,
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false,
"ignoreUploadUnusedFiles": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {

View File

@ -5,6 +5,18 @@
"compileHotReLoad": true,
"urlCheck": false
},
"condition": {},
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/wangdian/wangdian",
"pathName": "pages/wangdian/wangdian",
"query": "number=T1000126",
"launchMode": "default",
"scene": null
}
]
}
},
"libVersion": "3.3.4"
}