| | |
| | | data |
| | | }) |
| | | } |
| | | // 获取内容分享海报 |
| | | export const getContentShareImg = (data) => { |
| | | return request({ |
| | | url: '/web/personnel/getContentShareImg', |
| | | method: 'POST', |
| | | data |
| | | }) |
| | | } |
| | | // 0元定制信息 |
| | | export const saveFreeCustomizationApply = (data) => { |
| | | return request({ |
| | |
| | | // components/detailFooter/index.js |
| | | import { getContentShareImg } from '../../api/index' |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | | */ |
| | | properties: { |
| | | |
| | | info: Object, |
| | | path: String, |
| | | }, |
| | | |
| | | /** |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | handleEnjoy() { |
| | | const { info } = this.data |
| | | this.triggerEvent('enjoy', { |
| | | type: 'enjoy', flag: !info.isEnjoy |
| | | }) |
| | | }, |
| | | handleCollec() { |
| | | const { info } = this.data |
| | | this.triggerEvent('enjoy', { |
| | | type: 'collec', flag: !info.isCollection |
| | | }) |
| | | }, |
| | | handleDown() { |
| | | const { info, path } = this.data |
| | | getContentShareImg({ |
| | | articleId: info.id, |
| | | type: '1', |
| | | pageUrl: path, |
| | | imgurl: info.coverImage, |
| | | |
| | | }) |
| | | }, |
| | | openShare() { |
| | | console.log('点击打开'); |
| | | this.setData({ showShare: true }) |
| | |
| | | <view class="footer_wrap" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="content"> |
| | | <view class="btns"> |
| | | <view class="item"> |
| | | <image src="../../static/icon/detail_nav_like_sel@2x.png"></image> |
| | | <view bindtap="handleEnjoy" class="item"> |
| | | <image wx:if="{{ info.isEnjoy }}" src="../../static/icon/detail_nav_like_sel@2x.png"></image> |
| | | <image wx:else src="../../static/icon/detail_nav_like@2x.png"></image> |
| | | <text>喜欢</text> |
| | | </view> |
| | | <view class="item"> |
| | | <image src="../../static/icon/detail_nav_collected.png"></image> |
| | | <view bindtap="handleCollec" class="item"> |
| | | <image wx:if="{{ info.isCollection }}" src="../../static/icon/detail_nav_collected.png"></image> |
| | | <image wx:else src="../../static/icon/detail_nav_collect.png"></image> |
| | | <text>收藏</text> |
| | | </view> |
| | | <view class="item"> |
| | | <view bindtap="handleDown" class="item"> |
| | | <image src="../../static/icon/detail_nav_download@2x.png"></image> |
| | | <text>下载</text> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | <!-- --> |
| | | <view class="shade_modal" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view wx:if="{{ showShare }}" class="shade_modal" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button open-type="share" class="item" bindtap="handleShare"> |
| | | <image src="../../static/icon/wechat.png"></image> |
| | |
| | | </view> |
| | | <view bindtap="onClose" class="cancel">取消</view> |
| | | </view> |
| | | <view class="shade" bindtap="onClose"></view> |
| | | <view wx:if="{{ showShare }}" class="shade" bindtap="onClose"></view> |
| | | </view> |
| | |
| | | <view class="content"> |
| | | <view class="name">{{ item.title }}</view> |
| | | <view class="info"> |
| | | <image wx:if="{{ !item.collection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:if="{{ !item.isCollection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like_cancel" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{item.collection ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <text class="num {{item.isCollection ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image> |
| | | <text>{{ item.viewCount }}</text> |
| | | </view> |
| | |
| | | <view class="name">{{ item.title }}</view> |
| | | </view> |
| | | <view class="info"> |
| | | <image wx:if="{{ !item.collection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:if="{{ !item.isCollection }}" data-code="like" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <image wx:else data-code="like_cancel" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <text class="num {{item.collection ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <text class="num {{item.isCollection ? 'primary' : ''}}">{{ item.collectCount }}</text> |
| | | <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image> |
| | | <text>{{ item.viewCount }}</text> |
| | | </view> |
| | |
| | | actionType, |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.collection = !info.collection |
| | | info.isCollection = !info.isCollection |
| | | this.setData({info}) |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.collection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="collect" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </button> |
| | |
| | | getProductInfo, |
| | | actionDo |
| | | } from '../../api/index' |
| | | import moment from "moment"; |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | member |
| | | }) |
| | | }, |
| | | // 组件事件 |
| | | handleEnjoy(e) { |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | const { type, flag } = e.detail |
| | | console.log('type', type); |
| | | console.log('flag', flag); |
| | | const info = this.data.info |
| | | if(type == 'enjoy'){ |
| | | // 点击了喜欢 |
| | | const index = enjoyList.findIndex( i => i.id === info.id ) |
| | | if(index === -1){ |
| | | info.isEnjoy = true |
| | | this.setData({ info }) |
| | | enjoyList.push({ |
| | | ...info, |
| | | joinType: 'product', |
| | | timestamp: new Date().getTime() |
| | | }) |
| | | }else{ |
| | | info.isEnjoy = false |
| | | this.setData({ info }) |
| | | enjoyList.splice(index, 1) |
| | | } |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | }else{ |
| | | actionDo({ |
| | | id: info.id, |
| | | actionType: flag ? 'collect' : 'collect_cancel' |
| | | }).then(res => { |
| | | info.isCollection = flag |
| | | wx.showToast({title: flag ? '收藏成功' : '取消收藏'}) |
| | | this.setData({ |
| | | info |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | handleAction(e) { |
| | | const actionType = e.currentTarget.dataset.code |
| | | const { |
| | |
| | | actionType, |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.collection = !info.collection |
| | | info.isCollection = !info.isCollection |
| | | this.setData({ |
| | | info |
| | | }) |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | onShareAppMessage() { |
| | | console.log('用户点击了分享'); |
| | | }, |
| | | getDetail(id) { |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | getProductInfo({ |
| | | id |
| | | }).then(res => { |
| | | const index = enjoyList.findIndex( i => i.id === res.data.id ) |
| | | this.setData({ |
| | | info: res.data |
| | | info: { |
| | | ...res.data, |
| | | isEnjoy: index > -1 |
| | | } |
| | | }) |
| | | wx.setNavigationBarTitle({ |
| | | title: res.data.title |
| | |
| | | <view class="main_app"> |
| | | <buoyClient showPurpose="1" /> |
| | | <detailFooter /> |
| | | <view class="user" wx:if="{{ false }}"> |
| | | <view class="avatar"></view> |
| | | <view class="content"> |
| | | <view class="name">丁梓林</view> |
| | | <view class="desc">导购|5年经验</view> |
| | | </view> |
| | | <view class="btn">联系TA</view> |
| | | </view> |
| | | <detailFooter bindenjoy="handleEnjoy" path="/pages/detailDis/product" info="{{info}}" /> |
| | | <!-- banner轮播 --> |
| | | <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration> |
| | | <block wx:for="{{ info.bannerImgList }}"> |
| | |
| | | </view> |
| | | </view> |
| | | <!-- 富文本 --> |
| | | <view> |
| | | <view wx:if="{{info.content}}"> |
| | | <mp-html content="{{info.content}}"></mp-html> |
| | | </view> |
| | | <view class="spaceList"> |
| | |
| | | actionType, |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.collection = !info.collection |
| | | info.isCollection = !info.isCollection |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | | }) |
| | |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button class="item btn"> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.collection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image data-code="collect_cancel" bindtap="handleAction" wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else data-code="collect" bindtap="handleAction" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </button> |
| | |
| | | // pages/kefu/fond.js |
| | | import moment from "moment"; |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | bottomLift: 0 |
| | | bottomLift: 0, |
| | | enjoyList: [] |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.setData({ |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | this.initData() |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | initData() { |
| | | let temp = [] |
| | | let enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | enjoyList = enjoyList.sort((a,b)=>{ |
| | | return b.timestamp - a.timestamp |
| | | }) |
| | | enjoyList.forEach(item => { |
| | | item.joinDate = moment(item.timestamp).format('YYYY年MM月DD日') |
| | | item.joinTime = moment(item.timestamp).format('HH:mm') |
| | | item.checked = false |
| | | const index = temp.findIndex( i => i.joinDate === item.joinDate ) |
| | | if(index === -1){ |
| | | temp.push({ |
| | | joinDate: item.joinDate, |
| | | list: [item] |
| | | }) |
| | | }else{ |
| | | temp[index].list.push(item) |
| | | } |
| | | }); |
| | | this.setData({ enjoyList: temp }) |
| | | |
| | | |
| | | console.log('enjoyList', temp); |
| | | |
| | | }, |
| | | onReady() { |
| | | |
| | | }, |
| | |
| | | border-radius: 8rpx; |
| | | margin-left: 26rpx; |
| | | margin-right: 20rpx; |
| | | border: 1px solid; |
| | | } |
| | | } |
| | | } |
| | |
| | | <view class="container"> |
| | | <view class="date_item"> |
| | | <view class="date">2024年07月10日</view> |
| | | <view wx:for="{{ enjoyList }}" wx:for-item="day" class="date_item"> |
| | | <view class="date">{{ day.joinDate }}</view> |
| | | <view class="list"> |
| | | <view class="line"> |
| | | <image class="icon" src="../../static/icon/ic_select_sel@2x.png" mode="widthFix"></image> |
| | | <image class="icon" src="../../static/icon/ic_select@2x.png" mode="widthFix"></image> |
| | | <image class="img" src=""></image> |
| | | <view class="line" wx:for="{{ day.list }}" wx:for-item="item"> |
| | | <image wx:if="{{ item.check }}" class="icon" src="../../static/icon/ic_select_sel@2x.png" mode="widthFix"></image> |
| | | <image wx:else class="icon" src="../../static/icon/ic_select@2x.png" mode="widthFix"></image> |
| | | <image class="img" src="{{ item.coverImage }}" mode="aspectFill"></image> |
| | | <view class="content"> |
| | | <view class="name">简约轻奢|万科公园里,已光为媒简约轻奢|万科公园里,已光为媒简约轻奢|万科公园里,已光为媒</view> |
| | | <view class="time">18:00</view> |
| | | <view class="name">{{ item.title }}</view> |
| | | <view class="time">{{ item.joinTime }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | border-radius: 8rpx; |
| | | margin-left: 26rpx; |
| | | margin-right: 20rpx; |
| | | border: 1px solid; |
| | | } |
| | | .footer { |
| | | position: fixed; |
| | |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/promotion/index", |
| | | "query": "", |
| | | "pathName": "pages/detailDis/product", |
| | | "query": "id=1813372914895843329", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | }, |
| | |
| | | "query": "", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/kefu/fond", |
| | | "query": "", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | } |
| | | ] |
| | | } |
| | |
| | | |
| | | |
| | | // 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/' |