Commit 024edd4b by 高淑倩

modify: 弹框判断

parent 1d000e8c
......@@ -10,25 +10,25 @@ Component({
/**
* 组件的属性列表
*/
properties: {
bottom: {
type: Object,
value: {},
},
properties: {
bottom: {
type: Object,
value: {},
},
},
attached () {},
attached() { },
/**
* 组件的初始数据
*/
data: {
data: {
startX: 0,
startY: 0,
isAuthorization: false
},
},
/**
* 组件的方法列表
*/
methods: {
methods: {
touchStart(e) {
this.setData({
startX: e.changedTouches[0].clientX,
......@@ -39,48 +39,48 @@ Component({
let x = e.changedTouches[0].clientX;
let y = e.changedTouches[0].clientY;
// endX, endY, startX, startY
const {startX, startY} = this.data
const { startX, startY } = this.data
let isTouchLeft = utils.getTouchData(x, y, startX, startY)
// 触发左划事件
if(isTouchLeft == 'left') {
const {appid, path, link,item} = e.currentTarget.dataset
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
// 是当前小程序 直接跳转
if (wx.getStorageSync('_baseUserInfo')){
if (isTouchLeft == 'left') {
const { appid, path, link, item } = e.currentTarget.dataset
// 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)
if(link.type == 1) {
// type==1 外部 不用弹 没有登录弹
if (link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if(link.type == 2) {
} else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
}
if (link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if(link.type == 3) {
} 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) {
} else if (link.type == 4) {
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({
/**
* 组件的属性列表
*/
properties: {
imageData: {
type: Array,
value: [],
},
properties: {
imageData: {
type: Array,
value: [],
},
},
attached () {},
attached() { },
/**
* 组件的初始数据
*/
data: {
data: {
imgUrls: [],
indicatorDots: false,
autoplay: true,
......@@ -27,46 +27,49 @@ Component({
interval: 5000,
duration: 1000,
isAuthorization: false // false 不显示 true 显示
},
},
/**
* 组件的方法列表
*/
methods: {
preview(e) {
const {appid, path, link,item} = e.currentTarget.dataset
// 获取当前帐号信息
methods: {
preview(e) {
const { appid, path, link, item } = e.currentTarget.dataset
// 获取当前帐号信息
const userInfo = wx.getStorageSync('_baseUserInfo')
if (userInfo){
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}`)
}
}
// else {
// this.setData({
// isAuthorization: true
// })
// return false
// }
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
if (link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if (!userInfo) {
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({
/**
* 组件的属性列表
*/
properties: {
picNav: {
type: Array,
value: [],
},
properties: {
picNav: {
type: Array,
value: [],
},
},
attached () {},
attached() { },
/**
* 组件的初始数据
*/
data: {
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
isAuthorization: false
},
data: {
imagewidth: 0,//缩放后的宽
imageheight: 0,//缩放后的高
isAuthorization: false
},
/**
* 组件的方法列表
*/
methods: {
imageLoad(e) {
methods: {
imageLoad(e) {
let imageSize = utils.imageUtil(e)
this.setData({
imagewidth: imageSize.imageWidth,
imageheight: imageSize.imageHeight
})
},
preview(e) {
const {appid, path, link, item} = e.currentTarget.dataset
const {memberActivateStatus} = wx.getStorageSync('_baseUserInfo')
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
this.setData({
imagewidth: imageSize.imageWidth,
imageheight: imageSize.imageHeight
})
},
preview(e) {
const { appid, path, link, item } = e.currentTarget.dataset
const { memberActivateStatus } = wx.getStorageSync('_baseUserInfo')
// 获取当前帐号信息
const accountInfo = utils.getAccountInfo()
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
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}`)
// 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 (!userInfo) {
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()
}
}
}
}
})
......@@ -53,12 +53,17 @@ HandlerLink.prototype = {
} else if (type == 4) {
return `${item.link.url}`
} else if (type == 5) {
let currentOpen = ''
if(item.link.url == 1){
// 卡包
wxService.openCardList()
currentOpen = 1
return currentOpen
// wxService.openCardList()
} 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