| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <html>
- <head>
- <style>
- .body {
- background: url(/imgs/universe.mobile.jpg) right bottom;
- background-size: cover;
- }
- .content-wrap {
- width: 86%;
- margin: 0 auto;
- }
- .logo {
- text-align: center;
- margin: 13% 0;
- }
- .login-form-item {
- box-sizing: border-box;
- width: 100%;
- height: 80px;
- margin-bottom: 20px;
- position: relative;
- }
- .login-form-item input {
- box-sizing: border-box;
- display: inline-block;
- width: 100%;
- height: 100%;
- padding: 0 60px;
- font-size: 20px;
- background-color: #f0f1f5;
- border: none;
- border-radius: 50px;
- overflow: hidden;
- text-align: center;
- }
- ::-webkit-input-placeholder {
- /* WebKit browsers */
- color: #a6a9b7;
- font-size: 18px;
- }
- ::-moz-placeholder {
- /* Mozilla Firefox 19+ */
- color: #a6a9b7;
- font-size: 18px;
- }
- :-ms-input-placeholder {
- /* Internet Explorer 10+ */
- color: #a6a9b7;
- font-size: 18px;
- }
- input:-webkit-autofill,
- textarea:-webkit-autofill,
- select:-webkit-autofill {
- background-color: #f0f1f5;
- background-image: none;
- transition: background-color 50000s ease-in-out 0s;
- /*背景色透明 生效时长 过渡效果 启用时延迟的时间*/
- }
- .login-form-item img {
- position: absolute;
- top: 50%;
- right: 26px;
- transform: translateY(-50%);
- width: 20px;
- }
- .login-form-item .login-password-left {
- left: 26px;
- }
- .login-btn {
- width: 80px;
- height: 80px;
- line-height: 80px;
- border-radius: 50%;
- background-color: #e5e7ef;
- text-align: center;
- margin: 20px auto;
- }
- .login-btn-active {
- background-image: linear-gradient(to right, #01c2fb, #3796fe);
- }
- .login-btn img {
- width: 26px;
- vertical-align: middle;
- }
- .login-error {
- color: #ee0a24;
- text-align: center;
- font-size: 18px;
- }
- .login-error i {
- font-size: 30px;
- vertical-align: middle;
- }
- .login-WeChat {
- background-color: #07c160;
- color: #fff;
- text-align: center;
- height: 60px;
- line-height: 60px;
- border-radius: 40px;
- font-size: 18px;
- margin-top: 55px;
- }
- .login-WeChat i {
- vertical-align: middle;
- font-size: 30px;
- }
- #wxLoginLoading {
- width: 100%;
- min-height: 300px;
- text-align: center;
- margin-top: 20%;
- }
- #wxLoginLoading .icon-bindingWechat {
- font-size: 100px;
- color: #fff;
- padding: 12px;
- background-color: #50d678;
- border-radius: 20px;
- box-shadow: 1px 1px 30px #50d678
- }
- </style>
- <title>登录 - ${curWebSiteObj.seoTitle}</title>
- </head>
- <body class="body" style="background-color: #fff;">
- <div id="space-content" v-cloak>
- <div class="content-wrap">
- <div v-show="isShowLogin">
- <div class="logo">
- <van-image width="100%" height="100" fit="contain" src="${curWebSiteObj.whiteLogoFile}"></van-image>
- </div>
- <div class="login-form">
- <div class="login-form-item login-user">
- <input id="uname" type="text" placeholder="输入账号" v-model="userVal" @input="userValInput">
- </div>
- <div class="login-form-item login-password">
- <img :src="eyeSrc" alt="" class="login-password-left" v-show="isShowIcon"
- @click="closeEyeClick">
- <input id="upwd" :type="inputType" placeholder="输入密码" v-model="passwordVal"
- @input="passwordInput">
- <img src="/apps/space/images/mobile/login/close.png" alt="" v-show="isShowIcon"
- @click="clearClick">
- </div>
- <div style="min-height:36px">
- <div class="login-error" v-if="isShowMsg">
- <i class="spaceicon icon-failed2"></i>
- <span>
- {{msg}}
- </span>
- </div>
- </div>
- <!-- 账号、密码都有就加上login-btn-active类名,否则不加 -->
- <div class="login-btn" :class="{'login-btn-active':userVal.length>0}" @click="login">
- <img src="/apps/space/images/mobile/login/arrowsRight.png" alt="">
- </div>
- <!-- 微信登录按钮 -->
- <div class="login-form-item login-WeChat" @click="wxLogin" v-if="isWxClientFlag">
- <i class="spaceicon icon-wechat1"></i>
- <span>微信登录</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- if (window.top != window.self) {
- top.location.href = "/console";
- }
- </script>
- <script>
- space.vue = new Vue({
- el: "#space-content",
- data: function () {
- return {
- userVal: "",
- passwordVal: "",
- isShowIcon: false,
- isShowLogin: false,
- eyeSrc: "/apps/space/images/mobile/login/closeEye.png",
- inputType: "password",
- isWxClientFlag: false,
- msg: '${appmsg}',
- isShowMsg: false,
- }
- },
- methods: {
- hiddenMsg: function () {
- if (this.isShowMsg) {
- this.isShowMsg = !this.isShowMsg;
- }
- },
- userValInput: function () {
- this.hiddenMsg();
- },
- passwordInput: function () {
- var len = this.passwordVal.length;
- if (len > 0) {
- this.isShowIcon = true;
- } else {
- this.isShowIcon = false;
- }
- this.hiddenMsg();
- },
- clearClick: function () {
- this.passwordVal = "";
- this.isShowIcon = false;
- this.hiddenMsg();
- },
- closeEyeClick: function () {
- if (this.inputType == "password") {
- this.eyeSrc = "/apps/space/images/mobile/login/openEye.png";
- this.inputType = "text";
- } else {
- this.eyeSrc = "/apps/space/images/mobile/login/closeEye.png";
- this.inputType = "password";
- }
- },
- isWxClient: function () {
- var ua = window.navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == 'micromessenger') {
- return true;
- } else {
- return false;
- }
- },
- login: function () {
- var _this = this;
- if (space.utils.isNull(_this.userVal)) {
- $("#uname").focus();
- return;
- }
- if (space.utils.isNull(_this.passwordVal)) {
- $("#upwd").focus();
- return;
- }
- space.utils.ajax({
- type: "post",
- url: '@service{ name:`sys.login` }@',
- dataType: 'json',
- data: {
- uname: _this.userVal,
- upwd: _this.passwordVal
- },
- callback: function (data) {
- if (data.code == 'success') {
- if (data.data.resultCode == 1000) {
- _this.msg = data.data.msg;
- _this.isShowMsg = true;
- } else if (data.data.resultCode == 1010) {
- top.location.href = "/apps/workbench/";
- }
- }
- }
- });
- },
- wxLogin: function () {
- location.href = "/apps/wxlogin/?sid=${sid}";
- }
- },
- mounted: function () {
- this.isShowMsg = space.utils.notNull(this.msg);
- this.isWxClientFlag = this.isWxClient();
- if (!this.isWxClientFlag) {
- this.isShowLogin = true;
- }
- var sid = '${sid}';
- if (space.utils.notNull(sid)) {
- this.wxLogin();
- return;
- }
- // 特殊处理,由于需要进行支付,所以默认要进行授权
- var appCode = "${appcode}";
- if (space.utils.isNull(appCode)) {
- appCode = "null";
- }
- if (this.isWxClientFlag) {
- if (appCode == "null") {
- location.href = '/apps/wxauth/';
- } else if (appCode == "ok") {
- this.isShowLogin = true;
- } else if (appCode == 'appFail') {
- this.isShowLogin = true;
- } else if (appCode == "fail") {
- space.message.warning("${appmsg}");
- }
- }
- }
- })
- </script>
- </body>
- </html>
|