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

仓库/箱码

parent 21fc7d2c
;(function() { ;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null let ENV_VAR = null
let VERSION_NUMBER = 'v1.5.6' //版本号 let VERSION_NUMBER = 'v1.5.7' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
...@@ -220,6 +220,9 @@ let orderApiFun = function(vm){ ...@@ -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 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 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 = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -279,7 +282,8 @@ let orderApiFun = function(vm){ ...@@ -279,7 +282,8 @@ let orderApiFun = function(vm){
workerDealWithError, workerDealWithError,
association, association,
getWorkerData, getWorkerData,
getOrderTime getOrderTime,
parsingScanCode
} }
return orderApi return orderApi
} }
......
...@@ -3,25 +3,17 @@ ...@@ -3,25 +3,17 @@
<view class=""> <view class="">
<view class="u-flex" @click="scanCode"> <view class="u-flex" @click="scanCode">
<view class="txt u-flex-1"> <view class="txt u-flex-1">
<text v-if="item.fieldsTitle==='充电桩箱体二维码'">扫描二维码</text> <text v-if="item.fieldsTitle === '充电桩箱体二维码'">扫描二维码</text>
<text v-else>扫描二维码(仅挚达充电桩可扫描)</text> <text v-else>扫描二维码(仅挚达充电桩可扫描)</text>
</view> </view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
<view class="u-flex"> <view class="u-flex"><u-input class="u-flex-1 input-item" v-model="dataValue" @input="valueChange" type="text" :disabled="disabled" /></view>
<u-input
class="u-flex-1 input-item"
v-model="dataValue"
@input="valueChange"
type="text"
:disabled="disabled"
/>
</view>
</view> </view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin';
export default { export default {
name: 'XhScan', name: 'XhScan',
components: {}, components: {},
...@@ -29,30 +21,47 @@ export default { ...@@ -29,30 +21,47 @@ export default {
props: {}, props: {},
filters: {}, filters: {},
data() { data() {
return {} return {};
}, },
computed: {}, computed: {},
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
scanCode(type) { scanCode(type) {
if (this.disabled) return if (this.disabled) return;
const self = this const self = this;
uni.scanCode({ uni.scanCode({
success: function(res) { success: res => {
let result = res.result let result = res.result.substring(0,200);
if (self.item.fieldsTitle === '充电桩箱体二维码') {
self.dataValue = result;
self.parsingCode(result);
} else {
if (result.substring(0, 4) === 'http') { if (result.substring(0, 4) === 'http') {
let arr = result.split('/#/') let arr = result.split('/#/');
if (arr.length < 2) arr = result.split('?') if (arr.length < 2) arr = result.split('?');
result = arr[1] result = arr[1];
} }
self.dataValue = result self.dataValue = result;
self.valueChange(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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.required { .required {
......
...@@ -409,25 +409,43 @@ ...@@ -409,25 +409,43 @@
} }
} }
,{ , {
"path" : "warehouse/receiveDetail", "path": "warehouse/receiveDetail",
"style" : "style": {
{
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "收货", "navigationBarTitleText": "收货",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "warehouse/inventoryDetail",
"path" : "warehouse/inventoryDetail", "style": {
"style" :
{
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "盘点", "navigationBarTitleText": "盘点",
"enablePullDownRefresh": false "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 { ...@@ -137,6 +137,13 @@ export default {
value: '', value: '',
icon: 'liulanjilu.png', icon: 'liulanjilu.png',
imageStyle: 'width:34rpx;height:32rpx' 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 { ...@@ -80,12 +80,30 @@ export default {
console.log('类型:' + scanType); console.log('类型:' + scanType);
console.log('内容:' + result); console.log('内容:' + result);
if (scanType === 'QR_CODE') { if (scanType === 'QR_CODE') {
this.dataValue = result.substring(0,200); let dataValue = result.substring(0,200);
this.$emit("onScanCodeChange",this.dataValue) 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) { valueChange(e) {
this.$emit("onScanCodeChange",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