111开关

This commit is contained in:
3321822538@qq.com 2024-09-26 17:39:42 +08:00
parent 15ba5021ca
commit 522ddda955
8 changed files with 203 additions and 171 deletions

View File

@ -19,8 +19,8 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.2.81:10002', baseUrl: 'http://192.168.2.81:10002',
baseUrl: 'https://kg.chuangtewl.com/prod-api', // baseUrl: 'https://kg.chuangtewl.com/prod-api',
// loadingText: '努力加载中~', // loadingText: '努力加载中~',
// loadingTime: 1000, // loadingTime: 1000,
// 设置自定义头部content-type // 设置自定义头部content-type

View File

@ -89,7 +89,7 @@
.cont { .cont {
position: fixed; position: fixed;
left: 60rpx; left: 60rpx;
bottom: 78rpx; bottom: 58rpx;
width: 632rpx; width: 632rpx;
height: 128rpx; height: 128rpx;
background: #FFFFFF; background: #FFFFFF;

View File

@ -286,8 +286,6 @@
this.$u.put(`/app/bill/${this.id}/refreshPayResult`).then(res => { this.$u.put(`/app/bill/${this.id}/refreshPayResult`).then(res => {
this.getDevice() this.getDevice()
}) })
// this.getDevice(id)
// console.log(option);
if (option.flag) { if (option.flag) {
this.opflag = option.flag this.opflag = option.flag
} }

View File

@ -39,7 +39,7 @@
变动金额 变动金额
</view> </view>
<view class="text" style="color: #8883F0;font-size: 60rpx;"> <view class="text" style="color: #8883F0;font-size: 60rpx;">
{{list.amount}} {{list.amount == undefined ? '--' : list.amount}}
</view> </view>
</view> </view>
</view> </view>
@ -51,7 +51,7 @@
变动日期 变动日期
</view> </view>
<view class="text"> <view class="text">
{{list.createTime}} {{list.createTime == undefind ? '--' : list.createTime}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
@ -59,7 +59,7 @@
变动前余额 变动前余额
</view> </view>
<view class="text"> <view class="text">
{{list.beforeBalance}} {{list.beforeBalance == undefind ? '--' : list.beforeBalance}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
@ -67,7 +67,7 @@
变动后余额 变动后余额
</view> </view>
<view class="text"> <view class="text">
{{list.afterBalance}} {{list.afterBalance == undefind ? '--' : list.afterBalance}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
@ -75,16 +75,16 @@
用户名称 用户名称
</view> </view>
<view class="text"> <view class="text">
{{list.userName}} {{list.userName == undefind ? '--' : list.userName}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
<view class="text"> <view class="text" style="width: 120rpx;">
变动原因 变动原因
</view> </view>
<view class="text"> <view class="text">
{{list.reason}} {{list.reason == undefind ? '--' : list.reason}}
</view> </view>
</view> </view>
</view> </view>

View File

@ -182,7 +182,7 @@
<view class="tit">请输入您需要充值的时长或度数</view> <view class="tit">请输入您需要充值的时长或度数</view>
<input type="number" :focus="focus" v-model="cztime" placeholder="请输入时长或度数" /> <input type="number" :focus="focus" v-model="cztime" placeholder="请输入时长或度数" />
<input type="text" placeholder="请选择单位时长或度数" v-model="danwei" disabled="false" @click="showflag = true" /> <input type="text" placeholder="请选择单位时长或度数" v-model="danwei" disabled="false" @click="showflag = true" />
<u-icon name="arrow-down" style="position: fixed;top: 230rpx;right: 60rpx;" color="#999" size="28"></u-icon> <u-icon name="arrow-down" style="position: fixed;top: 234rpx;right: 60rpx;" color="#999" size="28"></u-icon>
<view class="xian"></view> <view class="xian"></view>
<view class="anniu"> <view class="anniu">
<text @click="btnqx">取消</text> <text style="border-left: 1px solid #eee;color: #8883F0;" <text @click="btnqx">取消</text> <text style="border-left: 1px solid #eee;color: #8883F0;"
@ -1731,7 +1731,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-left: 19rpx; margin-left: 10rpx;
padding: 0 10rpx; padding: 0 10rpx;
box-sizing: border-box; box-sizing: border-box;

View File

@ -68,10 +68,15 @@
<!-- 修改密码 --> <!-- 修改密码 -->
<view class="zhangh" v-if="pwdflag"> <view class="zhangh" v-if="pwdflag">
<view class="" style="margin-top: 30rpx;">
<input type="password" v-model="oldmm" placeholder="请输入您的旧密码(首次修改可忽略)" /> <u-input v-model="oldmm" :type="onetype" :border="border" placeholder="请输入您的旧密码(首次修改可忽略)" :password-icon="passwordIcon" />
<input type="password" v-model="newmm" placeholder="请输入您的新密码" /> </view>
<input type="password" v-model="qrmm" placeholder="请确认新密码" /> <view class="" style="margin-top: 30rpx;">
<u-input v-model="newmm" :type="twotype" :border="bordertwo" placeholder="请输入您的新密码" :password-icon="passwordIcontwo" />
</view>
<view class="" style="margin-top: 30rpx;">
<u-input v-model="qrmm" :type="thrtype" :border="borderthr" placeholder="请确认新密码" :password-icon="passwordIconthr" />
</view>
<view class="mmdl" @click="btndl"> <view class="mmdl" @click="btndl">
确认修改 确认修改
</view> </view>
@ -79,61 +84,6 @@
取消 取消
</view> </view>
</view> </view>
<view class="card" style="margin-top: 26rpx;" v-if='false'>
<view class="li">
<view class="tit">
常见问题
</view>
<view class="info">
<view class="iconfont icon-xiangyou1"></view>
</view>
</view>
<view class="li" style="border-bottom: #fff solid 2rpx;">
<view class="tit">
意见反馈
</view>
<view class="info">
<view class="iconfont icon-xiangyou1"></view>
</view>
</view>
</view>
<u-mask :show="showloading"></u-mask>
<view class="fz" v-show="showfz">
<view class="fz_top">
<view class="iconfont icon-shanchu">
</view>
<view class="tit">
设备分组
</view>
<view class="txt">
管理
</view>
</view>
<view class="card_cont">
<view class="cards" v-for="item in 10" :key="item">
<view class="txt">
全部
</view>
<view class="num">
1
</view>
</view>
<view class="zhanwei" style="width: 100%;height: 100rpx;">
</view>
</view>
</view>
<view class="dd">
<u-select v-model="show" :list="list" title='角色切换' @confirm="confirm"></u-select>
</view>
</view> </view>
</template> </template>
@ -142,6 +92,17 @@
export default { export default {
data() { data() {
return { return {
onetype: 'password',
passwordIcon: true,
border: true,
twotype: 'password',
passwordIcontwo: true,
bordertwo: true,
thrtype: 'password',
passwordIconthr: true,
borderthr: true,
thrpwd:'password',
twopwd:'password',
oldmm:'', oldmm:'',
newmm:'', newmm:'',
qrmm:'', qrmm:'',
@ -186,6 +147,28 @@
} }
}, },
methods: { methods: {
onepwdpassword(){
this.onepwd = 'password'
},
onepwdtext(){
this.onepwd = 'text'
},
twopwdpassword(){
this.twopwd = 'password'
},
twopwdtext(){
this.twopwd = 'text'
},
thrpwdpassword(){
this.thrpwd = 'password'
},
thrpwdtext(){
this.thrpwd = 'text'
},
// //
btnxg(){ btnxg(){
this.pwdflag = true this.pwdflag = true
@ -292,7 +275,7 @@
/deep/ .u-title{ /deep/ .u-title{
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
/deep/ .u-icon__icon{ /deep/ .uicon-nav-back{
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
page { page {
@ -308,26 +291,15 @@
color: #000; color: #000;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
input{
width: 562rpx;
height: 90rpx;
margin-top: 20rpx;
border-radius: 20rpx;
background-color: #eeefee;
text-align: center;
padding-left: 30rpx;
box-sizing: border-box;
text-align: left;
}
.mmdl{ .mmdl{
width: 562rpx; width: 562rpx;
height: 96rpx; height: 80rpx;
background: #8883F0; background: #8883F0;
border-radius: 52rpx 52rpx 52rpx 52rpx; border-radius: 52rpx 52rpx 52rpx 52rpx;
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FFFFFF; color: #FFFFFF;
line-height: 96rpx; line-height: 80rpx;
margin-top: 50rpx; margin-top: 50rpx;
} }
} }

View File

@ -23,54 +23,67 @@
<view class="buttons" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnshoudong"> <view class="buttons" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnshoudong">
账号密码登录 账号密码登录
</view> </view>
<!-- <view class="buttons" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnyzm"> <!-- <view class="buttons" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnyzm">
验证码登录 验证码登录
</view> --> </view> -->
<view class="buttons" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnbudl"> <view class="buttons" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnbudl">
暂不授权登录 暂不授权登录
</view> </view>
</view> </view>
</view> </view>
<!-- 账号密码登录 --> <!-- 账号密码登录 -->
<view class="zhangh" v-if="dlflag"> <view class="zhangh" v-if="dlflag">
<view class="tit"> <view class="tit">
账号密码登录 账号密码登录
</view> </view>
<input type="text" v-model="zh" placeholder="请输入你的账号" /> <!-- <input type="text" v-model="zh" placeholder="请输入你的账号" /> -->
<input type="password" v-model="mm" placeholder="请输入你的密码" /> <view class="" style="margin-top: 30rpx;">
<u-input v-model="zh" :border="border" placeholder="请输入你的账号" />
</view>
<view class="" style="margin-top: 30rpx;">
<u-input v-model="mm" :type="onetype" :border="border" placeholder="请输入你的密码"
:password-icon="passwordIcon" />
</view>
<view class="mmdl" @click="btndl"> <view class="mmdl" @click="btndl">
登录 登录
</view> </view>
<view class="mmdl" @click="btnqx(1)" style="background-color: #fff;border: 1px solid #efefef;color: #000;margin-top: 20rpx;"> <view class="mmdl" @click="btnqx(1)"
style="background-color: #fff;border: 1px solid #efefef;color: #000;margin-top: 20rpx;">
取消 取消
</view> </view>
</view> </view>
<!-- 验证码登录 --> <!-- 验证码登录 -->
<view class="zhangh" v-if="yzmflag"> <view class="zhangh" v-if="yzmflag">
<view class="tit"> <view class="tit">
验证码登录 验证码登录
</view> </view>
<input type="text" v-model="zh" placeholder="请输入你的账号" /> <view class="" style="margin-top: 30rpx;">
<view class="" style="display: flex;"> <u-input v-model="zh" :border="border" placeholder="请输入你的账号" />
<input style="width: 380rpx;margin-right: 20rpx;" type="password" v-model="mm" placeholder="请输入你的验证码" />
<view class="" style="height: 90rpx;
margin-top: 20rpx;
width: 180rpx;
color: #333;
background-color: #eeefee;text-align: center;line-height: 90rpx;">发送验证码</view>
</view> </view>
<view class="" style="margin-top: 30rpx;display: flex;align-items: center;justify-content: space-between;">
<u-input v-model="yzm" :border="border" placeholder="请输入验证码" />
<u-toast ref="uToast"></u-toast>
<u-verification-code :seconds="seconds" @start="start" ref="uCode"
@change="codeChange"></u-verification-code>
<u-button @click="getCode">{{tips}}</u-button>
</view>
<view class="mmdl" @click="btndl"> <view class="mmdl" @click="btndl">
登录 登录
</view> </view>
<view class="mmdl" @click="btnqx(2)" style="background-color: #fff;border: 1px solid #efefef;color: #000;margin-top: 20rpx;"> <view class="mmdl" @click="btnqx(2)"
style="background-color: #fff;border: 1px solid #efefef;color: #000;margin-top: 20rpx;">
取消 取消
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -79,6 +92,12 @@
export default { export default {
data() { data() {
return { return {
tips: '',
seconds: 60,
onetype: 'password',
passwordIcon: true,
border: true,
twopwd: 'password',
bgc: { bgc: {
backgroundColor: "#7D86EF", backgroundColor: "#7D86EF",
}, },
@ -86,47 +105,74 @@
chooseType: true, chooseType: true,
usertype: '', usertype: '',
login: false, login: false,
id:'', id: '',
dlflag:false, dlflag: false,
zh:'', zh: '',
mm:'', mm: '',
yzmflag:false, yzm: '',
syflag:true yzmflag: false,
syflag: true
} }
}, },
onLoad(option) { onLoad(option) {
if(option.id){ if (option.id) {
this.id = option.id this.id = option.id
} }
}, },
// //
onShareAppMessage: function () { onShareAppMessage: function() {
return { return {
title: '创想物联', title: '创想物联',
path: '/pages/shouye/index' path: '/pages/shouye/index'
} }
}, },
// //
onShareTimeline: function () { onShareTimeline: function() {
return { return {
title: '创想物联', title: '创想物联',
query: '', query: '',
path: '/pages/shouye/index' path: '/pages/shouye/index'
} }
}, },
methods: { methods: {
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
this.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 1000);
} else {
this.$u.toast('验证码已发送');
}
},
start() {
this.$u.toast('验证码已发送');
},
// //
btndl(){ btndl() {
let data = { let data = {
username:this.zh, username: this.zh,
password:this.mm password: this.mm
} }
this.$u.post("/app/auth/login", data).then(res => { this.$u.post("/app/auth/login", data).then(res => {
if(res.code == 200){ if (res.code == 200) {
wx.setStorageSync('token', res.token); wx.setStorageSync('token', res.token);
this.ceshi() this.ceshi()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -135,20 +181,20 @@
} }
}) })
}, },
btnqx(num){ btnqx(num) {
if(num == 1){ if (num == 1) {
this.dlflag = false this.dlflag = false
this.syflag = true this.syflag = true
}else{ } else {
this.yzmflag = false this.yzmflag = false
this.syflag = true this.syflag = true
} }
}, },
btnyzm(){ btnyzm() {
this.yzmflag = true this.yzmflag = true
this.syflag = false this.syflag = false
}, },
btnshoudong(){ btnshoudong() {
this.dlflag = true this.dlflag = true
this.syflag = false this.syflag = false
}, },
@ -166,7 +212,8 @@
console.log("eeeeeeee", e); console.log("eeeeeeee", e);
const wxLoginAsync = () => { const wxLoginAsync = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.login({success(res) { wx.login({
success(res) {
if (res.code) { if (res.code) {
let data = { let data = {
loginCode: res.code, loginCode: res.code,
@ -176,36 +223,37 @@
} else { } else {
reject(res.errMsg) reject(res.errMsg)
} }
},fail(err) { },
fail(err) {
reject(err) reject(err)
} }
}) })
}) })
} }
wxLoginAsync().then(async (data) => { wxLoginAsync().then(async (data) => {
this.$u.post("/app/auth/wxLogin", data).then((res) => { this.$u.post("/app/auth/wxLogin", data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
wx.setStorageSync('token', res.token); wx.setStorageSync('token', res.token);
that.ceshi() that.ceshi()
} }
})
}).catch((err) => {
console.error(err)
}) })
}).catch((err) => {
console.error(err)
})
}, },
async ceshi() { async ceshi() {
this.$u.get("/app/user/userInfo").then((res) => { this.$u.get("/app/user/userInfo").then((res) => {
if(this.id == 1){ if (this.id == 1) {
uni.navigateBack() uni.navigateBack()
}else{ } else {
uni.reLaunch({ uni.reLaunch({
url: '/pages/shouye/index' url: '/pages/shouye/index'
}) })
} }
}) })
}, },
btnbudl(){ btnbudl() {
uni.reLaunch({ uni.reLaunch({
url: '/pages/shouye/index' url: '/pages/shouye/index'
}) })
@ -215,47 +263,60 @@
</script> </script>
<style lang="scss"> <style lang="scss">
/deep/ .u-size-default{
height: 37px !important;
line-height: 35px !important;
margin-left: 10rpx;
}
/deep/ .u-btn{
padding: 0 20rpx !important;
}
page { page {
background: #FFFFFF; background: #FFFFFF;
} }
.zhangh{
.zhangh {
width: 562rpx; width: 562rpx;
text-align: center; text-align: center;
.tit{
.tit {
font-size: 40rpx; font-size: 40rpx;
color: #000; color: #000;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
input{
// input{
// width: 562rpx;
// height: 90rpx;
// margin-top: 20rpx;
// border-radius: 20rpx;
// background-color: #eeefee;
// text-align: center;
// padding-left: 30rpx;
// box-sizing: border-box;
// text-align: left;
// }
.mmdl {
width: 562rpx; width: 562rpx;
height: 90rpx; height: 80rpx;
margin-top: 20rpx;
border-radius: 20rpx;
background-color: #eeefee;
text-align: center;
padding-left: 30rpx;
box-sizing: border-box;
text-align: left;
}
.mmdl{
width: 562rpx;
height: 96rpx;
background: #8883F0; background: #8883F0;
border-radius: 52rpx 52rpx 52rpx 52rpx; border-radius: 52rpx 52rpx 52rpx 52rpx;
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #FFFFFF; color: #FFFFFF;
line-height: 96rpx; line-height: 80rpx;
margin-top: 50rpx; margin-top: 50rpx;
} }
} }
.buttons{
.buttons {
width: 562rpx; width: 562rpx;
text-align: center; text-align: center;
padding-bottom: 5rpx; padding-bottom: 5rpx;
box-sizing: border-box; box-sizing: border-box;
color: #ccc; color: #ccc;
} }
.page { .page {
position: relative; position: relative;
/* 添加相对定位 */ /* 添加相对定位 */

View File

@ -55,7 +55,8 @@
</view> </view>
</view> </view>
</view> </view>
<view class="bot_box"> <view class="bot_box" style="max-height: 1000rpx;
overflow: scroll;">
<view class="botcard" @click="topage(0)"> <view class="botcard" @click="topage(0)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uATEvHAKIB0tdXk0embn" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uATEvHAKIB0tdXk0embn" mode=""></image>
<view class="txt">我的店铺</view> <view class="txt">我的店铺</view>
@ -90,7 +91,7 @@
<view class="txt">咨询客服</view> <view class="txt">咨询客服</view>
</view> </view>
<view class="botcard" @click="btntuichu"> <view class="botcard" @click="btntuichu">
<image src="https://api.ccttiot.com/smartmeter/img/static/uCtxeWyTyH2DHQZaRv5Q" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uHB7v39URI7EL8s9bSIC" mode=""></image>
<view class="txt">退出登录</view> <view class="txt">退出登录</view>
</view> </view>