Commit ecbdba7a by 李伟康

提交代码

1 parent 0b6927e3
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
{ {
"root": "packageIndex", "root": "packageIndex",
"pages": [ "pages": [
"pages/index/index" "pages/index/index",
"pages/bannerJumpPage/bannerJumpPage"
] ]
}, },
{ {
......
/* packageEquity/pages/agreement/index.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/commodity/charge/charge.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/commodity/chargeDetail/chargeDetail.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/commodity/detail/detail.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/commodity/list/list.wxss */
\ No newline at end of file \ No newline at end of file
/* packageEquity/pages/package/package.wxss */
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/bannerJumpPage/bannerJumpPage.js
Page({
/**
* 页面的初始数据
*/
data: {
infoData: {},
titleList: ['商品', '图文介绍', '视频介绍']
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(e) {
let { titleList } = this.data
if (e && e.title) {
wx.setNavigationBarTitle({
title: e.title
})
} else {
wx.setNavigationBarTitle({
title: titleList[e.bannerType - 1]
})
}
this.setData({
infoData: e || {}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/bannerJumpPage/bannerJumpPage.wxss */
.content{
width: 100%;
min-height: 100vh;
background: #000;
display: flex;
justify-content: center;
align-items: center;
}
.content video{
width: 100%;
height: 100vh;
}
\ No newline at end of file \ No newline at end of file
<!--packageIndex/pages/bannerJumpPage/bannerJumpPage.wxml-->
<view class="content">
<image wx:if="{{infoData.bannerType == 2}}" src="{{infoData.linkUrl}}" mode="widthFix"></image>
<video wx:if="{{infoData.bannerType == 3}}" src="{{infoData.linkUrl}}"></video>
</view>
...@@ -36,7 +36,7 @@ Page({ ...@@ -36,7 +36,7 @@ Page({
console.log(data, '=============') console.log(data, '=============')
//scenc获取页面参数并跳转 //scenc获取页面参数并跳转
if (options.scene) { if (options.scene) {
return return this.getSceneById(options.scene)
} }
if (options.url) { if (options.url) {
return this.jumpPage(options.url) return this.jumpPage(options.url)
...@@ -49,6 +49,21 @@ Page({ ...@@ -49,6 +49,21 @@ Page({
} }
}, },
async getSceneById(scene) {
const id = decodeURIComponent(scene).split('=').at(-1)
try {
const {
code,
data
} = await wx.p.api.wechatApi.getSceneById({
id
})
if (code == 0) this.jumpPage(data.scene)
else throw {}
} catch (error) {
wx.p.wxApi.showToast(error || '获取scene失败')
}
},
jumpPage(val) { jumpPage(val) {
const targetPath = decodeURIComponent(val), const targetPath = decodeURIComponent(val),
{ {
......
// components/banner/banner.js // components/banner/banner.js
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
bannerList: { bannerList: {
type: Array, type: Array,
value: [] value: []
} }
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
jumpGoods(e) {
let {
id,
url,
equity,
item
} = e.currentTarget.dataset
if (id) wx.p.router.go('/packageMall/pages/detail/detail', {
id,
isActivity: false,
notIntercept: true
})
else if (equity) wx.p.router.go('/packageEquity/pages/allEquity/allEquity')
else if (url) wx.p.router.go('/packageIndex/pages/bannerJumpPage/bannerJumpPage', item)
}, },
changePage(e) {
/** let {
* 组件的初始数据 bannerList
*/ } = this.data
data: { bannerList.map(i => i.active = false)
let {
current
} = e.detail
bannerList[current].active = true
this.setData({
bannerList
})
}, },
/**
* 组件的方法列表
*/
methods: {
jumpGoods(e) {
let {
id,
url,
equity,
item
} = e.currentTarget.dataset
if (id) {
wx.p.router.go('/packageShopmall/packageMall/pages/detail/detail', {
id,
isActivity: false,
notIntercept: true
})
} else if (equity) {
wx.p.router.go('/packageShopmall/packageEquity/pages/allEquity/allEquity')
} else {
if (url) wx.p.router.go('/packageShopmall/packageIndex/pages/bannerJumpPage/bannerJumpPage', item)
}
},
changePage(e) {
let {
bannerList
} = this.data
bannerList.map(i => i.active = false)
let {
current
} = e.detail
bannerList[current].active = true
this.setData({
bannerList
})
},
}
})
\ No newline at end of file \ No newline at end of file
}
})
\ No newline at end of file \ No newline at end of file
...@@ -156,6 +156,7 @@ Page({ ...@@ -156,6 +156,7 @@ Page({
this.setData({ this.setData({
noticeContent: '' noticeContent: ''
}) })
this.getHomeConfig()
this.getActivityList() this.getActivityList()
}, },
onReachBottom() { onReachBottom() {
......
...@@ -27,6 +27,8 @@ Page({ ...@@ -27,6 +27,8 @@ Page({
} = this.data } = this.data
if (userInfo) { if (userInfo) {
this.getOrderNumberList() this.getOrderNumberList()
this.toCheckMember()
this.getMemberCardData()
} }
}, },
navbarReady(e) { navbarReady(e) {
...@@ -56,6 +58,45 @@ Page({ ...@@ -56,6 +58,45 @@ Page({
}) })
}) })
}, },
// 获取用户会员信息
toCheckMember() {
wx.p.router.intercept(false).then(sid => {
if (sid) {
this.setData({
isMember: false
})
} else {
wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false
if (res.data && res.data.validitDate) {
res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd')
}
if (res.code == 0 && res.data) {
flag = true
}
wx.p.storage.set('isVIP', flag)
this.setData({
isMember: flag,
vipInfo: res.data
})
})
}
})
},
// 获取门店会员卡信息
getMemberCardData() {
const {merchantId} = wx.p.storage.get('merchant_info')
let para = {
merchantId
}
wx.p.wxApi.equityApi.memberCard(para).then(res => {
this.setData({
memberInfo: res
})
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!