10 Commits

Author SHA1 Message Date
xuli3099
da98464e1a 增加退出登录提示 2025-08-20 10:14:04 +08:00
xuli3099
5e281672a3 查询版本加内外网处理 2025-08-20 10:04:27 +08:00
xuli3099
aae8e6fb50 删除无用内容 2025-08-20 09:53:47 +08:00
xuli3099
f44108a486 修改内网设备绑定 2025-08-20 09:42:06 +08:00
xuli3099
b2a53d04aa 修改登录及设备授权处理 2025-08-19 17:31:04 +08:00
xuli3099
2514b279b6 修改登录 2025-08-19 16:48:47 +08:00
xuli3099
d40d8e1e91 修改登录页面 2025-08-19 16:47:33 +08:00
xuli3099
96a9932e70 修改 内网授权页面 2025-08-19 14:37:32 +08:00
xuli3099
2ad389e2f0 修改首页及样式 2025-08-19 13:28:14 +08:00
xuli3099
a0f2fab6bf 增加内网内容 2025-08-19 09:34:58 +08:00
15 changed files with 300 additions and 261 deletions

View File

@@ -4,16 +4,16 @@
<script setup>
import { onLaunch } from '@dcloudio/uni-app';
onLaunch((opt) => {
console.log("onLaunch")
// import { onLaunch } from '@dcloudio/uni-app';
// onLaunch((opt) => {
// console.log("onLaunch")
uni.preloadPage({ url: "/pages/login/login" });
uni.preloadPage({ url: "/pages/home/home" });
uni.preloadPage({ url: "/pages/business/business" });
uni.preloadPage({ url: "/pages/notice/notice" });
uni.preloadPage({ url: "/pages/userinfo/userinfo" });
})
// uni.preloadPage({ url: "/pages/login/login" });
// uni.preloadPage({ url: "/pages/home/home" });
// uni.preloadPage({ url: "/pages/business/business" });
// uni.preloadPage({ url: "/pages/notice/notice" });
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
// })
</script>

View File

@@ -58,15 +58,15 @@ const handleBack = () => {
margin-left:-375rpx;
z-index: 999;
/* #ifdef APP-PLUS */
background: url('@/static/images/bg-Blue-header.png') no-repeat;
/* background: url('@/static/images/bg-Blue-header.png') no-repeat;
background-size:750rpx 160rpx;
height:160rpx;
height:160rpx; */
/* #endif */
/* #ifndef APP-PLUS */
background: url('@/static/images/bg-Blue-header2.png') no-repeat;
/* background: url('@/static/images/bg-Blue-header2.png') no-repeat;
background-size:750rpx 116rpx;
height:116rpx;
height:116rpx; */
/* #endif */
}

View File

@@ -4,5 +4,5 @@ export const AGREEWELCOME_KEY="agreewelcome";
// clientId 默认写2
export const CLIENT_ID="2";
// #区分内外网 //1-内网2-外网
export const NETWORK_ENV=2;
export const NETWORK_ENV=1;

View File

@@ -1,15 +1,20 @@
import { createSSRApp } from "vue";
import App from "./App.vue";
import { CLIENT_ID,NETWORK_ENV } from '@/enums/cacheEnums';
import '@/static/font/iconfont.css'
// pinia
import { createPinia } from 'pinia'
const pinia = createPinia()
export function createApp() {
const app = createSSRApp(App);
app.config.globalProperties.$CLIENT_ID = CLIENT_ID;
app.config.globalProperties.$NETWORK_ENV = NETWORK_ENV;
app.use(pinia)

View File

@@ -145,14 +145,7 @@
"navigationBarTitleText": "718友晟",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom",
// #ifdef APP-PLUS
"style": {
"app-plus": {
"background":"#F5F5F5"
}
}
// #endif
"navigationStyle": "custom"
},
"tabBar": {
"color": "#919191",

View File

@@ -2,12 +2,11 @@
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'业务中心'"
:leftFlag="false" :rightFlag="false" v-if="!searchShow"
></customHeader>
<customHeader v-else ref="customHeaderRef" :title="'搜索'"
:leftFlag="true" :rightFlag="false"
@back="handleBack" :searchType="1"
<customHeader ref="customHeaderRef" :title="!searchShow?'业务中心':'搜索'"
:leftFlag="!searchShow?false:true"
:rightFlag="false"
@back="handleBack"
:searchType="searchShow?1:undefined"
></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
@@ -68,7 +67,7 @@
<script setup>
import { ref,onMounted } from 'vue'
import { onLoad,onShow } from '@dcloudio/uni-app';
import { onLoad,onHide } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue';
import customSearch from '@/components/customSearch.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
@@ -99,6 +98,10 @@ let searchShow = ref(false);
let searchText = ref(undefined);
let searchTypeObj = ref({typeId:2});
onHide(()=>{
searchShow.value=false;
})
// 搜索返回操作
const handleBack=()=>{
searchShow.value=false;
@@ -173,7 +176,7 @@ let handleJump=(url)=>{
<style scope>
.scroll-h{
/* #ifdef APP-PLUS */
height: calc(100vh - 120px) !important;
height: calc(100vh - 130px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 140px) !important;

View File

@@ -6,13 +6,26 @@
<view :style="{height: navBarPaddingTop + 'px'}"></view>
<view class="auth-title">
<image src="@/static/images/icon-lock@2x.png"/>
<text>设备授权</text>
<text>{{networkEnv==1?'内网':''}}设备授权</text>
</view>
<view class="login-con">
<!-- 登录 -->
<block v-if="!bindStatus">
<view class="login-form">
<view class="login-form" :class="{network1:networkEnv==1}">
<uni-forms ref="form2" :model="formData2" :rules="rules2" label-position="top">
<!-- networkEnv -->
<uni-forms-item label="设备标识" required name="uniqCode" v-if="networkEnv==1">
<view class="code-con code-device">
<uni-easyinput prefixIcon="person" :inputBorder="false"
v-model="formData2.uniqCode" placeholder="请输入设备标识"
>
<!-- <template #prefixIcon> -->
<!-- <image src="@/static/images/login-biaoshi.png" style="width: 20px; height: 20px;" /> -->
<!-- </template> -->
</uni-easyinput>
</view>
</uni-forms-item>
<uni-forms-item label="用户名" required name="username">
<view class="code-con">
<uni-easyinput prefixIcon="person" :inputBorder="false"
@@ -80,7 +93,6 @@ import { v4 as uuidv4 } from 'uuid'
import { getNavBarPaddingTop} from '@/utils/system.js';
import { getBindStatus,authDeviceApply,authInputCode } from '@/api/auth.js';
import {showToast,showAlert} from '@/utils/message.js'
import { CLIENT_ID,NETWORK_ENV } from '@/enums/cacheEnums';
import encryptObj from '@/utils/encrypt.js'
import { requestAndroidPermissionAsync } from '@/utils/common.js'
@@ -94,8 +106,10 @@ const safeSave = uni.requireNativePlugin("Tm-TmSafeSaveFileModule");
// #endif
let systemInfo = {};
let deviceId = ref(undefined);
let clientId = `${proxy.$CLIENT_ID || 2}`;
let networkEnv = ref(proxy.$NETWORK_ENV);//1-内网 2-外网
onLoad(async(opt) => {
console.log("deviceAuth=>onLoad");
console.log("deviceAuth=>onLoad",clientId,networkEnv.value);
uni.setStorageSync('page_cache',true);
// uni.preloadPage({url: "/pages/login/login"});
// uni.preloadPage({url: "/pages/home/home"});
@@ -186,11 +200,17 @@ let refreshBindStatus = async ()=>{
// 账号登录
const form2 = ref(null);
const formData2 = ref({
uniqCode:'',
username: '',
password: ''
});
const rules2 = {
uniqCode:{
rules: [
{ required: true, errorMessage: '请输入设备标识' },
]
},
username: {
rules: [
{ required: true, errorMessage: '请输入用户名' },
@@ -210,14 +230,19 @@ const submitForm = async() => {
// 用户名和密码登录
form2.value.validate().then(async param => {
btnLoading.value = true;
deviceId.value = uuidv4();
let clientId = `${CLIENT_ID || 2}`;
//1-内网2-外网
if(networkEnv.value==1){
deviceId.value = param.uniqCode;
}else{
deviceId.value = uuidv4(); //2-外网 生成的设备唯一标识
}
let password = encryptObj.Encrypt(param.username + clientId + "," + param.password);
let params = {
username:param.username,
password,
networkEnv:NETWORK_ENV,//1-内网2-外网
uniqCode:deviceId.value,//生成的设备唯一标识
networkEnv:networkEnv.value,//1-内网2-外网
uniqCode:deviceId.value,
...systemInfo,//设备信息
// #ifdef APP-PLUS
verId:systemInfo.appWgtVersion,//当前版本号
@@ -402,6 +427,7 @@ const handleSubmit=()=>{
border-bottom: 1px solid #E7E7E7;
}
:deep(.uni-forms-item__label){
color:#239FDF;
font-weight: bold;
@@ -443,6 +469,31 @@ const handleSubmit=()=>{
content: "\e66c" !important;
}
/* 加设备ID样式 */
.container .login-form.network1{
padding-bottom:50rpx;
}
.container .login-form.network1 .code-con{
padding:0 0 3rpx;
}
.container .login-form.network1 :deep(.uni-forms-item){
margin-bottom:10px !important
}
.container .login-form.network1 :deep(.uni-easyinput__content-input){
height: 30px !important;
}
.container .login-form .code-con.code-device :deep(.uni-easyinput__content .uniui-person){
background: url('@/static/images/login-biaoshi.png') 15rpx no-repeat;
background-size:25rpx 30rpx;
width: 25rpx;
height: 30rpx;
margin-right:10rpx;
}
.container .login-form .code-con.code-device :deep(.uniui-person:before){
display: none;
}
.btn-submit{
width:496rpx;
height:88rpx;

View File

@@ -1,71 +1,71 @@
<template>
<view>
<view id="test">
<!-- #ifdef h5 -->
<web-view :src="url"></web-view>
<!-- #endif -->
</view>
</template>
<script setup>
import { ref,onMounted,getCurrentInstance } from 'vue';
import { onLoad,onReady } from '@dcloudio/uni-app';
import { onLoad,onReady,onBackPress } from '@dcloudio/uni-app';
const { proxy } = getCurrentInstance();
let windowInfo = ref(null);
let url = ref('');
let title = ref('');
//将要创建的webview对象
let wv;
onLoad(async(opt) => {
// console.log(opt)
console.log(opt)
url.value = opt.url;
title.value = opt.title;
// #ifdef APP-PLUS
titleNViewWebview(url.value,title.value);
// #endif
// uni.getSystemInfo({
// success: (res)=> {
// windowInfo.value = res;
// createWvAndLoadUrl(url.value,title.value);
// }
// });
})
onReady(()=>{
setTimeout(()=>{
uni.setNavigationBarTitle({
title:title.value
})
},2000)
})
onMounted(() => {
uni.getSystemInfo({
success: (res)=> {
windowInfo.value = res;
createWvAndLoadUrl(url.value);
// 带标题栏控件的Webview窗口
let webview = null;
function titleNViewWebview(url,title) {
webview = plus.webview.create(url, 'test', {
titleNView: {
backgroundColor: '#307AF5',
titleText: title,
titleColor: '#ffffff',
autoBackButton: true,
backgroundImage:'./../../static/images/bg-Blue-header.png',
buttons:[{onclick:clickButton}]
}
});
})
/*创建web-view并加载url*/
const createWvAndLoadUrl=(url)=>{
// #ifdef APP-PLUS
wv = plus.webview.create(url,"webview",{
// plusrequire:"none", //禁止远程网页使用plus的API有些使用mui制作的网页可能会监听plus.key造成关闭页面混乱可以通过这种方式禁止
top: 0,//this.windowInfo.statusBarHeight + 126, //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的可以继续降低TOP值
scalable: true,
height: windowInfo.value.windowHeight - windowInfo.value.statusBarHeight //- 126
})
wv.addEventListener('loading', () => {
webview.addEventListener('close', function(){
webview=null;
});
webview.addEventListener('titleUpdate', function(){
webview.show();
});
webview.addEventListener('loading', () => {
plus.nativeUI.showWaiting("loading...",{
width:'110px',
padding:'10px'
})
}, false);
//plus.nativeUI.showWaiting()
wv.addEventListener('loaded', () => {
webview.addEventListener('loaded', () => {
plus.nativeUI.closeWaiting();
}, false);
//wv.loadURL(url)
let currentWebview = proxy.$scope.$getAppWebview();
currentWebview = wv;
// console.log(wv)
// setTimeout(()=> {
// console.log(wv.getStyle())
// }, 1000);
// #endif
}
// 左侧按钮返回
function clickButton(){
// plus.nativeUI.alert('clicked!');
webview=null;
}
</script>

View File

@@ -1,156 +1,140 @@
<template>
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'首页'"
:leftFlag="false" :rightFlag="false"
></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
<!-- 下拉刷新 -->
<mescroll-uni ref="mescrollRef" @init="mescrollInit"
:down="downOption" @down="downCallback"
:fixed="false" class="scroll-h" :style="{ paddingTop: navBarPaddingTop + 'px' }"
:fixed="false" class="scroll-h"
>
<!-- #ifdef H5 -->
<view style="height:50rpx"></view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<!-- 删除设备ID--测试用 -->
<view class="del-cache" @click="handleDelete">
<!-- <view class="del-cache" @click="handleDelete">
<uni-icons type="minus" size="30" color="#ffffff"></uni-icons>
</view>
</view> -->
<!-- #endif -->
<!-- 搜索 @confirm="handleSearch" -->
<customSearch v-if="searchShow"
:searchKeywords="searchText"
:searchType="searchTypeObj"
@confirm="handleSearchConfirm"
></customSearch>
<view class="search search-sao" v-else>
<uni-search-bar class="custom-search" radius="28"
placeholder="请输入您想查询的内容或服务"
clearButton="auto" cancelButton="none"
bgColor="#6FA2F8" textColor="#ffffff"
@focus="handleSearchFocus"
v-model="searchText"
/>
<uni-icons custom-prefix="iconfont" color="#ffffff" type="icon-phonesaoyisao" size="20"></uni-icons>
<!-- 待办内容 -->
<view class="backlog-bg">
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count1 }}</view>
<view class="font-title">待办</view>
</view>
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count2 }}</view>
<view class="font-title">待审查</view>
</view>
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count3 }}</view>
<view class="font-title">待巡检</view>
</view>
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count4 }}</view>
<view class="font-title">待发货</view>
</view>
</view>
<block v-if="!searchShow">
<!-- 待办内容 -->
<view class="backlog-bg">
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count1 }}</view>
<view class="font-title">待办</view>
</view>
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count2 }}</view>
<view class="font-title">待审查</view>
</view>
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count3 }}</view>
<view class="font-title">待巡检</view>
</view>
<view class="backlog-b-item">
<view class="font-number">{{ backBlogObj.count4 }}</view>
<view class="font-title">待发货</view>
</view>
</view>
<!-- 跑马灯滚动 -->
<view class="notice-bg">
<img :src="'static/images/icon-notice@2x.png'" class="notice-icon" />
<view class="notice-list">
<!-- :interval="4000" -->
<swiper class="swiper-con"
:vertical="true"
:autoplay="true"
:duration="500"
:circular="true"
:disable-touch="true"
:display-multiple-items="1"
>
<swiper-item v-for="(item, index) in extendedList" :key="index" >
<view class="swiper-item">
{{ item }}
</view>
</swiper-item>
</swiper>
</view>
</view>
<!-- 日程提醒 -->
<view class="white-bg mar-top" v-if="stepList.length>0">
<view class="w-b-title">日程提醒
<view class="yellow-bg">
<i :class="{iconfont:true,'icon-phoneshizhong':true}"></i>
<view class="text-black">{{ weekStr }}</view>
</view>
</view>
<view class="section-line">
<customSteps :steps="stepList" :modelValue="stepList"></customSteps>
</view>
</view>
<!-- 销售任务完成情况 -->
<view class="white-bg mar-top">
<view class="w-b-title">销售任务完成情况
<view class="yellow-bg">
<picker @change="bindPickerChange" :value="activeIndex" :range="salesList" @click="clickPicker" @cancel="bindPickerCancel">
<view class="uni-input">{{salesList[activeIndex]}}</view>
</picker>
<i :class="{iconfont:true,'icon-down':salesFlag,'icon-up':!salesFlag}" class="picker-icon"></i>
</view>
</view>
<view class="progress-bg">
<progress :percent="percentNum" stroke-width="10" activeColor="#41E1B1" backgroundColor="#F0F0F0" />
<view class="percent" :style="{left:percentNum+'%'}">
<view class="percent-num">{{ percentNum }}%</view>
<i class="iconfont icon-down"></i>
</view>
<view class="percent-con">
<view class="p-first">
<view>实际销售额</view>
<view class="font-money">{{totalSales}}</view>
<!-- 跑马灯滚动 -->
<view class="notice-bg">
<img :src="'static/images/icon-notice@2x.png'" class="notice-icon" />
<view class="notice-list">
<!-- :interval="4000" -->
<swiper class="swiper-con"
:vertical="true"
:autoplay="true"
:duration="500"
:circular="true"
:disable-touch="true"
:display-multiple-items="1"
>
<swiper-item v-for="(item, index) in extendedList" :key="index" >
<view class="swiper-item">
{{ item }}
</view>
<view class="p-last">
<view>目标销售额</view>
<view class="font-money">{{ targetSales }}</view>
</swiper-item>
</swiper>
</view>
</view>
<!-- 日程提醒 -->
<view class="white-bg mar-top" v-if="stepList.length>0">
<view class="w-b-title">日程提醒
<view class="yellow-bg">
<i :class="{iconfont:true,'icon-phoneshizhong':true}"></i>
<view class="text-black">{{ weekStr }}</view>
</view>
</view>
<view class="section-line">
<customSteps :steps="stepList" :modelValue="stepList"></customSteps>
</view>
</view>
<!-- 销售任务完成情况 -->
<view class="white-bg mar-top">
<view class="w-b-title">销售任务完成情况
<view class="yellow-bg">
<picker @change="bindPickerChange" :value="activeIndex" :range="salesList" @click="clickPicker" @cancel="bindPickerCancel">
<view class="uni-input">{{salesList[activeIndex]}}</view>
</picker>
<i :class="{iconfont:true,'icon-down':salesFlag,'icon-up':!salesFlag}" class="picker-icon"></i>
</view>
</view>
<view class="progress-bg">
<progress :percent="percentNum" stroke-width="10" activeColor="#41E1B1" backgroundColor="#F0F0F0" />
<view class="percent" :style="{left:percentNum+'%'}">
<view class="percent-num">{{ percentNum }}%</view>
<i class="iconfont icon-down"></i>
</view>
<view class="percent-con">
<view class="p-first">
<view>实际销售额</view>
<view class="font-money">{{totalSales}}</view>
</view>
<view class="p-last">
<view>目标销售额</view>
<view class="font-money">{{ targetSales }}</view>
</view>
</view>
</view>
</view>
<!-- 常用服务 -->
<view class="white-bg" v-if="commonServiceList.length>0">
<view class="w-b-title">常用服务</view>
<view class="logo-list">
<view v-for="(item,index) in commonServiceList" class="l-l-item" :key="index" @click="handleJump(item.bizUrl)">
<img :src="'static/images/business/'+item.icon+'.png'" />
<text class="font-gray">{{ item.bizName }}</text>
</view>
<!-- <view class="l-l-item" @click="handleAddCommonSercice">
<img :src="'static/images/business/icon-add.png'">
<text class="font-gray">添加</text>
</view> -->
</view>
</view>
<!-- 常用服务 -->
<view class="white-bg" v-if="commonServiceList.length>0">
<view class="w-b-title">常用服务</view>
<view class="logo-list">
<view v-for="(item,index) in commonServiceList" class="l-l-item" :key="index" @click="handleJump(item.bizUrl)">
<img :src="'static/images/business/'+item.icon+'.png'" />
<text class="font-gray">{{ item.bizName }}</text>
</view>
<!-- <view class="l-l-item" @click="handleAddCommonSercice">
<img :src="'static/images/business/icon-add.png'">
<text class="font-gray">添加</text>
</view> -->
</view>
</view>
<!-- 新闻公告 -->
<view class="white-bg">
<view class="w-b-title">新闻公告
<text>更多新闻</text>
</view>
<view class="news-list">
<view v-for="(item,index) in newsList" class="news-item" :key="index">
<view class="n-i-title">{{ item.name }}
<view class="n-i-date">{{ formatDateStr(item.date) }}</view>
</view>
<img :src="item.imgSrc" v-if="item.imgSrc" />
</view>
</view>
</view>
<!-- 新闻公告 -->
<view class="white-bg">
<view class="w-b-title">新闻公告
<text>更多新闻</text>
</view>
<view class="news-list">
<view v-for="(item,index) in newsList" class="news-item" :key="index">
<view class="n-i-title">{{ item.name }}
<view class="n-i-date">{{ formatDateStr(item.date) }}</view>
</view>
<img :src="item.imgSrc" v-if="item.imgSrc" />
</view>
</view>
</view>
<!-- 底部加高度来避免tabbar遮挡 -->
<view class="bottom-height"></view>
</block>
<!-- 底部加高度来避免tabbar遮挡 -->
<view class="bottom-height"></view>
</mescroll-uni>
</view>
</view>
@@ -159,6 +143,7 @@
<script setup>
import { ref,onMounted,computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import customSteps from '@/components/customSteps.vue'
import customSearch from '@/components/customSearch.vue'
@@ -204,7 +189,7 @@ onLoad(async(opt) => {
// 初始化调用方法
const initLoad =()=>{
try {
showLoading("加载中...")
showLoading("加载中...");
getBackBlogCount();
getSwiperList();
getStepData();
@@ -251,24 +236,6 @@ onMounted(() => {
navBarPaddingTop.value = getNavBarPaddingTop()*2;
})
// 搜索处理
let searchShow = ref(false);
let searchTypeObj = ref({typeId:1});
let searchText = ref(undefined);
// 获取input 焦点跳转
const handleSearchFocus=()=>{
searchShow.value = true;
}
// 搜索完返回处理
const handleSearchConfirm = (param1,param2)=>{
// console.log(param1,param2)
searchText.value=param2.value;;
searchShow.value=false;
}
let backBlogObj = ref({
count1:0,
count2:0,
@@ -409,10 +376,10 @@ const formatDateStr =(times)=>{
.scroll-h{
/* #ifdef APP-PLUS */
height:calc(100vh - 30px) !important;
height:calc(100vh - 78px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 30px) !important;
height: calc(100vh - 80px) !important;
/* #endif */
}
:deep(.mescroll-upwarp){

View File

@@ -20,7 +20,7 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref,getCurrentInstance } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { versionCheck,getBindStatus } from '@/api/auth.js';
import { formatIOS } from '@/utils/status.js'
@@ -28,6 +28,7 @@ import { requestAndroidPermissionAsync,requestAndroidPermission } from '@/utils/
import {showAlert} from '@/utils/message.js'
import { useUserStore } from '@/stores/user';
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
// #ifdef APP-PLUS
// 获取 存储手机的module
@@ -45,9 +46,9 @@ let versionData = ref({}); //版本参数
onLoad(async(opt) => {
console.log("onLoad");
uni.preloadPage({url: "/pages/login/login"});
uni.preloadPage({url: "/pages/deviceAuth/deviceAuth"});
uni.preloadPage({url: "/pages/home/home"});
// uni.preloadPage({url: "/pages/login/login"});
// uni.preloadPage({url: "/pages/deviceAuth/deviceAuth"});
// uni.preloadPage({url: "/pages/home/home"});
// #ifdef APP-PLUS
// 查询版本接口
@@ -89,8 +90,10 @@ onLoad(async(opt) => {
// 检查版本是否是最新的s
const getOSVesion = async()=>{
let networkEnv = proxy.$NETWORK_ENV;//1-内网 2-外网
systemInfo = uni.getSystemInfoSync();
let param = {
runEnv:networkEnv,
// #ifdef APP-PLUS
verNumber:systemInfo.appWgtVersion,//当前版本号
// #endif

View File

@@ -73,7 +73,7 @@
</template>
<script setup>
import { ref,onMounted } from 'vue';
import { ref,onMounted,getCurrentInstance } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import customTabs from '@/components/customTabs.vue';
import {isPhoneNumber} from '@/utils/validate';
@@ -83,14 +83,17 @@ import { AGREEWELCOME_KEY } from '@/enums/cacheEnums';
import { getNavBarPaddingTop} from '@/utils/system.js'
import { useUserStore } from '@/stores/user';
import encryptObj from '@/utils/encrypt.js'
import { CLIENT_ID } from '@/enums/cacheEnums';
import {showAlert} from '@/utils/message.js'
// #ifdef APP-PLUS
// 获取 存储手机的module
const safeSave = uni.requireNativePlugin("Tm-TmSafeSaveFileModule");
// #endif
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
let clientId = `${proxy.$CLIENT_ID || 2}`;
let networkEnv = ref(proxy.$NETWORK_ENV);//1-内网 2-外网
onLoad(async(opt) => {
uni.setStorageSync('page_cache',true);
})
@@ -248,13 +251,13 @@ const submitForm = () => {
// 用户名和密码登录
form2.value.validate().then(async param => {
param.loginType = activeTab.value;
let clientId = `${CLIENT_ID || "2"}`;
param.clientId = clientId;
let password = encryptObj.Encrypt(param.username + clientId + "," + param.password);
param.password = password;
param.runEnv = networkEnv.value;
// #ifdef H5
param.uniqCode = '7f47cfb4-59e2-4cb9-ac46-9da5e23c4de2';//uni.getStorageSync('app_device_id');//先从缓存取之后处理 '7f47cfb4-59e2-4cb9-ac46-9da5e23c4de2'//
param.uniqCode = 'sn123456';//h5测试用 内网-sn123456 外网-e5687e80-526f-4522-ba7d-41d5db197a15
let res = await login(param);
userStore.login(res);
uni.switchTab({ url: '/pages/home/home' })

View File

@@ -2,17 +2,18 @@
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'消息'" :leftFlag="false" :rightFlag="true" v-if="!searchShow">
<template #right>
<customHeader ref="customHeaderRef" :title="!searchShow?'消息':'搜索'"
:leftFlag="!searchShow?false:true"
:rightFlag="true"
@back="handleBack" :searchType="searchShow?1:undefined"
>
<template #right v-if="!searchShow">
<view class="head-right" @click="handleRead">
<img :src="'static/images/icon-clean@2x.png'" />清除未读
</view>
</template>
</customHeader>
<customHeader v-else ref="customHeaderRef" :title="'搜索'"
:leftFlag="true" :rightFlag="false"
@back="handleBack" :searchType="1"
></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
@@ -54,7 +55,7 @@
<script setup>
import { ref, onMounted,computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app';
import { onLoad,onHide } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue'
import customSearch from '@/components/customSearch.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
@@ -85,6 +86,9 @@ let noticeTypeList=ref([
]);
let notictTypeCheck = ref({});//选中类型
onHide(()=>{
searchShow.value=false;
})
// 搜索返回操作
const handleBack=()=>{

View File

@@ -103,6 +103,7 @@ import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import { getNavBarPaddingTop } from '@/utils/system.js'
import { getUserInfo,versionCheck } from '@/api/auth.js'
import { formatIOS } from '@/utils/status.js'
import { showAlert } from '@/utils/message.js'
import { useUserStore } from '@/stores/user';
const userStore = useUserStore()
@@ -193,10 +194,14 @@ const getVersion = async ()=>{
// 3.退出登录
const handleLoginOut = async ()=>{
userStore.logout();
uni.reLaunch({
url: '/pages/login/login',
});
showAlert('是否确认退出?','提示',true,()=>{
userStore.logout();
uni.reLaunch({
url: '/pages/login/login',
});
})
}
// 4.跳转到版本
@@ -213,7 +218,7 @@ onMounted(() => {
<style scoped>
.scroll-h{
/* #ifdef APP-PLUS */
height:calc(100vh - 30px) !important;
height:calc(100vh - 50px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 30px) !important;

View File

@@ -5,7 +5,8 @@ page {
height: 100%;
padding: 0;
margin: 0;
background-color: #F5F5F5;
background-color: #307AF5;
/* background-color: #F5F5F5; */
color: #333;
}
@@ -19,26 +20,30 @@ page {
width: 100%;
margin: 0;
padding: 0;
background-color: #F5F5F5;
}
.con-bg {
position: absolute;
top: 0;
right: 0;
bottom: 0;
/* #ifdef APP-PLUS */
background: url('@/static/images/bg-Blue.png') no-repeat;
background-size: 100vw 761rpx;
width: 100vw;
height: 761rpx;
background-color: #F5F5F5;
background-image: url('@/static/images/bg-Blue.png');
background-repeat: no-repeat;
background-size: 750rpx 761rpx;
width: 750rpx;
/* height: 761rpx; */
left: 0;
/* #endif */
/* #ifndef APP-PLUS */
background: url('@/static/images/bg-Blue.png') no-repeat;
background-color: #F5F5F5;
background-image: url('@/static/images/bg-Blue.png');
background-repeat: no-repeat;
background-size: 750rpx 761rpx;
width: 750rpx;
height: 761rpx;
/* height: 761rpx; */
left: 50%;
margin-left: -375rpx;
/* #endif */
@@ -187,7 +192,7 @@ page {
/* width:690rpx; */
width:630rpx;
height:56rpx;
margin:0 auto 30rpx;
margin:10rpx auto 30rpx;
padding:0 30rpx;
display: flex;
color:#fff;

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B