Browse Source

企业端 token修复

master
蟑螂恶霸 2 years ago
parent
commit
3805455a68
  1. 3
      src/common/globalRouter.js
  2. 2
      src/config/env.js
  3. 93
      src/views/Home.vue
  4. 420
      src/views/enforceHome.vue
  5. 6
      src/views/enterprise/complaint.vue
  6. 981
      src/views/enterprise/complaintNoScan.vue

3
src/common/globalRouter.js

@ -3,7 +3,8 @@ import { createRouter, createWebHashHistory } from "vue-router";
let routes = [ let routes = [
{ {
path: "/", path: "/",
redirect: "/home", // redirect: "/home",
redirect: "/enforceHome",
name: "App", name: "App",
}, },
{ {

2
src/config/env.js

@ -1,6 +1,6 @@
//本地环境 //本地环境
// let baseUrl="http://139.186.135.156:86"; // let baseUrl="http://139.186.135.156:86";
// let baseUrl="http://10.132.108.3:85"; // let baseUrl="http://10.132.108.1:85";
let baseUrl="http://jdm.szssfj.cn/jdmApi"; let baseUrl="http://jdm.szssfj.cn/jdmApi";
// let baseUrl="http://127.0.0.1:85"; // let baseUrl="http://127.0.0.1:85";
// let wsUrl='ws://10.76.108.1:9326'; // let wsUrl='ws://10.76.108.1:9326';

93
src/views/Home.vue

@ -172,51 +172,56 @@
const signature = sha1(str).toString().toLowerCase(); const signature = sha1(str).toString().toLowerCase();
//i //i
getSiqLoginAuthTest({userId: "1608644307579883522", userName: "汪鑫"}, success => {
// getSiqLoginAuthTest({userId: "1795031916332843009", userName: ""}, success => { // getSiqLoginAuthTest({userId: "1795031916332843009", userName: ""}, success => {
// useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber); console.log(success.data);
// useCommon.SET_USER_PHONENUMBER(success.data.phonenumber.toString()); useCommon.SET_USER_PHONENUMBER(success.data.phonenumber.toString());
// console.log("phone : " + useCommon.phonenumber); useCommon.SET_USER_ID(success.data.userId);
// }, error => { useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber);
// }) useCommon.SET_TOKEN(success.data.token);
console.log(useCommon.userId);
w6s.config({ getEnterpriseMerchant(success.data.phonenumber.toString());
access_key: access_key, }, error => {
nonce: nonce, })
timestamp: timestamp,
signature: signature, // w6s.config({
}).then((res) => { // access_key: access_key,
// // nonce: nonce,
console.log("鉴权", res); // timestamp: timestamp,
// signature: signature,
}).catch((err) => { // }).then((res) => {
// // //
// console.log(err) // console.log("", res);
console.log("鉴权", err); //
// todo // }).catch((err) => {
getEnterpriseMerchant(useCommon.phonenumber.toString()); // //
}); // // console.log(err)
// console.log("", err);
w6s.ready(() => { // // todo
w6s.szient.getAuthCode({ // getEnterpriseMerchant(useCommon.phonenumber.toString());
success: function (res) { // });
console.log(res) //
console.log("认证", res); // w6s.ready(() => {
console.log("code: " + res.result.result.code); // w6s.szient.getAuthCode({
getSiqLoginAuth({code: res.result.result.code}, success => { // success: function (res) {
useCommon.SET_USER_PHONENUMBER(success.data.phonenumber.toString()); // console.log(res)
useCommon.SET_USER_ID(success.data.userId); // console.log("", res);
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber); // console.log("code: " + res.result.result.code);
getEnterpriseMerchant(success.data.phonenumber.toString()); // getSiqLoginAuth({code: res.result.result.code}, success => {
}, error => { // useCommon.SET_USER_PHONENUMBER(success.data.phonenumber.toString());
console.log("error : " + error) // useCommon.SET_USER_ID(success.data.userId);
}) // useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber);
}, // getEnterpriseMerchant(success.data.phonenumber.toString());
fail: function (err) { // }, error => {
console.log(err) // console.log("error : " + error)
console.log("认证", err); // })
}, // },
}); // fail: function (err) {
}); // console.log(err)
// console.log("", err);
// },
// });
// });
// getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{ // getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{
// if(!(success.data == null && success.data.length == 0)){ // if(!(success.data == null && success.data.length == 0)){

420
src/views/enforceHome.vue

@ -1,5 +1,5 @@
<template> <template>
<Loading class="loading-div" type="spinner" v-show="isLoading" color="#1989fa" /> <Loading class="loading-div" type="spinner" v-show="isLoading" color="#1989fa"/>
<div class="home app_content" v-if="!isLoading"> <div class="home app_content" v-if="!isLoading">
<!-- 导航栏 --> <!-- 导航栏 -->
<!-- <div class="header_body"> <!-- <div class="header_body">
@ -8,7 +8,7 @@
<!-- 中间 --> <!-- 中间 -->
<div class="warp_body" > <div class="warp_body">
<div class="logobox"></div> <div class="logobox"></div>
<!-- <div class="streamer" @click=""> <!-- <div class="streamer" @click="">
<i></i> <i></i>
@ -18,12 +18,12 @@
</div> --> </div> -->
<van-notice-bar <van-notice-bar
:text="noticeStr" :text="noticeStr"
:key="freshMap.key" :key="freshMap.key"
left-icon="volume-o" left-icon="volume-o"
scrollable scrollable
:speed="100" :speed="100"
class="streamer" class="streamer"
/> />
<!-- <div class="container streamer" id="notification-container":key="freshMap.key"> <!-- <div class="container streamer" id="notification-container":key="freshMap.key">
@ -72,9 +72,10 @@
<script setup name="Home"> <script setup name="Home">
import Vconsolefrom from 'vconsole'; import Vconsolefrom from 'vconsole';
import { Loading } from 'vant'; import {Loading} from 'vant';
import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home'; import {getEnterpriseMerchantAuthorization, getSzyptLoginAuth} from '../api/Home';
import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce"; import {queryEnforcementInspectionProgramListNoPermission} from "@/api/enforce";
const isLoading = ref(true); const isLoading = ref(true);
const {useCommon} = $globalStore; const {useCommon} = $globalStore;
const router = useRouter(); const router = useRouter();
@ -89,26 +90,26 @@
key: 0, key: 0,
}); });
// //
// setTimeout(() => { // setTimeout(() => {
// // // //
// router.push( // router.push(
// { // {
// path: "/noAccess" // path: "/noAccess"
// }); // });
isLoading.value = false; isLoading.value = false;
// }, 3000); // }, 3000);
// //
let noticeObj = reactive({ let noticeObj = reactive({
noticeList: [], noticeList: [],
notificationtext: "", notificationtext: "",
noticeTimer: null, noticeTimer: null,
itemWidth: 0, itemWidth: 0,
offset: 0, offset: 0,
step: 3, step: 3,
speed: 20, speed: 20,
}); });
const data = reactive({}); const data = reactive({});
@ -161,42 +162,42 @@
path: "/enforce/enforceNotice", path: "/enforce/enforceNotice",
}); });
} }
const queryList = () =>{ const queryList = () => {
queryEnforcementInspectionProgramListNoPermission({},success =>{ queryEnforcementInspectionProgramListNoPermission({}, success => {
console.log(success) console.log(success)
if(success.data.length > 4 ){ if (success.data.length > 4) {
for (let i = 0; i < 1; i++) { for (let i = 0; i < 1; i++) {
carouselList.push(success.data[i]); carouselList.push(success.data[i]);
noticeObj.noticeList.push(success.data[i].planName) noticeObj.noticeList.push(success.data[i].planName)
// noticeStr += success.data[i].planName + " "; // noticeStr += success.data[i].planName + " ";
// noticeStr += success.data[i].planName != null ?success.data[i].planName + "":""; // noticeStr += success.data[i].planName != null ?success.data[i].planName + "":"";
} }
noticeStr += success.data[0].planName != null ?success.data[0].planName + "":""; noticeStr += success.data[0].planName != null ? success.data[0].planName + "" : "";
}else{ } else {
carouselList = success.data; carouselList = success.data;
for (let i = 0; i <= success.data.length; i++) {
// carouselList.push(success.data[i]);
noticeObj.noticeList.push(success.data[i].planName);
}
noticeStr += success.data[0].planName != null ?success.data[0].planName + "":"";
}
freshMap.key = 1
console.log(carouselList);
// timerObj.timer = setInterval(flushMessage, 4000);
setNotificationMove();
},error =>{
}) for (let i = 0; i <= success.data.length; i++) {
// carouselList.push(success.data[i]);
noticeObj.noticeList.push(success.data[i].planName);
}
noticeStr += success.data[0].planName != null ? success.data[0].planName + "" : "";
}
freshMap.key = 1
console.log(carouselList);
// timerObj.timer = setInterval(flushMessage, 4000);
setNotificationMove();
}, error => {
})
} }
const flushMessage =() =>{ const flushMessage = () => {
timerObj.value++; timerObj.value++;
freshMap.key = timerObj.value; freshMap.key = timerObj.value;
if(carouselList.length == timerObj.value){ if (carouselList.length == timerObj.value) {
timerObj.value = 0; timerObj.value = 0;
} }
freshMap.key = timerObj.value; freshMap.key = timerObj.value;
noticeStr = carouselList[timerObj.value].planName noticeStr = carouselList[timerObj.value].planName
} }
// //
@ -223,14 +224,16 @@
// getSzyptLoginAuth(route?.query?.code,success =>{ // getSzyptLoginAuth(route?.query?.code,success =>{
getSzyptLoginAuth(code, success => { getSzyptLoginAuth(code, success => {
console.log(success.data) console.log(success.data)
useCommon.SET_USER_ID(success.data.userId); if (null != success.data) {
useCommon.SET_TOKEN(success.data.token); useCommon.SET_USER_ID(success.data.userId);
if(useCommon.firstLoad){ useCommon.SET_TOKEN(success.data.token);
isLoading.value = false;
} }
// if (useCommon.firstLoad) {
useCommon.SET_IS_FIRST_LOAD(false) isLoading.value = false;
queryList(); }
//
useCommon.SET_IS_FIRST_LOAD(false)
queryList();
// //
// if (!success.data.lawOfficer) { // if (!success.data.lawOfficer) {
// router.push( // router.push(
@ -251,51 +254,51 @@
// queryList(); // queryList();
}); });
const setNotificationMove =()=>{ const setNotificationMove = () => {
// //
clearInterval(noticeObj.noticeTimer); clearInterval(noticeObj.noticeTimer);
const notificationContainer = document.getElementById( const notificationContainer = document.getElementById(
"notification-container" "notification-container"
); );
const notificationWidth = notificationContainer.offsetWidth; const notificationWidth = notificationContainer.offsetWidth;
let index = 0; let index = 0;
// //
noticeObj.notificationtext = noticeObj.noticeList[index]; noticeObj.notificationtext = noticeObj.noticeList[index];
const notification = document.getElementById("notification"); const notification = document.getElementById("notification");
noticeObj.offset = notificationWidth; noticeObj.offset = notificationWidth;
// x // x
notification.style.transform = `translateX(${noticeObj.offset}px)`;
//
noticeObj.itemWidth = noticeObj.notificationtext.length * 20;
noticeObj.noticeTimer = setInterval(() => {
noticeObj.offset -= noticeObj.step;
if (noticeObj.offset < -noticeObj.itemWidth) {
noticeObj.offset = notificationWidth;
if (index >= noticeObj.noticeList.length - 1) {
index = 0;
} else {
index++;
}
noticeObj.notificationtext = noticeObj.noticeList[index];
noticeObj.itemWidth = noticeObj.notificationtext.length * 20;
}
notification.style.transform = `translateX(${noticeObj.offset}px)`; notification.style.transform = `translateX(${noticeObj.offset}px)`;
}, noticeObj.speed); //
noticeObj.itemWidth = noticeObj.notificationtext.length * 20;
noticeObj.noticeTimer = setInterval(() => {
noticeObj.offset -= noticeObj.step;
if (noticeObj.offset < -noticeObj.itemWidth) {
noticeObj.offset = notificationWidth;
if (index >= noticeObj.noticeList.length - 1) {
index = 0;
} else {
index++;
}
noticeObj.notificationtext = noticeObj.noticeList[index];
noticeObj.itemWidth = noticeObj.notificationtext.length * 20;
}
notification.style.transform = `translateX(${noticeObj.offset}px)`;
}, noticeObj.speed);
} }
const delayNoticeMove = () =>{ const delayNoticeMove = () => {
const notification = document.getElementById("notification"); const notification = document.getElementById("notification");
let currentOffset = notification.style.transform; let currentOffset = notification.style.transform;
if (currentOffset) { if (currentOffset) {
currentOffset = currentOffset.split("(")[1]; currentOffset = currentOffset.split("(")[1];
currentOffset = currentOffset.substring(0, currentOffset.indexOf("px")); currentOffset = currentOffset.substring(0, currentOffset.indexOf("px"));
let duration = ((Number(currentOffset) + noticeObj.itemWidth) / noticeObj.step) * noticeObj.speed; let duration = ((Number(currentOffset) + noticeObj.itemWidth) / noticeObj.step) * noticeObj.speed;
// setTimeout // setTimeout
setTimeout(() => { setTimeout(() => {
this.setNotificationMove(); this.setNotificationMove();
}, duration); }, duration);
} else { } else {
this.setNotificationMove(); this.setNotificationMove();
} }
} }
</script> </script>
@ -308,14 +311,14 @@
background-color: #f4f4f4; background-color: #f4f4f4;
.warp_body { .warp_body {
position: relative; position: relative;
margin: 0; margin: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #c6e6ff url("../assets/images/bg_el.jpg") no-repeat top; background: #c6e6ff url("../assets/images/bg_el.jpg") no-repeat top;
background-size: auto 100%; background-size: auto 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
.carousel_box { .carousel_box {
height: 4rem; height: 4rem;
@ -346,39 +349,40 @@
border-radius: 0.27rem; border-radius: 0.27rem;
.box-qr-code-text { .box-qr-code-text {
position: absolute; position: absolute;
z-index: 10; z-index: 10;
top: 10%; top: 10%;
right: 0.35rem; right: 0.35rem;
display: block; display: block;
font-size: 0.5rem; font-size: 0.5rem;
} }
} }
.box-qr-code::before { .box-qr-code::before {
content: ""; content: "";
position: absolute; position: absolute;
top: -0.14rem; top: -0.14rem;
left: -0.14rem; left: -0.14rem;
z-index: 0; z-index: 0;
width: calc(100% + 0.13rem); width: calc(100% + 0.13rem);
height: calc(100% + 0.13rem); height: calc(100% + 0.13rem);
background-color: #fff; background-color: #fff;
border: 0.14rem solid rgba(255,255,255,0.5); border: 0.14rem solid rgba(255, 255, 255, 0.5);
border-radius: 0.27rem; border-radius: 0.27rem;
} }
.box-qr-code::after { .box-qr-code::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.27rem; border-radius: 0.27rem;
background: #fff url("../assets/images/item_scan.jpg") no-repeat left; background: #fff url("../assets/images/item_scan.jpg") no-repeat left;
background-size: auto 100%; background-size: auto 100%;
border: 0.01rem solid #8db4ff; border: 0.01rem solid #8db4ff;
} }
.box-info { .box-info {
@ -390,39 +394,40 @@
border-radius: 0.27rem; border-radius: 0.27rem;
.box-info-text { .box-info-text {
position: absolute; position: absolute;
z-index: 10; z-index: 10;
top: 10%; top: 10%;
right: 0.35rem; right: 0.35rem;
display: block; display: block;
font-size: 0.5rem; font-size: 0.5rem;
} }
} }
.box-info::before { .box-info::before {
content: ""; content: "";
position: absolute; position: absolute;
top: -0.14rem; top: -0.14rem;
left: -0.14rem; left: -0.14rem;
z-index: 0; z-index: 0;
width: calc(100% + 0.13rem); width: calc(100% + 0.13rem);
height: calc(100% + 0.13rem); height: calc(100% + 0.13rem);
background-color: #fff; background-color: #fff;
border: 0.14rem solid rgba(255,255,255,0.5); border: 0.14rem solid rgba(255, 255, 255, 0.5);
border-radius: 0.27rem; border-radius: 0.27rem;
} }
.box-info::after { .box-info::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.27rem; border-radius: 0.27rem;
background: #fff url("../assets/images/item_check.jpg") no-repeat left; background: #fff url("../assets/images/item_check.jpg") no-repeat left;
background-size: auto 100%; background-size: auto 100%;
border: 1px solid #8db4ff; border: 1px solid #8db4ff;
} }
.box-complaint { .box-complaint {
@ -434,40 +439,41 @@
border-radius: 0.27rem; border-radius: 0.27rem;
.box-complaint-text { .box-complaint-text {
position: absolute; position: absolute;
z-index: 10; z-index: 10;
top: 10%; top: 10%;
right: 0.35rem; right: 0.35rem;
display: block; display: block;
font-size: 0.5rem; font-size: 0.5rem;
} }
} }
} }
.box-complaint::before { .box-complaint::before {
content: ""; content: "";
position: absolute; position: absolute;
top: -0.14rem; top: -0.14rem;
left: -0.14rem; left: -0.14rem;
z-index: 0; z-index: 0;
width: calc(100% + 0.13rem); width: calc(100% + 0.13rem);
height: calc(100% + 0.13rem); height: calc(100% + 0.13rem);
background-color: #fff; background-color: #fff;
border: 0.14rem solid rgba(255,255,255,0.5); border: 0.14rem solid rgba(255, 255, 255, 0.5);
border-radius: 0.27rem; border-radius: 0.27rem;
} }
.box-complaint::after { .box-complaint::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.27rem; border-radius: 0.27rem;
background: #fff url("../assets/images/item_count.jpg") no-repeat left; background: #fff url("../assets/images/item_count.jpg") no-repeat left;
background-size: auto 100%; background-size: auto 100%;
border: 0.01rem solid #8db4ff; border: 0.01rem solid #8db4ff;
} }
.recommend_box { .recommend_box {
@ -590,17 +596,21 @@
background: url("../assets/images/logo.png") no-repeat; background: url("../assets/images/logo.png") no-repeat;
background-size: 100% auto; background-size: 100% auto;
} }
.loading-div{
position: absolute; .loading-div {
top: 45%; position: absolute;
left: 48%; top: 45%;
left: 48%;
} }
.notice-bar-container { .notice-bar-container {
margin-bottom: 0.27rem; margin-bottom: 0.27rem;
} }
.notice-bar-container:last-child { .notice-bar-container:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
/* .notification{ /* .notification{
height: 100%; height: 100%;
font-size: 0.27rem; font-size: 0.27rem;
@ -610,17 +620,17 @@
}*/ }*/
@media screen and (max-width: 380px) { @media screen and (max-width: 380px) {
.home .warp_body { .home .warp_body {
background: #c6e6ff url("../assets/images/bg_el.jpg") no-repeat top; background: #c6e6ff url("../assets/images/bg_el.jpg") no-repeat top;
background-size: 100% auto; background-size: 100% auto;
} }
} }
@media screen and (min-width: 540px) { @media screen and (min-width: 540px) {
.home .warp_body { .home .warp_body {
background: #c6e6ff url("../assets/images/bg_el.jpg") no-repeat top; background: #c6e6ff url("../assets/images/bg_el.jpg") no-repeat top;
background-size: 100% auto; background-size: 100% auto;
} }
} }
</style> </style>

6
src/views/enterprise/complaint.vue

@ -206,7 +206,7 @@
}; };
const submit = () => { const submit = () => {
// console.log(submitData); console.log(submitData);
addEnterpriseComplaint(submitData, success => { addEnterpriseComplaint(submitData, success => {
@ -267,7 +267,6 @@
const uploadFiles = (file) => { const uploadFiles = (file) => {
console.log(11111111)
uploadFile(file, (res) => { uploadFile(file, (res) => {
console.log(res); console.log(res);
submitData.fileList.push(res.url) submitData.fileList.push(res.url)
@ -288,6 +287,9 @@
return true; return true;
} }
onMounted(() => { onMounted(() => {
console.log("================")
console.log(submitData.userId);
console.log("================")
submitData.relId = route?.query?.id; submitData.relId = route?.query?.id;
submitData.lawEnforcementIncident = route?.query?.lawEnforcementItemText; submitData.lawEnforcementIncident = route?.query?.lawEnforcementItemText;
data.isSelect = route?.query?.isSelect; data.isSelect = route?.query?.isSelect;

981
src/views/enterprise/complaintNoScan.vue

File diff suppressed because it is too large
Loading…
Cancel
Save