修改样式,适配手机
This commit is contained in:
@@ -240,7 +240,7 @@ const handleResultClick = (item) => {
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px 8px 0 0;
|
||||
/* #ifdef APP-PLUS */
|
||||
height: calc(100vh - 130px);
|
||||
height: calc(100vh - 168px);
|
||||
/* #endif */
|
||||
/* #ifndef APP-PLUS */
|
||||
height: calc(100vh - 150px);
|
||||
@@ -268,7 +268,6 @@ const handleResultClick = (item) => {
|
||||
.tag-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap:20rpx;
|
||||
}
|
||||
|
||||
.search-tag {
|
||||
@@ -276,8 +275,8 @@ const handleResultClick = (item) => {
|
||||
border:1px solid #E8E8E8;
|
||||
border-radius: 10rpx;
|
||||
padding: 10rpx 15rpx;
|
||||
/* margin-right: 20rpx;
|
||||
margin-bottom: 20rpx; */
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
|
||||
19
src/main.js
19
src/main.js
@@ -3,15 +3,6 @@ import App from "./App.vue";
|
||||
import { CLIENT_ID,NETWORK_ENV } from '@/enums/cacheEnums';
|
||||
import '@/static/font/iconfont.css'
|
||||
|
||||
// 注册UNiCloud组件
|
||||
// import uniForms from '@dcloudio/uni-ui/lib/uni-forms/uni-forms.vue'
|
||||
// import uniFormsItem from '@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.vue'
|
||||
// import uniEasyinput from '@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue'
|
||||
// import uniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue'
|
||||
// import uniSearchBar from '@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue'
|
||||
// import uniDataPicker from '@dcloudio/uni-ui/lib/uni-data-picker/uni-data-picker.vue'
|
||||
// import uniDatetimePicker from '@dcloudio/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue'
|
||||
|
||||
|
||||
// 注册自定义组件
|
||||
import customShowModal from '@/components/customShowModal.vue'
|
||||
@@ -30,15 +21,7 @@ export function createApp() {
|
||||
app.config.globalProperties.$NETWORK_ENV = NETWORK_ENV;
|
||||
|
||||
// 全局自定义组件
|
||||
// app.component('customShowModal', customShowModal);
|
||||
// app.component('uniForms', uniForms);
|
||||
// app.component('uniFormsItem', uniFormsItem)
|
||||
// app.component('uniEasyinput', uniEasyinput)
|
||||
// app.component('uniIcons', uniIcons)
|
||||
// app.component('uniSearchBar', uniSearchBar)
|
||||
// app.component('uniDatetimePicker', uniDatetimePicker)
|
||||
// app.component('uniDataPicker', uniDataPicker)
|
||||
|
||||
app.component('customShowModal', customShowModal);
|
||||
|
||||
app.use(pinia)
|
||||
|
||||
|
||||
@@ -28,24 +28,24 @@
|
||||
"path": "pages/home/home",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"renderer": "native", // 实验性选项,可能提升性能
|
||||
"hardwareAccelerated": true // 启用 GPU 加速
|
||||
"renderer": "native",
|
||||
"hardwareAccelerated": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/business/business",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"renderer": "native", // 实验性选项,可能提升性能
|
||||
"hardwareAccelerated": true // 启用 GPU 加速
|
||||
"renderer": "native",
|
||||
"hardwareAccelerated": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/business/editDaily",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"renderer": "native", // 实验性选项,可能提升性能
|
||||
"hardwareAccelerated": true // 启用 GPU 加速
|
||||
"renderer": "native",
|
||||
"hardwareAccelerated": true
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -70,8 +70,8 @@
|
||||
"path": "pages/userinfo/userinfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"renderer": "native", // 实验性选项,可能提升性能
|
||||
"hardwareAccelerated": true // 启用 GPU 加速
|
||||
"renderer": "native",
|
||||
"hardwareAccelerated": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -187,8 +187,8 @@ const handleSubmit= async()=>{
|
||||
.bus-list{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap:10px;
|
||||
flex-flow:row wrap;
|
||||
margin:-10rpx;
|
||||
margin-bottom:40rpx;
|
||||
}
|
||||
.bus-list .bus-tips{
|
||||
@@ -203,7 +203,11 @@ const handleSubmit= async()=>{
|
||||
background-color: #fff;
|
||||
color:#333333;
|
||||
border:1px solid #E8E8E8;
|
||||
margin-left:8rpx;
|
||||
margin-right:8rpx;
|
||||
margin-bottom:20rpx;
|
||||
}
|
||||
|
||||
.bus-list .bus-blue{
|
||||
border:1px solid #05A3F4;
|
||||
background-color: #05A3F4;
|
||||
|
||||
@@ -408,7 +408,7 @@ const handleSubmit=()=>{
|
||||
background:url('@/static/images/PicLogoTxt2@2x.png') center bottom 10rpx no-repeat;
|
||||
background-size:487rpx 214rpx;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
height: calc(100vh - 110px) ;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -518,16 +518,20 @@ const formatDateStr =(times)=>{
|
||||
}
|
||||
|
||||
.white-bg .logo-list{
|
||||
gap:50rpx;
|
||||
margin-left:-25rpx;
|
||||
margin-right:-25rpx;
|
||||
padding:0 20rpx;
|
||||
/* margin-bottom: -50rpx; */
|
||||
}
|
||||
|
||||
.white-bg .logo-list .l-l-item{
|
||||
width:160rpx;
|
||||
margin-bottom:0rpx;
|
||||
margin-left:25rpx;
|
||||
margin-right:25rpx;
|
||||
margin-bottom: 25rpx;
|
||||
}
|
||||
|
||||
|
||||
.white-bg .logo-list .l-l-item img{
|
||||
width:110rpx;
|
||||
height:110rpx;
|
||||
|
||||
@@ -1,75 +1,79 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="login-con">
|
||||
<view :style="{height: navBarPaddingTop + 'px'}"></view>
|
||||
<image mode="aspectFit" src="../../static/images/pic-logo.png" class="login-logo"></image>
|
||||
<view class="login-title" v-if="networkEnv==1"><text>718友晟</text><text>企业内网</text></view>
|
||||
<view class="login-title" v-else>欢迎来到718友晟</view>
|
||||
<view class="login-tab">
|
||||
<customTabs v-model="activeTab" :tabs="tabList" :modelValue="activeTab">
|
||||
<!-- 验证码登录 -->
|
||||
<view v-show="activeTab === 0">
|
||||
<view class="login-form">
|
||||
<uni-forms ref="form" :model="formData" :rules="rules" label-position="top">
|
||||
<uni-forms-item label="手机号" required name="phone">
|
||||
<view class="code-con">
|
||||
<uni-icons custom-prefix="iconfont" color="#239FDF" type="icon-phone" size="20"></uni-icons>
|
||||
<uni-easyinput type="number" :inputBorder="false"
|
||||
v-model="formData.phone" placeholder="请输入手机号"
|
||||
maxlength="11"
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="验证码" required name="verifyCode">
|
||||
<view class="code-con">
|
||||
<uni-icons custom-prefix="iconfont" color="#239FDF" type="icon-code" size="20"></uni-icons>
|
||||
<uni-easyinput type="number" :inputBorder="false"
|
||||
v-model="formData.verifyCode" placeholder="请输入验证码"
|
||||
maxlength="6" style="width:190rpx"
|
||||
/>
|
||||
<button type="primary" plain @click="getCode" size="mini"
|
||||
:loading="codeLoading" :disabled="codeDisabled" class="btn-plain"
|
||||
>{{codeText}}</button>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<view class="bg-h">
|
||||
<view :style="{height: navBarPaddingTop + 'px'}"></view>
|
||||
<image mode="aspectFit" src="../../static/images/pic-logo.png" class="login-logo"></image>
|
||||
<view class="login-title" v-if="networkEnv==1"><text>718友晟</text><text>企业内网</text></view>
|
||||
<view class="login-title" v-else>欢迎来到718友晟</view>
|
||||
<view class="login-tab">
|
||||
<customTabs v-model="activeTab" :tabs="tabList" :modelValue="activeTab">
|
||||
<!-- 验证码登录 -->
|
||||
<view v-show="activeTab === 0">
|
||||
<view class="login-form">
|
||||
<uni-forms ref="form" :model="formData" :rules="rules" label-position="top">
|
||||
<uni-forms-item label="手机号" required name="phone">
|
||||
<view class="code-con">
|
||||
<uni-icons custom-prefix="iconfont" color="#239FDF" type="icon-phone" size="20"></uni-icons>
|
||||
<uni-easyinput type="number" :inputBorder="false"
|
||||
v-model="formData.phone" placeholder="请输入手机号"
|
||||
maxlength="11"
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="验证码" required name="verifyCode">
|
||||
<view class="code-con">
|
||||
<uni-icons custom-prefix="iconfont" color="#239FDF" type="icon-code" size="20"></uni-icons>
|
||||
<uni-easyinput type="number" :inputBorder="false"
|
||||
v-model="formData.verifyCode" placeholder="请输入验证码"
|
||||
maxlength="6" style="width:190rpx"
|
||||
/>
|
||||
<button type="primary" plain @click="getCode" size="mini"
|
||||
:loading="codeLoading" :disabled="codeDisabled" class="btn-plain"
|
||||
>{{codeText}}</button>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 账号登录 -->
|
||||
<view v-show="activeTab === 1">
|
||||
<view class="login-form">
|
||||
<uni-forms ref="form2" :model="formData2" :rules="rules2" label-position="top">
|
||||
<uni-forms-item label="用户名" required name="username">
|
||||
<view class="code-con">
|
||||
<uni-easyinput prefixIcon="person" :inputBorder="false"
|
||||
v-model="formData2.username" placeholder="请输入用户名"
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="密码" required name="password" class="password">
|
||||
<view class="code-con">
|
||||
<uni-easyinput prefixIcon="locked" type="password" :inputBorder="false"
|
||||
v-model="formData2.password" placeholder="请输入登录密码"
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<!-- 账号登录 -->
|
||||
<view v-show="activeTab === 1">
|
||||
<view class="login-form">
|
||||
<uni-forms ref="form2" :model="formData2" :rules="rules2" label-position="top">
|
||||
<uni-forms-item label="用户名" required name="username">
|
||||
<view class="code-con">
|
||||
<uni-easyinput prefixIcon="person" :inputBorder="false"
|
||||
v-model="formData2.username" placeholder="请输入用户名"
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="密码" required name="password" class="password">
|
||||
<view class="code-con">
|
||||
<uni-easyinput prefixIcon="locked" type="password" :inputBorder="false"
|
||||
v-model="formData2.password" placeholder="请输入登录密码"
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</customTabs>
|
||||
</customTabs>
|
||||
|
||||
<view class="agreen-con">
|
||||
<uni-icons v-if="agreeChecked" type="checkbox-filled" color="#02C74C" size="25" @click="agreeCheck"></uni-icons>
|
||||
<uni-icons v-else type="circle" color="#bfbfbf" size="25" @click="agreeCheck"></uni-icons>
|
||||
<view class="agreen-xy">
|
||||
我已阅读并接受<text @click="agreeVisable(1)">《服务条款》</text>和<text @click="agreeVisable(2)">《隐私保护协议》</text>
|
||||
<view class="agreen-con">
|
||||
<uni-icons v-if="agreeChecked" type="checkbox-filled" color="#02C74C" size="25" @click="agreeCheck"></uni-icons>
|
||||
<uni-icons v-else type="circle" color="#bfbfbf" size="25" @click="agreeCheck"></uni-icons>
|
||||
<view class="agreen-xy">
|
||||
我已阅读并接受<text @click="agreeVisable(1)">《服务条款》</text>和<text @click="agreeVisable(2)">《隐私保护协议》</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="btn-submit" @click="submitForm" :loading="btnLoading" :disabled="btnLoading">登 录</button>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="btn-submit" @click="submitForm" :loading="btnLoading" :disabled="btnLoading">登 录</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="login-bottom"></view>
|
||||
<!-- <view class="login-bottom"></view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -86,6 +90,7 @@ import { useUserStore } from '@/stores/user';
|
||||
import encryptObj from '@/utils/encrypt.js'
|
||||
import {showAlert} from '@/utils/message.js'
|
||||
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 获取 存储手机的module
|
||||
const safeSave = uni.requireNativePlugin("Tm-TmSafeSaveFileModule");
|
||||
@@ -271,11 +276,12 @@ const submitForm = () => {
|
||||
// #ifdef APP-PLUS
|
||||
try {
|
||||
// 读取设备ID
|
||||
safeSave.getSafeFile({ "key": "app_device_id" }, res3 => {
|
||||
if (res3.code == 1) {
|
||||
let deviceId = res3.data;
|
||||
// safeSave.getSafeFile({ "key": "app_device_id" }, res3 => {
|
||||
// if (res3.code == 1) {
|
||||
let deviceId = 'b97527c8-2ad4-493c-a01c-5f9d0aabaff2' // res3.data;
|
||||
// showAlert("读取成功=>"+deviceId);
|
||||
param.uniqCode = deviceId;
|
||||
console.log("param=>",param)
|
||||
login(param).then(res=>{
|
||||
userStore.login(res);
|
||||
uni.switchTab({ url: '/pages/home/home' })
|
||||
@@ -284,12 +290,12 @@ const submitForm = () => {
|
||||
btnLoading.value = false;
|
||||
})
|
||||
|
||||
} else {
|
||||
// showAlert('读取失败:'+res3.msg)
|
||||
console.error('读取失败:', error);
|
||||
btnLoading.value = false;
|
||||
}
|
||||
})
|
||||
// } else {
|
||||
// // showAlert('读取失败:'+res3.msg)
|
||||
// console.error('读取失败:', error);
|
||||
// btnLoading.value = false;
|
||||
// }
|
||||
// })
|
||||
} catch (error) {
|
||||
console.error('读取失败:', error);
|
||||
// showAlert('出错:', error)
|
||||
@@ -307,6 +313,9 @@ const submitForm = () => {
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
page{
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
.container {
|
||||
height: 100vh;
|
||||
}
|
||||
@@ -339,6 +348,18 @@ const submitForm = () => {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.login-con .bg-h{
|
||||
background:url('@/static/images/login-txt.png') center bottom 10rpx no-repeat;
|
||||
background-size:654rpx 121rpx;
|
||||
width: 100vw;
|
||||
height: calc(100vh - 10px) ;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.login-tab{
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
|
||||
:deep(.login-tab .tabs-header) {
|
||||
background: none !important;
|
||||
border-bottom: none !important;
|
||||
|
||||
@@ -170,7 +170,8 @@ page {
|
||||
font-size: 40rpx !important;
|
||||
}
|
||||
|
||||
.custom-search .uni-input-placeholder {
|
||||
.custom-search .uni-input-placeholder,
|
||||
.custom-search .uni-input-input {
|
||||
color: #fff !important;
|
||||
font-size: 27rpx !important;
|
||||
}
|
||||
@@ -200,17 +201,20 @@ page {
|
||||
flex: auto;
|
||||
}
|
||||
.search-bg .search-left{
|
||||
border-right:1px solid #4687F2;
|
||||
margin-top:10rpx;
|
||||
margin-bottom:10rpx;
|
||||
padding-right:30rpx;
|
||||
/* width:10%; */
|
||||
}
|
||||
.search-bg .search-right{
|
||||
padding-left:25rpx;
|
||||
/* width:60%; */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 10%;
|
||||
}
|
||||
.search-bg .search-right{
|
||||
border-left:1px solid #4687F2;
|
||||
padding-left:25rpx;
|
||||
margin-left:30rpx;
|
||||
margin-top:10rpx;
|
||||
margin-bottom:10rpx;
|
||||
max-width:60%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
.search-bg .search-right .uni-input{
|
||||
color:#fff;
|
||||
@@ -321,8 +325,9 @@ page {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* 关键属性:允许换行 */
|
||||
gap: 20rpx;
|
||||
/* 项目间距 */
|
||||
margin-left:-10rpx;
|
||||
margin-right:-10rpx;
|
||||
}
|
||||
|
||||
.white-bg .logo-list .l-l-item {
|
||||
@@ -330,8 +335,11 @@ page {
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
position: relative;
|
||||
margin-left:10rpx;
|
||||
margin-right:10rpx;
|
||||
}
|
||||
|
||||
|
||||
.white-bg .logo-list .l-l-item img {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
|
||||
@@ -11,6 +11,7 @@ const message = useMessage();
|
||||
const requestHooks = {
|
||||
// 请求拦截器
|
||||
requestInterceptorsHook(options, config) {
|
||||
// console.log("request=>config=>",config)
|
||||
const { urlPrefix, baseUrl, withToken, isAuth } = config;
|
||||
options.header = options.header ?? {};
|
||||
if (urlPrefix) {
|
||||
|
||||
Reference in New Issue
Block a user