| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export const refreshEnjoy = (obj) =>{ |
| | | let child = obj.selectComponent('.buoyClient'); |
| | | // 调用子组件中定义的方法 |
| | | if(child){ |
| | | child.freshData(); |
| | | } |
| | | } |
| | |
| | | type: String, |
| | | value: '0' |
| | | } |
| | | }, |
| | | attached() { |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | this.setData({ enjoyList }) |
| | | }, |
| | | attached() { |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | this.setData({ enjoyList }) |
| | | }, |
| | | /** |
| | | * 组件的初始数据 |
| | |
| | | * 组件的方法列表 |
| | | */ |
| | | methods: { |
| | | freshData() { |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | this.setData({ enjoyList }) |
| | | }, |
| | | jumpPage(e) { |
| | | const urls = [ '/pages/kefu/fond', '/pages/store/staff' ] |
| | | const i = e.currentTarget.dataset.i |
| | |
| | | import { actionDo, getWholecaseInfo } from '../../api/index' |
| | | import { actionDo, getWholecaseInfo,refreshEnjoy } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | // } |
| | | // }, |
| | | handleEnjoy(e) { |
| | | const info = this.data.info |
| | | if(info.id == null ){ |
| | | return |
| | | } |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | const { type, flag } = e.detail |
| | | console.log('type', type); |
| | | console.log('flag', flag); |
| | | const info = this.data.info |
| | | console.log('flag', flag); |
| | | if(type == 'enjoy'){ |
| | | // 点击了喜欢 |
| | | const index = enjoyList.findIndex( i => i.id === info.id ) |
| | |
| | | enjoyList.splice(index, 1) |
| | | } |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | refreshEnjoy(this) |
| | | }else{ |
| | | actionDo({ |
| | | id: info.id, |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | refreshEnjoy(this) |
| | | }, |
| | | |
| | | /** |
| | |
| | | import { |
| | | shareContent, |
| | | getProductInfo, |
| | | actionDo |
| | | actionDo, |
| | | refreshEnjoy |
| | | } from '../../api/index' |
| | | import moment from "moment"; |
| | | Page({ |
| | |
| | | id: '', |
| | | info: {}, |
| | | member: {}, |
| | | showShare: false |
| | | showShare: false, |
| | | enjoyList: [] |
| | | }, |
| | | onShow(){ |
| | | console.log('onShow') |
| | | refreshEnjoy(this) |
| | | }, |
| | | onHide() { |
| | | console.log('onHide') |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | member |
| | | }) |
| | | }, |
| | | |
| | | // 组件事件 |
| | | handleEnjoy(e) { |
| | | const info = this.data.info |
| | | if(info.id == null ){ |
| | | return |
| | | } |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | const { type, flag } = e.detail |
| | | console.log('type', type); |
| | | console.log('flag', flag); |
| | | const info = this.data.info |
| | | console.log('flag', flag); |
| | | if(type == 'enjoy'){ |
| | | // 点击了喜欢 |
| | | const index = enjoyList.findIndex( i => i.id === info.id ) |
| | |
| | | enjoyList.splice(index, 1) |
| | | } |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | refreshEnjoy(this) |
| | | }else{ |
| | | actionDo({ |
| | | id: info.id, |
| | |
| | | <view class="main_app"> |
| | | <buoyClient showPurpose="1" /> |
| | | <buoyClient class="buoyClient" showPurpose="1" class="buoyClient"/> |
| | | <detailFooter bindenjoy="handleEnjoy" path="0" info="{{info}}" /> |
| | | <!-- banner轮播 --> |
| | | <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration> |
| | |
| | | import { getRealcaseInfo, actionDo } from '../../api/index' |
| | | import { getRealcaseInfo, actionDo ,refreshEnjoy} from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onShow(){ |
| | | refreshEnjoy(this) |
| | | }, |
| | | onLoad(options) { |
| | | var app = getApp().globalData |
| | | this.setData({ |
| | |
| | | }) |
| | | }, |
| | | handleEnjoy(e) { |
| | | const info = this.data.info |
| | | if(info.id == null ){ |
| | | return |
| | | } |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | const { type, flag } = e.detail |
| | | console.log('type', type); |
| | | console.log('flag', flag); |
| | | const info = this.data.info |
| | | console.log('flag', flag); |
| | | if(type == 'enjoy'){ |
| | | // 点击了喜欢 |
| | | const index = enjoyList.findIndex( i => i.id === info.id ) |
| | |
| | | enjoyList.splice(index, 1) |
| | | } |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | refreshEnjoy(this) |
| | | }else{ |
| | | actionDo({ |
| | | id: info.id, |
| | |
| | | item.checked = false |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | console.log(this.data.enjoyList) |
| | | this.initData() |
| | | }, |
| | | |
| | |
| | | } |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | |
| | | this.initData() |
| | | }, |
| | | itemClick(e) { |
| | |
| | | } |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyListTemp) |
| | | |
| | | that.initData() |
| | | } |
| | | } |
| | |
| | | item.checked = !item.checked |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | |
| | | this.initData() |
| | | }, |
| | | openShare() { |
| | |
| | | // export const baseUrl = 'http://192.168.0.135:10027' |
| | | export const baseUrl = 'https://dmtest.ahapp.net/web_interface' // 本地 |
| | | export const baseUrl = 'http://192.168.0.135:10027' |
| | | // export const baseUrl = 'https://dmtest.ahapp.net/web_interface' // 本地 |
| | | // export const baseUrl = 'http://zbtest.ahapp.net/zbom_interface/jx/wechat/' //测试服务器 |
| | | |
| | | // export const imageUrl = 'https://osswebcdn.zbom.com/jiaxuan/images/' |