Commit 024edd4b by 高淑倩

modify: 弹框判断

parent 1d000e8c
...@@ -16,7 +16,7 @@ Component({ ...@@ -16,7 +16,7 @@ Component({
value: {}, value: {},
}, },
}, },
attached () {}, attached() { },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
...@@ -39,48 +39,48 @@ Component({ ...@@ -39,48 +39,48 @@ Component({
let x = e.changedTouches[0].clientX; let x = e.changedTouches[0].clientX;
let y = e.changedTouches[0].clientY; let y = e.changedTouches[0].clientY;
// endX, endY, startX, startY // endX, endY, startX, startY
const {startX, startY} = this.data const { startX, startY } = this.data
let isTouchLeft = utils.getTouchData(x, y, startX, startY) let isTouchLeft = utils.getTouchData(x, y, startX, startY)
// 触发左划事件 // 触发左划事件
if(isTouchLeft == 'left') { if (isTouchLeft == 'left') {
const {appid, path, link,item} = e.currentTarget.dataset const { appid, path, link, item } = e.currentTarget.dataset
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
// 是当前小程序 直接跳转
if (wx.getStorageSync('_baseUserInfo')){
// navigateToMiniProgram:fail can only be invoked by user TAP gesture. // navigateToMiniProgram:fail can only be invoked by user TAP gesture.
if( link.type == 1) return false
// 更改数据问题 // 更改数据问题
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item) let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
// type==1 外部 不用弹 没有登录弹
if(link.type == 1) { if (link.type == 1) {
// 触发父组件更新页面 外部小程序 // 触发父组件更新页面 外部小程序
this.setData({ this.setData({
isAuthorization: false isAuthorization: false
}) })
return false return false
} else if(link.type == 2) { } else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
}
if (link.type == 2) {
// 触发父组件更新页面 // 触发父组件更新页面
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url }) this.triggerEvent('updatePage', { pageId: currentClickType.url })
}) })
} else if(link.type == 3) { } else if (link.type == 3) {
// 预览 // 预览
wx.previewImage({ wx.previewImage({
current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接 current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表 urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
}) })
} else if(link.type == 4) { } else if (link.type == 4) {
wxService.router(`${currentClickType}`) wxService.router(`${currentClickType}`)
} else if (link.type == 5) {
if (currentClickType == 1) {
wxService.openCardList()
} else if (currentClickType == 2) {
wxService.openCard()
} }
} }
// else{
// this.setData({
// isAuthorization: true
// })
// return false
// }
} }
} }
} }
......
...@@ -15,7 +15,7 @@ Component({ ...@@ -15,7 +15,7 @@ Component({
value: [], value: [],
}, },
}, },
attached () {}, attached() { },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
...@@ -33,40 +33,43 @@ Component({ ...@@ -33,40 +33,43 @@ Component({
*/ */
methods: { methods: {
preview(e) { preview(e) {
const {appid, path, link,item} = e.currentTarget.dataset const { appid, path, link, item } = e.currentTarget.dataset
// 获取当前帐号信息 // 获取当前帐号信息
const userInfo = wx.getStorageSync('_baseUserInfo') const userInfo = wx.getStorageSync('_baseUserInfo')
if (userInfo){
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item) let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
if (link.type == 1) {
if(link.type == 1) {
// 触发父组件更新页面 外部小程序 // 触发父组件更新页面 外部小程序
this.setData({ this.setData({
isAuthorization: false isAuthorization: false
}) })
return false return false
} else if(link.type == 2) { } else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
}
if (link.type == 2) {
// 触发父组件更新页面 // 触发父组件更新页面
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url }) this.triggerEvent('updatePage', { pageId: currentClickType.url })
}) })
} else if(link.type == 3) { } else if (link.type == 3) {
// 预览 // 预览
wx.previewImage({ wx.previewImage({
current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接 current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表 urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
}) })
} else if(link.type == 4) { } else if (link.type == 4) {
wxService.router(`${currentClickType}`) wxService.router(`${currentClickType}`)
} else if (link.type == 5) {
if (currentClickType == 1) {
wxService.openCardList()
} else if (currentClickType == 2) {
wxService.openCard()
} }
} }
// else {
// this.setData({
// isAuthorization: true
// })
// return false
// }
} }
} }
}) })
...@@ -15,7 +15,7 @@ Component({ ...@@ -15,7 +15,7 @@ Component({
value: [], value: [],
}, },
}, },
attached () {}, attached() { },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
...@@ -36,70 +36,46 @@ Component({ ...@@ -36,70 +36,46 @@ Component({
}) })
}, },
preview(e) { preview(e) {
const {appid, path, link, item} = e.currentTarget.dataset const { appid, path, link, item } = e.currentTarget.dataset
const {memberActivateStatus} = wx.getStorageSync('_baseUserInfo') const { memberActivateStatus } = wx.getStorageSync('_baseUserInfo')
// 获取当前帐号信息 // 获取当前帐号信息
const accountInfo = utils.getAccountInfo() const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo') const userInfo = wx.getStorageSync('_baseUserInfo')
if(accountInfo.miniProgram.appId == appid){
if (userInfo){
// if (!memberActivateStatus){
// wxService.openCard()
// }else{
// wxService.router(`${path}`)
// }
}else{
// if (path == '/pages/deliveryService/deliveryService') {
// wxService.router(`${path}`)
// return
// }
// this.setData({
// isAuthorization: true
// })
}
} else {
// 跳转其他小程序
// wx.navigateToMiniProgram({
// appId: appid,
// path: `${path}`,
// success: e => {
// console.log(e)
// },
// fail: e => {
// console.log(e)
// },
// complete: e => {
// console.log(e)
// },
// })
}
// if (!userInfo){
// this.setData({
// isAuthorization: true
// })
// return false
// }
// 2019.06.14 // 2019.06.14
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item) let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
if(link.type == 1) { if (link.type == 1) {
// 触发父组件更新页面 外部小程序 // 触发父组件更新页面 外部小程序
this.setData({ this.setData({
isAuthorization: false isAuthorization: false
}) })
return false return false
}else if(link.type == 2) { } else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
}
if (link.type == 2) {
// 触发父组件更新页面 // 触发父组件更新页面
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url }) this.triggerEvent('updatePage', { pageId: currentClickType.url })
}) })
} else if(link.type == 3) { } else if (link.type == 3) {
// 预览 // 预览
wx.previewImage({ wx.previewImage({
current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接 current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表 urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
}) })
} else if(link.type == 4) { } else if (link.type == 4) {
wxService.router(`${currentClickType}`) wxService.router(`${currentClickType}`)
} else if (link.type == 5) {
if (currentClickType == 1) {
wxService.openCardList()
} else if (currentClickType == 2) {
wxService.openCard()
}
} }
} }
} }
......
...@@ -53,12 +53,17 @@ HandlerLink.prototype = { ...@@ -53,12 +53,17 @@ HandlerLink.prototype = {
} else if (type == 4) { } else if (type == 4) {
return `${item.link.url}` return `${item.link.url}`
} else if (type == 5) { } else if (type == 5) {
let currentOpen = ''
if(item.link.url == 1){ if(item.link.url == 1){
// 卡包 // 卡包
wxService.openCardList() currentOpen = 1
return currentOpen
// wxService.openCardList()
} else if(item.link.url == 2){ } else if(item.link.url == 2){
// 激活领卡--开卡 // 激活领卡--开卡
wxService.openCard() currentOpen= 2
return currentOpen
// wxService.openCard()
} }
} }
} }
......
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