初始化

This commit is contained in:
仲么了
2023-01-11 16:33:13 +08:00
commit 0ea48cd5b3
181 changed files with 25945 additions and 0 deletions

52
pages/index/index.vue Normal file
View File

@@ -0,0 +1,52 @@
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '灿能'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

104
pages/index/mine.vue Normal file
View File

@@ -0,0 +1,104 @@
<template>
<Comp-page :loading="loading">
<view class="mine">
<view class="mine-header" @click="jump('basic')">
<image mode="aspectFill" class="mine-header-head" src="/static/head.jpg" />
<view class="mine-header-name hide-txt">灿能电力</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('server')"
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c;">
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
<view class="mine-nav-label">客服</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('setup')" style="margin-top:20rpx;border-bottom: none; ">
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
<view class="mine-nav-label">设置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
</view>
</Comp-page>
</template>
<script>
export default {
data () {
return {
loading: false
}
},
methods: {
init () {
},
jump (type) {
switch (type) {
case 'login':
uni.navigateTo({
url: `/pages/login/login`
})
default:
uni.navigateTo({
url: `/pages/mine/${type}`
})
break;
}
}
},
onLoad () {
this.init()
},
}
</script>
<style lang="scss">
.mine {
.mine-header {
padding: 200rpx 34rpx 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 8rpx #e7e7e74c;
.mine-header-head {
margin-right: 30rpx;
height: 128rpx;
width: 128rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
.mine-header-name {
margin-right: 30rpx;
flex: 1;
font-size: 36rpx;
color: #111;
font-weight: 700;
}
}
.mine-nav {
padding: 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
border-bottom: 1rpx solid #e8e8e8;
&-icon {
margin-right: 30rpx;
height: 44rpx;
width: 44rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
&-label {
margin-right: 30rpx;
flex: 1;
font-size: 28rpx;
color: #111;
}
}
}
</style>

52
pages/index/report.vue Normal file
View File

@@ -0,0 +1,52 @@
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '灿能'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

110
pages/login/forget.vue Normal file
View File

@@ -0,0 +1,110 @@
<template>
<Cn-page :loading="loading">
<view slot="body">
<view class="index">
<!-- <uni-forms ref="form" :label-width="80" :modelValue="formData" :rules="rules">
<uni-forms-item label="漏打日期" name="missingDate" required>
<uni-datetime-picker type="date" return-type="string" v-model="formData.missingDate" />
</uni-forms-item>
<uni-forms-item label="补卡类别" name="multipleDhoice" required>
<uni-data-checkbox v-model="formData.multipleDhoice" :localdata="range" />
</uni-forms-item>
<uni-forms-item label="漏打卡原因" name="reasonsForMissingPunch" required>
<uni-data-checkbox v-model="formData.reasonsForMissingPunch" :localdata="range2" />
</uni-forms-item>
<uni-forms-item name="remarks" label="备注" required>
<uni-easyinput type="textarea" v-model="formData.remarks" placeholder="请输入" />
</uni-forms-item>
</uni-forms> -->
<!-- <uni-steps :options="list2" active-color="#007AFF" direction="column" /> -->
<button type="default" class="submit-btn" @click="submit">提交</button>
</view>
</view>
</Cn-page>
</template>
<script>
export default {
name: "jiaban",
data () {
return {
loading: false,
alias: "missingPunchApplication",
// 表单数据
formData: {
created: "",
createdId: "",
viewRecordList: [],
applicant: "",
createdDate: "",
applicantId: "",
applicationNo: "",
multipleDhoice: "",
reasonsForMissingPunch: "",
remarks: ""
},
defId: "",
list2: [],
range: [
{ value: "上午上班", text: "上午上班" },
{ value: "下午上班", text: "下午上班" }
],
// 漏打卡原因
range2: [
{ value: "忘记打卡", text: "忘记打卡" },
{ value: "机器故障", text: "机器故障" },
{ value: "因公外出", text: "因公外出" },
{ value: "指纹丢失", text: "指纹丢失" },
{ value: "其他", text: "其他" }
],
rules: {
missingDate: {
rules: [
{
required: true,
errorMessage: "请选择漏打日期"
}
]
},
multipleDhoice: {
rules: [
{
required: true,
errorMessage: "请填写补卡类别"
}
]
},
reasonsForMissingPunch: {
rules: [
{
required: true,
errorMessage: "请选择漏打卡原因"
}
]
},
remarks: {
rules: [
{
required: true,
errorMessage: "请填写备注"
}
]
}
}
};
},
onLoad () {
},
methods: {
}
};
</script>
<style lang="scss">
.index {
padding: 34rpx;
.submit-btn {
background: $uni-theme-blue;
color: #fff;
}
}
</style>

300
pages/login/login.vue Normal file
View File

@@ -0,0 +1,300 @@
<template>
<Cn-page :loading="loading">
<view slot="body">
<view class="login">
<view class="login-title">登录</view>
<view class="login-des">{{ companyName }}</view>
<view class="login-box">
<!-- <image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image> -->
<image class="login-box-logo" mode="widthFix" src="/static/logo2.png"></image>
<template v-if="loginType == 'yzm'">
<view class="login-box-input mt100">
<input class="login-box-input-main" v-model="yzmForm.phone" placeholder="请输入手机号" />
</view>
<!-- <view class="login-box-input mt40">
<input class="login-box-input-main" v-model="yzmForm.imgCode" placeholder="图形验证码" />
<view class="login-box-input-img"></view>
</view> -->
<view class="login-box-input mt40">
<input class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" />
<view class="ml40" style="font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
v-if="waitTime > 0">{{ waitTime + 's后重新获取' }}</view>
<button class="login-box-input-btn" v-else @click="getCode" size="mini">获取验证码</button>
</view>
</template>
<template v-else>
<view class="login-box-input mt100">
<input class="login-box-input-main" v-model="pwdForm.account" placeholder="请输入账号" />
</view>
<view class="login-box-input mt40">
<input type="password" class="login-box-input-main" v-model="pwdForm.pwd"
placeholder="请输入密码" />
</view>
<!-- <view class="login-box-input mt40">
<view class="login-box-input-icon"></view>
<input class="login-box-input-main" v-model="pwdForm.imgCode" placeholder="图形验证码" />
<view class="login-box-input-img"></view>
</view> -->
</template>
<view class="login-box-btn" @click="login"> 登录 </view>
<view class="login-box-footer">
<view @click="loginType = 'pwd'" v-if="loginType == 'yzm'">账号密码登录</view>
<view @click="loginType = 'yzm'" v-else>短信验证码登录</view>
<view style="flex:1"></view>
<navigator url="/pages/login/changePwd" hover-class="none">忘记密码</navigator>
<view style="margin:0 10px;color:#999">|</view>
<view>快速注册</view>
</view>
<view class="login-box-tips">
<view style="color:#999">点击登录即表示同意</view>
<view>用户协议</view>
<view>个人信息保护政策</view>
</view>
</view>
</view>
</view>
</Cn-page>
</template>
<script>
export default {
data () {
return {
loading: false,
loginType: 'pwd',
pwdForm: {
account: '',
pwd: '',
imgCode: '',
},
yzmForm: {
phone: '',
code: '',
imgCode: '',
},
waitTime: 0,
tenantId: '',
companyName: '',
}
},
components: {},
methods: {
getCode () {
this.waitTime = 60
this.inter = setInterval(() => {
if (this.waitTime == 0) {
clearInterval(this.inter)
} else {
this.waitTime--
}
}, 1000)
},
login () {
if (this.loginType == 'pwd') {
this.pwdLogin()
} else {
this.yzmLogin()
}
},
pwdLogin () {
if (!this.pwdForm.account && !this.pwdForm.pwd) {
return this.$util.toast('请填写登录信息!')
}
this.$request({
url: '/org/login/valid',
data: {
account: this.pwdForm.account.trim(),
password: this.pwdForm.pwd,
tenantId: this.tenantId,
},
method: 'POST',
}).then(res => {
uni.setStorageSync('login', true)
uni.setStorageSync('Authorization', res.data)
uni.setStorageSync('password', this.pwdForm.pwd)
uni.setStorageSync('account', this.pwdForm.account.trim())
this.$util.toast('登录成功!')
// #ifndef MP
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index',
})
}, 100);
// #endif
this.$util.loadConfig(() => { }, true)
// #ifdef MP
uni.login({
provider: 'weixin',
success: loginRes => {
console.log(loginRes)
this.$request({
url: '/org/wxxcx/login',
data: {
code: loginRes.code,
tenantId: this.tenantId,
},
method: 'POST',
}).then(res => {
this.$request({
url: '/org/wxxcx/bindUser',
data: {
account: this.pwdForm.account.trim(),
password: this.pwdForm.pwd,
openid: res.data.openid,
tenantId: this.tenantId,
},
method: 'POST'
}).then(res => {
uni.reLaunch({
url: '/pages/index/index',
})
})
})
},
})
// #endif
})
},
yzmLogin () {
if (!this.yzmForm.phone && !this.yzmForm.code) {
return this.$util.toast('请填写登录信息!')
}
this.$request({
url: '/org/login/valid',
data: {
account: this.yzmForm.phone.trim(),
code: this.yzmForm.code,
tenantId: this.tenantId,
},
method: 'POST',
}).then(res => {
uni.setStorageSync('Authorization', res.data)
this.$util.toast('登录成功!')
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index',
})
}, 1500)
})
},
},
onLoad (o) {
uni.removeStorageSync('Authorization')
if (o.alias) {
this.tenantId = o.alias
this.companyName = o.name
this.pwdForm.account = o.account
uni.setStorageSync('tenantId', this.tenantId)
uni.setStorageSync('companyName', this.companyName)
uni.setStorageSync('account', this.pwdForm.account)
} else {
this.tenantId = uni.getStorageSync('tenantId')
this.companyName = uni.getStorageSync('companyName')
this.pwdForm.account = uni.getStorageSync('account')
}
},
}
</script>
<style lang='scss'>
.login {
.login-title {
padding-left: 64rpx;
padding-top: 48rpx;
font-size: 56rpx;
font-weight: 600;
color: #111;
}
.login-des {
padding-left: 64rpx;
margin-top: 12rpx;
font-size: 28rpx;
color: #999;
}
.login-box {
display: flex;
flex-direction: column;
margin: 60rpx auto 0;
box-sizing: border-box;
width: 680rpx;
padding: 100rpx 40rpx;
border-radius: 40rpx;
background: #fff;
overflow: hidden;
.login-box-logo {
background: $uni-theme-blue;
height: 100rpx;
width: 100rpx;
margin: 0 auto;
}
.login-box-input {
height: 110rpx;
display: flex;
align-items: center;
border-bottom: 1rpx solid #f0f0f0;
.login-box-input-icon {
width: 40rpx;
margin-right: 40rpx;
}
.login-box-input-main {
font-size: 28rpx;
flex: 1;
height: 100rpx;
line-height: 100rpx;
}
.login-box-input-btn {
width: 200rpx;
margin-left: 40rpx;
background: $uni-theme-blue;
color: #fff;
}
.login-box-input-img {
margin-left: 40rpx;
background: skyblue;
height: 80rpx;
width: 200rpx;
}
}
.login-box-switch {
margin-top: 60rpx;
color: $uni-theme-blue;
font-size: 28rpx;
text-align: center;
}
.login-box-btn {
display: flex;
align-items: center;
justify-content: center;
margin-top: 80rpx;
width: 100%;
background: $uni-theme-blue;
color: #fff;
height: 80rpx;
border-radius: 12rpx;
}
.login-box-footer {
display: flex;
margin-top: 40rpx;
font-size: 28rpx;
color: $uni-theme-blue;
}
.login-box-tips {
margin-top: 60rpx;
display: flex;
justify-content: center;
font-size: 20rpx;
}
}
}
</style>

237
pages/login/platform.vue Normal file
View File

@@ -0,0 +1,237 @@
<template>
<Cn-page :loading="loading">
<view slot="body">
<view class="platform">
<view class="platform-bg"></view>
<!-- <view class="platform-title">全国特种设备无损检测公共服务云平台</view> -->
<view class="platform-des" v-if="list.length">当前手机号绑定单位</view>
<view class="platform-des" v-else>通过手机号获取单位</view>
<view class="platform-content" v-if="list.length">
<navigator
hover-class="none"
:url="'/pages/login/login?alias=' + item.alias + '&name=' + item.companyName + '&account=' + phone.trim()"
class="platform-content-card"
v-for="item in list"
:key="item.alias"
>
<view class="platform-content-card-title">{{ item.companyName }}</view>
<view class="platform-content-card-des">{{ item.alias }}</view>
</navigator>
<div style="height:280rpx"></div>
<view class="platform-footer iphone">
<view class="platform-footer-tips">以上不是您需访问的平台</view>
<view class="platform-footer-btn" @click="showPopup">输入智慧云手机号/账号</view>
</view>
</view>
<view class="platform-content center" v-else>
<view>
<view class="platform-footer-btn" @click="showPopup">输入智慧云手机号/账号</view>
<!-- #ifdef MP -->
<button
v-if="canGetPhoneNumber"
type="primary"
class="platform-footer-btn"
open-type="getPhoneNumber"
@getphonenumber="onGetUserPhone"
>本机号码一键获取</button>
<!-- <view
type="primary"
class="platform-footer-btn"
@click="wxLogin"
>微信一键登录</view> -->
<!-- #endif -->
</view>
</view>
<uni-popup ref="inputPhone" type="center" :animation="false">
<view class="input-box">
<input
type="text"
class="input-box-main"
placeholder-class="input-box-main-placeholder"
placeholder="请输入智慧云手机号/账号"
v-model="phone"
/>
<view class="input-box-btn">
<view class="input-box-btn-item" @click="cancel">取消</view>
<view class="input-box-btn-item" @click="load">确定</view>
</view>
</view>
</uni-popup>
</view>
</view>
</Cn-page>
</template>
<script>
export default {
data() {
return {
loading: false,
phone: "",
list: [],
canGetPhoneNumber: true
};
},
components: {},
methods: {
showPopup() {
this.$refs.inputPhone.open();
},
load() {
this.$request({
url: "/cloud/getPlatformByAccout",
data: {
accout: this.phone.trim()
},
method: "POST"
}).then(res => {
console.warn(res);
this.list = res.data;
this.$refs.inputPhone.close();
});
},
cancel() {
this.$refs.inputPhone.close();
},
onGetUserPhone(e) {
console.warn(e);
this.$request({
url: "/org/wxxcx/getPhoneNum",
data: {
code: e.detail.code,
},
method: "POST"
}).then(res=>{
let data = JSON.parse(res.data)
this.phone = data.phoneNumber
this.load()
})
}
},
onLoad() {
// #ifdef MP-WEIXIN
uni.hideHomeButton();
// #endif
}
};
</script>
<style lang='less'>
.platform {
position: relative;
z-index: 2;
.platform-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 320rpx;
background: skyblue;
z-index: -1;
}
.platform-title {
padding: 40rpx 20rpx 0;
font-size: 28rpx;
color: #fff;
}
.platform-des {
padding: 36rpx 20rpx 0;
font-size: 24rpx;
color: #fff;
}
.platform-content {
padding: 28rpx 20rpx;
font-size: 24rpx;
margin-top: 60rpx;
border-radius: 28rpx 28rpx 0 0;
min-height: 50vh;
background: #f5f6fa;
.platform-content-card {
margin-bottom: 20rpx;
padding: 33rpx 28rpx;
border-radius: 14rpx;
background: #fff;
.platform-content-card-title {
font-weight: 600;
font-size: 28rpx;
color: #111;
}
.platform-content-card-des {
font-size: 24rpx;
margin-top: 23rpx;
color: #999;
}
}
}
.platform-footer {
position: fixed;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 280rpx;
width: 100%;
background: #fff;
.platform-footer-tips {
font-size: 28rpx;
color: #000;
}
}
.platform-footer-btn {
margin: 0 auto;
height: 80rpx;
width: 480rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 40rpx;
background: #449dff;
font-size: 24rpx;
color: #fff;
border-radius: 40rpx;
overflow: hidden;
}
.input-box {
box-sizing: border-box;
padding: 80rpx 60rpx 0;
height: 400rpx;
width: 680rpx;
border-radius: 16rpx;
background: #fff;
.input-box-main {
box-sizing: border-box;
height: 80rpx !important;
line-height: 80rpx !important;
border-radius: 4rpx;
font-size: 28rpx;
color: #333;
padding: 0 40rpx;
margin-top: 40rpx;
background: #f9f9f9;
}
.input-box-btn {
margin-top: 80rpx;
display: flex;
justify-content: center;
.input-box-btn-item {
height: 64rpx;
width: 200rpx;
background: #449dff;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 24rpx;
border-radius: 8rpx;
}
.input-box-btn-item:first-of-type {
box-sizing: border-box;
margin-right: 37rpx;
background: #fff;
border: 1px solid #666666;
color: #666666;
}
}
}
}
</style>