@@ -166,9 +166,7 @@ | |||||
}, | }, | ||||
onCheckUpdate() { | onCheckUpdate() { | ||||
if (uni.canIUse('getUpdateManager')) { | if (uni.canIUse('getUpdateManager')) { | ||||
uni.showLoading({ title: '正在检测版本' }); | |||||
const updateManager = uni.getUpdateManager() | |||||
uni.hideLoading(); | |||||
const updateManager = uni.getUpdateManager(); | |||||
updateManager.onCheckForUpdate(function (res) { | updateManager.onCheckForUpdate(function (res) { | ||||
// 请求完新版本信息的回调 | // 请求完新版本信息的回调 | ||||
if (res.hasUpdate) { | if (res.hasUpdate) { | ||||
@@ -347,7 +345,17 @@ | |||||
}, | }, | ||||
decodeBPABase64(str) { | decodeBPABase64(str) { | ||||
return decode(str).replace('BPA_BASE64', ''); | return decode(str).replace('BPA_BASE64', ''); | ||||
} | |||||
}, | |||||
/** | |||||
* 判断是否为海科微信小程序 | |||||
*/ | |||||
onHKApp() { | |||||
const appInfo = uni.getAccountInfoSync(); | |||||
if (appInfo.miniProgram.appId === 'wx67f7399628986bfb') { | |||||
return true; | |||||
} | |||||
return false; | |||||
}, | |||||
} | } | ||||
} | } | ||||
</script> | </script> | ||||
@@ -86,7 +86,7 @@ | |||||
}, | }, | ||||
async onSearchUserLocation() { | async onSearchUserLocation() { | ||||
let response = await getApp().onGetUserLocation(); | let response = await getApp().onGetUserLocation(); | ||||
if (true) { | |||||
if (response) { | |||||
this.isShowLoactionAuth = false; | this.isShowLoactionAuth = false; | ||||
this.onFetchStoreList(); | this.onFetchStoreList(); | ||||
} else { | } else { | ||||
@@ -151,15 +151,15 @@ | |||||
this.$refs.popup.open('right'); | this.$refs.popup.open('right'); | ||||
}, | }, | ||||
async onGetUserLocation() { | 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() { | onQueryStoreAndGoods() { | ||||
if (this.storeList.length === 0) { | if (this.storeList.length === 0) { | ||||
@@ -81,7 +81,7 @@ | |||||
isShowActivity: false, //是否显示活动列表弹窗 | isShowActivity: false, //是否显示活动列表弹窗 | ||||
activityList: [], | activityList: [], | ||||
drinkInfo: {}, //积杯换饮 | drinkInfo: {}, //积杯换饮 | ||||
isHKApp: false, | |||||
isHKApp: getApp().onHKApp(), | |||||
carouselList: [ | 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/133058072111585205.jpg', | ||||
'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/goods/133058072178578510.jpg' | 'https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee/qw/goods/133058072178578510.jpg' | ||||
@@ -97,7 +97,6 @@ | |||||
onShow() { | onShow() { | ||||
this.onFetchUserInfo(); | this.onFetchUserInfo(); | ||||
this.onFetchStoreStyles(); | this.onFetchStoreStyles(); | ||||
this.onHKApp(); | |||||
}, | }, | ||||
created() { | created() { | ||||
this.onFetchActivityData(); | this.onFetchActivityData(); | ||||
@@ -115,15 +114,6 @@ | |||||
} | } | ||||
}, | }, | ||||
methods: { | methods: { | ||||
/** | |||||
* 判断是否为海科微信小程序 | |||||
*/ | |||||
onHKApp() { | |||||
const appInfo = uni.getAccountInfoSync(); | |||||
if (appInfo.miniProgram.appId === 'wx67f7399628986bfb') { | |||||
this.isHKApp = true; | |||||
} | |||||
}, | |||||
onJumpOrder() { | onJumpOrder() { | ||||
uni.switchTab({ | uni.switchTab({ | ||||
url: '/pages/food/food' | url: '/pages/food/food' | ||||
@@ -89,7 +89,10 @@ | |||||
<text class="agreement-common-text">会员卡适用</text> | <text class="agreement-common-text">会员卡适用</text> | ||||
<text class="agreement-green-text">门店详情</text> | <text class="agreement-green-text">门店详情</text> | ||||
</view> | </view> | ||||
<view class="wechat-register-btn" @click="onRegisterMember"> | |||||
<view v-if="isHKApp" class="wechat-register-btn" @click="onRegisterMember"> | |||||
绑定员工信息 | |||||
</view> | |||||
<view v-else class="wechat-register-btn" @click="onRegisterMember"> | |||||
微信一键注册 | 微信一键注册 | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -108,7 +111,7 @@ | |||||
return { | return { | ||||
isAgree: false, | isAgree: false, | ||||
imageServer: getApp().globalData.imageServer, | imageServer: getApp().globalData.imageServer, | ||||
isHKApp: false, | |||||
isHKApp: getApp().onHKApp(), | |||||
userInfo: { | userInfo: { | ||||
avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', | avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0', | ||||
nickName: '', | nickName: '', | ||||
@@ -129,18 +132,8 @@ | |||||
}, | }, | ||||
onShow() { | onShow() { | ||||
this.onFetchStoreStyles(); | this.onFetchStoreStyles(); | ||||
this.onHKApp(); | |||||
}, | }, | ||||
methods: { | methods: { | ||||
/** | |||||
* 判断是否为海科微信小程序 | |||||
*/ | |||||
onHKApp() { | |||||
const appInfo = uni.getAccountInfoSync(); | |||||
if (appInfo.miniProgram.appId === 'wx67f7399628986bfb') { | |||||
this.isHKApp = true; | |||||
} | |||||
}, | |||||
onCheckboxChange() { | onCheckboxChange() { | ||||
this.isAgree = !this.isAgree; | this.isAgree = !this.isAgree; | ||||
}, | }, | ||||
@@ -227,7 +220,7 @@ | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
async onChooseAvatar(userFace) { | |||||
async onChooseAvatar(userFace,e) { | |||||
this.userInfo.avatarUrl = userFace.detail.avatarUrl; | this.userInfo.avatarUrl = userFace.detail.avatarUrl; | ||||
const ext = userFace.detail.avatarUrl.split('.')[1]; | const ext = userFace.detail.avatarUrl.split('.')[1]; | ||||
const response = await goodsAPI.GetCosRequestURL({ directory: "applet", fileExtension: ext, method: "PUT" }); | const response = await goodsAPI.GetCosRequestURL({ directory: "applet", fileExtension: ext, method: "PUT" }); | ||||
@@ -246,6 +239,8 @@ | |||||
this.userInfo.avatarUrl = data.headers.location; | this.userInfo.avatarUrl = data.headers.location; | ||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
//获取页面风格 | //获取页面风格 | ||||
onFetchStoreStyles() { | onFetchStoreStyles() { | ||||
@@ -80,6 +80,22 @@ | |||||
{{memberCard.phone}} | {{memberCard.phone}} | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="personal-card-item" v-if="isHKApp"> | |||||
<view class="personal-card-prev"> | |||||
所属部门 | |||||
</view> | |||||
<view class="personal-card-content text-overflow-one"> | |||||
{{onFormatTages(memberCard.tags)}} | |||||
</view> | |||||
</view> | |||||
<view class="personal-card-item" v-if="isHKApp"> | |||||
<view class="personal-card-prev"> | |||||
工号 | |||||
</view> | |||||
<view class="personal-card-content text-overflow-one"> | |||||
{{memberCard.jobNumber}} | |||||
</view> | |||||
</view> | |||||
</view> | </view> | ||||
<view class="personal-btn" @click="onSaveUserInfo"> | <view class="personal-btn" @click="onSaveUserInfo"> | ||||
保存信息 | 保存信息 | ||||
@@ -113,7 +129,8 @@ | |||||
], | ], | ||||
memberCard: { | memberCard: { | ||||
headImgUrl: '' | headImgUrl: '' | ||||
} | |||||
}, | |||||
isHKApp: getApp().onHKApp() | |||||
} | } | ||||
}, | }, | ||||
onShow() { | onShow() { | ||||
@@ -284,8 +301,14 @@ | |||||
this.memberCard.headImgUrl = data.headers.location; | this.memberCard.headImgUrl = data.headers.location; | ||||
} | } | ||||
}); | }); | ||||
}, | |||||
onFormatTages(tags) { | |||||
if (tags && tags.length > 0) { | |||||
return tags.join(); | |||||
} else { | |||||
return '暂无部门'; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> | ||||
@@ -3,12 +3,15 @@ | |||||
<view class="position-box"> | <view class="position-box"> | ||||
<view class="position-title"> | <view class="position-title"> | ||||
成都市高新区 | 成都市高新区 | ||||
<!-- 贵阳市南明区油榨街 --> | |||||
</view> | </view> | ||||
<view class="position-title"> | <view class="position-title"> | ||||
环球中心N5-911B | 环球中心N5-911B | ||||
<!-- 市南路110号 --> | |||||
</view> | </view> | ||||
<view class="position-title"> | <view class="position-title"> | ||||
四川黑菠萝科技 | 四川黑菠萝科技 | ||||
<!-- 贵州矮香牛餐饮管理有限公司 --> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="image-iconfont"> | <view class="image-iconfont"> | ||||
@@ -0,0 +1,42 @@ | |||||
/** | |||||
* 微信小程序环境下将文件上传到OSS。 | |||||
*/ | |||||
const UploadOSS = (params) => { | |||||
const host = '<host>'; | |||||
const signature = '<signatureString>'; | |||||
const ossAccessKeyId = '<accessKey>'; | |||||
const policy = '<policyBase64Str>'; | |||||
const key = '<object name>'; | |||||
const securityToken = '<x-oss-security-token>'; | |||||
const filePath = '<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: '上传失败!' | |||||
}); | |||||
} | |||||
}); | |||||
}); | |||||
} |
@@ -1,12 +1,8 @@ | |||||
import Encrypt from "./crypto.js"; | import Encrypt from "./crypto.js"; | ||||
let BASE_URL = ''; | 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 Franchisee = '/kitchen'; //加盟商:0 | ||||
const Order = '/order'; //订单: 1 | const Order = '/order'; //订单: 1 | ||||
@@ -14,9 +10,9 @@ const Pay = '/wechat/'; //支付: 2 | |||||
const accountInfo = uni.getAccountInfoSync(); | const accountInfo = uni.getAccountInfoSync(); | ||||
if (accountInfo.miniProgram.envVersion === 'trial') { | 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') { | } 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) => { | const request = (options) => { | ||||