wangyx 1 month ago
parent
commit
4593b52703
  1. 17
      App.vue
  2. 4
      pages.json
  3. 114
      pages/login/login.vue
  4. 8
      pages/tabBar/work/index.vue
  5. 7
      pages/tabBar/xjPage/xj.vue
  6. 23
      pagesA/checkout/detail/detail.vue
  7. 2
      pagesA/checkout/list/list.vue
  8. 42
      pagesA/force/index/index.vue
  9. 37
      pagesA/release/detail/detail.vue
  10. 6
      pagesA/release/list/list.vue

17
App.vue

@ -2,22 +2,7 @@
export default {
onLaunch: function() {
console.log('App Launch');
// uni.logincode
uni.login({
provider:'weixin',
success: function(loginRes) {
// code
console.log('获取的用户code是:' + loginRes.code);
uni.request({
url:'',
method:'POST'
})
},
fail: function(error) {
//
console.error('登录失败:', error);
}
});
},
onShow: function() {
console.log('App Show')

4
pages.json

@ -62,14 +62,14 @@
{
"path": "pages/tabBar/sdPage/sfReport",
"style": {
"navigationBarTitleText": "水上报",
"navigationBarTitleText": "水上报",
"disableScroll": true
}
},
{
"path": "pages/tabBar/sdPage/dfReport",
"style": {
"navigationBarTitleText": "电上报",
"navigationBarTitleText": "电上报",
"disableScroll": true
}
}

114
pages/login/login.vue

@ -1,11 +1,7 @@
<template>
<view class="login-bg">
<view class="login-welcome">
<image
class="login-bg-img"
src="../../static/img/login-top.png"
mode="aspectFill"
></image>
<image class="login-bg-img" src="../../static/img/login-top.png" mode="aspectFill"></image>
<view class="login-welcome-content">
<text class="login-title">您好</text>
<text class="login-title">欢迎使用</text>
@ -14,61 +10,39 @@
<view class="login-form-box">
<view class="login-form-item">
<text class="login-label">用户名</text>
<u-input
v-model="form.username"
placeholder="请输入用户名"
type="text"
border="none"
shape="circle"
custom-style="background:#f6f6f6;padding:16rpx 0;padding-left:16px;"
/>
<u-input v-model="form.username" placeholder="请输入用户名" type="text" border="none" shape="circle"
custom-style="background:#f6f6f6;padding:16rpx 0;padding-left:16px;" />
</view>
<view class="login-form-item">
<text class="login-label">密码</text>
<u-input
v-model="form.password"
placeholder="请输入密码"
type="password"
border="none"
shape="circle"
custom-style="background:#f6f6f6;padding:16rpx 0;padding-left:16px;"
/>
<u-input v-model="form.password" placeholder="请输入密码" type="password" border="none" shape="circle"
custom-style="background:#f6f6f6;padding:16rpx 0;padding-left:16px;" />
</view>
<view class="login-form-item captcha-row">
<text class="login-label">验证码</text>
<view class="captcha-flex">
<u-input
v-model="form.code"
placeholder="验证码"
border="none"
shape="circle"
custom-style="background:#f6f6f6;padding:16rpx 0;padding-left:16px;"
/>
<image
:src="codeUrl"
class="captcha-img"
mode="aspectFit"
@click="getCaptcha"
/>
<u-input v-model="form.code" placeholder="验证码" border="none" shape="circle"
custom-style="background:#f6f6f6;padding:16rpx 0;padding-left:16px;" />
<image :src="codeUrl" class="captcha-img" mode="aspectFit" @click="getCaptcha" />
</view>
</view>
</view>
<view class="login-btn-box">
<u-button
:hairline="false"
shape="circle"
:custom-style="btnStyle"
@click="handleLogin"
color="#fff"
>登录</u-button
>
<u-button :hairline="false" shape="circle" :custom-style="btnStyle" @click="handleLogin"
color="#fff">登录</u-button>
</view>
</view>
</template>
<script>
import { login, getCodeImg } from "../api";
import { encrypt, decrypt } from "../../utils/jsencrypt";
import {
login,
getCodeImg
} from "../api";
import {
encrypt,
decrypt
} from "../../utils/jsencrypt";
export default {
data() {
return {
@ -104,6 +78,24 @@ export default {
}
},
async handleLogin() {
// uni.logincode
uni.login({
provider: 'weixin',
success: function(loginRes) {
// code
console.log('获取的用户code是:' + loginRes.code);
// uni.request({
// url: '',
// method: 'POST'
// }).then(res => {
// console.log(res, 'res')
// })
},
fail: function(error) {
//
console.error('登录失败:', error);
}
});
const username = String(this.form.username); //
// 1.
const lockInfo = JSON.parse(
@ -126,7 +118,10 @@ export default {
}
// 2.
if (!this.form.username || !this.form.password || !this.form.code) {
uni.showToast({ title: "请填写完整信息", icon: "none" });
uni.showToast({
title: "请填写完整信息",
icon: "none"
});
return;
}
this.loading = true;
@ -153,9 +148,14 @@ export default {
if (res.code === 200) {
this.loginFailCounts[username] = 0;
uni.setStorageSync("token", res.token);
uni.switchTab({ url: "/pages/tabBar/work/index" });
uni.switchTab({
url: "/pages/tabBar/work/index"
});
} else {
uni.showToast({ title: res.msg, icon: "none" });
uni.showToast({
title: res.msg,
icon: "none"
});
//
this.loginFailCounts[username] =
(this.loginFailCounts[username] || 0) + 1;
@ -164,14 +164,20 @@ export default {
this.accountLockTimes[username] = lockEndTime;
uni.setStorageSync(
`lock_${username}`,
JSON.stringify({ lockEndTime, username })
JSON.stringify({
lockEndTime,
username
})
);
uni.showToast({
title: "账号登录失败次数过多,已锁定10分钟",
icon: "none",
});
} else {
uni.showToast({ title: res[1].data.msg || "登录失败", icon: "none" });
uni.showToast({
title: res[1].data.msg || "登录失败",
icon: "none"
});
}
this.getCaptcha();
}
@ -191,12 +197,14 @@ export default {
background: #f7fafd;
height: 100vh;
}
.login-welcome {
position: relative;
width: 100vw;
padding-top: 244rpx;
overflow: hidden;
}
.login-bg-img {
position: absolute;
left: 0;
@ -205,6 +213,7 @@ export default {
height: 526px;
z-index: 1;
}
.login-welcome-content {
position: relative;
z-index: 2;
@ -216,6 +225,7 @@ export default {
padding-left: 60rpx;
margin-bottom: 70rpx;
}
.login-title {
font-size: 36rpx;
font-weight: bold;
@ -231,9 +241,11 @@ export default {
padding: 40rpx 30rpx 30rpx 30rpx;
margin-bottom: -46rpx;
}
.login-form-item {
margin-bottom: 36rpx;
}
.login-label {
font-size: 28rpx;
font-weight: bold;
@ -241,19 +253,23 @@ export default {
margin-bottom: 12rpx;
display: block;
}
.login-btn-box {
width: 100%;
display: flex;
justify-content: center;
}
.captcha-row {
display: flex;
flex-direction: column;
}
.captcha-flex {
display: flex;
align-items: center;
}
.captcha-img {
width: 160rpx;
height: 60rpx;

8
pages/tabBar/work/index.vue

@ -71,8 +71,8 @@ export default {
{ image: '/static/img/记录.png', text: '巡检记录' },
],
sdList: [
{ image: '/static/img/水费.png', text: '水上报' },
{ image: '/static/img/电费.png', text: '电上报' },
{ image: '/static/img/水费.png', text: '水上报' },
{ image: '/static/img/电费.png', text: '电上报' },
],
bxList: [
{ image: '/static/img/上报.png', text: '上报' },
@ -130,11 +130,11 @@ export default {
}
},
handelSdClick (item) {
if(item.text === '水上报'){
if(item.text === '水上报'){
uni.navigateTo({
url: '/pages/tabBar/sdPage/sfReport'
})
} else if(item.text === '电上报'){
} else if(item.text === '电上报'){
uni.navigateTo({
url: '/pages/tabBar/sdPage/dfReport'
})

7
pages/tabBar/xjPage/xj.vue

@ -38,6 +38,8 @@
accept="all"
@afterRead="afterRead"
@delete="onDelete"
:maxSize="10 * 1024 * 1024"
@oversize="oversize"
>
<view class="custom-upload-btn">
<view class="icon-box">
@ -158,6 +160,11 @@ export default {
});
});
this.form.imageList = arry
},
//
oversize(e) {
this.$u.toast("请传10MB以内大小的图片/视频!");
return false;
},
getDictType(){
getDicts('inspection_question_type').then((res) => {

23
pagesA/checkout/detail/detail.vue

@ -100,6 +100,8 @@ import { detail } from '@/api/mz/contract';
:maxCount="10"
uploadIconColor="#12c3c3"
:previewImage="true"
:maxSize="10 * 1024 * 1024"
@oversize="oversize"
>
<view class="custom-upload-btn">
<view class="icon-box">
@ -197,6 +199,11 @@ export default {
beforeRead(event) {
console.log("event", event);
},
//
oversize(e) {
this.$u.toast("请传10MB以内大小的图片/视频!");
return false;
},
//
async afterRead(event) {
@ -210,9 +217,9 @@ export default {
});
});
for (let i = 0; i < lists.length; i++) {
try {
const result = await uploadImage(lists[i].url);
let item = this[`fileList${event.name}`][fileListLen];
this[`fileList${event.name}`].splice(
fileListLen,
1,
@ -223,6 +230,20 @@ export default {
})
);
fileListLen++;
} catch (err) {
//
let msg = (err && err.msg) || (err && err.message) || "上传失败";
console.log('344',err);
uni.showToast({
title: msg,
icon: "none",
duration: 3000
});
//
this[`fileList${event.name}`].splice(fileListLen, 1);
return; //
}
}
var arry = [];
this.fileList.filter((v, i) => {

2
pagesA/checkout/list/list.vue

@ -32,7 +32,7 @@
</view>
<view style="text-align: center;" v-if="isLoading">加载中...</view>
<view v-else-if="listData.length <= 0" class="no-data"> 暂无数据~ </view>
<view v-else-if="noMore && listData.length > 0" style="text-align: center;">没有更多了~</view>
<!-- <view v-else-if="noMore && listData.length > 0" style="text-align: center;">没有更多了~</view> -->
</scroll-view>
</view>
</template>

42
pagesA/force/index/index.vue

@ -12,6 +12,7 @@
:showAction="false"
@search="handleQuery"
@clear="handleClear"
@clickIcon="handleQuery"
></u-search>
</u-form-item>
</view>
@ -53,13 +54,13 @@
/> -->
</u-form-item>
<view style="border-bottom: 2rpx solid #e5e5e5; margin: 0"></view>
<u-form-item
<!-- <u-form-item
label="退房日期"
prop="leaveDate"
required
@click="showDate = false"
>
<text style="text-align: right">{{ baseInfo.checkOutTime }}</text>
<text style="text-align: right">{{ baseInfo.checkOutTime }}</text> -->
<!-- <u--input
v-model="baseInfo.checkOutTime"
placeholder="请选择退房日期"
@ -67,7 +68,7 @@
readonly
input-align="right"
></u--input> -->
</u-form-item>
<!-- </u-form-item> -->
<!-- <u-form-item
label="问题类型"
prop="problemType"
@ -104,6 +105,8 @@
:maxCount="10"
uploadIconColor="#12c3c3"
:previewImage="true"
:maxSize="10 * 1024 * 1024"
@oversize="oversize"
>
<view class="custom-upload-btn">
<view class="icon-box">
@ -218,17 +221,19 @@ export default {
});
},
handleClear() {
this.form = {
room: "",
name: "",
idCard: "",
phone: "",
leaveDate: "",
desc: "",
imageUrl: "",
pickerValue: "",
problemType: "",
};
(this.baseInfo.graduateName = ""),
(this.baseInfo.telephone = ""),
(this.baseInfo.idCard = ""),
(this.baseInfo.checkOutTime = ""),
(this.baseInfo.apartmentName = ""),
(this.baseInfo.buildingName = ""),
(this.baseInfo.unitName = ""),
(this.baseInfo.roomTypeName = "");
},
//
oversize(e) {
this.$u.toast("请传10MB以内大小的图片/视频!");
return false;
},
//
beforeRead(event) {
@ -315,13 +320,22 @@ export default {
},
handleTempSave(params) {
forceRelease(params).then((res) => {
if (res.code === 200) {
uni.showToast({
title: res.msg,
icon: "success",
});
setTimeout(() => {
uni.switchTab({
url: "/pages/tabBar/work/index",
});
}, 1500);
} else {
uni.showToast({
title: res.msg,
icon: "error",
});
}
});
},
},

37
pagesA/release/detail/detail.vue

@ -1,7 +1,11 @@
<template>
<view class="checkout-detail-bg">
<!-- 房间图片 -->
<image class="room-img" :src="userInfo.houseTypeCoverImg" mode="aspectFill"></image>
<image
class="room-img"
:src="userInfo.houseTypeCoverImg"
mode="aspectFill"
></image>
<!-- 基本信息卡片 -->
<view class="info-card">
<view class="info-header">
@ -78,7 +82,9 @@
uploadIconColor="#12c3c3"
uploadText="点击上传"
:previewImage="true"
accept="media"
accept="all"
:maxSize="10 * 1024 * 1024"
@oversize="oversize"
>
</u-upload>
<!-- #endif -->
@ -92,6 +98,8 @@
uploadIconColor="#12c3c3"
:previewImage="true"
accept="image/*,video/*"
:maxSize="10 * 1024 * 1024"
@oversize="oversize"
>
<view class="custom-upload-btn">
<view class="icon-box">
@ -186,6 +194,11 @@ export default {
});
this.fileList = arry;
},
//
oversize(e) {
this.$u.toast("请传10MB以内大小的图片/视频!");
return false;
},
//
async afterRead(event) {
let lists = [].concat(event.file);
@ -284,14 +297,17 @@ export default {
}
//
if (!this.roomDetail.facilitiesCheckResults || this.roomDetail.facilitiesCheckResults.length === 0) {
if (
!this.roomDetail.facilitiesCheckResults ||
this.roomDetail.facilitiesCheckResults.length === 0
) {
uni.showToast({ title: "请完成设备检查", icon: "none" });
return;
}
//
const unfinishedDevices = this.roomDetail.facilitiesCheckResults.filter(item =>
item.checkResult === undefined || item.checkResult === null
const unfinishedDevices = this.roomDetail.facilitiesCheckResults.filter(
(item) => item.checkResult === undefined || item.checkResult === null
);
if (unfinishedDevices.length > 0) {
uni.showToast({ title: "请完成所有设备检查", icon: "none" });
@ -299,11 +315,14 @@ export default {
}
// 0
const nonIntactDevices = this.roomDetail.facilitiesCheckResults.filter(item =>
item.checkResult !== 0
const nonIntactDevices = this.roomDetail.facilitiesCheckResults.filter(
(item) => item.checkResult !== 0
);
if (nonIntactDevices.length > 0) {
uni.showToast({ title: "所有设备必须都是完好状态才能提交", icon: "none" });
uni.showToast({
title: "所有设备必须都是完好状态才能提交",
icon: "none",
});
return;
}
@ -313,7 +332,7 @@ export default {
cleaned: this.cleaned,
facilitiesCheckDesc: this.value,
facilitiesCheckImages: this.fileList,
imageList:this.fileList
imageList: this.fileList,
};
const res = await releaseRoom(parm);

6
pagesA/release/list/list.vue

@ -9,7 +9,7 @@
@scrolltolower="loadMore"
style="height: 100vh;"
>
<view v-for="item in listData" :key="item.id">
<view v-for="(item,index) in listData" :key="item.roomId">
<view class="checkout-card" @click="goDetail(item)">
<image :src="item.houseTypeCoverImg" class="room-img" mode="aspectFill"></image>
<view class="room-info">
@ -23,7 +23,7 @@
</view>
<view style="text-align: center;" v-if="isLoading">加载中...</view>
<view v-else-if="listData.length <= 0" class="no-data"> 暂无数据~ </view>
<view v-else-if="noMore && listData.length > 0" style="text-align: center;">没有更多了~</view>
<!-- <view v-else-if="noMore " style="text-align: center;">没有更多了~</view> -->
</scroll-view>
</view>
</template>
@ -102,6 +102,8 @@ export default {
}
},
goDetail(item) {
console.log(item,'item');
uni.navigateTo({
url: `/pagesA/release/detail/detail?roomId=${item.roomId}&userInfo=${JSON.stringify(item)}`
});

Loading…
Cancel
Save