1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- const app = getApp();
- Component({
- data: {
- selected: 0,
- color: "#7A7E83",
- selectedColor: "#3cc51f",
- list: [
- {
- pagePath: "/pages/index/index",
- text: "首页",
- iconPath: "/static/tabbar/index.png",
- selectedIconPath: "/static/tabbar/index-active.png"
- },
- {
- pagePath: "/pages/store/store",
- text: "门店",
- iconPath: "/static/tabbar/store.png",
- selectedIconPath: "/static/tabbar/store-active.png"
- },
- {
- pagePath: "/pages/mine/mine",
- text: "我的",
- iconPath: "/static/tabbar/me.png",
- selectedIconPath: "/static/tabbar/me-active.png"
- }
- ],
- showShare: false,
- showAgreementModal:false,
- showPoster:false,
- programConfig: {}
- },
- lifetimes: {
- attached() {
- this.setData({
- programConfig: app.globalData.programConfig
- });
- }
- },
- methods: {
- switchTab(e) {
- const { path, index } = e.currentTarget.dataset
- wx.switchTab({ url: path })
- this.setData({ selected: index })
- },
- onCloseShare() {
- this.setData({ showShare: false })
- },
- openShare() {
- this.setData({ showShare: true })
- },
- openShowAgreementModal(){
- this.setData({ showAgreementModal: true })
- },
- onClosePoster(){
- this.setData({ showPoster: true })
- },
- openPoster() {
- this.setData({
- showShare:false,
- showPoster: true
- });
- },
- // 分享逻辑
- onShareAppMessage(res) {
- const shareType = res.target.dataset.type;
- if (shareType === 'poster') {
- // return {
- // title: '分享我的专属海报',
- // path: '/pages/index/index',
- // imageUrl: app.globalData.programConfig.share_img
- // }
- } else if (shareType === 'friend') {
- return {
- path: '/pages/index/index',
- imageUrl: app.globalData.programConfig.share_img
- }
- }
- }
- }
- })
|