Commit 81a16d36 authored by 石盼盼's avatar 石盼盼

Merge branch 'spp' into 'master'

Spp

See merge request !3
parents ff9d7ae0 e0b8462b
{
"name": "fhxm",
"name": "repair",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
......
{
"name": "fhxm",
"name": "repair",
"version": "0.1.0",
"private": true,
"scripts": {
......
<template>
<div id="app">
<keep-alive>
<keep-alive v-if="$route.meta.keepAlive">
<router-view />
</keep-alive>
<router-view v-else />
<div class="goBack-btn flex-h flex-hc flex-align-center" v-if="!$route.meta.hideBack" >
<i class="iconfont icon-icon_fanhuishouye" @click="gohome"></i>
</div>
......
......@@ -8,10 +8,10 @@ const baseUrl = '/api'
// }
// todo: url
// const httpUrl = 'https://fhxmtest.xueyoubangedu.com' // 测试接口
// const h5Url = 'http://fhxmtest.h5.xueyoubangedu.com' // 测试h5线上地址
const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
const h5Url = 'http://depository.fhxmcy.com' // 正式h5线上地址
const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口
const h5Url = 'https://repair.zeruiedu.com' // 测试h5线上地址
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
// const h5Url = 'http://depository.fhxmcy.com' // 正式h5线上地址
export default {
// url地址
......@@ -21,11 +21,18 @@ export default {
WINDOWHREF_ASK: `${httpUrl}/api/scm/login?callBack=${h5Url}&scopes=snsapi_userinfo&type=1`,
// 登录相关
SENDCODE: baseUrl + '/scm/send', // 发送验证码
BINDLOGIN: baseUrl + '/scm/bind/login', // 绑定后台账号
BINDLOGINTWO: baseUrl + '/scm/bind/login/two', // 绑定后台账号
REFRESHTOKEN: baseUrl + '/scm/change/token', // 更新token
LOGOUT: baseUrl + '/scm/logout', // 更新token
SENDCODE: baseUrl + '/worker/send', // 发送验证码
BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信
USERINFO: baseUrl + '/worker/user/info', // 获取用户信息
REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表
ORDER_STATUS: baseUrl + '/worker/repair/order/status', // 获取订单状态
REPAIR_BEGIN: baseUrl + '/worker/repair/begin', // 开始维修接口
REPAIR_ORDER_DETAIL: baseUrl + '/worker/repair/order/detail', // 报修单详情
REPAIR_ORDER: baseUrl + '/worker/material/order', // 发起收费生成耗材单
MATERIAL_REMARK: baseUrl + '/worker/material/remark', // 备注耗材
// BINDLOGINTWO: baseUrl + '/scm/bind/login/two', // 绑定后台账号
// REFRESHTOKEN: baseUrl + '/scm/change/token', // 更新token
// LOGOUT: baseUrl + '/scm/logout', // 更新token
// 首页
WARNGOODS: baseUrl + '/scm/warn_goods/today', // 今日预警
......
......@@ -34,34 +34,35 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
const { data, config } = response
return data
// console.log('添加响应拦截器', response)
if (data.code === 400) {
console.log('===== token过期 =====')
const promisefresh = new Promise(function (resolve, reject) {
updateToken(() => {
config.headers.token = window.localStorage.getItem('token')
axios.request(response.config).then(res => {
const curData = res.data
if (curData.code === 200) {
resolve(curData)
} else {
// window.localStorage.removeItem('token')
// window.localStorage.removeItem('status')
resolve(curData)
}
})
}, (err) => {
resolve(err)
window.localStorage.clear()
Toast('身份失效,请重新登录')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
console.log('错误--------', err)
})
})
return promisefresh
} else {
return data
}
// if (data.code === 400) {
// console.log('===== token过期 =====')
// const promisefresh = new Promise(function (resolve, reject) {
// updateToken(() => {
// config.headers.token = window.localStorage.getItem('token')
// axios.request(response.config).then(res => {
// const curData = res.data
// if (curData.code === 200) {
// resolve(curData)
// } else {
// // window.localStorage.removeItem('token')
// // window.localStorage.removeItem('status')
// resolve(curData)
// }
// })
// }, (err) => {
// resolve(err)
// window.localStorage.clear()
// Toast('身份失效,请重新登录')
// window.document.location = selfApi.WINDOWHREF_LOGIN // url-
// console.log('错误--------', err)
// })
// })
// return promisefresh
// } else {
// return data
// }
},
error => {
let info = {}
......
......@@ -22,7 +22,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 axios from './axios'
import { Toast, Dialog } from 'vant'
import {
Toast,
Dialog
} from 'vant'
import router from '../router/index'
import selfApi from '@/api/apiList'
const instance = axios()
export default {
get (url, params, headers, toast = true) {
get(url, params, headers, toast = true) {
const options = {}
options.headers = {
token: window.localStorage.getItem('token'),
type: 1
// token: window.localStorage.getItem('token'),
token: 'sys'
// type: 1
}
if (params) {
......@@ -19,7 +23,10 @@ export default {
}
if (headers) {
options.headers = { ...options.headers, ...headers }
options.headers = {
...options.headers,
...headers
}
}
Toast.allowMultiple()
let tipsToast = ''
......@@ -33,7 +40,11 @@ export default {
}
return new Promise((resolve, reject) => {
instance.get(url, options).then(res => {
const { code, data, message } = res
const {
data,
message
} = res
const code = res.meta.code
// console.log(code, typeof code, '11111111111111')
toast && tipsToast.clear()
if (code === 200) {
......@@ -53,19 +64,23 @@ export default {
})
},
post (url, data, headers, params, toast = true) {
post(url, data, headers, params, toast = true) {
const options = {}
options.headers = {
token: window.localStorage.getItem('token'),
type: 1
// token: window.localStorage.getItem('token'),
token: 'sys'
// type: 1
}
if (params) {
options.params = params
}
if (headers) {
options.headers = { ...options.headers, ...headers }
options.headers = {
...options.headers,
...headers
}
}
Toast.allowMultiple()
let tipsToast = ''
......@@ -79,7 +94,11 @@ export default {
}
return new Promise((resolve, reject) => {
instance.post(url, data, options).then(res => {
const { code, data, message } = res
const {
data,
message
} = res
const code = res.meta.code
toast && tipsToast.clear()
if (code === 200) {
resolve(data)
......@@ -98,15 +117,22 @@ export default {
})
},
put (url, params, headers) {
put(url, params, headers) {
const options = {}
if (headers) {
options.headers = { ...options.headers, ...headers }
options.headers = {
...options.headers,
...headers
}
}
return new Promise((resolve, reject) => {
instance.put(url, params, options).then(res => {
const { code, data, message } = res
const {
code,
data,
message
} = res
if (code === 200) {
resolve(data)
} else if (code !== 400) {
......@@ -119,14 +145,17 @@ export default {
})
},
delete (url, params, headers) {
delete(url, params, headers) {
const options = {}
if (params) {
options.params = params
}
if (headers) {
options.headers = { ...options.headers, ...headers }
options.headers = {
...options.headers,
...headers
}
}
return instance.delete(url, options)
}
......
......@@ -7,7 +7,7 @@ import myApi from './api/apiList'
import myAxios from './api/index'
import Vant from 'vant'
import 'vant/lib/index.css'
// import vConsole from '@/plugins/vconsole.js'
import vConsole from '@/plugins/vconsole.js'
import myCondition from '@/components/common/condition.vue'
import listTips from '@/components/common/listtips.vue'
// Vue.component('chooseDate', chooseDate)
......@@ -15,7 +15,7 @@ import listTips from '@/components/common/listtips.vue'
// import chooseDate from '@/components/common/chooseDate.vue'
Vue.component('myCondition', myCondition)
Vue.component('listTips', listTips)
// Vue.use(vConsole)
Vue.use(vConsole)
Vue.config.productionTip = false
......
......@@ -5,88 +5,94 @@ import Home from '../views/tabbar/Home.vue'
Vue.use(VueRouter)
const routes = [{
path: '/',
name: 'home',
meta: {
title: '首页',
hideBack: true
const routes = [
{
path: '/home',
name: 'home',
meta: {
title: '工单',
hideBack: true,
keepAlive: true
},
component: Home
},
component: Home
},
{
path: '/my',
name: 'my',
meta: {
title: '我的',
hideBack: true
{
path: '/',
redirect: '/login'
},
component: () => import('../views/tabbar/my.vue')
},
{
path: '/mine',
name: 'mine',
meta: {
title: '我的',
hideBack: true
{
path: '/my',
name: 'my',
meta: {
title: '我的',
hideBack: true
},
component: () => import('../views/tabbar/my.vue')
},
component: () => import('../views/tabbar/mine.vue')
},
{
path: '/modifyPhone',
name: 'mesmodifyPhonesage',
meta: {
title: '修改手机号',
hideBack: true
{
path: '/mine',
name: 'mine',
meta: {
title: '我的',
hideBack: true
},
component: () => import('../views/tabbar/mine.vue')
},
component: () => import('../views/tabbar/modifyPhone.vue')
},
// 登录
{
path: '/login',
name: 'login',
meta: {
title: '机构登录',
hideBack: true
{
path: '/modifyPhone',
name: 'mesmodifyPhonesage',
meta: {
title: '修改手机号',
hideBack: true
},
component: () => import('../views/tabbar/modifyPhone.vue')
},
component: () => import('@/views/login/login.vue')
},
{
path: '/againLogin',
name: 'againLogin',
meta: {
title: '机构登录',
hideBack: true
// 登录
{
path: '/login',
name: 'login',
meta: {
title: '登录',
hideBack: true
},
component: () => import('@/views/login/login.vue')
},
component: () => import('@/views/login/againlogin.vue')
},
// 个人中心
{
path: '/charge',
name: 'charge',
meta: {
title: '发起收费',
hideBack: true
{
path: '/againLogin',
name: 'againLogin',
meta: {
title: '登录',
hideBack: true
},
component: () => import('@/views/login/againlogin.vue')
},
component: () => import('@/views/my/charge.vue')
},
{
path: '/relationUsers',
name: 'relationUsers',
meta: {
title: '我的'
// 个人中心
{
path: '/charge',
name: 'charge',
meta: {
title: '发起收费',
hideBack: true
},
component: () => import('@/views/my/charge.vue')
},
component: () => import('@/views/my/relation-users.vue')
},
{
path: '/addRelation',
name: 'addRelation',
meta: {
title: '绑定机构'
{
path: '/relationUsers',
name: 'relationUsers',
meta: {
title: '我的'
},
component: () => import('@/views/my/relation-users.vue')
},
component: () => import('@/views/my/add-relation.vue')
}
{
path: '/addRelation',
name: 'addRelation',
meta: {
title: '绑定机构'
},
component: () => import('@/views/my/add-relation.vue')
}
]
const router = new VueRouter({
......
......@@ -49,6 +49,7 @@ export default {
return false
},
getCode () {
console.log(111);
if (this.isSending) return
if (this.tel.length !== 11) {
this.$toast('请正确输入手机号码')
......@@ -84,8 +85,7 @@ export default {
// const _this = this
this.$http.post(this.$myApi.BINDLOGIN, curParams)
.then(res => {
window.localStorage.removeItem('againLogin')
window.document.location = this.$myApi.WINDOWHREF_ASK // url-
this.$router.replace('/home')
})
.catch(() => {})
},
......
<template>
<div class="cont">
<div class="cont" v-if="order">
<div class="top">
<div class="item flex-h flex-vc">
<div class="title">维修类目:</div>
<div class="title">供水</div>
<div class="title">{{order.repair_type.type_name}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">重点水房类-水房的阀门关不紧</div>
<div class="item-desc que-desc">{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item-desc">公寓区-16号楼-东侧水房</div>
<div
class="item-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">张三三</div>
<div class="item-desc">{{order.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone">186787867463</div>
<div class="item-desc phone">{{order.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
......@@ -25,9 +27,8 @@
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div class="img flex-h">
<img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt />
<img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt />
<div class="img flex-h" v-for="(child, index) in order.image" :key="index">
<img :src="child.url" alt />
</div>
</div>
</div>
......@@ -116,9 +117,33 @@ export default {
hc_name: '请选择',
hcPicker: false,
hcNum: '',
repair_order_id: '',
order: '',
}
},
},
created(){
// console.log('change页面')
this.repair_order_id = this.$route.query.id
// console.log(this.$route.query.id,'接收的id');
this.getDetail()
},
// mounted(){
// this.getDetail()
// },
methods:{
getDetail(){
let repair_order_id = this.repair_order_id.toString()
const curParams = {
repair_order_id: this.repair_order_id
}
// const _this = this
this.$http.get(this.$myApi.REPAIR_ORDER_DETAIL, curParams)
.then(res => {
this.order = res.order
console.log(this.order,123456);
})
.catch(() => {})
},
showZl(index){
this.addList[index].zlSelect = true
},
......
This diff is collapsed.
<template>
<div class="cont">
<div class="cont" v-if="user">
<div class="top"></div>
<div class="info-item">
<div class="photo">
<img src="@assets/images/my/touxiang.png" alt="">
<img src="@assets/images/my/touxiang.png" alt />
</div>
<div class="btn">工作中</div>
<div class="name">张初一</div>
<div class="group">能源保障组</div>
<div class="name">{{user.name}}</div>
<div class="group">{{user.department.name}}</div>
<div class="tel flex-h">
<div class="telNumber">13180043557</div>
<img src="@assets/images/my/bianji.png" alt="">
<div class="telNumber">{{user.phone}}</div>
<img src="@assets/images/my/bianji.png" alt />
</div>
</div>
<!-- tabbar -->
......@@ -25,6 +25,23 @@ export default {
components: {
myTabbar
},
data(){
return{
user: '',
}
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo () {
this.$http.get(this.$myApi.USERINFO)
.then(res => {
this.user = res
})
.catch(() => {})
},
}
}
</script>
......@@ -69,29 +86,29 @@ export default {
line-height: 0.48rem;
margin: 1.13rem auto 0.59rem;
}
.name{
color: #000000;
font-size: 0.38rem;
margin-bottom: 0.27rem;
font-weight: bold;
.name {
color: #000000;
font-size: 0.38rem;
margin-bottom: 0.27rem;
font-weight: bold;
}
.group{
color: #000000;
font-size: 0.3rem;
margin-bottom: 0.48rem;
.group {
color: #000000;
font-size: 0.3rem;
margin-bottom: 0.48rem;
}
.tel{
width: 2rem;
height: 0.28rem;
margin: 0 auto;
.tel {
width: 2rem;
height: 0.28rem;
margin: 0 auto;
}
.tel .telNumber{
color: #000000;
font-size: 0.3rem;
margin-right: 0.2rem;
.tel .telNumber {
color: #000000;
font-size: 0.3rem;
margin-right: 0.2rem;
}
.tel img{
width: 0.28rem;
height: 0.28rem;
.tel img {
width: 0.28rem;
height: 0.28rem;
}
</style>
\ No newline at end of file
......@@ -61,8 +61,8 @@ module.exports = {
proxy: {
'/api/': {
// todo: url
// target: 'https://fhxmtest.xueyoubangedu.com/api', // 测试
target: 'https://fenghexm.xueyoubangedu.com/api', // 正式
target: 'https://repairtest.zeruiedu.com/api', // 测试
// target: 'https://repair.zeruiedu.com/api', // 正式
autoRewrite: true,
changeOrigin: true,
ws: true,
......
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