Commit d3eab360 by Chao Sun

login

parents
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}
{"type":"module"}
\ No newline at end of file
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
uni-page-body{
height: 100%;
}
</style>
import request from "../util/request";
import {baseURL,apiURL,sfpURL} from "../environments/environment";
export default {
//查看token是否已经失效
checkToken(){
const params = {
token:uni.getStorageSync('uni-token'),
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/checkToken`, "POST", params)
},
// 获取token
obtainToken(){
const params = {
ticket:'uni-app'
}
return request(`${baseURL}/api/authorize/obtainToken`, "POST", params)
},
}
<template>
<view class="wrapper">
<view class="logo">
<img src="/static/logo.png" alt="logo" srcset="">
<view>欢迎登录使用CFFP</view>
</view>
<view class="content">
<view class="login_title">
{{loginTypeName}}
</view>
<form>
<view class="inputItem" v-if="loginType==='register'">
<input class="uni-input" name="invitationCode" placeholder="输入邀请码(非必填)" />
</view>
<view class="inputItem">
<input class="uni-input" name="mobileNo" placeholder="输入手机号" />
</view>
<view class="inputItem" v-if="loginType === 'codelogin' || loginType==='register'">
<input class="uni-input" name="code" placeholder="输入验证码" />
<text @click="sendMessage()">{{sedCode}}</text>
</view>
<view class="inputItem" v-if="loginType === 'pwlogin' || loginType==='register'">
<input class="uni-input" type="text" name="password" placeholder="输入密码" v-if="!passwordFlag"/>
<input class="uni-input" type="text" password name="password" placeholder="输入密码" v-if="passwordFlag"/>
<text v-if="passwordFlag" @click="passwordFlag=false">显示密码</text>
<text v-if="!passwordFlag" @click="passwordFlag=true">不显示密码</text>
</view>
</form>
<view class="agree">
<icon :type="radioUnselect" size="26"/><text>已阅读并同意</text><a href="#">银盾保险经纪服务协议</a><text></text><a href="">隐私政策</a>
</view>
<view class="login_btn">
{{loginType=='register'?'注册':'登录'}}
</view>
<view class="login_type">
<text @click="getLogin()">{{(loginType=='pwlogin' || loginType=='register')?'验证码登录':'密码登录'}}</text>
<text @click="register()">{{loginType=='codelogin'?'立即注册':'忘记密码'}}</text>
</view>
<view>
<view class="other_login">
<text class="text_line"></text>
<text style="margin: 0 40rpx;position: relative;top: 10rpx;">其他登录</text>
<text class="text_line"></text>
</view>
<view class="login_type">
<text>游客</text>
<text>代理商</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 登陆方式初始化为验证码登录
loginType: 'codelogin',
passwordFlag:false,
loginTypeName:'验证码登录',
countdown:60,
sedCode:'获取验证码'
}
},
methods: {
formReset: function(e) {
console.log('清空数据')
},
getLogin(){
this.loginType==='codelogin'?this.loginType='pwlogin':this.loginType='codelogin';
this.loginTypeName = this.loginType =='codelogin'?'验证码登录':'密码登录';
},
register(){
this.loginType = 'register';
this.loginTypeName = '注册';
},
sendMessage(){
this.delayTime()
},
delayTime() {
if (this.countdown == 0) {
this.isValid = false;
this.sedCode = "重新发送";
this.countdown = 60;
} else {
this.isValid = true;
this.sedCode = this.countdown + "s";
this.countdown--;
setTimeout(() => {
this.delayTime();
}, 1000);
}
}
}
}
</script>
<style lang="scss">
.wrapper{
background: #20279B;
overflow: auto;
height: 100%;
.logo{
text-align: center;
color: #fff;
padding: 60rpx 0;
view{
margin-top: 40rpx;
font-size: 40rpx;
}
}
.content{
background-color: #fff;
margin:0 20rpx;
border-radius: 30rpx;
padding: 40rpx 60rpx;
overflow: hidden;
margin-bottom: 30rpx;
min-height: 65%;
.login_title{
text-align: center;
font-size: 40rpx;
margin-bottom: 60rpx;
}
form{
.inputItem{
position: relative;
margin-bottom: 30rpx;
.uni-input{
height: 80rpx;
line-height: 80rpx;
}
.uni-input:after{
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid rgba(0,0,0,.1);
color: #CECECE;
transform-origin: 0 100%;
transform: scaleY(.5);
z-index: 2;
}
text{
position: absolute;
right: 0;
top: 20rpx;
color: #20279B;
}
}
}
.agree{
font-size: 28rpx;
color:#666;
text-align: center;
a{
color: #20279B;
text-decoration: none;
}
}
.login_btn{
height: 100rpx;
line-height: 100rpx;
text-align: center;
margin: 40rpx auto;
color: #fff;
background: #20279B;
border-radius: 80rpx;
}
.login_type{
display: flex;
justify-content: space-between;
margin: 30rpx;
}
.other_login{
text-align: center;
color: #20279B;
position: relative;
.text_line{
display: inline-block;
height: 1px;
background: #20279B;
width: 30%;
}
}
}
}
</style>
\ No newline at end of file
const dev = {
base_url:'https://mdev.zuihuibi.cn',
api_url:'https://mdev.zuihuibi.cn/api',
sfp_url:'https://mdev.zuihuibi.cn/api/sfp'
}
const stage = {
base_url:'https://mstage.zuihuibi.cn',
api_url:'https://mstage.zuihuibi.cn/api',
sfp_url:'https://mstage.zuihuibi.cn/api/sfp'
}
const prod = {
base_url:'https://m.zuihuibi.cn',
api_url:'https://m.zuihuibi.cn/api',
sfp_url:'https://m.zuihuibi.cn/api/sfp'
}
const config = {
dev,
stage,
prod
}
let env = 'dev';
// if (process.env.NODE_ENV === 'development') {
// env = 'dev';
// }else if (process.env.NODE_ENV === 'production') {
// env = 'prod';
// }else if (process.env.NODE_ENV === 'uat'){
// env = 'stage';
// }
let baseURL = config[env].base_url;
let apiURL = config[env].api_url;
let sfpURL = config[env].sfp_url;
export{
baseURL,
apiURL,
sfpURL
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
\ No newline at end of file
{
"name" : "cffp",
"appid" : "__UNI__65C4CDC",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wx53a601e27aaf7897",
"setting" : {
"urlCheck" : false,
"es6" : true,
"postcss" : true,
"minified" : true
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "开发"
}
}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "3"
}
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "components/login/login",
"style": {
"topWindow": false,
"navigationBarTitleText": "CFFP"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom"
},
"uniIdRouter": {}
}
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
var _style_0 = {};
exports.styles = [_style_0];
Promise.resolve("./app.css.js").then(() => {
});
This source diff could not be displayed because it is too large. You can view the blob instead.
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var w=Object.create;var g=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var k=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var M=(e,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!B.call(e,s)&&s!==t&&g(e,s,{get:()=>a[s],enumerable:!(n=y(a,s))||n.enumerable});return e};var N=(e,a,t)=>(t=e!=null?w(O(e)):{},M(a||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e));var D=k((x,_)=>{_.exports=Vue});var I=Object.prototype.toString,p=e=>I.call(e),d=e=>p(e).slice(8,-1);function T(){return typeof __channelId__=="string"&&__channelId__}function v(e,a){switch(d(a)){case"Function":return"function() { [native code] }";default:return a}}function F(e,a,t){return T()?(t.push(a.replace("at ","uni-app:///")),console[e].apply(console,t)):t.map(function(s){let i=p(s).toLowerCase();if(["[object object]","[object array]","[object module]"].indexOf(i)!==-1)try{s="---BEGIN:JSON---"+JSON.stringify(s,v)+"---END:JSON---"}catch(l){s=i}else if(s===null)s="---NULL---";else if(s===void 0)s="---UNDEFINED---";else{let l=d(s).toUpperCase();l==="NUMBER"||l==="BOOLEAN"?s="---BEGIN:"+l+"---"+s+"---END:"+l+"---":s=String(s)}return s}).join("---COMMA---")+" "+a}function m(e,a,...t){let n=F(e,a,t);n&&console[e](n)}var b=(e,a)=>{let t=e.__vccOpts||e;for(let[n,s]of a)t[n]=s;return t};var C={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let a={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},t=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),n=t[1];n&&(t[1]=a[n]||n),t.length=t.length>2?2:t.length,this.locale=t.join("-")},localize(e){let a=this.locale,t=a.split("-")[0],n=this.fallbackLocale,s=i=>{let l=Object.assign({},this.localization[i],(this.localizationTemplate||{})[i]);return m("log","at mixins/i18n.js:78","********** o :>> ",l),l};return s("messages")[e]||s(a)[e]||s(t)[e]||s(n)[e]||e}}},E={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:a,runtime:t,data:n={},useGlobalEvent:s}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=t,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(n)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let i=this,l=function(c){let h=c.data&&c.data.__message;!h||i.__onMessageCallback&&i.__onMessageCallback(h.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",l);else{let c=new BroadcastChannel(this.__page);c.onmessage=l}},postMessage(e={},a=!1){let t=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:a}})),n=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(t,n):new BroadcastChannel(n).postMessage(t);else{let s=plus.webview.getWebviewById(n);s&&s.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:t})})`)}},onMessage(e){this.__onMessageCallback=e}}};var r=N(D());var R={content:{"":{flex:1,alignItems:"center",justifyContent:"center",backgroundColor:"#000000"}},barcode:{"":{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:1}},"set-flash":{"":{alignItems:"center",justifyContent:"center",transform:"translateY(80px)",zIndex:2}},"image-flash":{"":{width:26,height:26,marginBottom:2}},"image-flash-text":{"":{fontSize:10,color:"#FFFFFF"}}},o=plus.barcode,A={qrCode:[o.QR,o.AZTEC,o.MAXICODE],barCode:[o.EAN13,o.EAN8,o.UPCA,o.UPCE,o.CODABAR,o.CODE128,o.CODE39,o.CODE93,o.ITF,o.RSS14,o.RSSEXPANDED],datamatrix:[o.DATAMATRIX],pdf417:[o.PDF417]},L={[o.QR]:"QR_CODE",[o.EAN13]:"EAN_13",[o.EAN8]:"EAN_8",[o.DATAMATRIX]:"DATA_MATRIX",[o.UPCA]:"UPC_A",[o.UPCE]:"UPC_E",[o.CODABAR]:"CODABAR",[o.CODE39]:"CODE_39",[o.CODE93]:"CODE_93",[o.CODE128]:"CODE_128",[o.ITF]:"CODE_25",[o.PDF417]:"PDF_417",[o.AZTEC]:"AZTEC",[o.RSS14]:"RSS_14",[o.RSSEXPANDED]:"RSSEXPANDED"},P={mixins:[E,C],data:{filters:[0,2,1],backgroud:"#000000",frameColor:"#118ce9",scanbarColor:"#118ce9",enabledFlash:!1,flashImage0:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABjklEQVRoQ+1ZbVHEQAx9TwE4ABTcOQAknANQAKcAUAAOAAXgAHAACsDCKQiTmbYDzJZtNt2bFrJ/m6+Xl2yyU2LmhzOPH/8PgIjcADirxNyapNoffMwMiMgzgMPBHmyCLySPLCoBwJKtAbJbYaBmD1yRvBwAtBMxl5DF+DZkiwCIyBLAzsgBbki+Wm2WAlCaL6zOMvKnJO+sNksB7ALQbO1ZHfbIv5FUVs2nCIB6EZETALdmj2mFY5I6X8ynGEADQllYmL1+VzBfnV/VvQB0aj45ARyQ/Ci14QLQsOBZLe5JaikWnzEA7AN4L4hgA2Dpyb76dANwsOCq/TZhASAYKGie0a7R1lDPI0ebtF0NUi+4yfdAtxr3PEMnD6BbD0QkNfACQO05EAwMuaBqDrIVycdmTpwDuP4R0OR7QFftVRP0g+49cwOQq4DJMxAAchmofY3m/EcJBQOZbTRKKJeBKKEoIePvpFRJ1VzmciUccyCa+C81cerBkuuB7sGTE/zt+yhN7AnAqxsAvBn06n8CkyPwMZKwm+UAAAAASUVORK5CYII=",flashImage1:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUAAAA3kvI3lfY2k/VAl+43k/U3k/Q4k/M3kvI3k/M4k/Q4lPU2lPU2k/Vdq843k/WWSpNKAAAAD3RSTlMAwD+QINCAcPBgUDDgoBAE044kAAAAdklEQVQ4y2OgOrD/DwffUSTkERIfyZXAtOMbca7iVoKDDSgSbAijJqBI8J2HiX9FM2s+TOITmgQrTEIATYIJJuEA5mJ68S+Gg/0hEi0YEoxQK2gs0WyPQyKBGYeEAhPtJRaw45AIccXpwVEJekuwQyQWMFAfAACeDBJY9aXa3QAAAABJRU5ErkJggg==",autoDecodeCharSet:!1,autoZoom:!0,localizationTemplate:{en:{fail:"Recognition failure","flash.on":"Tap to turn light on","flash.off":"Tap to turn light off"},zh:{fail:"\u8BC6\u522B\u5931\u8D25","flash.on":"\u8F7B\u89E6\u7167\u4EAE","flash.off":"\u8F7B\u89E6\u5173\u95ED"}}},onLoad(){let e=this.data,a=e.scanType;this.autoDecodeCharSet=e.autoDecodeCharSet,this.autoZoom=e.autoZoom;let t=[];Array.isArray(a)&&a.length&&a.forEach(n=>{let s=A[n];s&&(t=t.concat(s))}),t.length||(t=t.concat(A.qrCode).concat(A.barCode).concat(A.datamatrix).concat(A.pdf417)),this.filters=t,this.onMessage(n=>{this.gallery()})},onUnload(){this.cancel()},onReady(){setTimeout(()=>{this.cancel(),this.start()},50)},methods:{start(){this.$refs.barcode.start({sound:this.data.sound})},scan(e){o.scan(e,(a,t,n,s)=>{this.scanSuccess(a,t,n,s)},()=>{plus.nativeUI.toast(this.localize("fail"))},this.filters,this.autoDecodeCharSet)},cancel(){this.$refs.barcode.cancel()},gallery(){plus.gallery.pick(e=>{this.scan(e)},e=>{e.code!==(weex.config.env.platform.toLowerCase()==="android"?12:-2)&&plus.nativeUI.toast(this.localize("fail"))},{multiple:!1,system:!1,filename:"_doc/uniapp_temp/gallery/",permissionAlert:!0})},onmarked(e){var a=e.detail;this.scanSuccess(a.code,a.message,a.file,a.charSet)},scanSuccess(e,a,t,n){this.postMessage({event:"marked",detail:{scanType:L[e],result:a,charSet:n||"utf8",path:t||""}})},onerror(e){this.postMessage({event:"fail",message:JSON.stringify(e)})},setFlash(){this.enabledFlash=!this.enabledFlash,this.$refs.barcode.setFlash(this.enabledFlash)}}};function Q(e,a,t,n,s,i){return(0,r.openBlock)(),(0,r.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,r.createElementVNode)("view",{class:"content"},[(0,r.createElementVNode)("barcode",{class:"barcode",ref:"barcode",autostart:"false",backgroud:e.backgroud,frameColor:e.frameColor,scanbarColor:e.scanbarColor,filters:e.filters,autoDecodeCharset:e.autoDecodeCharSet,autoZoom:e.autoZoom,onMarked:a[0]||(a[0]=(...l)=>i.onmarked&&i.onmarked(...l)),onError:a[1]||(a[1]=(...l)=>i.onerror&&i.onerror(...l))},null,40,["backgroud","frameColor","scanbarColor","filters","autoDecodeCharset","autoZoom"]),(0,r.createElementVNode)("view",{class:"set-flash",onClick:a[2]||(a[2]=(...l)=>i.setFlash&&i.setFlash(...l))},[(0,r.createElementVNode)("u-image",{class:"image-flash",src:e.enabledFlash?e.flashImage1:e.flashImage0,resize:"stretch"},null,8,["src"]),(0,r.createElementVNode)("u-text",{class:"image-flash-text"},(0,r.toDisplayString)(e.enabledFlash?e.localize("flash.off"):e.localize("flash.on")),1)])])])}var u=b(P,[["render",Q],["styles",[R]]]);var f=plus.webview.currentWebview();if(f){let e=parseInt(f.id),a="template/__uniappscan",t={};try{t=JSON.parse(f.__query__)}catch(s){}u.mpType="page";let n=Vue.createPageApp(u,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:a,__pageQuery:t});n.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...u.styles||[]])),n.mount("#root")}})();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>View</title>
<link rel="stylesheet" href="app.css" />
<script>var __uniConfig = {"globalStyle":{}}</script>
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
</head>
<body>
<div id="app"></div>
<script src="uni-app-view.umd.js"></script>
</body>
</html>
;(function(){
let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","style":"custom","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"cffp","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"3.6.3","entryPagePath":"components/login/login","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"locales":{}};
const __uniRoutes = [{"path":"components/login/login","meta":{"isQuit":true,"isEntry":true,"topWindow":false,"navigationBar":{"titleText":"CFFP","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
__uniConfig.styles=[];//styles
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:16})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:u,window:u,document:u,frames:u,self:u,location:u,navigator:u,localStorage:u,history:u,Caches:u,screen:u,alert:u,confirm:u,prompt:u,fetch:u,XMLHttpRequest:u,WebSocket:u,webkit:u,print:u}}}});
})();
\ No newline at end of file
(function(){})();
\ No newline at end of file
if (typeof Promise !== "undefined" && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor;
return this.then((value) => promise.resolve(callback()).then(() => value), (reason) => promise.resolve(callback()).then(() => {
throw reason;
}));
};
}
;
if (typeof uni !== "undefined" && uni && uni.requireGlobal) {
const global = uni.requireGlobal();
ArrayBuffer = global.ArrayBuffer;
Int8Array = global.Int8Array;
Uint8Array = global.Uint8Array;
Uint8ClampedArray = global.Uint8ClampedArray;
Int16Array = global.Int16Array;
Uint16Array = global.Uint16Array;
Int32Array = global.Int32Array;
Uint32Array = global.Uint32Array;
Float32Array = global.Float32Array;
Float64Array = global.Float64Array;
BigInt64Array = global.BigInt64Array;
BigUint64Array = global.BigUint64Array;
}
;
if (uni.restoreGlobal) {
uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval);
}
(function(vue) {
"use strict";
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
console[type].apply(console, [...args, filename]);
}
}
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_main$1 = {
data() {
return {
loginType: "codelogin",
passwordFlag: false,
loginTypeName: "\u9A8C\u8BC1\u7801\u767B\u5F55",
countdown: 60,
sedCode: "\u83B7\u53D6\u9A8C\u8BC1\u7801"
};
},
methods: {
formReset: function(e) {
formatAppLog("log", "at components/login/login.vue:69", "\u6E05\u7A7A\u6570\u636E");
},
getLogin() {
this.loginType === "codelogin" ? this.loginType = "pwlogin" : this.loginType = "codelogin";
this.loginTypeName = this.loginType == "codelogin" ? "\u9A8C\u8BC1\u7801\u767B\u5F55" : "\u5BC6\u7801\u767B\u5F55";
},
register() {
this.loginType = "register";
this.loginTypeName = "\u6CE8\u518C";
},
sendMessage() {
this.delayTime();
},
delayTime() {
if (this.countdown == 0) {
this.isValid = false;
this.sedCode = "\u91CD\u65B0\u53D1\u9001";
this.countdown = 60;
} else {
this.isValid = true;
this.sedCode = this.countdown + "s";
this.countdown--;
setTimeout(() => {
this.delayTime();
}, 1e3);
}
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("view", { class: "wrapper" }, [
vue.createElementVNode("view", { class: "logo" }, [
vue.createElementVNode("img", {
src: "/static/logo.png",
alt: "logo",
srcset: ""
}),
vue.createElementVNode("view", null, "\u6B22\u8FCE\u767B\u5F55\u4F7F\u7528CFFP")
]),
vue.createElementVNode("view", { class: "content" }, [
vue.createElementVNode("view", { class: "login_title" }, vue.toDisplayString($data.loginTypeName), 1),
vue.createElementVNode("form", null, [
$data.loginType === "register" ? (vue.openBlock(), vue.createElementBlock("view", {
key: 0,
class: "inputItem"
}, [
vue.createElementVNode("input", {
class: "uni-input",
name: "invitationCode",
placeholder: "\u8F93\u5165\u9080\u8BF7\u7801(\u975E\u5FC5\u586B)"
})
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("view", { class: "inputItem" }, [
vue.createElementVNode("input", {
class: "uni-input",
name: "mobileNo",
placeholder: "\u8F93\u5165\u624B\u673A\u53F7"
})
]),
$data.loginType === "codelogin" || $data.loginType === "register" ? (vue.openBlock(), vue.createElementBlock("view", {
key: 1,
class: "inputItem"
}, [
vue.createElementVNode("input", {
class: "uni-input",
name: "code",
placeholder: "\u8F93\u5165\u9A8C\u8BC1\u7801"
}),
vue.createElementVNode("text", {
onClick: _cache[0] || (_cache[0] = ($event) => $options.sendMessage())
}, vue.toDisplayString($data.sedCode), 1)
])) : vue.createCommentVNode("v-if", true),
$data.loginType === "pwlogin" || $data.loginType === "register" ? (vue.openBlock(), vue.createElementBlock("view", {
key: 2,
class: "inputItem"
}, [
!$data.passwordFlag ? (vue.openBlock(), vue.createElementBlock("input", {
key: 0,
class: "uni-input",
type: "text",
name: "password",
placeholder: "\u8F93\u5165\u5BC6\u7801"
})) : vue.createCommentVNode("v-if", true),
$data.passwordFlag ? (vue.openBlock(), vue.createElementBlock("input", {
key: 1,
class: "uni-input",
type: "text",
password: "",
name: "password",
placeholder: "\u8F93\u5165\u5BC6\u7801"
})) : vue.createCommentVNode("v-if", true),
$data.passwordFlag ? (vue.openBlock(), vue.createElementBlock("text", {
key: 2,
onClick: _cache[1] || (_cache[1] = ($event) => $data.passwordFlag = false)
}, "\u663E\u793A\u5BC6\u7801")) : vue.createCommentVNode("v-if", true),
!$data.passwordFlag ? (vue.openBlock(), vue.createElementBlock("text", {
key: 3,
onClick: _cache[2] || (_cache[2] = ($event) => $data.passwordFlag = true)
}, "\u4E0D\u663E\u793A\u5BC6\u7801")) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true)
]),
vue.createElementVNode("view", { class: "agree" }, [
vue.createElementVNode("icon", {
type: _ctx.radioUnselect,
size: "26"
}, null, 8, ["type"]),
vue.createElementVNode("text", null, "\u5DF2\u9605\u8BFB\u5E76\u540C\u610F"),
vue.createElementVNode("a", { href: "#" }, "\u94F6\u76FE\u4FDD\u9669\u7ECF\u7EAA\u670D\u52A1\u534F\u8BAE"),
vue.createElementVNode("text", null, "\u548C"),
vue.createElementVNode("a", { href: "" }, "\u9690\u79C1\u653F\u7B56")
]),
vue.createElementVNode("view", { class: "login_btn" }, vue.toDisplayString($data.loginType == "register" ? "\u6CE8\u518C" : "\u767B\u5F55"), 1),
vue.createElementVNode("view", { class: "login_type" }, [
vue.createElementVNode("text", {
onClick: _cache[3] || (_cache[3] = ($event) => $options.getLogin())
}, vue.toDisplayString($data.loginType == "pwlogin" || $data.loginType == "register" ? "\u9A8C\u8BC1\u7801\u767B\u5F55" : "\u5BC6\u7801\u767B\u5F55"), 1),
vue.createElementVNode("text", {
onClick: _cache[4] || (_cache[4] = ($event) => $options.register())
}, vue.toDisplayString($data.loginType == "codelogin" ? "\u7ACB\u5373\u6CE8\u518C" : "\u5FD8\u8BB0\u5BC6\u7801"), 1)
]),
vue.createElementVNode("view", null, [
vue.createElementVNode("view", { class: "other_login" }, [
vue.createElementVNode("text", { class: "text_line" }),
vue.createElementVNode("text", { style: { "margin": "0 40rpx", "position": "relative", "top": "10rpx" } }, "\u5176\u4ED6\u767B\u5F55"),
vue.createElementVNode("text", { class: "text_line" })
]),
vue.createElementVNode("view", { class: "login_type" }, [
vue.createElementVNode("text", null, "\u6E38\u5BA2"),
vue.createElementVNode("text", null, "\u4EE3\u7406\u5546")
])
])
])
]);
}
var ComponentsLoginLogin = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "E:/work/cffp/components/login/login.vue"]]);
__definePage("components/login/login", ComponentsLoginLogin);
const _sfc_main = {
onLaunch: function() {
formatAppLog("log", "at App.vue:4", "App Launch");
},
onShow: function() {
formatAppLog("log", "at App.vue:7", "App Show");
},
onHide: function() {
formatAppLog("log", "at App.vue:10", "App Hide");
}
};
var App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/work/cffp/App.vue"]]);
function createApp() {
const app = vue.createVueApp(App);
return {
app
};
}
const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp();
uni.Vuex = __Vuex__;
uni.Pinia = __Pinia__;
__app__.provide("__globalStyles", __uniConfig.styles);
__app__._component.mpType = "app";
__app__._component.render = () => {
};
__app__.mount("#app");
})(Vue);
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.wrapper {
background: #20279B;
overflow: auto;
height: 100%;
}
.wrapper .logo {
text-align: center;
color: #fff;
padding: 1.875rem 0;
}
.wrapper .logo uni-view {
margin-top: 1.25rem;
font-size: 1.25rem;
}
.wrapper .content {
background-color: #fff;
margin: 0 0.625rem;
border-radius: 0.9375rem;
padding: 1.25rem 1.875rem;
overflow: hidden;
margin-bottom: 0.9375rem;
min-height: 65%;
}
.wrapper .content .login_title {
text-align: center;
font-size: 1.25rem;
margin-bottom: 1.875rem;
}
.wrapper .content uni-form .inputItem {
position: relative;
margin-bottom: 0.9375rem;
}
.wrapper .content uni-form .inputItem .uni-input {
height: 2.5rem;
line-height: 2.5rem;
}
.wrapper .content uni-form .inputItem .uni-input:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
color: #CECECE;
transform-origin: 0 100%;
transform: scaleY(0.5);
z-index: 2;
}
.wrapper .content uni-form .inputItem uni-text {
position: absolute;
right: 0;
top: 0.625rem;
color: #20279B;
}
.wrapper .content .agree {
font-size: 0.875rem;
color: #666;
text-align: center;
}
.wrapper .content .agree a {
color: #20279B;
text-decoration: none;
}
.wrapper .content .login_btn {
height: 3.125rem;
line-height: 3.125rem;
text-align: center;
margin: 1.25rem auto;
color: #fff;
background: #20279B;
border-radius: 2.5rem;
}
.wrapper .content .login_type {
display: flex;
justify-content: space-between;
margin: 0.9375rem;
}
.wrapper .content .other_login {
text-align: center;
color: #20279B;
position: relative;
}
.wrapper .content .other_login .text_line {
display: inline-block;
height: 1px;
background: #20279B;
width: 30%;
}
\ No newline at end of file
{
"@platforms": [
"android",
"iPhone",
"iPad"
],
"id": "__UNI__65C4CDC",
"name": "cffp",
"version": {
"name": "1.0.0",
"code": "100"
},
"description": "",
"developer": {
"name": "",
"email": "",
"url": ""
},
"permissions": {
"UniNView": {
"description": "UniNView原生渲染"
}
},
"plus": {
"useragent": {
"value": "uni-app",
"concatenate": true
},
"splashscreen": {
"target": "id:1",
"autoclose": true,
"waiting": true,
"delay": 0
},
"popGesture": "close",
"launchwebview": {
"render": "always",
"id": "1",
"kernel": "WKWebview"
},
"statusbar": {
"immersed": "supportedDevice",
"style": "light",
"background": "#F8F8F8"
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"distribute": {
"google": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"apple": {},
"plugins": {
"audio": {
"mp3": {
"description": "Android平台录音支持MP3格式文件"
}
}
}
},
"uniStatistics": {
"enable": false
},
"allowsInlineMediaPlayback": true,
"uni-app": {
"control": "uni-v3",
"vueVersion": "3",
"compilerVersion": "3.6.3",
"nvueCompiler": "uni-app",
"renderer": "auto",
"nvue": {
"flex-direction": "column"
},
"nvueLaunchMode": "normal"
}
},
"launch_path": "__uniappview.html"
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports[Symbol.toStringTag] = "Module";
var common_vendor = require("./common/vendor.js");
if (!Math) {
"./components/login/login.js";
}
const _sfc_main = {
onLaunch: function() {
console.log("App Launch");
},
onShow: function() {
console.log("App Show");
},
onHide: function() {
console.log("App Hide");
}
};
var App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "E:/work/cffp/App.vue"]]);
function createApp() {
const app = common_vendor.createSSRApp(App);
return {
app
};
}
createApp().app.mount("#app");
exports.createApp = createApp;
{
"pages": [
"components/login/login"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom"
},
"permission": {
"scope.userLocation": {
"desc": "开发"
}
},
"usingComponents": {}
}
\ No newline at end of file
/*每个页面公共css */
uni-page-body{
height: 100%;
}
page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
"use strict";
var common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
loginType: "phone"
};
},
methods: {
formReset: function(e) {
console.log("\u6E05\u7A7A\u6570\u636E");
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {};
}
var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/work/cffp/components/login/login.vue"]]);
wx.createPage(MiniProgramPage);
{
"navigationBarTitleText": "CFFP",
"usingComponents": {}
}
\ No newline at end of file
<view class="wrapper"><view class="logo"><image src="/static/logo.png" alt="logo" srcset=""></image><view>欢迎登录使用CFFP</view></view><view class="content"><view class="login_title"> 验证码登录 </view><form><view class="inputItem"><input class="uni-input" name="mobileNo" placeholder="输入手机号"/></view><view class="inputItem"><input class="uni-input" name="mobileNo" placeholder="输入验证码"/><text>获取验证码</text></view></form><view class="agree"><text>已阅读并同意</text><navigator href="#">银盾保险经纪服务协议</navigator><text>和</text><navigator href="">隐私政策</navigator></view><view class="login_btn"> 登录 </view><view class="login_type"><text>密码登录</text><text>立即注册</text></view><view><view class="other_login"><text class="text_line"></text><text style="margin:0 40rpx;position:relative;top:10rpx">其他登录</text><text class="text_line"></text></view><view class="login_type"><text>游客</text><text>代理商</text></view></view></view></view>
\ No newline at end of file
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.wrapper {
background: #20279B;
overflow: hidden;
height: 100%;
}
.wrapper .logo {
text-align: center;
color: #fff;
padding: 80rpx 0;
}
.wrapper .logo view {
margin-top: 60rpx;
font-size: 40rpx;
}
.wrapper .content {
background-color: #fff;
margin: 0 20rpx;
border-radius: 30rpx;
padding: 40rpx 60rpx;
overflow: hidden;
margin-bottom: 30rpx;
}
.wrapper .content .login_title {
text-align: center;
font-size: 40rpx;
margin-bottom: 60rpx;
}
.wrapper .content form .inputItem {
position: relative;
margin-bottom: 30rpx;
}
.wrapper .content form .inputItem .uni-input {
height: 80rpx;
line-height: 80rpx;
}
.wrapper .content form .inputItem .uni-input:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
color: #CECECE;
transform-origin: 0 100%;
transform: scaleY(0.5);
z-index: 2;
}
.wrapper .content form .inputItem text {
position: absolute;
right: 0;
top: 20rpx;
color: #20279B;
}
.wrapper .content .agree {
font-size: 28rpx;
color: #666;
text-align: center;
}
.wrapper .content .agree a {
color: #20279B;
text-decoration: none;
}
.wrapper .content .login_btn {
height: 100rpx;
line-height: 100rpx;
text-align: center;
margin: 40rpx auto;
color: #fff;
background: #20279B;
border-radius: 80rpx;
}
.wrapper .content .login_type {
display: flex;
justify-content: space-between;
margin: 30rpx;
}
.wrapper .content .other_login {
text-align: center;
color: #20279B;
position: relative;
}
.wrapper .content .other_login .text_line {
display: inline-block;
height: 1px;
background: #20279B;
width: 30%;
}
\ No newline at end of file
{
"description": "项目配置文件。",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"bigPackageSizeSupport": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.27.0",
"appid": "wx53a601e27aaf7897",
"projectname": "cffp",
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}
\ No newline at end of file
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "cffp",
"setting": {
"compileHotReLoad": true
}
}
\ No newline at end of file
export default{
// 获取url的参数
getQueryString(name){
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = decodeURIComponent(window.location.search).substr(1).match(reg);
if (r != null) {
return r[2];
}
return null;
},
// 数字千分位
numberConverter(value){
if (!value) return 0
// 获取整数部分
const intPart = Math.trunc(value)
// 整数部分处理,增加,
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
// 预定义小数部分
let floatPart = ''
// 将数值截取为小数部分和整数部分
const valueArray = value.toString().split('.')
if (valueArray.length === 2) { // 有小数部分
floatPart = valueArray[1].toString() // 取得小数部分
return intPartFormat + '.' + floatPart
}
return intPartFormat + floatPart
}
}
\ No newline at end of file
import api from "../api/api";
import {baseURL,apiURL,sfpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`/api/authorize/obtainToken`,`/api/authorize/checkToken`]
export const interceptor = () => {
uni.addInterceptor('request', {
// 请求拦截器
invoke(args) {
// console.log('请求拦截器',args);
// 加载loading
uni.showLoading({
title: '加载中...'
})
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
console.log('-----------')
return new Promise((resolve, reject)=>{
uni.request({
url: '/api/authorize/obtainToken',
method:'POST',
data:{ticket: 'uni-app'},
success: (res) => {
if(res.statusCode===200){
uni.setStorageSync('uni-token',res.data['data']['token']);
window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime();
}
// console.log(res)
},fail(err) {
reject(err);
},
})
uni.hideLoading()
return false
})
}
// request 触发前拼接 url
//设置请求头及token
args.header = {
'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded',
'X-Authorization': uni.getStorageSync('uni-token')
}
// console.log(args.header)
},
// 响应拦截器,可以对数据进行预处理
success(args) {
uni.hideLoading()
// console.log(args);
},
fail(err) {
console.log('interceptor-fail', err)
console.log('请求失败')
uni.hideLoading()
},
complete(res) {
uni.hideLoading()
}
})
}
import {interceptor} from "./interceptor";
// 全局请求封装
export default (url, method, params) => {
interceptor();
return new Promise((resolve, reject) => {
uni.request({
url: url,
method: method,
data: {
...params
},
success(res) {
resolve(res.data);
},
fail(err) {
reject(err);
},
complete() {
uni.hideLoading();
}
});
});
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment