Browse Source

加入test环境,解决弹框不退出

test
是小王呀\24601 1 year ago
parent
commit
aa50c31464
  1. 5
      .env.test
  2. 1
      package.json
  3. 10
      src/config/env.test.js
  4. 10
      src/router/index.js
  5. 4
      src/store/index.js
  6. 3
      src/store/modules/app.js
  7. 10
      src/utils/request.js
  8. 29
      src/views/Hotline/index.vue
  9. 21
      src/views/HotlineDetail/index.vue

5
.env.test

@ -0,0 +1,5 @@
NODE_ENV='test'
# must start with VUE_APP_
VUE_APP_ENV = 'test'
outputDir = 'epmet-work-h5-test'

1
package.json

@ -10,6 +10,7 @@
"build": "vue-cli-service build", "build": "vue-cli-service build",
"build:dev": "vue-cli-service build --mode development", "build:dev": "vue-cli-service build --mode development",
"build:prod": "vue-cli-service build --mode production", "build:prod": "vue-cli-service build --mode production",
"build:test": "vue-cli-service build --mode test",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"deps": "yarn upgrade-interactive --latest" "deps": "yarn upgrade-interactive --latest"

10
src/config/env.test.js

@ -0,0 +1,10 @@
// 本地环境配置
module.exports = {
env: 'test',
title: 'e联社区',
baseUrl: 'https://epmet-test.elinkservice.cn/', // 项目地址
baseApi: 'https://epmet-test.elinkservice.cn/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
// baseApi: 'http://219.146.91.110:30801/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
APPID: 'xxx',
APPSECRET: 'xxx',
}

10
src/router/index.js

@ -1,6 +1,7 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import { constantRouterMap } from './router.config.js' import { constantRouterMap } from './router.config.js'
import store from '@/store'
// hack router push callback // hack router push callback
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
@ -27,13 +28,16 @@ function getQueryParams() {
}) })
return params return params
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
let urlParams = getQueryParams() let urlParams = getQueryParams()
if(urlParams.worktoken){ if(urlParams.worktoken&&to.path=='/Hotline'){
console.log(store.state.app,"store.state.app.userInfo");
store.state.app.isRouterLoading = true
console.log(to,"to");
console.log(urlParams.worktoken,"Sdfsfdjhjh") console.log(urlParams.worktoken,"Sdfsfdjhjh")
localStorage.setItem('token_work',urlParams.worktoken) localStorage.setItem('token_work',urlParams.worktoken)
next({ path:'/Hotline'}) next({ })
}else{ }else{
next() next()
console.log(urlParams.worktoken,"Sdfsfd") console.log(urlParams.worktoken,"Sdfsfd")

4
src/store/index.js

@ -11,7 +11,8 @@ const userInfo = {
userInfo: { userInfo: {
userName: '', userName: '',
agencyName: '', agencyName: '',
serviceOrgIdentities: [] serviceOrgIdentities: [],
isRouterLoading:false
} }
}, },
mutations: { mutations: {
@ -21,6 +22,7 @@ const userInfo = {
} }
}; };
const userInfoGetters = { const userInfoGetters = {
userInfo: state => state.userInfo.userInfo userInfo: state => state.userInfo.userInfo
}; };

3
src/store/modules/app.js

@ -1,7 +1,8 @@
const state = { const state = {
userName: '', userName: '',
tabActive:1, tabActive:1,
scrollTop:0 scrollTop:0,
isRouterLoading:false
} }
const mutations = { const mutations = {
SET_USER_NAME(state, name) { SET_USER_NAME(state, name) {

10
src/utils/request.js

@ -50,9 +50,15 @@ service.interceptors.response.use(
return Promise.resolve(res) return Promise.resolve(res)
} else { } else {
let loginCode = [10007, 401, 10001, 10005, 10006] let loginCode = [10007, 401, 10001, 10005, 10006]
if (loginCode.includes(res.code)) { if (loginCode.includes(res.code)) {
localStorage.removeItem('token_work') if (store.state.app.userInfo.isRouterLoading) {
router.replace('/') return
}else{
localStorage.removeItem('token_work')
router.replace('/')
}
}else if(code > 8000){ }else if(code > 8000){
Tips.error(res.msg) Tips.error(res.msg)
}else{ }else{

29
src/views/Hotline/index.vue

@ -8,11 +8,15 @@
<van-search v-model="mobile" class="no-margin" left-icon="false" shape="round" placeholder="手机号" /> <van-search v-model="mobile" class="no-margin" left-icon="false" shape="round" placeholder="手机号" />
<van-search v-model="operationTypeType" class="no-margin" left-icon="false" @click="showpicker1" <van-search v-model="operationTypeType" class="no-margin" left-icon="false" @click="showpicker1"
shape="round" placeholder="办理状态" /> shape="round" placeholder="办理状态" />
<van-popup v-model="showpicker2" position="bottom" :style="{ height: '40%' }"> <van-popup v-if="showpicker2" v-model="showpicker2" position="bottom" :style="{ height: '40%' }">
<van-picker show-toolbar title="标题" :columns="actions" @cancel="showPicker2 = false" <van-picker v-if="showpicker2" show-toolbar title="标题" :columns="actions" @cancel="showPicker2 = false"
@confirm="onConfirm" /> @confirm="onConfirm"
/>
</van-popup> </van-popup>
<!-- <van-dropdown-menu class="custom-dropdown-menu" > <!-- <van-popup v-model="showpicker2" position="bottom">
<van-picker show-toolbar :columns="actions" @cancel="showPicker = false" @confirm="onConfirm" />
</van-popup> -->
<!-- <van-dropdown-menu class="custom-dropdown-menu" > @confirm="onConfirm"
<van-dropdown-item v-model="operationTypeName" :options="actions" <van-dropdown-item v-model="operationTypeName" :options="actions"
@change="onOperationType" /> @change="onOperationType" />
</van-dropdown-menu> --> </van-dropdown-menu> -->
@ -23,7 +27,7 @@
</div> </div>
<div class="container"> <div class="container">
<div class=" card m-top12" v-for="(item, index) in tableData" :key="index" @click="onHandle(item)"> <div class=" card m-top12" v-for="(item, index) in tableData" :key="index" @click="onHandle(item)">
<div class="flex flex-certer1 flex-center2 flex-end "> <div class="flex flex-certer1 flex-center2 flex-end ">
<div class="workorder"> <div class="workorder">
工单号{{ item.workOrderNum }} 工单号{{ item.workOrderNum }}
@ -42,7 +46,8 @@
来电人{{item.name}} {{item.mobile}} 来电人{{item.name}} {{item.mobile}}
</div> </div>
<div> <div>
<van-button v-if=" item.operationType!=='11'&&item.operationType!=='12'" class="handle" round type="info" @click="onHandle(item)">办理</van-button> <van-button v-if=" item.operationType!=='11'&&item.operationType!=='12'" class="handle" round
type="info" @click="onHandle(item)">办理</van-button>
</div> </div>
@ -119,7 +124,6 @@ export default {
}, },
methods: { methods: {
statusClass(item) { statusClass(item) {
console.log(item,"dklslksjvx");
return { return {
'status-red': item === '未联系当事人', 'status-red': item === '未联系当事人',
'lan': item === '已联系当事人', 'lan': item === '已联系当事人',
@ -133,14 +137,15 @@ export default {
this.operationTypeType=value.text this.operationTypeType=value.text
this.operationType=value.value this.operationType=value.value
// this.value = value; // this.value = value;
this.showPicker2 = false; this.showpicker2 = false;
console.log( this.showPicker2,"iugui"); console.log( this.showPicker2,"iugui");
this.$nextTick(() => {
console.log('Popup visibility status:', this.showpicker2);
});
}, },
onConfirm(value) {
// this.value = value;
this.showpicker2 = false;
},
showpicker1(){ showpicker1(){
console.log("fds ");
this.showpicker2=true this.showpicker2=true
}, },

21
src/views/HotlineDetail/index.vue

@ -103,10 +103,10 @@
{{ tableData.eventContent}} {{ tableData.eventContent}}
</div> --> </div> -->
<div v-for="(item,index) in afterList" :key="index"> <div v-for="(item,index) in afterList" :key="index">
<div class="flex flex-end flex-center2 "> <div class="flex flex-end flex-center2 ">
<div class="flex flex-center2 " style="padding:5px;"> <div class="flex flex-center2 " style="padding:5px;">
<div class="Processhandling-left">指派</div> <div v-if="item.agencyId" class="Processhandling-left">指派</div>
<div v-else class="Processhandling-left">{{item.processName}}</div>
</div> </div>
<div class="Processhandling-right">{{item.processTime}}</div> <div class="Processhandling-right">{{item.processTime}}</div>
</div> </div>
@ -132,7 +132,6 @@
<div class="Dispatch-right">{{item.timeLimit}}</div> <div class="Dispatch-right">{{item.timeLimit}}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="container1"> <div class="container1">
@ -180,7 +179,6 @@
placeholder="请选择" @click="showtime = true" /> placeholder="请选择" @click="showtime = true" />
<van-datetime-picker v-if="showtime" type="datetime" :min-date="minDate" <van-datetime-picker v-if="showtime" type="datetime" :min-date="minDate"
:max-date="maxDate" @confirm="handleConfirm" @cancel="handleCancel" /> :max-date="maxDate" @confirm="handleConfirm" @cancel="handleCancel" />
<van-field v-if="operationType=='11'" readonly is-link v-model="loseContactName" label="联系当事人" <van-field v-if="operationType=='11'" readonly is-link v-model="loseContactName" label="联系当事人"
placeholder="请选择" required @click="showloseContact = true" /> placeholder="请选择" required @click="showloseContact = true" />
<van-action-sheet v-if="showloseContact" v-model="loseContact" :actions="loseContactList" <van-action-sheet v-if="showloseContact" v-model="loseContact" :actions="loseContactList"
@ -197,19 +195,10 @@
placeholder="请选择" required @click="showsatisfaction = true" /> placeholder="请选择" required @click="showsatisfaction = true" />
<van-action-sheet v-if="showsatisfaction" v-model="satisfaction" :actions="satisfactionList" <van-action-sheet v-if="showsatisfaction" v-model="satisfaction" :actions="satisfactionList"
@select="onsatisfaction" /> @select="onsatisfaction" />
<van-field v-if="operationType=='11'" readonly is-link v-model="dissatisfyReasonName" label="不满意原因" <van-field v-if="operationType=='11'" readonly is-link v-model="dissatisfyReasonName" label="不满意原因"
placeholder="请选择" required @click="showdissatisfyReason = true" /> placeholder="请选择" required @click="showdissatisfyReason = true" />
<van-action-sheet v-if="showdissatisfyReason" v-model="dissatisfyReason" <van-action-sheet v-if="showdissatisfyReason" v-model="dissatisfyReason"
:actions="dissatisfyReasonList" @select="onshowdissatisfyReason" /> :actions="dissatisfyReasonList" @select="onshowdissatisfyReason" />
<div class="textarea"> <div class="textarea">
<van-field v-if="operationType=='11'" type="textarea" v-model="visitComments" label="回访意见" <van-field v-if="operationType=='11'" type="textarea" v-model="visitComments" label="回访意见"
placeholder="请输入内容" rows="2" autosize show-word-limit required /> placeholder="请输入内容" rows="2" autosize show-word-limit required />
@ -217,7 +206,7 @@
</van-cell-group> </van-cell-group>
<div class="flex flex-x flex-mean" style="margin-top: 10px;"> <div class="flex flex-x flex-mean" style="margin-top: 10px;">
<van-button style="width: 30%;" round type="info" @click="cancel">取消</van-button> <van-button style="width: 30%;" round type="info" @click="cancel">取消</van-button>
<van-button style="width: 30%;" round type="info" @click="onreply">办理</van-button> <van-button v-if="tableData.operationType!=='11'&& tableData.operationType!=='12'" style="width: 30%;" round type="info" @click="onreply">办理</van-button>
</div> </div>
</van-popup> </van-popup>
@ -257,7 +246,6 @@ export default {
icEventId:"", icEventId:"",
workOrderNum:"", workOrderNum:"",
mobile:"", mobile:"",
operationType:"未联系当事人",
status: false, status: false,
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
@ -331,9 +319,6 @@ export default {
this.icEventId =this.$route.query.icEventId; this.icEventId =this.$route.query.icEventId;
this.icEventList() this.icEventList()
this.process() this.process()
}, },
mounted() { mounted() {

Loading…
Cancel
Save