From 0280c4bf9bcd16c923b60dedb2b0dc0620dabf14 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Wed, 28 Aug 2024 18:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/http.interceptor.js | 4 +- page_user/creadtg.vue | 10 +- page_user/deviceedit.vue | 2 +- page_user/homepage.vue | 7 +- page_user/mydetail.vue | 416 ++++++++++++++++++++--------------- page_user/mydingdan.vue | 9 +- page_user/orderlist.vue | 7 +- pages.json | 2 +- pages/index/index.vue | 112 +++++++--- pages/myorder/index.vue | 65 +++++- pages/nearbystores/index.vue | 78 ++++++- 11 files changed, 483 insertions(+), 229 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 9f92982..451f4f3 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -20,8 +20,8 @@ const install = (Vue, vm) => { // }, // }); Vue.prototype.$u.http.setConfig({ - baseUrl: 'http://192.168.2.8:3302', - // baseUrl: 'https://kang.chuangtewl.com/prod-api', + // baseUrl: 'http://192.168.2.8:3302', + baseUrl: 'https://kang.chuangtewl.com/prod-api', loadingText: '努力加载中~', loadingTime: 800, // 设置自定义头部content-type diff --git a/page_user/creadtg.vue b/page_user/creadtg.vue index 089deb4..bb7bfbb 100644 --- a/page_user/creadtg.vue +++ b/page_user/creadtg.vue @@ -6,17 +6,17 @@ 角色名称 - + - + 投资人 - + - + @@ -28,7 +28,7 @@ 被推广人分成比例不能超过自身分成比例 - + diff --git a/page_user/deviceedit.vue b/page_user/deviceedit.vue index 4fa9c5a..880468e 100644 --- a/page_user/deviceedit.vue +++ b/page_user/deviceedit.vue @@ -60,7 +60,7 @@ 所在房间: - {{obj.room == undefined ? '--' : obj.room}} + {{obj.room == undefined ? '--' : obj.room}}号 diff --git a/page_user/homepage.vue b/page_user/homepage.vue index 192fd0d..b85e5c4 100644 --- a/page_user/homepage.vue +++ b/page_user/homepage.vue @@ -75,7 +75,7 @@ - 套餐管理 + 套餐管理 @@ -315,11 +315,13 @@ } .gn_list{ width: 658rpx; - max-height: 420rpx; + max-height: 430rpx; background: #FFFFFF; border-radius: 24rpx 24rpx 24rpx 24rpx; margin-top: 20rpx; border-radius: 20rpx; + padding-top: 10rpx; + box-sizing: border-box; .list_val{ width: 100%; display: flex; @@ -327,6 +329,7 @@ align-items: center; padding: 18rpx 36rpx; box-sizing: border-box; + font-size: 28rpx; } .lt{ display: flex; diff --git a/page_user/mydetail.vue b/page_user/mydetail.vue index 78dcfe2..4ef1001 100644 --- a/page_user/mydetail.vue +++ b/page_user/mydetail.vue @@ -3,95 +3,100 @@ - - 剩余时长 - - - {{formattedTime}} - - - - - - - {{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}}小时 - - - 套餐时长 - + + 剩余时长 + + + {{formattedTime}} + + + + + + + {{detailobj.suitTime == undefined ? '--' : detailobj.suitTime}}小时 - - - - - - - {{detailobj.money == undefined ? '--' : detailobj.money}}元 - - - 实付金额 - + + 套餐时长 - - - - - 设备编号:{{detailobj.deviceNo == undefined ? '--' : detailobj.deviceNo}} - - - - - - 订单号 - - - {{detailobj.billNo == undefined ? '--' : detailobj.billNo}} - - - - - 购买套餐: - - - {{detailobj.suitName == undefined ? '--' : detailobj.suitName}} - - - - - 金额 - - - ¥{{detailobj.money == undefined ? '--' : detailobj.money}} - - - - - 租借店铺: - - - {{detailobj.storeName == undefined ? '--' : detailobj.storeName}} - - - - - 支付时间: - - - {{detailobj.payTime == undefined ? '--' : detailobj.payTime}} - - - - - - - + + + 订单号 + + + {{detailobj.billNo == undefined ? '--' : detailobj.billNo}} + + + + + 购买套餐: + + + {{detailobj.suitName == undefined ? '--' : detailobj.suitName}} + + + + + 金额 + + + ¥{{detailobj.money == undefined ? '--' : detailobj.money}} + + + + + 租借店铺: + + + {{detailobj.storeName == undefined ? '--' : detailobj.storeName}} + + + + + 支付时间: + + + {{detailobj.payTime == undefined ? '--' : detailobj.payTime}} + + + + + + 删除订单 + + + 删除订单 + + + - + @@ -100,59 +105,98 @@ export default { data() { return { - imgad:'', - detailobj:{}, - billId:'', - timeday: '', + imgad: '', + detailobj: {}, + billId: '', + timeday: '', + flag: true } }, onLoad(option) { - if(option.billId){ - this.billId = option.billId - this.getlist() - this.getad() - }else{ + if (option.billId) { + this.billId = option.billId + this.getlist() + // this.getad() + } else { this.billId = option.id this.getlist() - this.getad() + // this.getad() } }, // 分享到好友(会话) - onShareAppMessage: function () { - return { - title: '创亿康', - path: '/pages/index/index' - } - }, - - // 分享到朋友圈 - onShareTimeline: function () { - return { - title: '创亿康', - query: '', - path: '/pages/index/index' - } - }, - computed: { - formattedTime() { - if (this.timeday.days > 0) { - // 只展示天和小时 - return `${this.timeday.days}天${this.timeday.hours}小时` - } else if (this.timeday.hours > 0) { - // 展示小时和分钟 - return `${this.timeday.hours}小时${this.timeday.minutes}分钟` - } else if (this.timeday.minutes > 0) { - // 展示分钟和秒 - return `${this.timeday.minutes}分钟${this.timeday.seconds}秒` - } else { - // 展示秒或0(如果秒也为0) - return this.timeday.seconds > 0 ? `${this.timeday.seconds}秒` : '0' - } - } - }, + onShareAppMessage: function() { + return { + title: '创亿康', + path: '/pages/index/index' + } + }, + + // 分享到朋友圈 + onShareTimeline: function() { + return { + title: '创亿康', + query: '', + path: '/pages/index/index' + } + }, + computed: { + formattedTime() { + if (this.timeday.days > 0) { + // 只展示天和小时 + return `${this.timeday.days}天${this.timeday.hours}小时` + } else if (this.timeday.hours > 0) { + // 展示小时和分钟 + return `${this.timeday.hours}小时${this.timeday.minutes}分钟` + } else if (this.timeday.minutes > 0) { + // 展示分钟和秒 + return `${this.timeday.minutes}分钟${this.timeday.seconds}秒` + } else { + // 展示秒或0(如果秒也为0) + return this.timeday.seconds > 0 ? `${this.timeday.seconds}秒` : '0' + } + } + }, methods: { + btndel() { + let that = this + uni.showModal({ + title: '提示', + content: '您确定要删除此订单吗?', + success: function(res) { + if (res.confirm) { + that.flag = false + that.$u.delete(`/app/bill/${that.billId}`).then(res => { + if (res.code == 200) { + uni.showToast({ + title: res.msg, + icon: 'success', + duration: 1000 + }) + setTimeout(() => { + that.flag = true + uni.navigateBack() + }, 1500) + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 1000 + }) + setTimeout(() => { + that.flag = true + }, 1500) + } + }) + } else if (res.cancel) { + console.log('用户点击取消'); + // 执行取消后的逻辑 + } + } + }) + }, + // 请求详情 - getlist(){ + getlist() { this.$u.get(`/app/bill/${this.billId}`).then((res) => { if (res.code == 200) { this.detailobj = res.data @@ -170,7 +214,7 @@ if (differenceInMs <= 0) { this.timeday = 0 } else { - if(this.timeday == ''){ + if (this.timeday == '') { this.timeday = this.formatMilliseconds(differenceInMs) this.startTimer() } @@ -220,30 +264,6 @@ seconds: seconds } }, - - - btnad() { - this.$u.get("/app/ad").then((res) => { - if (res.code == 200) { - if (res.data.urlType == 1) { - uni.navigateTo({ - url: '/pages/webview?url=' + res.data.url - }) - } else { - uni.navigateTo({ - url: res.data.url - }) - } - } - }) - }, - getad() { - this.$u.get("/app/ad").then((res) => { - if (res.code == 200) { - this.imgad = res.data.picture - } - }) - }, } } @@ -256,53 +276,82 @@ /deep/ .u-icon__icon { padding-bottom: 15rpx; } - page { - background: #F4F5F7; - } + + page { + background: #F4F5F7; + } + + .del { + position: fixed; + bottom: 100rpx; + left: 50%; + transform: translateX(-50%); + // background-color: #fff; + // background: linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%); + background-color: red; + padding-left: 50rpx; + padding-right: 50rpx; + width: 650rpx; + height: 84rpx; + // background: red; + filter: blur(0px); + text-align: center; + line-height: 84rpx; + font-size: 36rpx; + color: #fff; + border-radius: 50rpx; + } + .page { width: 750rpx; height: 100vh; overflow: hidden; padding: 0 46rpx; box-sizing: border-box; + .guangg { margin-top: 30rpx; margin-bottom: 10rpx; - + image { border-radius: 30rpx; width: 100%; height: 218rpx; } } - .list_item{ + + .list_item { width: 658rpx; height: 380rpx; background: #FFFFFF; - box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42,130,228,0.1); + box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1); border-radius: 24rpx 24rpx 24rpx 24rpx; margin: auto; margin-top: 30rpx; padding: 24rpx 30rpx; box-sizing: border-box; - .top{ + + .top { width: 100%; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #D8D8D8; padding-bottom: 20rpx; - box-sizing: border-box; - .bh{ + box-sizing: border-box; + + .bh { font-size: 28rpx; color: #3D3D3D; } - .wc{ + + .wc { font-size: 28rpx; color: #8883F0; } } - .bot{ + + .bot { margin-top: 22rpx; width: 100%; display: flex; @@ -312,11 +361,13 @@ padding-top: 20rpx; box-sizing: border-box; border-top: 1px solid #D8D8D8; - .time{ + + .time { font-size: 24rpx; color: #808080; } - .pagexq{ + + .pagexq { width: 142rpx; height: 48rpx; background: #8883F0; @@ -328,7 +379,8 @@ border-radius: 20rpx; } } - .item_xx{ + + .item_xx { margin-top: 22rpx; width: 100%; display: flex; @@ -338,21 +390,24 @@ color: #3D3D3D; } } - .shengyu{ + + .shengyu { font-size: 40rpx; color: #3D3D3D; margin-top: 46rpx; } - .time{ + + .time { font-size: 48rpx; color: #8883F0; margin-top: 12rpx; } - .setmeal{ + + .setmeal { margin-top: 38rpx; width: 658rpx; height: 150rpx; - background: rgba(136,131,240,0.1); + background: rgba(136, 131, 240, 0.1); border-radius: 24rpx 24rpx 24rpx 24rpx; border-image: linear-gradient(180deg, rgba(255, 255, 255, 0.07999999821186066), rgba(156.31499379873276, 140.25000303983688, 255, 0.23999999463558197)) 2 2; display: flex; @@ -360,45 +415,54 @@ align-items: center; padding: 0 42rpx; box-sizing: border-box; - .cen{ + + .cen { width: 2rpx; height: 108rpx; border: 2rpx solid #8883F0; opacity: 0.5; } - .lt{ + + .lt { display: flex; align-items: center; text-align: center; - image{ + + image { width: 84rpx; height: 84rpx; margin-right: 30rpx; } - .one{ + + .one { font-size: 32rpx; color: #3D3D3D; } - .two{ + + .two { font-size: 24rpx; color: #3D3D3D; margin-top: 8rpx; } } - .rt{ + + .rt { display: flex; align-items: center; text-align: center; - image{ + + image { width: 84rpx; height: 84rpx; margin-right: 30rpx; } - .one{ + + .one { font-size: 32rpx; color: #3D3D3D; } - .two{ + + .two { font-size: 24rpx; color: #3D3D3D; margin-top: 8rpx; diff --git a/page_user/mydingdan.vue b/page_user/mydingdan.vue index 76cfd97..2897bd4 100644 --- a/page_user/mydingdan.vue +++ b/page_user/mydingdan.vue @@ -3,7 +3,7 @@ - + 设备编号:{{item.deviceNo}} @@ -66,7 +66,7 @@ {{item.createTime}} - + 订单详情 @@ -101,6 +101,11 @@ } }, onLoad(option) { + + }, + onShow() { + this.wateringList = [] + this.pagenum = 1 this.getlist() }, // 分享到好友(会话) diff --git a/page_user/orderlist.vue b/page_user/orderlist.vue index 841ca25..35142fc 100644 --- a/page_user/orderlist.vue +++ b/page_user/orderlist.vue @@ -138,8 +138,8 @@ this.pagenum = 1 this.getlist() }else if(num == 2){ - this.isUsing = false - this.isFinished = true + this.isUsing = true + this.isFinished = false this.wateringList = [] this.pagenum = 1 this.getlist() @@ -239,8 +239,9 @@ background-color: #F7FAFE !important; height: 100vh; width: 100%; + overflow: hidden; .order_list{ - padding-bottom: 100rpx; + padding-bottom: 350rpx; box-sizing: border-box; height: 1020rpx; overflow: scroll; diff --git a/pages.json b/pages.json index 7356d18..3eebef8 100644 --- a/pages.json +++ b/pages.json @@ -71,7 +71,7 @@ },{ "path": "pages/webview", "style": { - "navigationBarTitleText": "上传", + "navigationBarTitleText": "", "enablePullDownRefresh": false, "navigationStyle": "custom" } diff --git a/pages/index/index.vue b/pages/index/index.vue index 02b58b5..36a83e5 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -7,25 +7,28 @@ + :show-location="true" :markers="covers" :scale="mapScale" @tap="onMapTap"/> - + 您有正在使用中的设备... - - + + + + {{item.deviceName}} - + + @@ -159,8 +162,8 @@ indicatorDots: true, autoplay: true, - interval: 6000, - duration: 2000, + interval: 5000, + duration: 500, c: '', //推广码 tgobj: {}, @@ -182,7 +185,7 @@ let decodedValue = decodeURIComponent(sceneValue) let id = getQueryParam(decodedValue, 'c') this.c = id - console.log('接收到的参数:', this.c) + // console.log('接收到的参数:', this.c) this.$u.get(`/app/shareCode/byCode/${this.c}`).then((res) => { if (res.code == 200) { this.tgobj = res.data @@ -347,9 +350,9 @@ uni.navigateTo({ url: '/pages/webview?url=' + item.url }) - } else { + } else { uni.navigateTo({ - url: item.url + url: '/' + item.url }) } } @@ -399,15 +402,14 @@ } that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => { if (res.data == 2) { - that.$u.get(`/app/device/${id}/withSuitList`).then( - (res) => { + that.$u.get(`/app/device/${id}/withSuitList`).then((res) => { if (res.code == 200) { uni.navigateTo({ url: '/page_user/fuwu?id=' + id }) - } + } }) - }else if (res.data == 0) { + } else if (res.data == 0) { uni.showModal({ title: '提示', content: '该设备未录入,你需进行录入吗?', @@ -515,6 +517,64 @@ onControltap(control) { this.setMapScale() }, + // 点击地图查询点击地方的店铺 + onMapTap(e){ + this.jinweidu = e.detail.longitude + ',' + e.detail.latitude + this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then( + res => { + if (res.code == 200) { + this.listmap = res.data + res.data.forEach(item => { + // if (item.deviceCount !== null && item.deviceCount > 0) { + const shopCover = { + id: parseFloat(item.storeId), + latitude: item.lat, + longitude: item.lng, + width: 25, + height: 30, + iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY', + // iconPath:item.picture + label: { + content: item.name, + anchorX: (() => { + if (item.name.length <= 2) { + return -12 + } else if (item.name.length <= + 3) { + return -20 + } else if (item.name.length <= + 4) { + return -25 + } else if (item.name.length <= + 5) { + return -30 + } else if (item.name.length <= + 6) { + return -35 + } else if (item.name.length <= + 8) { + return -40 + } else if (item.name.length <= + 10) { + return -45 + } else { + return -item.name.length * + 6 + } + })(), + fontWeight: 700, + color: '#8883F0', + borderColor: '#fff', + borderRadius: 5, + bgColor: '#fff' + } + } + this.covers.push(shopCover) + // } + }) + } + }) + }, // 地图回正 async setMapScale(e, val) { let mapContext = uni.createMapContext('map', this); @@ -558,7 +618,7 @@ longitude: item.lng, width: 25, height: 30, - iconPath: 'https://api.ccttiot.com/smartmeter/img/static/ukj9VG7nQkBdZ4SKfQ6E', + iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY', // iconPath:item.picture label: { content: item.name, @@ -630,7 +690,7 @@ longitude: item.lng, width: 25, height: 30, - iconPath: 'https://api.ccttiot.com/smartmeter/img/static/ukj9VG7nQkBdZ4SKfQ6E', + iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY', borderColor: '#fff', borderRadius: 5, bgColor: '#fff' @@ -648,7 +708,7 @@ longitude: item.lng, width: 25, height: 30, - iconPath: 'https://api.ccttiot.com/smartmeter/img/static/ukj9VG7nQkBdZ4SKfQ6E', + iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY', label: { content: item.name, anchorX: this.calculateAnchorX(item.name), @@ -686,7 +746,7 @@ } else { this.jmlogin() } - }) + }) }, jmlogin() { @@ -1109,8 +1169,8 @@ .ongoing_order { width: 622rpx; max-height: 100%; - background-color: rgba(0, 0, 0, 0.4); - // background: linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%); + // background-color: rgba(0, 0, 0, 0.4); + background: linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%); border-radius: 40rpx 40rpx 40rpx 40rpx; // opacity: 0.6; position: absolute; @@ -1127,7 +1187,7 @@ align-items: center; justify-content: space-between; font-size: 36rpx; - color: #fff; + color: #3D3D3D; padding: 0 38rpx; padding-right: 56rpx; box-sizing: border-box; @@ -1144,8 +1204,8 @@ width: 622rpx; height: 94rpx; background: rgba(0, 0, 0, 0.4); - // background: linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%); - box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3); + background: linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%); + // box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3); border-radius: 40rpx 40rpx 40rpx 40rpx; display: flex; align-items: center; @@ -1154,7 +1214,7 @@ box-sizing: border-box; font-weight: 400; font-size: 36rpx; - color: #fff; + color: #3D3D3D; .order_lt { display: flex; diff --git a/pages/myorder/index.vue b/pages/myorder/index.vue index 14b3d29..76e57c7 100644 --- a/pages/myorder/index.vue +++ b/pages/myorder/index.vue @@ -4,7 +4,7 @@ title-size='44' height='44'> + :show-location="true" :markers="covers" :scale="mapScale" @tap="onMapTap"/>