diff --git a/common/httpRequest.js b/common/httpRequest.js index 45ec54f..7e31877 100644 --- a/common/httpRequest.js +++ b/common/httpRequest.js @@ -6,12 +6,12 @@ const tui = { //接口地址 interfaceUrl: function() { - // return 'https://storage.xenjoyou.com/hiver' + return 'https://storage.xenjoyou.com/hiver' // return 'http://172.22.14.0:8888/hiver' // return 'http://172.22.175.84:8888/hiver' // return 'http://172.22.116.195:8888/hiver' // return 'http://192.168.0.13:8888/hiver' - return 'http://154.8.162.157:8888/hiver' + // return 'http://154.8.162.157:8888/hiver' }, toast: function(text, duration, success) { uni.showToast({ @@ -109,7 +109,14 @@ const tui = { }, method: method, //'GET','POST' dataType: 'json', - success: (res) => { + success: (res) => { + console.log(res.data.code) + if(res.data.code == 401){ + uni.clearStorage() + uni.navigateTo({ + url: '/pages/login/login' + }) + } clearTimeout(tui.delayed) tui.delayed = null; if (tui.loadding && !hideLoading) { diff --git a/components/kk-printer/index.vue b/components/kk-printer/index.vue index 020d56e..a517e5d 100644 --- a/components/kk-printer/index.vue +++ b/components/kk-printer/index.vue @@ -83,7 +83,8 @@ //获取特征值时返回的三要素 serviceId: '', writeId: '', - readId: '' + readId: '', + iosNo:false } }, props:{ @@ -164,12 +165,48 @@ //打开蓝牙适配器 blesdk.openBlue().then((res)=>{ //获取已连接设备 - blesdk.getConnectedBluetoothDevices().then((res)=>{ + blesdk.getConnectedBluetoothDevices().then((res)=>{ + if(this.iosNo){ + let datalen=20; + // #ifdef APP-PLUS + if (plus.os.name != 'Android') + { + datalen=180; + } + // #endif + + this.isPrinting = true; + this.$emit('onPrint'); + this.$nextTick(()=>{ + if(this.bufferData!=''){ + let buffer = gbk.strToGBKByte(this.bufferData) + + let opt = { + deviceId: this.deviceId, + serviceId: this.serviceId, + characteristicId: this.writeId, + value:buffer, + lasterSuccess: this.onPrintSuccess, + onceLength:datalen + } + console.log("开始打印了") + console.log(opt) + blesdk.sendDataToDevice(opt); + this.isPrinting = false; + //打印成功跳转页面 + } + + }) + return + } //若没有已连接设备,弹框搜索设备 console.log(res,this.deviceId,this.serviceId,this.writeId,this.bufferData,this.onPrintSuccess,'res,this.deviceId,this.serviceId,this.writeId,this.bufferData,this.onPrintSuccess’') - if(res.devices.length == 0){ + if(res.devices.length == 0){ + console.log("没有设备连接") + this.iosNo = true this.isShowSearch = true - }else{ + }else{ + console.log("有设备连接") let datalen=20; // #ifdef APP-PLUS if (plus.os.name != 'Android') diff --git a/components/kk-printer/utils/bluetoolth.js b/components/kk-printer/utils/bluetoolth.js index e7bedec..0f8884d 100644 --- a/components/kk-printer/utils/bluetoolth.js +++ b/components/kk-printer/utils/bluetoolth.js @@ -227,7 +227,8 @@ export function getDeviceCharacteristics(deviceId, services, success, fail) { export function onGetBLECharacteristicValueChange(options, onChange = function() {}) { console.log('deviceId ', options.deviceId); console.log('serviceId ', options.serviceId); - console.log('characteristicId ', options.characteristicId); + console.log('characteristicId ', options.characteristicId); + console.log('苹果手机看这里'); uniAsyncPromise('notifyBLECharacteristicValueChange', { state: true, ...options, @@ -262,7 +263,8 @@ export function sendDataToDevice(options) { ...options, value: options.value.slice(0, byteLength > speed ? speed : byteLength), }) - .then((res) => { + .then((res) => { + console.log("发送信息到蓝牙成功") if (byteLength > speed) { sendDataToDevice({ ...options, @@ -428,7 +430,7 @@ function Hex2Str(num) { * printNum: 打印张数,默认为1 * rotation:页面整体旋转 1-90度 2-180度 3-270度 其他-不旋转 */ -export function CreatCPCLPage(width, height, printNum, rotation = 0, offset = 0) { +export function CreatCPCLPage(width, height, printNum, rotation, offset = 0) { var strCmd = '! ' + offset + ' 200 200 ' + height + ' ' + printNum + '\n'; strCmd += "PAGE-WIDTH " + width + '\n'; if (rotation == 1) @@ -451,7 +453,8 @@ export function CreatCPCLPage(width, height, printNum, rotation = 0, offset = 0) * content: 文字内容 */ export function addCPCLText(x, y, fontName, fontSize, rotation, content) { - //console.log(fontName,fontSize,rotation, content); + //console.log(fontName,fontSize,rotation, content); + // alert(content); var strCmd = ''; if (rotation == 1) { strCmd += 'T90 '; diff --git a/package.json b/package.json index f837220..90a5ab5 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,34 @@ -{ - "name": "uView", - "version": "1.8.6", - "description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水", - "main": "index.js", - "keywords": [ - "uview", - "ui", - "uni-app" - ], - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "" - }, - "devDependencies": { - "node-sass": "^4.14.0", - "sass-loader": "^8.0.2" - }, - "author": "uView", - "license": "MIT", - "id": "uview-v1", - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ] - } -} \ No newline at end of file +{ + "name": "uView", + "version": "1.8.6", + "description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水", + "main": "index.js", + "keywords": [ + "uview", + "ui", + "uni-app" + ], + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "" + }, + "devDependencies": { + "node-sass": "^4.14.0", + "sass-loader": "^8.0.2" + }, + "author": "uView", + "license": "MIT", + "id": "uview-v1", + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ] + }, + "dependencies": { + "uniapp-qrcode": "^1.0.2" + } +} diff --git a/pages.json b/pages.json index 725b3b3..b46a383 100644 --- a/pages.json +++ b/pages.json @@ -100,7 +100,14 @@ "navigationBarTitleText": "订单列表", "enablePullDownRefresh": false } - }, + }, + { + "path": "pages/index/downStearmList", + "style": { + "navigationBarTitleText": "客户下单页", + "enablePullDownRefresh": false + } + }, { "path": "pages/index/logistics", "style": { diff --git a/static/images/pyq.png b/static/images/pyq.png new file mode 100644 index 0000000..f1a2bb7 Binary files /dev/null and b/static/images/pyq.png differ diff --git a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue index ab08656..d81c676 100644 --- a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +++ b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue @@ -3,10 +3,10 @@ {{shareTitleText}} - + @@ -45,30 +45,10 @@ name: 'wx' }, { - text: '支付宝', - icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png', - name: 'wx' - }, - { - text: 'QQ', - icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png', - name: 'qq' - }, - { - text: '新浪', - icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png', - name: 'sina' - }, - // { - // text: '百度', - // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png', - // name: 'copy' - // }, - // { - // text: '其他', - // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png', - // name: 'more' - // } + text: '朋友圈', + icon: '/static/images/pyq.png', + name: 'pyq' + } ] } }, @@ -85,9 +65,8 @@ /** * 选择内容 */ - select(item, index) { + select(index) { this.$emit('select', { - item, index }) this.close()