|
@@ -369,12 +369,20 @@
|
|
|
this.backPage = option.page
|
|
|
}
|
|
|
if(this.isShareType =='share'){
|
|
|
- if(uni.getStorageSync('_WX_State')){
|
|
|
- wxLogin.wxLoginAuthorize()
|
|
|
- }else{
|
|
|
- console.log(new Date +'用户未授权微信信息')
|
|
|
- this.$api.navigateTo('/pages/authorization/authorization')
|
|
|
- }
|
|
|
+ authorize.getSetting().then(res =>{
|
|
|
+ console.log('用户是否授权过',res)
|
|
|
+ if(res == 1){
|
|
|
+ wxLogin.wxLoginAuthorize()
|
|
|
+ }else{
|
|
|
+ this.$api.navigateTo('/pages/authorization/authorization')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // if(uni.getStorageSync('_WX_State')){
|
|
|
+ // wxLogin.wxLoginAuthorize()
|
|
|
+ // }else{
|
|
|
+ // console.log(new Date +'用户未授权微信信息')
|
|
|
+ // this.$api.navigateTo('/pages/authorization/authorization')
|
|
|
+ // }
|
|
|
}
|
|
|
this.getWinHeight()
|
|
|
},
|
|
@@ -490,28 +498,52 @@
|
|
|
console.log(e.detail.query)
|
|
|
},
|
|
|
buyProductCart(){//底部购物车按钮点击
|
|
|
- if(uni.getStorageSync('_WX_State')){
|
|
|
- if(this.hasLogin){
|
|
|
- this.$api.navigateTo('/pages/goods/cart')
|
|
|
- }else{
|
|
|
- this.$api.navigateTo('/pages/login/login?type=1')
|
|
|
+ authorize.getSetting().then(res =>{
|
|
|
+ console.log('用户是否授权过',res)
|
|
|
+ if(res == 1){
|
|
|
+ if(this.hasLogin){
|
|
|
+ this.$api.navigateTo('/pages/goods/cart')
|
|
|
+ }else{
|
|
|
+ this.$api.navigateTo('/pages/login/login?type=1')
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
}
|
|
|
- }else{
|
|
|
- console.log(new Date +'用户未授权微信信息')
|
|
|
- this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
- }
|
|
|
+ })
|
|
|
+ // if(uni.getStorageSync('_WX_State')){
|
|
|
+ // if(this.hasLogin){
|
|
|
+ // this.$api.navigateTo('/pages/goods/cart')
|
|
|
+ // }else{
|
|
|
+ // this.$api.navigateTo('/pages/login/login?type=1')
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // console.log(new Date +'用户未授权微信信息')
|
|
|
+ // this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
+ // }
|
|
|
},
|
|
|
btnGetConfirm(type){//加入购物车&&立即购买点击
|
|
|
- if(uni.getStorageSync('_WX_State')){
|
|
|
- if(this.hasLogin){
|
|
|
- this.showSpec(type);
|
|
|
- }else{
|
|
|
- this.$api.navigateTo('/pages/login/login?type=1')
|
|
|
+ authorize.getSetting().then(res =>{
|
|
|
+ console.log('用户是否授权过',res)
|
|
|
+ if(res == 1){
|
|
|
+ if(this.hasLogin){
|
|
|
+ this.showSpec(type);
|
|
|
+ }else{
|
|
|
+ this.$api.navigateTo('/pages/login/login?type=1')
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
}
|
|
|
- }else{
|
|
|
- console.log(new Date +'用户未授权微信信息')
|
|
|
- this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
- }
|
|
|
+ })
|
|
|
+ // if(uni.getStorageSync('_WX_State')){
|
|
|
+ // if(this.hasLogin){
|
|
|
+ // this.showSpec(type);
|
|
|
+ // }else{
|
|
|
+ // this.$api.navigateTo('/pages/login/login?type=1')
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // console.log(new Date +'用户未授权微信信息')
|
|
|
+ // this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
+ // }
|
|
|
},
|
|
|
changeCountAdd(){//popup弹窗数量增加按钮
|
|
|
if(this.buyRetailPriceStep == 2){
|
|
@@ -606,14 +638,24 @@
|
|
|
})
|
|
|
},
|
|
|
navToLogin(){
|
|
|
- if(uni.getStorageSync('_WX_State')){
|
|
|
- this.$store.commit('setLoginType',8)
|
|
|
- this.$store.commit('setLoginProductId',this.productID)
|
|
|
- this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
|
|
|
- }else{
|
|
|
- console.log(new Date +'用户未授权微信信息')
|
|
|
- this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
- }
|
|
|
+ authorize.getSetting().then(res =>{
|
|
|
+ console.log('用户是否授权过',res)
|
|
|
+ if(res == 1){
|
|
|
+ this.$store.commit('setLoginType',8)
|
|
|
+ this.$store.commit('setLoginProductId',this.productID)
|
|
|
+ this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
|
|
|
+ }else{
|
|
|
+ this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // if(uni.getStorageSync('_WX_State')){
|
|
|
+ // this.$store.commit('setLoginType',8)
|
|
|
+ // this.$store.commit('setLoginProductId',this.productID)
|
|
|
+ // this.$api.navigateTo(`/pages/login/login?id=${this.productID}`)
|
|
|
+ // }else{
|
|
|
+ // console.log(new Date +'用户未授权微信信息')
|
|
|
+ // this.$api.navigateTo('/pages/authorization/authorization?type=1')
|
|
|
+ // }
|
|
|
},
|
|
|
setHeaderBtnPosi(){
|
|
|
// 获得胶囊按钮位置信息
|