Browse Source

封版 v1.0

master
DESKTOP-00SUCB6\Administrator 4 years ago
parent
commit
ce30b199fb
  1. 11
      public/config.js
  2. 82
      public/fwm/fwm.html
  3. BIN
      public/fwm/img/search-bg.png
  4. 2
      public/index.html
  5. 60
      public/m.html
  6. 18
      src/api/get.js
  7. 10
      src/utils/validate.ts
  8. 4
      src/views/get/addCancel.vue
  9. 4
      src/views/get/addGet.vue
  10. 4
      src/views/get/cancel.vue
  11. 102
      src/views/get/get.vue
  12. 2
      src/views/layout/components/Sidebar/SidebarItem.vue
  13. 2
      src/views/login/index.vue
  14. 1
      src/views/systemManage/user.vue
  15. 62
      vue.config.js

11
public/config.js

@ -5,11 +5,12 @@
// SHOW_URL: "http://www.fatoaniic.com/ftpfile/",
// }
config = {
// API_URL: 'http://121.36.65.171:9999',
API_URL: 'http://172.119.50.121:8081',
// API_URL: 'http://172.119.50.248:8081',
API_URL: 'http://121.36.65.171:9999',
// API_URL: 'http://10.10.9.71:8081',
UPLOAD_URL: "http://61.135.192.42:8082/attachment/uploadOne",
DOWNLOAD_URL: "http://61.135.192.42:8082/api-ftp/ftp/download?filename=",
SHOW_URL: "http://www.fatoaniic.com/ftpfile/",
// UPLOAD_URL: "http://61.135.192.42:8082/attachment/uploadOne",
// DOWNLOAD_URL: "http://61.135.192.42:8082/api-ftp/ftp/download?filename=",
// SHOW_URL: "http://www.fatoaniic.com/ftpfile/",
}

82
public/fwm/fwm.html

@ -52,20 +52,6 @@
align-items: center;
flex-direction: column;
}
.search-input {
background: transparent;
width: 150px;
border: 1px solid #969696;
-webkit-appearance: none;
border-radius: 5px;
padding: 0 10px;
color: #333;
height: 35px;
font-size: 16px;
transition: background-color 50000s ease-in-out 0s;
-webkit-text-fill-color: #333 !important;
}
.search-container {
position: relative;
width: 100vw;
@ -88,14 +74,29 @@
position: relative;
top:5px;
width: 100%;
min-height: 200px;
min-height: 250px;
background: #fff;
border-radius: 20px;
padding: 15px;
word-wrap:break-word;
/* font-weight: 550; */
}
.content-box .content-title {
position: relative;
display: inline-block;
width: 88px;
height: 30px;
font-weight: 550;
font-size: 14px;
line-height: 30px;
color: #000000;
vertical-align: top;
}
.content-box .content-text {
position: relative;
display: inline-block;
width: 190px;
height: 30px;
font-size: 14px;
line-height: 30px;
color: #000000;
@ -108,18 +109,6 @@
.text-indent-1 {
text-indent:1em
}
.aplayer-block {
position: relative;
/* bottom: 20px; */
margin: 20px 0;
width: 100%;
height: 50px;
background: #fff;
border-radius: 25px;
}
.aplayer-block audio {
width: 100%;
}
.nla-public {
position: absolute;
right: 15px;
@ -132,20 +121,20 @@
<div class="search-container flex-box-column">
<div class="content-block">
<p class="title text-indent-1">查询结果:</p>
<p class="title text-indent-1" id="gyhl_code"></p>
<div id="patch" class="content-box">
<img src="img/nls.jpg" class="nla-public">
<p class="content-text">尊敬的客户您好!</p>
<p class="content-text text-indent-1">您所查询的商品编码为:</p>
<p class="num-text" id="gyhl_code">86.121.1377451536954687488/F574AH121Y7#.F</p>
<p class="content-text text-indent-1">您查询的是由"北京顺鑫农业股份有限公司牛栏山酒厂"生产的正牌产品,请放心使用,谢谢您的查询。</p>
<br>
<p class="content-text">查询次数:<span id="scan_count"></span>,首次查询时间为:<br> <span id="first_scan"></span></p>
</div>
<div class="aplayer-block">
<audio id="play1" controls="controls" >
<source src="aa.mp3"></source>
</audio>
<!-- <img src="img/nls.jpg" class="nla-public"> -->
<label class="content-title" for="companyName">企业信息</label><br>
<label class="content-title text-indent-1" for="companyName">企业名称:</label>
<span class="content-text" id="companyName">尊敬的客户您好!</span><br>
<label class="content-title text-indent-1" for="companyAddr">企业地址:</label>
<span class="content-text" id="companyAddr">尊敬的客户您好!</span><br>
<label class="content-title" for="companyName">防伪码信息</label><br>
<label class="content-title text-indent-1" for="createTime">注册时间:</label>
<span class="content-text" id="createTime">尊敬的客户您好!</span><br>
<label class="content-title text-indent-1" for="summary">简介:</label>
<span class="content-text" id="summary">尊敬的客户您好!尊敬的客户您好!尊敬的客户您好!
尊敬的客户您好!尊敬的客户您好! 尊敬的客户您好!尊敬的客户您好!</span><br>
</div>
</div>
@ -158,11 +147,9 @@
// $("#sys_title").html(SYS_TITLE)
var param = '';
var code = '';
// param = decodeURIComponent(window.location.href.split('?')[1])
param = window.location.href.split('?')[1] || ''
code = param.split('&')[0] || '0000LH5D2B82'
code = param.split('&')[0] || ''
$("#gyhl_code").text(code)
function checkSocureData() {
if(code)
{
@ -174,9 +161,10 @@
console.log(res.code);
if(res.code == 200)
{
$("#gyhl_code").text(res.data.gyhl_code)
$("#scan_count").text(res.data.scan_count)
$("#first_scan").text(res.data.first_scan)
$("#companyName").text(res.data.companyName)
$("#companyAddr").text(res.data.companyAddr)
$("#createTime").text(res.data.createTime)
$("#summary").text(res.data.summary)
} else {
console.log(res.msg)
}

BIN
public/fwm/img/search-bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 750 KiB

2
public/index.html

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" href="./favicon.ico">
<title>牛栏山工业互联网防伪系统</title>
<script src="./config.js"></script>
</head>

60
public/m.html

@ -52,20 +52,6 @@
align-items: center;
flex-direction: column;
}
.search-input {
background: transparent;
width: 150px;
border: 1px solid #969696;
-webkit-appearance: none;
border-radius: 5px;
padding: 0 10px;
color: #333;
height: 35px;
font-size: 16px;
transition: background-color 50000s ease-in-out 0s;
-webkit-text-fill-color: #333 !important;
}
.search-container {
position: relative;
width: 100vw;
@ -101,7 +87,8 @@
color: #000000;
}
.content-box .num-text {
font-size: 13px;
font-size: 12px;
text-align: center;
line-height: 30px;
color: #C02932;
}
@ -114,7 +101,7 @@
margin: 20px 0;
width: 100%;
height: 50px;
background: #fff;
/* background: #fff; */
border-radius: 25px;
}
.aplayer-block audio {
@ -126,6 +113,7 @@
width: 80px;
height: 80px;
bottom: 10px;
}
</style>
<body>
@ -133,18 +121,23 @@
<div class="content-block">
<p class="title text-indent-1">查询结果:</p>
<div id="patch" class="content-box">
<img src="./fwm/img/nls.jpg" class="nla-public">
<p class="content-text">尊敬的客户您好!</p>
<p class="content-text text-indent-1">您所查询的商品编码为:</p>
<p class="num-text" id="gyhl_code">86.121.1377451536954687488/F574AH121Y7#.F</p>
<p class="content-text text-indent-1">您查询的是由"北京顺鑫农业股份有限公司牛栏山酒厂"生产的正牌产品,请放心使用,谢谢您的查询。</p>
<br>
<p class="content-text">查询次数:<span id="scan_count"></span>,首次查询时间为:<br> <span id="first_scan"></span></p>
<div class="content-box">
<div id="patch" style="display: none;">
<img src="./fwm/img/nls.jpg" class="nla-public">
<p class="content-text">尊敬的客户您好!</p>
<p class="content-text text-indent-1">您所查询的商品编码为:</p>
<p class="num-text" id="gyhl_code"></p>
<p class="content-text text-indent-1">您查询的是由"北京顺鑫农业股份有限公司牛栏山酒厂"生产的正牌产品,请放心使用,谢谢您的查询。</p>
<br>
<p class="content-text">查询次数:<span id="scan_count"></span>,首次查询时间为:<br> <span id="first_scan"></span></p>
</div>
<div id="noFound" style="display: none;">
<p class="content-text text-indent-1" style="color:red;font-size: 18px;">您所查询的商品不存在!</p>
</div>
</div>
<div class="aplayer-block">
<div class="aplayer-block" id="aplayerBlock" style="display: none;">
<audio id="play1" controls="controls" >
<source src="./fwm/aa.mp3"></source>
<source id="audioSource" src=""></source>
</audio>
</div>
</div>
@ -161,8 +154,7 @@
// param = decodeURIComponent(window.location.href.split('?')[1])
param = window.location.href.split('?')[1] || ''
code = param.split('&')[0] || '0000LH5D2B82'
code = param.split('&')[0] || ''
function checkSocureData() {
if(code)
{
@ -174,11 +166,21 @@
console.log(res.code);
if(res.code == 200)
{
$("#patch").show()
$("#aplayerBlock").show()
$("#gyhl_code").text(res.data.gyhl_code)
$("#scan_count").text(res.data.scan_count)
$("#first_scan").text(res.data.first_scan)
let url = config.API_URL + res.data.url
$('#play1').attr('src',url)
var fry_audio=$('#play1').get('0');
fry_audio.load()
// createAudioMP3(res.data.gyhl_code)
} else {
console.log(res.msg)
$("#noFound").show()
}
},
error: function(err) {

18
src/api/get.js

@ -42,3 +42,21 @@ export function generateFetch(params) {
});
}
//发送短信
export function sendMessage(params) {
return request({
url: '/sms/send',
method: 'post',
data:params
});
}
//短信验证并获取下载地址
export function getDownloadUrl(params) {
return request({
url: '/fetch/getDownloadUrl',
method: 'post',
data:params
});
}

10
src/utils/validate.ts

@ -91,7 +91,15 @@ export function getDay() {
  var dateStr = year + "-" + month + "-" + day;
return dateStr
}
/*获取当前年月日*/
export function getDay2() {
var nowDate = new Date();
  var year = nowDate.getFullYear();
  var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
  var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
  var dateStr = year + "" + month + "" + day;
return dateStr
}
/*获取当前年月日时分秒*/
export function getDayTime() {
var nowDate = new Date();

4
src/views/get/addCancel.vue

@ -106,7 +106,7 @@ import {
getFetchList
} from "@/api/get"
import {addDiscard} from "@/api/cancel"
import {getDayTime} from "@/utils/validate"
import {getDayTime,getDay2} from "@/utils/validate"
export default {
name: "addGet",
data() {
@ -118,7 +118,7 @@ export default {
otherTotal:'50000万',
},
form:{
num:this.$route.query.ids || 'FMD_'+new Date().getTime(),
num:this.$route.query.ids || 'FMD_'+getDay2()+'_'+Math.floor(Math.random()*10000),
theGetTime:this.$route.query.times || getDayTime(),
qmdnum:'',
fileName:''

4
src/views/get/addGet.vue

@ -76,7 +76,7 @@ import {
addFetchList,getFetchDetail,updateFetch
} from "@/api/get"
import { getWhitelist } from "@/api/user"
import {getDayTime} from "@/utils/validate"
import {getDayTime,getDay2} from "@/utils/validate"
import {summaryPortal} from '@/api/status';
export default {
name: "addGet",
@ -85,7 +85,7 @@ export default {
return {
AllData:{},
id:this.$route.query.ids || "",
num:this.$route.query.ids || 'QMD_'+new Date().getTime(),
num:this.$route.query.ids || 'QMD_'+getDay2()+'_'+Math.floor(Math.random()*10000),
theGetTime:this.$route.query.times || getDayTime(),
paramsForm:{
params: [],

4
src/views/get/cancel.vue

@ -93,7 +93,7 @@
<script>
import { getDiscardList,addDiscard } from "@/api/cancel"
import { getFetchList } from "@/api/get"
import {getDayTime} from "@/utils/validate"
import {getDayTime,getDay2} from "@/utils/validate"
export default {
name: "getCancel",
data() {
@ -112,7 +112,7 @@ export default {
QMD_list:[],
fileList:[],
cancelForm:{
discard_id:this.$route.query.ids || 'FMD_'+new Date().getTime(),
discard_id:this.$route.query.ids || 'FMD_'+getDay2()+'_'+Math.floor(Math.random()*10000),
discard_time:this.$route.query.times || getDayTime(),
fetch_id:'',
filename:''

102
src/views/get/get.vue

@ -38,7 +38,7 @@
</el-table-column>
<el-table-column prop="fileName" label="防伪码">
<template slot-scope="scope">
<a :href="BASE_URL + scope.row.downloadUrl"><el-button type="text">{{scope.row.fileName}}</el-button></a>
<el-button type="text" @click="downLoadFile(scope.row.fetchId)">{{scope.row.fileName}}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="250">
@ -59,29 +59,67 @@
layout="total, prev, pager, next, sizes, jumper"
:total="total">
</el-pagination>
<el-dialog title="发码" :visible.sync="dialogDownloadVisible" width="500px" :close-on-click-modal='false'>
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label="手机号:" :label-width="formLabelWidth" prop="telPhone" ref="telPhone">
<el-input v-model.number="form.telPhone" maxlength="11" autocomplete="off" size="small"></el-input>
</el-form-item>
<el-form-item label="短信验证码:" :label-width="formLabelWidth" prop="vCode">
<el-input v-model.number="form.vCode" autocomplete="off" size="small" style="width:110px;margin-right:5px;"></el-input>
<el-button type="danger" style="width:100px;" size="small" @click="getSendMessage" :disabled="sendStatus">{{!sendStatus?'获取验证码':timer+'秒'}}</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="mini" @click="submitForm('form')">保存</el-button>
<el-button type="info" size="mini" @click="resetForm('form')">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getFetchList,generateFetch
getFetchList,generateFetch,sendMessage,getDownloadUrl
} from "@/api/get"
import {validatePhone} from "@/utils/validate"
export default {
name: "getGet",
data() {
const checkPhoneNum = (rule, value, callback) => {
if (!validatePhone(value)) {
return callback(new Error('请输入正确的手机号码'));
} else {
callback()
}
};
return {
BASE_URL:config.API_URL,
formSearch: {//
time: '',
number: '',
},
form:{
telPhone:'',
vCode:''
},
rules: {
telPhone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{validator:checkPhoneNum,trigger:"blur"}
],
vCode: [
{ required: true, message: '请输入短信验证码', trigger: 'blur' }
]
},
currentPage: 1, //
pageSize: 10, //
total: 0, //
tableData: [
tableData: [], //
formLabelWidth:'120px',
dialogDownloadVisible:false,
sendStatus:false,
timer:60,
fetchId:'',
], //
};
},
mounted() {
@ -108,6 +146,58 @@ export default {
this.total = res.data.count
})
},
downLoadFile(id){
this.dialogDownloadVisible = true
this.fetchId = id
},
getSendMessage(){
this.$refs['form'].validateField('telPhone',(valid) => {
if (valid) {
console.log('telPhone error');
return false;
} else {
sendMessage({phone:this.form.telPhone+''}).then(res => {
this.$message({
message: res.msg,
type: 'success'
});
this.timer = 60
this.sendStatus = true
var flag = setInterval(() =>{
if(this.timer == 0)
{
clearInterval(flag)
this.sendStatus = false
} else {
this.timer--
}
},1000)
})
}
});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
const param ={
fetch_id:this.fetchId,
phone:this.form.telPhone+'',
verify_code:this.form.vCode+''
}
getDownloadUrl(param).then(res => {
window.location.href = this.BASE_URL + res.data
})
} else {
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.dialogDownloadVisible = false
},
confirm(id){
this.$confirm('此操作将生成防伪码印刷文件, 是否继续?', '提示', {
confirmButtonText: '确定',

2
src/views/layout/components/Sidebar/SidebarItem.vue

@ -38,7 +38,7 @@
<span class="myTitle" slot="title">{{item.item}}</span>
</el-menu-item>
</router-link>
<el-submenu v-else :index="item.url" :key="item.url">
<el-submenu v-else :index="'submenu_'+ item.id" :key="item.url">
<template slot="title">
<span class="myTitle" slot="title">{{item.item}}</span>
</template>

2
src/views/login/index.vue

@ -90,7 +90,7 @@
</el-button>
</el-form>
<div class="login_copyright">
ICP备案证书号:京ICP备12027436号 京公网安备 11011302002117 牛栏山二锅头酒厂 技术支持<a target="_bank" href="http://www.fatoan.com/">福通互联</a>
ICP备案证书号:京ICP备12027436号 京公网安备 11011302002117 牛栏山二锅头酒厂 技术支持<a target="_bank" href="http://www.fatoan.com/">福通互联</a> 版本v1.0
</div>
</div>
</template>

1
src/views/systemManage/user.vue

@ -38,6 +38,7 @@
<el-button type="info" size="mini" @click="resetForm('passForm'),dialogResetPass = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>

62
vue.config.js

@ -26,15 +26,15 @@ module.exports = {
}),
]
},
pwa: {
iconPaths: {
favicon32: 'favicon.ico',
favicon16: 'favicon.ico',
appleTouchIcon: 'favicon.ico',
maskIcon: 'favicon.ico',
msTileImage: 'favicon.ico'
}
},
// pwa: {
// iconPaths: {
// favicon32: 'favicon.ico',
// favicon16: 'favicon.ico',
// appleTouchIcon: 'favicon.ico',
// maskIcon: 'favicon.ico',
// msTileImage: 'favicon.ico'
// }
// },
/* webpack-dev-server 相关配置 */
devServer: {
/* 自动打开浏览器 */
@ -49,35 +49,21 @@ module.exports = {
},
hotOnly: false,
/* 使用代理 */
proxy: {
'/api': {
/* 目标代理服务器地址 */
target: 'http://121.36.79.12:8085',
/* 允许跨域 */
changeOrigin: true,
// 如果要代理 websockets
// ws: true,
// 将主机标头的原点更改为目标URL
changeOrigin: true,
pathRewrite: {
'^/api': ''
},
// onProxyRes(proxyRes, req, res) {
// var cookies = proxyRes.headers['set-cookie']
// if (cookies == null || cookies.length == 0) {
// delete proxyRes.headers['set-cookie']
// return
// }
// for (var i = 0,n = cookies.length; i < n; i++) {
// if(cookies[i].match(/^JSESSIONID=[^;]+;[\s\S]*Path=\/[^;]+/)){
// cookies[i] = cookies[i].replace(/Path=\/[^;]+/,'Path=/');
// }
// }
// proxyRes.headers['set-cookie'] = cookies;
// }
},
},
// proxy: {
// '/api': {
// /* 目标代理服务器地址 */
// target: 'http://121.36.79.12:8085',
// /* 允许跨域 */
// changeOrigin: true,
// // 如果要代理 websockets
// // ws: true,
// // 将主机标头的原点更改为目标URL
// changeOrigin: true,
// pathRewrite: {
// '^/api': ''
// },
// },
// },
},
transpileDependencies: ['webpack-dev-server/client'],
chainWebpack: config => {

Loading…
Cancel
Save