zhaoxiaohai 2 rokov pred
rodič
commit
98c28962df

+ 74 - 0
pages/login/modules/account.js

@@ -0,0 +1,74 @@
+const loginMsg = require("./login"),
+    md5 = require("../../../utils/md5"),
+    _Http = getApp().globalData.http;
+
+Component({
+    properties: {},
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        accountno: "",
+        password: "",
+        inputType: "password", //密码输入框类型
+        memory: true, //记忆
+        focus: false,
+    },
+    lifetimes: {
+        attached: function () {
+            /* 恢复缓存中保存的账号密码 */
+            this.setData({
+                ...wx.getStorageSync('loginMsg')
+            });
+            this.allowOrNot();
+        }
+    },
+    methods: {
+        /* input输入 */
+        inputChange(e) {
+            this.setData({
+                [e.target.dataset.name]: e.detail.value.trim()
+            })
+            this.allowOrNot()
+        },
+        /* 验证是否允许登录 */
+        allowOrNot() {
+            getCurrentPages()[0].setData({
+                disabled: (this.data.accountno.length > 0 && this.data.password.length > 0) ? false : true
+            })
+        },
+        /* 改变密码输入框类型 */
+        changePasswordType() {
+            this.setData({
+                inputType: this.data.inputType == "text" ? 'password' : 'text'
+            })
+        },
+        /* 是否记忆密码 */
+        isMemory() {
+            this.setData({
+                memory: !this.data.memory
+            })
+        },
+        /* 处理登录 */
+        handleLogin() {
+            _Http.login({
+                "accountno": this.data.accountno,
+                "password": md5.hexMD5(this.data.password),
+                "systemclient": "wechatsaletool"
+            }).then(res => {
+                getCurrentPages()[0].setData({
+                    loading: false
+                })
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                })
+                wx.setStorageSync('loginMsg', {
+                    accountno: this.data.accountno,
+                    password: (this.data.memory) ? this.data.password : ''
+                })
+                loginMsg.loginMsg(res);
+            })
+        }
+    }
+})

+ 6 - 0
pages/login/modules/account.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-checkbox": "@vant/weapp/checkbox/index"
+    }
+}

+ 32 - 0
pages/login/modules/account.scss

@@ -0,0 +1,32 @@
+.input {
+    text-align: left;
+    margin-left: 50rpx;
+}
+
+.image {
+    width: 40rpx !important;
+    height: 40rpx !important;
+}
+
+.box {
+    display: flex;
+    justify-content: space-between;
+    width: 690rpx;
+    margin: 40rpx auto 0;
+    font-family: PingFang SC-Regular, PingFang SC;
+
+    .checkbox {
+        font-size: 24rpx;
+        color: #666666;
+        margin-top: -3rpx;
+    }
+
+    .label {
+        margin-left: -10rpx;
+    }
+
+    .view {
+        font-size: 24rpx;
+        color: #999999;
+    }
+}

+ 18 - 0
pages/login/modules/account.wxml

@@ -0,0 +1,18 @@
+<van-cell>
+    <text slot='icon' class="iconfont icon-a-biaoqianlanwodexuanzhong" />
+    <input class="input" type="text" value='{{accountno}}' bindinput="inputChange" data-name="accountno" placeholder="请输入账户名" />
+</van-cell>
+<van-cell>
+    <text slot='icon' class="iconfont icon-a-wodemima" />
+    <input class="input" wx:if="{{inputType=='text'}}" focus='{{focus}}' bindinput="inputChange" data-name="password" value="{{password}}" placeholder="请输入密码" />
+    <input class="input" wx:else type="password" focus='{{focus}}' bindinput="inputChange" data-name="password" value="{{password}}" placeholder="请输入密码" />
+    <view slot='right-icon' style="width: 90rpx;height: 22.4px; display: flex; justify-content: flex-end;" catchtap="changePasswordType">
+        <image class="image" src="{{inputType=='password'?'/static/image/dp-none.svg':'/static/image/dp-show.svg'}}" />
+    </view>
+</van-cell>
+<view class="box">
+    <van-checkbox custom-class='checkbox' label-class='label' icon-size="28rpx" value="{{ memory }}" shape="square" bind:change="isMemory">
+        记住密码
+    </van-checkbox>
+    <navigator url="./retrievePassword" class="view">忘记密码?</navigator>
+</view>

+ 59 - 0
pages/login/modules/agreement.js

@@ -0,0 +1,59 @@
+// pages/login/modules/agreement.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        isAgree: {
+            type: Boolean
+        },
+        callBack: {
+            type: Function
+        }
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        /* 修改授权 */
+        isAgreeChange() {
+            let isAgree = !this.data.isAgree
+            this.setData({
+                isAgree
+            })
+            this.triggerEvent("callBack", isAgree)
+        },
+        checkTheAgreement() {
+            wx.showLoading({
+                title: '加载中...',
+            })
+            wx.downloadFile({
+                url: 'https://mdyossys.obs.cn-east-3.myhuaweicloud.com/resources/%E7%BE%8E%E5%A4%A7CRM%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%9A%90%E7%A7%81%E4%BF%9D%E6%8A%A4%E6%8C%87%E5%BC%95.docx',
+                success: (res) => {
+                    wx.openDocument({
+                        filePath: res.tempFilePath,
+                        success:(s)=>{
+                            wx.hideLoading();
+
+                        },
+                        fail: (err) => {
+                            wx.hideLoading();
+                            wx.showToast({
+                                title: '读取失败,请稍后再试',
+                                icon: "none"
+                            })
+                        }
+                    })
+                },
+                fail: (err) => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        title: '读取失败,请稍后再试',
+                        icon: "none"
+                    })
+                }
+            })
+        }
+    }
+})

+ 6 - 0
pages/login/modules/agreement.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-checkbox": "@vant/weapp/checkbox/index"
+    }
+}

+ 19 - 0
pages/login/modules/agreement.scss

@@ -0,0 +1,19 @@
+/* 登录协议 */
+.agreement {
+    display: flex;
+    width: 100%;
+    justify-content: center;
+
+    .con {
+        width: 376rpx;
+        text-align: center;
+        font-size: 24rpx !important;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #666666 !important;
+        margin-left: -20rpx;
+
+        text {
+            color: #3874F6;
+        }
+    }
+}

+ 3 - 0
pages/login/modules/agreement.wxml

@@ -0,0 +1,3 @@
+<view class="agreement">
+    <van-checkbox icon-size="28rpx" label-class='con' value="{{ isAgree }}" bind:change="isAgreeChange">登录代表您已同意<text catchtap="checkTheAgreement">《隐私协议》</text></van-checkbox>
+</view>

+ 82 - 0
pages/login/modules/login.js

@@ -0,0 +1,82 @@
+const _Http = getApp().globalData.http;
+let count = 0; //接口完成数量
+
+function loginMsg(res) {
+    wx.setStorageSync('account_list', res.account_list);
+    if (res.account_list.length == 1) {
+        wx.setStorageSync('userMsg', res.account_list[0])
+        query_userauth();
+    } else {
+        wx.redirectTo({
+            url: './selectSite',
+        })
+    }
+}
+/* 获取用户权限 */
+function query_userauth() {
+    query_adspacelist();
+    querySite_Parameter();
+    _Http.basic({
+        "classname": "sysmanage.develop.userauth.userauth",
+        "method": "query_userauth",
+        content: {
+            nocache: true
+        }
+    }).then(res => {
+        if (res.msg != '成功') return wx.showToast({
+            title: '权限查询失败,请稍后再试',
+            icon: "none"
+        })
+        wx.setStorageSync('userauth', res.data);
+        count += 1;
+        toHome();
+    });
+    if (!getApp().globalData.socketEstablish) getApp().initSocket();
+}
+/* 查询站点数据 */
+function querySite_Parameter() {
+    _Http.basic({
+        "classname": "webmanage.site.site",
+        "method": "querySite_Parameter",
+        "content": {}
+    }).then(res => {
+        if (res.msg != '成功') return wx.showToast({
+            title: res.msg,
+            icon: "none"
+        });
+        wx.setStorageSync('siteP', res.data);
+        count += 1;
+        toHome();
+    })
+}
+/* 查询轮播图 */
+function query_adspacelist() {
+    _Http.basic({
+        "classname": "common.adspace.adspace",
+        "method": "query_adspacelist",
+        "content": {}
+    }).then(res => {
+        if (res.msg != '成功') return wx.showToast({
+            title: res.msg,
+            icon: "none"
+        });
+        wx.setStorageSync('banner_list', res.data)
+        count += 1;
+        toHome();
+    })
+}
+
+function toHome() {
+    if (count < 3) return;
+    let pages = getCurrentPages();
+    let prevPage = pages[pages.length - 2];
+    if (prevPage && prevPage.__route__ == 'pages/tabbar/home/index') prevPage.refreshData();
+    wx.switchTab({
+        url: '/pages/tabbar/home/index'
+    })
+}
+/* 站点数据查询 */
+module.exports = {
+    loginMsg,
+    query_userauth
+}

+ 103 - 0
pages/login/modules/phone.js

@@ -0,0 +1,103 @@
+let loginMsg = require("./login"),
+    md5 = require("../../../utils/md5"),
+    _Http = getApp().globalData.http,
+    Check = require("../../../utils/Check"),
+    downCount = null;
+
+Component({
+    properties: {},
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        phonenumber: '',
+        password: '',
+        showText: "获取验证码",
+        memory: true
+    },
+    lifetimes: {
+        attached: function () {
+            /* 恢复缓存中保存的账号密码 */
+            this.setData({
+                ...wx.getStorageSync('loginMsg')
+            });
+            setTimeout(this.allowOrNot, 300)
+        }
+    },
+    methods: {
+        /* 获取验证码 */
+        getPassword() {
+            if (this.data.showText != "获取验证码") return;
+            if (!Check.CheckPhoneNumber(this.data.phonenumber)) return;
+            _Http.getpassword({
+                "phonenumber": this.data.phonenumber,
+                "systemclient": "wechatsaletool"
+            }).then(res => {
+                wx.showToast({
+                    title: res.msg,
+                    icon: "none",
+                    duration: 3000
+                })
+                if (res.code != 1) return;
+                this.setData({
+                    showText: 30
+                })
+                downCount = setInterval(() => {
+                    let showText = this.data.showText;
+                    if (showText == 0) {
+                        clearInterval(downCount)
+                        showText = '获取验证码'
+                    } else {
+                        showText--
+                    }
+                    this.setData({
+                        showText
+                    })
+                }, 1000)
+            })
+        },
+        /* input输入 */
+        inputChange(e) {
+            this.setData({
+                [e.target.dataset.name]: e.detail.value.trim()
+            })
+            this.allowOrNot();
+        },
+        /* 验证是否允许登录 */
+        allowOrNot() {
+            getCurrentPages().forEach(v => {
+                if (['pages/login/phone'].includes(v.__route__)) {
+                    v.setData({
+                        disabled: this.data.phonenumber.length == 0 || this.data.password.length == 0
+                    })
+                }
+            })
+        },
+        /* 处理登录 */
+        handleLogin() {
+            _Http.plogin({
+                "phonenumber": this.data.phonenumber,
+                "password": md5.hexMD5(this.data.password),
+                "systemclient": "wechatsaletool"
+            }).then(res => {
+                getCurrentPages()[0].setData({
+                    loading: false
+                })
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                })
+                wx.setStorageSync('loginMsg', {
+                    phonenumber: (this.data.memory) ? this.data.phonenumber : ''
+                })
+                loginMsg.loginMsg(res);
+            })
+        },
+        /* 是否记忆密码 */
+        isMemory() {
+            this.setData({
+                memory: !this.data.memory
+            })
+        },
+    }
+})

+ 6 - 0
pages/login/modules/phone.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-checkbox": "@vant/weapp/checkbox/index"
+    }
+}

+ 14 - 0
pages/login/modules/phone.scss

@@ -0,0 +1,14 @@
+@import './account.scss';
+
+.box {
+    width: 100vw;
+    padding: 0 50rpx;
+    box-sizing: border-box;
+}
+
+.right-icon {
+    width: 180rpx;
+    text-align: center;
+    height: 22.4px;
+    border-left: 1rpx solid #ddd;
+}

+ 16 - 0
pages/login/modules/phone.wxml

@@ -0,0 +1,16 @@
+<van-cell>
+    <text slot='icon' class="iconfont icon-a-wodemendianxinxidianhua" />
+    <input class="input" type="number" value='{{phonenumber}}' bindinput="inputChange" data-name="phonenumber" placeholder="请输入手机号" />
+</van-cell>
+<van-cell>
+    <text slot='icon' class="iconfont icon-a-biaoqianlanxiaoxixuanzhong" />
+    <input class="input" type="number" bindinput="inputChange" data-name="password" value="{{password}}" placeholder="请输入验证码" />
+    <view slot='right-icon' class="right-icon" catchtap="getPassword">
+        {{showText=='获取验证码'?showText:showText+'s'}}
+    </view>
+</van-cell>
+<view class="box">
+    <van-checkbox custom-class='checkbox' label-class='label' icon-size="28rpx" value="{{ memory }}" shape="square" bind:change="isMemory">
+        记住号码
+    </van-checkbox>
+</view>

+ 62 - 0
pages/login/phone.js

@@ -0,0 +1,62 @@
+import Toast from '@vant/weapp/toast/toast';
+const _Http = getApp().globalData.http,
+    loginMsg = require("./modules/login");
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        isAgree: true,
+        disabled: true, //是否禁用
+        loading: false, //登陆中
+    },
+    onLoad(options) {},
+    /* 微信登录 */
+    wechatLogin() {
+        if (!this.data.isAgree) return Toast({
+            message: '请阅读并勾选用户协议',
+            position: 'bottom'
+        });
+        wx.login({
+            success(res) {
+                if (res.code) {
+                    _Http.loginbywechat({
+                        wechat_code: res.code,
+                        "systemclient": "wechatsaletool"
+                    }).then(res => {
+                        console.log("微信快捷登录", res)
+                        if (res.code == 0) return wx.showToast({
+                            title: res.msg,
+                            icon: "none"
+                        })
+                        loginMsg.loginMsg(res);
+                    })
+                } else {
+                    console.log('登录失败!' + res.errMsg)
+                }
+            }
+        })
+    },
+    /* 用户登录 */
+    userLogin() {
+        if (this.data.loading || this.data.disabled) return;
+        if (!this.data.isAgree) return Toast({
+            message: '请阅读并勾选用户协议',
+            position: 'bottom'
+        });
+        this.setData({
+            loading: true
+        })
+        this.selectComponent('#login').handleLogin();
+    },
+    /* 授权 */
+    agreementChange({
+        detail
+    }) {
+        this.setData({
+            isAgree: detail
+        })
+    },
+    onShareAppMessage() {}
+})

+ 9 - 0
pages/login/phone.json

@@ -0,0 +1,9 @@
+{
+    "navigationBarTitleText": "账户登录",
+    "usingComponents": {
+        "Agreement": "./modules/agreement",
+        "van-divider": "@vant/weapp/divider/index",
+        "account": "./modules/account",
+        "phone": "./modules/phone"
+    }
+}

+ 33 - 0
pages/login/phone.scss

@@ -0,0 +1,33 @@
+page {
+    background: #ffffff;
+}
+
+.logo {
+    width: 100vw;
+    height: 340rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    margin-bottom: 40rpx;
+
+    image {
+        width: 192rpx !important;
+        height: 192rpx !important;
+        border-radius: 24rpx;
+        border: 2rpx solid #CCC;
+        margin-top: 60rpx;
+    }
+}
+
+.iconfont {
+    color: var(--assist);
+}
+
+.login {
+    width: 650rpx;
+    height: 90rpx;
+    border-radius: 16rpx !important;
+    font-size: 28rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #FFFFFF;
+}

+ 25 - 0
pages/login/phone.wxml

@@ -0,0 +1,25 @@
+<view class="logo">
+    <image src="/static/image/logo.png" />
+</view>
+
+<!-- 手机号登录/账号登录  -->
+<phone id='login' wx:if="{{false}}" />
+<account wx:else id='login' />
+
+<view style="width: 100vw; text-align: center;margin-top: 60rpx;margin-bottom: 40rpx;">
+    <van-button disabled='{{disabled}}' custom-class='login' bindtap="userLogin" loading='{{loading}}' loading-text="登陆中..." color='linear-gradient(90deg, #3874F6 0%, #095DE0 100%);'>登录</van-button>
+</view>
+
+<!-- 隐私协议 -->
+<Agreement isAgree='{{isAgree}}' bindcallBack='agreementChange' />
+
+<!-- 快捷登录 -->
+<block >
+    <view style="height: 100rpx;" />
+    <van-divider contentPosition="center">其他登录方式</van-divider>
+    <view style="width: 100%; text-align: center;">
+        <text class="iconfont icon-a-wodebangdingweixin" style="font-size: 100rpx; color:#07C160;" bindtap="wechatLogin" />
+    </view>
+</block>
+
+<van-toast id="van-toast" />

+ 152 - 0
pages/login/retrievePassword.js

@@ -0,0 +1,152 @@
+const _Http = getApp().globalData.http;
+import Toast from '@vant/weapp/toast/toast';
+const md5 = require('../../utils/md5');
+let passwordDowm = null;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        from: {
+            accountno: "", //账户名
+            password: "", //验证码
+            newPassword: "", //新密码
+            verifyNewPassword: "", //确认密码
+        },
+        disabled: true, //修改按钮禁用
+        loading: false,
+        confirmPassword: "", //两次密码是否一致
+        countDown: "", //倒计时
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+    /* 获取验证码 */
+    getPassword() {
+        let accountno = this.data.from.accountno;
+        if (!accountno) return Toast({
+            message: '您还未填写账户名称',
+            position: 'bottom'
+        });
+        if (this.data.countDown != '') return Toast({
+            message: '您已发送验证码,请勿重复获取',
+            position: 'bottom'
+        });
+        _Http.base({
+            "classname": "common.usercenter.usercenter",
+            "method": "forgetPassword_getPassWord",
+            "content": {
+                accountno
+            }
+        }, false).then(res => {
+            if (res.code != 1) return Toast({
+                message: res.data,
+                position: 'bottom'
+            });
+            this.setData({
+                countDown: 30
+            })
+            passwordDowm = setInterval(() => {
+                let countDown = (this.data.countDown == 0) ? '' : this.data.countDown - 1;
+                this.setData({
+                    countDown
+                })
+                if (countDown == '') clearInterval(passwordDowm)
+            }, 1000);
+            Toast({
+                message: res.msg,
+                position: 'bottom'
+            });
+        })
+    },
+    /* 表单输入 */
+    formInput(e) {
+        let v = e.detail.value.trim(),
+            name = e.currentTarget.dataset.name;
+        this.setData({
+            [`from.${name}`]: v
+        });
+        let disabled = false,
+            from = this.data.from;
+        for (let i in from) {
+            if (from[i] == '') disabled = true;
+        }
+        this.setData({
+            disabled
+        })
+        this.passwordBlur();
+    },
+    /* 验证确认密码 */
+    passwordBlur() {
+        let {
+            from
+        } = this.data,
+            confirmPassword = from.newPassword == from.verifyNewPassword;
+        if (from.newPassword == '' || from.verifyNewPassword == '') confirmPassword = ""
+        this.setData({
+            confirmPassword
+        })
+    },
+    /* 清除确认密码 */
+    clearNewPassword() {
+        this.setData({
+            ['from.verifyNewPassword']: '',
+            confirmPassword: ""
+        })
+    },
+    /* 修改密码 */
+    changePassword() {
+        if (this.data.disabled || this.data.loading) return;
+        if (this.data.confirmPassword != true) return Toast({
+            message: '请检查新密码与确认密码',
+            position: 'bottom'
+        });
+        let from = this.data.from;
+        this.setData({
+            loading: true
+        })
+        _Http.base({
+            "classname": "common.usercenter.usercenter",
+            "method": "forgetPassword_changePassWord",
+            "content": {
+                "password": md5.hexMD5(from.password),
+                "accountno": from.accountno,
+                "newpassword": md5.hexMD5(from.newPassword)
+            }
+        }).then(res => {
+            this.setData({
+                loading: false
+            })
+            if (res.msg != '成功') return Toast({
+                message: res.msg,
+                position: 'bottom'
+            });
+            this.setData({
+                disabled: true
+            })
+            wx.showToast({
+                title: '修改成功!',
+            })
+            let pages = getCurrentPages(),
+                prevPage = pages[pages.length - 2];
+            prevPage.setData({
+                password: "" // 需要传递的值
+            })
+            wx.setStorageSync('loginMsg', {
+                "accountno": this.data.from.accountno,
+                "password": this.data.from.newPassword
+            })
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 0
+                })
+            }, 300)
+        })
+    },
+    onShareAppMessage() {}
+})

+ 4 - 0
pages/login/retrievePassword.json

@@ -0,0 +1,4 @@
+{
+    "navigationBarTitleText": "找回密码",
+    "usingComponents": {}
+}

+ 1 - 0
pages/login/retrievePassword.scss

@@ -0,0 +1 @@
+@import "../../pages/tabbar/mine/changePassword/index.scss";

+ 32 - 0
pages/login/retrievePassword.wxml

@@ -0,0 +1,32 @@
+<My_card custom-class='input-field'>
+    <view class="icon-box">
+        <text class="iconfont icon-a-biaoqianlanwodexuanzhong" />
+    </view>
+    <input class="input" type="text" bindinput="formInput" data-name="accountno" placeholder='请填写账户名' />
+</My_card>
+<My_card custom-class='input-field'>
+    <view class="icon-box">
+        <text class="iconfont icon-hujiao" />
+    </view>
+    <input class="input" type="number" bindinput="formInput" data-name="password" placeholder='请填写验证码' />
+    <view class="auth-code" bindtap="getPassword">{{countDown?countDown+'s':'获取验证码'}}</view>
+</My_card>
+<My_card custom-class='input-field'>
+    <view class="icon-box">
+        <text class="iconfont icon-a-wodemima" />
+    </view>
+    <input class="input" password bindinput="formInput" data-name="newPassword" placeholder='请设置6-20位新密码' />
+</My_card>
+<My_card custom-class='input-field'>
+    <view class="icon-box">
+        <text class="iconfont icon-a-wodemima" />
+    </view>
+    <input class="input" password value="{{from.verifyNewPassword}}" bindinput="formInput" data-name="verifyNewPassword" placeholder='请确认新密码' />
+    <view wx:if="{{confirmPassword===false}}" class="errmsg">两次密码不一致
+        <van-icon class="iconfont" name="clear" bind:click="clearNewPassword" />
+    </view>
+</My_card>
+<view style="width: 100%; text-align: center;margin-top: 100rpx;">
+    <van-button disabled='{{disabled}}' bindtap="changePassword" loading='{{loading}}' loading-text="修改中..." custom-class='but-style'>确定修改</van-button>
+</view>
+<van-toast id="van-toast" />

+ 31 - 0
pages/login/selectSite.js

@@ -0,0 +1,31 @@
+const login = require('./modules/login');
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        account_list: ""
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {},
+
+    toHome(e) {
+        const {
+            item
+        } = e.currentTarget.dataset;
+        wx.setStorageSync('userMsg', item);
+        login.query_userauth();
+    },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+        this.setData({
+            account_list: wx.getStorageSync('account_list')
+        })
+    },
+    onShareAppMessage() {}
+})

+ 4 - 0
pages/login/selectSite.json

@@ -0,0 +1,4 @@
+{
+    "navigationBarTitleText": "选择站点",
+    "usingComponents": {}
+}

+ 22 - 0
pages/login/selectSite.scss

@@ -0,0 +1,22 @@
+navigator {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 690rpx;
+    height: 90rpx;
+    margin: 20rpx auto 0;
+    background-color: #ffffff;
+    border-radius: 16rpx;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+
+    view {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+    }
+
+    .iconfont {
+        color: #CCCCCC;
+    }
+}

+ 4 - 0
pages/login/selectSite.wxml

@@ -0,0 +1,4 @@
+<navigator wx:for="{{account_list}}" url="#" data-item='{{item}}' bindtap="toHome">
+    <view>{{item.sitename}}</view>
+    <view class="iconfont icon-a-wodetiaozhuan" />
+</navigator>