Commit fc303434 authored by xinzhedeai's avatar xinzhedeai

home bg图

parent 9f10fe24
import { showCustomModal, storageInfo } from "./util";
import { showCustomModal } from "./util";
import { BASEURL, REQUESTIMEOUT } from "./config";
console.log(BASEURL, 'BASEURLBASEURLBASEURL')
const BASE_URL = BASEURL;
const REQUEST_TIMEOUT = REQUESTIMEOUT;
......@@ -12,7 +13,7 @@ export default function request(options) {
data: options.data || {},
header: options.header || {
'Content-Type': 'application/json',
'Authorization': storageInfo.get('token')
'Authorization': uni.getStorageSync('token')
},
success: (res) => {
console.log(res, 'request')
......@@ -44,12 +45,12 @@ uni.addInterceptor("request", {
showCustomModal({
content: msg,
success: function() {
uni.getStorageSync('token', '')
uni.reLaunch({ // 登录超时跳转登录页面
url: "/pages/user/login"
})
}
});
return
}
if (code !== 200) {
showCustomModal({
......
......@@ -319,6 +319,7 @@ var pager = {
})
},
relaunchTo: function(url){
console.log('relaunch', url)
uni.reLaunch({
url
})
......
......@@ -3,10 +3,12 @@
<view class="body-wrapper">
<view class="logo-wrapper">
<image class="logoImg" src="/static/image/home/logo.png" alt="" />
<h3>露天炮孔验收仪</h3>
<button @click="gosend">获取电量</button>
</view>
<view class="link-info-wrapper" @click="gosend('POWER')">
<image class="bg" src="../../static/image/paokong/home-title-bg.png" mode=""></image>
<div class="left">
<image :src="`/static/image/paokong/${connected?'linkY':'linkN'}.png`" mode=""></image>
<view class="link-status">
......@@ -14,9 +16,20 @@
</view>
</div>
<div class="right">
<h2>设备参数</h2>
<p>设备名称:露天炮孔验收仪</p>
<p>设备型号:MYSM-OH-01</p>
<div class="top">
<h2>设备电量</h2>
<p>
小球 <image src="/static/image/paokong/qiu-dl.png">{{ '22' }} %
仪器 <image src="/static/image/paokong/shebei-dl.png">{{ '24' }} %
</p>
</div>
<div class="bottom">
<h2>设备参数</h2>
<p>设备名称:露天炮孔验收仪</p>
<p>设备型号:MYSM-OH-01</p>
<p>设备ID:MYSM-OH-01</p>
</div>
</div>
</view>
<p class="list-item" @click="uploadExcel">
......@@ -235,9 +248,7 @@
url = '/pages/home/operateLog'
}
uni.navigateTo({
url
})
pager.navTo(url)
}
}
}
......@@ -301,22 +312,33 @@
}
.link-info-wrapper {
position: relative;
width: 646rpx;
height: 300rpx;
background: url('@/static/image/paokong/home-title-bg.png');
height: 440rpx;
// background-image: url('/static/image/paokong/home-title-bg.png');
// background-color: linear-gradient(-90deg, #F6F9FF 31%, #E4EFFF 100%);
background-position: center right;
background-size: cover;
box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(7, 36, 72, 0.11);
border-radius: 10rpx;
border: 2px solid #FFFFFF;
display: flex;
align-items: center;
gap: 47rpx;
padding-left: 49rpx;
// background-position: center;
// background-size: cover;
// box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(7, 36, 72, 0.11);
// border-radius: 10rpx;
// border: 2px solid #FFFFFF;
// display: flex;
// align-items: center;
// gap: 47rpx;
// padding-left: 49rpx;
.bg{
position: absolute;
bottom: 0;
left: -40rpx;
right: 0;
width: 728rpx;
height: 464rpx;
z-index: 0;
}
.left {
position: absolute;
left: 60rpx;
top: 110rpx;
image {
width: 136rpx;
height: 136rpx;
......@@ -339,6 +361,26 @@
}
.right {
position: absolute;
right: 10rpx;
top: 18rpx;
.top{
image{
width: 15rpx;
height: 30rpx;
}
p{
display: flex;
justify-content: start;
align-items: center;
gap: 10rpx;
font-size: 30rpx;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
border-bottom: 4rpx solid #CCD1DB;
}
}
h2 {
font-size: 34rpx;
font-weight: bold;
......
......@@ -19,7 +19,7 @@
<script>
import {showCustomToast, popuper, storageInfo, pager} from '../../common/util.js'
import {showCustomToast, popuper, storager, pager} from '../../common/util.js'
import {login} from '../../api/login.js'
export default {
onLoad() {
......@@ -51,7 +51,7 @@
},
methods: {
async wxLogin(){
popuper.hideLoading({title: '登录中...'})
popuper.showLoading({title: '登录中...'})
const loginRes = await this.getWxCode()
if(!loginRes.code){
showCustomToast({
......@@ -106,11 +106,9 @@
popuper.hideLoading()
if(res){
storageInfo.set('token', res.token)
storager.set('token', res.token)
console.log('获取token', res.token)
pager.relaunchTo({
url: '/pages/home/home'
})
pager.relaunchTo('/pages/home/home')
}
}
......
static/image/paokong/qiu-dl.png

128 KB | W: | H:

static/image/paokong/qiu-dl.png

477 Bytes | W: | H:

static/image/paokong/qiu-dl.png
static/image/paokong/qiu-dl.png
static/image/paokong/qiu-dl.png
static/image/paokong/qiu-dl.png
  • 2-up
  • Swipe
  • Onion skin
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