From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +0800
Subject: [PATCH] 提交
---
wechat_staff/pages/kefu/select.js | 48 ++++++++++++++++++++++++++++--------------------
1 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/wechat_staff/pages/kefu/select.js b/wechat_staff/pages/kefu/select.js
index 8c8cfdf..5896bc1 100644
--- a/wechat_staff/pages/kefu/select.js
+++ b/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})
@@ -65,28 +83,18 @@
})
},
jumpClient() {
- getCrmAuthUrl({type:1}).then(res => {
- console.log(res.data)
+ getCrmAuthUrl({type:1}).then(res => {
this.setData({ url: res.data })
+ const url =res.data
wx.navigateTo({
- url: '/pages/webView/index?link=' + res.data,
+ url: '/pages/webView/index',
+ success: function(res1) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ console.log(url)
+ res1.eventChannel.emit('data',{link:url} );
+ }
})
})
- },
- 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() {
--
Gitblit v1.9.3