Commit 25214db1 by 肖康

仓库拍照

parents
# dependencies
**/node_modules
.idea
.DS_Store
# misc
npm-debug.log*
yarn-error.log
yarn.lock
package-lock.json
*bak
# visual studio code
.vscode
.history
*.log
functions/*
.temp/**
.eslintcache
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = {
"app": {
"$homepage": "pages/index/index"
}
};
if(!self.Map || !self.Set || !self.Symbol) {
importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
}
\ No newline at end of file
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/list/list?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/detail/detail?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
if(!self.__appxInited) {
self.__appxInited = 1;
require('./config$');
if( navigator.userAgent && (navigator.userAgent.indexOf('LyraVM') > 0 || navigator.userAgent.indexOf('AlipayIDE') > 0) ) {
var AFAppX = self.AFAppX.getAppContext ? self.AFAppX.getAppContext().AFAppX : self.AFAppX;
} else {
importScripts('https://appx/af-appx.worker.min.js');
var AFAppX = self.AFAppX;
}
self.getCurrentPages = AFAppX.getCurrentPages;
self.getApp = AFAppX.getApp;
self.Page = AFAppX.Page;
self.App = AFAppX.App;
self.my = AFAppX.bridge || AFAppX.abridge;
self.abridge = self.my;
self.Component = AFAppX.WorkerComponent || function(){};
self.$global = AFAppX.$global;
self.requirePlugin = AFAppX.requirePlugin;
if(AFAppX.registerApp) {
AFAppX.registerApp({
appJSON: appXAppJson,
});
}
function success() {
require('../../app');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/list/list?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/detail/detail?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = {
"app": {
"$homepage": "pages/index/index"
}
};
if(!self.Map || !self.Set || !self.Symbol) {
importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
}
importScripts(`https://appx/af-appx.worker.min.js`);
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/list/list?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/detail/detail?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=42)}({0:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var originalBridgeCall=self.AlipayJSBridge&&self.AlipayJSBridge.call,originalFetch=self.fetch,originImportScripts=self.importScripts,originEval="function"==typeof self.__eval?self.__eval:self.eval;exports.getUserAgent=function(){return navigator.swuserAgent||navigator.userAgent||""},exports.debug=console.log.bind(console),exports.checkIOS=function(){return/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(exports.getUserAgent())},exports.isLyra=function(){return Boolean(self.__LyraWSWorkerOrigin)},exports.callInternalAPI=function(e,t){var n={data:{method:e,param:t},action:"internalAPI"},o=encodeURIComponent(JSON.stringify(n));originalFetch?originalFetch("https://alipay.kylinBridge/?data="+o,{mode:"no-cors"}).then((function(){})).catch((function(){})):originalBridgeCall&&originalBridgeCall("internalAPI",{method:e,param:t})},exports.getStartupParams=function(){return self.__appxStartupParams&&self.__appxStartupParams.version?self.__appxStartupParams:self.AFAppX&&self.AFAppX.bridge&&self.AFAppX.bridge.callSync&&self.AFAppX.bridge.callSync("getStartupParams")||{}},exports.getBridge=function(){return self.AFAppX.bridge};var appxImported=!1,appxImportListener=[];exports.runAfterAppx=function(e){if(self.AFAppX)return appxImported=!0,void e();self.importScripts=function(e){originImportScripts(e),appxImported||"https://appx/af-appx.worker.min.js"!==e||(appxImported=!0,appxImportListener.forEach((function(e){return e()})),appxImportListener=[])},appxImportListener.push(e)},exports.evaluateScript=function(expression){return"function"==typeof eval?eval(expression):originEval(expression)}},10:function(e,t){
/*!
Copyright (C) 2013-2017 by Andrea Giammarchi - @WebReflection
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var n="\\x"+("0"+"~".charCodeAt(0).toString(16)).slice(-2),o="\\"+n,r=new RegExp(n,"g"),s=new RegExp(o,"g"),a=new RegExp("(?:^|([^\\\\]))"+o),i=[].indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},c=String;function u(e,t,n){return t instanceof Array?function(e,t,n){for(var o=0,r=t.length;o<r;o++)t[o]=u(e,t[o],n);return t}(e,t,n):t instanceof c?t.length?n.hasOwnProperty(t)?n[t]:n[t]=function(e,t){for(var n=0,o=t.length;n<o;e=e[t[n++].replace(s,"~")]);return e}(e,t.split("~")):e:t instanceof Object?function(e,t,n){for(var o in t)t.hasOwnProperty(o)&&(t[o]=u(e,t[o],n));return t}(e,t,n):t}var l={stringify:function(e,t,s,a){return l.parser.stringify(e,function(e,t,s){var a,c,u=!1,l=!!t,p=[],d=[e],f=[e],g=[s?"~":"[Circular]"],m=e,h=1;return l&&(c="object"==typeof t?function(e,n){return""!==e&&t.indexOf(e)<0?void 0:n}:t),function(e,t){return l&&(t=c.call(this,e,t)),u?(m!==this&&(a=h-i.call(d,this)-1,h-=a,d.splice(h,d.length),p.splice(h-1,p.length),m=this),"object"==typeof t&&t?(i.call(d,t)<0&&d.push(m=t),h=d.length,(a=i.call(f,t))<0?(a=f.push(t)-1,s?(p.push((""+e).replace(r,n)),g[a]="~"+p.join("~")):g[a]=g[0]):t=g[a]):"string"==typeof t&&s&&(t=t.replace(n,o).replace("~",n))):u=!0,t}}(e,t,!a),s)},parse:function(e,t){return l.parser.parse(e,function(e){return function(t,r){var s="string"==typeof r;return s&&"~"===r.charAt(0)?new c(r.slice(1)):(""===t&&(r=u(r,r,{})),s&&(r=r.replace(a,"$1~").replace(o,n)),e?e.call(this,t,r):r)}}(t))},parser:JSON};e.exports=l},2:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Connect="RemoteX.connect",e.Disconnect="RemoteX.disconnect",e.PageChanged="RemoteX.pageChanged",e.DataChanged="RemoteX.dataChanged",e.EvaluteScript="RemoteX.evaluteScript",e.syncStorage="RemoteX.syncStorage",e.requestWillBeSent="RemoteX.requestWillBeSent",e.requestFinished="RemoteX.requestFinished",e.Ping="RemoteX.ping",e.Pong="RemoteX.pong"}(t.RemoteXMethods||(t.RemoteXMethods={}))},42:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(43),r=n(46),s=n(0);s.runAfterAppx((function(){s.debug("[bugme] run after appx"),s.getStartupParams().isRemoteX||s.isLyra()?(s.debug("[bugme] remotex mode"),o.registerRemoteX()):(s.debug("[bugme] preview mode"),r.registerPreview())}))},43:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),r=n(0),s=n(44);t.registerRemoteX=function(){if(self.navigator){r.debug("[bugme] start to register remotex"),s.listenEvents(),o.SocketConn.open(),self.bugmeAPI={send:function(e){o.SocketConn.send(e)}};if(self.document&&self.document.dispatchEvent)try{self.document.dispatchEvent("bugmeInjected")}catch(e){self.document.dispatchEvent(new CustomEvent("bugmeInjected"))}else self.dispatchEvent&&self.dispatchEvent(new CustomEvent("bugmeInjected"))}}},44:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),r=n(0),s=n(9),a=n(45);function i(e){if(!e||"object"!=typeof e)return{};var t={};return Object.keys(e).forEach((function(n){t[n]=""+e[n]})),t}var c=/^https?:\/\/hpmweb\.alipay\.com/,u=function(e){c.test(e.url)||s.SocketConn.send({method:o.RemoteXMethods.requestWillBeSent,params:{reqId:e.requestId,url:e.url,method:(e.method||"GET").toUpperCase(),body:e.postBody,headers:i(e.headers)}})},l=function(e){c.test(e.url)||s.SocketConn.send({method:o.RemoteXMethods.requestFinished,params:{reqId:e.requestId,url:e.url,status:e.status,body:e.body,headers:i(e.headers)}})},p=function(e){c.test(e.url)||s.SocketConn.send({method:o.RemoteXMethods.requestFinished,params:{reqId:e.requestId,url:e.url,status:null}})},d=function(e){var t={};Object.keys(e.data).forEach((function(n){try{t[n]=JSON.parse(e.data[n]).APDataStorage}catch(e){}})),s.SocketConn.send({method:o.RemoteXMethods.syncStorage,params:{data:t}})};t.listenEvents=function(){var e=r.getBridge();e.on(a.ERiverWorkerEvent.PageResume,(function(){s.SocketConn.send({method:o.RemoteXMethods.PageChanged})})),e.on(a.ERiverWorkerEvent.DebugPanelClick,(function(){s.SocketConn.close()})),r.checkIOS()&&!r.isLyra()?(e.on(a.ERiverDebugEvent.networkRequest,(function(e){var t=e.data;u(t)})),e.on(a.ERiverDebugEvent.networkResponse,(function(e){var t=e.data;l(t)})),e.on(a.ERiverDebugEvent.networkError,(function(e){var t=e.data;p(t)})),e.on(a.ERiverDebugEvent.storageChanged,(function(e){var t=e.data;d(t)}))):e.on(a.ERiverDebugEvent.debugConsole,(function(e){var t,n=e.data,o=n.type,r=n.content;try{t=JSON.parse(r)}catch(e){return}switch(o){case a.ERiverDebugEvent.networkRequest:u(t);break;case a.ERiverDebugEvent.networkResponse:l(t);break;case a.ERiverDebugEvent.networkError:p(t);break;case a.ERiverDebugEvent.storageChanged:d(t)}}))}},45:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.networkRequest="tinyAppRemoteDebug_network_request",e.networkResponse="tinyAppRemoteDebug_network_response",e.networkError="tinyAppRemoteDebug_network_error",e.storageChanged="tinyAppRemoteDebug_storage",e.debugConsole="onTinyDebugConsole",e.vconsoleMessage="onMessageFromVConsole"}(t.ERiverDebugEvent||(t.ERiverDebugEvent={})),function(e){e.PageResume="pageResume",e.DebugPanelClick="tinyRemoteDebugPanelButtonClick"}(t.ERiverWorkerEvent||(t.ERiverWorkerEvent={}))},46:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),r=n(0),s=function(e,t){return void 0===t?"©undefined":null===t?"©null":t===-1/0?"©- Infinity":t===1/0?"©Infinity":"number"==typeof t&&isNaN(t)?"©NaN":"function"==typeof t?"©function":t},a=Function,i=function(e){try{if(e.fromVConsoleToWorker){var t=e.requestId;if("exec"===e.method){try{new a("requestId","sendBack","var res = "+e.script+";console.log(res);")(t,(function(e){return r.callInternalAPI("tinyDebugConsole",{type:"msgFromWorkerToVConsole",content:o.stringify({requestId:t,returnValue:e},s)})}))}catch(e){console.error(e.name+":"+e.message)}}}}catch(e){}};t.registerPreview=function(){setTimeout((function(){self.document?self.document.addEventListener("push",(function(e){try{var t=e.data.param;i(JSON.parse(t.content||t.data.content))}catch(e){}})):self.addEventListener&&self.addEventListener("push",(function(e){try{var t=JSON.parse(JSON.parse(e.data.text()).param.data.content);i(t)}catch(e){}}))}),10),["log","info","error","debug","warn"].forEach((function(e){var t="o"+e;console[t]||(console[t]=console[e],console[e]=function(){for(var n,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];console[t].apply(console,a);try{n=o.stringify(a.map((function(e){return e instanceof Error?e.name+": "+e.message:e})),s)}catch(e){return void console.error(e.name+": "+e.message)}r.callInternalAPI("tinyDebugConsole",{content:n,type:"console_"+e})})}))}},9:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),r=n(0),s=n(2),a=function(){r.getBridge().call("showRemoteDebugPanel",{status:"connecting",text:"远程调试准备中",buttonTitle:"退出"})},i=function(){r.getBridge().call("showRemoteDebugPanel",{status:"connected",text:"远程调试已连接",buttonTitle:"退出"})},c=function(){r.getBridge().call("showRemoteDebugPanel",{status:"disconnected",text:"远程调试已断开",buttonTitle:"退出"})};t.SocketConn={messageQueue:[],socketTask:null,send:function(e){var t=this,n="string"==typeof e?e:JSON.stringify(e);n.length>5242880?r.debug("[bugme] socket send failed, size: ",n.length):this.socketTask?(this.messageQueue.length&&(this.messageQueue.forEach((function(e){t.socketTask.send({data:e})})),this.messageQueue=[]),this.socketTask.send({data:n})):this.messageQueue.push(n)},close:function(){this.socketTask?this.socketTask.close():r.getBridge().showToast({content:"请点击右上角关闭按钮退出",duration:1e3})},connect:function(e){var t=this,n=r.getBridge(),o=n.connectSocket({url:e,multiple:!0});o.onOpen((function(){t.socketTask=o,t.onopen(),r.debug("[bugme] websocket connected")})),o.onMessage((function(e){t.onmessage(e)})),o.onClose((function(){t.onclose()})),o.onError((function(){t.socketTask||(c(),n.showToast({content:"本次真机调试已结束,请重新生成调试版本",duration:2e3}))}))},open:function(){var e=this,t=r.getStartupParams(),n=t.channelId,o=t.channelAuthPair,s=self.__LyraWSWorkerOrigin;if(n||s){a();var i=r.getBridge(),c=s?s+"/worker":"wss://openchannel.alipay.com/host/"+n;if(o&&(c+="?"+o.key+"="+o.value),r.checkIOS()&&!r.isLyra()){this.connect(c);var u=i.connectSocket;i.connectSocket=function(e){if(e&&e.multiple)return u(e);i.showToast({content:"iOS 真机调试暂不支持 connectSocket JSAPI",duration:1e3})},i.onSocketOpen=i.offSocketOpen=i.onSocketMessage=i.offSocketMessage=i.closeSocket=function(){}}else setTimeout((function(){e.connect(c)}),1200)}else r.debug("[bugme] missing channelId in startup params")},onopen:function(){var e=r.getBridge(),t=e.getSystemInfoSync();this.send({method:s.RemoteXMethods.Connect,params:{userAgent:r.getUserAgent(),sdkVersion:e.SDKVersion,alipayVersion:t.version,model:t.model,system:t.system}}),i()},onmessage:function(e){try{var t=JSON.parse(e.data.data),n=t.method,a=t.id,i=t.params;if(n===s.RemoteXMethods.Disconnect)this.close();else if(n===s.RemoteXMethods.EvaluteScript){if(i&&i.code)try{var c=r.evaluateScript(i.code);this.send({returnId:a,payload:o.stringify(c)})}catch(e){r.debug("[remoteX worker evaluateScript] ",e)}}else n===s.RemoteXMethods.Ping&&this.send({method:s.RemoteXMethods.Pong,params:{returnId:a}})}catch(t){r.debug("RemoteX onSocketMessage error",t,e)}},onclose:function(){this.socketTask=null,this.messageQueue=[],c(),[1,2].forEach((function(e){r.getBridge().call("closeSocket",{socketTaskId:e})}))}}}});
if(!self.__appxInited) {
self.__appxInited = 1;
require('./config$');
require('./importScripts$');
var AFAppX = self.AFAppX;
self.getCurrentPages = AFAppX.getCurrentPages;
self.getApp = AFAppX.getApp;
self.Page = AFAppX.Page;
self.App = AFAppX.App;
self.my = AFAppX.bridge || AFAppX.abridge;
self.abridge = self.my;
self.Component = AFAppX.WorkerComponent || function(){};
self.$global = AFAppX.$global;
self.requirePlugin = AFAppX.requirePlugin;
if(AFAppX.registerApp) {
AFAppX.registerApp({
appJSON: appXAppJson,
});
}
function success() {
require('../../app');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/list/list?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
require('../../pages/detail/detail?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
const host = 'http://www.photo.com:8000';//开发环境
//const host = '172.18.137.41:8001';//线上环境
const axios = ({ method = 'GET', url, data = {}, isLoading = true }) => {
let url_ = host + url;
isLoading &&
dd.showLoading({
content: '加载中...',
});
return new Promise((resolve, reject) => {
dd.httpRequest({
url: url_,
method: method,
data: data,
success: function (res) {
isLoading && dd.hideLoading();
resolve(res)
},
fail: function (err) {
isLoading && dd.hideLoading();
dd.showToast({
type: 'fail',
content: '服务器异常'
});
reject('服务器异常')
}
});
})
}
export default axios
\ No newline at end of file
.header{
padding:0 10rpx ;
}
.header .box-h{
height:80rpx;
display: flex;
align-items: center;
border-bottom:1rpx solid #ccc;
}
App({
onLaunch(options) {
// 第一次打开
// options.query == {number:1}
console.info('App onLaunch');
},
onShow(options) {
// 从后台被 scheme 重新打开
// options.query == {number:1}
},
personName: "仓库管理员"
});
{
"pages": [
"pages/index/index",
"pages/list/list",
"pages/detail/detail"
],
"window": {
"defaultTitle": "仓库拍照扫码系统"
}
}
.list-box{
padding:10rpx 30rpx;
display: flex;
align-items: center;
}
.list-box .t2{
flex:2;
}
.list-box input{
border:1px solid #ccc;
flex:2;
height:60rpx;
border-radius: 10rpx;
background: #f3f3f3;
}
.list-box2 input{
background:rgba(255,255,255,0);
}
.list-box .tl{
flex:1;
}
.list-box view{
flex:1;
height:60rpx;
line-height: 60rpx;
text-align: center;
cursor: pointer;
background: #319cd8;
border-radius: 10rpx;
color:#fff;
margin-left: 10rpx;
}
.list-box2 view{
background: none;
}
.detail-list{
padding:30rpx;
}
.detail-list .group{
border-bottom:1px solid #ccc;
font-size: 28rpx;
}
.detail-list .group.d{
background: yellow
}
.detail-list .group.y{
background: green;
}
.detail-list .group .g-t{
height:40rpx;
line-height: 40rpx;
}
.detail-list .group .g-c{
display: flex;
}
.detail-list .group .g-c-l{
flex:2;
height:80rpx;
line-height: 80rpx;
}
.detail-list .group .g-c-r view{
height:40rpx;
line-height: 40rpx;
text-align: left;
}
.detail-list .group .g-c-r{
flex:1;
text-align: center;
}
.detail-list .group .g-b{
height:110rpx;
}
.detail-list .group .g-b .imgs{
width:100rpx;
height:100rpx;
margin-right: 20rpx;
float: left;
}
\ No newline at end of file
<include src="../public/header/header.axml"/>
<view class="list-box">
<text>出库单号:</text>
<input onInput="bindKeyInput" value="{{inputValue}}" disabled="true"/>
<view onTap="submitGo">整单提交</view>
</view>
<view class="list-box list-box2">
<text class="tl">明细扫码:</text>
<text onTap="saoma" class="t2">
<input placeholder="点击输入框扫码" disabled="true"/>
</text>
<view ></view>
</view>
<view class="detail-list">
<view hidden="{{item.order_info.isShow ? false : true}}" class="group {{(item.order_info.scanqty==0)?'':(item.order_info.qty==item.order_info.scanqty)?'y':'d'}}" a:for="{{list}}">
<view class="g-t">
{{item.order_info.materialname}}
</view>
<view class="g-c">
<view class="g-c-l">
{{item.order_info.brand }}
</view>
<view class="g-c-r">
<view>数量:{{item.order_info.qty}}</view>
<view>已扫描:{{item.order_info.scanqty}}</view>
</view>
</view>
<view class="g-b" >
<image src="{{item.image_src}}" class="imgs" a:for="{{item.order_info.order_image_info}}"/>
</view>
</view>
</view>
\ No newline at end of file
import axios from '../../api'
Page({
data: {
inputValue: "",
inputValue2: "",
detailId: "",
personName: "",
list: [],
detailImages: []
},
onLoad(query) {
// 页面加载
this.setData({
inputValue: query.data
})
this.getDateList()
},
onReady() {
// 页面加载完成
this.setData({
personName: getApp().personName
})
},
getDateList() {
axios({
url: "/photo_taking/get_order_info/" + this.data.inputValue
}).then(res => {
res.data.data.forEach((item) => {
item.order_info.isShow = 1
});
this.setData({
list: res.data.data
})
})
},
getSaoMaId(code) {
axios({
url: "/photo_taking/scan_order_detail/" + this.data.inputValue + "/" + code
}).then(res => {
//请求得到的ID值
let detail_id = res.data.data;
this.data.list.forEach((item) => {
if (item.order_info.id == detail_id) {
item.order_info.isShow = 1
} else {
item.order_info.isShow = 0
}
});
this.setData({
list: this.data.list,
detailId: detail_id
})
this.subMxActionShee()
}).catch(err=>{
console.log(err)
})
},
saoma() {
dd.scan({
type: 'qr',
success: (res) => {
let code_=encodeURI(res.code)
this.setData({
inputValue2: code_
});
this.getSaoMaId(code_)
}
});
},
clear() {
//提交成功 取消
this.data.list.forEach((item) => {
item.order_info.isShow = 1
});
this.setData({
inputValue2: "",
detailImages: "",
list: this.data.list
});
},
submitDetail() {
console.log(
{
id: this.data.detailId,
scan_str: this.data.inputValue2,
image_src: (this.data.detailImages.join(","))
}
)
axios({
url: "/photo_taking/add_order_image",
method: "POST",
data: {
id: this.data.detailId,
scan_str: this.data.inputValue2,
image_src: (this.data.detailImages.join(","))
}
}).then(res => {
if (res.code == 0) {
console.log(res)
dd.showToast({
type: 'success',
content: '扫码明细提交成功',
duration: 3000
});
//提交成功
this.clear();
this.getDateList();
}
})
},
subMxActionShee() {
//提交明细
dd.showActionSheet({
items: ['提交', '拍照'],
cancelButtonText: '取消',
success: (res) => {
if (res.index == 0) {
this.submitDetail()
} else if (res.index == 1) {
//拍照
dd.chooseImage({
count: 10,
success: (res) => {
console.log(res.filePaths)
this.setData({
detailImages: [...this.data.detailImages, ...res.filePaths]
});
console.log(this.data.detailImages)
this.subMxActionShee();
},
});
} else {
this.clear()
}
}
});
},
bindKeyInput(e) {
this.setData({
inputValue: e.detail.value,
});
},
bindKeyInput2(e) {
this.setData({
inputValue2: e.detail.value,
});
},
submitGo() {
//提交
axios({
url: "/photo_taking/submit_order/" + this.data.inputValue
}).then(res => {
if (res.code == 0) {
dd.showToast({
type: 'success',
content: '整单提交成功',
duration: 3000
});
setTimeout(() => {
dd.navigateTo({
url: '/pages/index/index'
})
}, 500)
} else {
dd.showToast({
type: 'fail',
content: res.data,
duration: 3000
});
}
})
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: '仓库拍照扫码系统',
desc: '猎芯网内部使用',
path: 'pages/index/index',
};
},
});
{}
\ No newline at end of file
.store-box{
padding:30rpx;
padding-top: 300rpx;
}
.saoma-btn{
margin:0 auto;
width:400rpx;
height:200rpx;
border:1rpx solid #ccc;
background: #f3f3f3;
border-radius: 10rpx;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size:32rpx;
}
\ No newline at end of file
<include src="../public/header/header.axml"/>
<view class="store-box">
<view class="saoma-btn" onTap="gotoList">
扫码拍照
</view>
</view>
Page({
data: {
page:1,
personName:""
},
onLoad(query) {
// 页面加载
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
},
onReady() {
// 页面加载完成
this.setData({
personName: getApp().personName
})
},
gotoList(){
dd.navigateTo({
url: '/pages/list/list'
})
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: '仓库拍照扫码系统',
desc: '猎芯网内部使用',
path: 'pages/index/index',
};
},
});
{}
\ No newline at end of file
.list-box{
padding:30rpx;
display: flex;
align-items: center;
}
.list-box input{
border:1px solid #ccc;
height:60rpx;
border-radius: 10rpx;
}
.list-box .inputbox{
flex:2;
}
.list-box text{
flex:1;
}
.list-box .bl{
flex:1;
height:60rpx;
line-height: 60rpx;
text-align: center;
cursor: pointer;
background: #319cd8;
border-radius: 10rpx;
color:#fff;
margin-left: 10rpx;
}
\ No newline at end of file
<include src="../public/header/header.axml"/>
<view class="list-box">
<text>出库单号:</text>
<view class="inputbox" onTap="saoma">
<input placeholder="点击输入框扫码" onInput="bindKeyInput"/>
</view>
<view class="bl" onTap="gotoDetail">锁定</view>
</view>
\ No newline at end of file
Page({
data: {
inputValue: "",
personName: ""
},
onLoad(query) {
// 页面加载
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
},
onReady() {
// 页面加载完成
this.setData({
personName: getApp().personName
})
},
saoma() {
dd.scan({
type: 'bar',
success: (res) => {
this.setData({
inputValue: (res.code.split("|")[0]),
});
this.gotoDetail()
},
});
},
bindKeyInput(e) {
this.setData({
inputValue: e.detail.value,
});
},
gotoDetail() {
let val = this.data.inputValue
if (val) {
dd.navigateTo({
url: '/pages/detail/detail?data=' + this.data.inputValue
})
} else {
dd.showToast({
type: 'fail',
content: '单号不能为空',
duration: 3000
});
}
},
onShow() {
// 页面显示
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
},
onReachBottom() {
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: '仓库拍照扫码系统',
desc: '猎芯网内部使用',
path: 'pages/index/index',
};
},
});
{}
\ No newline at end of file
<view class="header">
<view class="box-h">
当前操作人员:{{personName}}
</view>
</view>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment