| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <template>
- <view class="container">
- <!-- 接单考核时间区域 -->
- <view class="box">
- 接单考核时间
- <view class="box_time">
- <input type="number" v-model="receivingTime" @blur="handleChange($event, 1)" />
- <img src="../../static/images/repairsImg/clock.png" />
- </view>
- 分钟
- </view>
- <!-- 维修考核时间区域 -->
- <view class="box">
- 维修考核时间
- <view class="box_time">
- <input type="number" v-model="repairsTime" @blur="handleChange($event, 2)" />
- <img src="../../static/images/repairsImg/clock.png" />
- </view>
- 分钟
- </view>
- <!-- 提交按钮区域 -->
- <view class="btn" @click="handleSub">提交</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- receivingTime: 0,
- repairsTime: 0
- }
- },
- methods: {
- // 提交按钮回调
- handleSub() {
- uni.showModal({
- title: '提示',
- content: '确定延时吗?',
- success: (res) => {
- if (res.confirm) {
- console.log(this.receivingTime)
- console.log(this.repairsTime)
- uni.showToast({
- title: '延时成功',
- icon: 'success'
- })
- setTimeout(() => {
- uni.navigateBack(1)
- }, 1500)
- }
- }
- })
- },
- // 输入框输入事件回调
- handleChange(e, type) {
- // console.log(e.detail.value)
- // 验证输入为整数
- const reg = /^\+?[1-9][0-9]*$/
- if (!reg.test(e.detail.value)) {
- uni.showToast({
- title: '输入格式错误,请重新输入',
- icon: 'none'
- })
- if (type === 1) {
- this.receivingTime = 0
- } else {
- this.repairsTime = 0
- }
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- box-sizing: border-box;
- padding: 0 30rpx;
- width: 100vw;
- height: 100vh;
- .box {
- display: flex;
- align-items: center;
- height: 100rpx;
- font-size: 32rpx;
- font-weight: bold;
- .box_time {
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-sizing: border-box;
- padding: 0 23rpx;
- margin: 0 25rpx;
- width: 237rpx;
- height: 68rpx;
- font-weight: 400;
- border-radius: 4rpx;
- border: 1rpx solid #a6a6a6;
- input {
- flex: 1;
- }
- img {
- width: 40rpx;
- height: 40rpx;
- }
- }
- }
- .btn {
- position: absolute;
- bottom: 66rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- margin: auto;
- width: 690rpx;
- height: 100rpx;
- color: #fff;
- font-size: 32rpx;
- border-radius: 12rpx;
- background-color: #6fb6b8;
- }
- }
- </style>
|