This commit is contained in:
3321822538@qq.com 2024-11-13 18:01:04 +08:00
parent 459fee332e
commit eb418e26f1
14 changed files with 413 additions and 320 deletions

View File

@ -9,18 +9,18 @@ const install = (Vue, vm) => {
'content-type': 'application/json;charset=UTF-8',
},
});
})
// 请求拦截部分,如配置,每次请求前都会执行
Vue.prototype.$u.http.interceptor.request = (config) => {
const token = uni.getStorageSync('token');
config.header.Authorization = token;
const token = uni.getStorageSync('token')
config.header.Authorization = token
// #ifdef H5
config.header.Authorization = 'Bearer '+token;
config.header.Authorization = 'Bearer '+token
// #endif
if(config.url == '/user/login') config.header.noToken = true;
if(config.url == '/user/login') config.header.noToken = true
// 最后需要将config进行return
return config;
return config
}
// 响应拦截,如配置,每次请求结束都会执行本方法
@ -30,7 +30,7 @@ const install = (Vue, vm) => {
success: function(ret) {
console.log("main.js==>res", ret)
}
});
})
wx.login({
success(res) {
if (res.code) {
@ -45,27 +45,21 @@ const install = (Vue, vm) => {
// uni.navigateTo({
// url:'/pages/login/login'
// })
} else if (res.code == 200) {
uni.setStorageSync('token', res.token);
// console.log("老用户登录",res.data)
// uni.switchTab({
// url:'/pages/index/index'
// })
}
});
})
}
},
});
})
}
return res;
return res
}
}
export default {
install
}

View File

@ -10,13 +10,13 @@
<view v-if="title == '添加蜂箱'" class="qrcode" @click="btnqrcode">
<image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image>
</view>
<view v-else class="qrcode" @click="btnqrcode">
<view v-else class="qrcode" @click="btnqrcode">
<image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image>
</view>
<input v-if="title == '添加蜂箱'" type="text" class="ips" v-model="sn" placeholder="请扫描蜂箱上的二维码" style="margin-left: 32rpx;"
placeholder-class="my-placeholder" />
<input v-else type="text" class="ips" v-model="sn" disabled="true" placeholder="请扫描蜂箱上的二维码" style="margin-left: 32rpx;"
placeholder-class="my-placeholder" />
<input v-if="title == '添加蜂箱'" type="text" class="ips" v-model="sn" placeholder="请扫描蜂箱上的二维码"
style="margin-left: 32rpx;" placeholder-class="my-placeholder" />
<input v-else type="text" class="ips" v-model="sn" disabled="true" placeholder="请扫描蜂箱上的二维码"
style="margin-left: 32rpx;" placeholder-class="my-placeholder" />
</view>
<view class="tit">
@ -40,7 +40,7 @@
</view>
<view class="iptbox">
<input type="text" class="ips" v-model="videoStream" placeholder="请输入设备ID或视频流地址"
placeholder-class="my-placeholder"/>
placeholder-class="my-placeholder" />
</view>
<view class="btn" @click="btnadd" v-if="title == '添加蜂箱'">
@ -69,27 +69,26 @@
name: '',
videoStream: '',
fc: '',
fcid:'',
fcid: '',
showmiyuan: false,
miyuancolumns: [],
pagesum: 1,
pagesize: 99,
beehiveId:'',
code:''
beehiveId: '',
code: ''
}
},
onLoad(option) {
if(option.tit){
if (option.tit) {
this.title = option.tit
this.beehiveId = option.beehiveId
this.geteditxq()
}else{
} else {
this.title = '添加蜂箱'
}
this.getmiyuancolumns()
},
onShow() {
this.getmiyuancolumns()
},
methods: {
//
@ -109,35 +108,34 @@
});
setTimeout(() => {
uni.navigateBack({
delta:2
});
}, 1500);
delta: 2
})
}, 1500)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
})
}
})
.catch(error => {
console.error('删除蜂场失败:', error);
console.error('删除蜂场失败:', error)
uni.showToast({
title: '删除蜂场失败,请稍后再试',
icon: 'none',
duration: 2000
});
});
})
})
}
}
});
})
},
//
geteditxq(){
geteditxq() {
this.$u.get(`/farm/beehive/${this.beehiveId}`).then(res => {
if (res.code == 200) {
this.sn = res.data.sn
this.sn = res.data.sn
this.name = res.data.name
this.fc = res.data.apiaryName
this.videoStream = res.data.videoStream
@ -146,24 +144,24 @@
})
},
//
btnedit(){
btnedit() {
let data = {
beehiveId:this.beehiveId,
apiaryId:this.fcid,
name:this.name,
videoStream:this.videoStream
beehiveId: this.beehiveId,
apiaryId: this.fcid,
name: this.name,
videoStream: this.videoStream
}
this.$u.put(`/farm/beehive`,data).then(res => {
this.$u.put(`/farm/beehive`, data).then(res => {
if (res.code == 200) {
uni.showToast({
title: '修改成功',
icon: 'success',
duration:1000
})
setTimeout(()=>{
uni.navigateBack()
},1500)
}else{
uni.showToast({
title: '修改成功',
icon: 'success',
duration: 1000
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
} else {
uni.showToast({
title: res.msg,
icon: 'none',
@ -172,19 +170,18 @@
}
})
},
// // // // //
btnqrcode(){
btnqrcode() {
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
let url = res.result
let sIndex = url.indexOf('s=')
if (sIndex !== -1) {
this.sn = url.substring(sIndex + 2);
} else {
this.sn = res.result
let url = res.result
let sIndex = url.indexOf('s=')
if (sIndex !== -1) {
this.sn = url.substring(sIndex + 2)
} else {
this.sn = res.result
}
},
fail: err => {
@ -195,7 +192,7 @@
}
})
},
confirmmy(e){
confirmmy(e) {
this.fc = e[0].label
this.fcid = e[0].value
},
@ -206,10 +203,26 @@
};
this.$u.get('/farm/apiary/list', data).then((res) => {
if (res.code === 200) {
this.miyuancolumns = res.rows.map(item => ({
value: item.apiaryId,
label: item.name
}))
if (res.rows.length == 0 || res.rows == null) {
uni.showModal({
title: '提示',
content: '您暂无蜂场,是否先去添加蜂场?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/Apiary/AddApiary'
})
} else if (res.cancel) {
uni.navigateBack()
}
}
})
} else {
this.miyuancolumns = res.rows.map(item => ({
value: item.apiaryId,
label: item.name
}))
}
} else {
// uni.showToast({
// title: res.msg,
@ -222,24 +235,24 @@
//
btnadd() {
let data = {
sn:this.sn,
name:this.name,
apiaryId:this.fcid,
videoStream:this.videoStream
sn: this.sn,
name: this.name,
apiaryId: this.fcid,
videoStream: this.videoStream
}
this.$u.put('farm/beehive/bind', data).then(res => {
if (res.code == 200) {
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(()=>{
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
uni.navigateBack()
},1500)
}else if(res.code == 401){
}, 1500)
} else if (res.code == 401) {
uni.navigateTo({
url:'/pages/login/login'
url: '/pages/login/login'
})
} else {
uni.showToast({
@ -255,18 +268,15 @@
// url:'/pages/Apiary/AddApiary'
// })
// }
}
}
</script>
<style lang="scss">
page {
background-color: #F4FAF8;
}
.page {
// position: relative;
width: 750rpx;
.tit {
@ -286,11 +296,12 @@
height: 222rpx;
}
}
.btns {
display: flex;
align-items: center;
justify-content: center;
margin: auto;
margin: auto;
margin-top: 50rpx;
width: 658rpx;
height: 88rpx;
@ -304,17 +315,13 @@
.btn {
margin: 160rpx auto;
margin-bottom: 0;
// position: fixed;
display: flex;
align-items: center;
justify-content: center;
// bottom: 100rpx;
// left: 46rpx;
width: 658rpx;
height: 88rpx;
background: #FFCC25;
border-radius: 20rpx 20rpx 20rpx 20rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
@ -344,7 +351,6 @@
.ips {
width: 630rpx;
}
image {
@ -358,8 +364,5 @@
color: #808080;
}
}
}
</style>

View File

@ -4,7 +4,7 @@
back-icon-color="#000" height='50'></u-navbar>
<view class="title">
<text>设备录入列表</text>
<text style="font-size: 28rpx;width: 160rpx;height: 60rpx;border-radius: 20rpx;background-color: #FFC107;text-align: center;color: #fff;line-height: 60rpx;margin-top: 20rpx;" @click="btnkzt">控制台</text>
<text style="font-size: 28rpx;width: 160rpx;height: 60rpx;border-radius: 20rpx;background-color: #ce9e10;text-align: center;color: #fff;line-height: 60rpx;margin-top: 20rpx;" @click="btnkzt">控制台</text>
</view>
<view class="dblist" v-for="(item, index) in devicesLists" :key="index">
@ -20,11 +20,11 @@
<view class="mac">
MAC{{item.name.substring(5)}}
</view>
<view class="" style="color: #FFC107;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
<view class="" style="color: #ce9e10;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
蓝牙强度:{{item.RSSI}}
</view>
<!-- <view @click.stop="btnshows(item,index)"
style="color: #FFC107;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
style="color: #ce9e10;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
型号选择:{{item.xuanz == undefined ? '--' : item.xuanz}}
</view> -->
</view>
@ -590,7 +590,7 @@
bottom: 112rpx;
button {
background: #FFC107;
background: #ce9e10;
border-radius: 52rpx 52rpx 52rpx 52rpx;
color: #fff;
}
@ -631,7 +631,7 @@
margin-top: 46rpx;
width: 266rpx;
height: 96rpx;
background: #FFC107;
background: #ce9e10;
border-radius: 52rpx 52rpx 52rpx 52rpx;
color: #fff;
text-align: center;

View File

@ -18,21 +18,33 @@
<view class="machao">
MAC号{{obj.mac == undefined ? '--' : obj.mac}}
</view>
<!-- <view class="machao">
电压{{obj.voltage == undefined ? '--' : obj.voltage}}V
<view class="machao">
总重量{{(obj.totalWeight == undefined ? '--' : (Number(obj.totalWeight / 1000)).toFixed(2)) + 'kg'}}
</view>
<view class="machao">
功率{{obj.realTimePower == undefined ? '--' : obj.realTimePower}}KW
箱内湿度{{obj.innerHumidity == undefined ? '--' : obj.innerHumidity + '%'}}
</view>
<view class="machao">
电流{{obj.electricity == undefined ? '--' : obj.electricity}}A
</view> -->
箱外湿度{{obj.outerHumidity == undefined ? '--' : obj.outerHumidity + '%'}}
</view>
<view class="machao">
箱外温度{{obj.outerTemperature == undefined ? '--' : obj.outerTemperature + '%'}}
</view>
<view class="machao">
剩余电量{{obj.surplusPower == undefined ? '--' : obj.surplusPower + '%'}}
</view>
<view class="machao">
箱内二氧化碳浓度{{obj.innerCo2 == undefined ? '--' : obj.innerCo2 + '%'}}
</view>
<view class="machao">
进出量(){{obj.ioCount == undefined ? '--' : obj.ioCount}}
</view>
<view class="machao">
频率{{obj.volume == undefined ? '--' : obj.volume + 'hz'}}
</view>
<view class="machao">
网络<text v-if="onlineStatus == '离线'" style="color: red;">离线</text> <text v-if="onlineStatus == '在线'" style="color: green;">在线</text>
</view>
<!-- <view class="machao">
状态<text v-if="powerStatus == '关闭'" style="color: red;">关闭</text> <text v-if="powerStatus == '开启'" style="color: green;">开启</text>
</view> -->
<view class="machao">
最后在线时间{{obj.lastOnlineTime == undefined ? '--' : obj.lastOnlineTime}}
</view>
@ -42,9 +54,12 @@
<view class="anniu" @click="btnkq">
开启蜂鸣
</view>
<!-- <view class="anniu" @click="btngb">
关闭
</view> -->
<view class="anniu" @click="btngbkq">
开启风扇
</view>
<view class="anniu" @click="btngb">
关闭风扇
</view>
<view class="anniu" @click="btnsx">
刷新
</view>
@ -155,7 +170,7 @@
uni.navigateBack()
},
//
//
btnkq(){
this.$u.put(`/app/beehive/admin/buzzer?sn=${this.storeId}`).then((res) => {
if (res.code == 200) {
@ -176,9 +191,9 @@
}
})
},
//
//
btngb(){
this.$u.put(`/app/device/admin/${this.id}/switch?open=false`).then((res) => {
this.$u.put(`/app/beehive/admin/fan?sn=${this.storeId}&open=false`).then((res) => {
if (res.code == 200) {
setTimeout(()=>{
this.btnsx()
@ -197,28 +212,31 @@
}
})
},
//
btngbkq(){
this.$u.put(`/app/beehive/admin/fan?sn=${this.storeId}&open=true`).then((res) => {
if (res.code == 200) {
setTimeout(()=>{
this.btnsx()
},1000)
uni.showToast({
title: res.msg,
icon: 'success',
duration: 2000
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
//
btnsx(){
this.getsn()
// this.$u.get(`/app/device/${this.storeId}/refreshIot`).then((res) => {
// if(res.code == 200){
// this.getsn()
// uni.showToast({
// title: res.msg,
// icon: 'success',
// duration: 2000
// })
// }else{
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// })
// }
// })
}
}
}
</script>
@ -241,18 +259,19 @@
width: 30%;
height: 90rpx;
border-radius: 20rpx;
background-color: #FFC107;
background-color:#ce9e10;
color: #fff;
font-size: 32rpx;
text-align: center;
line-height: 90rpx;
margin: 0 10rpx;
}
}
.fanhui{
width: 658rpx;
height: 90rpx;
border-radius: 20rpx;
background-color: #FFC107;
background-color: #ce9e10;
color: #fff;
font-size: 32rpx;
text-align: center;

View File

@ -72,6 +72,13 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{
"path": "pages/login/logoyzm",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/Apiary/AddApiary",

View File

@ -105,16 +105,11 @@
if (this.list.length < this.total) {
this.ishave();
} else {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 1000
// });
this.$refs.uToast.show({
title: '没有更多蜂场了',
type: 'default',
position:'bottom'
})
this.$refs.uToast.show({
title: '没有更多蜂场了',
type: 'default',
position:'bottom'
})
}
},
addApiary() {
@ -129,26 +124,23 @@
};
this.$u.get('/farm/apiary/list', data).then((res) => {
if (res.code === 200) {
this.total = res.total;
this.total = res.total
if (this.total < 1) {
this.logoflag = true;
this.logoflag = true
} else {
if (this.pagesum > 1) {
this.list = this.list.concat(res.rows)
} else {
this.list = res.rows
}
this.pagesum++;
this.logoflag = false;
// console.log(this.list);
this.pagesum++
this.logoflag = false
}
} else {
this.logoflag = true
}
})
},
}
}
</script>
@ -157,18 +149,14 @@
page {
background-color: #FAFDFD;
}
.page {
// position: relative;
width: 750rpx;
.Apiary_box {
padding-left: 40rpx;
box-sizing: border-box;
padding-bottom: 230rpx;
overflow-y: auto;
height: 78vh;
.Apiary_card {
margin-top: 20rpx;
position: relative;
@ -178,13 +166,11 @@
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
image {
width: 674rpx;
height: 360rpx;
border-radius: 20rpx 20rpx 0 0;
}
.address {
margin-top: 18rpx;
padding: 0 24rpx;
@ -197,7 +183,6 @@
/* 超出部分隐藏 */
text-overflow: ellipsis;
}
.info {
margin-top: 18rpx;
padding: 0 24rpx;
@ -205,20 +190,17 @@
align-items: center;
flex-wrap: nowrap;
justify-content: space-between;
.left {
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
}
.right {
font-weight: 600;
font-size: 32rpx;
color: #50565A;
}
}
.weather {
padding: 20rpx 24rpx;
position: absolute;
@ -230,19 +212,16 @@
width: 674rpx;
height: 70rpx;
background-color: rgba(255, 255, 255, 0.5);
image {
width: 44rpx;
height: 44rpx;
}
.txt1 {
margin-left: 16rpx;
font-weight: 600;
font-size: 32rpx;
color: #3d3d3d;
}
.txt2 {
margin-left: 28rpx;
font-weight: 600;
@ -252,16 +231,13 @@
}
}
}
.top_box {
margin: 42rpx auto;
display: flex;
flex-wrap: nowrap;
width: 664rpx;
align-items: center;
.search {
display: flex;
flex-wrap: nowrap;
align-items: center;
@ -271,26 +247,18 @@
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx;
image {
width: 35.97rpx;
height: 35.97rpx;
}
.search_center {
margin-left: 34rpx;
width: 480rpx;
.ips {
//
width: 100%; //
// border: 1px solid #ccc; //
// placeholder
}
.my-placeholder {
font-weight: 400;
font-size: 32rpx;
@ -298,25 +266,21 @@
}
}
}
.add {
margin-left: 30rpx;
width: 66rpx;
height: 66rpx;
}
}
.no_cont {
margin: 152rpx auto 0;
width: 432rpx;
.img {
image {
width: 432rpx;
height: 432rpx;
}
}
.txt {
margin-top: 50rpx;
width: 100%;
@ -326,9 +290,5 @@
color: #808080;
}
}
}
</style>

View File

@ -70,13 +70,8 @@
code: '',
fengzhong:'',
miyuan:'',
fengzhongcolumns: [
],
miyuancolumns: [
],
fengzhongcolumns: [],
miyuancolumns: [],
showfengzhong:false,
showmiyuan:false,
form: {
@ -89,7 +84,6 @@
beeType:'',
honeyType:''
},
userImgs: '',
token: '',
sn:'',
@ -263,20 +257,20 @@
chooseAddress() {
uni.chooseLocation({
success: (res) => {
console.log(res);
console.log(res)
let address = res.address;
let regex = /^([\u4e00-\u9fa5]+省)([\u4e00-\u9fa5]+市)([\u4e00-\u9fa5]+市|[\u4e00-\u9fa5]+区)(.*)/;
let match = address.match(regex);
let regex = /^([\u4e00-\u9fa5]+省)([\u4e00-\u9fa5]+市)([\u4e00-\u9fa5]+市|[\u4e00-\u9fa5]+区)(.*)/
let match = address.match(regex)
if (match && match.length > 3) {
let province = match[1];
let city = match[2];
let district = match[3];
let province = match[1]
let city = match[2]
let district = match[3]
this.form.province = province
this.form.city = city
this.form.county = district
// console.log(this.form);
// console.log(this.form)
} else {
console.log('地址格式不匹配或无法提取省市区信息');
console.log('地址格式不匹配或无法提取省市区信息')
}
this.form.lng = res.longitude
this.form.lat = res.latitude
@ -290,7 +284,7 @@
icon: 'none'
})
} else {
console.log('选择位置失败', err);
console.log('选择位置失败', err)
//
}
},
@ -307,7 +301,6 @@
.page {
padding-bottom: 200rpx;
// position: relative;
width: 750rpx;
.btn{
position: fixed;

View File

@ -266,14 +266,14 @@
}
},
updateWordCount() {
this.currentCount = this.textValue.trim().replace(/\s+/g, '').length;
this.currentCount = this.textValue.trim().replace(/\s+/g, '').length
},
getQiniuToken() {
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
if (res.code == 200) {
this.token = res.token
}
});
})
},
btn() {
let _this = this

View File

@ -168,9 +168,7 @@
频率
</view>
</view>
</view>
</view>
</view>
</scroll-view>

View File

@ -202,18 +202,12 @@
onShow() {
this.getuserinfo()
setTimeout(() => {
}, 1500);
const now = new Date();
const previousDay = new Date(now)
this.yeartime.year = now.getFullYear()
this.yeartime.month = String(previousDay.getMonth() + 1).padStart(2, '0')
this.yeartime.day = String(now.getDate()).padStart(2, '0')
previousDay.setDate(now.getDate() - 7)
this.yeartimes.year = previousDay.getFullYear()
this.yeartimes.month = String(previousDay.getMonth() + 1).padStart(2, '0')
@ -251,7 +245,6 @@
} else if (res.code == 10003) {
taht.logoflag = true
}
// console.log(res,10003);
})
}
},
@ -268,8 +261,6 @@
this.gettj()
this.getyj()
} else {
// uni.navigateTo({
// url:
// })
@ -356,29 +347,24 @@
// console.log(e, 'aaaa');
},
getnum() {
const currentDate = new Date();
const currentDate = new Date()
//
const sevenDaysAgoDate = new Date();
sevenDaysAgoDate.setDate(currentDate.getDate() - 7);
sevenDaysAgoDate.setDate(currentDate.getDate() - 7)
// 'YYYY-MM-DD'
const formatDate = (date) => {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
};
const currentDateString = formatDate(currentDate);
const sevenDaysAgoDateString = formatDate(sevenDaysAgoDate);
const year = date.getFullYear()
const month = (date.getMonth() + 1).toString().padStart(2, '0')
const day = date.getDate().toString().padStart(2, '0')
return `${year}-${month}-${day}`
}
const currentDateString = formatDate(currentDate)
const sevenDaysAgoDateString = formatDate(sevenDaysAgoDate)
// data dateRange
let data = {
dateRange: `${sevenDaysAgoDateString},${currentDateString}`
};
this.$u.get('/farmer/report/ioCount?', data).then((res) => {
if (res.code === 200) {
this.numdata = res.data
this.$refs.canvas4.init(this.initChart4)
@ -387,35 +373,29 @@
title: res.msg,
icon: 'none',
duration: 2000
});
})
}
})
},
getnums() {
const currentDate = new Date();
const currentDate = new Date()
//
const sevenDaysAgoDate = new Date();
sevenDaysAgoDate.setDate(currentDate.getDate() - 7);
const sevenDaysAgoDate = new Date()
sevenDaysAgoDate.setDate(currentDate.getDate() - 7)
// 'YYYY-MM-DD'
const formatDate = (date) => {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
};
const currentDateString = formatDate(currentDate);
const sevenDaysAgoDateString = formatDate(sevenDaysAgoDate);
const year = date.getFullYear()
const month = (date.getMonth() + 1).toString().padStart(2, '0')
const day = date.getDate().toString().padStart(2, '0')
return `${year}-${month}-${day}`
}
const currentDateString = formatDate(currentDate)
const sevenDaysAgoDateString = formatDate(sevenDaysAgoDate)
// data dateRange
let data = {
dateRange: `${sevenDaysAgoDateString},${currentDateString}`
};
}
this.$u.get('/farmer/report/weightDay?', data).then((res) => {
if (res.code === 200) {
this.numdatas = res.data
this.$refs.canvas3.init(this.initChart3)
@ -424,15 +404,13 @@
title: res.msg,
icon: 'none',
duration: 2000
});
})
}
})
},
//
initChart4(canvas, width, height, canvasDpr) {
let that = this
const option = {
grid: {
left: '4%',
@ -645,7 +623,6 @@
chart.setOption(option)
return chart
},
//
}

View File

@ -34,6 +34,9 @@
<button class="button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" >
授权登录
</button>
<view class="button" style="text-align: center;background-color: transparent;border: 1px solid #FFF5D6;margin-top: 80rpx;color: #FFF5D6;" @click="btnname">
手机号登录
</view>
<!-- <view class="yinsi">
<u-checkbox-group>
<u-checkbox v-model="checked" shape="circle" size="28"></u-checkbox>
@ -86,6 +89,12 @@
}
},
methods: {
//
btnname(){
uni.navigateTo({
url:'/pages/login/logoyzm'
})
},
chck(){
if(this.type==0){
uni.showToast({
@ -115,38 +124,38 @@
// duration: 1000
// })
// }else{
let that = this;
console.log("eeeeeeee", e);
let that = this
console.log("eeeeeeee", e)
const wxLoginAsync = () => {
return new Promise((resolve, reject) => {
wx.login({
success(res) {
if (res.code) {
console.log('登录!', res);
console.log('登录!', res)
let data = {
loginCode: res.code,
type: that.type,
mobileCode: e.detail.code,
deptId:100,
};
resolve(data);
resolve(data)
} else {
reject(res.errMsg);
reject(res.errMsg)
}
},
fail(err) {
reject(err);
reject(err)
}
});
});
};
})
})
}
wxLoginAsync()
.then(async (data) => {
this.$u.post("/app/auth/wxLogin",data).then((res) => {
// this.$forceUpdate()
if (res.code == 200) {
console.log(res,'resres');
wx.setStorageSync('token', res.token);
console.log(res,'resres')
wx.setStorageSync('token', res.token)
that.ceshi()
}else{
uni.showToast({
@ -155,22 +164,21 @@
duration: 1000
});
}
});
})
})
.catch((err) => {
console.error(err);
console.error(err)
});
// }
},
async ceshi() {
this.$u.get("/app/user/userInfo").then((res) => {
console.log('进入跳转');
console.log('进入跳转')
uni.switchTab({
url: '/pages/index/index'
})
});
})
},
}
}
@ -223,7 +231,6 @@
background: #FFF5D6;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.15);
border-radius: 30rpx 30rpx 30rpx 30rpx;
.img{
width: 208rpx;
image{
@ -237,9 +244,7 @@
font-size: 40rpx;
color: #3D3D3D;
}
}
}
.act1{
background: #FFE593;
@ -253,14 +258,12 @@
height: 86rpx;
background: #FFE47F;
border-radius: 16rpx 16rpx 16rpx 16rpx;
font-weight: 500;
font-size: 36rpx;
color: #FFFFFF;
}
}
.page2{
.img_box{
margin-top: 250rpx;
margin-left: 86rpx;
@ -284,11 +287,5 @@
color: #FFC107;
}
}
}
</style>

189
pages/login/logoyzm.vue Normal file
View File

@ -0,0 +1,189 @@
<template>
<view class="page">
<image src="https://api.ccttiot.com/smartmeter/img/static/usgI7U9TVKyLc2LJUCIV" mode="" class="bjimg"></image>
<view class="name">
欢迎来到
</view>
<view class="name">
创特智慧封箱
</view>
<view class="tab">
<view @click="btn(1)" :class="indextab == 1 ? 'active' : ''">验证码登录 <view :class="indextab == 1 ? 'actives' : ''"></view> </view>
<view @click="btn(2)" :class="indextab == 2 ? 'active' : ''">密码登录 <view :class="indextab == 2 ? 'actives' : ''"></view> </view>
</view>
<!-- 验证码 -->
<view class="yzm">
<view class="tel">
<input type="text" placeholder="手机号"/>
</view>
<view class="telyzm">
<input type="text" placeholder="验证码"/>
<view class="huoquyzm">
获取验证码
</view>
</view>
</view>
<!-- 密码登录-->
<view class="ljdl">
立即登录
</view>
<view class="qita">
其他登录方式
</view>
<view class="shouquan">
<image src="https://api.ccttiot.com/smartmeter/img/static/ueYnGOxy812cY5hWLMfe" mode=""></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "",
},
indextab:1
}
},
methods: {
//
btn(num){
this.indextab = num
}
}
}
</script>
<style lang="scss">
.active{
font-size: 36rpx;
color: #3D3D3D;
font-weight: 600;
}
.actives{
display: block !important;
}
page{
padding-top: 224rpx;
box-sizing: border-box;
padding-left: 54rpx;
padding-right: 54rpx;
.shouquan{
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 132rpx;
image{
width: 64rpx;
height: 64rpx;
}
}
.qita{
width: 100%;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 226rpx;
text-align: center;
font-size: 32rpx;
color: #808080;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 226rpx;
}
.ljdl{
width: 650rpx;
height: 108rpx;
background: linear-gradient( 90deg, #FFCF3E 0%, #FFB300 100%), #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
text-align: center;
line-height: 108rpx;
font-size: 36rpx;
color: #FFFFFF;
margin-top: 120rpx;
width: 100%;
margin: auto;
margin-top: 226rpx;
}
.yzm{
.tel{
width: 650rpx;
height: 108rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 70rpx;
line-height: 108rpx;
padding-left: 38rpx;
padding-right: 38rpx;
box-sizing: border-box;
input{
width: 100%;
height: 108rpx;
line-height: 108rpx;
}
}
.telyzm{
width: 650rpx;
height: 108rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 70rpx;
line-height: 108rpx;
padding-left: 38rpx;
padding-right: 38rpx;
box-sizing: border-box;
display: flex;
justify-content: space-between;
.huoquyzm{
font-size: 32rpx;
color: #FFBF00;
}
input{
height: 108rpx;
line-height: 108rpx;
}
}
}
.name{
font-size: 44rpx;
color: #3D3D3D;
font-weight: 600;
}
.tab{
margin-top: 80rpx;
display: flex;
view{
font-size: 36rpx;
color: #50565A;
margin-right: 78rpx;
position: relative;
text-align: center;
view{
width: 88rpx;
height: 16rpx;
background: #FFCC25;
border-radius: 13rpx 13rpx 13rpx 13rpx;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: -2;
z-index: -1;
display: none;
}
}
}
}
.bjimg{
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: -1;
}
</style>

View File

@ -501,9 +501,7 @@
page {
background-color: #FAFDFD;
}
.page {
// position: relative;
width: 750rpx;
//
.fxtan {
@ -561,49 +559,40 @@
}
}
}
.fctq {
margin-top: 20rpx;
font-size: 28rpx;
display: flex;
color: #3D3D3D;
view {
margin-right: 40rpx;
}
}
.fcdz {
font-size: 32rpx;
color: #808080;
margin-top: 20rpx;
text {
margin-right: 10rpx;
}
}
.fcbh {
font-weight: 600;
font-size: 32rpx;
color: #3D3D3D;
}
.fctop {
display: flex;
justify-content: space-between;
.fclt {
display: flex;
align-items: center;
.fctit {
font-weight: 600;
font-size: 40rpx;
color: #3D3D3D;
margin-right: 32rpx;
}
.fcry {
width: 90rpx;
height: 42rpx;
@ -614,24 +603,19 @@
color: #FFFFFF;
text-align: center;
}
image {
width: 64rpx;
height: 64rpx;
margin-right: 28rpx;
}
}
.fcrt {
// font-weight: 600;
font-size: 64rpx;
padding-bottom: 10rpx;
box-sizing: border-box;
}
}
}
//
.fctan {
position: fixed;
@ -688,49 +672,40 @@
}
}
}
.fctq {
margin-top: 20rpx;
font-size: 28rpx;
display: flex;
color: #3D3D3D;
view {
margin-right: 40rpx;
}
}
.fcdz {
font-size: 32rpx;
color: #808080;
margin-top: 20rpx;
text {
margin-right: 10rpx;
}
}
.fcbh {
font-weight: 600;
font-size: 32rpx;
color: #3D3D3D;
}
.fctop {
display: flex;
justify-content: space-between;
.fclt {
display: flex;
align-items: center;
.fctit {
font-weight: 600;
font-size: 40rpx;
color: #3D3D3D;
margin-right: 32rpx;
}
.fcry {
width: 90rpx;
height: 42rpx;
@ -741,31 +716,24 @@
color: #FFFFFF;
text-align: center;
}
image {
width: 64rpx;
height: 64rpx;
margin-right: 28rpx;
}
}
.fcrt {
// font-weight: 600;
font-size: 64rpx;
padding-bottom: 10rpx;
box-sizing: border-box;
}
}
}
.fxtongji {
position: fixed;
top: 15vh;
right: 50rpx;
z-index: 99;
.one {
display: flex;
align-items: center;
@ -773,25 +741,21 @@
padding: 4rpx 20rpx;
box-sizing: border-box;
border-radius: 30rpx;
.wz {
color: #3D3D3D;
font-size: 32rpx;
margin: 0 15rpx;
font-weight: 600;
}
.shu {
color: #FFC107;
font-size: 32rpx;
}
image {
width: 44rpx;
height: 44rpx;
}
}
.two {
display: flex;
align-items: center;
@ -800,33 +764,25 @@
padding: 4rpx 20rpx;
box-sizing: border-box;
border-radius: 30rpx;
.wz {
color: #3D3D3D;
font-size: 32rpx;
margin: 0 15rpx;
font-weight: 600;
}
.shu {
color: #FFC107;
font-size: 32rpx;
}
image {
width: 44rpx;
height: 44rpx;
}
}
}
.map {
width: 750rpx;
height: 100vh;
}
}
</style>

View File

@ -169,7 +169,7 @@
position: fixed;
top: 200rpx;
right: 20px;
background-color: #FFC107;
background-color: #ce9e10;
}
page {
background-color: #FAFDFD;