Compare commits

...
6 Commits
16 changed files with 404 additions and 213 deletions
+7
View File
@@ -34,6 +34,10 @@ const install = (Vue, vm) => {
data: req.data, data: req.data,
header: req.header header: req.header
}, null, 2)); }, null, 2));
// #ifdef APP-PLUS
// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,关闭校验证书
req.sslVerify = false;
// #endif
if (!req.header){ if (!req.header){
req.header = []; req.header = [];
} }
@@ -176,6 +180,9 @@ const install = (Vue, vm) => {
uni.request({ uni.request({
url, url,
method: 'PUT', method: 'PUT',
// #ifdef APP-PLUS
sslVerify: false,
// #endif
header: { header: {
...header, ...header,
'Platform': 2, 'Platform': 2,
+9 -1
View File
@@ -48,6 +48,13 @@ export default {
dataKey: 'data', dataKey: 'data',
needSetup: false needSetup: false
}, },
{
brand: 'nlscan',
name: '新大陆',
action: 'nlscan.action.SCANNER_RESULT',
dataKey: 'SCAN_BARCODE1',
needSetup: false
},
{ ...PHONE_SCAN_CONFIG }, { ...PHONE_SCAN_CONFIG },
]; ];
}, },
@@ -267,7 +274,8 @@ export default {
if (!self.isPageActive) return; if (!self.isPageActive) return;
try { try {
plus.android.importClass('android.content.Intent'); // 广播回调里的 intent 需要按实例导入,否则 getStringExtra 不可用
plus.android.importClass(intent);
const scanResult = intent.getStringExtra(config.dataKey); const scanResult = intent.getStringExtra(config.dataKey);
console.log(`${config.name}扫码结果:`, scanResult); console.log(`${config.name}扫码结果:`, scanResult);
+3
View File
@@ -23,6 +23,9 @@ export function request(options) {
url: apiurl + options.url, url: apiurl + options.url,
method: options.method || 'GET', method: options.method || 'GET',
data: options.data, data: options.data,
// #ifdef APP-PLUS
sslVerify: false,
// #endif
header: { header: {
'Platform': 2, 'Platform': 2,
'Authorization': token, 'Authorization': token,
+19
View File
@@ -17,6 +17,25 @@ import VueI18n from '@/common/vue-i18n.min.js';
import lang_zh_CN from '@/common/locales/zh_CN.js'; import lang_zh_CN from '@/common/locales/zh_CN.js';
import lang_en from '@/common/locales/en.js'; import lang_en from '@/common/locales/en.js';
// #ifdef APP-PLUS
// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,全局关闭 HTTPS 证书校验
(() => {
const patchSslVerify = (methodName) => {
const original = uni[methodName];
if (typeof original !== 'function') {
return;
}
uni[methodName] = (options = {}) => original({
...options,
sslVerify: false
});
};
patchSslVerify('request');
patchSslVerify('downloadFile');
patchSslVerify('uploadFile');
})();
// #endif
Vue.config.productionTip = false; Vue.config.productionTip = false;
App.mpType = 'app'; App.mpType = 'app';
+2 -2
View File
@@ -2,8 +2,8 @@
"name" : "浩拓ERP", "name" : "浩拓ERP",
"appid" : "__UNI__F79F300", "appid" : "__UNI__F79F300",
"description" : "浩拓ERP", "description" : "浩拓ERP",
"versionName" : "1.1.5", "versionName" : "1.1.6",
"versionCode" : 105, "versionCode" : 106,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"optimization" : { "optimization" : {
+78 -63
View File
@@ -8,22 +8,20 @@
<!-- <u-tabs :list="list" :is-scroll="false" :current="current" @change="onClickItem"></u-tabs> --> <!-- <u-tabs :list="list" :is-scroll="false" :current="current" @change="onClickItem"></u-tabs> -->
<!-- <view v-if="current === 0"> --> <!-- <view v-if="current === 0"> -->
<view class="list"> <view class="list">
<template v-if="isDevelopment"> <view class="list-call env-call">
<view class="list-call"> <view class="iconfont icon-link" style="font-size: 28px;color:#5473e8;"></view>
<view class="iconfont icon-link" style="font-size: 22px;color:#5473e8;"></view> <view style="width: 100%;">
<view style="width: 100%;"> <view class="server-selector" @click="showServerPicker">
<view class="server-selector" @click="showServerPicker"> <text>{{ getApiUrlLabel() }}</text>
<text>{{ getApiUrlLabel() }}</text> <view class="iconfont icon-arrow-down"></view>
<view class="iconfont icon-arrow-down" style="font-size: 16px;"></view>
</view>
</view> </view>
</view> </view>
<view class="list-call" v-if="selectedApiUrl === 'custom'"> </view>
<!-- 当选择自定义时显示输入框 --> <view class="list-call" v-if="selectedApiUrl === 'custom'">
<input class="u-input" type="text" v-model="customApiUrl" maxlength="100" placeholder="请输入服务器地址" <!-- 当选择自定义时显示输入框 -->
@blur="handleBlurInputUrl" /> <input class="u-input" type="text" v-model="customApiUrl" maxlength="100" placeholder="请输入服务器地址"
</view> @blur="handleBlurInputUrl" />
</template> </view>
<view class="list-call"> <view class="list-call">
<view class="iconfont icon-avatar" style="font-size: 22px;color:#5473e8;"></view> <view class="iconfont icon-avatar" style="font-size: 22px;color:#5473e8;"></view>
<input class="u-input" type="text" v-model="login.username" maxlength="32" <input class="u-input" type="text" v-model="login.username" maxlength="32"
@@ -105,7 +103,7 @@
<!-- </view>--> <!-- </view>-->
<!-- </view>--> <!-- </view>-->
<!-- </div>--> <!-- </div>-->
<u-select v-model="showApiUrlPicker" :list="apiUrlList" title="选择服务器" <u-select class="login-env-picker" v-model="showApiUrlPicker" :list="apiUrlList" title="选择服务器"
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-select> @confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-select>
<!-- 版本信息显示 --> <!-- 版本信息显示 -->
<view class="version-info"> <view class="version-info">
@@ -137,10 +135,12 @@ export default {
password: "" password: ""
}, },
showApiUrlPicker: false, showApiUrlPicker: false,
// 根据环境设置默认URL和选项 // 暂时在打包后也展示服务器选项;生产包默认正式环境
selectedApiUrl: config.isDevelopment ? config.devApiUrlOptions[0].value : config.productionApiUrl, selectedApiUrl: config.isDevelopment
? config.devApiUrlOptions[0].value
: ((config.devApiUrlOptions.find(item => item.label === '正式环境') || {}).value || config.productionApiUrl),
customApiUrl: 'http://192.168.1.66:50002/hcscm/pda/v1', customApiUrl: 'http://192.168.1.66:50002/hcscm/pda/v1',
apiUrlList: config.isDevelopment ? config.devApiUrlOptions : [], apiUrlList: config.devApiUrlOptions,
phoneNo: '', phoneNo: '',
//username: '', //username: '',
//password: '', //password: '',
@@ -169,16 +169,13 @@ export default {
}, },
onShow() { onShow() {
// 只在开发环境读取存储的URL uni.getStorage({
if (config.isDevelopment) { key: 'ApiUrl',
uni.getStorage({ success: (e) => {
key: 'ApiUrl', util.updateApiUrl(e.data);
success: (e) => { this.selectedApiUrl = e.data;
util.updateApiUrl(e.data); }
this.selectedApiUrl = e.data; });
}
});
}
uni.getStorage({ uni.getStorage({
key: 'UserInfo', key: 'UserInfo',
@@ -300,21 +297,12 @@ export default {
title: '登录中...' title: '登录中...'
}); });
let currentApiUrl; const currentApiUrl = this.selectedApiUrl === 'custom' ? this.customApiUrl : this.selectedApiUrl;
if (!currentApiUrl || currentApiUrl.length === 0) {
if (config.isDevelopment) { this.$u.toast('请输入服务器地址');
// 开发环境:使用选择的URL return;
currentApiUrl = this.selectedApiUrl === 'custom' ? this.customApiUrl : this.selectedApiUrl;
if (!currentApiUrl || currentApiUrl.length === 0) {
this.$u.toast('请输入服务器地址');
return;
}
// 更新store中的URL
this.$store.dispatch('updateApiUrl', currentApiUrl);
} else {
// 生产环境:使用固定的生产URL
currentApiUrl = config.productionApiUrl;
} }
this.$store.dispatch('updateApiUrl', currentApiUrl);
if (this.login.username.length == 0) { if (this.login.username.length == 0) {
this.$u.toast('请输入账号'); this.$u.toast('请输入账号');
@@ -338,14 +326,14 @@ export default {
console.log('login res', res) console.log('login res', res)
var aLoginUserData = res; var aLoginUserData = res;
// 只在开发环境保存 apiurl 到本地存储 //console.log('--aLoginUserData->>' + JSON.stringify(aLoginUserData));
if (config.isDevelopment) { uni.setStorage({
uni.setStorage({ key: 'ApiUrl',
key: 'ApiUrl', data: currentApiUrl
data: currentApiUrl });
}); util.updateApiUrl(currentApiUrl);
util.updateApiUrl(currentApiUrl); // 保存 token 到本地存储
} uni.setStorageSync('RemoteTokenData', aLoginUserData);
applyLoginData(aLoginUserData); applyLoginData(aLoginUserData);
@@ -445,18 +433,14 @@ export default {
}, },
handleBlurInputUrl(e) { handleBlurInputUrl(e) {
// 只在开发环境处理自定义URL const url = e.detail.value.trim();
if (config.isDevelopment) { if (url) {
const url = e.detail.value.trim(); this.customApiUrl = url;
if (url) { uni.setStorage({
this.customApiUrl = url; key: 'ApiUrl',
// 保存到本地存储 data: url
uni.setStorage({ });
key: 'ApiUrl', util.updateApiUrl(url);
data: url
});
util.updateApiUrl(url);
}
} }
}, },
} }
@@ -465,14 +449,25 @@ export default {
<style lang="scss"> <style lang="scss">
@import 'index.scss'; @import 'index.scss';
.env-call {
height: auto;
min-height: 140rpx;
}
.server-selector { .server-selector {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 10rpx 0; min-height: 80rpx;
padding: 16rpx 0;
font-size: 40rpx;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.server-selector .icon-arrow-down {
font-size: 28px;
}
.list-call { .list-call {
.u-select { .u-select {
margin-bottom: 10rpx; margin-bottom: 10rpx;
@@ -587,3 +582,23 @@ export default {
margin-left: 10rpx; margin-left: 10rpx;
} }
</style> </style>
<style lang="scss" scoped>
.login-env-picker {
::v-deep .u-select__header,
::v-deep .u-select__header__btn {
height: 100rpx;
font-size: 36rpx;
}
::v-deep .u-select__body {
height: 560rpx;
}
::v-deep .u-select__body__picker-view__item,
::v-deep .u-line-1 {
height: 88rpx;
font-size: 40rpx;
line-height: 88rpx;
}
}
</style>
+22 -15
View File
@@ -47,6 +47,7 @@
<!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item> <!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item>
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#ff8a00' }" title="联系客服" @click="navTo('service')"></u-cell-item>!--> <u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#ff8a00' }" title="联系客服" @click="navTo('service')"></u-cell-item>!-->
<u-gap height="20" bg-color="#f5f5f5"></u-gap> <u-gap height="20" bg-color="#f5f5f5"></u-gap>
<u-cell-item icon="reload" :iconStyle="{ color: '#19be6b' }" title="版本更新" @click="upgrade"></u-cell-item>
<u-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" @click="navTo('setting')"></u-cell-item> <u-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" @click="navTo('setting')"></u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
@@ -55,6 +56,8 @@
</template> </template>
<script> <script>
import CommonNavbar from "@/components/common-navbar/index"; import CommonNavbar from "@/components/common-navbar/index";
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js';
import config from '@/common/config.js';
/** /**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved. * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/ */
@@ -102,25 +105,29 @@ export default {
}, },
upgrade(){ upgrade(){
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.$u.api.upgradeCheck().then(res => { app_upgrade(async () => {
if (res.result == 'true'){ const appInfo = await new Promise((resolve) => {
uni.showModal({ plus.runtime.getProperty(plus.runtime.appid, (inf) => {
title: '提示', resolve(inf);
content: res.message + '是否下载更新?',
showCancel: true,
success: function (res2) {
if (res2.confirm) {
plus.runtime.openURL(res.data.apkUrl);
}
}
}); });
}else{ });
this.$u.toast(res.message); const res = await this.$u.api.upgradeCheck({
app_name: config.upgradeName,
current_version: appInfo.version
});
if (!res.download_url) {
this.$u.toast('当前版本已是最新版');
return;
} }
}); return {
changelog: res.message + ',最新版本:' + res.latest_version,
status: res.need_update ? 1 : 0,
path: res.download_url
};
}, 1);
// #endif // #endif
// #ifndef APP-PLUS // #ifndef APP-PLUS
this.$u.toast('小程序端或H5端无需检查更新') this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
// #endif // #endif
} }
} }
+20 -1
View File
@@ -83,7 +83,7 @@ export default {
const res = await this.$u.api.dictionary.getDetailEnumList({ const res = await this.$u.api.dictionary.getDetailEnumList({
dictionary_id: DICTIONARY_TYPE_SCANNER, dictionary_id: DICTIONARY_TYPE_SCANNER,
}); });
const list = Array.isArray(res) ? res : []; const list = Array.isArray(res) ? res : (Array.isArray(res && res.list) ? res.list : []);
const builtinConfigs = this.getScannerConfigs(); const builtinConfigs = this.getScannerConfigs();
if (list.length) { if (list.length) {
this.configList = list this.configList = list
@@ -98,6 +98,7 @@ export default {
this.useFallbackConfigList(); this.useFallbackConfigList();
} }
this.ensurePhoneScanOption(); this.ensurePhoneScanOption();
this.ensureNlscanOption();
this.initFormFromSaved(); this.initFormFromSaved();
}, },
useFallbackConfigList() { useFallbackConfigList() {
@@ -110,6 +111,24 @@ export default {
this.configList.push(phoneConfig); this.configList.push(phoneConfig);
} }
}, },
ensureNlscanOption() {
const nlscanConfig = this.getScannerConfigs().find((item) => item.brand === 'nlscan');
if (!nlscanConfig) {
return;
}
const exists = this.configList.some((item) => {
return item.brand === nlscanConfig.brand || item.action === nlscanConfig.action;
});
if (exists) {
return;
}
const phoneIndex = this.configList.findIndex((item) => item.brand === PHONE_SCAN_BRAND);
if (phoneIndex >= 0) {
this.configList.splice(phoneIndex, 0, nlscanConfig);
return;
}
this.configList.push(nlscanConfig);
},
initFormFromSaved() { initFormFromSaved() {
const savedConfig = getScanConfig(this.getScannerConfigs()); const savedConfig = getScanConfig(this.getScannerConfigs());
if (savedConfig) { if (savedConfig) {
-34
View File
@@ -4,7 +4,6 @@
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell-item title="通用" @click="navTo('/pages/sys/user/currency')" :arrow="true"></u-cell-item> <u-cell-item title="通用" @click="navTo('/pages/sys/user/currency')" :arrow="true"></u-cell-item>
<u-gap height="20" bg-color="#f5f5f5"></u-gap> <u-gap height="20" bg-color="#f5f5f5"></u-gap>
<u-cell-item title="版本更新" @click="upgrade()" :arrow="true"></u-cell-item>
<u-cell-item title="隐私政策" @click="navTo('')" :arrow="true"></u-cell-item> <u-cell-item title="隐私政策" @click="navTo('')" :arrow="true"></u-cell-item>
<u-cell-item title="用户协议" @click="navTo('')" :arrow="true"></u-cell-item> <u-cell-item title="用户协议" @click="navTo('')" :arrow="true"></u-cell-item>
</u-cell-group> </u-cell-group>
@@ -18,9 +17,6 @@
/** /**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved. * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/ */
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
import util from '@/common/util.js';
import config from '../../../common/config';
import { clearUserSession } from '@/common/userSession.js'; import { clearUserSession } from '@/common/userSession.js';
export default { export default {
@@ -35,36 +31,6 @@ export default {
url: url url: url
}); });
}, },
upgrade(){
// #ifdef APP-PLUS
app_upgrade(async ()=>{
// 获取应用信息
const appInfo = await new Promise((resolve) => {
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
resolve(inf);
});
});
const res = await this.$u.api.upgradeCheck({
app_name: config.upgradeName,
current_version: appInfo.version
})
console.log('res',res)
if(!res.download_url){
this.$u.toast('当前版本已是最新版');
return
}
return {
changelog: res.message + ',最新版本:' + res.latest_version,
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
path: res.download_url // 新apk地址
}
}, 1)
// #endif
// #ifndef APP-PLUS
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
// #endif
},
openSettings() { openSettings() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.getSystemInfo({ uni.getSystemInfo({
+229 -76
View File
@@ -1,37 +1,50 @@
<template> <template>
<view class="wrap"> <view class="workbench-page">
<common-navbar title="工作台" :showBack="false"> <common-navbar
title="应用中心"
:showBack="false"
backgroundColor="#f4f5e8"
:showShadow="false"
>
<template #left>
<text class="app-version">v{{ appVersion }}</text>
</template>
<template #right> <template #right>
<view class="scan_box"> <view class="settings-entry" @click="openSettings">
<u-icon name="scan" color="#333333" size="46" @click="handleScan"></u-icon> <u-icon name="setting-fill" color="#242820" size="32"></u-icon>
<text class="settings-text">设置</text>
</view> </view>
</template> </template>
</common-navbar> </common-navbar>
<view v-for="group in visibleMenuGroups" :key="group.title">
<view class="workbench-title">{{ group.title }}</view> <view class="menu-grid">
<view class="toolbar"> <view
<u-grid class="grid" :col="4" :border="false"> v-for="(item, index) in visibleMenuItems"
<u-grid-item :key="item.router"
v-for="(item, index) in group.items" class="menu-card"
:key="item.router" :class="`menu-card--${index % 6}`"
:index="index" hover-class="menu-card--active"
@click="navTo(item.url)" @click="navTo(item.url)"
> >
<view class="home-icon" :class="item.color"> <image class="card-background" :src="item.backgroundImage" mode="aspectFill"></image>
<i class="iconfont" :class="item.icon"></i> <text class="card-mark">“</text>
</view> <view class="card-content">
<view class="grid-text">{{ item.name }}</view> <view class="card-title">{{ item.name }}</view>
</u-grid-item> <view class="card-subtitle">{{ item.subtitle }}</view>
</u-grid> </view>
<view class="card-arrow">
<u-icon name="arrow-right" color="#5b6257" size="22"></u-icon>
</view>
</view> </view>
<view v-if="!visibleMenuItems.length" class="empty-state">暂无可用功能</view>
</view> </view>
<view v-if="!visibleMenuGroups.length" class="textCenter">暂无可用功能</view>
</view> </view>
</template> </template>
<script> <script>
import CommonNavbar from "@/components/common-navbar/index"; import CommonNavbar from "@/components/common-navbar/index";
import scanMixin from '@/common/scanMixin.js'; import scanMixin from '@/common/scanMixin.js';
import { hasResourceRouter } from '@/common/userSession.js'; import { hasResourceRouter } from '@/common/userSession.js';
import manifest from '@/manifest.json';
/** /**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved. * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/ */
@@ -56,6 +69,8 @@ export default {
items: [ items: [
{ {
name: '成品配布', name: '成品配布',
subtitle: 'FINISHED GOODS',
backgroundImage: '/static/workbench/finished-goods.png',
url: '/pages/saleship/salepickscan', url: '/pages/saleship/salepickscan',
router: 'CashCommodityClothOrder', router: 'CashCommodityClothOrder',
icon: 'icon-hetongguanli', icon: 'icon-hetongguanli',
@@ -68,6 +83,8 @@ export default {
items: [ items: [
{ {
name: '加工进仓', name: '加工进仓',
subtitle: 'PROCESSING IN',
backgroundImage: '/static/workbench/processing-in.png',
url: '/pages/storegoods/storeGoodsProcessInList', url: '/pages/storegoods/storeGoodsProcessInList',
router: 'FpProcessingEntryOrder', router: 'FpProcessingEntryOrder',
icon: 'icon-hetongguanli', icon: 'icon-hetongguanli',
@@ -75,6 +92,8 @@ export default {
}, },
{ {
name: '加工出仓', name: '加工出仓',
subtitle: 'PROCESSING OUT',
backgroundImage: '/static/workbench/processing-out.png',
url: '/pages/storegoods/storeGoodsProcessOutList', url: '/pages/storegoods/storeGoodsProcessOutList',
router: 'FpProcessingDeliverFromGodownOrder', router: 'FpProcessingDeliverFromGodownOrder',
icon: 'icon-hetongguanli', icon: 'icon-hetongguanli',
@@ -82,6 +101,8 @@ export default {
}, },
{ {
name: '加工退货进仓', name: '加工退货进仓',
subtitle: 'RETURN ENTRY',
backgroundImage: '/static/workbench/return-entry.png',
url: '/pages/storegoods/storeGoodsProcessReturnInList', url: '/pages/storegoods/storeGoodsProcessReturnInList',
router: 'FpProcessingReturnEntryOrder', router: 'FpProcessingReturnEntryOrder',
icon: 'icon-hetongguanli', icon: 'icon-hetongguanli',
@@ -89,6 +110,8 @@ export default {
}, },
{ {
name: '采购进仓', name: '采购进仓',
subtitle: 'PURCHASE ENTRY',
backgroundImage: '/static/workbench/purchase-entry.png',
url: '/pages/storegoods/storeGoodsPurchaseInList', url: '/pages/storegoods/storeGoodsPurchaseInList',
router: 'FinishPurchaseWarehouseEntry', router: 'FinishPurchaseWarehouseEntry',
icon: 'icon-hetongguanli', icon: 'icon-hetongguanli',
@@ -106,11 +129,8 @@ export default {
// onUnload, onHide, onShow 已由 scanMixin 自动处理 // onUnload, onHide, onShow 已由 scanMixin 自动处理
computed: { computed: {
contentStyle() { appVersion() {
const navHeight = getStatusBarHeight() + 44; return manifest.versionName;
return {
height: `${navHeight}px`,
};
}, },
visibleMenuGroups() { visibleMenuGroups() {
return this.menuGroups return this.menuGroups
@@ -119,6 +139,11 @@ export default {
items: group.items.filter((item) => hasResourceRouter(item.router)) items: group.items.filter((item) => hasResourceRouter(item.router))
})) }))
.filter((group) => group.items.length > 0); .filter((group) => group.items.length > 0);
},
visibleMenuItems() {
return this.visibleMenuGroups.reduce((items, group) => {
return items.concat(group.items);
}, []);
} }
}, },
methods: { methods: {
@@ -136,6 +161,11 @@ export default {
url: url, url: url,
}); });
}, },
openSettings() {
uni.navigateTo({
url: '/pages/sys/user/setting'
});
},
imgListClick(index) { imgListClick(index) {
console.log(`点击了第${index + 1}页图片`); console.log(`点击了第${index + 1}页图片`);
}, },
@@ -205,63 +235,186 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "index.scss"; page {
min-height: 100%;
background: #f4f5e8;
}
.scan_box { .workbench-page {
min-height: 100vh;
padding-bottom: 40rpx;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 220rpx),
#f4f5e8;
}
.workbench-page .navbar_left,
.workbench-page .navbar_right {
min-width: 68px !important;
}
.workbench-page .navbar_center {
padding: 0 8px !important;
}
.app-version {
color: #444a40;
font-size: 24rpx;
font-weight: 500;
white-space: nowrap;
}
.settings-entry {
display: flex; display: flex;
flex-direction: column; align-items: center;
justify-content: flex-end;
color: #242820;
font-size: 26rpx;
white-space: nowrap;
}
.settings-text {
margin-left: 8rpx;
}
.menu-grid {
display: flex;
flex-wrap: wrap;
padding: 14rpx 19rpx 40rpx;
}
.menu-card {
position: relative;
box-sizing: border-box;
width: calc(50% - 30rpx);
height: 218rpx;
margin: 14rpx 15rpx;
overflow: hidden;
border-radius: 12rpx 28rpx 12rpx 28rpx;
color: #ffffff;
box-shadow: 0 12rpx 24rpx rgba(49, 58, 45, 0.14);
transition: transform 120ms ease, opacity 120ms ease;
}
.menu-card--active {
opacity: 0.88;
transform: scale(0.97);
}
.menu-card--0 {
background: linear-gradient(145deg, #ed4052, #cf263e);
}
.menu-card--1 {
background: linear-gradient(145deg, #1787f0, #1768d6);
}
.menu-card--2 {
background: linear-gradient(145deg, #6558eb, #4639c8);
}
.menu-card--3 {
background: linear-gradient(145deg, #ff6a2b, #ea3d19);
}
.menu-card--4 {
background: linear-gradient(145deg, #149de4, #1977d1);
}
.menu-card--5 {
background: linear-gradient(145deg, #20bea8, #0c9789);
}
.card-background {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
opacity: 0.72;
pointer-events: none;
}
.card-mark {
position: absolute;
top: 10rpx;
left: 18rpx;
color: rgba(255, 255, 255, 0.2);
font-family: Georgia, serif;
font-size: 74rpx;
font-weight: 700;
line-height: 1;
}
.card-content {
position: absolute;
z-index: 1;
right: 16rpx;
bottom: 42rpx;
left: 22rpx;
}
.card-title {
overflow: hidden;
font-size: 40rpx;
font-weight: 700;
line-height: 1.25;
text-overflow: ellipsis;
white-space: nowrap;
}
.card-subtitle {
margin-top: 8rpx;
color: rgba(255, 255, 255, 0.76);
font-size: 22rpx;
font-weight: 500;
letter-spacing: 1rpx;
line-height: 1.2;
}
.card-arrow {
position: absolute;
z-index: 2;
right: 0;
bottom: 0;
display: flex;
width: 48rpx;
height: 42rpx;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 8rpx 0 0 0;
background: rgba(244, 245, 232, 0.94);
}
.scan_text { .empty-state {
font-size: 12px; width: 100%;
color: #2979ff; padding: 120rpx 0;
color: #7e8578;
font-size: 28rpx;
text-align: center;
}
@media screen and (max-width: 350px) {
.menu-grid {
padding-right: 15rpx;
padding-left: 15rpx;
}
.menu-card {
width: calc(50% - 22rpx);
height: 206rpx;
margin-right: 11rpx;
margin-left: 11rpx;
}
.card-title {
font-size: 36rpx;
} }
} }
.banner-box { @media (prefers-reduced-motion: reduce) {
padding: 0 2%; .menu-card {
width: 96%; transition: none;
height: 170rpx; }
margin: 30rpx 0 30rpx;
}
.u-swiper-wrap {
padding: 0 10px;
}
.banner-pic {
width: 47%;
float: left;
display: inline-block;
margin: 0 1.5%;
}
.banner-pic image {
width: 100%;
height: 170rpx;
border-radius: 12rpx;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.u-mode-light-info {
background-color: #ffffff;
color: #666666;
border: 1px solid #e9ecf6;
font-size: 12px;
padding: 2px 8px;
position: relative;
top: -3px;
}
.workbench-title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding: 15px 30rpx;
}
.home-icon i.icon-tongzhi {
font-size: 22px;
} }
</style> </style>
+15 -21
View File
@@ -26,22 +26,19 @@ function normalizeApiUrl(url) {
// 初始化API URL // 初始化API URL
function initApiUrl() { function initApiUrl() {
if (config.isDevelopment) { const fallbackUrl = config.isDevelopment
// 开发环境:从存储读取,如果没有则使用测试环境 ? config.devApiUrlOptions[0].value
try { : ((config.devApiUrlOptions.find(item => item.label === '正式环境') || {}).value || config.productionApiUrl);
const savedApiUrl = uni.getStorageSync('ApiUrl'); try {
const url = normalizeApiUrl(savedApiUrl || config.devApiUrlOptions[0].value); const savedApiUrl = uni.getStorageSync('ApiUrl');
if (savedApiUrl && url !== savedApiUrl) { const url = normalizeApiUrl(savedApiUrl || fallbackUrl);
uni.setStorageSync('ApiUrl', url); if (savedApiUrl && url !== savedApiUrl) {
} uni.setStorageSync('ApiUrl', url);
return url;
} catch (e) {
console.log('读取存储的 apiurl 失败', e);
return config.devApiUrlOptions[0].value;
} }
} else { return url;
// 生产环境:使用固定的生产URL } catch (e) {
return normalizeApiUrl(config.productionApiUrl); console.log('读取存储的 apiurl 失败', e);
return normalizeApiUrl(fallbackUrl);
} }
} }
@@ -114,14 +111,8 @@ const store = new Vuex.Store({
state.vuex_notificationAudio = audio; state.vuex_notificationAudio = audio;
}, },
SET_API_URL(state, url) { SET_API_URL(state, url) {
// 生产环境不允许修改URL
if (!config.isDevelopment) {
console.warn('生产环境不允许修改API URL');
return;
}
const nextUrl = normalizeApiUrl(url); const nextUrl = normalizeApiUrl(url);
state.apiurl = nextUrl state.apiurl = nextUrl
// 同时保存到本地存储
uni.setStorageSync('ApiUrl', nextUrl) uni.setStorageSync('ApiUrl', nextUrl)
} }
}, },
@@ -183,6 +174,9 @@ const store = new Vuex.Store({
uni.request({ uni.request({
url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList", url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList",
method: "GET", method: "GET",
// #ifdef APP-PLUS
sslVerify: false,
// #endif
header: { header: {
platform: "2", platform: "2",
Authorization: uni.getStorageSync("RemoteTokenData").token, Authorization: uni.getStorageSync("RemoteTokenData").token,
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB