更新修改

master
lion 1 year ago
parent 55994c3910
commit 2ca9e9d649

@ -59,7 +59,7 @@
<u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker> <u-picker @confirm="dateConfirm" mode="time" v-model="dateShow" :params="dateParams"></u-picker>
<timeSlot ref="timeslot" :title="'选择时间段'" :min="hMin" :max="hMax" @confirm="confirmTime"></timeSlot> <timeSlot ref="timeslot" :title="'选择时间段'" :min="hMin" :max="hMax" @confirm="confirmTime"></timeSlot>
<u-picker @confirm="siteConfirm" v-model="siteShow" :range="siteList" range-key="name" <u-picker @confirm="siteConfirm" v-model="siteShow" :range="siteList" range-key="real_name"
mode="selector"></u-picker> mode="selector"></u-picker>
<!-- 新增车牌 --> <!-- 新增车牌 -->

@ -49,13 +49,25 @@
</view> </view>
<view v-if="info.status===1" class="wrap-code"> <view v-if="info.status===1" class="wrap-code">
<view style="display: flex;justify-content: center;margin-top:40rpx"> <view style="display: flex;justify-content: center;margin-top:40rpx" @click="showBigCode">
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="info.code" :sizeUnit="'rpx'" :size="400" <uqrcode ref="uqrcode" canvas-id="qrcode" :value="code" :sizeUnit="'rpx'" :size="400" :options="{
:options="{
margin: 10, margin: 10,
foregroundImageSrc: '/static/index_icon1.png', foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode> }"></uqrcode>
</view> </view>
<view class="modal-xyk-item-reload" @click="refreshCode(book_id)">
<!-- <image :src="base.imgHost('me-reload.png')"></image> -->
<view>点击刷新二维码</view>
</view>
</view>
</view>
<view v-if="bigCode" class="big">
<view class="big-wrap">
<view class="big-close" @click='bigCode=false'>X</view>
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="code" :sizeUnit="'rpx'" :size="500" :options="{
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view> </view>
</view> </view>
</view> </view>
@ -71,11 +83,28 @@
data() { data() {
return { return {
info: {}, info: {},
passcode:'' passcode: '',
book_id: '',
code: '',
bigCode: false,
timer:null
} }
}, },
onLoad(options) { onLoad(options) {
let that = this
this.book_id = options.id
this.getBookDetail(options.id) this.getBookDetail(options.id)
if(!this.timer){
this.timer = setInterval(function(){
that.refreshCode(that.book_id)
},3*60*1000)
}
},
onUnload() {
if(this.timer){
clearInterval(this.timer)
this.timer = null
}
}, },
methods: { methods: {
async getBookDetail(id) { async getBookDetail(id) {
@ -83,6 +112,22 @@
id: id id: id
}) })
this.info = res this.info = res
this.code = res.qrcode
},
async refreshCode(id) {
uni.showLoading({
title: '...'
})
const res = await this.$u.api.scheduleDetail({
id: id
})
this.code = res.qrcode
setTimeout(function() {
uni.hideLoading()
}, 500)
},
showBigCode() {
this.bigCode = true
}, },
formatTime(val) { formatTime(val) {
if (val) { if (val) {
@ -118,23 +163,75 @@
border-radius: 20rpx; border-radius: 20rpx;
background-color: #fff; background-color: #fff;
padding: 30rpx; padding: 30rpx;
margin-bottom:30rpx; margin-bottom: 30rpx;
&>view{
&>view {
font-size: 28rpx; font-size: 28rpx;
color:#666666; color: #666666;
margin-bottom:30rpx; margin-bottom: 30rpx;
display: flex; display: flex;
&>text:first-child{
color:#333; &>text:first-child {
width:180rpx; color: #333;
width: 180rpx;
display: inline-block; display: inline-block;
font-weight: bold; font-weight: bold;
} }
&>text:last-child{
&>text:last-child {
width: calc(100% - 180rpx); width: calc(100% - 180rpx);
} }
} }
} }
} }
.modal-xyk-item-reload {
display: flex;
align-items: center;
padding: 30rpx 40rpx;
font-size: 40rpx;
justify-content: center;
image {
width: 27rpx;
height: 25rpx;
margin-right: 10rpx;
}
}
.big {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
overflow: scroll;
&-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 500rpx;
text-align: center;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
&-close {
width: 80rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
background: #6e6e77;
border-radius: 80rpx;
position: absolute;
top: -80rpx;
right: 0;
}
}
} }
</style> </style>

@ -18,8 +18,8 @@
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text> <text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</view> </view>
</view> </view>
<view class="usercode"> <view class="usercode" @click="showBigCode=true">
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="userInfo.code" :sizeUnit="'rpx'" <uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'"
:size="160" :options="{ :size="160" :options="{
margin: 10, margin: 10,
foregroundImageSrc: '/static/index_icon1.png', foregroundImageSrc: '/static/index_icon1.png',
@ -96,8 +96,8 @@
<!-- <view style="margin-bottom:40rpx;text-align: center;">电子校园卡</view> --> <!-- <view style="margin-bottom:40rpx;text-align: center;">电子校园卡</view> -->
<view class="modal-xyk-between"> <view class="modal-xyk-between">
<view class="modal-xyk-item"> <view class="modal-xyk-item">
<view style="display: flex;justify-content: center;" @click="refreshCode"> <view style="display: flex;justify-content: center;" @click="bigCode">
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="userInfo.code" :sizeUnit="'rpx'" <uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'"
:size="160" :options="{ :size="160" :options="{
margin: 10, margin: 10,
foregroundImageSrc: '/static/index_icon1.png', foregroundImageSrc: '/static/index_icon1.png',
@ -116,7 +116,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="modal-xyk-item-reload" @click="refreshCode"> <view class="modal-xyk-item-reload" @click="getQrCode" v-if="myQrcode">
<image :src="base.imgHost('me-reload.png')"></image> <image :src="base.imgHost('me-reload.png')"></image>
<view>点击二维码刷新</view> <view>点击二维码刷新</view>
</view> </view>
@ -152,7 +152,15 @@
</u-popup> </u-popup>
</view> </view>
<view v-if="showBigCode" class="big">
<view class="big-wrap">
<view class="big-close" @click='showBigCode=false'>X</view>
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'" :size="500" :options="{
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
</view>
<tabbar :currentPage="3"></tabbar> <tabbar :currentPage="3"></tabbar>
</view> </view>
</template> </template>
@ -173,7 +181,10 @@
showCard: false, showCard: false,
userInfo: {}, userInfo: {},
hasMobile: false, hasMobile: false,
course_signs: [] course_signs: [],
showBigCode:false,
myQrcode:'',
timer:null
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -191,8 +202,28 @@
onShow() { onShow() {
this.showRegister = false this.showRegister = false
this.getUserInfo() this.getUserInfo()
let that = this
if(!this.timer){
this.timer = setInterval(function(){
that.getQrCode()
},3*60*1000)
}
},
onLoad() {
},
onUnload() {
if(this.timer){
clearInterval(this.timer)
this.timer = null
}
},
onHide() {
if(this.timer){
clearInterval(this.timer)
this.timer = null
}
}, },
onLoad() {},
methods: { methods: {
refreshCode() { refreshCode() {
if (!this.hasMobile) { if (!this.hasMobile) {
@ -201,14 +232,10 @@
return return
} }
this.showCard = true this.showCard = true
this.$refs.uqrcode.make({ },
success: () => { bigCode(){
console.log('生成成功'); this.showCard = false
}, this.showBigCode = true
fail: err => {
console.log(err)
}
});
}, },
toUrl(type) { toUrl(type) {
if (type === 1 || type === 2 || type === 3) { if (type === 1 || type === 2 || type === 3) {
@ -245,7 +272,8 @@
console.log("res", res) console.log("res", res)
this.$u.vuex('vuex_user', res.user) this.$u.vuex('vuex_user', res.user)
this.userInfo = res.user this.userInfo = res.user
this.course_signs = res.user.course_signs ? res.user.course_signs : [] this.course_signs = res.user.course_signs ? res.user.course_signs : [],
this.myQrcode = res.course_signs?res.course_signs.qrcode:''
if (this.base.isNull(res.user.mobile)) { if (this.base.isNull(res.user.mobile)) {
this.showRegister = true this.showRegister = true
this.hasMobile = false this.hasMobile = false
@ -255,6 +283,17 @@
} }
}) })
}, },
getQrCode(){
uni.showLoading({
title: '...'
})
this.$u.api.user().then(res => {
this.myQrcode = res.course_signs?res.course_signs.qrcode:''
setTimeout(function() {
uni.hideLoading()
}, 500)
})
},
// //
goBind() { goBind() {
console.log("qwe") console.log("qwe")
@ -521,7 +560,7 @@
&>view { &>view {
text-align: left; text-align: left;
margin-bottom: 20rpx; // margin-bottom: 20rpx;
} }
&-course { &-course {
@ -537,5 +576,39 @@
} }
} }
} }
.big {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
overflow: scroll;
&-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 500rpx;
text-align: center;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
&-close {
width: 80rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
background: #6e6e77;
border-radius: 80rpx;
position: absolute;
top: -80rpx;
right: 0;
}
}
} }
</style> </style>
Loading…
Cancel
Save