From faee62f47523b2e1c0d1eeed34e047be8ca0c99d Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 09 七月 2025 16:57:01 +0800
Subject: [PATCH] 完善蓝牙连接组件 实现蓝牙状态全局可查询
---
pages.json | 881 ++++++++++++++++++++++++------------------------
main.js | 3
components/blueToothConnector/blueToothConnector.vue | 148 +++++++
3 files changed, 583 insertions(+), 449 deletions(-)
diff --git a/components/blueToothConnector/blueToothConnector.vue b/components/blueToothConnector/blueToothConnector.vue
index 9b86d0f..2b9aba0 100644
--- a/components/blueToothConnector/blueToothConnector.vue
+++ b/components/blueToothConnector/blueToothConnector.vue
@@ -2,7 +2,15 @@
<view>
<!-- 钃濈墮杩炴帴鐘舵�� MAC鍦板潃 -->
<view class="connection-status">
- <view>杩炴帴鐘舵�侊細</view>
+ <view style="display: flex; flex-direction: row; gap: 20rpx;padding: 20rpx;">
+ <view style="width: 5rem;">杩炴帴璁惧: </view>
+ <view v-if="$printer.isConnected() === false">鏃�</view>
+ <view v-else="$printer.isConnected() === true"
+ style="flex: 1;display: inline-flex;flex-direction: row;justify-content: space-between;">
+ <view>{{ $printer.connectedDevice().name }}</view>
+ <view>{{ $printer.connectedDevice().address }}</view>
+ </view>
+ </view>
</view>
<!-- 鎿嶄綔鍖� -->
<view class="buttons">
@@ -34,12 +42,13 @@
FakeConnectedDevice,
WriteOptions,
} from '@psdk/frame-father';
+import { getAddress } from '../../utils/auth';
export default {
name: "blueToothConnector",
data() {
return {
discoveredDevices: [], // 鏌ヨ鍒扮殑璁惧
- connectedDeviceId: ""
+ connectedDeviceId: "",
};
},
methods: {
@@ -86,6 +95,7 @@
}
}
})
+
},
onDevice(device) {
console.log("鐩戝惉瀵绘壘鍒版柊璁惧鐨勪簨浠�---------------")
@@ -108,7 +118,8 @@
title: '杩炴帴涓�'
});
bluetoothTool.connDevice(device.address, (result) => {
- console.log(result)
+ console.log("璁惧MAC鍦板潃: ", device.address)
+ console.log("printer锛�",vm.$printer._connectedDevice)
uni.hideLoading()
if (result) {
// // console.log(result);
@@ -116,10 +127,14 @@
// console.log(vm.$printer)
vm.$printer.init(new FakeConnectedDevice());
vm.connectedDeviceId = device.address;
+ vm.$printer._connectedDevice.address = device.address
+ vm.$printer._connectedDevice.name = device.name
+ console.log("printer锛�",vm.$printer._connectedDevice)
uni.showToast({
icon: 'none',
title: '杩炴帴鎴愬姛'
})
+
} else {
uni.showToast({
icon: 'none',
@@ -138,12 +153,132 @@
if (vm.connectedDeviceId != '') {
bluetoothTool.closeBtSocket();
vm.connectedDeviceId = "";
+ vm.$printer._connectedDevice = null
+
}
+ },
+ labelPrint() {
+ // 鎵撳嵃
+ // 妫�鏌ヨ摑鐗欒繛鎺�
+ let btStatus = bluetoothTool.getBluetoothStatus()
+ if (btStatus != true) {
+ this.showToast("钃濈墮杩炴帴寮傚父!")
+ return
+ }
+
+ // 妫�鏌ユ槸鍚﹁繛鎺ヨ澶�
+ let pairedDevices = bluetoothTool.getPairedDevices()
+ if (pairedDevices.length < 1) {
+ this.showToast("鏃犺澶囪繛鎺�!")
+ return
+ }
+
+ // 妫�鏌ヨ〃鍗曢」鏄惁鏈夌┖鍊�
+ for (var key in this.hform) {
+ if (this.hform[key] == "") {
+ // todo 鎻愮ず琛ㄥ崟椤逛笉鑳戒负绌�
+ this.showToast("琛ㄥ崟涓嶈兘鏈夌┖鍊�!")
+ return
+ }
+ }
+ this.printWrite()
+
+
+ },
+ showToast(msg, status = "none") {
+ uni.showToast({
+ title: msg,
+ icon: status,
+ duration: 2000
+ });
+ },
+ ///杞垚瀹夊崜鏈夌鍙风殑
+ uint8ArrayToSignedArray(uint8Array) {
+ let signedArray = new Array(uint8Array.length);
+ for (let i = 0; i < uint8Array.length; i++) {
+ if (uint8Array[i] >= 128) {
+ signedArray[i] = uint8Array[i] - 256;
+ } else {
+ signedArray[i] = uint8Array[i];
+ }
+ }
+ return signedArray;
+ },
+ async printWrite(type = "cpcl") {
+ const vm = this;
+ console.log("寮�濮嬫墦鍗�------------------")
+ switch (type) {
+ case "cpcl":
+ await vm.writeCpclModel();
+ break;
+ }
+ },
+ async writeCpclModel() {
+ const vm = this;
+ try {
+ const cpcl = await vm.$printer.cpcl().clear()
+ .page(new CPage({
+ width: 608,
+ height: 260
+ }))
+ .text(new CText({
+ x: 54,
+ y: 40,
+ content: "鐗╂枡浠g爜: " + vm.hform.HMaterCode,
+ font: CFont.TSS24
+ }))
+ .text(new CText({
+ x: 54,
+ y: 80,
+ content: "鍚� 绉�: " + vm.hform.HMaterName,
+ font: CFont.TSS24
+ }))
+ .text(new CText({
+ x: 54,
+ y: 120,
+ content: "瑙勬牸鍨嬪彿: " + vm.hform.HMaterType,
+ font: CFont.TSS24
+ }))
+ .text(new CText({
+ x: 54,
+ y: 160,
+ content: "鏁� 閲�: " + vm.hform.HNumber,
+ font: CFont.TSS24
+ }))
+ .bar(new CBar({
+ x: 120,
+ y: 200,
+ lineWidth: 1,
+ height: 80,
+ content: vm.hform.HBarCode,
+ codeRotation: CCodeRotation.ROTATION_0,
+ codeType: CCodeType.CODE128
+ }))
+ .form(new CForm()) //鏍囩绾搁渶瑕佸姞瀹氫綅鎸囦护
+ .print();
+ console.log(cpcl.command().string());
+ var binary = cpcl.command().binary();
+ await this.sendMessage(Array.from(this.uint8ArrayToSignedArray(binary)));
+ } catch (e) {
+ console.error(e);
+ uni.showToast({
+ title: '澶辫触',
+ });
+ }
+ },
+ async sendMessage(cmd) {
+ console.log(cmd);
+ const result = bluetoothTool.sendByteData(cmd);
+ uni.showToast({
+ icon: 'none',
+ title: result ? '鍙戦�佹垚鍔燂紒' : '鍙戦�佸け璐�...'
+ })
},
},
async mounted() {
//#ifdef APP-PLUS
// 钃濈墮
+ console.log("钃濈墮鍒濆鍖�")
bluetoothTool.init({
listenBTStatusCallback: (state) => {
if (state == 'STATE_ON') {
@@ -166,9 +301,10 @@
}
});
- // 鏌ョ湅杩炴帴璁惧
- let pariedDevices = bluetoothTool.getPairedDevices()
- console("宸查厤瀵硅澶�", pariedDevices)
+ console.log(this.$printer)
+ if(this.$printer.isConnected()){
+ this.connectedDeviceId = this.$printer.connectedDevice().address
+ }
//#endif
},
}
diff --git a/main.js b/main.js
index ba432dd..983fc86 100644
--- a/main.js
+++ b/main.js
@@ -1,5 +1,6 @@
import App from './App'
-
+import Printer from './plugins/printer'
+Vue.use(Printer);
// 鐢熶骇鐜
// Vue.prototype.serverUrl = "https://qqyapi.xinlinsoft.cn/qqy-api";
// 寮�鍙戠幆澧�
diff --git a/pages.json b/pages.json
index a80f462..c78e332 100644
--- a/pages.json
+++ b/pages.json
@@ -1,446 +1,443 @@
{
- "pages": [ //pages鏁扮粍涓涓�椤硅〃绀哄簲鐢ㄥ惎鍔ㄩ〉锛屽弬鑰冿細https://uniapp.dcloud.io/collocation/pages
- {
- "path": "pages/index/login",
-
- "style": {
- "navigationBarTitleText": "鐧诲綍",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/index/index",
- "style": {
- "navigationBarTitleText": "棣栭〉",
- "navigationStyle": "custom"
- }
- },
- {
- "path": "pages/index/tab1",
- "style": {
- "navigationBarTitleText": "妯″潡鍔熻兘"
- }
- },
- {
- "path": "pages/index/tab2",
- "style": {
- "navigationBarTitleText": "鎶ヨ〃涓績"
- }
- },
- {
- "path": "pages/index/mine",
- "style": {
- "navigationBarTitleText": "涓汉涓績",
- // "navigationStyle": "custom"
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#65a2fb"
- }
- },
- {
- "path": "pages/shebeilvli/form",
- "style": {
- "navigationBarTitleText": "璁惧鐘舵�佸垎鏋�"
- }
- },
- {
- "path": "pages/shebeilvli/table",
- "style": {
- "navigationBarTitleText": "璁惧灞ュ巻",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/shebeilvli/table_son",
- "style": {
- "navigationBarTitleText": "璁惧灞ュ巻瀛愯〃"
- }
- },
- {
- "path": "pages/baoyangjihua/form",
- "style": {
- "navigationBarTitleText": "璁惧淇濆吇璁″垝鍗�"
- }
- },
- {
- "path": "pages/baoyangjihua/table",
- "style": {
- "navigationBarTitleText": "璁惧淇濆吇璁″垝鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/baoyangjihua/table_son",
- "style": {
- "navigationBarTitleText": "淇濆吇璁″垝瀛愯〃"
- }
- },
- {
- "path": "pages/baoyangjilu/form",
- "style": {
- "navigationBarTitleText": "璁惧淇濆吇璁板綍鍗�"
- }
- },
- {
- "path": "pages/baoyangjilu/table",
- "style": {
- "navigationBarTitleText": "璁惧淇濆吇璁板綍鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/baoyangjilu/table_son",
- "style": {
- "navigationBarTitleText": "淇濆吇璁板綍瀛愯〃"
- }
- },
- {
- "path": "pages/guzhangdengji/form",
- "style": {
- "navigationBarTitleText": "璁惧鏁呴殰鐧昏琛�"
- }
- },
- {
- "path": "pages/guzhangdengji/table",
- "style": {
- "navigationBarTitleText": "璁惧鏁呴殰鐧昏琛�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/shebeidangan/form",
- "style": {
- "navigationBarTitleText": "璁惧妗f"
- }
- },
- {
- "path": "pages/shebeidangan/table",
- "style": {
- "navigationBarTitleText": "璁惧妗f",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/shebeiweixiu/form",
- "style": {
- "navigationBarTitleText": "璁惧缁翠慨璁板綍鍗�"
- }
- },
- {
- "path": "pages/shebeiweixiu/table",
- "style": {
- "navigationBarTitleText": "璁惧缁翠慨璁板綍鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/weiwaigxIn/form",
- "style": {
- "navigationBarTitleText": "濮斿宸ュ簭鍙戝嚭鍗�"
- }
- },
- {
- "path": "pages/weiwaigxIn/table",
- "style": {
- "navigationBarTitleText": "濮斿宸ュ簭鍙戝嚭鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/weiwaigxOut/form",
- "style": {
- "navigationBarTitleText": "濮斿宸ュ簭鎺ユ敹鍗�"
- }
- },
- {
- "path": "pages/weiwaigxOut/table",
- "style": {
- "navigationBarTitleText": "濮斿宸ュ簭鎺ユ敹鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/weiwaigxOut/firstCheck",
- "style": {
- "navigationBarTitleText": "棣栦欢妫�楠屽崟",
- "enablePullDownRefresh": true
- }
- },{
- "path": "pages/gongxuIn/form",
- "style": {
- "navigationBarTitleText": "宸ュ簭杩涚珯鎺ユ敹鍗�"
- }
- },
- {
- "path": "pages/gongxuIn/table",
- "style": {
- "navigationBarTitleText": "宸ュ簭杩涚珯鎺ユ敹鍗�",
- "enablePullDownRefresh": true
- }
- },{
- "path": "pages/gongxuOut/form",
- "style": {
- "navigationBarTitleText": "宸ュ簭鍑虹珯姹囨姤鍗�"
- }
- },
- {
- "path": "pages/gongxuOut/table",
- "style": {
- "navigationBarTitleText": "宸ュ簭鍑虹珯姹囨姤鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/shebeiguanli/form",
- "style": {
- "navigationBarTitleText": "璁惧绠$悊",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/shebeiguanli/table",
- "style": {
- "navigationBarTitleText": "璁惧绠$悊",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/shebeiguanli/list",
- "style": {
- "navigationBarTitleText": "宸ュ崟鍒楄〃",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/baogong/form",
- "style": {
- "navigationBarTitleText": "浜ч噺姹囨姤鍗�",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/baogong/table",
- "style": {
- "navigationBarTitleText": "鎶ュ伐骞冲彴",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/baogong/list",
- "style": {
- "navigationBarTitleText": "宸ュ崟鍒楄〃",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/baogong/abnormal",
- "style": {
- "navigationBarTitleText": "寮傚父鍙嶉鍗�",
- "enablePullDownRefresh": false
- }
- },
- {
- "path": "pages/yichang/table",
- "style": {
- "navigationBarTitleText": "寮傚父鍙嶉鍗曞垪琛�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/yichang/form",
- "style": {
- "navigationBarTitleText": "寮傚父鍙嶉鍗�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path": "pages/yichang/list",
- "style": {
- "navigationBarTitleText": "寮傚父鍙嶉澶勭悊鍗曞垪琛�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/labelPrinter/index",
- "style": {
- "navigationBarTitleText": "鏍囩鎵撳嵃"
- }
- },
- {
- "path" : "pages/shebeiyunxingzhuangtai/shebeiyunxingzhuangtai",
- "style": {
- "navigationBarTitleText": "璁惧杩愯鐘舵��",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/shebeiyunxingzhuangtai/detail",
- "style": {
- "navigationBarTitleText": "璁惧杩愯鐘舵�佽鎯�"
- }
- },
- {
- "path" : "pages/mujvzhuangtai/mujvzhuangtai",
- "style" :
+ "pages" : [
+ //pages鏁扮粍涓涓�椤硅〃绀哄簲鐢ㄥ惎鍔ㄩ〉锛屽弬鑰冿細https://uniapp.dcloud.io/collocation/pages
+ {
+ "path" : "pages/index/login",
+ "style" : {
+ "navigationBarTitleText" : "鐧诲綍",
+ "navigationStyle" : "custom"
+ }
+ },
+ {
+ "path" : "pages/index/index",
+ "style" : {
+ "navigationBarTitleText" : "棣栭〉",
+ "navigationStyle" : "custom"
+ }
+ },
+ {
+ "path" : "pages/index/tab1",
+ "style" : {
+ "navigationBarTitleText" : "妯″潡鍔熻兘"
+ }
+ },
+ {
+ "path" : "pages/index/tab2",
+ "style" : {
+ "navigationBarTitleText" : "鎶ヨ〃涓績"
+ }
+ },
+ {
+ "path" : "pages/index/mine",
+ "style" : {
+ "navigationBarTitleText" : "涓汉涓績",
+ // "navigationStyle": "custom"
+ "navigationBarTextStyle" : "white",
+ "navigationBarBackgroundColor" : "#65a2fb"
+ }
+ },
+ {
+ "path" : "pages/shebeilvli/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧鐘舵�佸垎鏋�"
+ }
+ },
+ {
+ "path" : "pages/shebeilvli/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧灞ュ巻",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeilvli/table_son",
+ "style" : {
+ "navigationBarTitleText" : "璁惧灞ュ巻瀛愯〃"
+ }
+ },
+ {
+ "path" : "pages/baoyangjihua/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧淇濆吇璁″垝鍗�"
+ }
+ },
+ {
+ "path" : "pages/baoyangjihua/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧淇濆吇璁″垝鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/baoyangjihua/table_son",
+ "style" : {
+ "navigationBarTitleText" : "淇濆吇璁″垝瀛愯〃"
+ }
+ },
+ {
+ "path" : "pages/baoyangjilu/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧淇濆吇璁板綍鍗�"
+ }
+ },
+ {
+ "path" : "pages/baoyangjilu/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧淇濆吇璁板綍鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/baoyangjilu/table_son",
+ "style" : {
+ "navigationBarTitleText" : "淇濆吇璁板綍瀛愯〃"
+ }
+ },
+ {
+ "path" : "pages/guzhangdengji/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧鏁呴殰鐧昏琛�"
+ }
+ },
+ {
+ "path" : "pages/guzhangdengji/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧鏁呴殰鐧昏琛�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeidangan/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧妗f"
+ }
+ },
+ {
+ "path" : "pages/shebeidangan/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧妗f",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeiweixiu/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧缁翠慨璁板綍鍗�"
+ }
+ },
+ {
+ "path" : "pages/shebeiweixiu/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧缁翠慨璁板綍鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/weiwaigxIn/form",
+ "style" : {
+ "navigationBarTitleText" : "濮斿宸ュ簭鍙戝嚭鍗�"
+ }
+ },
+ {
+ "path" : "pages/weiwaigxIn/table",
+ "style" : {
+ "navigationBarTitleText" : "濮斿宸ュ簭鍙戝嚭鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/weiwaigxOut/form",
+ "style" : {
+ "navigationBarTitleText" : "濮斿宸ュ簭鎺ユ敹鍗�"
+ }
+ },
+ {
+ "path" : "pages/weiwaigxOut/table",
+ "style" : {
+ "navigationBarTitleText" : "濮斿宸ュ簭鎺ユ敹鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/weiwaigxOut/firstCheck",
+ "style" : {
+ "navigationBarTitleText" : "棣栦欢妫�楠屽崟",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/gongxuIn/form",
+ "style" : {
+ "navigationBarTitleText" : "宸ュ簭杩涚珯鎺ユ敹鍗�"
+ }
+ },
+ {
+ "path" : "pages/gongxuIn/table",
+ "style" : {
+ "navigationBarTitleText" : "宸ュ簭杩涚珯鎺ユ敹鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/gongxuOut/form",
+ "style" : {
+ "navigationBarTitleText" : "宸ュ簭鍑虹珯姹囨姤鍗�"
+ }
+ },
+ {
+ "path" : "pages/gongxuOut/table",
+ "style" : {
+ "navigationBarTitleText" : "宸ュ簭鍑虹珯姹囨姤鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeiguanli/form",
+ "style" : {
+ "navigationBarTitleText" : "璁惧绠$悊",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeiguanli/table",
+ "style" : {
+ "navigationBarTitleText" : "璁惧绠$悊",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeiguanli/list",
+ "style" : {
+ "navigationBarTitleText" : "宸ュ崟鍒楄〃",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/baogong/form",
+ "style" : {
+ "navigationBarTitleText" : "浜ч噺姹囨姤鍗�",
+ "enablePullDownRefresh" : false
+ }
+ },
+ {
+ "path" : "pages/baogong/table",
+ "style" : {
+ "navigationBarTitleText" : "鎶ュ伐骞冲彴",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/baogong/list",
+ "style" : {
+ "navigationBarTitleText" : "宸ュ崟鍒楄〃",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/baogong/abnormal",
+ "style" : {
+ "navigationBarTitleText" : "寮傚父鍙嶉鍗�",
+ "enablePullDownRefresh" : false
+ }
+ },
+ {
+ "path" : "pages/yichang/table",
+ "style" : {
+ "navigationBarTitleText" : "寮傚父鍙嶉鍗曞垪琛�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/yichang/form",
+ "style" : {
+ "navigationBarTitleText" : "寮傚父鍙嶉鍗�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/yichang/list",
+ "style" : {
+ "navigationBarTitleText" : "寮傚父鍙嶉澶勭悊鍗曞垪琛�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/labelPrinter/index",
+ "style" : {
+ "navigationBarTitleText" : "鏍囩鎵撳嵃"
+ }
+ },
+ {
+ "path" : "pages/shebeiyunxingzhuangtai/shebeiyunxingzhuangtai",
+ "style" : {
+ "navigationBarTitleText" : "璁惧杩愯鐘舵��",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/shebeiyunxingzhuangtai/detail",
+ "style" : {
+ "navigationBarTitleText" : "璁惧杩愯鐘舵�佽鎯�"
+ }
+ },
+ {
+ "path" : "pages/mujvzhuangtai/mujvzhuangtai",
+ "style" : {
+ "navigationBarTitleText" : "妯″叿鐘舵�佸垎甯�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/mujvzhuangtai/detail",
+ "style" : {
+ "navigationBarTitleText" : "妯″叿鐘舵�佽鎯�"
+ }
+ },
+ {
+ "path" : "pages/tiaomachaima/tiaomachaima",
+ "style" : {
+ "navigationBarTitleText" : "鏉$爜鎷嗙爜"
+ }
+ },
+ {
+ "path" : "pages/wuliaosaoma/wuliaosaoma",
+ "style" : {
+ "navigationBarTitleText" : "鐗╂枡娓呭崟"
+ }
+ },
+ {
+ "path" : "pages/wuliaosaoma/detail",
+ "style" : {
+ "navigationBarTitleText" : "鏉$爜妗f"
+ }
+ },
+ {
+ "path" : "pages/caigouruku/table",
+ "style" : {
+ "navigationBarTitleText" : "閲囪喘鍏ュ簱",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/caigouruku/form",
+ "style" : {
+ "navigationBarTitleText" : "閲囪喘鍏ュ簱鍗�"
+ }
+ },
+ {
+ "path" : "pages/caigoutuiliao/table",
+ "style" : {
+ "navigationBarTitleText" : "閲囪喘閫�鏂�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/caigoutuiliao/form",
+ "style" : {
+ "navigationBarTitleText" : "閲囪喘閫�鏂欏崟"
+ }
+ },
+ {
+ "path" : "pages/xiaoshouchuku/table",
+ "style" : {
+ "navigationBarTitleText" : "閿�鍞嚭搴�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/xiaoshouchuku/form",
+ "style" : {
+ "navigationBarTitleText" : "閿�鍞嚭搴撳崟"
+ }
+ },
+ {
+ "path" : "pages/xiaoshoutuihuo/table",
+ "style" : {
+ "navigationBarTitleText" : "閿�鍞��璐�",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/xiaoshoutuihuo/form",
+ "style" : {
+ "navigationBarTitleText" : "閿�鍞��璐у崟"
+ }
+ },
+ {
+ "path" : "pages/qitachuku/qitachuku",
+ "style" : {
+ "navigationBarTitleText" : "鍏朵粬鍑哄簱",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/qitachuku/form",
+ "style" : {
+ "navigationBarTitleText" : "鍏朵粬鍑哄簱鍗�"
+ }
+ },
+ {
+ "path" : "pages/qitaruku/qitaruku",
+ "style" : {
+ "navigationBarTitleText" : "鍏朵粬鍏ュ簱",
+ "enablePullDownRefresh" : true
+ }
+ },
+ {
+ "path" : "pages/qitaruku/form",
+ "style" : {
+ "navigationBarTitleText" : "鍏朵粬鍏ュ簱鍗�"
+ }
+ }
+ ],
+ "tabBar" : {
+ "color" : "#888888", //tab 涓婄殑鏂囧瓧榛樿棰滆壊锛屼粎鏀寔鍗佸叚杩涘埗棰滆壊
+ "selectedColor" : "#2d7dee", //tab 涓婄殑鏂囧瓧閫変腑鏃剁殑棰滆壊锛屼粎鏀寔鍗佸叚杩涘埗棰滆壊
+ "borderStyle" : "black", //tabbar涓婅竟妗嗙殑棰滆壊锛� 浠呮敮鎸� black / white
+ "backgroundColor" : "#ffffff", //tab 鐨勮儗鏅壊锛屼粎鏀寔鍗佸叚杩涘埗棰滆壊
+ "list" : [
+ {
+ "pagePath" : "pages/index/index",
+ "iconPath" : "static/tabBar/home.png",
+ "selectedIconPath" : "static/tabBar/home-default.png",
+ "text" : "棣栭〉"
+ },
+ {
+ "pagePath" : "pages/index/tab1",
+ "iconPath" : "static/tabBar/icon1.png",
+ "selectedIconPath" : "static/tabBar/icon1-default.png",
+ "text" : "妯″潡鍔熻兘"
+ },
+ {
+ "pagePath" : "pages/index/tab2",
+ "iconPath" : "static/tabBar/icon2.png",
+ "selectedIconPath" : "static/tabBar/icon2-default.png",
+ "text" : "鎶ヨ〃涓績"
+ },
+ {
+ "pagePath" : "pages/index/mine",
+ "iconPath" : "static/tabBar/user.png",
+ "selectedIconPath" : "static/tabBar/user-default.png",
+ "text" : "鎴戠殑"
+ }
+ ]
+ },
+ "globalStyle" : {
+ "navigationBarTextStyle" : "white",
+ "navigationBarTitleText" : "璁惧绠$悊",
+ "navigationBarBackgroundColor" : "#3A78FF",
+ "backgroundColor" : "#F8F8F8",
+ "pageOrientation" : "default"
+ },
+ "uniIdRouter" : {},
+ "condition" : { //妯″紡閰嶇疆锛屼粎寮�鍙戞湡闂寸敓鏁�
+ "current": 0, //褰撳墠婵�娲荤殑妯″紡(list 鐨勭储寮曢」)
+ "list": [
{
- "navigationBarTitleText" : "妯″叿鐘舵�佸垎甯�",
- "enablePullDownRefresh": true
+ "name": "", //妯″紡鍚嶇О
+ "path": "", //鍚姩椤甸潰锛屽繀閫�
+ "query": "" //鍚姩鍙傛暟锛屽湪椤甸潰鐨刼nLoad鍑芥暟閲岄潰寰楀埌
}
- },
- {
- "path" : "pages/mujvzhuangtai/detail",
- "style" :
- {
- "navigationBarTitleText" : "妯″叿鐘舵�佽鎯�"
- }
- },
- {
- "path" : "pages/tiaomachaima/tiaomachaima",
- "style" :
- {
- "navigationBarTitleText" : "鏉$爜鎷嗙爜"
- }
- },
- {
- "path" : "pages/wuliaosaoma/wuliaosaoma",
- "style" :
- {
- "navigationBarTitleText" : "鐗╂枡娓呭崟"
- }
- },
- {
- "path" : "pages/wuliaosaoma/detail",
- "style" :
- {
- "navigationBarTitleText" : "鏉$爜妗f"
- }
- },
- {
- "path" : "pages/caigouruku/table",
- "style" :
- {
- "navigationBarTitleText" : "閲囪喘鍏ュ簱",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/caigouruku/form",
- "style" :
- {
- "navigationBarTitleText" : "閲囪喘鍏ュ簱鍗�"
- }
- },
- {
- "path" : "pages/caigoutuiliao/table",
- "style" :
- {
- "navigationBarTitleText" : "閲囪喘閫�鏂�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/caigoutuiliao/form",
- "style" :
- {
- "navigationBarTitleText" : "閲囪喘閫�鏂欏崟"
- }
- },
- {
- "path" : "pages/xiaoshouchuku/table",
- "style" :
- {
- "navigationBarTitleText" : "閿�鍞嚭搴�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/xiaoshouchuku/form",
- "style" :
- {
- "navigationBarTitleText" : "閿�鍞嚭搴撳崟"
- }
- },
- {
- "path" : "pages/xiaoshoutuihuo/table",
- "style" :
- {
- "navigationBarTitleText" : "閿�鍞��璐�",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/xiaoshoutuihuo/form",
- "style" :
- {
- "navigationBarTitleText" : "閿�鍞��璐у崟"
- }
- },
- {
- "path" : "pages/qitachuku/qitachuku",
- "style" :
- {
- "navigationBarTitleText" : "鍏朵粬鍑哄簱",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/qitachuku/form",
- "style" :
- {
- "navigationBarTitleText" : "鍏朵粬鍑哄簱鍗�"
- }
- },
- {
- "path" : "pages/qitaruku/qitaruku",
- "style" :
- {
- "navigationBarTitleText" : "鍏朵粬鍏ュ簱",
- "enablePullDownRefresh": true
- }
- },
- {
- "path" : "pages/qitaruku/form",
- "style" :
- {
- "navigationBarTitleText" : "鍏朵粬鍏ュ簱鍗�"
- }
- }
- ],
- "tabBar": {
- "color": "#888888", //tab 涓婄殑鏂囧瓧榛樿棰滆壊锛屼粎鏀寔鍗佸叚杩涘埗棰滆壊
- "selectedColor": "#2d7dee", //tab 涓婄殑鏂囧瓧閫変腑鏃剁殑棰滆壊锛屼粎鏀寔鍗佸叚杩涘埗棰滆壊
- "borderStyle": "black", //tabbar涓婅竟妗嗙殑棰滆壊锛� 浠呮敮鎸� black / white
- "backgroundColor": "#ffffff", //tab 鐨勮儗鏅壊锛屼粎鏀寔鍗佸叚杩涘埗棰滆壊
- "list": [{
- "pagePath": "pages/index/index",
- "iconPath":"static/tabBar/home.png",
- "selectedIconPath":"static/tabBar/home-default.png",
- "text": "棣栭〉"
- },
- {
- "pagePath": "pages/index/tab1",
- "iconPath":"static/tabBar/icon1.png",
- "selectedIconPath":"static/tabBar/icon1-default.png",
- "text": "妯″潡鍔熻兘"
- },
- {
- "pagePath": "pages/index/tab2",
- "iconPath":"static/tabBar/icon2.png",
- "selectedIconPath":"static/tabBar/icon2-default.png",
- "text": "鎶ヨ〃涓績"
- },
- {
- "pagePath": "pages/index/mine",
- "iconPath":"static/tabBar/user.png",
- "selectedIconPath":"static/tabBar/user-default.png",
- "text": "鎴戠殑"
- }]
- },
- "globalStyle": {
- "navigationBarTextStyle": "white",
- "navigationBarTitleText": "璁惧绠$悊",
- "navigationBarBackgroundColor": "#3A78FF",
- "backgroundColor": "#F8F8F8",
- "pageOrientation": "default"
- },
- "uniIdRouter": {}
+ ]
+ }
}
--
Gitblit v1.9.1