Commit 1fbd67ab authored by 刘文虎's avatar 刘文虎

仓库/箱码

parent 21fc7d2c
;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null
let VERSION_NUMBER = 'v1.5.6' //版本号
let VERSION_NUMBER = 'v1.5.7' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') {
......
......@@ -220,6 +220,9 @@ let orderApiFun = function(vm){
let getWorkerData = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + `/getWorkerData`, params)
let getOrderTime = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + `/getOrderTime/${params.id}`, params)
// 完工-安装信息-充电桩信息-验证箱体二维码
let parsingScanCode = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/parts/' + vm.vuex_token + `/take/stock/parsing/code`, params)
const orderApi = {
listByRecommendOrder,
listOrderCount,
......@@ -279,7 +282,8 @@ let orderApiFun = function(vm){
workerDealWithError,
association,
getWorkerData,
getOrderTime
getOrderTime,
parsingScanCode
}
return orderApi
}
......
......@@ -3,25 +3,17 @@
<view class="">
<view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">
<text v-if="item.fieldsTitle==='充电桩箱体二维码'">扫描二维码</text>
<text v-if="item.fieldsTitle === '充电桩箱体二维码'">扫描二维码</text>
<text v-else>扫描二维码(仅挚达充电桩可扫描)</text>
</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
<view class="u-flex">
<u-input
class="u-flex-1 input-item"
v-model="dataValue"
@input="valueChange"
type="text"
:disabled="disabled"
/>
</view>
<view class="u-flex"><u-input class="u-flex-1 input-item" v-model="dataValue" @input="valueChange" type="text" :disabled="disabled" /></view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
import stringMixin from './stringMixin';
export default {
name: 'XhScan',
components: {},
......@@ -29,30 +21,47 @@ export default {
props: {},
filters: {},
data() {
return {}
return {};
},
computed: {},
watch: {},
mounted() {},
methods: {
scanCode(type) {
if (this.disabled) return
const self = this
if (this.disabled) return;
const self = this;
uni.scanCode({
success: function(res) {
let result = res.result
success: res => {
let result = res.result.substring(0,200);
if (self.item.fieldsTitle === '充电桩箱体二维码') {
self.dataValue = result;
self.parsingCode(result);
} else {
if (result.substring(0, 4) === 'http') {
let arr = result.split('/#/')
if (arr.length < 2) arr = result.split('?')
result = arr[1]
let arr = result.split('/#/');
if (arr.length < 2) arr = result.split('?');
result = arr[1];
}
self.dataValue = result
self.valueChange(result)
},
})
},
self.dataValue = result;
self.valueChange(result);
}
}
});
},
}
async parsingCode(code) {
try {
let res = await this.$u.api.parsingScanCode({ code });
this.valueChange(res.data);
} catch (e) {
//TODO handle the exception
uni.showToast({
icon: 'none',
title: '二维码验证失败'
});
}
}
}
};
</script>
<style lang="scss" scoped>
.required {
......
......@@ -409,25 +409,43 @@
}
}
,{
"path" : "warehouse/receiveDetail",
"style" :
{
, {
"path": "warehouse/receiveDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "收货",
"enablePullDownRefresh": false
}
}
,{
"path" : "warehouse/inventoryDetail",
"style" :
{
}, {
"path": "warehouse/inventoryDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "盘点",
"enablePullDownRefresh": false
}
}, {
"path": "about/about",
"style": {
"navigationBarTitleText": "关于",
"enablePullDownRefresh": false
}
}, {
"path": "about/user-agreement/user-agreement",
"style": {
"navigationBarTitleText": "用户协议",
"enablePullDownRefresh": false
}
}, {
"path": "about/privacy-agreement/privacy-agreement",
"style": {
"navigationBarTitleText": "隐私协议",
"enablePullDownRefresh": false
}
}
]
},
......
......@@ -137,6 +137,13 @@ export default {
value: '',
icon: 'liulanjilu.png',
imageStyle: 'width:34rpx;height:32rpx'
},
{
pathName: 'about/about',
title: '关于',
value: '',
icon: 'wodeziliao.png',
imageStyle: 'width:32rpx;height:32rpx'
}
],
[
......
<template>
<!-- 设置 -->
<view class="setting-view">
<!-- <u-navbar back-icon-color="#333333" background="#FFFFFF" title="设置" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar> -->
<view class="list-view">
<u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index">
<u-cell-item value="" :border-bottom="false" @click="handleClick(item.pathName)">
<view slot="title" class="item-title">{{item.title}}</view>
</u-cell-item>
</view>
</u-cell-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
computed: {
items() {
return [
{
pathName: 'about/user-agreement/user-agreement',
title: '用户协议',
},
{
pathName: 'about/privacy-agreement/privacy-agreement',
title: '隐私协议',
},
]
}
},
onLoad() {
getApp().trackPage('关于')
},
methods: {
handleClick(path) {
if(this.vuex_token) {
this.$u.route({
url: 'pages/mine/' + path
})
} else {
this.$u.route({url: "pages/login/index"})
}
},
}
};
</script>
<style lang="scss" scoped>
.setting-view {
padding-bottom: 44px;
height: 100vh;
display: flex;
flex-direction: column;
background-color: #F4F5F7;
.list-view {
height: 100%;
margin-top: 30rpx;
.item-title {
font-size: 32rpx;
color: #333333;
line-height: 32rpx;
}
.item-value {
font-size: 26rpx;
color: #999999;
}
.line-view {
height: 2rpx;
background-color: #F4F5F7;
margin: 30rpx;
}
}
}
</style>
This diff is collapsed.
This diff is collapsed.
......@@ -80,12 +80,30 @@ export default {
console.log('类型:' + scanType);
console.log('内容:' + result);
if (scanType === 'QR_CODE') {
this.dataValue = result.substring(0,200);
this.$emit("onScanCodeChange",this.dataValue)
let dataValue = result.substring(0,200);
this.parsingCode(dataValue)
}else{
uni.showToast({
icon:"none",
title:"二维码错误"
})
}
}
});
},
async parsingCode(code){
try{
let res=await this.$u.api.parsingScanCode({code})
this.dataValue=res.data
this.$emit("onScanCodeChange",this.dataValue)
}catch(e){
//TODO handle the exception
uni.showToast({
icon:"none",
title:"二维码验证失败"
})
}
},
valueChange(e) {
this.$emit("onScanCodeChange",e)
}
......
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 to comment