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:dev": "vue-cli-service build --mode development",
"build:prod": "vue-cli-service build --mode production",
"build:test": "vue-cli-service build --mode test",
"build:stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint",
"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 Router from 'vue-router'
import { constantRouterMap } from './router.config.js'
import store from '@/store'
// hack router push callback
const originalPush = Router.prototype.push
@ -27,13 +28,16 @@ function getQueryParams() {
})
return params
}
router.beforeEach((to, from, next) => {
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")
localStorage.setItem('token_work',urlParams.worktoken)
next({ path:'/Hotline'})
next({ })
}else{
next()
console.log(urlParams.worktoken,"Sdfsfd")

4
src/store/index.js

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

3
src/store/modules/app.js

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

10
src/utils/request.js

@ -50,9 +50,15 @@ service.interceptors.response.use(
return Promise.resolve(res)
} else {
let loginCode = [10007, 401, 10001, 10005, 10006]
if (loginCode.includes(res.code)) {
localStorage.removeItem('token_work')
router.replace('/')
if (store.state.app.userInfo.isRouterLoading) {
return
}else{
localStorage.removeItem('token_work')
router.replace('/')
}
}else if(code > 8000){
Tips.error(res.msg)
}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="operationTypeType" class="no-margin" left-icon="false" @click="showpicker1"
shape="round" placeholder="办理状态" />
<van-popup v-model="showpicker2" position="bottom" :style="{ height: '40%' }">
<van-picker show-toolbar title="标题" :columns="actions" @cancel="showPicker2 = false"
@confirm="onConfirm" />
<van-popup v-if="showpicker2" v-model="showpicker2" position="bottom" :style="{ height: '40%' }">
<van-picker v-if="showpicker2" show-toolbar title="标题" :columns="actions" @cancel="showPicker2 = false"
@confirm="onConfirm"
/>
</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"
@change="onOperationType" />
</van-dropdown-menu> -->
@ -23,7 +27,7 @@
</div>
<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="workorder">
工单号{{ item.workOrderNum }}
@ -42,7 +46,8 @@
来电人{{item.name}} {{item.mobile}}
</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>
@ -119,7 +124,6 @@ export default {
},
methods: {
statusClass(item) {
console.log(item,"dklslksjvx");
return {
'status-red': item === '未联系当事人',
'lan': item === '已联系当事人',
@ -133,14 +137,15 @@ export default {
this.operationTypeType=value.text
this.operationType=value.value
// this.value = value;
this.showPicker2 = false;
this.showpicker2 = false;
console.log( this.showPicker2,"iugui");
this.$nextTick(() => {
console.log('Popup visibility status:', this.showpicker2);
});
},
onConfirm(value) {
// this.value = value;
this.showpicker2 = false;
},
showpicker1(){
console.log("fds ");
this.showpicker2=true
},

21
src/views/HotlineDetail/index.vue

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

Loading…
Cancel
Save