This repository has been archived on 2022-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
saas-page-web/index.html

76 lines
2.0 KiB
HTML
Raw Normal View History

2022-08-30 01:39:22 +00:00
<!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 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
}
})
}
})
}
},
created() {
fetch('http://192.168.26.198:3001/epi-project/tenants').then(r => r.json()).then(res => {
this.tenantList = res.data;
})
}
})
$('.sel-input').click(() => {
$('#sel-body').animate({
height: 'toggle',
opacity: 'toggle'
})
});
</script>
</body>
</html>