| 12345678910111213141516171819202122232425262728293031323334 |
- <template>
- <web-view :src="url" :progress="false"></web-view>
- </template>
- <script>
- export default {
- data() {
- return {
- url: 'https://chtech.ncjti.edu.cn/carstop/dist5/#/'
- }
- },
- onLoad() {
- // 获取小程序中的用户信息
- const userInfo = uni.getStorageSync('userinfo_storage_key')
- // 获取校园打卡小程序中的用户信息
- const clockIn_userInfo = uni.getStorageSync('userInfo')
- if (userInfo) {
- // 如果在小程序中获取过用户信息
- const cardNumber = userInfo.card_number
- this.url = `${this.url}?card_number=${cardNumber}`
- } else if (!userInfo && clockIn_userInfo) {
- // 如果在校园打卡小程序中获取过用户信息
- const cardNumber = clockIn_userInfo.cardNumber
- this.url = `${this.url}?card_number=${cardNumber}`
- } else {
- // 如果都没有获取过用户信息
- this.url = `${this.url}?type=weixin`
- }
- }
- }
- </script>
- <style></style>
|