| | |
| | | data |
| | | }) |
| | | } |
| | | export const getUserCard = (data) => { |
| | | // 批量添加喜欢给客户 |
| | | export const batchAddLike = (data) => { |
| | | return request({ |
| | | url: '/web/personnel/getUserCard', |
| | | url: '/web/personnel/batchAddLike', |
| | | method: "POST", |
| | | data |
| | | }) |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 小程序注销 |
| | | export const getCrmAuthUrl = (data) => { |
| | | return request({ |
| | | url: '/web/customer/getCrmAuthUrl', |
| | |
| | | }) |
| | | }, |
| | | batchDown() { |
| | | console.log('点解了下载'); |
| | | this.triggerEvent('down') |
| | | setTimeout(() => { |
| | | eventBus.emit('batchDown', [1,2,3]) |
| | | }, 1000) |
| | | wx.navigateTo({ |
| | | url: '/pages/download/index', |
| | | setTimeout(() => { |
| | | wx.navigateTo({ |
| | | url: '/pages/download/index', |
| | | }, 1000) |
| | | }) |
| | | }, |
| | | closeCard() { |
| | |
| | | this.setData({ info }) |
| | | enjoyList.push({ |
| | | ...info, |
| | | joinType: 'product', |
| | | joinType: '1', |
| | | timestamp: new Date().getTime() |
| | | }) |
| | | }else{ |
| | |
| | | this.setData({ info }) |
| | | enjoyList.push({ |
| | | ...info, |
| | | joinType: 'product', |
| | | joinType: '0', |
| | | timestamp: new Date().getTime() |
| | | }) |
| | | }else{ |
| | |
| | | <view class="main_app"> |
| | | <buoyClient showPurpose="1" /> |
| | | <detailFooter bindenjoy="handleEnjoy" path="0" info="{{info}}" /> |
| | | <detailFooter binddown="handleDown" bindenjoy="handleEnjoy" path="0" info="{{info}}" /> |
| | | <!-- banner轮播 --> |
| | | <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration> |
| | | <block wx:for="{{ info.bannerImgList }}"> |
| | |
| | | this.setData({ info }) |
| | | enjoyList.push({ |
| | | ...info, |
| | | joinType: 'product', |
| | | joinType: '2', |
| | | timestamp: new Date().getTime() |
| | | }) |
| | | }else{ |
| | |
| | | import moment from "moment"; |
| | | import { getContentShareImg } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | */ |
| | | data: { |
| | | bottomLift: 0, |
| | | checkAll: false, |
| | | enjoyList: [] |
| | | }, |
| | | |
| | |
| | | this.setData({ |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | let enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | enjoyList.forEach(item => { |
| | | item.checked = false |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | this.initData() |
| | | }, |
| | | |
| | |
| | | enjoyList = enjoyList.sort((a,b)=>{ |
| | | return b.timestamp - a.timestamp |
| | | }) |
| | | let count = 0 |
| | | enjoyList.forEach(item => { |
| | | if(item.checked){ |
| | | count++ |
| | | } |
| | | 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({ |
| | |
| | | }else{ |
| | | temp[index].list.push(item) |
| | | } |
| | | }); |
| | | }) |
| | | this.setData({ checkAll: count === enjoyList.length }) |
| | | this.setData({ enjoyList: temp }) |
| | | |
| | | |
| | | console.log('enjoyList', temp); |
| | | |
| | | }, |
| | | itemCheck(e){ |
| | | const { enjoyList } = this.data |
| | | const { index, inde } = e.currentTarget.dataset |
| | | enjoyList[index].list[inde].check = !enjoyList[index].list[inde].check |
| | | this.setData({ enjoyList }) |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | const { id } = e.currentTarget.dataset |
| | | console.log(id); |
| | | enjoyList.forEach(item => { |
| | | if(item.id === id){ |
| | | item.checked = !item.checked |
| | | } |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | this.initData() |
| | | }, |
| | | bind() { |
| | | wx.navigateTo({ |
| | | url: '/pages/kefu/select', |
| | | }) |
| | | }, |
| | | handleDown() { |
| | | const { |
| | | info, |
| | | path |
| | | } = this.data |
| | | const { enjoyList } = this.data |
| | | let obj = {} |
| | | enjoyList.forEach(item => { |
| | | item.list.forEach(ite => { |
| | | if(ite.checked){ |
| | | obj = ite |
| | | } |
| | | }) |
| | | }) |
| | | console.log('obj', obj); |
| | | let that = this |
| | | getContentShareImg({ |
| | | articleId: path + '&' + info.id, |
| | | articleId: obj.id + '&' + obj.joinType, |
| | | type: '1', |
| | | // pageUrl: path, |
| | | imgurl: info.coverImage, |
| | | imgurl: obj.coverImage, |
| | | }).then(res => { |
| | | this.setData({ |
| | | isShowPoster: true, |
| | | showShare: false, |
| | | posterUrl: res.data |
| | | }) |
| | | |
| | | }) |
| | | }, |
| | | saveCard() { |
| | |
| | | closeCard() { |
| | | this.setData({ isShowPoster: false }) |
| | | }, |
| | | itemDel() { |
| | | let that = this |
| | | let ids = [] |
| | | let { enjoyList } = this.data |
| | | enjoyList.forEach(item => { |
| | | item.list.forEach(ite => { |
| | | if(ite.checked){ |
| | | ids.push(ite.id) |
| | | } |
| | | }) |
| | | }) |
| | | if(ids.length === 0) return wx.showToast({ |
| | | title: '请先选择要删除的产品',icon: 'none' |
| | | }) |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '你确认要删除该产品吗', |
| | | success (res) { |
| | | if (res.confirm) { |
| | | let enjoyListTemp = wx.getStorageSync('enjoyList') || [] |
| | | ids.forEach(item => { |
| | | const index = enjoyListTemp.findIndex(i => i.id == item) |
| | | console.log('index', index); |
| | | if(index > -1){ |
| | | enjoyListTemp.splice(index, 1) |
| | | } |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyListTemp) |
| | | that.initData() |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | checkAll() { |
| | | let enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | enjoyList.forEach(item => { |
| | | item.checked = !item.checked |
| | | }) |
| | | wx.setStorageSync('enjoyList', enjoyList) |
| | | this.initData() |
| | | }, |
| | | openShare() { |
| | | console.log('点击打开'); |
| | | let count = 0 |
| | | const { enjoyList } = this.data |
| | | enjoyList.forEach(item => { |
| | | item.list.forEach(ite => { |
| | | if(ite.checked){ |
| | | count ++ |
| | | } |
| | | }) |
| | | }) |
| | | if(count != 1) return wx.showToast({ |
| | | title: '有且只能选择一个产品',icon: 'none' |
| | | }) |
| | | this.setData({ |
| | | showShare: true |
| | | }) |
| | |
| | | padding-bottom: 220rpx; |
| | | } |
| | | .date_item{ |
| | | position: relative; |
| | | .date{ |
| | | display: flex; |
| | | font-weight: 500; |
| | |
| | | width: 160rpx; |
| | | .icon{ |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | margin-right: 18rpx; |
| | | } |
| | | } |
| | |
| | | position: fixed; |
| | | bottom: 0; |
| | | width: 100%; |
| | | z-index: 9999; |
| | | z-index: 99999; |
| | | background-color: #fff; |
| | | border-radius: 24rpx 24rpx 0rpx 0rpx; |
| | | .btns{ |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | z-index: 1000; |
| | | z-index: 99; |
| | | background-color: rgba(0,0,0,.5); |
| | | } |
| | | .card_wrap{ |
| | |
| | | <view class="date">{{ day.joinDate }}</view> |
| | | <view class="list"> |
| | | <view class="line" wx:for="{{ day.list }}" wx:for-index="inde" wx:for-item="item"> |
| | | <image data-index="{{index}}" data-inde="{{inde}}" bindtap="itemCheck" wx:if="{{ item.check }}" class="icon" src="../../static/icon/ic_select_sel@2x.png"></image> |
| | | <image data-index="{{index}}" data-inde="{{inde}}" bindtap="itemCheck" wx:else class="icon" src="../../static/icon/ic_select@2x.png"></image> |
| | | <image data-id="{{item.id}}" bindtap="itemCheck" wx:if="{{ item.checked }}" class="icon" src="../../static/icon/ic_select_sel@2x.png"></image> |
| | | <image data-id="{{item.id}}" bindtap="itemCheck" wx:else class="icon" src="../../static/icon/ic_select@2x.png"></image> |
| | | <image class="img" src="{{ item.coverImage }}" mode="aspectFill"></image> |
| | | <view class="content"> |
| | | <view class="name">{{ item.title }}</view> |
| | |
| | | <!-- footer --> |
| | | <view class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <view class="all_sel"> |
| | | <image class="icon" src="../../static/icon/ic_select_sel@2x.png" mode="widthFix"></image> |
| | | <view bindtap="checkAll" class="all_sel"> |
| | | <image wx:if="{{ checkAll }}" 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> |
| | | <text>全选</text> |
| | | </view> |
| | | <view class="list"> |
| | | <view class="item">删除</view> |
| | | <view class="item paina">关联</view> |
| | | <view bindtap="itemDel" class="item">删除</view> |
| | | <view bindtap="bind" class="item paina">关联</view> |
| | | <view bindtap="openShare" class="item primary">分享</view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | <view bindtap="onClose" class="cancel">取消</view> |
| | | </view> |
| | | <view wx:if="{{ showShare }}" class="shade" bindtap="onClose"></view> |
| | | <van-overlay z-index="99998" show="{{ showShare }}" bind:click="onClose" /> |
| | | |
| | | <!-- --> |
| | | <view wx:if="{{ isShowPoster }}" class="card_wrap"> |
| | |
| | | background-color: #f7f7f7; |
| | | padding-bottom: 220rpx; |
| | | } |
| | | .date_item { |
| | | position: relative; |
| | | } |
| | | .date_item .date { |
| | | display: flex; |
| | | font-weight: 500; |
| | |
| | | } |
| | | .footer .btns .all_sel .icon { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | margin-right: 18rpx; |
| | | } |
| | | .footer .btns .list { |
| | |
| | | position: fixed; |
| | | bottom: 0; |
| | | width: 100%; |
| | | z-index: 9999; |
| | | z-index: 99999; |
| | | background-color: #fff; |
| | | border-radius: 24rpx 24rpx 0rpx 0rpx; |
| | | } |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | z-index: 1000; |
| | | z-index: 99; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | } |
| | | .card_wrap { |
| | |
| | | import { getCustomerList, getCrmAuthUrl } from '../../api/index' |
| | | import { getCustomerList, getCrmAuthUrl, batchAddLike } from '../../api/index' |
| | | const { HYEventBus } = require('hy-event-store') |
| | | const eventBus = new HYEventBus() |
| | | Page({ |
| | |
| | | |
| | | keyWords: '', |
| | | dataList: [], |
| | | customer: {}, |
| | | total: 0, |
| | | flag: 0, |
| | | page: 1, |
| | |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | this.getList() |
| | | }, |
| | | |
| | | }, |
| | | handleSub() { |
| | | const { customer } = this.data |
| | | const enjoyList = wx.getStorageSync('enjoyList') || [] |
| | | if(!customer.userId) return wx.showToast({ |
| | | title: '请先选择要关联的客户', icon: 'none' |
| | | }) |
| | | batchAddLike({ |
| | | articleIds: enjoyList.filter(i => i.checked).map(i => i.id).join(','), |
| | | customerId: customer.userId |
| | | }) |
| | | }, |
| | | tabsClick(e) { |
| | | const flag = e.currentTarget.dataset.tab |
| | | this.setData({flag}) |
| | | this.setData({total: 0,dataList: [], page: 1}) |
| | | this.getList() |
| | | }, |
| | | itemCheck(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | this.setData({ customer: item }) |
| | | }, |
| | | reloadList() { |
| | | this.setData({total: 0,dataList: [], page: 1}) |
| | |
| | | url: '/pages/webView/index?link=' + res.data, |
| | | }) |
| | | }) |
| | | }, |
| | | handleSub() { |
| | | console.log('点击饿了'); |
| | | wx.canvasToTempFilePath({ |
| | | x: 100, |
| | | y: 200, |
| | | width: 50, |
| | | height: 50, |
| | | destWidth: 100, |
| | | destHeight: 100, |
| | | canvasId: 'myCanvas', |
| | | success(res) { |
| | | console.log(res.tempFilePath) |
| | | } |
| | | }) |
| | | }, |
| | | onReady() { |
| | | |
| | |
| | | } |
| | | .icon{ |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | margin-right: 30rpx; |
| | | } |
| | | .avatar{ |
| | |
| | | <view wx:if="{{ flag == 0 }}" class="item"> |
| | | <view class="item_content"> |
| | | <view class="checked_wrap"> |
| | | <image wx:if="{{ item.checked }}" class="icon" src="../../static/icon/ic_video@2x.png" mode="widthFix"></image> |
| | | <image wx:else class="icon" src="../../static/icon/ic_select@2x.png" mode="widthFix"></image> |
| | | <image data-item="{{ item }}" bindtap="itemCheck" wx:if="{{ customer.userId == item.userId }}" class="icon" src="../../static/icon/ic_video@2x.png" mode="widthFix"></image> |
| | | <image wx:else data-item="{{ item }}" bindtap="itemCheck" class="icon" src="../../static/icon/ic_select@2x.png" mode="widthFix"></image> |
| | | <image class="avatar" src="../../static/images/default_avatar.png"></image> |
| | | </view> |
| | | <!-- --> |
| | |
| | | } |
| | | .list .item .icon { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | margin-right: 30rpx; |
| | | } |
| | | .list .item .avatar { |
| | |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/kefu/select", |
| | | "pathName": "pages/webView/index", |
| | | "query": "", |
| | | "launchMode": "default", |
| | | "scene": null |