80 lines
2.1 KiB
HTML
80 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title></title>
|
|
<meta name="viewport"
|
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
|
<script src="js/v2.6.10/vue.min.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js">
|
|
</script>
|
|
<link rel="stylesheet" href="css/style.css">
|
|
<link rel="stylesheet" href="css/scroll.css">
|
|
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<h1>智慧防疫平台</h1>
|
|
<div class="sel-div">
|
|
<div class="sel-input">
|
|
<p class="sel-placeholder" v-if="!selectedTenant">请选择租户</p>
|
|
<p class="sel-text" v-else>{{selectedTenant.name}}</p>
|
|
<img src="img/arrow.png" />
|
|
</div>
|
|
<div class="sel-body" id="sel-body">
|
|
<div class="set-place"></div>
|
|
<div class="option-body">
|
|
<div :class="{'active-option':selectedTenant && tenant.identifier == selectedTenant.identifier}"
|
|
v-for="tenant in tenantList" @click="selChange(tenant)">{{tenant.name}}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
// var host = 'http://192.168.26.198:10089';
|
|
var ctx = '/epi-project'
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
tenantList: [],
|
|
selectedTenant: null
|
|
},
|
|
methods: {
|
|
selChange(tenant) {
|
|
this.selectedTenant = tenant;
|
|
$('#sel-body').animate({
|
|
height: 'toggle',
|
|
opacity: 'toggle'
|
|
})
|
|
localStorage.setItem('tenant', tenant.identifier);
|
|
wx.miniProgram.getEnv(function(res) {
|
|
if (res.miniprogram) {
|
|
wx.miniProgram.postMessage({
|
|
data: {
|
|
tenant: tenant.identifier
|
|
}
|
|
})
|
|
}
|
|
});
|
|
// 跳转业务系统
|
|
location.href = '/'
|
|
}
|
|
},
|
|
created() {
|
|
fetch(ctx + '/tenants').then(r => r.json()).then(res => {
|
|
this.tenantList = res.data;
|
|
})
|
|
}
|
|
})
|
|
|
|
$('.sel-input').click(() => {
|
|
$('#sel-body').animate({
|
|
height: 'toggle',
|
|
opacity: 'toggle'
|
|
})
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|