unknown
12 months ago
13 changed files with 452 additions and 150 deletions
-
60components/callPhone/callPhone.vue
-
8config/api.js
-
60config/request.js
-
11pages.json
-
63pages/recordEntry/operate/mySchedule/plan/plan.vue
-
2pages/tabbar/mine/index.vue
-
43pages/userCenter/examinInfo/comp/examinItem.vue
-
92pages/userCenter/examinInfo/examinInfo.vue
-
6pages/userCenter/myCar/comp/unbind.vue
-
43pages/userCenter/myCar/myCar.vue
-
138pages/userCenter/myCar/notBound/notBound.vue
-
37pages/userCenter/studentComment/studentComment.vue
-
39store/modules/user.js
@ -0,0 +1,60 @@ |
|||
<template> |
|||
<view class="box"> |
|||
<view class="phoneIcon" @click.stop="phoneClick"> |
|||
<slot></slot> |
|||
</view> |
|||
<u-action-sheet :actions="servicePhone" :show="show" @select="callPhoneClick" :closeOnClickOverlay="true" @close="show=false" cancelText="取消"></u-action-sheet> |
|||
</view> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
// props: { |
|||
// servicePhone: { |
|||
// type: Array, |
|||
// default: [] |
|||
// } |
|||
// }, |
|||
props: ['servicePhone'], |
|||
data() { |
|||
return { |
|||
// servicePhone: [ |
|||
// {name: '18267103167'}, |
|||
// {name: '18267103168'}, |
|||
// ], |
|||
show: false |
|||
} |
|||
}, |
|||
methods: { |
|||
phoneClick() { |
|||
if(!this.servicePhone) return false |
|||
if(this.servicePhone.length==1) { |
|||
this.callPhoneClick(this.servicePhone[0]) |
|||
}else { |
|||
show=true |
|||
} |
|||
}, |
|||
callPhoneClick(item) { |
|||
|
|||
let phone = item.name |
|||
// #ifdef MP-WEIXIN |
|||
this.$u.utils.callPhone(phone) |
|||
// #endif |
|||
|
|||
// #ifdef H5 |
|||
var a = document.createElement('a') |
|||
a.setAttribute('href', 'tel:'+ phone) |
|||
document.body.appendChild(a) |
|||
a.click() |
|||
console.log(phone) |
|||
// #endif |
|||
|
|||
this.show =false |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,138 @@ |
|||
<template> |
|||
<view class="pageBgImg"> |
|||
<topNavbar title="未绑定的车辆"></topNavbar> |
|||
<view class="pad"> |
|||
<view class="searcBox"> |
|||
<searchRow placeholder="搜索车牌号" @searchFn="searchFn"></searchRow> |
|||
</view> |
|||
<view class="ul"> |
|||
<view class="card" v-for="(item,index) in list" :key="index"> |
|||
<view class="name">车牌号:{{item.licnum}}</view> |
|||
<view class="text">车辆型号:{{item.manufacturer}}</view> |
|||
<view class="flex-b"> |
|||
<view class="text">培训车型:{{item.perdritype}}</view> |
|||
<view class="btnBg" @click="bindClick(item)">立即绑定</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view style="padding-bottom: 20rpx;" v-if="list.length"> |
|||
<u-loadmore :status="status" /> |
|||
</view> |
|||
<nodata v-if="!list.length&&status=='nomore'"></nodata> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { carPage, coachBinding } from '@/config/api.js' |
|||
export default { |
|||
data() { |
|||
return { |
|||
list: [], |
|||
params: { |
|||
pageNo: 1, |
|||
pageSize: 20, |
|||
coachId: 0 |
|||
}, |
|||
total: 20, |
|||
status: 'loading' |
|||
} |
|||
}, |
|||
onLoad() { |
|||
this.params.schoolId = this.vuex_schoolId |
|||
this.carPageFn() |
|||
}, |
|||
onPullDownRefresh() { |
|||
this.list = [] |
|||
this.params.pageNo = 1 |
|||
this.carPageFn().then(()=>{uni.stopPullDownRefresh()}) |
|||
}, |
|||
onReachBottom() { |
|||
if(this.total>this.list.length) { |
|||
this.carPageFn() |
|||
} |
|||
}, |
|||
methods: { |
|||
async carPageFn() { |
|||
const {data: res} = await carPage(this.params) |
|||
this.params.pageNo ++ |
|||
this.list.push(...res.list) |
|||
this.total = res.total |
|||
if(this.list.length>=this.total) this.status = 'nomore' |
|||
console.log(res) |
|||
}, |
|||
searchFn(val) { |
|||
console.log(val) |
|||
this.params.licnum = val |
|||
this.list = [] |
|||
this.params.pageNo = 1 |
|||
this.carPageFn() |
|||
}, |
|||
async coachBindingFn(item) { |
|||
let obj = { |
|||
"carId": item.id, |
|||
"coachId": this.vuex_coachId, |
|||
"coachName": this.vuex_userInfo.user.nickname |
|||
} |
|||
const res = await coachBinding(obj) |
|||
if(res.code==0) { |
|||
this.$u.toast('绑定成功') |
|||
setTimeout(()=>{ |
|||
uni.navigateBack() |
|||
}, 1500) |
|||
} |
|||
console.log(res) |
|||
}, |
|||
bindClick(item) { |
|||
let title = `确定要将 ${item.licnum} 教练车绑定到您的名下吗?` |
|||
let _this = this |
|||
uni.showModal({ |
|||
title, |
|||
success: function(res) { |
|||
if (res.confirm) { |
|||
_this.coachBindingFn(item) |
|||
} else if (res.cancel) { |
|||
console.log('用户点击取消'); |
|||
} |
|||
} |
|||
}) |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.ul { |
|||
padding-top: 20rpx; |
|||
.card { |
|||
padding: 20rpx; |
|||
margin-bottom: 20rpx; |
|||
.name { |
|||
font-size: 28rpx; |
|||
font-weight: 550; |
|||
color: $themC; |
|||
} |
|||
|
|||
.text { |
|||
margin-top: 16rpx; |
|||
font-size: 26rpx; |
|||
color: #333; |
|||
} |
|||
|
|||
.flex-b { |
|||
.text { |
|||
|
|||
} |
|||
|
|||
.btnBg { |
|||
height: 60rpx; |
|||
line-height: 60rpx; |
|||
padding: 0 28rpx; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue