Compare commits

...

2 Commits

  1. 2
      weapp/app.js
  2. BIN
      weapp/images/logo.png
  3. BIN
      weapp/images/password.png
  4. BIN
      weapp/images/userName.png
  5. 12
      weapp/pages/index/index.js
  6. 7
      weapp/pages/index/index.wxml
  7. 2
      weapp/pages/index/index.wxss
  8. 45
      weapp/pages/login/login.js
  9. 6
      weapp/pages/login/login.json
  10. 14
      weapp/pages/login/login.wxml
  11. 67
      weapp/pages/login/login.wxss

2
weapp/app.js

@ -4,7 +4,7 @@ App({
globalData: {
userInfo: null,
baseUrl: 'http://10.8.16.221:4900', //api 本地环境
// imgUrl: 'http://10.8.16.221:5000/_file-server/', //本地环境
imgUrl: 'http://10.8.16.221:5900/_file-server/', //web 本地环境
},
onShow(e) {
// 检查是否有更新

BIN
weapp/images/logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 187 KiB

BIN
weapp/images/password.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
weapp/images/userName.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

12
weapp/pages/index/index.js

@ -14,6 +14,7 @@ Page({
count: '', //总条数
keyName: '', //结构物名称
hidden: true,
imgUrl: getApp().globalData.imgUrl
},
// 输入框
@ -30,6 +31,7 @@ Page({
that.setData({
page: 0, //当前页
count: '', //总条数
dataList:[]
})
that.getProjectList();
},
@ -40,6 +42,7 @@ Page({
that.setData({
page: 0, //当前页
count: '', //总条数
dataList:[]
})
that.getProjectList();
},
@ -48,8 +51,8 @@ Page({
getProjectList: function () {
let that = this;
let { page, limit, keyName } = that.data;
Request.get(getProjectList(), { limit, page, name: keyName }).then(res => {
console.log(res);
let data = keyName ? { limit, page, name: keyName } : { limit, page }
Request.get(getProjectList(), data).then(res => {
if (res.rows.length == 0) {
that.setData({
dataList: res.rows,
@ -139,7 +142,10 @@ Page({
let page = _that.data.page + 1; //获取当前页数并+1
let { dataList, count } = _that.data;
if (dataList.length == count) {
showToast('没有更多数据了...');
wx.showToast({
title: '没有更多数据了...',
icon: 'none',
})
return;
}
_that.setData({

7
weapp/pages/index/index.wxml

@ -2,7 +2,7 @@
<view>
<view class="searchFixed">
<view class="searchBoxs">
<input class="searchInps" bindinput="formInp" bindconfirm="bindconfirm" value='{{name}}' type="text" placeholder="请输入结构物名称" />
<input class="searchInps" bindinput="formInp" bindconfirm="bindconfirm" value='{{keyName}}' type="text" placeholder="请输入结构物名称" />
<button class="btnSearch" bindtap="goSearch">搜索</button>
</view>
</view>
@ -10,9 +10,10 @@
<view style="margin-top: 140rpx;">
<block wx:for="{{dataList}}" wx:key='*this'>
<view style="padding-bottom: 60rpx;">
<image style="width: 100%;height: 372rpx;display: block;" src="https://dingyue.ws.126.net/2021/0428/099be11ej00qs9xld006bc000xc00m7m.jpg"></image>
<image wx:if="{{item.img != null || item.img.length > 0}}" style="width: 100%;height: 372rpx;display: block;" src="{{imgUrl + item.img[0]}}"></image>
<view wx:if="{{item.img == null || item.img.length == 0}}" style="width: 100%;height: 372rpx;line-height: 372rpx;text-align: center;background: #fff;border-bottom: 2rpx solid #ccc;">暂无图片</view>
<view class="box">
<view style="font-weight:bold;font-size:32rpx;">结构物A</view>
<view style="font-weight:bold;font-size:32rpx;">{{item.name}}</view>
<view style="font-size:28rpx;color: rgb(166,166,166);">
<view style=" margin-top:6rpx;">今日问题:<text>12</text></view>
<view style="float:left;width:360rpx;">未处理问题:<text>12</text></view>

2
weapp/pages/index/index.wxss

@ -48,7 +48,7 @@ page {
.box {
padding: 20rpx;
box-shadow: 0rpx 0rpx 10rpx #ccc;
box-shadow: 0rpx 10rpx 10rpx #ccc;
overflow: hidden;
line-height: 50rpx;
background: #fff;

45
weapp/pages/login/login.js

@ -8,34 +8,14 @@ Page({
* 页面的初始数据
*/
data: {
userNameCan: false,
passwordCan: false,
},
setColor: function () {
this.setData({
backgroundInput: this.data.userNameCan == true && this.data.passwordCan == true ? 'rgb(51, 133, 255)' : 'rgb(255,255,255)',
colorInput: this.data.userNameCan == true && this.data.passwordCan == true ? 'rgb(255, 255, 255)' : 'rgb(201,201,201)',
})
},
bindUserName: function (e) {
this.setData({
userNameCan: e.detail.value.length > 0 ? true : false,
})
this.setColor();
},
bindPassword: function (e) {
this.setData({
passwordCan: e.detail.value.length > 0 ? true : false,
})
this.setColor();
},
// 登录
getLogin: function (e) {
if (e.detail.value.username.length == 0 || e.detail.value.password == 0) {
wx.showToast({
title: '请输入用户名密码',
title: '请输入账号密码',
icon: 'none',
})
return
@ -59,6 +39,29 @@ Page({
})
},
bindForget() {
wx.showModal({
title: '温馨提示',
content: '请联系管理员:18888888888',
confirmText: '拨打电话',
confirmColor: '#488EFF',
cancelColor: '#488EFF',
success(res) {
if (res.confirm) {
wx.makePhoneCall({
phoneNumber: "18888888888",
success: function () {
console.log("拨打电话成功!")
},
fail: function () {
console.log("拨打电话失败!")
}
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/

6
weapp/pages/login/login.json

@ -1,6 +1,6 @@
{
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"disableScroll": true
}

14
weapp/pages/login/login.wxml

@ -1,25 +1,21 @@
<!--pages/login/login.wxml-->
<view class='logo-container'>
<image class='logo' src='/images/logo.png' mode='aspectFit' />
<image class='logo' src='/images/logo.png' />
</view>
<view class="body-container" wx:if='{{!isAutoLogin}}'>
<form report-submit='true' bindsubmit='getLogin'>
<view class='userName-container marginBottom'>
<image class='userName-logo' src='/images/userName.png' />
<input class='input' name='username' placeholder='请输入用户名' value='' type='text' maxlength="50" confirm-type="next" bindinput='bindUserName' />
<input class='input' name='username' placeholder='请输入账号' value='' type='text' maxlength="50" confirm-type="next" bindinput='bindUserName' />
</view>
<view class='userName-container'>
<image class='password-logo' src='/images/password.png' />
<input class='input' name='password' placeholder='输入密码' value='' type='text' password='true' maxlength="50" confirm-type="done" bindinput='bindPassword' />
<input class='input' name='password' placeholder='输入密码' value='' type='text' password='true' maxlength="50" confirm-type="done" bindinput='bindPassword' />
</view>
<button class='login-btn' disabled="{{!userNameCan || !passwordCan}}" style='background:{{backgroundInput}}; color:{{colorInput}};' form-type="submit">登录</button>
<button class='login-btn' form-type="submit">登录</button>
</form>
</view>
<view class='co-info'>
<view>仅提供内部人员使用</view>
<view>©飞尚科技</view>
</view>
<!-- <view class="forget" bindtap="bindForget">忘记密码</view> -->

67
weapp/pages/login/login.wxss

@ -1,20 +1,12 @@
/* pages/login/login.wxss */
page {
background: rgb(255, 255, 255);
}
.logo-container {
margin-top: 85rpx;
margin-bottom: 125rpx;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
margin-bottom: 40rpx;
}
.logo {
width: 180rpx;
height: 180rpx;
width: 100%;
height: 456rpx;
}
.body-container {
@ -24,13 +16,13 @@ page {
}
.marginBottom {
margin-bottom: 30rpx;
margin-bottom: 40rpx;
}
.userName-container {
width: 580rpx;
height: 95rpx;
background: rgb(245, 245, 247);
width: 670rpx;
height: 96rpx;
background: #F0F3FB;
border-radius: 10rpx;
display: flex;
justify-content: center;
@ -38,36 +30,37 @@ page {
}
.userName-logo {
width: 30rpx;
height: 34rpx;
padding-right: 15rpx;
border-right: 1px dashed #8A8A8A;
width: 32rpx;
height: 32rpx;
padding-left: 36rpx;
padding-right: 30rpx;
}
.password-logo {
width: 30rpx;
height: 34rpx;
padding-right: 15rpx;
border-right: 1px dashed #8A8A8A;
width: 32rpx;
height: 32rpx;
padding-left: 36rpx;
padding-right: 30rpx;
}
.input {
width: 492rpx;
width: 556rpx;
height: 95rpx;
padding-left: 15rpx;
font-size: 32rpx;
font-size: 28rpx;
}
.login-btn {
width: 580rpx !important;
height: 98rpx;
margin-top: 90rpx;
color: rgb(201, 201, 201);
background: rgb(255, 255, 255);
width: 670rpx !important;
height: 96rpx;
margin-top: 40rpx;
color: #fff;
background-image: linear-gradient(179deg, #488EFF 0%, #2675F5 100%);
display: flex;
justify-content: center;
align-items: center;
border-radius: 10rpx;
font-size: 36rpx;
}
.backColor {
@ -145,12 +138,10 @@ page {
height: 80rpx;
}
.co-info {
position: fixed;
bottom: 10px;
left: 0;
width: 100vw;
color: #ccc;
text-align: center;
font-size: 14px
.forget {
color: #2675F5;
font-size: 28rpx;
width: 670rpx;
margin: 20rpx auto 0;
text-align: right;
}
Loading…
Cancel
Save