Commit 18f77d7c authored by 郭欢's avatar 郭欢

'token过期逻辑,首页修改,'

parent ed247072
......@@ -26,6 +26,7 @@ export default {
// 登录相关
SENDCODE: baseUrl + '/worker/send', // 发送验证码
BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信
REFRESHTOKEN: baseUrl + '/worker/change/token',
USERINFO: baseUrl + '/worker/user/info', // 获取用户信息
REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表
......
......@@ -5,14 +5,15 @@ export function updateToken (cb, errcb) {
.post(apiList.REFRESHTOKEN, null, {
headers: {
token: window.localStorage.getItem('token'),
type: 1
// type: 1
}
})
.then((response) => {
console.log(response, 'response--------')
if (response.status === 200) {
const curdata = response.data
const code = curdata.code
const msg = curdata.msg
const code = curdata.meta.code
const msg = curdata.meta.message
console.log('换取token ' + code + ' --- ' + msg)
if (code === 200) {
window.localStorage.setItem('token', curdata.data.token)
......@@ -22,7 +23,7 @@ export function updateToken (cb, errcb) {
typeof cb === 'function' && cb()
} else {
console.log('token换取失败-------', curdata)
// typeof errcb === 'function' && errcb(curdata)
typeof errcb === 'function' && errcb(curdata)
}
}
})
......
@import "../global.scss";
.tips-cont {
@extend .flex-h;
@extend .flex-space-between;
width: 100%;
height: 2.36rem;
background: $color-main;
color: #ffffff;
padding: .4rem .3rem .3rem .3rem;
font-size: .28rem;
.left-cont {
width: 4rem;
.tips-title {
@extend .flex-h;
@extend .flex-align-center;
font-size: .36rem;
margin-bottom: .16rem;
img {
width: .35rem;
height: .35rem;
margin-left: .12rem;
vertical-align: middle;
}
}
.tip-text {
font-size: .32rem;
margin-top: .2rem;
}
}
.btn {
@extend .flex-h;
@extend .flex-hc;
@extend .flex-align-center;
min-width: 1.6rem;
max-width: 2.5rem;
height: .46rem;
border: 1px solid #ffffff;
text-align: center;
line-height: .46rem;
border-radius: .25rem;
font-size: .28rem;
padding: 0 .1rem;
p {
margin-right: .05rem;
}
.iconfont {
font-size: .16rem;
}
}
.purchase-btn {
width: 1.88rem;
height: .6rem;
line-height: .6rem;
color: #000000;
background: #FFCA3C;
text-align: center;
line-height: .6rem;
border-radius: .16rem;
margin-top: .56rem;
// &.disabled-btn {
// color: #cccccc;
// background: #aca9a2;
// }
&.disabled-btn {
opacity: 0.6;
}
}
}
.content {
padding: .1rem .3rem;
.cont {
min-height: 100vh;
background: #fff;
padding: 0.4rem 0rem;
}
.top {
height: 0.36rem;
margin-bottom: 0.38rem;
margin-left: 0.3rem;
}
.top .point {
width: 0.1rem;
height: 0.1rem;
background: #0054ff;
border-radius: 50%;
margin-right: 0.13rem;
}
.top .status {
color: #0054ff;
font-size: 0.36rem;
font-weight: bold;
}
.menu .hc_total {
color: #727272;
font-size: 0.28rem;
}
.menu .options {
width: 1.76rem;
height: 0.58rem;
background: #ffffff;
border: 1px solid #0054ff;
border-radius: 0.12rem;
color: #0054ff;
font-size: 0.28rem;
line-height: 0.58rem;
text-align: center;
position: relative;
z-index: 10;
margin-right: 0.3rem;
}
.menu .options .option-box {
width: 1.7rem;
// height: 2rem;
background: #fff;
border: 1px solid #0054ff;
position: absolute;
top: 0.57rem;
left: 0rem;
z-index: 10;
border-radius: 0 0 0.12rem 0.12rem;
}
.order-item {
width: 6.9rem;
background: #ffffff;
margin-top: .12rem;
box-shadow: 0px 0px 0.12rem 0.01rem rgba(214, 214, 214, 0.78);
border-radius: 0.12rem;
margin: 0.4rem auto 0.2rem;
padding: 0.4rem 0.3rem;
font-size: 0.3rem;
}
.placeholder-view {
.title {
color: #0054ff;
font-size: 0.32rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
.item {
// height: 0.3rem;
margin-bottom: 0.2rem;
}
.item-title {
// min-width: 1.5rem;
color: #000000;
}
.item-desc {
color: #727272;
}
.que-desc {
margin: .2rem auto;
}
.img {
width: 1.2rem;
height: 1.2rem;
border-radius: 0.08rem;
margin-top: 0.08rem;
}
.img img {
width: 100%;
height: 2rem;
height: 100%;
border-radius: 0.08rem;
margin-left: 0.16rem;
margin-right: 0.16rem;
}
.list-item {
margin-bottom: 0.4rem;
}
.line {
width: 6.28rem;
height: 0.01rem;
background: #f1f1f1;
margin-bottom: 0.4rem;
}
.ma-item {
margin-top: 0.3rem;
}
.one {
color: #727272;
margin-bottom: 0.3rem;
}
.one-item {
margin-left: 0.3rem;
margin-right: 0.3rem;
}
.btn-item {
width: 1.8rem;
height: 0.7rem;
background: #0054ff;
border-radius: 0.35rem;
text-align: center;
line-height: 0.7rem;
color: #fff;
font-size: 0.27rem;
margin-left: 0.2rem;
}
.sf-btn {
background: #ffffff;
border: 1px solid #0054ff;
color: #0054ff;
}
.blank {
height: 1rem;
}
.van-popup {
width: 6.9rem;
max-height: 7rem;
// height: 5.9rem;
background: #fff;
border-radius: 0.12rem;
padding-top: 0.4rem;
padding-bottom: 0.2rem;
text-align: center;
}
.pop_title {
color: #000000;
font-size: 0.36rem;
font-weight: bold;
margin-bottom: 0.4rem;
}
.van-popup textarea {
width: 6.3rem;
height: 3rem;
border: 1px solid #f1f1f1;
border-radius: 0.08rem;
padding: 0.3rem 0.2rem;
}
.van-popup textarea::-webkit-input-placeholder {
color: #c8c8c8;
font-size: 0.26rem;
}
.btnItem {
margin-top: 0.4rem;
margin-left: 0.65rem;
}
.btnItem .cancel {
width: 2.65rem;
height: 0.78rem;
border: 1px solid #c8c8c8;
border-radius: 0.39rem;
color: #000000;
font-size: 0.32rem;
text-align: center;
line-height: 0.78rem;
margin-right: 0.3rem;
}
.btnItem .sure {
width: 2.65rem;
height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem;
color: #ffffff;
font-size: 0.32rem;
text-align: center;
line-height: 0.78rem;
margin-right: 0.3rem;
}
.input {
width: 6.3rem;
height: 0.76rem;
background: #ffffff;
border: 1px solid #f1f1f1;
border-radius: 0.08rem;
text-align: left;
padding-left: 0.2rem;
margin-bottom: 0.1rem;
font-size: 0.3rem;
}
.input::-webkit-input-placeholder {
color: #c8c8c8;
font-size: 0.3rem;
}
.math-btn {
margin-left: 0.3rem;
margin-right: 0.3rem;
color: #0256ff;
font-size: 0.3rem;
}
.hc_total {
text-align: left;
color: #000000;
font-size: 0.26rem;
margin-left: 0.3rem;
}
.sure-btn {
width: 3.12rem;
height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem;
color: #ffffff;
text-align: center;
line-height: 0.78rem;
margin: 1.2rem auto;
}
\ No newline at end of file
......@@ -5,58 +5,59 @@
<div class="status">工作中</div>
</div>
<div class="menu flex-h flex-hb">
<div class="hc_total">{{count}}个工单</div>
<div class="options" >
{{currentName}}
<div class="option-box" v-show="true">
<div
class="option-item"
v-for="item in optionList"
:key="item.time_type"
:value="item.name"
@click="changeItem(item.time_type,item.name)"
>{{item.name}}</div>
</div>
<div class="hc_total">{{count}}个工单</div>
<div class="options" >
<div @click="chooseTab">{{curSelect.name}}</div>
<div class="option-box" v-show="tabShow">
<div
class="option-item"
v-for="item in optionList"
:key="item.type"
:value="item.name"
@click="changeItem(item)"
>{{item.name}}</div>
</div>
</div>
</div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item" v-for="(item, index) in list" :key="item.id">
<div class="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div class="item-title">预约时间</div>
<div class="item-desc">{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-title">问题描述</div>
<div class="item-desc que-desc">{{item.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item flex-h flex-start">
<div class="item-title">服务地址</div>
<div class="item-desc">{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-title">客户姓名</div>
<div class="item-desc">{{item.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-title">联系电话</div>
<div class="item-desc phone">{{item.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-title">提交时间</div>
<div class="item-desc">{{item.created_at}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div class="item flex-h flex-start">
<div class="item-title">图片详情</div>
<div class="img flex-h" v-for="(child, index) in item.image" :key="index">
<img :src="child.url" alt />
</div>
</div>
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-title">派工对象</div>
<div class="item-desc">{{item.worker.name}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-title">联系电话</div>
<div class="item-desc">{{item.worker.phone}}</div>
</div>
<div class="material" v-if="item.no_pay_order != null" >
......@@ -166,7 +167,25 @@ export default {
},
data () {
return {
count: '',
// 头部日期范围筛选
tabShow: false, // tab范围选择框是否显示
curSelect: { type: '3', name: '本月' }, // 当前选择的日期范围
optionList: [
{ type: '1', name: '今日' },
{ type: '2', name: '本周' },
{ type: '3', name: '本月' },
{ type: '4', name: '自定义' }
],
// 工单数据
count: '', // 工单总数
list: [], // 列表
isloading: false,
page: 1,
more: true,
locked: false,
limit: 10,
status: {}, // 工作状态
imgList: [],
addList: [
{
......@@ -174,37 +193,9 @@ export default {
sl: ''
}
],
xianshi: false,
currentName: '本月',
optionList: [
{
time_type: '1',
name: '今日'
},
{
time_type: '2',
name: '本周'
},
{
time_type: '3',
name: '本月'
},
{
time_type: '4',
name: '自定义'
}
],
activeStatus: 3,
zdShow: false, // 发起转单弹窗
hcShow: false, // 耗材弹窗
lookShow: false, // 查看耗材弹窗
list: [],
isloading: false,
page: 1,
more: true,
locked: false,
limit: 10,
status: {}
lookShow: false // 查看耗材弹窗
}
},
created () {
......@@ -233,7 +224,7 @@ export default {
if (this.more && !this.isloading) {
this.isloading = true
const curParams = {
time_type: this.activeStatus,
time_type: this.curSelect.type,
page: this.page,
limit: this.limit
}
......@@ -246,7 +237,6 @@ export default {
this.locked = false
this.isloading = false
this.count = data.count
console.log(data, 1111)
})
.catch(() => {
this.locked = false
......@@ -282,25 +272,19 @@ export default {
this.addList.splice(index, 1)
},
// 点击选择
show (e) {
if (this.xianshi == true) {
this.xianshi = false
} else if (this.xianshi == false) {
this.xianshi = true
}
chooseTab (e) {
this.tabShow = !this.tabShow
},
// 日期维度变化
changeItem (time_type, name) {
console.log(time_type, name, '111111111111111111')
if (time_type == this.activeStatus) {
return
changeItem (item) {
if (item.type !== this.curSelect.type) {
this.curSelect = item
this.tabShow = false
setTimeout(() => {
this.initData()
this.getList()
}, 0)
}
this.activeStatus = time_type
this.currentName = name
setTimeout(() => {
this.initData()
this.getList()
}, 0)
},
// 备注耗材弹窗
bz_click (id) {
......@@ -341,233 +325,11 @@ export default {
query: { id }
})
}
}
},
}
</script>
<style lang="scss" scoped>
.cont {
min-height: 100vh;
background: #fff;
padding: 0.4rem 0rem;
}
.top {
height: 0.36rem;
margin-bottom: 0.38rem;
margin-left: 0.3rem;
}
.top .point {
width: 0.1rem;
height: 0.1rem;
background: #0054ff;
border-radius: 50%;
margin-right: 0.13rem;
}
.top .status {
color: #0054ff;
font-size: 0.36rem;
font-weight: bold;
}
.menu .hc_total {
color: #727272;
font-size: 0.28rem;
}
.menu .options {
width: 1.76rem;
height: 0.58rem;
background: #ffffff;
border: 1px solid #0054ff;
border-radius: 0.12rem;
color: #0054ff;
font-size: 0.28rem;
line-height: 0.58rem;
text-align: center;
position: relative;
margin-right: 0.3rem;
}
.menu .options .option-box {
width: 1.7rem;
// height: 2rem;
background: #fff;
border: 1px solid #0054ff;
position: absolute;
top: 0.57rem;
left: 0rem;
border-radius: 0 0 0.12rem 0.12rem;
}
.order-item {
width: 6.9rem;
background: #ffffff;
box-shadow: 0px 0px 0.12rem 0.01rem rgba(214, 214, 214, 0.78);
border-radius: 0.12rem;
margin-top: 0.4rem;
padding: 0.4rem 0.3rem;
margin-bottom: 0.2rem;
margin-left: 0.3rem;
}
.title {
color: #0054ff;
font-size: 0.32rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
.item {
// height: 0.3rem;
margin-bottom: 0.2rem;
}
.item-title {
color: #000000;
font-size: 0.3rem;
}
.item-desc {
color: #727272;
font-size: 0.3rem;
}
.que-desc {
margin-top: 0.4rem;
margin-bottom: 0.4rem;
}
.img {
width: 1.2rem;
height: 1.2rem;
border-radius: 0.08rem;
// margin-top: 0.8rem;
}
.img img {
width: 100%;
height: 100%;
border-radius: 0.08rem;
margin-left: 0.16rem;
margin-right: 0.16rem;
}
.list-item {
margin-bottom: 0.4rem;
}
.line {
width: 6.28rem;
height: 0.01rem;
background: #f1f1f1;
margin-bottom: 0.4rem;
}
.ma-item {
margin-top: 0.3rem;
}
.one {
color: #727272;
font-size: 0.3rem;
margin-bottom: 0.3rem;
}
.one-item {
margin-left: 0.3rem;
margin-right: 0.3rem;
}
.btn-item {
width: 1.8rem;
height: 0.7rem;
background: #0054ff;
border-radius: 0.35rem;
text-align: center;
line-height: 0.7rem;
color: #fff;
font-size: 0.27rem;
margin-left: 0.2rem;
}
.sf-btn {
background: #ffffff;
border: 1px solid #0054ff;
color: #0054ff;
}
.blank {
height: 1rem;
}
.van-popup {
width: 6.9rem;
max-height: 7rem;
// height: 5.9rem;
background: #fff;
border-radius: 0.12rem;
padding-top: 0.4rem;
padding-bottom: 0.2rem;
text-align: center;
}
.pop_title {
color: #000000;
font-size: 0.36rem;
font-weight: bold;
margin-bottom: 0.4rem;
}
.van-popup textarea {
width: 6.3rem;
height: 3rem;
border: 1px solid #f1f1f1;
border-radius: 0.08rem;
padding: 0.3rem 0.2rem;
}
.van-popup textarea::-webkit-input-placeholder {
color: #c8c8c8;
font-size: 0.26rem;
}
.btnItem {
margin-top: 0.4rem;
margin-left: 0.65rem;
}
.btnItem .cancel {
width: 2.65rem;
height: 0.78rem;
border: 1px solid #c8c8c8;
border-radius: 0.39rem;
color: #000000;
font-size: 0.32rem;
text-align: center;
line-height: 0.78rem;
margin-right: 0.3rem;
}
.btnItem .sure {
width: 2.65rem;
height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem;
color: #ffffff;
font-size: 0.32rem;
text-align: center;
line-height: 0.78rem;
margin-right: 0.3rem;
}
.input {
width: 6.3rem;
height: 0.76rem;
background: #ffffff;
border: 1px solid #f1f1f1;
border-radius: 0.08rem;
text-align: left;
padding-left: 0.2rem;
margin-bottom: 0.1rem;
font-size: 0.3rem;
}
.input::-webkit-input-placeholder {
color: #c8c8c8;
font-size: 0.3rem;
}
.math-btn {
margin-left: 0.3rem;
margin-right: 0.3rem;
color: #0256ff;
font-size: 0.3rem;
}
.hc_total {
text-align: left;
color: #000000;
font-size: 0.26rem;
margin-left: 0.3rem;
}
.sure-btn {
width: 3.12rem;
height: 0.78rem;
background: linear-gradient(270deg, #0054ff, #1965ff);
border-radius: 0.39rem;
color: #ffffff;
text-align: center;
line-height: 0.78rem;
margin: 1.2rem auto;
}
</style>
\ No newline at end of file
@import "@assets/styles/tabbar/index.scss";
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment