Commit 5fce9aaf by liangjianmin

fix(app): 在生产环境检查应用更新并优化首页功能入口

- App.vue中添加ENV变量判断,只在生产环境执行版本检查逻辑
- index.vue中添加ENV变量判断,测试环境跳过更新检查,避免不必要请求
- 注释并隐藏首页“按容器上架”入口,优化UI布局
- 维护首页导航功能,更新版本检查逻辑,确保用户获取最新应用版本提示
- 优化版本检查流程,确保拉取版本信息后正确更新UI弹窗及提示
- 细节调整,提高代码健壮性及用户体验
parent 4dc9d3cc
<script>
import { API } from '@/util/api.js';
import { API, ENV } from '@/util/api.js';
export default {
onLaunch: function() {
},
onShow: function() {
if (ENV !== 'production') return;
var wms_version = uni.getStorageSync('wms_version') || '';
this.request(API.getLatestAppInfo, 'POST', {}, false).then(res => {
if (res.code === 0) {
......
......@@ -28,12 +28,12 @@
</view>
<text class="text">理货</text>
</navigator>
<navigator class="box-li column rowCenter verCenter" url="/pages/putaway/pack" hover-class="none">
<!-- <navigator class="box-li column rowCenter verCenter" url="/pages/putaway/pack" hover-class="none">
<view class="box row rowCenter verCenter">
<image src="/static/home/@2x(8).png"></image>
</view>
<text class="text">按容器上架</text>
</navigator>
</navigator> -->
<navigator class="box-li column rowCenter verCenter" url="/pages/putaway/index" hover-class="none">
<view class="box row rowCenter verCenter">
<image src="/static/home/@2x(8).png"></image>
......@@ -117,7 +117,7 @@
</template>
<script>
import { API } from '@/util/api.js';
import { API, ENV } from '@/util/api.js';
import { compareVersion } from '@/util/util.js';
import UpdateModal from '@/components/UpdateModal.vue';
......@@ -154,9 +154,13 @@
});
},
/**
* 检查应用更新
* 检查应用更新,测试环境跳过
*/
checkAppUpdate() {
if (ENV !== 'production') {
uni.stopPullDownRefresh();
return;
}
// #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, (info) => {
var localVersion = info.version || '1.0.0';
......
......@@ -26,20 +26,6 @@
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text>
</view>
</view>
<!-- 容器选择 -->
<view class="search-box row bothSide verCenter" :class="{ 'error-style': !is_submit }">
<view class="text">容 器</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入容器编码" placeholder-style="color:#919399" v-model="searchParams.container_name" @input="handleInput(4, $event)" />
</view>
<view>
<text class="iconfont icon-juxing3" @click="createTallyContainer()"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_contaion"></text>
</view>
</view>
</view>
<!-- 详情 -->
<view class="section">
<view class="field-item row" v-if="detail">
......@@ -382,7 +368,7 @@
<text class="check-box-icon" :class="{ curr: is_batch_flag }"></text>
<text class="text">按标准包装量分批</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }" style="width: 30%;">理 货</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" style="width: 30%;">理 货</view>
</template>
<!-- 无标准包装量 -->
<template v-else>
......@@ -398,7 +384,7 @@
</view>
</picker>
</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }">理 货</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive">理 货</view>
</template>
</template>
<!-- 非深圳自营- -->
......@@ -407,7 +393,7 @@
<text class="check-box-icon" :class="{ curr: print_flag }"></text>
<text class="text">打印入库标签</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }" style="width: 60%;">理 货</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive" style="width: 60%;">理 货</view>
</template>
</view>
</view>
......@@ -427,7 +413,6 @@
is_print: false, //查询该销售单是否需要打印客户标签
coo: '', //产地
cod: '', //COD
is_submit: true,
stock_in_item_id: '',
stock_in_id: '',
noexebshowFalg: true, //控制是否会触发生命周期
......@@ -435,7 +420,6 @@
pic_flag: false, //是否整单照片
is_batch_flag: false, //是否分批理货
input_flag: false,
input_contaion: false,
company_id: uni.getStorageSync('company_id') || 1, //公司组织
page: 1,
limit: 1,
......@@ -444,9 +428,7 @@
item: ['货品信息', '其他信息'],
print_style: ['基本样式', '不带D/C'],
print_style_index: 0,
indexContainer: -1,
array: ['物流单号', '入库单号', '入仓号'],
tallyContainer: [], //容器列表
detail: {}, //详情的数据
image_list: [], //本地图片路径列表
server_image_list: [], //服务器图片路径列表
......@@ -471,9 +453,7 @@
searchParams: {
stock_in_sn: '', //入库单号
tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '', //入仓单号
container_name: '', //容器编码
container_id: '' //容器id
stock_in_with_stock_in_items_inhouse: '' //入仓单号
},
date_code_format: '',//日期转DC格式
formParams: {
......@@ -495,8 +475,6 @@
onLoad(options) {
this.stock_in_item_id = options.stock_in_item_id || '';
this.stock_in_id = options.stock_in_id || '';
this.searchParams.container_name = options.container_name || '';
this.searchParams.container_id = options.container_id || '';
//快速扫描
this.fastParams.flag = options.flag;
this.fastParams.qty = Number(options.qty) || '';
......@@ -616,39 +594,10 @@
this.input_flag = false;
this.stock_in_item_id = this.detail.stock_in_item_id;
this.clearInputAndFocus(); //再次获取焦点
} else {
//容器以及一键理货里面的容器
this.input_contaion = false;
this.searchParams.container_name = '';
this.searchParams.container_id = '';
}
this.getData();
},
/**
*刷新容器
*/
createTallyContainer(type) {
if (type == 1) {
var params = {
is_mac: 1
};
} else {
var params = {};
}
this.request(API.createTallyContainer, 'GET', params, false).then(res => {
if (res.code === 0) {
this.is_submit = true;
this.searchParams.container_name = res.data.container_sn;
this.searchParams.container_id = res.data.id;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 单号搜索
* @param {Object} event
*/
......@@ -682,18 +631,11 @@
this.searchParams.stock_in_with_stock_in_items_inhouse = val;
this.input_flag = true;
this.getData();
} else if (type == 4) {
//容器
this.searchParams.container_name = val;
this.input_contaion = true;
this.getTallyContainer();
}
} else {
if (type == 1 || type == 2 || type == 3) {
this.input_flag = false;
this.getData();
} else if (type == 4) {
this.input_contaion = false;
}
}
}, 500),
......@@ -803,36 +745,6 @@
});
},
/**
* 获取容器列表数据
*/
getTallyContainer() {
this.request(API.getTallyContainer, 'GET', {}, false).then(res => {
if (res.code === 0) {
var name = this.searchParams.container_name;
this.is_submit = res.data.list.some(function (obj) {
return obj.name === name;
});
if (this.is_submit) {
var id = res.data.list.filter(function (item) {
if (item.name == name) {
return {
id: item.id
};
}
});
this.searchParams.container_id = id[0].id;
} else {
this.searchParams.container_id = '';
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 选择图片
*/
chooseImageChange() {
......@@ -942,15 +854,6 @@
* 理货提交
*/
createTallyReceive() {
// 现在需求是都去掉容器必填的验证
if (!this.is_submit) {
uni.showToast({
title: '请输入正确容器',
icon: 'error'
});
return false;
}
if (!this.formParams.tally_qty) {
uni.showModal({
itle: '提示',
......@@ -1034,7 +937,6 @@
}
var params = {
container_id: this.searchParams.container_id,
stock_in_id: this.stock_in_id,
stock_in_item_id: this.stock_in_item_id,
tally_qty: this.formParams.tally_qty,
......
......@@ -465,5 +465,6 @@ const API = {
module.exports = {
API
API,
ENV
}
\ 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