baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)

This commit is contained in:
Gaussian committed 2026-11-06 18:38:38 +08:00
commit c2b0e7be0d
6522 files changed
+3530643

No files matched your search

+91
View File
@@ -0,0 +1,91 @@
//王者地带
//http://ask.dcloud.net.cn/people/%E7%8E%8B%E8%80%85%E5%9C%B0%E5%B8%A6
//5+APP Android 获取手机本机MAC 地址,支持所有安卓版本
//2018-12-12
module.exports = {
// #ifdef APP-PLUS
address: function() {
var Build = plus.android.importClass('android.os.Build');
if (Build.VERSION.SDK_INT < 23) //android 6.0以下版本
{
return this.WifiInfoMac();
} else if (Build.VERSION.SDK_INT == 23) //android 6.0
{
return this.ReaderMac();
} else {
return this.NetworkMac();
}
},
WifiInfoMac: function() {
var Context = plus.android.importClass("android.content.Context");
var WifiManager = plus.android.importClass("android.net.wifi.WifiManager");
var wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE);
var WifiInfo = plus.android.importClass("android.net.wifi.WifiInfo");
var wifiInfo = wifiManager.getConnectionInfo();
return wifiInfo.getMacAddress();
},
ReaderMac: function() {
try {
var BufferedReader = plus.android.importClass("java.io.BufferedReader");
var FileReader = plus.android.importClass("java.io.FileReader");
var file = new FileReader("/sys/class/net/wlan0/address");
var reader = new BufferedReader(file, 256);
var address = reader.readLine();
reader.close();
return address;
} catch (error) {
this.NetworkMac();
return "02:00:00:00:00:00";
}
},
NetworkMac: function() {
var NetworkInterface = plus.android.importClass("java.net.NetworkInterface");
var networkInterface = NetworkInterface.getByName("eth1");
if (networkInterface == null) {
networkInterface = NetworkInterface.getByName("wlan0");
}
if (networkInterface == null) {
this.isWifi();
return "02:00:00:00:00:00";
}
var mac = networkInterface.getHardwareAddress();
var macArr = [];
for (var i in mac) {
macArr.push(this.format(mac[i]));
}
return macArr.join(":");
},
format: function(mac) {
if (parseInt(mac) >= 0) {
var numbder = parseInt(mac).toString(16);
var num = numbder.length == 1 ? "0" + numbder : numbder;
return num;
} else {
var numbder = parseInt(256 - Math.abs(mac)).toString(16);
var num = numbder.length == 1 ? "0" + numbder : numbder;
return num;
}
},
isWifi: function() {
if (plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_WIFI) {
return "02:00:00:00:00:00";
} else {
plus.nativeUI.confirm("需要打开WiFi才能获取到MAC地址,是否去打开WiFi", function(event) {
if (event.index == 0) {
var main = plus.android.runtimeMainActivity();
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.wifi.WifiSettings");
main.startActivity(intent);
}
});
}
}
// #endif
};
+93
View File
@@ -0,0 +1,93 @@
export default {
checkVersionUrl:function(){
const systemInfo = uni.getSystemInfoSync();
const platform = systemInfo.platform;
//appName 宿主APP名称 字节跳动小程序
//AppPlatform App平台 QQ小程序
//host 宿主平台 百度小程序
//app 当前运行的客户端 支付宝小程序
console.log("systemInfo.appName" + systemInfo.appName)
console.log("systemInfo.AppPlatform" + systemInfo.AppPlatform)
console.log("systemInfo.host" + systemInfo.host)
console.log("systemInfo.app" + systemInfo.app)
console.log("systemInfo.SDKVersion" + systemInfo.SDKVersion)
console.log("systemInfo.swanNativeVersion" + systemInfo.swanNativeVersion)
let versionCode = plus.runtime.app.versionCode
console.log("plus.runtime.app.versionCode" + plus.runtime.app.versionCode)
console.log("plus.runtime.app.versionCode" + plus.runtime.app.versionCode)
let checkVersionurl = "" // 检测更新地址
let runAppFlag = true
//运行平台判断
if(systemInfo.appName == "微信小程序") {
runAppFlag = false
}
if(runAppFlag) {
uni.request({
url: checkVersionurl, //仅为示例,并非真实接口地址。
data: {
versionCode: versionCode,
platform: platform
},
header: {
//'custom-header': 'hello' //自定义请求头信息
},
success: (res) => {
console.log(res.data);
let downloadUrl = res.data;
if (platform == "android") {
// 安装下载的apk文件
let dtask = plus.downloader.createDownload(downloadUrl, {}, function(d, status) {
if (status == 200) { // 下载成功
let path = d.filename
plus.runtime.install(path)
console.log(d.filename)
} else { //下载失败
alert("Download failed: " + status)
}
})
dtask.start()
// dtask.addEventListener("statechanged", function(task, status) {
// switch (task.state) {
// case 1: // 开始
// res.change({
// progressValue:0,
// progressTip:"准备下载...",
// progress: true
// });
// break;
// case 2: // 已连接到服务器
// res.change({
// progressValue:0,
// progressTip:"开始下载...",
// progress: true
// });
// break;
// case 3:
// const progress = parseInt(task.downloadedSize / task.totalSize * 100);
// if(progress - lastProgressValue >= 2){
// lastProgressValue = progress;
// res.change({
// progressValue:progress,
// progressTip: "已下载" + progress + "%",
// progress: true
// });
// }
// break;
// }
// });
} else {
//url在appstore的地址
plus.runtime.openURL(url)
}
}
});
}
}
}
+230
View File
@@ -0,0 +1,230 @@
// import request from './j-request/request.js'
import store from '../store/index.js'
export default {
GetSourceTypeList(type) {
var souceList = new Array();
var userId = store.state.userInfo.ID
//console.log("111111111111111111111"+this.userInfo.ID)
request.post({
data: {
//id: this.userInfo.ID,
action: 'QuerySelBill',
params: {
"id": userId,
"tranType": type
}
}
})
.then(res => {
var datalist = JSON.parse(res)
for (let i = 0; i < datalist.length; i++) {
souceList.push({
'FIsOpenSource': datalist[i].FIsOpenSource,
'FSourceTranType': datalist[i].FSourceTranType,
'FDestTranType': datalist[i].FDestTranType,
'ViewName': datalist[i].ViewName,
'value': datalist[i].FSourceBillName
})
}
}).catch(err => {
console.log(err, '获取源单类型错误')
});
console.log(souceList, '源单数据')
return souceList;
},
//获取部门,客户,供应商
GetComInfoList(type, number) {
//type: 1,客户 2,部门 3,供应商
var customList = new Array();
let datalist
if (number == "") {
switch (type) {
case 1:
uni.getStorage({
key: "customerInfos",
success: (res) => {
datalist = res.data;
}
})
break;
case 2:
uni.getStorage({
key: "deptInfos",
success: (res) => {
datalist = res.data;
}
})
break;
case 3:
uni.getStorage({
key: "supplierInfos",
success: (res) => {
datalist = res.data;
}
})
break;
}
}
if (!datalist || datalist.length == 0)
{
var userId = store.state.userInfo.UserID
var dbs=store.state.userInfo.dbAlise
request.post({
data: {
action: 'getInfo',
params: {
"wUserID": userId,
"DBAias": dbs,
"FNumber": number,
"type": type
}
},
}).then(res => {
var data = JSON.parse(res)
datalist=data.data;
}).catch(err => {
console.log(err, '获取客户/部门/供应商错误')
});
}
for (let i = 0; i < datalist.length; i++) {
customList.push({
FItemID: datalist[i].FItemID,
FNumber: datalist[i].FNumber,
value: datalist[i].FName,
})
}
// if (number == "" && customList.length > 0) {
// this.SetComStorage(type, customList);
// }
return customList;
},
SetComStorage(type, data) {
console.log(data, '------进入缓存-------=')
switch (type) {
case 1:
store.saveCustomerInfos(data);
break;
case 2:
store.saveDeptInfos(data);
break;
case 3:
store.saveSupplierInfos(data);
break;
}
},
CheckBarcodeNumber(barcodeNumber) {
if (!barcodeNumber) {
return true;
}
let barcodeRule
if(store.state.sysParameters) {
if(store.state.sysParameters.hasOwnProperty("BarcodeRuleForVerification")) {
let rule = store.state.sysParameters["BarcodeRuleForVerification"];
console.log(typeof(rule),'rule属性')
barcodeRule=rule//.FValue
}
}
console.log(barcodeRule)
if(!barcodeRule)
{
return true;
}
let ruleNoSpace = barcodeRule.replace(/\s*/g, "");
if (!ruleNoSpace) {
return false;
}
if (ruleNoSpace.length === 0) {
return false;
}
let rules = ruleNoSpace.split("|");
//最小长度|最大长度|起始字符|结束字符|包含字符(字符之间可以已逗号隔开)
if (rules[0]) {
if (barcodeNumber.length < Number.parseInt(rules[0])) {
return false;
}
}
if (rules[1]) {
if (barcodeNumber.length > Number.parseInt(rules[1])) {
return false;
}
}
if (rules[2]) {
let header = barcodeNumber.substr(0, 1);
let ruleChart2 = rules[2].split(",")
if (ruleChart2) {
if (ruleChart2.length > 0) {
let filterChart2 = ruleChart2.filter(
function(myChar) {
return myChar == header;
}
)
if (!filterChart2) {
return false;
}
if (filterChart2.length === 0) {
return false;
}
}
}
}
if (rules[3]) {
let end = barcodeNumber.substr(-1, 1);
let ruleChart3 = rules[3].split(",");
if (ruleChart3) {
if (ruleChart3.length > 0) {
let filterChart3 = ruleChart3.filter(
function(myChar) {
return myChar == end;
}
)
if (!filterChart3) {
return false;
}
if (filterChart3.length === 0) {
return false;
}
}
}
}
if (rules[4]) {
let myBarcodeNumber = barcodeNumber;
if (rules[2]) {
myBarcodeNumber = myBarcodeNumber.substr(1, myBarcodeNumber.length - 1);
}
if (rules[3]) {
myBarcodeNumber = myBarcodeNumber.substr(0, myBarcodeNumber.length - 1);
}
let ruleChart4 = rules[4].split(",");
if (ruleChart4) {
if (ruleChart4.length > 0) {
ruleChart4.forEach(
function(myChar) {
myBarcodeNumber = myBarcodeNumber.replace(new RegExp(myChar, "gm"), "");
}
);
if (myBarcodeNumber) {
if (myBarcodeNumber.length > 0) {
return true;
}
}
}
}
}
return true;
},
}
+43
View File
@@ -0,0 +1,43 @@
.sub-btn {
width: 20%;
color: #FFFFFF;
background-color: #007BFF;
height: 58upx;
line-height: 58upx;
font-size: 24upx;
}
.bg-darkblue{
background-color: #55aa7f !important;
}
.bg-blue{
background-color: #55aaff !important;
}
.bg-darkred{
background-color: #ff0000 !important;
}
.bg-light-orange{
background-color: #ffaa7f !important;
}
.bg-light-green{
background-color: #84AF9B;
}
.bg-dark-gray{
background-color: #767d78;
}
.bg-light-gray{
background-color: #C8C7A8;
}
.bg-light-yellow{
background-color: #FACDAE;
}
.bg-light-red{
background-color:#FC9C9D;
}
+249
View File
@@ -0,0 +1,249 @@
/* gray-layer */
.gray-layer {position: fixed;left: 0;right: 0;top: 0;bottom: 0;background-color: #333333;opacity: 0.5;}
.header-row-class-organzie{
display: flex;
justify-content: flex-end;
align-items: center;
margin-right: 20px;
}
.header-row-title-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.head-row-content-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.img-organzie{
height: 32rpx;
width: 32rpx;
margin-left: 24rpx;
}
/* search-style */
.search{position: relative;display: flex;flex-wrap: nowrap;justify-content: flex-start;align-items: center;height: 72rpx;line-height: 72rpx;margin: 24rpx 40rpx 0 40rpx;flex-shrink: 0;flex-grow: 0;border-radius: 8rpx;}
.search-type-select{
width: 150rpx;
height: 72rpx;
line-height: 72rpx;
text-align: end;
font-size: 28rpx;
font-family: PingFangSC, PingFangSC-Regular;
font-style: auto;
color: #666666;
flex-shrink: 0;
flex-grow: 0;
margin-right: 24rpx;
}
.uni-input{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
height: 72rpx;
line-height: 72rpx;
border: 1px solid #D8D8D8;
color: #666666;
padding: 0 10rpx;
border-radius: 8rpx;
flex-wrap: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
background-color: rgba(173,173,173,0.12);
}
.uni-input-text{text-align: left;width: 100%;font-weight: 400;font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;color: rgba(60,60,67,0.60);;}
.search-input{
width: 100%;
height: 72rpx;
line-height: 72rpx;
font-size: 28rpx;
font-family: PingFangSC, PingFangSC-Regular;
color: #6B6B6B;
padding-left: 15rpx;
padding-right: 15rpx;
border-radius: 8rpx;
border: 1px solid #D8D8D8;
background-color: rgba(173,173,173,0.12);
}
.search-placeholder{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;text-align: left;color: rgba(160,160,160,0.60);}
.search-img{height: 34rpx;width: 34rpx;position: absolute;right: 20rpx;top: 20rpx;}
/* list-card-style */
.list-card{position: relative;display: flex;flex-direction: column;background: #FFFFFF;
margin: 16rpx 40rpx;padding: 15rpx 20rpx 15rpx 0rpx;border-radius: 8rpx;}
.list-card-Info{display: flex;flex-direction: row;align-items: center;justify-content: space-between;}
.list-card-Info-item{display: flex;flex-direction: column;align-items: flex-start;}
.list-card-Info-item-row{display: flex;flex-direction: row;flex-shrink: 0;}
.list-card-Info-item-status-realse{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;text-align: left;color: rgba(27,175,7,0.60);margin-bottom: 20rpx;}
.list-card-Info-item-status-ongoing{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;
text-align: left;color: rgba(226,115,0,0.60);margin-bottom: 20rpx;}
.list-card-Info-item-status-ongoing span{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;
text-align: left;color: rgba(226,115,0,0.60);margin-bottom: 20rpx;}
.list-card-Info-item-text{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;
text-align: left;color: rgba(60,60,67,0.60);margin-bottom: 20rpx;overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;}
.list-card-Info-item-text span{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;
text-align: left;color: #000000;margin-bottom: 20rpx;overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;}
span{font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;text-align: left;color: rgba(60,60,67,0.85);}
.list-card-img{height: 28rpx;width: 28rpx;flex-shrink: 0;}
.list-card-btn{display: flex;flex-direction: row;height: 44rpx;margin-top: 0rpx;align-items: center;}
.btn{height: 44rpx;line-height: 44rpx;width: 100%;text-align: center;font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #0a7ffd;border-right: 1px solid #dadada;}
.btn-gray{height: 44rpx;line-height: 44rpx;width: 100%;text-align: center;font-size: 28rpx;font-weight: 400;color: #d8d8d8;border-right: 1px solid #d8d8d8;font-family: PingFangSC, PingFangSC-Regular;}
/* tabBar */
.tabBar{display: flex;position: fixed;flex-direction: row;left: 0;right: 0;bottom: 0;height: 100rpx;background: rgba(255, 255, 255, 1);box-shadow:2px 2px 10px rgba(0, 0, 0, 1);}
.tabBar-item{display: flex;flex-direction: column;align-items: center;width: 100%;}
.tabBar-item-view{display: flex;flex-direction: row;flex-shrink: 1;flex-grow: 1;align-items: center ;}
.tabBar-item-img{height: 42rpx;width: 46rpx;}
.tabBar-item-text{text-align: center;margin-left: 16rpx;font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #999999;}
/* soildDel */
.delete-icon {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
right: -175rpx;
width: 130rpx;
height: 62rpx;
line-height: 62rpx;
border-radius: 31rpx;
font-weight: 500;
font-size: 32rpx;
text-align: center;
color: #FFFFFF;
background: #FF1C1C;
}
/* change-label */
.change-label {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 44rpx;
margin: 32rpx 40rpx;
}
.label-type {
display: flex;
flex-direction: row;
flex-shrink: 0;
}
.add-btn {
width: 156rpx;
height: 52rpx;
line-height: 52rpx;
opacity: 1;
background: #1890ff;
border-radius: 26rpx;
font-size: 28rpx;
font-family: PingFangSC, PingFangSC-Regular;
font-weight: 400;
text-align: center;
color: #ffffff;
}
.change-label-first-selected {
height: 44rpx;
line-height: 44rpx;
text-align: left;
font-size: 32rpx;
font-family: PingFangSC, PingFangSC-Semibold;
font-weight: 600;
color: #1890ff;
}
.change-label-first-unselect {
height: 44rpx;
line-height: 44rpx;
text-align: left;
font-size: 32rpx;
font-family: PingFangSC, PingFangSC-Semibold;
font-weight: 400;
color: #4b4b4b;
}
.change-label-second-selected {
height: 44rpx;
line-height: 44rpx;
text-align: left;
font-size: 32rpx;
font-family: PingFangSC, PingFangSC-Semibold;
font-weight: 600;
color: #1890ff;
margin-left: 72rpx;
}
.change-label-second-unselect {
height: 44rpx;
line-height: 44rpx;
text-align: left;
font-size: 32rpx;
font-family: PingFangSC, PingFangSC-Semibold;
font-weight: 400;
color: #4b4b4b;
margin-left: 72rpx;
}
/* bottom-select */
.bottom-select {position: fixed;left: 0rpx;right: 0rpx;bottom: 0rpx;background-color: #FFFFFF;opacity: 1;z-index: 5;}
.bottom-select-head {display: flex;flex-wrap: nowrap;border-bottom: 1px solid #f9f9f9;}
.bottom_select-head-cancel {height: 80rpx;line-height: 80rpx;width: 100%;font-size: 32rpx;text-align: left;margin-left: 32rpx;color: #666666;}
.bottom_select-head-confirm {height: 80rpx;line-height: 80rpx;width: 100%;font-size: 32rpx;text-align: end;margin-right: 32rpx;color: #0184ff;}
.bottom-select-list {display: flex;width: 100%;align-items: center;}
.bottom-select-list-item {height: 72rpx;line-height: 72rpx;width: 100%;text-align: center;font-size: 16px;
font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;overflow: hidden;text-overflow:ellipsis;}
/* alter-window */
.alter-window{height: 680rpx;width: 800rpx;background-color: #F7F7F7;border-radius: 28rpx;position: fixed;right: 0;left: 0;top: 0;bottom: 0;margin: auto;}
.window-title{font-size: 34rpx;font-family: PingFangSC, PingFangSC-Semibold;font-weight: 600;text-align: center;color: #000000;margin-top: 40rpx;}
.window-content{margin: 0 0;height: 100%;display: flex;flex-direction: column;}
.window-content-item{display: flex;flex-direction: row;align-items: center;height: 72rpx;margin:0 70rpx 24rpx 70rpx;}
.window-btn{height: 90rpx;width: 100%;position: absolute;bottom: 0;display: flex;flex-direction: row;border-top: rgba(60,60,67,0.36) solid 1rpx;align-items: center;}
.window-btn-cancel{height: 90rpx;line-height: 90rpx;width: 100%;text-align: center;font-size: 34rpx;
font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #727171;border-right: rgba(60,60,67,0.36) solid 1rpx;}
.window-btn-confirm{height: 90rpx;line-height: 90rpx;width: 100%;text-align: center;font-size: 34rpx;
font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #0A7AFF;}
/* grid */
.file-content{margin: 0 32rpx;padding: 0rpx 0 50rpx 0;border-bottom: 1px solid #f0f0f0;}
.grid-item-box{display: flex;flex-direction: column;align-items: center;margin-top: 50rpx;}
/* bottom-btn */
.bottom-btn{
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
background-color: #2560C9;
}
/* check-detail-mid */
.check-mid-text{flex-wrap: nowrap;width: 160rpx;text-align: right;flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;}
.table-text{flex-wrap: nowrap;text-align: left;flex-shrink: 0;width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;}
+158
View File
@@ -0,0 +1,158 @@
function handle(err){
console.log(err);
if (err.state) {
//服务器返回
let regToken = /Token/;
if(regToken.test(err.errorMsg)) {
let eMsg = err.errorMsg.toString().substr(0,100);
uni.showModal({
content: eMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
else {
let eMsg = err.errorMsg.toString().substr(0,100);
uni.showModal({
content: eMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
else {
//非服务器返回
if(err.statusCode) {
let errorMsg = "";
if(err.data) {
errorMsg = err.statusCode + " " + err.errMsg + " " + err.data.toString().substr(0,100);
}
else {
errorMsg = err.statusCode + " " + err.errMsg.toString().substr(0,100);
}
if(err.statusCode == 404) {
uni.showModal({
content: "请确认服务器地址是否正确",
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
else {
uni.showModal({
content: errorMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
else if (err.errMsg){
let reg = /request:fail/;
let regTimeout = /request:fail timeout/;
let regAbort = /request:fail abort/;
if(regTimeout.test(err.errMsg.toString())){
uni.showToast({
icon: 'none',
title: "当前网络质量不好请稍后再试"
});
}
else if (regAbort.test(err.errMsg.toString())){
uni.showToast({
icon: 'none',
title: "当前网络质量不好请稍后再试"
});
}
else if (reg.test(err.errMsg.toString())){
uni.showToast({
icon: 'none',
title: "请确认当前网络是否连接"
});
}
else {
let errorMsg = err.errMsg.toString().substr(0,100);
uni.showModal({
content: errorMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
else {
let reg = /errorMsg/;
if(reg.test(err.toString())) {
let errorMsg = err.toString().substr(0,100);
uni.showModal({
content: errorMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
else if(err.toString()) {
let errorMsg = err.toString().substr(0,100);
uni.showModal({
content: errorMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
else {
let errorMsg = '提交资料有问题,请先确认' + err + err.toString().substr(0,100);
uni.showModal({
content: errorMsg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
}
}
export default {handle}
+31
View File
@@ -0,0 +1,31 @@
.s-main
{
font-size: 50upx;
display: flex;
flex-direction: column;
}
.s-content{
background: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
height: 100upx;
border-bottom: 1upx solid #F2F2F2;
}
.s-title{
display: flex;
flex: 1;
justify-content: center;
}
.s-part{
display: flex;
flex: 3;
justify-content: center;
}
.s-btn{
margin: 0 auto;
padding-top: 10%;
width: 60%;;
}
+41
View File
@@ -0,0 +1,41 @@
export default {
globalReturnType:new Map(),
globalData: {
requestUrl: '', //http://localhost:8300
printUrl: '' //打印服务器地址
},
setGlobalObj(data) {
//设置服务器变量
this.globalData = Object.assign({}, this.globalData, data);
//缓存数据
uni.setStorage({
key: 'RequestUrl',
data: data.requestUrl
});
uni.setStorage({
key: 'PrintUrl',
data: data.printUrl
});
},
getReturnType(url){
if (url) {
return this.globalReturnType.get(url);
}
},
setReturnType(url, returnType) {
if (url && returnType) {
this.globalReturnType.set(url, returnType);
}
},
deleteReturnType(url) {
if (url) {
this.globalReturnType.delete(url);
}
},
}
+22
View File
@@ -0,0 +1,22 @@
@font-face {
font-family: 'iconfont'; /* project id 1912602 */
src: url('https://at.alicdn.com/t/font_1912602_bd2r66xw9t.eot');
src: url('https://at.alicdn.com/t/font_1912602_bd2r66xw9t.eot?#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_1912602_bd2r66xw9t.woff2') format('woff2'),
url('https://at.alicdn.com/t/font_1912602_bd2r66xw9t.woff') format('woff'),
url('https://at.alicdn.com/t/font_1912602_bd2r66xw9t.ttf') format('truetype'),
url('https://at.alicdn.com/t/font_1912602_bd2r66xw9t.svg#iconfont') format('svg');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 20px;
color: #CCCCCC;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-qingchuhuancun:before {
content: "\e610";
}
+56
View File
@@ -0,0 +1,56 @@
page{
background: #F2F2F2;
}
.main{
display: flex;
flex-direction: column;
background: #FFFFFF;
margin-bottom: 2%;
}
.m-title{
display: flex;
align-items: center;
justify-content: flex-start;
margin-left: 2%;
height: 70upx;
font-size: 35upx;
font-weight: bold;
}
.mt-center{
padding-top: 2%;
justify-content: center;
font-size: 37upx;
}
.m-contain
{
display: flex;
flex-direction: row;
flex-wrap: wrap;//换行
padding-bottom: 5%;
}
.m-contain view{
height: 200upx;
width: 75px;
display: inline-flex;
flex-direction:column;
justify-content: center;
align-items: center;
}
.m-contain view view{
display: flex;
justify-content: center;
align-items:center;
}
image{
height: 38px;
width: 38px;
}
.m-sign{
color: #007AFF;
font-weight: bold;
margin-right: 4px;
}
+274
View File
@@ -0,0 +1,274 @@
/*
* JavaScript MD5 1.0.1
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*jslint bitwise: true */
/*global unescape, define */
'use strict';
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
}
function md5_ff(a, b, c, d, x, s, t) {
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t) {
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t) {
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t) {
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binl_md5(x, len) {
/* append padding */
x[len >> 5] |= 0x80 << (len % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var i, olda, oldb, oldc, oldd,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
for (i = 0; i < x.length; i += 16) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = md5_ff(a, b, c, d, x[i], 7, -680876936);
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i], 20, -373897302);
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5_hh(d, a, b, c, x[i], 11, -358537222);
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i], 6, -198630844);
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return [a, b, c, d];
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr(input) {
var i,
output = '';
for (i = 0; i < input.length * 32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
}
return output;
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl(input) {
var i,
output = [];
output[(input.length >> 2) - 1] = undefined;
for (i = 0; i < output.length; i += 1) {
output[i] = 0;
}
for (i = 0; i < input.length * 8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
}
return output;
}
/*
* Calculate the MD5 of a raw string
*/
function rstr_md5(s) {
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstr_hmac_md5(key, data) {
var i,
bkey = rstr2binl(key),
ipad = [],
opad = [],
hash;
ipad[15] = opad[15] = undefined;
if (bkey.length > 16) {
bkey = binl_md5(bkey, key.length * 8);
}
for (i = 0; i < 16; i += 1) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input) {
//r16TD&*~12{]?[+3
//0123456789abcdef
var hex_tab = 'r16TD&*~12{]?[+3',
output = '',
x,
i;
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F) +
hex_tab.charAt(x & 0x0F);
}
return output;
}
/*
* Encode a string as utf-8
*/
function str2rstr_utf8(input) {
return unescape(encodeURIComponent(input));
}
/*
* Take string arguments and return either raw or hex encoded strings
*/
function raw_md5(s) {
return rstr_md5(str2rstr_utf8(s));
}
function hex_md5(s) {
return rstr2hex(raw_md5(s));
}
function raw_hmac_md5(k, d) {
return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));
}
function hex_hmac_md5(k, d) {
return rstr2hex(raw_hmac_md5(k, d));
}
function md5(string, key, raw) {
if (!key) {
if (!raw) {
return hex_md5(string);
}
return raw_md5(string);
}
if (!raw) {
return hex_hmac_md5(key, string);
}
return raw_hmac_md5(key, string);
}
export default { md5 }
//module.exports.default = module.exports;
+228
View File
@@ -0,0 +1,228 @@
import axios from '@/js_sdk/gangdiedao-uni-axios'
import global from '@/common/global.js'
//外部操作对象
const request = new Object();
//axios.default.baseURL = '/api'
// 创建自定义接口服务实例
const service = axios.create({
//baseURL: '',
timeout: 30000, // 不可超过 manifest.json 中配置 networkTimeout的超时时间
withCredentials: true,
headers: {
'Content-Type': 'application/json',
// 'Content-Type': 'application/x-www-form-urlencoded',
},
})
// 拦截器 在请求之前拦截
service.interceptors.request.use(config => {
config.baseURL = global.globalData.requestUrl;
let token = uni.getStorageSync('token');
if (token) {
config.headers.Authorization = "Bearer " + token;
}
console.log("config", config);
return config
})
// 响应后的拦截
service.interceptors.response.use(
(response) => {
return response
},
(error) => {
if (error.config && error.config.url) {
global.deleteReturnType(error.config.url);
}
if (error && error.response && error.response.status) {
let msg = error.message.toString().substr(0, 100)
let promiseError = new Error(msg)
promiseError.name = error.response.status
return Promise.reject(promiseError)
}
let msg = error.message.toString().substr(0, 100)
let promiseError = new Error(msg)
promiseError.name = "server"
return Promise.reject(promiseError)
})
request.service = service;
request.localPost = function(url, parmas, returnType){
let defaultType = "Data"
if (url) {
let fullUrl = global.globalData.requestUrl + url
if (returnType) {
defaultType = returnType
}
global.setReturnType(fullUrl, defaultType)
let promise = new Promise(function (resolve, reject) {
//做一些异步操作
service
.post(fullUrl, parmas)
.then((response) => {
console.log('response', response);
console.log('response', response.config);
console.log('response', response.config.url);
let dataType
if (response.config.url) {
dataType = global.getReturnType(response.config.url)
global.deleteReturnType(response.config.url)
}
if (!dataType) {
dataType = "Data"
}
let data = response.data
if (
data.ErrCode == 0 ||
data.StatusCode == 200 ||
data.Success
) {
if (dataType) {
if (dataType == "all") {
resolve(data)
} else {
resolve(data[dataType])
}
} else {
resolve(data.Data)
}
} else {
//后台反馈错误
let msg = response.message || data.Data || data.Message
msg = msg.toString().substr(0, 100)
let promiseError = new Error(msg)
promiseError.name = "api"
reject(promiseError)
}
})
.catch((err) => {
let ifLogin = uni.getStorageSync("ifLogin")
if (err.name == "401" && !tokenError && ifLogin) {
resolve(
request.login(
request.localPost,
url,
parmas,
returnType,
true
)
)
} else if (err.name == "401" && !tokenError) {
uni.hideLoading()
console.log("relaunch")
uni.navigateTo({ url: "/pages/myinfo/login/login" })
} else {
reject(err)
}
})
})
promise.catch((err) => {
uni.hideLoading()
})
return promise
}
}
request.localGet = function(url, parmas, returnType){
let defaultType = "data"
if (url) {
let fullUrl = global.globalData.requestUrl + url
if (returnType) {
defaultType = returnType
}
global.setReturnType(fullUrl, defaultType)
let promise = new Promise(function (resolve, reject) {
//做一些异步操作
service
.get(fullUrl, parmas)
.then((response) => {
let dataType
if (response.config.url) {
dataType = global.getReturnType(response.config.url)
global.deleteReturnType(response.config.url)
}
if (!dataType) {
dataType = "Data"
}
let data = response.data
if (
data.ErrCode == 0 ||
data.StatusCode == 200 ||
data.Success
) {
if (dataType) {
if (dataType == "all") {
resolve(data)
} else {
resolve(data[dataType])
}
} else {
resolve(data.Data)
}
} else {
//后台反馈错误
let msg = response.message || data.Data || data.Message
msg = msg.toString().substr(0, 100)
let promiseError = new Error(msg)
promiseError.name = "api"
reject(promiseError)
}
})
.catch((err) => {
let ifLogin = uni.getStorageSync("ifLogin")
if (err.name == "401" && !tokenError && ifLogin) {
resolve(
request.login(
request.localPost,
url,
parmas,
returnType,
true
)
)
} else if (err.name == "401" && !tokenError) {
uni.hideLoading()
uni.navigateTo({ url: "/pages/myinfo/login/login" })
} else {
reject(err)
}
})
})
promise.catch((err) => {
uni.hideLoading()
})
return promise
}
}
request.post = function(url, parmas, tokenError) {
return request.localPost(url, parmas, "Data", tokenError);
}
request.get = function(url, parmas, tokenError) {
return request.localGet(url, parmas, "Data", tokenError);
}
request.login = function(callback, url, parmas, returnType) {
let tokenParams = uni.getStorageSync('RequestToken');
return service.post('/Authentication/RequestToken', tokenParams)
.then(res => {
uni.setStorageSync('token',res.data.Data.token);
return callback(url, parmas, returnType, true);
});
}
export default request;
+101
View File
@@ -0,0 +1,101 @@
import axios from '@/js_sdk/gangdiedao-uni-axios'
import global from '@/common/global.js'
//axios.default.baseURL = '/api'
// 创建自定义接口服务实例
const servicex = axios.create({
//baseURL: '',
timeout: 30000, // 不可超过 manifest.json 中配置 networkTimeout的超时时间
withCredentials: true,
headers: {
// 'Content-Type': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
},
})
// 拦截器 在请求之前拦截
servicex.interceptors.request.use(config => {
config.baseURL = global.globalData.requestUrl;
let token = uni.getStorageSync('token');
if (token) {
config.headers.Authorization = "Bearer " + token;
}
console.log("config", config);
return config
})
// 响应后的拦截
servicex.interceptors.response.use(response => {
let returnType;
if (response.config.url) {
returnType = global.getReturnType(response.config.url);
global.deleteReturnType(response.config.url);
}
if (!returnType) {
returnType = "Data";
}
console.log("response", response || 'Error');
let data = response.data;
if (data.ErrCode == 0||data.StatusCode == 200) {
console.log("data.Data", data.Data);
// if (response.config.url=="http://192.168.0.3:3003/feeder/GetProductionLines"){
// return data;
// } else {
if (returnType) {
if (returnType == "all") {
return data;
}
return data[returnType];
}
return data.Data;
// }
}
else {
return Promise.reject(new Error(response.message||data.Data||data.Message))
}
}, error => {
if (error.config && error.config.url) {
global.deleteReturnType(error.config.url);
}
if (error && error.response && error.response.status) {
switch (error.response.status) {
case 401: //认证失败,清除token,重新登录
uni.setStorageSync('token', '');
uni.redirectTo({
url: '/pages/index/index'
});
break;
}
}
return Promise.reject(error.message);
})
servicex.localPost = function(url, parmas, returnType){
let myType = "data"
if (url) {
let myUrl = global.globalData.requestUrl + url;
if (returnType) {
myType = returnType;
}
global.setReturnType(myUrl, myType);
return servicex.post(myUrl, parmas);
}
}
servicex.localGet = function(url, parmas, returnType){
let myType = "data"
if (url) {
let myUrl = global.globalData.requestUrl + url;
if (returnType) {
myType = returnType;
}
global.setReturnType(myUrl, myType);
return servicex.get(myUrl, parmas);
}
}
export default servicex
+11
View File
@@ -0,0 +1,11 @@
function handle(){
let barcode = '';
uni.scanCode({
success:function(res){
let barcode = res.result
}
})
return barcode;
}
export default {handle}
+1447
View File
File diff suppressed because it is too large. Load diff
+82
View File
@@ -0,0 +1,82 @@
module.exports = {
removeLetter:function(str){
let result;
let reg = /[a-zA-Z]+/; //[a-zA-Z]表示匹配字母,g表示全局匹配
while (result = str.match(reg)) { //判断str.match(reg)是否没有字母了
str = str.replace(result[0], ''); //替换掉字母 result[0] 是 str.match(reg)匹配到的字母
}
return str;
},
judgeFloat:function(qty){
let checkQtyErrorFlag = true;
let reg = /\D/;
checkQtyErrorFlag = reg.test(qty);
if(checkQtyErrorFlag) {
let firstQty = qty.toString().substr(0,1);
checkQtyErrorFlag = reg.test(firstQty);
//防止非数字开头
if(!checkQtyErrorFlag) {
let replaceQty = qty.toString().replace(".", "");
checkQtyErrorFlag = reg.test(replaceQty);
}
}
//排除0000.1
if(!checkQtyErrorFlag) {
if (qty.toString().substr(0,1) == "0" && qty.toString().substr(1,1) != "."){
checkQtyErrorFlag = true;
}
}
//排除0...1
if(!checkQtyErrorFlag) {
if ((qty.toString().split('.')).length > 2){
checkQtyErrorFlag = true;
}
}
if(checkQtyErrorFlag) {
uni.showToast({
icon: "none",
title: "请输入正确的数量值",
duration: 3500,
})
return false;
}
//排除0...1
if(!checkQtyErrorFlag) {
if ((qty.toString().split('.')).length > 1){
if (qty.toString().split('.')[1].length > 6){
checkQtyErrorFlag = true;
}
}
}
if(checkQtyErrorFlag) {
uni.showToast({
icon: "none",
title: "小数位最多只能输入6位",
duration: 3500,
})
return false;
}
return true;
},
judgeInt:function(qty){
let checkQtyErrorFlag = true;
let reg = /\./;
checkQtyErrorFlag = reg.test(qty);
if(checkQtyErrorFlag) {
return false;
}
return true;
}
}