| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- <template>
- <view class="container">
- <view class="info">{{ info }}</view>
- <!-- 床位列表区域 -->
- <view class="bed_list">
- <!-- 每一个床位区域 -->
- <view class="bed_item" v-for="(item, index) in bedList" :key="index">
- <view class="item_top">
- <view class="top_left" v-if="item.isCheck == 0">暂无入住</view>
- <view class="top_left" v-if="item.isCheck == 1">{{ item.name ? '本人入住' : '已入住' }}</view>
- <view class="top_right">{{ index + 1 }}号床</view>
- </view>
- <!-- 详细信息区域 -->
- <view class="item_form icon" v-if="item.isCheck == 0">
- <image class="form_not" src="/static/5.png" mode="aspectFill"></image>
- 暂无入住
- </view>
- <view class="item_form icon" v-if="item.isCheck == 1 && !item.name">
- <image class="form_have" src="/static/4.png" mode="aspectFill"></image>
- 已入住
- </view>
- <view class="item_form" v-if="item.isCheck == 1 && item.name">
- <view class="form_left">
- <view class="left_box">
- <view class="box_key">姓名:</view>
- <view class="box_value">
- <input
- class="input"
- type="text"
- placeholder="请输入姓名"
- placeholder-style="color:#CCCCCC;font-size:28rpx"
- :value="item.name"
- :disabled="item.name"
- />
- </view>
- </view>
- <view class="left_box">
- <view class="box_key">学院:</view>
- <view class="box_value">
- <input
- class="input"
- type="text"
- placeholder="请输入学院"
- placeholder-style="color:#CCCCCC;font-size:28rpx"
- :value="item.college"
- :disabled="item.college"
- />
- </view>
- </view>
- <view class="left_box">
- <view class="box_key">专业:</view>
- <view class="box_value">
- <input
- class="input"
- type="text"
- placeholder="请输入专业"
- placeholder-style="color:#CCCCCC;font-size:28rpx"
- :value="item.major"
- :disabled="item.major"
- />
- </view>
- </view>
- <view class="left_box">
- <view class="box_key">联系方式:</view>
- <view class="box_value">
- <input
- class="input"
- type="text"
- placeholder="请输入联系方式"
- placeholder-style="color:#CCCCCC;font-size:28rpx"
- :value="item.phone"
- :disabled="item.phone"
- />
- </view>
- </view>
- <view class="left_box">
- <view class="box_key">家庭住址:</view>
- <view class="box_value">
- <input
- class="input"
- type="text"
- placeholder="请输入家庭住址"
- placeholder-style="color:#CCCCCC;font-size:28rpx"
- :value="item.address"
- :disabled="item.address"
- />
- </view>
- </view>
- </view>
- <!-- 照片区域 -->
- <image class="form_photo" v-if="item.picture" :src="item.picture" mode="aspectFill"></image>
- <image class="form_photo" v-else src="@/static/7.png" mode="aspectFill"></image>
- </view>
- </view>
- </view>
- <!-- 按钮区域 -->
- <view class="btns">
- <view class="btn_next" @click="handleLook">查看预报道凭证</view>
- <view class="btn_next" @click="handleCar">车牌预约</view>
- <view class="btn_next" @click="logout">退出登录</view>
- </view>
- </view>
- </template>
- <script setup>
- import { onLoad } from '@dcloudio/uni-app'
- import { ref } from 'vue'
- import { getBedDetailsReq } from '@/api/index.js'
- const info = ref()
- const studentInfo = ref()
- // 宿舍床位数组
- const bedList = ref([])
- onLoad((options) => {
- // console.log(options)
- info.value = options.str
- studentInfo.value = uni.getStorageSync('studentInfo')
- getBedDetails()
- })
- // 获取宿舍详情
- const getBedDetails = async () => {
- const res = await getBedDetailsReq()
- // console.log(res)
- if (res.code == 200) {
- bedList.value = res.data
- }
- }
- // 查看电子凭证按钮回调
- const handleLook = () => {
- let studentCard = uni.getStorageSync('studentInfo').cardId
- // console.log(studentCard)
- if (bedList.value.length) {
- let obj = bedList.value.find((ele) => ele.studentCard == studentCard)
- // console.log(obj)
- if (obj) {
- let msg = encodeURIComponent(JSON.stringify(obj))
- uni.navigateTo({
- url: `/pages/proof/proof?msg=${msg}`
- })
- } else {
- uni.showToast({
- title: '请先选择床位',
- icon: 'none'
- })
- }
- } else {
- uni.showToast({
- title: '请先选择床位',
- icon: 'none'
- })
- }
- }
- // 车牌预约按钮回调
- const handleCar = () => {
- let info = uni.getStorageSync('studentInfo')
- // console.log(info)
- if (info.trafficMethod == '自驾') {
- uni.showModal({
- title: '提示',
- content: '确定前往车牌预约吗?',
- success: (res) => {
- if (res.confirm) {
- uni.reLaunch({
- url: '/pages/subscribe/subscribe'
- })
- }
- }
- })
- } else {
- uni.showToast({
- title: '您选择的交通方式不为自驾,不支持车牌预约',
- icon: 'none'
- })
- }
- }
- // 退出登录按钮回调
- const logout = () => {
- uni.showModal({
- title: '提示',
- content: '确定退出登录吗?',
- success: (res) => {
- if (res.confirm) {
- let urlstr = uni.getStorageSync('urlstr')
- uni.clearStorageSync()
- window.location.href = `https://chtech.ncjti.edu.cn/welcome/welcomeH5/#/?urlstr=${urlstr}`
- }
- }
- })
- }
- </script>
- <style lang="scss" scoped>
- .container {
- padding-top: 12rpx;
- padding-bottom: 50rpx;
- min-height: 100vh;
- background-color: #f5f9ff;
- .info {
- padding: 0 20rpx;
- height: 90rpx;
- line-height: 90rpx;
- font-size: 36rpx;
- font-weight: bold;
- text-align: center;
- background-color: #fff;
- }
- .bed_list {
- background-color: #fff;
- .bed_item {
- padding: 0 20rpx;
- margin-bottom: 20rpx;
- .item_top {
- display: flex;
- align-items: center;
- height: 80rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #0061ff;
- .top_left {
- box-sizing: border-box;
- padding-left: 42rpx;
- width: 520rpx;
- height: 100%;
- line-height: 80rpx;
- border-radius: 9rpx 9rpx, 0rpx, 0rpx;
- background-color: #cce0ff;
- }
- .top_right {
- flex: 1;
- height: 100%;
- line-height: 80rpx;
- text-align: center;
- }
- }
- .item_form {
- display: flex;
- box-sizing: border-box;
- padding-top: 40rpx;
- width: 710rpx;
- height: 543rpx;
- border-radius: 8rpx;
- background-color: #f2f7ff;
- .form_left {
- width: 520rpx;
- .left_box {
- display: flex;
- align-items: center;
- margin-bottom: 20rpx;
- .box_key {
- width: 140rpx;
- text-align: end;
- font-size: 28rpx;
- }
- .box_value {
- box-sizing: border-box;
- padding: 0 20rpx;
- width: 355rpx;
- height: 74rpx;
- border-radius: 4rpx;
- background-color: #fff;
- .input {
- height: 100%;
- }
- }
- }
- }
- .form_photo {
- margin-left: 20rpx;
- width: 156rpx;
- height: 199rpx;
- border-radius: 8rpx;
- border: 2rpx solid #ccc;
- }
- .form_have {
- margin-bottom: 5rpx;
- width: 132rpx;
- height: 132rpx;
- }
- .form_not {
- width: 174rpx;
- height: 174rpx;
- }
- }
- .icon {
- flex-direction: column;
- align-items: center;
- justify-content: center;
- font-size: 24rpx;
- }
- }
- }
- .btns {
- padding: 20rpx 20rpx 0;
- background-color: #fff;
- .btn_next {
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 50rpx 20rpx;
- height: 100rpx;
- font-size: 32rpx;
- color: #fff;
- border-radius: 8rpx;
- background-color: #0061ff;
- }
- }
- }
- </style>
|