From 832273c4d961cff053319f6c7a33da934034ab95 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Sat, 3 Dec 2022 11:03:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8F=9C=E5=93=81=E9=A2=84?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 16 +++++-- src/pages/applicableStore/applicableStore.vue | 2 +- src/pages/foodReservation/foodReservation.vue | 18 ++++---- src/pages/homeNew/homeNew.vue | 12 +----- src/pages/memberRegister/memberRegister.vue | 21 ++++------ src/pages/personal/personal.vue | 27 +++++++++++- src/pages/position/position.vue | 3 ++ src/utils/UploadOSS.js | 42 +++++++++++++++++++ src/utils/request.js | 14 +++---- 9 files changed, 106 insertions(+), 49 deletions(-) create mode 100644 src/utils/UploadOSS.js diff --git a/src/App.vue b/src/App.vue index ad4bc57..25fcd34 100644 --- a/src/App.vue +++ b/src/App.vue @@ -166,9 +166,7 @@ }, onCheckUpdate() { if (uni.canIUse('getUpdateManager')) { - uni.showLoading({ title: '正在检测版本' }); - const updateManager = uni.getUpdateManager() - uni.hideLoading(); + const updateManager = uni.getUpdateManager(); updateManager.onCheckForUpdate(function (res) { // 请求完新版本信息的回调 if (res.hasUpdate) { @@ -347,7 +345,17 @@ }, decodeBPABase64(str) { return decode(str).replace('BPA_BASE64', ''); - } + }, + /** + * 判断是否为海科微信小程序 + */ + onHKApp() { + const appInfo = uni.getAccountInfoSync(); + if (appInfo.miniProgram.appId === 'wx67f7399628986bfb') { + return true; + } + return false; + }, } } diff --git a/src/pages/applicableStore/applicableStore.vue b/src/pages/applicableStore/applicableStore.vue index 98d046d..0ad3cdd 100644 --- a/src/pages/applicableStore/applicableStore.vue +++ b/src/pages/applicableStore/applicableStore.vue @@ -86,7 +86,7 @@ }, async onSearchUserLocation() { let response = await getApp().onGetUserLocation(); - if (true) { + if (response) { this.isShowLoactionAuth = false; this.onFetchStoreList(); } else { diff --git a/src/pages/foodReservation/foodReservation.vue b/src/pages/foodReservation/foodReservation.vue index 9edb4ca..2c33960 100644 --- a/src/pages/foodReservation/foodReservation.vue +++ b/src/pages/foodReservation/foodReservation.vue @@ -151,15 +151,15 @@ this.$refs.popup.open('right'); }, async onGetUserLocation() { - // this.isShowLoactionAuth = false; - // this.onQueryStoreAndGoods(); - const response = await getApp().onGetUserLocation(); - if (response) { - this.isShowLoactionAuth = false; - this.onQueryStoreAndGoods(); - } else { - this.isShowLoactionAuth = true; - } + this.isShowLoactionAuth = false; + this.onQueryStoreAndGoods(); + // const response = await getApp().onGetUserLocation(); + // if (response) { + // this.isShowLoactionAuth = false; + // this.onQueryStoreAndGoods(); + // } else { + // this.isShowLoactionAuth = true; + // } }, onQueryStoreAndGoods() { if (this.storeList.length === 0) { diff --git a/src/pages/homeNew/homeNew.vue b/src/pages/homeNew/homeNew.vue index 66baae0..eedd50e 100644 --- a/src/pages/homeNew/homeNew.vue +++ b/src/pages/homeNew/homeNew.vue @@ -81,7 +81,7 @@ isShowActivity: false, //是否显示活动列表弹窗 activityList: [], drinkInfo: {}, //积杯换饮 - isHKApp: false, + isHKApp: getApp().onHKApp(), carouselList: [ 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/goods/133058072111585205.jpg', 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/goods/133058072178578510.jpg' @@ -97,7 +97,6 @@ onShow() { this.onFetchUserInfo(); this.onFetchStoreStyles(); - this.onHKApp(); }, created() { this.onFetchActivityData(); @@ -115,15 +114,6 @@ } }, methods: { - /** - * 判断是否为海科微信小程序 - */ - onHKApp() { - const appInfo = uni.getAccountInfoSync(); - if (appInfo.miniProgram.appId === 'wx67f7399628986bfb') { - this.isHKApp = true; - } - }, onJumpOrder() { uni.switchTab({ url: '/pages/food/food' diff --git a/src/pages/memberRegister/memberRegister.vue b/src/pages/memberRegister/memberRegister.vue index 577fb54..d990f4a 100644 --- a/src/pages/memberRegister/memberRegister.vue +++ b/src/pages/memberRegister/memberRegister.vue @@ -89,7 +89,10 @@ 会员卡适用 门店详情 - + + 绑定员工信息 + + 微信一键注册 @@ -108,7 +111,7 @@ return { isAgree: false, imageServer: getApp().globalData.imageServer, - isHKApp: false, + isHKApp: getApp().onHKApp(), userInfo: { avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', nickName: '', @@ -129,18 +132,8 @@ }, onShow() { this.onFetchStoreStyles(); - this.onHKApp(); }, methods: { - /** - * 判断是否为海科微信小程序 - */ - onHKApp() { - const appInfo = uni.getAccountInfoSync(); - if (appInfo.miniProgram.appId === 'wx67f7399628986bfb') { - this.isHKApp = true; - } - }, onCheckboxChange() { this.isAgree = !this.isAgree; }, @@ -227,7 +220,7 @@ } } }, - async onChooseAvatar(userFace) { + async onChooseAvatar(userFace,e) { this.userInfo.avatarUrl = userFace.detail.avatarUrl; const ext = userFace.detail.avatarUrl.split('.')[1]; const response = await goodsAPI.GetCosRequestURL({ directory: "applet", fileExtension: ext, method: "PUT" }); @@ -246,6 +239,8 @@ this.userInfo.avatarUrl = data.headers.location; } }); + + }, //获取页面风格 onFetchStoreStyles() { diff --git a/src/pages/personal/personal.vue b/src/pages/personal/personal.vue index 535088e..924823e 100644 --- a/src/pages/personal/personal.vue +++ b/src/pages/personal/personal.vue @@ -80,6 +80,22 @@ {{memberCard.phone}} + + + 所属部门 + + + {{onFormatTages(memberCard.tags)}} + + + + + 工号 + + + {{memberCard.jobNumber}} + + 保存信息 @@ -113,7 +129,8 @@ ], memberCard: { headImgUrl: '' - } + }, + isHKApp: getApp().onHKApp() } }, onShow() { @@ -284,8 +301,14 @@ this.memberCard.headImgUrl = data.headers.location; } }); + }, + onFormatTages(tags) { + if (tags && tags.length > 0) { + return tags.join(); + } else { + return '暂无部门'; + } } - } } diff --git a/src/pages/position/position.vue b/src/pages/position/position.vue index bdc00eb..262d345 100644 --- a/src/pages/position/position.vue +++ b/src/pages/position/position.vue @@ -3,12 +3,15 @@ 成都市高新区 + 环球中心N5-911B + 四川黑菠萝科技 + diff --git a/src/utils/UploadOSS.js b/src/utils/UploadOSS.js new file mode 100644 index 0000000..660ce7c --- /dev/null +++ b/src/utils/UploadOSS.js @@ -0,0 +1,42 @@ +/** + * 微信小程序环境下将文件上传到OSS。 + */ +const UploadOSS = (params) => { + const host = ''; + const signature = ''; + const ossAccessKeyId = ''; + const policy = ''; + const key = ''; + const securityToken = ''; + const filePath = ''; // 待上传文件的文件路径。 + return new Promise((resolve, reject) => { + uni.uploadFile({ + url: host, // 开发者服务器的URL。 + filePath: filePath, + name: 'file', // 必须填file。 + formData: { + key, + policy, + OSSAccessKeyId: ossAccessKeyId, + signature, + // 'x-oss-security-token': securityToken // 使用STS签名时必传。 + }, + success: (res) => { + if (res.statusCode === 204) { + resolve({ + isSuccess: true, + data: res.data, + msg: '上传成功!' + }); + } + }, + fail: err => { + reject({ + isSuccess: false, + data: err, + msg: '上传失败!' + }); + } + }); + }); +} \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index cc21ce3..ebd54d0 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,12 +1,8 @@ import Encrypt from "./crypto.js"; let BASE_URL = ''; - BASE_URL = 'https://www.black-pa.com:5500/pro'; //线上正式 - // BASE_URL = 'https://www.black-pa.com:5500/dev'; //线上开发 - // BASE_URL = 'https://www.black-pa.com:5500/test'; //线上测试 - - // BASE_URL = 'https://bpa.black-pa.com:21527'; //本地开发 - // BASE_URL = 'http://192.168.1.21:5001'; - // BASE_URL = 'https://bpa.black-pa.com:21528'; //本地测试 + BASE_URL = 'https://witt.black-pa.com'; //线上正式 + // BASE_URL = 'https://bpa.black-pa.com:21527'; //线上开发 + // BASE_URL = 'https://bpa.black-pa.com:21528'; //线上测试 const Franchisee = '/kitchen'; //加盟商:0 const Order = '/order'; //订单: 1 @@ -14,9 +10,9 @@ const Pay = '/wechat/'; //支付: 2 const accountInfo = uni.getAccountInfoSync(); if (accountInfo.miniProgram.envVersion === 'trial') { - BASE_URL = 'https://www.black-pa.com:5500/test'; + BASE_URL = 'https://bpa.black-pa.com:21528'; } else if (accountInfo.miniProgram.envVersion === 'release') { - BASE_URL = 'https://www.black-pa.com:5500/pro'; + BASE_URL = 'https://witt.black-pa.com'; } const request = (options) => {