Commit 024edd4b by 高淑倩

modify: 弹框判断

parent 1d000e8c
...@@ -10,25 +10,25 @@ Component({ ...@@ -10,25 +10,25 @@ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
bottom: { bottom: {
type: Object, type: Object,
value: {}, value: {},
}, },
}, },
attached () {}, attached() { },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
startX: 0, startX: 0,
startY: 0, startY: 0,
isAuthorization: false isAuthorization: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
touchStart(e) { touchStart(e) {
this.setData({ this.setData({
startX: e.changedTouches[0].clientX, startX: e.changedTouches[0].clientX,
...@@ -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
// }
} }
} }
} }
......
...@@ -9,17 +9,17 @@ Component({ ...@@ -9,17 +9,17 @@ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
imageData: { imageData: {
type: Array, type: Array,
value: [], value: [],
}, },
}, },
attached () {}, attached() { },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
imgUrls: [], imgUrls: [],
indicatorDots: false, indicatorDots: false,
autoplay: true, autoplay: true,
...@@ -27,46 +27,49 @@ Component({ ...@@ -27,46 +27,49 @@ Component({
interval: 5000, interval: 5000,
duration: 1000, duration: 1000,
isAuthorization: false // false 不显示 true 显示 isAuthorization: false // false 不显示 true 显示
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
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({
// 触发父组件更新页面 外部小程序 isAuthorization: false
this.setData({ })
isAuthorization: false return false
}) } else if (!userInfo) {
return false this.setData({
} else if(link.type == 2) { isAuthorization: true
// 触发父组件更新页面 })
wxService.nextTick(() => { return false
this.triggerEvent('updatePage', { pageId: currentClickType.url }) }
})
} else if(link.type == 3) {
// 预览
wx.previewImage({
current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if(link.type == 4) {
wxService.router(`${currentClickType}`)
}
}
// else {
// this.setData({
// isAuthorization: true
// })
// return false
// }
if (link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if (link.type == 3) {
// 预览
wx.previewImage({
current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (link.type == 4) {
wxService.router(`${currentClickType}`)
} else if (link.type == 5) {
if (currentClickType == 1) {
wxService.openCardList()
} else if (currentClickType == 2) {
wxService.openCard()
}
}
} }
} }
}) })
...@@ -9,98 +9,74 @@ Component({ ...@@ -9,98 +9,74 @@ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
picNav: { picNav: {
type: Array, type: Array,
value: [], value: [],
}, },
}, },
attached () {}, attached() { },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
imagewidth: 0,//缩放后的宽 imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高 imageheight: 0,//缩放后的高
isAuthorization: false isAuthorization: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
imageLoad(e) { imageLoad(e) {
let imageSize = utils.imageUtil(e) let imageSize = utils.imageUtil(e)
this.setData({ this.setData({
imagewidth: imageSize.imageWidth, imagewidth: imageSize.imageWidth,
imageheight: imageSize.imageHeight imageheight: imageSize.imageHeight
}) })
}, },
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){ // 2019.06.14
// if (!memberActivateStatus){ let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
// wxService.openCard() if (link.type == 1) {
// }else{ // 触发父组件更新页面 外部小程序
// wxService.router(`${path}`) this.setData({
// } isAuthorization: false
}else{ })
// if (path == '/pages/deliveryService/deliveryService') { return false
// wxService.router(`${path}`) } else if (!userInfo) {
// return this.setData({
// } isAuthorization: true
// this.setData({ })
// isAuthorization: true return false
// }) }
}
} else { if (link.type == 2) {
// 跳转其他小程序 // 触发父组件更新页面
// wx.navigateToMiniProgram({ wxService.nextTick(() => {
// appId: appid, this.triggerEvent('updatePage', { pageId: currentClickType.url })
// path: `${path}`, })
// success: e => { } else if (link.type == 3) {
// console.log(e) // 预览
// }, wx.previewImage({
// fail: e => { current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
// console.log(e) urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
// }, })
// complete: e => { } else if (link.type == 4) {
// console.log(e) wxService.router(`${currentClickType}`)
// }, } else if (link.type == 5) {
// }) if (currentClickType == 1) {
} wxService.openCardList()
// if (!userInfo){ } else if (currentClickType == 2) {
// this.setData({ wxService.openCard()
// isAuthorization: true
// })
// return false
// }
// 2019.06.14
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
if(link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
}else if(link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if(link.type == 3) {
// 预览
wx.previewImage({
current: `https://images.unsplash.com/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`http://testimg3.bigaka.com/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if(link.type == 4) {
wxService.router(`${currentClickType}`)
} }
}
} }
} }
}) })
...@@ -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