''
liukangdong
2024-07-24 4e069fd2c9469702f03b5a7280bfa9cede0ae239
''
已修改15个文件
204 ■■■■ 文件已修改
wechat_staff/api/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/components/detailFooter/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/detailDis/case.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/detailDis/product.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/detailDis/product.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/detailDis/realpic.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/fond.js 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/fond.less 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/fond.wxml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/fond.wxss 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/select.js 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/select.less 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/select.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/pages/kefu/select.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/project.private.config.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wechat_staff/api/index.js
@@ -142,9 +142,10 @@
    data
  })
}
export const getUserCard = (data) => {
// 批量添加喜欢给客户
export const batchAddLike = (data) => {
  return request({
    url: '/web/personnel/getUserCard',
    url: '/web/personnel/batchAddLike',
    method: "POST",
    data
  })
@@ -308,7 +309,6 @@
    data
  })
}
// 小程序注销
export const getCrmAuthUrl = (data) => {
  return request({
    url: '/web/customer/getCrmAuthUrl',
wechat_staff/components/detailFooter/index.js
@@ -95,11 +95,15 @@
      })
    },
    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() {
wechat_staff/pages/detailDis/case.js
@@ -63,7 +63,7 @@
        this.setData({ info })
        enjoyList.push({
          ...info,
          joinType: 'product',
          joinType: '1',
          timestamp: new Date().getTime()
        })
      }else{
wechat_staff/pages/detailDis/product.js
@@ -49,7 +49,7 @@
        this.setData({ info })
        enjoyList.push({
          ...info,
          joinType: 'product',
          joinType: '0',
          timestamp: new Date().getTime()
        })
      }else{
wechat_staff/pages/detailDis/product.wxml
@@ -1,6 +1,6 @@
<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 }}">
wechat_staff/pages/detailDis/realpic.js
@@ -56,7 +56,7 @@
        this.setData({ info })
        enjoyList.push({
          ...info,
          joinType: 'product',
          joinType: '2',
          timestamp: new Date().getTime()
        })
      }else{
wechat_staff/pages/kefu/fond.js
@@ -1,4 +1,5 @@
import moment from "moment";
import { getContentShareImg } from '../../api/index'
Page({
  /**
@@ -6,6 +7,7 @@
   */
  data: {
    bottomLift: 0,
    checkAll: false,
    enjoyList: []
  },
@@ -17,6 +19,11 @@
    this.setData({
      bottomLift: app.bottomLift
    })
    let enjoyList = wx.getStorageSync('enjoyList') || []
    enjoyList.forEach(item => {
      item.checked = false
    })
    wx.setStorageSync('enjoyList', enjoyList)
    this.initData()
  },
@@ -26,10 +33,13 @@
    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({
@@ -39,37 +49,52 @@
      }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() {
@@ -108,8 +133,61 @@
  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
    })
wechat_staff/pages/kefu/fond.less
@@ -3,6 +3,7 @@
  padding-bottom: 220rpx;
}
.date_item{
  position: relative;
  .date{
    display: flex;
    font-weight: 500;
@@ -71,6 +72,7 @@
      width: 160rpx;
      .icon{
        width: 40rpx;
        height: 40rpx;
        margin-right: 18rpx;
      }
    }
@@ -107,7 +109,7 @@
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 9999;
  z-index: 99999;
  background-color: #fff;
  border-radius: 24rpx 24rpx 0rpx 0rpx;
  .btns{
@@ -145,6 +147,7 @@
  width: 100%;
  height: 100%;
  z-index: 1000;
  z-index: 99;
  background-color: rgba(0,0,0,.5);
}
.card_wrap{
wechat_staff/pages/kefu/fond.wxml
@@ -3,8 +3,8 @@
    <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>
@@ -16,13 +16,14 @@
  <!-- 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>
@@ -42,7 +43,7 @@
    </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">
wechat_staff/pages/kefu/fond.wxss
@@ -2,6 +2,9 @@
  background-color: #f7f7f7;
  padding-bottom: 220rpx;
}
.date_item {
  position: relative;
}
.date_item .date {
  display: flex;
  font-weight: 500;
@@ -72,6 +75,7 @@
}
.footer .btns .all_sel .icon {
  width: 40rpx;
  height: 40rpx;
  margin-right: 18rpx;
}
.footer .btns .list {
@@ -105,7 +109,7 @@
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 9999;
  z-index: 99999;
  background-color: #fff;
  border-radius: 24rpx 24rpx 0rpx 0rpx;
}
@@ -142,6 +146,7 @@
  width: 100%;
  height: 100%;
  z-index: 1000;
  z-index: 99;
  background-color: rgba(0, 0, 0, 0.5);
}
.card_wrap {
wechat_staff/pages/kefu/select.js
@@ -1,4 +1,4 @@
import { getCustomerList, getCrmAuthUrl } from '../../api/index'
import { getCustomerList, getCrmAuthUrl, batchAddLike } from '../../api/index'
const { HYEventBus } = require('hy-event-store')
const eventBus = new HYEventBus()
Page({
@@ -11,6 +11,7 @@
    keyWords: '',
    dataList: [],
    customer: {},
    total: 0,
    flag: 0,
    page: 1,
@@ -27,12 +28,29 @@
      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})
@@ -72,21 +90,6 @@
        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() {
wechat_staff/pages/kefu/select.less
@@ -98,6 +98,7 @@
    }
    .icon{
      width: 40rpx;
      height: 40rpx;
      margin-right: 30rpx;
    }
    .avatar{
wechat_staff/pages/kefu/select.wxml
@@ -23,8 +23,8 @@
      <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>
          <!--  -->
wechat_staff/pages/kefu/select.wxss
@@ -99,6 +99,7 @@
}
.list .item .icon {
  width: 40rpx;
  height: 40rpx;
  margin-right: 30rpx;
}
.list .item .avatar {
wechat_staff/project.private.config.json
@@ -38,7 +38,7 @@
        },
        {
          "name": "",
          "pathName": "pages/kefu/select",
          "pathName": "pages/webView/index",
          "query": "",
          "launchMode": "default",
          "scene": null