Commit 4557923c by songbingqi

修复部分bug

parent 94101c65
......@@ -253,9 +253,20 @@ export default {
scroll(e) {
if (!this.scrolled) return;
const { categoryPostion } = this;
const [el] = categoryPostion.filter(item => (item.top) - (e.target.scrollTop) >= 20);
console.log(el,'-------------------',e.target.scrollTop)
if (el) this.categoryId = el.id
let otherHeight = 0
if(this.buied){
otherHeight = 320
}else{
otherHeight = 270
}
if(this.shopCarFlag){
otherHeight += 100
}else{
otherHeight+=0
}
const el = categoryPostion.filter(item => {return item.top <= e.target.scrollTop+otherHeight});
console.log(el[el.length-1],'-------------------',e.target.scrollTop+otherHeight,otherHeight)
if (el[el.length-1]) this.categoryId = el[el.length-1].id
},
categoryClickMain(id) {
this.scrolled = false
......
......@@ -326,16 +326,7 @@ export default {
}
},
async getallNum(e) {
const settleMentFunc = async ()=>{
let Authorization = uni.getStorageSync('Authorization');
if (!Authorization) {
this.loginByPhoneNumber(e);
return
}
if(!this.shopState||!this.isInRange){
return
}
const gosettleFun = async ()=> {
const { goods } = this;
const { data } = await Order.checkSku({skuId:goods.skuId})
const {state,goods:newgoods} = data.data
......@@ -355,40 +346,50 @@ export default {
uni.navigateTo({ url: `/orderSubPackage/pages/settlement/index?buyType=1&goodsList=1` })
}
}
uni.authorize({
scope: 'scope.userLocation',
success: () => { //1.1 允许授权
console.log("允许授权位置");
settleMentFunc()
},
fail: (err) => { //1.2 拒绝授权
wx.exitMiniProgram({ success: (res) => { } })
console.log("获取位置失败")
uni.showModal({
content: '检测到您没打开地理位置权限,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success: (res) => {
if (res.confirm) {
uni.openSetting({//opensetting是调起设置页面的
success: (res) => {
console.log(res)
if(res.authSetting['scope.userLocation'] == true){//判断res.authsetting的值是true还是false
settleMentFunc()
}else{
// console.log("什么也不做");
}
}
})
} else {
console.log('取消');
return false;
}
}
})
let Authorization = uni.getStorageSync('Authorization');
if (!Authorization) {
this.loginByPhoneNumber(e);
uni.authorize({
scope: 'scope.userLocation',
success: () => { //1.1 允许授权
console.log("允许授权位置");
settleMentFunc()
},
fail: (err) => { //1.2 拒绝授权
wx.exitMiniProgram({ success: (res) => { } })
console.log("获取位置失败")
uni.showModal({
content: '检测到您没打开地理位置权限,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success: (res) => {
if (res.confirm) {
uni.openSetting({//opensetting是调起设置页面的
success: (res) => {
console.log(res)
if(res.authSetting['scope.userLocation'] == true){//判断res.authsetting的值是true还是false
gosettleFun()
}else{
// console.log("什么也不做");
}
}
})
} else {
console.log('取消');
return false;
}
}
})
}
})
return
}
})
return
if(!this.shopState||!this.isInRange){
return
}
// return
},
async getMenuList() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment