[update] 物流信息查询改为后端查,之前是直接跳快递100

This commit is contained in:
lideqin
2023-04-25 18:56:34 +08:00
parent 0eb9f7b0e5
commit 71106e081e
22 changed files with 530 additions and 8 deletions
+3
View File
@@ -23,3 +23,6 @@ window._CONFIG["memberURL"] = "/memberApi";
// 会员系统的静态文件的地址
window._CONFIG["memberStaticDomainURL"] = window._CONFIG["memberURL"] + "/sys/common/static";
window._CONFIG["memberDomianWebSocketURL"] = "http://10.0.1.9:9000/api";
// 查看物流信息
window._CONFIG["lookExpressDomainURL"] = "http://localhost:3001/lookExpressInfo";
@@ -22,3 +22,6 @@ window._CONFIG["memberURL"] = "/memberApi";
// 会员系统的静态文件的地址
window._CONFIG["memberStaticDomainURL"] = window._CONFIG["memberURL"] + "/sys/common/static";
window._CONFIG["memberDomianWebSocketURL"] = "http://139.9.235.66/memberApi";
// 查看物流信息
window._CONFIG["lookExpressDomainURL"] = "http://bxxt.hzwlsoft.com/lookexpressinfo";
+3
View File
@@ -23,3 +23,6 @@ window._CONFIG["memberURL"] = "/memberApi";
// 会员系统的静态文件的地址
window._CONFIG["memberStaticDomainURL"] = window._CONFIG["memberURL"] + "/sys/common/static";
window._CONFIG["memberDomianWebSocketURL"] = "http://cwp.catarc.org.cn/memberApi";
// 查看物流信息
window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookexpressinfo";
Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

+7 -2
View File
@@ -2,6 +2,7 @@
import { UserLayout, TabLayout } from '@/components/layouts'
import SignUpEntrance from "@views/signUp/SignUpEntrance"
import SignUpPage from "@views/signUp/SignUpPage"
import LookExpressInfo from "@views/expressInfo/LookExpressInfo"
/**
* 走菜单,走权限控制
@@ -66,7 +67,7 @@ export const constantRouterMap = [
path: 'member-register-result',
name: 'MemberRegisterResult',
component: () => import(/* webpackChunkName: "user" */ '@/views/standardsAssociation/register/RegisterResult')
},
}
]
},
{
@@ -79,7 +80,11 @@ export const constantRouterMap = [
component: SignUpPage,
hidden: true,
},
{
path: "/lookExpressInfo",
component: LookExpressInfo,
hidden: true
}
]
/**
+1 -1
View File
@@ -9,7 +9,7 @@ import { generateIndexRouter } from '@/utils/util'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/user/login', '/user/manageLogin', '/user/register', '/user/register-result', '/user/member-register', '/user/member-register-result', '/user/alteration','/signupentrance','/signUpPage'] // no redirect whitelist
const whiteList = ['/user/login', '/user/manageLogin', '/user/register', '/user/register-result', '/user/member-register', '/user/member-register-result', '/user/alteration','/signupentrance','/signUpPage','/lookExpressInfo'] // no redirect whitelist
const ThirdLoginFunc = (token) => {
return new Promise(resolve => {
+8 -1
View File
@@ -913,7 +913,14 @@ export default {
* */
lookLogistics(record) {
const com = Number(record.sendMethod) === 1 && 'ems' || 'shunfeng'
window.open(`https://www.kuaidi100.com/chaxun?com=${com}&nu=${record.postNo}`)
// window.open(`https://www.kuaidi100.com/chaxun?com=${com}&nu=${record.postNo}`)
let url = ''
if (com === 'shunfeng' && record.contactMobile) {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }&phone=${ record.contactMobile }`
} else {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }`
}
window.open(url, '_blank')
},
/*
* 当前时间是否超过会议报名时间
+8 -1
View File
@@ -291,7 +291,14 @@ export default {
* */
lookLogistics(record) {
const com = Number(record.sendMethod) === 1 && 'ems' || 'shunfeng'
window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
// window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
let url = ''
if (com === 'shunfeng' && record.mobile) {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }&phone=${ record.mobile }`
} else {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }`
}
window.open(url, '_blank')
},
/*
* 去合同详情 传入合同id
+387
View File
@@ -0,0 +1,387 @@
<template>
<div class="all-wrapper">
<div class="top-wrapper">
<img src="~@/assets/logo.png" alt="logo" width="72" height="28">
<p>标准所来款管理系统</p>
</div>
<div class="title-wrapper">
<p>快递查询</p>
<a-input-group compact class="input-group">
<a-select class="search-select" v-model="searchQuarm.com">
<a-select-option :value="2">
<div class="search-left">
<img src="~@/assets/expressBrandLogo/shunfeng.png"/>
<p>顺丰速运</p>
</div>
</a-select-option>
<a-select-option :value="1">
<div class="search-left">
<img src="~@/assets/expressBrandLogo/ems.png"/>
<p>邮政速递</p>
</div>
</a-select-option>
</a-select>
<a-input-search class="input-search" placeholder="请输入要查询的快递单号" v-model="searchQuarm.num" @search="onSearch">
<a-button slot="enterButton" type="primary">
<img class="search-icon" src="~@/assets/expressBrandLogo/search.png"/>
<span class="search-text">搜索</span>
</a-button>
</a-input-search>
</a-input-group>
</div>
<div class="content-wrapper">
<p class="nu-p">运单号{{ model.nu }}</p>
<img class="cut-line" src="~@/assets/expressBrandLogo/cutLine.png">
<a-empty class="empty-wrapper" v-if="!model.data || model.data.length === 0"/>
<a-steps v-else class="steps-wrapper" :current="0" direction="vertical">
<template slot="progressDot" slot-scope="{ index}">
<!-- 已签收进行时图标 -->
<img class="deliver-status-img" v-if="index === 0 && model.data[0].title === '已签收'"
src="~@/assets/expressBrandLogo/signed.png"/>
<!-- 派送中进行时图标 -->
<img class="deliver-status-img" v-else-if="index === 0 && model.data[0].title === '派送中'"
src="~@/assets/expressBrandLogo/delivery.png"/>
<!-- 运输中进行时图标 -->
<img class="deliver-status-img" v-else-if="index === 0 && model.data[0].title === '运输中'"
src="~@/assets/expressBrandLogo/transit.png"/>
<!-- 已揽收进行时图标 -->
<img class="deliver-status-img" v-else-if="index === 0 && model.data[0].title === '已揽收'"
src="~@/assets/expressBrandLogo/received.png"/>
<!-- 已揽收已完成图标 -->
<img class="deliver-status-img" v-else-if="index !== 0 && model.data[index].title === '已揽收'"
src="~@/assets/expressBrandLogo/received-finish.png"/>
<span v-else class="ant-steps-icon-dot"/>
</template>
<a-step v-for="(item, index) of model.data" :key="index"
:class="(index === 0 && item.title ? 'img-dot one-title' : 'no-one-title') + ' ' + (item.title ? 'subTitle-have-title' : 'subTitle-no-title')"
:title="item.title" :subTitle="item.time">
<template slot="description">
<span v-for="(text, index) of handlerStr(item.context).split('--')" :key="index" :class="checkIsPhone(text) ? 'is-phone' : ''">{{ text }}</span>
</template>
</a-step>
</a-steps>
</div>
<!-- 输入手机号弹出框 -->
<input-phone-modal ref="inputPhoneModal" @change="phoneModalChange"></input-phone-modal>
</div>
</template>
<script>
import {getAction} from '../../api/manage'
import InputPhoneModal from './components/InputPhoneModal'
export default {
name: 'LookExpressInfo',
components: { InputPhoneModal },
data() {
return {
expressBrand: 'shunfeng',
model: {},
searchQuarm: {
num: 1245737436301,
com: 2,
phone: ''
},
url: {
queryByNu: '/mail/postInfo/queryInfo'
}
}
},
methods: {
onSearch() {
this.searchByNu()
},
searchByNu () {
if (this.searchQuarm.com === 2 && !this.searchQuarm.phone) {
this.$nextTick(() => {
// 没有手机号,弹框输入手机号
this.$refs.inputPhoneModal.open()
})
} else {
this.queryByNu()
}
},
// 查询物流信息
queryByNu () {
getAction(this.url.queryByNu, this.searchQuarm).then(res => {
if (res.success) {
if (res.result.data) {
console.log('成功了', res)
this.model = res.result
this.model.data = this.model.data.map(item => {
return {
...item,
title: ['已签收', '派送中', '运输中', '已揽收'].includes(item.context.split(',')[0]) ? item.context.split(',')[0] : ''
}
})
} else {
this.$message.warning(res.result.message)
}
} else {
this.$message.warning(res.message)
this.model = {}
}
})
},
// 输入手机号弹框返回
phoneModalChange (phone) {
this.searchQuarm.phone = phone
this.queryByNu()
},
// 识别一段话中的固话或手机号
handlerStr(value) {
let str = value
let newStr = [] //返回值
const phoneReg = /(1[0-9]{10})|([0-9]{3,4})?[0-9]{7,8}/g //匹配手机号或者固话
// let num = str.replace(/\s|[(]|[)]|[]|[]|[-]*/g, '') //去除字符串中所有空格、小括号和横杠
let num = str
const phone = num.match(phoneReg) //识别手机号或者固话(在字符串内检索指定的值,或找到一个或多个正则表达式的匹配)
console.log(phone)
if(phone) {
for (let item of phone) {
// 把匹配到的电话号码或者固话前后都加--
// const indexOf = num.indexOf(item)
num = num.replace(item, '--' + item + '--') //识别手机号或者固话,在前后加--
}
}
newStr = num
// phone && (newStr = phone.join(' ')) //有值的话得到一个数组,用空格隔开转化为字符串
return newStr
},
checkIsPhone (str) {
// 检查一个字符串是否是手机号或固话
const phoneReg = /(1[0-9]{10})|([0-9]{3,4})?[0-9]{7,8}/g //匹配手机号或者固话
const arr = str.match(phoneReg)
if (arr && arr.length > 0) {
return true
} else {
return false
}
}
},
created() {
document.title = '查看物流'
this.searchQuarm.num = this.$route.query.nu
this.searchQuarm.com = this.$route.query.com === 'shunfeng' ? 2 : 1
this.searchQuarm.phone = this.$route.query.phone
// this.searchQuarm.num = this.$route.query.num
// this.searchQuarm.com = this.$route.query.com
// this.searchQuarm.phone = this.$route.query.phone
this.searchByNu()
}
}
</script>
<style scoped lang="less">
.all-wrapper {
width: 100%;
min-height: 100%;
background-color: #F4F4F4;
}
.top-wrapper {
width: 100%;
height: 60px;
background-color: #069F99;
display: flex;
align-items: center;
img {
margin: 0 8px 0 24px;
}
p {
font-size: 18px;
color: #FFFFFF;
font-weight: bold;
margin: 0;
}
}
.title-wrapper {
width: 980px;
height: 200px;
margin: 0 auto;
background-color: #FFFFFF;
padding-top: 42px;
p {
font-size: 24px;
text-align: center;
}
}
.input-group {
width: 680px;
margin: 0 auto;
}
// 搜索左侧下拉框的选择框
.search-select {
width: 178px;
/deep/ .ant-select-selection {
height: 56px;
display: flex;
align-items: center;
background-color: #F8F8F8;
}
}
// 搜索左侧物流公司logo和名称
.search-left {
width: 140px;
display: flex;
align-self: center;
justify-content: center;
img {
height: 32px;
}
p {
font-size: 16px;
font-weight: bold;
margin: 0 12px;
}
}
// 搜索右侧的搜索框
.input-search {
width: calc(100% - 178px);
height: 56px;
/deep/ .ant-input-wrapper {
height: 100%;
input {
height: 100%;
font-size: 16px;
}
.ant-input-group-addon button {
height: 100%;
display: flex;
align-items: center;
}
}
.search-icon {
width: 20px;
height: 20px;
margin-right: 4px;
}
.search-text {
font-size: 18px;
}
}
// 物流信息容器
.content-wrapper {
width: 980px;
//height: auto;
//height: 100%;
min-height: calc(100vh - 260px - 12px) !important;
background-color: #FFFFFF;
margin: 12px auto 0;
padding-top: 32px;
.nu-p {
color: rgba(0, 0, 0, 0.9);
font-size: 20px;
font-weight: 600;
margin: 0 0 28px 32px;
}
.cut-line {
width: 100%;
}
// 空状态
.empty-wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
// 步骤条
.steps-wrapper {
padding: 32px;
/deep/ .ant-steps-item-content {
width: 90%;
margin-left: 40px;
}
/deep/ .ant-steps-item-container {
.ant-steps-item-tail {
left: 2px !important;
}
.ant-steps-item-icon {
width: 30px;
display: flex;
justify-content: center;
}
.ant-steps-icon-dot {
width: 8px;
height: 8px;
}
}
}
// 没有一级标题时二级标题的样式
.subTitle-no-title {
/deep/ .ant-steps-item-subtitle {
margin-left: 0;
}
}
// 有一级标题时二级标题的样式
.subTitle-have-title{
/deep/ .ant-steps-item-subtitle {
margin-left: 8px;
}
}
// 图片步骤点的样式
.deliver-status-img {
width: 30px;
}
// 图片作为步骤点时的样式
.img-dot {
/deep/ .ant-steps-item-tail {
padding: 40px 0 4px !important;
}
}
// 第一个物流信息标题,需要高亮显示
.one-title {
/deep/ .ant-steps-item-title{
color: #069f99 !important;
font-size: 18px;
}
/deep/ .ant-steps-item-subtitle{
color: rgba(0, 0, 0, 0.45);
}
}
// 不是第一个物流信息标题,置灰
.no-one-title{
/deep/ .ant-steps-item-title{
color: rgba(0, 0, 0, 0.45) !important;
font-size: 18px;
}
/deep/ .ant-steps-item-subtitle{
color: rgba(0, 0, 0, 0.45);
}
}
// 手机号码变色
.is-phone{
color: #069f99 !important;
}
</style>
@@ -0,0 +1,86 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit},props:{disabled:disabledBtn} }"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入手机号" @change="event => event.target.value = event.target.value.trim()"
v-decorator="['phone', validatorRules.phone]"/>
</a-form-item>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import { phoneReg } from '../../../utils/validate'
export default {
name: 'InputPhoneModal',
data() {
return {
title: '填写手机号',
width: '50%',
visible: false,
disableSubmit: false,
disabledBtn: false,
confirmLoading: false,
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
validatorRules: {
phone: {
rules: [{required: true, message: '请输入手机号'}, { validator: this.checkPhone }],
validateTrigger: 'blur'}
}
}
},
methods: {
open () {
this.visible = true
// 重置表单
this.form.resetFields()
},
handleOk () {
this.form.validateFields((err, values) => {
if(!err){
this.$emit('change', values.phone)
this.visible = false
}
})
},
handleCancel () {
this.visible = false
},
// 手机号校验
checkPhone (rules, value, callback) {
if (value) {
if (phoneReg(value)) {
callback()
} else {
callback(new Error('请输入正确格式的移动电话'))
}
return
}
callback()
},
}
}
</script>
<style scoped>
</style>
@@ -176,7 +176,14 @@ export default {
},
lookLogistics(record) {
const com = Number(record.sendMethod) === 1 && 'ems' || 'shunfeng'
window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
// window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
let url = ''
if (com === 'shunfeng' && record.principalPhone) {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }&phone=${ record.principalPhone }`
} else {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }`
}
window.open(url, '_blank')
},
handleCancel() {
this.close()
@@ -419,7 +419,14 @@ export default {
// this.model.sendMethod 1是ems 2是顺丰
// https://www.kuaidi100.com/chaxun?com=[]&nu=[]
const com = Number(this.model.sendMethod) === 1 && 'ems' || 'shunfeng'
window.open(`https://www.kuaidi100.com/chaxun?com=${com}&nu=${this.model.postNo}`)
// window.open(`https://www.kuaidi100.com/chaxun?com=${com}&nu=${this.model.postNo}`)
let url = ''
if (com === 'shunfeng' && this.model.mobile) {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ this.model.postNo }&phone=${ this.model.mobile }`
} else {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ this.model.postNo }`
}
window.open(url, '_blank')
}
}
+8 -1
View File
@@ -370,7 +370,14 @@ export default {
* */
lookLogistics(record) {
const com = Number(record.sendMethod) === 1 && 'ems' || 'shunfeng'
window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
// window.open(`https://www.kuaidi100.com/chaxun?com=${ com }&nu=${ record.postNo }`)
let url = ''
if (com === 'shunfeng' && record.contactMobile) {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }&phone=${ record.contactMobile }`
} else {
url = `${window._CONFIG['lookExpressDomainURL']}?com=${ com }&nu=${ record.postNo }`
}
window.open(url, '_blank')
},
/*
* 通过文件id获取文件的相关信息