Showing
26 changed files
with
665 additions
and
129 deletions
1 | import minaEnv from "../utils/minaEnv"; | 1 | import minaEnv from "../utils/minaEnv"; |
2 | export const API_CONST = { | 2 | export const API_CONST = { |
3 | login: { | 3 | login: { |
4 | - wxLogin: { url: `/open/wx-mini-program/wxLogin?corpCode=${minaEnv.corpCode}&_v=${+new Date()}`, method: "POST" }, // 根据微信小程序code进行免登 | ||
5 | - registerLogin: { url: `/open/wx-mini-program/registerLogin?corpCode=${minaEnv.corpCode}&_v=${+new Date()}`, method: "POST" }, // 获取用户手机号并进行注册登录 | ||
6 | - }, | 4 | + wxLogin: { |
5 | + url: `/qx-api/qx-apaas-auth/server/auth/login`, | ||
6 | + method: "POST" | ||
7 | + }, | ||
8 | + loginSecurity:{ | ||
9 | + url:`/qx-api/qx-unified-user/login/securityImg`, | ||
10 | + method:"GET" | ||
11 | + }, | ||
12 | + userSecurity:{ | ||
13 | + url:`/qx-api/qx-apaas-uc/user/securityImg`, | ||
14 | + method:"GET" | ||
15 | + }, | ||
16 | + | ||
17 | + logout:{ | ||
18 | + url:`/qx-api/qx-apaas-auth/server/auth/mobile/logout`, | ||
19 | + method:"POST" | ||
20 | + } | ||
21 | + | ||
22 | + }, // 获取用户手机号并进行注册登录 | ||
23 | + | ||
7 | 24 | ||
8 | home: { | 25 | home: { |
9 | miniData: { | 26 | miniData: { |
10 | url: `/open/qx-apaas-custom/hczd/index`, | 27 | url: `/open/qx-apaas-custom/hczd/index`, |
11 | method: "POST"//参数:{"corpCode": "default"} | 28 | method: "POST"//参数:{"corpCode": "default"} |
12 | }, | 29 | }, |
13 | - getDate:{ | ||
14 | - url:`/open/qx-apaas-custom/hczd/getDate`, | ||
15 | - method:"POST"//参数 | ||
16 | - | 30 | + getDate: { |
31 | + url: `/open/qx-apaas-custom/hczd/getDate`, | ||
32 | + method: "POST"//参数 | ||
33 | + | ||
17 | } | 34 | } |
18 | } | 35 | } |
19 | 36 |
1 | import * as echarts from './../../ec-canvas/echarts'; | 1 | import * as echarts from './../../ec-canvas/echarts'; |
2 | 2 | ||
3 | function initChart(canvas: any, width: any, height: any, data: any, dpr: any) { | 3 | function initChart(canvas: any, width: any, height: any, data: any, dpr: any) { |
4 | - console.log(data, 'data-------data') | 4 | + // console.log(data, 'data-------data') |
5 | const chart = echarts.init(canvas, null, { | 5 | const chart = echarts.init(canvas, null, { |
6 | width: width, | 6 | width: width, |
7 | height: height, | 7 | height: height, |
miniprogram/img/qixiao.png
0 → 100644
10.8 KB
miniprogram/img/wczd.png
0 → 100644
105 KB
miniprogram/pages/acount/acount.json
0 → 100644
miniprogram/pages/acount/acount.min.css
0 → 100644
1 | +.acount_main{background:#f7f7f7;height:100vh;width:100%}.acount_main .top_info{height:80%}.acount_main .acount_logout{height:20%;display:flex;width:100%;align-items:center}.acount_main .acount_logout .logout_btn{margin:20rpx 40rpx;height:80rpx;width:calc(100% - 80rpx);background:#fff;border-radius:1.06667vw;line-height:10.66667vw;text-align:center;font-family:PingFangSC-Regular;font-size:36rpx;color:#fc6b6c;font-weight:400} |
miniprogram/pages/acount/acount.scss
0 → 100644
1 | +.acount_main { | ||
2 | + background: #f7f7f7; | ||
3 | + height: 100vh; | ||
4 | + width: 100%; | ||
5 | + .top_info { | ||
6 | + height: 80%; | ||
7 | + } | ||
8 | + .acount_logout { | ||
9 | + height: 20%; | ||
10 | + display: flex; | ||
11 | + width: 100%; | ||
12 | + align-items: center; | ||
13 | + .logout_btn { | ||
14 | + margin: 20rpx 40rpx; | ||
15 | + height: 80rpx; | ||
16 | + width: calc(100% - 80rpx); | ||
17 | + background: #fff; | ||
18 | + border-radius: 1.06667vw; | ||
19 | + line-height: 10.66667vw; | ||
20 | + text-align: center; | ||
21 | + font-family: PingFangSC-Regular; | ||
22 | + font-size:36rpx; | ||
23 | + color: #fc6b6c; | ||
24 | + font-weight: 400; | ||
25 | + } | ||
26 | + } | ||
27 | +} |
miniprogram/pages/acount/acount.ts
0 → 100644
1 | +// pages/acount/acount.ts | ||
2 | +import { API_CONST } from "./../../api/smartElectric"; | ||
3 | +import { HTTPService as HTTP } from "./../../services/HTTPService"; | ||
4 | +import Dialog from '@vant/weapp/dialog/dialog'; | ||
5 | +Page({ | ||
6 | + | ||
7 | + /** | ||
8 | + * 页面的初始数据 | ||
9 | + */ | ||
10 | + data: { | ||
11 | + | ||
12 | + }, | ||
13 | + | ||
14 | + /** | ||
15 | + * 生命周期函数--监听页面加载 | ||
16 | + */ | ||
17 | + onLoad() { | ||
18 | + | ||
19 | + }, | ||
20 | + | ||
21 | + /** | ||
22 | + * 生命周期函数--监听页面初次渲染完成 | ||
23 | + */ | ||
24 | + onReady() { | ||
25 | + | ||
26 | + }, | ||
27 | + | ||
28 | + /** | ||
29 | + * 生命周期函数--监听页面显示 | ||
30 | + */ | ||
31 | + onShow() { | ||
32 | + | ||
33 | + }, | ||
34 | + | ||
35 | + /** | ||
36 | + * 生命周期函数--监听页面隐藏 | ||
37 | + */ | ||
38 | + onHide() { | ||
39 | + | ||
40 | + }, | ||
41 | + | ||
42 | + /** | ||
43 | + * 生命周期函数--监听页面卸载 | ||
44 | + */ | ||
45 | + onUnload() { | ||
46 | + | ||
47 | + }, | ||
48 | + | ||
49 | + /** | ||
50 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
51 | + */ | ||
52 | + onPullDownRefresh() { | ||
53 | + | ||
54 | + }, | ||
55 | + | ||
56 | + /** | ||
57 | + * 页面上拉触底事件的处理函数 | ||
58 | + */ | ||
59 | + onReachBottom() { | ||
60 | + | ||
61 | + }, | ||
62 | + | ||
63 | + /** | ||
64 | + * 用户点击右上角分享 | ||
65 | + */ | ||
66 | + onShareAppMessage() { | ||
67 | + | ||
68 | + }, | ||
69 | + onClickLeft() { | ||
70 | + wx.navigateBack() | ||
71 | + }, | ||
72 | + | ||
73 | + __mobilelogoutEvent(){ | ||
74 | + HTTP.POST({ | ||
75 | + ...API_CONST.login.logout, | ||
76 | + payload:{ | ||
77 | + | ||
78 | + } | ||
79 | + }).then((data: any) => { | ||
80 | + if(data.success){ | ||
81 | + wx.navigateTo({url:"/pages/login/login"}) | ||
82 | + } | ||
83 | + }) | ||
84 | + }, | ||
85 | + logoutEvent() {//退出登录事件 | ||
86 | + console.log('退出页面') | ||
87 | + Dialog.confirm({ | ||
88 | + message: '是否确定退出当前账号?', | ||
89 | + }) | ||
90 | + .then(() => { | ||
91 | + // on confirm | ||
92 | + this.__mobilelogoutEvent() | ||
93 | + | ||
94 | + }) | ||
95 | + .catch(() => { | ||
96 | + // on cancel | ||
97 | + }); | ||
98 | + } | ||
99 | +}) |
miniprogram/pages/acount/acount.wxml
0 → 100644
1 | +<view class="acount_main"> | ||
2 | + <view class="top_info"> | ||
3 | + <view class="acount_top"> | ||
4 | + <van-nav-bar title="账号管理" left-text="返回" left-arrow bind:click-left="onClickLeft" /> | ||
5 | + </view> | ||
6 | + <view class="acount_info"> | ||
7 | + <van-cell-group> | ||
8 | + <van-cell title="姓名" value="内容" /> | ||
9 | + <van-cell title="手机号" value="内容" /> | ||
10 | + <van-cell title="邮箱" value="内容" /> | ||
11 | + </van-cell-group> | ||
12 | + </view> | ||
13 | + </view> | ||
14 | + | ||
15 | + <view class="acount_logout"> | ||
16 | + <view class="logout_btn" bind:tap="logoutEvent"> | ||
17 | + 退出登录 | ||
18 | + </view> | ||
19 | + </view> | ||
20 | + <van-dialog id="van-dialog" /> | ||
21 | +</view> | ||
22 | + | ||
23 | + | ||
24 | + |
miniprogram/pages/acount/acount.wxss
0 → 100644
1 | +.acount_main { | ||
2 | + background: #f7f7f7; | ||
3 | + height: 100vh; | ||
4 | + width: 100%; | ||
5 | +} | ||
6 | + | ||
7 | +.acount_main .top_info { | ||
8 | + height: 80%; | ||
9 | +} | ||
10 | + | ||
11 | +.acount_main .acount_logout { | ||
12 | + height: 20%; | ||
13 | + display: flex; | ||
14 | + width: 100%; | ||
15 | + align-items: center; | ||
16 | +} | ||
17 | + | ||
18 | +.acount_main .acount_logout .logout_btn { | ||
19 | + margin: 20rpx 40rpx; | ||
20 | + height: 80rpx; | ||
21 | + width: calc(100% - 80rpx); | ||
22 | + background: #fff; | ||
23 | + border-radius: 1.06667vw; | ||
24 | + line-height: 10.66667vw; | ||
25 | + text-align: center; | ||
26 | + font-family: PingFangSC-Regular; | ||
27 | + font-size: 36rpx; | ||
28 | + color: #fc6b6c; | ||
29 | + font-weight: 400; | ||
30 | +} |
1 | -.home_main{padding:24rpx 20rpx;overflow-y:auto;overflow-x:hidden}.home_main .home_content{width:100%} | 1 | +.home_main{height:100vh;width:100%}.home_main .home-info{width:100%;background:#3499ff;height:160rpx;padding:40rpx 20rpx;margin-top:100rpx;display:flex}.home_main .home-info .home-info-avatar{font-size:48rpx;background:#fff;color:#3499ff;border-radius:50%;width:120rpx;height:120rpx;text-align:center;line-height:120rpx;margin-right:20rpx}.home_main .home-info .mine-info{color:#fff}.home_main .home-info .mine-info .mine-info-basic{font-size:40rpx}.home_main .home-info .mine-info .mine-company{margin-top:20rpx}.home_main .home-info .mine-info .mine-company .mine-company-info{font-size:28rpx} |
1 | .home_main { | 1 | .home_main { |
2 | - padding: 24rpx 20rpx; | ||
3 | - overflow-y: auto; | ||
4 | - overflow-x: hidden; | ||
5 | - // height: 100vh; | 2 | + height: 100vh; |
3 | + width: 100%; | ||
4 | + | ||
6 | // background: red; | 5 | // background: red; |
6 | + .home-info { | ||
7 | + width: 100%; | ||
8 | + background: #3499ff; | ||
9 | + height: 160rpx; | ||
10 | + padding: 40rpx 20rpx; | ||
11 | + margin-top: 100rpx; | ||
12 | + display: flex; | ||
7 | 13 | ||
14 | + .home-info-avatar { | ||
15 | + font-size: 48rpx; | ||
16 | + background: #fff; | ||
17 | + color: rgb(52, 153, 255); | ||
18 | + border-radius: 50%; | ||
19 | + width: 120rpx; | ||
20 | + height: 120rpx; | ||
21 | + text-align: center; | ||
22 | + line-height: 120rpx; | ||
23 | + margin-right: 20rpx; | ||
24 | + } | ||
8 | 25 | ||
9 | - .home_content { | ||
10 | - width: 100%; | 26 | + .mine-info { |
27 | + color: #fff; | ||
28 | + | ||
29 | + .mine-info-basic { | ||
30 | + font-size: 40rpx; | ||
31 | + } | ||
32 | + | ||
33 | + .mine-company { | ||
34 | + margin-top: 20rpx; | ||
35 | + .mine-company-info { | ||
36 | + font-size: 28rpx; | ||
37 | + } | ||
38 | + } | ||
39 | + } | ||
11 | } | 40 | } |
12 | 41 | ||
13 | } | 42 | } |
1 | -// pages/home/home.ts | ||
2 | -const app = getApp(); | 1 | +// index.ts// app.ts |
2 | +import { HTTPService as HTTP } from "../../services/HTTPService"; | ||
3 | +// 获取应用实例 | ||
4 | +import minaEnv from "../../utils/minaEnv"; | ||
5 | +import { getShareInfo } from "../../utils/wxUtil"; | ||
6 | +// @ts-ignore | ||
7 | +const app = getApp<IAppOption>(); | ||
3 | Page({ | 8 | Page({ |
4 | - | ||
5 | - /** | ||
6 | - * 页面的初始数据 | ||
7 | - */ | ||
8 | data: { | 9 | data: { |
9 | - | 10 | + url: "", |
10 | }, | 11 | }, |
11 | - | ||
12 | - /** | ||
13 | - * 生命周期函数--监听页面加载 | ||
14 | - */ | ||
15 | onLoad() { | 12 | onLoad() { |
16 | 13 | ||
17 | }, | 14 | }, |
18 | - | ||
19 | - /** | ||
20 | - * 生命周期函数--监听页面初次渲染完成 | ||
21 | - */ | ||
22 | - onReady() { | ||
23 | - | ||
24 | - }, | ||
25 | - | ||
26 | - /** | ||
27 | - * 生命周期函数--监听页面显示 | ||
28 | - */ | ||
29 | - onShow() { | ||
30 | - | ||
31 | - }, | ||
32 | - | ||
33 | - /** | ||
34 | - * 生命周期函数--监听页面隐藏 | ||
35 | - */ | ||
36 | - onHide() { | ||
37 | - | ||
38 | - }, | ||
39 | - | ||
40 | - /** | ||
41 | - * 生命周期函数--监听页面卸载 | ||
42 | - */ | ||
43 | - onUnload() { | ||
44 | - | ||
45 | - }, | ||
46 | - | ||
47 | - /** | ||
48 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
49 | - */ | ||
50 | - onPullDownRefresh() { | ||
51 | - | ||
52 | - }, | ||
53 | - | ||
54 | - /** | ||
55 | - * 页面上拉触底事件的处理函数 | ||
56 | - */ | ||
57 | - onReachBottom() { | ||
58 | - | 15 | + handleGetMessage(e: any) { |
16 | + console.log(e, 'handleGetMessagehandleGetMessage') | ||
59 | }, | 17 | }, |
60 | - | ||
61 | - /** | ||
62 | - * 用户点击右上角分享 | ||
63 | - */ | ||
64 | - onShareAppMessage() { | ||
65 | - | 18 | + loadSuccess() { |
19 | + console.log('网页加载成功!!!') | ||
66 | }, | 20 | }, |
67 | - tabsItemChange(e: any) { | ||
68 | - console.log(e, '----tab传过来的值', e.detail.type) | ||
69 | - const idx = e.detail.type | ||
70 | - this.setData({ | ||
71 | - currentIndex: idx | ||
72 | - }) | ||
73 | - }, | ||
74 | - gotoMonitor() { | ||
75 | - // wx.switchTab({ | ||
76 | - // url:"/pages/monitor/monitor" | ||
77 | - // }) | ||
78 | - | ||
79 | - wx.reLaunch({// | ||
80 | - url: "/pages/monitor/monitor" | ||
81 | - }) | ||
82 | - }, | ||
83 | - gotoDetail() { | ||
84 | - // wx.switchTab// 只能跳转到tab页面 | ||
85 | - // wx.navigateTo//关闭所有页面,打开到应用内的某个页面 | ||
86 | - // wx.reLaunch//关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 | ||
87 | - wx.navigateTo({ | ||
88 | - url: "/pages/detail/detail?id=1" | ||
89 | - }) | ||
90 | - | ||
91 | - }, | ||
92 | - getChildComponent: function () { | ||
93 | - const child = this.selectComponent('.hhhhhh_uuuuu') | ||
94 | - child.setData({ | ||
95 | - topTitleName:"88888888888" | ||
96 | - }) | ||
97 | - console.log(child,'childchildchild') | 21 | + onShow() { |
22 | + // let pages = getCurrentPages(); | ||
23 | + // console.log(pages) | ||
98 | }, | 24 | }, |
99 | - getAppData(){ | ||
100 | - | 25 | + gotoAcount() { |
26 | + wx.navigateTo({ url: "/pages/acount/acount" }) | ||
101 | }, | 27 | }, |
102 | - changeAppData(){ | ||
103 | - wx.getLocation({ | ||
104 | - type: 'wgs84', | ||
105 | - success: (res) => { | ||
106 | - var latitude = res.latitude // 纬度 | ||
107 | - var longitude = res.longitude // 经度 | ||
108 | - console.log(latitude,longitude,'-------------') | ||
109 | - } | ||
110 | - }) | ||
111 | - } | ||
112 | -}) | ||
28 | + onReady() { }, | ||
29 | +}); |
1 | <view class="home_main"> | 1 | <view class="home_main"> |
2 | - <view class="home_content"> | ||
3 | - home页面 | 2 | + <view class="home-info"> |
3 | + <view class="home-info-avatar"> | ||
4 | + 铨 | ||
5 | + </view> | ||
6 | + <view class="mine-info"> | ||
7 | + <view class="mine-info-basic"> | ||
8 | + 周铨 | ||
9 | + </view> | ||
10 | + <view class="mine-company"> | ||
11 | + <!-- <image src="" class="image_view" mode=""/> --> | ||
12 | + <view class="mine-company-info">青谷科技</view> | ||
13 | + </view> | ||
14 | + </view> | ||
15 | + </view> | ||
16 | + | ||
17 | + <view class="acountManage"> | ||
18 | + | ||
19 | + <van-cell icon="friends-o" is-link bind:tap="gotoAcount"> | ||
20 | + <view slot="title"> | ||
21 | + <view class="van-cell-text">账号管理</view> | ||
22 | + </view> | ||
23 | + </van-cell> | ||
4 | </view> | 24 | </view> |
5 | </view> | 25 | </view> |
1 | .home_main { | 1 | .home_main { |
2 | - padding: 24rpx 20rpx; | ||
3 | - overflow-y: auto; | ||
4 | - overflow-x: hidden; | 2 | + height: 100vh; |
3 | + width: 100%; | ||
5 | } | 4 | } |
6 | 5 | ||
7 | -.home_main .home_content { | 6 | +.home_main .home-info { |
8 | width: 100%; | 7 | width: 100%; |
8 | + background: #3499ff; | ||
9 | + height: 160rpx; | ||
10 | + padding: 40rpx 20rpx; | ||
11 | + margin-top: 100rpx; | ||
12 | + display: flex; | ||
13 | +} | ||
14 | + | ||
15 | +.home_main .home-info .home-info-avatar { | ||
16 | + font-size: 48rpx; | ||
17 | + background: #fff; | ||
18 | + color: #3499ff; | ||
19 | + border-radius: 50%; | ||
20 | + width: 120rpx; | ||
21 | + height: 120rpx; | ||
22 | + text-align: center; | ||
23 | + line-height: 120rpx; | ||
24 | + margin-right: 20rpx; | ||
25 | +} | ||
26 | + | ||
27 | +.home_main .home-info .mine-info { | ||
28 | + color: #fff; | ||
29 | +} | ||
30 | + | ||
31 | +.home_main .home-info .mine-info .mine-info-basic { | ||
32 | + font-size: 40rpx; | ||
33 | +} | ||
34 | + | ||
35 | +.home_main .home-info .mine-info .mine-company { | ||
36 | + margin-top: 20rpx; | ||
37 | +} | ||
38 | + | ||
39 | +.home_main .home-info .mine-info .mine-company .mine-company-info { | ||
40 | + font-size: 28rpx; | ||
9 | } | 41 | } |
miniprogram/pages/login/login.json
0 → 100644
miniprogram/pages/login/login.min.css
0 → 100644
1 | +.login_main{height:100vh;width:100%;background-image:linear-gradient(180deg, rgba(7,54,207,0.08), rgba(0,90,255,0) 48%)}.login_main .login_content{margin:0 20rpx}.login_main .login_content .login_log{display:flex;width:100%;justify-content:center;padding-top:250rpx}.login_main .login_content .login_log .welcome-logo{width:300rpx;height:100rpx}.login_main .login_content .login_form{margin-top:100rpx;padding:0 50rpx;position:relative}.login_main .login_content .login_form .passwordMargin{margin-top:200rpx}.login_main .login_content .login_form .code-img{position:absolute;bottom:120rpx;right:50rpx;width:100rpx;height:80rpx}.login_main .login_content .login_form .login_btn{margin-top:20rpx;display:flex;justify-content:center;align-items:center;border-radius:10rpx;font-size:40rpx;color:#fff;text-align:center;line-height:100rpx;font-weight:400;background:rgba(23,100,255,0.9);box-shadow:0 0 1.06667vw 0 rgba(23,100,255,0.5)} |
miniprogram/pages/login/login.scss
0 → 100644
1 | +.login_main { | ||
2 | + height: 100vh; | ||
3 | + width: 100%; | ||
4 | + background-image: linear-gradient(180deg, rgba(7, 54, 207, .08), rgba(0, 90, 255, 0) 48%); | ||
5 | + | ||
6 | + .login_content { | ||
7 | + margin: 0 20rpx; | ||
8 | + // height: 100%; | ||
9 | + // width: 100%; | ||
10 | + | ||
11 | + .login_log { | ||
12 | + display: flex; | ||
13 | + width: 100%; | ||
14 | + justify-content: center; | ||
15 | + padding-top: 250rpx; | ||
16 | + | ||
17 | + // background-image: linear-gradient(180deg, rgba(225, 233, 252, .05) 12%, #f8f8f9); | ||
18 | + // background: red; | ||
19 | + .welcome-logo { | ||
20 | + width: 300rpx; | ||
21 | + height: 100rpx; | ||
22 | + } | ||
23 | + } | ||
24 | + .login_form { | ||
25 | + margin-top: 100rpx; | ||
26 | + padding: 0 50rpx; | ||
27 | + position: relative; | ||
28 | + .passwordMargin { | ||
29 | + margin-top: 200rpx; | ||
30 | + } | ||
31 | + .code-img { | ||
32 | + position: absolute; | ||
33 | + bottom: 120rpx; | ||
34 | + right: 50rpx; | ||
35 | + width: 100rpx; | ||
36 | + height: 80rpx; | ||
37 | + // background: red; | ||
38 | + } | ||
39 | + .login_btn { | ||
40 | + margin-top: 20rpx; | ||
41 | + display: flex; | ||
42 | + justify-content: center; | ||
43 | + align-items: center; | ||
44 | + border-radius:10rpx; | ||
45 | + font-size: 40rpx; | ||
46 | + color: #fff; | ||
47 | + text-align: center; | ||
48 | + line-height: 100rpx; | ||
49 | + font-weight: 400; | ||
50 | + | ||
51 | + background: rgba(23,100,255,.9); | ||
52 | + // background-image: linear-gradient(90deg, rgba(23, 100, 255, .5), rgba(23, 100, 255, .5)); | ||
53 | + box-shadow: 0 0 1.06667vw 0 rgba(23, 100, 255, .5); | ||
54 | + } | ||
55 | + } | ||
56 | + } | ||
57 | + | ||
58 | + | ||
59 | +} |
miniprogram/pages/login/login.ts
0 → 100644
1 | +// pages/login/login.ts | ||
2 | +import { API_CONST } from "./../../api/smartElectric"; | ||
3 | +import { HTTPService as HTTP } from "./../../services/HTTPService"; | ||
4 | +Page({ | ||
5 | + | ||
6 | + /** | ||
7 | + * 页面的初始数据 | ||
8 | + */ | ||
9 | + data: { | ||
10 | + logoUrl: "./../../img/qixiao.png", | ||
11 | + checkFlag: true, | ||
12 | + username: "",// 用户名 | ||
13 | + password: "",//密码 | ||
14 | + hideFlag: true,//是否隐藏 | ||
15 | + keyStr: "",// key值 | ||
16 | + imgUrl:"",//显示验证码的图片地址 | ||
17 | + codeKey: ""//验证码 | ||
18 | + }, | ||
19 | + | ||
20 | + /** | ||
21 | + * 生命周期函数--监听页面加载 | ||
22 | + */ | ||
23 | + onLoad() { | ||
24 | + this.__getLoginSecurityImg() | ||
25 | + }, | ||
26 | + | ||
27 | + /** | ||
28 | + * 生命周期函数--监听页面初次渲染完成 | ||
29 | + */ | ||
30 | + onReady() { | ||
31 | + | ||
32 | + }, | ||
33 | + | ||
34 | + /** | ||
35 | + * 生命周期函数--监听页面显示 | ||
36 | + */ | ||
37 | + onShow() { | ||
38 | + | ||
39 | + }, | ||
40 | + | ||
41 | + /** | ||
42 | + * 生命周期函数--监听页面隐藏 | ||
43 | + */ | ||
44 | + onHide() { | ||
45 | + | ||
46 | + }, | ||
47 | + | ||
48 | + /** | ||
49 | + * 生命周期函数--监听页面卸载 | ||
50 | + */ | ||
51 | + onUnload() { | ||
52 | + | ||
53 | + }, | ||
54 | + | ||
55 | + /** | ||
56 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
57 | + */ | ||
58 | + onPullDownRefresh() { | ||
59 | + | ||
60 | + }, | ||
61 | + | ||
62 | + /** | ||
63 | + * 页面上拉触底事件的处理函数 | ||
64 | + */ | ||
65 | + onReachBottom() { | ||
66 | + | ||
67 | + }, | ||
68 | + | ||
69 | + /** | ||
70 | + * 用户点击右上角分享 | ||
71 | + */ | ||
72 | + onShareAppMessage() { | ||
73 | + | ||
74 | + }, | ||
75 | + getPhoneNumber(e: any) { | ||
76 | + console.log(e, 'eeee---------eeeeee') | ||
77 | + wx.switchTab({ url: "/pages/monitor/monitor" }) | ||
78 | + // console.log(e.detail.code) // 动态令牌 | ||
79 | + // console.log(e.detail.errMsg) // 回调信息(成功失败都会返回) | ||
80 | + // console.log(e.detail.errno) // 错误码(失败时返回) | ||
81 | + }, | ||
82 | + loginEvent() :any{ | ||
83 | + if(!this.data.username|| !this.data.password){ | ||
84 | + wx.showToast({ | ||
85 | + title: "请将信息填写完整", | ||
86 | + icon: 'none', | ||
87 | + duration: 2000 | ||
88 | + }); | ||
89 | + return false; | ||
90 | + } | ||
91 | + HTTP.POST({ | ||
92 | + ...API_CONST.login.wxLogin, | ||
93 | + payload: this.getLoginParams() | ||
94 | + }).then((data: any) => { | ||
95 | + if (data.success) { | ||
96 | + wx.switchTab({ | ||
97 | + url: "/pages/monitor/monitor" | ||
98 | + }) | ||
99 | + } else { | ||
100 | + this.__getUserSecurityImg() | ||
101 | + wx.showToast({ | ||
102 | + title: data.msg || '请求失败', | ||
103 | + icon: 'error', | ||
104 | + duration: 2000 | ||
105 | + }); | ||
106 | + } | ||
107 | + }) | ||
108 | + | ||
109 | + }, | ||
110 | + userEvent(e: any) { | ||
111 | + this.setData({ | ||
112 | + username: e.detail | ||
113 | + }) | ||
114 | + }, | ||
115 | + passEvent(e: any) { | ||
116 | + this.setData({ | ||
117 | + password: e.detail | ||
118 | + }) | ||
119 | + }, | ||
120 | + getLoginParams() { | ||
121 | + // 组织ID登录 | ||
122 | + return { | ||
123 | + LOGIN_TYPE: 'CORP', | ||
124 | + code: this.data.codeKey.replace(/(^\s*)|(\s*$)/g, ''), // 图片验证码 | ||
125 | + corpCode: "default", | ||
126 | + username: this.data.username, | ||
127 | + password: this.data.password, | ||
128 | + key: this.data.keyStr, | ||
129 | + autoLogin: false, | ||
130 | + | ||
131 | + } | ||
132 | + }, | ||
133 | + imgKeyEvent(e: any) { | ||
134 | + this.setData({ | ||
135 | + codeKey: e.detail | ||
136 | + }) | ||
137 | + }, | ||
138 | + changeIconEvent() { | ||
139 | + this.setData({ | ||
140 | + checkFlag: !this.data.checkFlag | ||
141 | + }) | ||
142 | + }, | ||
143 | + //登录时获取key值 | ||
144 | + __getLoginSecurityImg() { | ||
145 | + HTTP.GET({ | ||
146 | + ...API_CONST.login.loginSecurity, | ||
147 | + payload: { | ||
148 | + corpCode: "default" | ||
149 | + } | ||
150 | + }).then((res: any) => { | ||
151 | + if (res.success) { | ||
152 | + this.setData({ | ||
153 | + hideFlag: res.data.hide,//是否隐藏 | ||
154 | + keyStr: res.data.key,// key值 | ||
155 | + }) | ||
156 | + if(res.data.hide === false){ | ||
157 | + this.__getUserSecurityImg() | ||
158 | + } | ||
159 | + } | ||
160 | + }) | ||
161 | + }, | ||
162 | + //用户获取codekey | ||
163 | + __getUserSecurityImg() { | ||
164 | + HTTP.GET({ | ||
165 | + ...API_CONST.login.userSecurity, | ||
166 | + payload: { | ||
167 | + corpCode: "default", | ||
168 | + key:this.data.keyStr | ||
169 | + } | ||
170 | + }).then((res: any) => { | ||
171 | + console.log(res,'res------') | ||
172 | + if (res.success) { | ||
173 | + this.setData({ | ||
174 | + hideFlag: res.data.hide,//是否隐藏 | ||
175 | + keyStr: res.data.key,// key值 | ||
176 | + imgUrl:res.data.img.replace(/[\r\n]/g, '') | ||
177 | + }) | ||
178 | + } | ||
179 | + }) | ||
180 | + } | ||
181 | +}) |
miniprogram/pages/login/login.wxml
0 → 100644
1 | +<view class="login_main"> | ||
2 | + <view class="login_content"> | ||
3 | + <view class="login_log"> | ||
4 | + <image src="{{logoUrl}}" class="welcome-logo" mode="" /> | ||
5 | + </view> | ||
6 | + <view class="login_form"> | ||
7 | + <van-cell-group> | ||
8 | + <van-field label="用户名" title-width="50" value="{{ username }}" bind:change="userEvent" required clearable placeholder="请输入手机号" bind:click-icon="onClickIcon" /> | ||
9 | + <van-field label="密码" title-width="50" value="{{ password }}" bind:change="passEvent" type="{{checkFlag?'':'password'}}" bind:click-icon="changeIconEvent" icon="{{checkFlag?'eye-o':'closed-eye'}}" placeholder="请输入密码" required /> | ||
10 | + | ||
11 | + <van-field wx:if="{{!hideFlag&& imgUrl}}" title-width="50" label="验证码" value="{{ codeKey }}" bind:change="imgKeyEvent" placeholder="请输入验证码" required /> | ||
12 | + <image src="{{imgUrl}}" wx:if="{{ imgUrl}}" class="code-img" /> | ||
13 | + </van-cell-group> | ||
14 | + <view class="login_btn" bind:tap="loginEvent"> | ||
15 | + 登录 | ||
16 | + </view> | ||
17 | + </view> | ||
18 | + | ||
19 | + </view> | ||
20 | + | ||
21 | +</view> |
miniprogram/pages/login/login.wxss
0 → 100644
1 | +.login_main { | ||
2 | + height: 100vh; | ||
3 | + width: 100%; | ||
4 | + background-image: linear-gradient(180deg, rgba(7, 54, 207, 0.08), rgba(0, 90, 255, 0) 48%); | ||
5 | +} | ||
6 | + | ||
7 | +.login_main .login_content { | ||
8 | + margin: 0 20rpx; | ||
9 | +} | ||
10 | + | ||
11 | +.login_main .login_content .login_log { | ||
12 | + display: flex; | ||
13 | + width: 100%; | ||
14 | + justify-content: center; | ||
15 | + padding-top: 250rpx; | ||
16 | +} | ||
17 | + | ||
18 | +.login_main .login_content .login_log .welcome-logo { | ||
19 | + width: 300rpx; | ||
20 | + height: 100rpx; | ||
21 | +} | ||
22 | + | ||
23 | +.login_main .login_content .login_form { | ||
24 | + margin-top: 100rpx; | ||
25 | + padding: 0 50rpx; | ||
26 | + position: relative; | ||
27 | +} | ||
28 | + | ||
29 | +.login_main .login_content .login_form .passwordMargin { | ||
30 | + margin-top: 200rpx; | ||
31 | +} | ||
32 | + | ||
33 | +.login_main .login_content .login_form .code-img { | ||
34 | + position: absolute; | ||
35 | + bottom: 120rpx; | ||
36 | + right: 50rpx; | ||
37 | + width: 100rpx; | ||
38 | + height: 80rpx; | ||
39 | +} | ||
40 | + | ||
41 | +.login_main .login_content .login_form .login_btn { | ||
42 | + margin-top: 20rpx; | ||
43 | + display: flex; | ||
44 | + justify-content: center; | ||
45 | + align-items: center; | ||
46 | + border-radius: 10rpx; | ||
47 | + font-size: 40rpx; | ||
48 | + color: #fff; | ||
49 | + text-align: center; | ||
50 | + line-height: 100rpx; | ||
51 | + font-weight: 400; | ||
52 | + background: rgba(23, 100, 255, 0.9); | ||
53 | + box-shadow: 0 0 1.06667vw 0 rgba(23, 100, 255, 0.5); | ||
54 | +} |
@@ -633,12 +633,12 @@ Page({ | @@ -633,12 +633,12 @@ Page({ | ||
633 | type: type | 633 | type: type |
634 | } | 634 | } |
635 | }).then((res: any) => { | 635 | }).then((res: any) => { |
636 | - console.log(res, 'res-----------getDate') | 636 | + // console.log(res, 'res-----------getDate') |
637 | var that = this | 637 | var that = this |
638 | if (res.success) { | 638 | if (res.success) { |
639 | that.setData({ | 639 | that.setData({ |
640 | - myLineObj: {}, | ||
641 | - homeLineObj: {} | 640 | + myLineObj: {} as any, |
641 | + homeLineObj: {} as any | ||
642 | }) | 642 | }) |
643 | if (type === "INDEX_MAP") { | 643 | if (type === "INDEX_MAP") { |
644 | that.setData({ | 644 | that.setData({ |
@@ -5,11 +5,18 @@ | @@ -5,11 +5,18 @@ | ||
5 | "compileHotReLoad": true, | 5 | "compileHotReLoad": true, |
6 | "urlCheck": false | 6 | "urlCheck": false |
7 | }, | 7 | }, |
8 | - "libVersion": "3.6.5", | 8 | + "libVersion": "3.6.6", |
9 | "condition": { | 9 | "condition": { |
10 | "miniprogram": { | 10 | "miniprogram": { |
11 | "list": [ | 11 | "list": [ |
12 | { | 12 | { |
13 | + "name": "pages/login/login", | ||
14 | + "pathName": "pages/login/login", | ||
15 | + "query": "", | ||
16 | + "launchMode": "default", | ||
17 | + "scene": null | ||
18 | + }, | ||
19 | + { | ||
13 | "name": "监控-首页", | 20 | "name": "监控-首页", |
14 | "pathName": "pages/monitor/monitor", | 21 | "pathName": "pages/monitor/monitor", |
15 | "query": "", | 22 | "query": "", |