Commit 060f105a by danmo

Merge remote-tracking branch 'origin/back_end_dev' into back_end_dev

# Conflicts:
#	linkwe-admin/pom.xml
#	linkwe-admin/src/main/resources/application.yml
2 parents d03e023e 6c2d244e
Showing 270 changed files with 4127 additions and 351 deletions
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<div align="center"> <div align="center">
![GVP Stars](http://img.shields.io/badge/GPV%20Stars-700+-yellow) [![star](https://gitee.com/LinkWeChat/link-wechat/badge/star.svg?theme=gvp)](https://gitee.com/LinkWeChat/link-wechat/stargazers)
![GVP Forks](http://img.shields.io/badge/GPV%20Forks-200+-yellow) [![fork](https://gitee.com/LinkWeChat/link-wechat/badge/fork.svg?theme=gvp)](https://gitee.com/LinkWeChat/link-wechat/members)
![license](http://img.shields.io/badge/license-GPL%203.0-green) ![license](http://img.shields.io/badge/license-GPL%203.0-green)
</div> </div>
...@@ -21,6 +21,14 @@ ...@@ -21,6 +21,14 @@
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/233450_65d03349_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_00.png") ![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/233450_65d03349_1480777.png "LinkWeChat 企业微信私域流量营销专家-V1.0.4_00.png")
---
**如果您觉得我们的开源项目很有帮助,请帮忙点击右上方的 :star: Star ,您的认可就是我们最大的动力,谢谢支持!:heart:**
---
[LinkWeChat 官方帮助手册——语雀](https://www.yuque.com/linkwechat/help)
### 平台简介 ### 平台简介
> LinkWeChat, Link to WeChat > LinkWeChat, Link to WeChat
...@@ -51,7 +59,8 @@ LinkWeChat 是一款基于人工智能的企业微信 SCRM 系统,为企业构 ...@@ -51,7 +59,8 @@ LinkWeChat 是一款基于人工智能的企业微信 SCRM 系统,为企业构
```java ```java
JDK >= 1.8 (推荐1.8版本) JDK >= 1.8 (推荐1.8版本)
Mysql >= 5.5.0 (推荐5.7版本) Mysql >= 5.7.0 (推荐5.7版本)
Mysql >= 5.7.0 (推荐5.7版本)
Redis >= 3.0 Redis >= 3.0
Maven >= 3.0 Maven >= 3.0
Node >= 10 Node >= 10
...@@ -96,6 +105,8 @@ npm run serve ...@@ -96,6 +105,8 @@ npm run serve
- `username` : 账号 - `username` : 账号
- `password `: 密码 - `password `: 密码
数据库脚本:[https://gitee.com/LinkWeChat_admin/link-we-chat-db/tree/master](https://gitee.com/LinkWeChat_admin/link-we-chat-db/tree/master)
2、开发环境配置 2、开发环境配置
...@@ -213,13 +224,13 @@ com.linkwechat ...@@ -213,13 +224,13 @@ com.linkwechat
#### 在线体验 #### 在线体验
演示地址:http://106.13.201.219/ 演示地址:http://demo.linkwechat.cn/
演示账号/密码:test/123456 演示账号/密码:Wecome/123456
#### 开发进度 #### 开发进度
![输入图片说明](https://images.gitee.com/uploads/images/2020/1231/233603_09dc4ac4_1480777.png "LinkWeChat 1.0.png") ![输入图片说明](https://images.gitee.com/uploads/images/2021/0521/161235_092f96cb_1480777.png "LinkWeChat 1.0.png")
### 联系作者加入群 ### 联系作者加入群
...@@ -297,6 +308,10 @@ LinkWeChat 开源版遵循 [GPL-3.0](https://gitee.com/LinkWeChat/link-wechat/bl ...@@ -297,6 +308,10 @@ LinkWeChat 开源版遵循 [GPL-3.0](https://gitee.com/LinkWeChat/link-wechat/bl
| *力 | ¥ 66.00 | 微信 | 2021-04-09 10:30:11 | 支持开源 | | *力 | ¥ 66.00 | 微信 | 2021-04-09 10:30:11 | 支持开源 |
| *生 | ¥ 66.00 | 微信 | 2021-04-15 21:36:01 | 支持开源 | | *生 | ¥ 66.00 | 微信 | 2021-04-15 21:36:01 | 支持开源 |
| Q*N | ¥ 10.00 | 微信 | 2021-04-19 20:24:11 | 感谢分享 | | Q*N | ¥ 10.00 | 微信 | 2021-04-19 20:24:11 | 感谢分享 |
| 大*k | ¥ 10.00 | 微信 | 2021-04-22 12:25:02 | 感谢您的开源 |
| J*s | ¥ 10.00 | 微信 | 2021-05-19 17:33:10 | 感谢您的开源 |
| *茶 | ¥ 10.00 | 微信 | 2021-05-17 20:46:05 | 感谢您的开源 |
`LinkWeChat` 全体开发团队感谢以下全部合作伙伴的服务器赞助(排名不分先后): `LinkWeChat` 全体开发团队感谢以下全部合作伙伴的服务器赞助(排名不分先后):
...@@ -306,6 +321,17 @@ LinkWeChat 开源版遵循 [GPL-3.0](https://gitee.com/LinkWeChat/link-wechat/bl ...@@ -306,6 +321,17 @@ LinkWeChat 开源版遵循 [GPL-3.0](https://gitee.com/LinkWeChat/link-wechat/bl
| Happy | 两核 8G 服务器一台 | | Happy | 两核 8G 服务器一台 |
| 平山阑槛倚晴空 | 两核 4G 服务器一台 | | 平山阑槛倚晴空 | 两核 4G 服务器一台 |
#### 捐赠用途
患难与共,风雨同舟。
LinkWeChat 开源团队将目前所收项目捐赠全额捐出,仅尽绵薄之力,在此我们也感谢大家的捐赠和支持,希望河南尽早渡过难关。
同时也希望 LinkWeChat 不仅能为国内开源社区建设做一点贡献,也能为社会产生一些价值。
![输入图片说明](https://images.gitee.com/uploads/images/2021/0722/233536_67c02015_1480777.png "屏幕截图.png")
--- ---
**如果您觉得我们的开源项目很有帮助,请帮忙点击右上方的 :star: Star ,您的认可就是我们最大的动力,谢谢支持!:heart:** **如果您觉得我们的开源项目很有帮助,请帮忙点击右上方的 :star: Star ,您的认可就是我们最大的动力,谢谢支持!:heart:**
\ No newline at end of file \ No newline at end of file
File mode changed
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.annotation.Log; import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController; import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult; import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo; import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType; import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.wecom.domain.WeChatItem;
import com.linkwechat.wecom.domain.WeMaterial;
import com.linkwechat.wecom.domain.dto.WeChatItemDto; import com.linkwechat.wecom.domain.dto.WeChatItemDto;
import com.linkwechat.wecom.domain.vo.WeChatSideVo; import com.linkwechat.wecom.domain.vo.WeChatSideVo;
import com.linkwechat.wecom.service.IWeChatItemService; import com.linkwechat.wecom.service.IWeChatItemService;
import com.linkwechat.wecom.service.IWeMaterialService;
import com.linkwechat.wecom.service.IWePosterService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 聊天工具侧边栏 * 聊天工具侧边栏
...@@ -26,6 +37,52 @@ public class WeChatItemController extends BaseController { ...@@ -26,6 +37,52 @@ public class WeChatItemController extends BaseController {
@Autowired @Autowired
private IWeChatItemService weChatItemService; private IWeChatItemService weChatItemService;
@Autowired
private IWeMaterialService materialService;
@Resource
private IWePosterService wePosterService;
// @PreAuthorize("@ss.hasPermi('wecom:material:list')")
@GetMapping("/mList")
@ApiOperation("获取侧边栏选中或者未选中素材")
public TableDataInfo mList(@RequestParam(value = "categoryId", required = false) String categoryId
, @RequestParam(value = "search", required = false) String search,@RequestParam(value = "mediaType") String mediaType) {
startPage();
List<WeMaterial> list;
if(StringUtils.isNotBlank(mediaType) && mediaType.equals(MediaType.POSTER.getType())){
list = wePosterService.list(StringUtils.isBlank(categoryId)?null:Long.valueOf(categoryId),search).stream().map(wePoster -> {
WeMaterial weMaterial = new WeMaterial();
weMaterial.setMaterialName(wePoster.getTitle());
weMaterial.setMaterialUrl(wePoster.getSampleImgPath());
weMaterial.setCategoryId(wePoster.getCategoryId());
weMaterial.setId(wePoster.getId());
return weMaterial;
}).collect(Collectors.toList());
}else {
list = materialService.findWeMaterials(categoryId, search,mediaType);
}
if(CollectionUtil.isNotEmpty(list)){
List<WeChatItem> weChatItems = weChatItemService.list(new LambdaQueryWrapper<WeChatItem>()
.in(WeChatItem::getMaterialId,list.stream().map(WeMaterial::getId).collect(Collectors.toList())));
if(CollectionUtil.isNotEmpty(weChatItems)){
list.stream().forEach(k->{
k.setIsCheck(
weChatItems.stream().filter(item -> item.getMaterialId()
.equals(k.getId())).findFirst().isPresent()?true:false
);
});
}
}
return getDataTable(list);
}
/** /**
* 侧边栏抓取素材 * 侧边栏抓取素材
...@@ -55,4 +112,8 @@ public class WeChatItemController extends BaseController { ...@@ -55,4 +112,8 @@ public class WeChatItemController extends BaseController {
return getDataTable(weChatSideVos); return getDataTable(weChatSideVos);
} }
} }
...@@ -64,6 +64,9 @@ public class WeMaterialController extends BaseController { ...@@ -64,6 +64,9 @@ public class WeMaterialController extends BaseController {
list = materialService.findWeMaterials(categoryId, search,mediaType); list = materialService.findWeMaterials(categoryId, search,mediaType);
} }
return getDataTable(list); return getDataTable(list);
} }
......
package com.linkwechat.common.aop;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;
/**
* @description: 客户轨迹记录AOP
* @author: HaoN
* @create: 2021-05-02 22:51
**/
@Aspect
@Component
public class CustomerTrajectoryAop {
@Pointcut("@annotation(com.linkwechat.wecom.annotation.CustomerTrajectoryRecord)")
public void customerTrajectoryPointCut(){}
/**
* 记录轨迹
* @param joinPoint
*/
@Around("customerTrajectoryPointCut()")
public void customerTrajectoryRecord(ProceedingJoinPoint joinPoint){
}
}
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 塬微管理系统/开发环境 # 基础api(根据实际情况,自行配置,下为示例)
VUE_APP_BASE_API = 'http://106.13.201.219' VUE_APP_BASE_API = 'http://demo.linkwechat.cn'
# VUE_APP_BASE_API = 'http://3x2d6z.natappfree.cc'
# 开发环境IP
VUE_APP_BASE_URL = 'http://192.168.0.101'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
# 塬微管理系统/生产环境api # 基础api
VUE_APP_BASE_API = 'http://106.13.201.219' VUE_APP_BASE_API = 'http://demo.linkwechat.cn'
# 生产环境IP # 路由基础路径
VUE_APP_BASE_URL = 'http://106.13.201.219' VUE_APP_BASE_URL = '/'
\ No newline at end of file \ No newline at end of file
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"clipboard": "^2.0.8",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"vant": "^2.12.2", "vant": "^2.12.2",
"vconsole": "^3.4.0", "vconsole": "^3.9.1",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0" "vuex": "^3.4.0"
......
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title>
<script src="./jweixin-1.2.0.js"></script> <%= htmlWebpackPlugin.options.title %>
</title>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
</head> </head>
......
<script> <script>
import { getUserInfo } from '@/api/common'
import { getAgentTicket, getAppTicket } from '@/api/common' import { getAgentTicket, getAppTicket } from '@/api/common'
import { param2Obj } from '@/utils/index'
export default { export default {
name: 'App', name: 'App',
provide() {
return {
reload: this.reload
}
},
data() { data() {
return { return {
appId: 'appId', corpId: '',
agentId: '1000005', agentId: '',
isRouterAlive: true
} }
}, },
created() { async created() {
// this.wxConfig() // http://106.13.201.219/?code=xxx&state=linkwechat#/route
// console.log('routerbeforeCreate', this.$route);
// this.$dialog({ message: 'url' + JSON.stringify(window.location) })
let query = param2Obj(window.location.search)
let hash = param2Obj(window.location.hash)
query = Object.assign(query, hash)
let code = query.code
this.corpId = query.corpId
this.agentId = query.agentId
// this.$toast('agentId:' + this.agentId)
this.$router.onReady(() => {
const noAuth = this.$router.app.$route.meta
? this.$router.app.$route.meta.noAuth
: false
if (!code && !noAuth) {
this.$toast('未获得授权')
}
})
if (!code) {
// this.$toast('未获得授权')
return
}
let { data } = await getUserInfo(code, this.agentId)
this.$store.state.userId = data.userId
// this.$toast('userId:' + this.$store.state.userId)
}, },
watch: { watch: {
// 通过config接口注入权限验证配置 // 通过config接口注入权限验证配置
// 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url的SPA(single-page application)的web app可在每次url变化时进行调用) // 所有需要使用JS-SDK的页面必须先注入配置信息,否则将无法调用(同一个url仅需调用一次,对于变化url的SPA(single-page application)的web app可在每次url变化时进行调用)
$route() { $route(route) {
this.wxConfig() // this.wxConfig()
}, const noAuth = route.meta ? route.meta.noAuth : false
}, !noAuth && this.wxConfig()
methods: {
wxConfig() {
getAgentTicket(window.location.href.split('#')[0]).then(({ data }) => {
let { timestamp, nonceStr, signature } = data
wx.agentConfig({
corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['sendChatMessage'], //必填
success: (res) => {
// 回调
},
fail: (res) => {
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
} }
}, },
}) methods: {
reload() {
this.isRouterAlive = false
this.$nextTick(() => {
this.isRouterAlive = true
}) })
}, },
_wxConfig() { async wxConfig() {
// 获取企业的jsapi_ticket this.$store.state.agentConfigStatus = false
getAppTicket(window.location.href).then(({ data }) => { try {
let { timestamp, nonceStr, signature } = data let { data } = await getAgentTicket(
wx.config({ window.location.href.split('#')[0],
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题 this.agentId
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 )
appId: this.appId, // 必填,企业微信的corpID
timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: ['getContext', 'sendChatMessage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
})
wx.ready(() => {
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
getAgentTicket(window.location.href).then(({ data }) => {
let { timestamp, nonceStr, signature } = data let { timestamp, nonceStr, signature } = data
wx.agentConfig({ wx.agentConfig({
corpid: this.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致 beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: true,
corpid: this.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247) agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
timestamp, // 必填,生成签名的时间戳 timestamp, // 必填,生成签名的时间戳
nonceStr, // 必填,生成签名的随机串 nonceStr, // 必填,生成签名的随机串
signature, // 必填,签名,见附录-JS-SDK使用权限签名算法 signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['sendChatMessage'], //必填 jsApiList: [
'sendChatMessage',
'getContext',
'getCurExternalContact',
'openEnterpriseChat',
'shareToExternalContact',
'shareToExternalChat'
], //必填
success: (res) => { success: (res) => {
// 回调 // 回调
this.$toast('agentId成功:')
this.$store.state.agentConfigStatus = true
}, },
fail: (res) => { fail: (res) => {
console.log('agent config 失败: ', res)
this.$toast('agentId失败:' + JSON.stringify(res))
if (res.errMsg.indexOf('function not exist') > -1) { if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级') alert('版本过低请升级')
} }
}, }
})
})
}) })
} catch (error) {}
}
// 丢弃
// _wxConfig() {
// // 获取企业的jsapi_ticket
// getAppTicket(window.location.href).then(({ data }) => {
// let { timestamp, nonceStr, signature } = data
// wx.config({
// beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
// debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
// corpId: this.corpId, // 必填,企业微信的corpID
// timestamp, // 必填,生成签名的时间戳
// nonceStr, // 必填,生成签名的随机串
// signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
// jsApiList: ['getContext', 'sendChatMessage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
// })
// wx.ready(() => {
// // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
// getAgentTicket(window.location.href).then(({ data }) => {
// let { timestamp, nonceStr, signature } = data
// wx.agentConfig({
// corpid: this.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
// agentid: this.agentId, // 必填,企业微信的应用id (e.g. 1000247)
// timestamp, // 必填,生成签名的时间戳
// nonceStr, // 必填,生成签名的随机串
// signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
// jsApiList: ['sendChatMessage'], //必填
// success: (res) => {
// // 回调
// },
// fail: (res) => {
// if (res.errMsg.indexOf('function not exist') > -1) {
// alert('版本过低请升级')
// }
// },
// })
// })
// })
wx.error(function(res) { // wx.error(function(res) {
console.error(res) // console.error(res)
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 // // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
}) // })
}) // })
}, // },
}, }
} }
</script> </script>
<template> <template>
<div id="app"> <div id="app">
<router-view class="page" /> <router-view class="page" v-if="isRouterAlive" />
</div> </div>
</template> </template>
......
import request from '@/utils/request' import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/chat' const wecom = window.CONFIG.services.wecom
const service = wecom + '/chat'
const serviceMaterial = wecom + '/material'
/** /**
* 侧边栏列表 * 侧边栏列表
...@@ -45,6 +47,9 @@ export function addCollection(data) { ...@@ -45,6 +47,9 @@ export function addCollection(data) {
return request({ return request({
url: service + '/collection/addCollection', url: service + '/collection/addCollection',
method: 'post', method: 'post',
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
data, data,
}) })
} }
...@@ -64,3 +69,17 @@ export function cancleCollection(data) { ...@@ -64,3 +69,17 @@ export function cancleCollection(data) {
data, data,
}) })
} }
/**
* 获取企业微信素材media_id
* @param {*} params
* url [string] 是 素材路径
type [string] 是 素材类型
name [string] 是 文件名称
*/
export function getMaterialMediaId(params) {
return request({
url: serviceMaterial + '/temporaryMaterialMediaId',
params,
})
}
...@@ -6,11 +6,12 @@ const service = config.services.wecom ...@@ -6,11 +6,12 @@ const service = config.services.wecom
* 获取应用的jsapi_ticket * 获取应用的jsapi_ticket
* @param {*} url 页面url * @param {*} url 页面url
*/ */
export function getAgentTicket(url) { export function getAgentTicket(url, agentId) {
return request({ return request({
url: service + '/ticket/getAgentTicket', url: service + '/ticket/getAgentTicket',
params: { params: {
url, url,
agentId,
}, },
}) })
} }
...@@ -32,12 +33,12 @@ export function getAppTicket(url) { ...@@ -32,12 +33,12 @@ export function getAppTicket(url) {
* 获取登录用户id * 获取登录用户id
* @param {*} url 页面url * @param {*} url 页面url
*/ */
export function getUserInfo(code) { export function getUserInfo(code, agentId) {
return request({ return request({
url: service + '/user/getUserInfo', url: service + '/user/getUserInfo',
params: { params: {
code, code,
agentId: '1000005', agentId,
}, },
}) })
} }
\ No newline at end of file \ No newline at end of file
import request from '@/utils/request'
const wecom = window.CONFIG.services.wecom
const service = wecom + '/community/h5'
/**
* 获取用户相关的所有任务
* @param {*} userId 用户ID
* @param {*} taskType 0: 全部 1: 老客标签建群 2: 群SOP
* @returns
*/
export function getTasks (userId, taskType) {
return request({
url: service + '/' + userId,
params: {
type: taskType
}
})
}
/**
* 获取任务相关员工及完成情况
* @param {*} taskId 任务ID
* @param {*} taskType 1: 老客标签建群 2: 群SOP
* @returns
*/
export function getState (taskId, taskType) {
return request({
url: service + '/scope/' + taskId,
params: {
type: taskType
}
})
}
/**
* 更新任务状态
* @param {*} userId 用户ID
* @param {*} taskId 任务ID
* @param {*} taskType 0: 老客标签建群 1: 群SOP
* @returns
*/
export function changeStatus (userId, taskId, taskType) {
return request({
url: service + '/changeStatus',
params: {
emplId: userId,
taskId: taskId,
type: taskType
}
})
}
/**
* 获取用户相关的所有关键词任务任务
* @param {*} word 搜索的关键词或活码名称
* @returns
*/
export function getKeywordTasks (word) {
return request({
url: service + '/filter',
params: {
word: word
}
})
}
import request from '@/utils/request'
const wecom = window.CONFIG.services.wecom
const service = wecom + '/groupCode'
// 通过群活码UUID获取群活码详情及可用的实际群码
export function getDetail (uuid) {
return request({
url: service + '/getActualCode/' + uuid
})
}
import request from '@/utils/request'
const wecom = window.CONFIG.services.wecom
const service = wecom + '/portrait'
// 根据客户id和当前企业员工id获取客户详细信息
export function getCustomerInfo(params) {
return request({
url: service + '/findWeCustomerInfo',
params
})
}
// 客户画像资料更新
export function getWeCustomerInfo(data) {
return request({
url: service + '/updateWeCustomerInfo',
method: 'post',
data: {
externalUserid: data.externalUserid, // 客户Id
userId: data.userId, // 员工Id
remarkMobiles: data.remarkMobiles, // 手机号
birthday: data.birthday, // 客户生日
email: data.email, // 邮箱
address: data.address, // 地址
qq: data.qq, // qq
position: data.position, // 职业
remarkCorpName: data.remarkCorpName, // 公司
description: data.description // 其他描述
}
})
}
// 获取当前系统所有可用标签
export function getAllTags(params) {
return request({
url: service + '/findAllTags',
params
})
}
// 更新客户画像标签
export function updateWeCustomerPorTraitTag(data) {
return request({
url: service + '/updateWeCustomerPorTraitTag',
method: 'post',
data
})
}
// 查看客户添加的员工
export function findAddaddEmployes(params) {
return request({
url: service + '/findAddaddEmployes/' + params
})
}
// 获取用户添加的群
export function findAddGroupNum(params) {
return request({
url: service + '/findAddGroupNum',
params
})
}
// 获取轨迹信息
/**
*
* @param {*}
{
pageNum:
pageSize:
trajectoryType: 轨迹类型(1:信息动态;2:社交动态;3:活动规则;4:待办动态)
userId: 员工的id
externalUserid: 客户id
}
* @returns
*/
export function findTrajectory(params) {
return request({
url: service + '/findTrajectory',
params
})
}
// 添加或编辑轨迹
export function addOrEditWaitHandle(data) {
return request({
url: service + '/addOrEditWaitHandle',
method: 'post',
data
})
}
// 删除轨迹
export function removeTrajectory(params) {
return request({
url: service + '/removeTrajectory/' + params,
method: 'delete'
})
}
// 完成待办
export function handleWait(params) {
return request({
url: service + '/handleWait/' + params,
method: 'delete'
})
}
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>IconFont Demo</title>
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
<script src="iconfont.js"></script>
<!-- jQuery -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
<!-- 代码高亮 -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
</head>
<body>
<div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">&#xe86b;</a></h1>
<div class="nav-tabs">
<ul id="tabs" class="dib-box">
<li class="dib active"><span>Unicode</span></li>
<li class="dib"><span>Font class</span></li>
<li class="dib"><span>Symbol</span></li>
</ul>
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=2510853" target="_blank" class="nav-more">查看项目</a>
</div>
<div class="tab-container">
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe600;</span>
<div class="name">性别</div>
<div class="code-name">&amp;#xe600;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe601;</span>
<div class="name">性别</div>
<div class="code-name">&amp;#xe601;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
<hr>
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
<ul>
<li>兼容性最好,支持 IE6+,及所有现代浏览器。</li>
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
<li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
</ul>
<blockquote>
<p>注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式</p>
</blockquote>
<p>Unicode 使用步骤如下:</p>
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.eot');
src: url('iconfont.eot?#iefix') format('embedded-opentype'),
url('iconfont.woff2') format('woff2'),
url('iconfont.woff') format('woff'),
url('iconfont.ttf') format('truetype'),
url('iconfont.svg#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
<pre><code class="language-css"
>.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
<pre>
<code class="language-html"
>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-man"></span>
<div class="name">
性别
</div>
<div class="code-name">.icon-man
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-xingbie"></span>
<div class="name">
性别
</div>
<div class="code-name">.icon-xingbie
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
<hr>
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
<p>与 Unicode 使用方式相比,具有如下特点:</p>
<ul>
<li>兼容性良好,支持 IE8+,及所有现代浏览器。</li>
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
<li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
</code></pre>
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-man"></use>
</svg>
<div class="name">性别</div>
<div class="code-name">#icon-man</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xingbie"></use>
</svg>
<div class="name">性别</div>
<div class="code-name">#icon-xingbie</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>
<hr>
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
<ul>
<li>支持多色图标了,不再受单色限制。</li>
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
</code></pre>
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
<pre><code class="language-html">&lt;style&gt;
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
&lt;/style&gt;
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
&lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
&lt;/svg&gt;
</code></pre>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.tab-container .content:first').show()
$('#tabs li').click(function (e) {
var tabContent = $('.tab-container .content')
var index = $(this).index()
if ($(this).hasClass('active')) {
return
} else {
$('#tabs li').removeClass('active')
$(this).addClass('active')
tabContent.hide().eq(index).fadeIn()
}
})
})
</script>
</body>
</html>
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1619340295504'); /* IE9 */
src: url('iconfont.eot?t=1619340295504#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAOAAAsAAAAAB1wAAAMzAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCfgqCTIJEATYCJAMMCwgABCAFhG0HNxuDBsgekiQBeyhJThMigiCE4uFr7H/n7u5XgQbJ3SpE89A90yhFvKo25v3fWhvcKm8Q9ROzlb97onODZxLRQncPCTLpqCQJDaa2SYOKV45GKObVdCmZ1Of65iVDaFNpS3UGXE6/tuA8oJzW2vZP0ZiACQa0N7aBAymQBL1FdhFXxCJPE6jXXbesGbM0FlSoQJMCcWCvyKDCjE1poIZaobpiZRFXValN59IJV4Lvx2fDopakKkMzl+yS8mj+HfQucs5UJjZ4BPl4HijryBgAKcSqSt8SOVFugBz1Vi5XD2hdg4J38V/hHU+22j88QiKqIXIj6MPnE+9QnVOT8xdIIINqFByA3OZNnX13T70b+7Ucf6jffcbHylvVbEqt2gfEit1J0oNeja57PHryOvNG3AvfBWfTG4gf0+RZRfdJH1Bi+/isev2Al5Jv2H6urOxlWz4zjGXScnaXQ4ef6ff5/MKbezpJX+Bndle/dRt3vpZOqHpDV21uWquB09iS/XaazV/s//t0SZPd1+iQSuxNPkeT2tvh5R/qbb3erJtt4+0GjYi6U50rc/MSyYKpYD9PKzDtMcLTaNqZ2BvpdEzryKDV9T6JZH5OrP0lT/8vT5E/5O6Df5tcqan7zixyYH0mwA4d/jMWz4zpS3NntkCo/Es/cz3kOWn3W37j+Z1jy1+h/kUaCnhzz4ODWOVfATfUnrg/+AlyYFOxlcieiymjMjeQje3pSfASNagChdp99jd0AZMJtbokSGp0Q1arB62wBqBKgxGoVmsy6vUnX9+gA5EjSh362eIQWp0hafYYWat3WmFlUKWrb1RrjYx6qwLfsUGv2FvvHAOGAo/ZdRziEnGBOGlxSDWBuBxlSFoZ8GxA0qEkHhg0JF+UQxzIGHPSK+IgpQIWSCKGZdx5EI0mcJIkwsDR3iClycm+wbuqXtTLJWKo2HQEYFCAh7HWYSGchDjB60wVFz5vAkTLohikoawlbgOItFD32IBe/QCaXBcHlV3LJWkrRIMoSoAJiIQYTMZ5QBTnErBk9bAwwKF6BXtkkib1Ce0EqK53fkPsAUqVKtCBOVLkKPLBrfGCzt64yIYAIQA=') format('woff2'),
url('iconfont.woff?t=1619340295504') format('woff'),
url('iconfont.ttf?t=1619340295504') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1619340295504#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-man:before {
content: "\e600";
}
.icon-xingbie:before {
content: "\e601";
}
No preview for this file type
!function(e){var t,n,o,i,c,a,l='<svg><symbol id="icon-man" viewBox="0 0 1024 1024"><path d="M734.81728 575.0016a238.976 238.976 0 0 0-52.80768-79.54432 239.488 239.488 0 0 0-149.4272-69.53472l0.00512-236.58496 89.7024 89.7024a21.6576 21.6576 0 1 0 30.63296-30.63808L528.98304 124.4672a21.6576 21.6576 0 0 0-30.63296 0L374.41536 248.3968a21.66784 21.66784 0 0 0 30.63808 30.63808l84.18816-84.19328v231.26528a239.45728 239.45728 0 0 0-67.70688 16.5376 238.8992 238.8992 0 0 0-79.54432 52.80768 238.9504 238.9504 0 0 0-52.80768 79.54432c-11.68384 28.81024-17.60768 59.24352-17.60768 90.46016s5.92384 61.64992 17.60768 90.46016c12.09856 29.83936 29.87008 56.6016 52.80768 79.54432s49.71008 40.70912 79.54432 52.80768c28.80512 11.68384 59.24352 17.60256 90.46016 17.60256s61.65504-5.91872 90.45504-17.60256a238.93504 238.93504 0 0 0 79.54944-52.8128 238.976 238.976 0 0 0 52.80768-79.54432 239.55456 239.55456 0 0 0 17.60768-90.46016 239.54944 239.54944 0 0 0-17.59744-90.44992z m-83.45088 229.82144c-76.84608 76.84608-201.88672 76.84608-278.72768 0-76.8512-76.84608-76.84608-201.88672 0-278.72768 76.8512-76.84608 201.8816-76.84608 278.72768 0s76.84608 201.88672 0 278.72768z" fill="#40b1fc" ></path></symbol><symbol id="icon-xingbie" viewBox="0 0 1024 1024"><path d="M832.205 631.5a25.615 25.615 0 0 0-36.199 0l-64.153 64.154-68.557-68.556c87.86-106.138 82.125-264.192-17.203-363.52-51.149-51.098-119.04-79.258-191.283-79.258s-140.186 28.16-191.232 79.206-79.258 119.04-79.258 191.284 28.16 140.185 79.206 191.232c52.736 52.736 122.01 79.104 191.232 79.104 61.236 0 122.47-20.634 172.288-61.85l68.557 68.557-64.153 64.153a25.615 25.615 0 0 0 0 36.199c5.017 5.017 11.57 7.475 18.124 7.475s13.108-2.509 18.125-7.475l64.154-64.154 42.496 42.496c5.017 5.018 11.571 7.475 18.125 7.475s13.107-2.508 18.124-7.475a25.615 25.615 0 0 0 0-36.198l-42.496-42.496 64.154-64.154a25.667 25.667 0 0 0-0.051-36.198z m-532.48-21.657c-41.421-41.42-64.205-96.46-64.205-155.033 0-58.573 22.784-113.613 64.205-155.034 41.42-41.472 96.512-64.256 155.085-64.256 58.572 0 113.612 22.784 155.033 64.205 85.504 85.504 85.504 224.614 0 310.118-85.504 85.504-224.614 85.504-310.118 0z" fill="#1296DB" ></path></symbol></svg>',s=(s=document.getElementsByTagName("script"))[s.length-1].getAttribute("data-injectcss");if(s&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}function d(){c||(c=!0,o())}t=function(){var e,t,n,o;(o=document.createElement("div")).innerHTML=l,l=null,(n=o.getElementsByTagName("svg")[0])&&(n.setAttribute("aria-hidden","true"),n.style.position="absolute",n.style.width=0,n.style.height=0,n.style.overflow="hidden",e=n,(t=document.body).firstChild?(o=e,(n=t.firstChild).parentNode.insertBefore(o,n)):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(n=function(){document.removeEventListener("DOMContentLoaded",n,!1),t()},document.addEventListener("DOMContentLoaded",n,!1)):document.attachEvent&&(o=t,i=e.document,c=!1,(a=function(){try{i.documentElement.doScroll("left")}catch(e){return void setTimeout(a,50)}d()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,d())})}(window);
\ No newline at end of file \ No newline at end of file
{
"id": "2510853",
"name": "linkWechart",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "13963323",
"name": "性别",
"font_class": "man",
"unicode": "e600",
"unicode_decimal": 58880
},
{
"icon_id": "16921771",
"name": "性别",
"font_class": "xingbie",
"unicode": "e601",
"unicode_decimal": 58881
}
]
}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="man" unicode="&#58880;" d="M734.81728 320.99839999999995a238.976 238.976 0 0 1-52.80768 79.54432 239.488 239.488 0 0 1-149.4272 69.53472l0.00512 236.58496 89.7024-89.7024a21.6576 21.6576 0 1 1 30.63296 30.63808L528.98304 771.5328a21.6576 21.6576 0 0 1-30.63296 0L374.41536 647.6032a21.66784 21.66784 0 0 1 30.63808-30.63808l84.18816 84.19328v-231.26528a239.45728 239.45728 0 0 1-67.70688-16.5376 238.8992 238.8992 0 0 1-79.54432-52.80768 238.9504 238.9504 0 0 1-52.80768-79.54432c-11.68384-28.81024-17.60768-59.24352-17.60768-90.46016s5.92384-61.64992 17.60768-90.46016c12.09856-29.83936 29.87008-56.6016 52.80768-79.54432s49.71008-40.70912 79.54432-52.80768c28.80512-11.68384 59.24352-17.60256 90.46016-17.60256s61.65504 5.91872 90.45504 17.60256a238.93504 238.93504 0 0 1 79.54944 52.8128 238.976 238.976 0 0 1 52.80768 79.54432 239.55456 239.55456 0 0 1 17.60768 90.46016 239.54944 239.54944 0 0 1-17.59744 90.44992z m-83.45088-229.82144c-76.84608-76.84608-201.88672-76.84608-278.72768 0-76.8512 76.84608-76.84608 201.88672 0 278.72768 76.8512 76.84608 201.8816 76.84608 278.72768 0s76.84608-201.88672 0-278.72768z" horiz-adv-x="1024" />
<glyph glyph-name="xingbie" unicode="&#58881;" d="M832.205 264.5a25.615 25.615 0 0 1-36.199 0l-64.153-64.154-68.557 68.556c87.86 106.138 82.125 264.192-17.203 363.52-51.149 51.098-119.04 79.258-191.283 79.258s-140.186-28.16-191.232-79.206-79.258-119.04-79.258-191.284 28.16-140.185 79.206-191.232c52.736-52.736 122.01-79.104 191.232-79.104 61.236 0 122.47 20.634 172.288 61.85l68.557-68.557-64.153-64.153a25.615 25.615 0 0 1 0-36.199c5.017-5.017 11.57-7.475 18.124-7.475s13.108 2.509 18.125 7.475l64.154 64.154 42.496-42.496c5.017-5.018 11.571-7.475 18.125-7.475s13.107 2.508 18.124 7.475a25.615 25.615 0 0 1 0 36.198l-42.496 42.496 64.154 64.154a25.667 25.667 0 0 1-0.051 36.198z m-532.48 21.657c-41.421 41.42-64.205 96.46-64.205 155.033 0 58.573 22.784 113.613 64.205 155.034 41.42 41.472 96.512 64.256 155.085 64.256 58.572 0 113.612-22.784 155.033-64.205 85.504-85.504 85.504-224.614 0-310.118-85.504-85.504-224.614-85.504-310.118 0z" horiz-adv-x="1024" />
</font>
</defs></svg>
No preview for this file type
No preview for this file type
No preview for this file type
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br />
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
>vue-cli documentation</a
>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
target="_blank"
rel="noopener"
>router</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
target="_blank"
rel="noopener"
>vuex</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a
>
</li>
</ul>
<h3>Essential Links</h3>
<ul>
<li>
<a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
</li>
<li>
<a href="https://forum.vuejs.org" target="_blank" rel="noopener"
>Forum</a
>
</li>
<li>
<a href="https://chat.vuejs.org" target="_blank" rel="noopener"
>Community Chat</a
>
</li>
<li>
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
>Twitter</a
>
</li>
<li>
<a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
</li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li>
<a href="https://router.vuejs.org" target="_blank" rel="noopener"
>vue-router</a
>
</li>
<li>
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-devtools#vue-devtools"
target="_blank"
rel="noopener"
>vue-devtools</a
>
</li>
<li>
<a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
>vue-loader</a
>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
rel="noopener"
>awesome-vue</a
>
</li>
</ul>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
<template>
<div>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
loading-text="上划加载更多"
>
<van-cell v-for="(item, index) in wList" :key="index">
<!-- 时间 -->
<p class="f12" style="position:relative; ">
{{ dateFormat(item[0].createTime, 'yyyy-MM-dd') }}
{{ dateFormat(item[0].createTime, 'ww') }}
<!-- {{item1.trajectoryType}} -->
</p>
<!-- <van-cell> -->
<van-steps
direction="vertical"
inactive-color="#2c8cf0"
:active="active"
v-for="(item1, index) in item"
:key="index"
>
<van-step class="msg">
<span class="f12 po">
{{ dateFormat(item[0].createTime, 'hh:mm') }}</span
>
<span class="fs14">{{ chargeType(item1.trajectoryType) }}</span>
<span class="finish-box">
<span
class="finish"
v-if="item1.trajectoryType == 4 && item1.status != 3"
@click="finDynamic(item1.id)"
>完成</span
>
<span class="deldynamic" @click="delDynamic(item1.id)">删除</span>
</span>
<p class="fs14 con ">{{ item1.content }}</p>
</van-step>
<!-- <van-step>
<span class="f12 po"> 12:40</span>
<span class="fs14">社交动态</span>
<span class="deldynamic">删除</span>
<p class="fs14 con ">编辑编辑</p>
</van-step> -->
</van-steps>
</van-cell>
<!-- <van-divider /> -->
</van-list>
</div>
</template>
<script>
import { removeTrajectory, handleWait } from '@/api/portrait'
import { dateFormat } from '@/utils'
export default {
props: ['stepList'],
inject: ['reload'],
data() {
return {
// 步骤条
active: -1,
// 轨迹外层按时间
wlist: [],
content: '',
type: 0,
wList: [],
finished: false,
loading: false
}
},
watch: {
stepList(newVal, oldVal) {
// console.log(newVal, oldVal);
this.wList = []
let dayList = []
newVal.forEach((ele) => {
let date = this.dateFormat(ele.createTime, 'yyyyMMdd')
dayList.includes(date) || dayList.push(date)
})
dayList.sort((a, b) => b - a)
for (let i = 0; i < dayList.length; i++) {
let timeList = []
for (let j = 0; j < newVal.length; j++) {
// console.log(newVal[j].createTime);
if (dayList[i] == this.dateFormat(newVal[j].createTime, 'yyyyMMdd')) {
timeList.push(newVal[j])
}
}
this.wList.push(timeList)
}
this.loading = false
this.finished = true
// console.log(this.wlist);
// this.onLoad()
}
},
methods: {
onLoad() {
// // 异步更新数据
// // setTimeout 仅做示例,真实场景中一般为 ajax 请求
// setTimeout(() => {
// // debugger
// let total = this.wlist.length > 10 ? 10 : this.wlist.length
// for (let i = 0; i < total; i++) {
// this.wList.push(this.wlist[i])
// }
// console.log(this.wList)
// // 加载状态结束
// this.loading = false
// // 数据全部加载完成
// if (this.wList.length >= this.wlist.length) {
// this.finished = true
// }
// }, 1000)
},
// 根据数字判断类型
chargeType(num) {
if (num == 1) {
return (this.type = '信息动态')
} else if (num == 2) {
return (this.type = '社交动态')
} else if (num == 3) {
return (this.type = '活动规则')
} else if (num == 4) {
return (this.type = '待办动态')
}
},
dateFormat(data, format) {
return dateFormat(new Date(data), format)
},
// 删除轨迹
delDynamic(id) {
this.$dialog
.confirm({
title: '警告',
message: '确定要删除吗?'
})
.then(() => {
return removeTrajectory(id)
})
.then((data) => {
this.$toast.success('删除成功')
// 重新获取全部数据
this.$emit('reload')
})
.catch(() => {
// on cancel
})
},
// 点击完成
finDynamic(id) {
handleWait(id)
.then((data) => {
this.$emit('reload')
})
.catch((err) => {
console.log(err)
})
}
}
}
</script>
<style lang="less" scoped>
.f12 {
color: #9c9c9c;
font-size: 12px;
font-weight: 600;
}
/deep/.msg {
&::after {
border: none;
}
.po {
position: relative;
}
}
.fs14 {
color: #333;
font-size: 14px;
position: relative;
left: 20px;
}
.deldynamic {
float: right;
color: #9c9c9c;
font-size: 12px;
font-weight: 600;
}
.con {
left: 51px;
margin-top: 20px;
}
.finish-box {
float: right;
position: relative;
width: 80px;
}
.finish {
position: absolute;
color: #2c8cf0;
font-size: 12px;
font-weight: 600;
// right: 30px;
// top: 0px;
}
</style>
...@@ -4,38 +4,9 @@ const config = { ...@@ -4,38 +4,9 @@ const config = {
*/ */
cookieExpires: 1, cookieExpires: 1,
/** /**
* @description 是否使用国际化,默认为false
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
useI18n: false,
/**
* @description api请求基础路径
*/
// 测试服
domain:
process.env.NODE_ENV === 'development'
? 'http://192.168.1.32:8888'
: 'http://192.168.1.26:8888', //
// 正式服
// domain: process.env.NODE_ENV === 'development' ? 'http://192.168.1.35:8118' : 'https://gateway.visualinsur.cn:8888', //
/**
* @description 默认打开的首页的路由name值,默认为home * @description 默认打开的首页的路由name值,默认为home
*/ */
homeName: 'home', homeName: 'home',
/**
* @description 需要加载的插件
*/
plugin: {
// 'error-store': {
// showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
// developmentOff: false // 设为true后在开发环境不会收集错误信息,方便开发中排查错误
// }
},
// get domain() {
// return process.env.NODE_ENV === 'development' ? this.baseUrl.dev : this.baseUrl.pro
// }
} }
config.services = { config.services = {
......
import Vue from 'vue' import Vue from 'vue'
import config from '@/config' import config from '@/config'
import '@/assets/icon/iconfont.css'
window.CONFIG = config window.CONFIG = config
......
...@@ -10,8 +10,8 @@ const routes = [ ...@@ -10,8 +10,8 @@ const routes = [
name: 'Home', name: 'Home',
component: Home, component: Home,
meta: { meta: {
title: '首页', title: '首页'
}, }
}, },
{ {
path: '/chat', path: '/chat',
...@@ -21,13 +21,131 @@ const routes = [ ...@@ -21,13 +21,131 @@ const routes = [
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/chat'), component: () => import(/* webpackChunkName: "about" */ '../views/chat'),
meta: { meta: {
title: 'chat', title: 'chat'
}
},
// 用户画像
{
path: '/portrait',
name: 'portrait',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(/* webpackChunkName: "about" */ '../views/portrait/index'),
meta: {
title: 'portrait'
}
},
// 用户画像详情
{
path: '/customerDetail',
name: 'customerDetail',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(
/* webpackChunkName: "about" */ '../views/portrait/customerDetail.vue'
),
hidden: true,
meta: {
title: ''
}
},
// 社群关系
{
path: '/community',
name: 'community',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(/* webpackChunkName: "about" */ '../views/portrait/community.vue'),
hidden: true,
meta: {
title: ''
}
},
// 群活码扫描跳转页面
{
path: '/groupCode',
name: 'groupCode',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(/* webpackChunkName: "about" */ '../views/groupCode/index'),
hidden: true,
meta: {
title: '',
noAuth: true
}
},
// 群活码扫描跳转页面
{
path: '/task',
// name: 'task',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(
/* webpackChunkName: "about" */ '../views/communityOperating/task/index'
),
children: [
{
path: '',
component: () =>
import(
/* webpackChunkName: "about" */ '../views/communityOperating/task/list'
),
hidden: true,
meta: {
title: ''
// noAuth: true
}
}, },
{
path: 'state',
name: 'taskState',
component: () =>
import(
/* webpackChunkName: "about" */ '../views/communityOperating/task/state.vue'
),
hidden: true,
meta: {
title: '',
noAuth: true
}
}
],
hidden: true,
meta: {
title: '',
noAuth: true
}
}, },
// 群活码扫描跳转页面
{
path: '/keywords',
name: 'keywords',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () =>
import(
/* webpackChunkName: "about" */ '../views/communityOperating/keywords/index'
),
hidden: true,
meta: {
title: ''
}
}
] ]
const router = new VueRouter({ const router = new VueRouter({
routes, routes
}) })
export default router export default router
import Vue from "vue"; import Vue from 'vue'
import Vuex from "vuex"; import Vuex from 'vuex'
Vue.use(Vuex); Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: {}, state: {
userId: '',
agentConfigStatus: false,
},
mutations: {}, mutations: {},
actions: {}, actions: {},
modules: {} modules: {},
}); })
...@@ -310,18 +310,6 @@ ais { ...@@ -310,18 +310,6 @@ ais {
.pt5 { .pt5 {
padding-top: 5px; padding-top: 5px;
} }
.pb5 {
padding-bottom: 5px;
}
.pt10 {
padding-top: 10px;
}
.pt15 {
padding-top: 15px;
}
.pt20 {
padding-top: 20px;
}
.pr5 { .pr5 {
padding-right: 5px; padding-right: 5px;
...@@ -335,6 +323,16 @@ ais { ...@@ -335,6 +323,16 @@ ais {
padding-left: 5px; padding-left: 5px;
} }
.pt10 {
padding-top: 10px;
}
.pt15 {
padding-top: 15px;
}
.pt20 {
padding-top: 20px;
}
.mt5 { .mt5 {
margin-top: 5px; margin-top: 5px;
} }
...@@ -347,14 +345,14 @@ ais { ...@@ -347,14 +345,14 @@ ais {
margin-bottom: 5px; margin-bottom: 5px;
} }
.mb8 {
margin-bottom: 8px;
}
.ml5 { .ml5 {
margin-left: 5px; margin-left: 5px;
} }
.mb8 {
margin-bottom: 8px;
}
.mt10 { .mt10 {
margin-top: 10px; margin-top: 10px;
} }
......
/**
* query请求路径参数转为对象
* @param {*} url
*/
export function param2Obj(url) {
url = url == null ? window.location.href : url
let search = decodeURIComponent(url).split('?')[1]
search = search && search.split('#')[0]
if (!search) {
return {}
}
return JSON.parse(
'{"' +
search
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"') +
'"}'
)
}
// 日期时间格式化
export function dateFormat(date = new Date(), fmt = 'yyyy-MM-dd hh:mm:ss') {
var o = {
'M+': date.getMonth() + 1, //月份
'd+': date.getDate(), //日
'h+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
'S+': date.getMilliseconds(), //毫秒
'w+': '星期' + '日一二三四五六'.charAt(date.getDay()) //星期
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length)
)
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
)
}
}
return fmt
}
...@@ -7,7 +7,7 @@ function createAxios(baseURL) { ...@@ -7,7 +7,7 @@ function createAxios(baseURL) {
headers: { headers: {
Auth_token: '', Auth_token: '',
}, },
timeout: 3000, timeout: 10000,
}) })
// 请求拦截 // 请求拦截
instance.interceptors.request.use( instance.interceptors.request.use(
......
...@@ -4,12 +4,18 @@ import { ...@@ -4,12 +4,18 @@ import {
getCollectionList, getCollectionList,
addCollection, addCollection,
cancleCollection, cancleCollection,
getMaterialMediaId,
} from '@/api/chat' } from '@/api/chat'
export default { export default {
components: {}, components: {},
props: { props: {
sideId: { sideId: {
type: String, type: String,
default: '',
},
// mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
mediaType: {
type: String,
default: '0', default: '0',
}, },
userId: { userId: {
...@@ -23,38 +29,66 @@ export default { ...@@ -23,38 +29,66 @@ export default {
}, },
data() { data() {
return { return {
refreshing: false,
loading: false, loading: false,
finished: false, finished: false,
error: false, error: false,
pageSize: 1, pageNum: 1,
pageNum: 10, pageSize: 10,
list: [], list: [],
collectList: [], collectList: [],
mediaTypeObj: {
'0': '图片',
'1': '语音',
'2': '视频',
'3': '普通文件',
'4': '文本',
'5': '海报',
},
} }
}, },
watch: {}, watch: {
userId() {
this.getList(1)
},
},
computed: {}, computed: {},
created() { created() {
this.getList() this.getList()
this.userId && this.getCollectionList() // this.userId && this.getCollectionList()
}, },
mounted() {}, mounted() {},
methods: { methods: {
getList(page) { getList(page) {
let pageSize = page || this.pageSize++ let pageNum = page || this.pageNum++
let pageNum = this.pageNum let pageSize = this.pageSize
let keyword = this.keyword let keyword = this.keyword
page == 1 && (this.list = []) page == 1 && (this.list = [])
this.loading = true
;(this.sideId ;(this.sideId
? getMaterialList({ sideId: this.sideId, pageSize, pageNum, keyword }) ? getMaterialList({
userId: this.userId,
sideId: this.sideId,
mediaType: this.mediaType,
pageSize,
pageNum,
keyword,
})
: getCollectionList({ userId: this.userId, pageSize, pageNum, keyword }) : getCollectionList({ userId: this.userId, pageSize, pageNum, keyword })
) )
.then(({ rows, total }) => { .then(({ rows, total }) => {
// 判断我的列表
if (!this.sideId) {
rows.forEach((element) => {
element.collection = 1
})
}
this.list.push(...rows) this.list.push(...rows)
this.loading = false this.loading = false
this.refreshing = false
// 数据全部加载完成 // 数据全部加载完成
if (this.list.length >= total) { if (this.list.length >= +total) {
this.finished = true this.finished = true
} }
}) })
...@@ -62,26 +96,38 @@ export default { ...@@ -62,26 +96,38 @@ export default {
this.error = true this.error = true
}) })
}, },
getCollectionList() { // getCollectionList() {
let data = { userId: this.userId, pageSize: 1, pageNum: 1000 } // let data = { userId: this.userId, pageSize: 1000, pageNum: 1 }
getCollectionList(data).then(({ rows, total }) => { // getCollectionList(data).then(({ rows, total }) => {
this.collectList = rows.map((d) => d.id) // this.collectList = rows.map((d) => d.materialId)
}) // })
}, // },
isCollected(id) {
return this.collectList.includes(id)
},
send(data) { send(data) {
this.$toast.loading({
message: '正在发送...',
duration: 0,
forbidClick: true,
})
let entry = undefined let entry = undefined
wx.invoke('getContext', {}, function(res) { let _this = this
wx.invoke('getContext', {}, async function(res) {
if (res.err_msg == 'getContext:ok') { if (res.err_msg == 'getContext:ok') {
entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools entry = res.entry //返回进入H5页面的入口类型,目前 contact_profile、single_chat_tools、group_chat_tools
if (!['single_chat_tools', 'group_chat_tools'].includes(entry)) { let mes = {}
try {
if (
!['single_chat_tools', 'group_chat_tools', 'normal'].includes(
entry
)
) {
// _this.$toast.clear()
_this.$toast('入口错误:' + entry)
return return
} }
// mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报 // mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
// msgtype 文本(“text”),图片(“image”),视频(“video”),文件(“file”),H5(“news”)和小程序(“miniprogram”) // msgtype 文本(“text”),图片(“image”),视频(“video”),文件(“file”),H5(“news”)和小程序(“miniprogram”)
let mes = {}
let msgtype = { let msgtype = {
0: 'image', 0: 'image',
2: 'video', 2: 'video',
...@@ -99,8 +145,18 @@ export default { ...@@ -99,8 +145,18 @@ export default {
case '0': case '0':
case '2': case '2':
case '3': case '3':
let dataMediaId = {
url: data.materialUrl,
type: msgtype[data.mediaType],
name: data.materialName,
}
let resMaterialId = await getMaterialMediaId(dataMediaId)
if (!resMaterialId.data) {
_this.$toast('获取素材id失败')
return
}
mes[msgtype[data.mediaType]] = { mes[msgtype[data.mediaType]] = {
mediaid: data.materialId, // mediaid: resMaterialId.data.media_id, //
} }
break break
case '5': case '5':
...@@ -114,7 +170,7 @@ export default { ...@@ -114,7 +170,7 @@ export default {
// case '6': // case '6':
// mes.miniprogram = { // mes.miniprogram = {
// appid: 'wx8bd80126147df384', //小程序的appid // appid: 'wx8bd80126147df384', //小程序的appid
// title: 'this is title', //小程序消息的title // title: '_this is title', //小程序消息的title
// imgUrl: // imgUrl:
// 'https://search-operate.cdn.bcebos.com/d054b8892a7ab572cb296d62ec7f97b6.png', //小程序消息的封面图。必须带http或者https协议头,否则报错 $apiName$:fail invalid imgUrl // 'https://search-operate.cdn.bcebos.com/d054b8892a7ab572cb296d62ec7f97b6.png', //小程序消息的封面图。必须带http或者https协议头,否则报错 $apiName$:fail invalid imgUrl
// page: '/index/page.html', //小程序消息打开后的路径,注意要以.html作为后缀,否则在微信端打开会提示找不到页面 // page: '/index/page.html', //小程序消息打开后的路径,注意要以.html作为后缀,否则在微信端打开会提示找不到页面
...@@ -122,24 +178,35 @@ export default { ...@@ -122,24 +178,35 @@ export default {
// break // break
} }
mes.msgtype = msgtype[data.mediaType] mes.msgtype = msgtype[data.mediaType]
wx.invoke('sendChatMessage', mes, function(res) { // _this.$dialog({ message: 'mes:' + JSON.stringify(mes) })
if (res.err_msg == 'sendChatMessage:ok') { } catch (err) {
//发送成功 _this.$dialog({ message: 'err' + JSON.stringify(err) })
}
wx.invoke('sendChatMessage', mes, function(resSend) {
if (resSend.err_msg == 'sendChatMessage:ok') {
//发送成功 sdk会自动弹出成功提示,无需再加
// _this.$toast('发送成功')
} else {
//错误处理
// _this.$dialog({ message: '发送失败:' + JSON.stringify(resSend) })
} }
}) })
_this.$toast.clear()
} else { } else {
_this.$toast.clear()
//错误处理 //错误处理
_this.$dialog({ message: '进入失败:' + JSON.stringify(res) })
} }
}) })
}, },
collect(materialId) { collect(data) {
;(this.isCollected(materialId) ? cancleCollection : addCollection)({ // collection 是否收藏 0未收藏 1 已收藏
;(data.collection == 1 ? cancleCollection : addCollection)({
userId: this.userId, userId: this.userId,
materialId, materialId: data.materialId,
}).then(({ data }) => { }).then(() => {
this.isCollected(materialId) data.collection = [1, 0][data.collection]
? this.isCollected.splice(this.isCollected.indexOf(materialId), 1) this.$toast('操作成功')
: this.isCollected.push(materialId)
}) })
}, },
}, },
...@@ -148,6 +215,11 @@ export default { ...@@ -148,6 +215,11 @@ export default {
<template> <template>
<div> <div>
<van-pull-refresh
v-model="refreshing"
success-text="刷新成功"
@refresh="getList(1)"
>
<van-list <van-list
v-model="loading" v-model="loading"
:finished="finished" :finished="finished"
...@@ -157,21 +229,55 @@ export default { ...@@ -157,21 +229,55 @@ export default {
@load="getList()" @load="getList()"
> >
<div v-for="(item, index) in list" class="list" :key="index"> <div v-for="(item, index) in list" class="list" :key="index">
<div class="title">{{ item.content }}</div> <div class="content bfc-o">
<!-- 图片 -->
<van-image
v-if="item.mediaType == 0"
width="80"
height="80"
:src="item.materialUrl"
/>
<!-- 视频 -->
<van-image
v-if="item.mediaType == 2"
width="80"
height="80"
:src="item.coverUrl"
/>
<span class="title">
{{ item.mediaType == 4 ? item.content : item.materialName }}
</span>
</div>
<div class="info"> <div class="info">
{{ item.content }} {{ mediaTypeObj[item.mediaType] }}类型
<span>2020/2/4</span> <span class="time">{{ item.createTime }}</span>
<div class="fr flex"> <div class="fr flex">
<div class="action" @click="send(item)">发送</div> <div class="action" @click="send(item)">发送</div>
<div v-if="!!userId" class="action" @click="collect(item.id)"> <div v-if="!!userId" class="action" @click="collect(item)">
{{ isCollected(item.id) ? '已' : '' }}收藏 {{ item.collection == 1 ? '取消' : '' }}收藏
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
</van-pull-refresh>
</div> </div>
</template> </template>
<style lang="less" scoped></style> <style lang="less" scoped>
.content {
// display: flex;
.van-image {
float: left;
margin: 0 10px 5px 0;
border: 1px solid #eee;
}
.title {
word-break: break-all;
}
}
.time {
margin-left: 5px;
}
</style>
2
<script> <script>
import { getUserInfo } from '@/api/common'
import { getTypeList } from '@/api/chat' import { getTypeList } from '@/api/chat'
import List from './List' import List from './List'
export default { export default {
...@@ -14,51 +12,18 @@ export default { ...@@ -14,51 +12,18 @@ export default {
loading: false, loading: false,
finished: false, finished: false,
show: false, show: false,
userId: '', // userId: this.$store.state.userId,
} }
}, },
watch: {}, watch: {},
computed: {}, computed: {
beforeCreate() { userId() {
// http://106.13.201.219/?auth_code=xxx#/authWehatCallback return this.$store.state.userId
// console.log('routerbeforeCreate', this.$route);
// let auth_code = location.search
// .slice(1)
// .split('&')[0]
// .split('=')[1]
// if (!auth_code) {
// this.$toast('未获得授权')
// return
// }
// getUserInfo(auth_code)
// .then(({ data }) => {
// this.userId = data.userId
// this.$toast('userId:' + this.userId)
// })
// .catch((err) => {
// this.$toast('err:' + err)
// })
}, },
},
beforeCreate() {},
created() { created() {
let auth_code = location.search // this.$toast('userId:' + this.$store.state.userId)
.slice(1)
.split('&')[0]
.split('=')[1]
if (!auth_code) {
this.$toast('未获得授权')
return
}
getUserInfo(auth_code)
.then(({ data }) => {
this.userId = data.userId
this.$toast('userId:' + this.userId)
})
.catch((err) => {
Dialog.confirm({
title: '标题',
message: err,
})
})
this.getList() this.getList()
}, },
mounted() {}, mounted() {},
...@@ -100,6 +65,7 @@ export default { ...@@ -100,6 +65,7 @@ export default {
<List <List
:ref="'list' + (index + 1)" :ref="'list' + (index + 1)"
:sideId="item.sideId" :sideId="item.sideId"
:mediaType="item.mediaType"
:userId="userId" :userId="userId"
:keyword="keyword" :keyword="keyword"
></List> ></List>
......
<template>
<div>
<div class="task-wrapper">
<div class="header">
<span> 群SOP </span>
<div> {{ task.createTime }} </div>
</div>
<div class="group">
<van-cell class="group-tags" title="发送给客户群">
<template #default>
<template v-for="group of task.groupList.slice(0, 2)">
<van-tag :key="group.chatId" size="large"> {{ group.groupName }} </van-tag>
</template>
<template v-if="task.groupList.length > 2">
<van-tag size="large"> ... </van-tag>
</template>
</template>
</van-cell>
<van-cell title="发送时间" :value="sendRange"></van-cell>
</div>
<div class="content">
<div @touchstart.prevent="touchStart" @touchend="touchEnd">
{{ task.content }}
</div>
<div class="copy-wrapper" v-show="showCopy">
<van-button :class="'copy-btn_' + task.ruleId" :data-clipboard-text="task.content"> 复制 </van-button>
</div>
</div>
<div class="image-list">
<template v-for="material of task.materialList">
<!-- mediaType: 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报 6 海报字体 -->
<van-image v-if="material.mediaType === 0" width="80" :key="material.id" :src="material.materialUrl"></van-image>
</template>
<template v-for="pic of task.picList">
<van-image width="80" :key="pic" :src="pic"></van-image>
</template>
</div>
<div>
<!-- <van-cell title="发送给" is-link value="张三、李四、王五等11人"></van-cell> -->
<van-cell title="已完成成员" is-link :value="showDone" @click="goState(1)"></van-cell>
<van-cell title="未完成成员" is-link :value="showTodo" @click="goState"></van-cell>
</div>
<div class="send-button" v-if="!state">
<van-button type="info" size="mini" @click="send">发送</van-button>
</div>
</div>
<div class="bottom-line"></div>
</div>
</template>
<script>
import ClipboardJS from 'clipboard'
import { changeStatus } from '@/api/community'
export default {
name: 'SOPPanel',
props: {
task: {
type: Object,
required: true
},
// true: 已处理 false: 未处理
state: {
type: Boolean,
required: true
},
isAdmin: {
type: Boolean,
default: true
}
},
data () {
return {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null,
touch: false,
}
},
methods: {
goState (active) {
if (!this.isAdmin) return
this.$router.push({
name: 'taskState',
query: {
taskId: this.task.ruleId,
active: active === 1 ? 1 : 0,
taskType: 2,
}
})
},
send () {
const userId = this.$store.state.userId
const taskId = this.task.ruleId
wx.invoke("shareToExternalChat", {
title: '',
desc: '',
link: '',
imgUrl: ''
}, function(res) {
if (res.err_msg == "shareToExternalChat:ok") {
changeStatus(userId, taskId, 1).then((res) => {
this.$emit('refresh')
}).catch(() => {
this.$emit('refresh')
})
} else {
}
}
)
},
touchStart () {
    clearTimeout(this.copyEvent)
    this.copyEvent = setTimeout(() => {
        this.touch = true
    }, this.touchDelay)
},
touchEnd () {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
}
},
computed: {
sendRange () {
if (!this.task.startExeTime || !this.task.stopExeTime) return ''
return this.task.startExeTime + ' - ' + this.task.stopExeTime
},
todoMembers () {
if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return []
const members = []
for (let member of this.task.scopeList) {
if (!member.done) members.push(member)
}
return members
},
showTodo () {
if (this.todoMembers.length === 0) return '无'
const names = this.todoMembers.map(m => m.name)
if (this.todoMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.todoMembers.length + '人'
},
doneMembers () {
if (!this.task || !this.task.scopeList || this.task.scopeList.length === 0) return []
const members = []
for (let member of this.task.scopeList) {
if (member.done) members.push(member)
}
return members
},
showDone () {
if (this.doneMembers.length === 0) return '无'
const names = this.doneMembers.map(m => m.name)
if (this.doneMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人'
},
},
mounted() {
this.clipboard = new ClipboardJS('.copy-btn_' + this.task.ruleId)
this.clipboard.on('success', (e) => {
this.showCopy = false
})
this.clipboard.on('error', (e) => {
this.showCopy = false
})
},
}
</script>
<style lang="less" scoped>
.task-wrapper {
padding: 10px 8px;
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 5px 0 12px;
span {
font-size: 18px;
font-weight: bold;
}
}
.group {
.group-tags {
:nth-child(n+2) {
margin-left: 5px;
}
.van-tag {
background-color: #f2f2f2;
color: black;
padding: 6px 10px;
}
}
}
.content {
padding: 15px;
background-color: #f2f2f2;
font-size: 16px;
line-height: 20px;
color: #999999;
// margin-bottom: 15px;
min-height: 30px;
position: relative;
.copy-wrapper {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: space-around;
}
}
.image-list {
.van-image {
padding: 10px 10px 0 0;
}
}
.van-cell {
padding: 10px 6px;
}
.send-button {
padding: 10px 5px 5px;
display: flex;
flex-direction: row-reverse;
.van-button {
padding: 0 12px;
margin-right: 12px;
border-radius: 4px;
font-size: 12px;
}
}
}
.bottom-line {
background-color: #f2f2f2;
height: 15px;
}
</style>
<template>
<div>
<div>
<van-search
v-model="keyword"
placeholder="搜索活码名或关键词"
shape="round"
@search="onSearch"
@clear="clear"
>
</van-search>
</div>
<div class="history-wrapper">
<template v-for="k of history">
<van-tag :key="k" size="large" closeable @click="search(k)" @close="removeHistory(k)"> {{ k }} </van-tag>
</template>
</div>
<div class="bottom-line"></div>
<div>
<template v-if="!tasks || tasks.length === 0">
<van-empty description="暂无数据" />
</template>
<template v-else>
<template v-for="task of tasks">
<KeywordPanel :key="task.taskId" :task="task" :state="false"></KeywordPanel>
</template>
</template>
</div>
<van-overlay :show="loading" class-name="overlay">
<van-loading type="spinner"></van-loading>
</van-overlay>
</div>
</template>
<script>
import KeywordPanel from './panel'
import { getKeywordTasks } from '@/api/community'
export default {
components: { KeywordPanel },
data () {
return {
keyword: '',
storageKey: 'keywords',
history: [],
tasks: [],
loading: false,
focus: false
}
},
methods: {
getTasks () {
this.loading = true
getKeywordTasks(this.keyword).then((res) => {
if (res.code === 200) {
this.tasks = res.rows
}
this.loading = false
}).catch(() => {
this.loading = false
})
},
setHistory (keyword) {
if (!keyword) return
if (!this.history.includes(keyword)) {
this.history.push(keyword)
localStorage.setItem(this.storageKey, JSON.stringify(this.history))
}
},
removeHistory (keyword) {
if (this.history.includes(keyword)) {
this.history.splice(this.history.indexOf(keyword), 1)
localStorage.setItem(this.storageKey, JSON.stringify(this.history))
}
},
getHistory () {
this.history = JSON.parse(localStorage.getItem(this.storageKey)) || []
},
onSearch () {
this.setHistory(this.keyword)
this.getTasks()
},
search (keyword) {
this.keyword = keyword
this.getTasks()
},
clear () {
this.getTasks()
}
},
computed: {
url () {
return window.location.href
}
},
created () {
this.getHistory()
this.getTasks()
}
}
</script>
<style lang="less" scoped>
.history-wrapper {
padding: 0 20px 20px;
.van-tag {
margin: 10px 10px 0 0;
}
}
.bottom-line {
background-color: #f2f2f2;
height: 15px;
}
.overlay {
display: flex;
align-items: center;
.van-loading {
margin: auto;
}
}
</style>
<template>
<div>
<div class="task-wrapper">
<div class="header">
<span> {{ task.taskName }} </span>
</div>
<div class="keywords">
<template v-for="keyword of keywords">
<van-tag size="medium" :key="keyword"> {{ keyword }} </van-tag>
</template>
</div>
<div class="guide" v-if="task.welcomeMsg">
<div @touchstart.prevent="touchStart" @touchend="touchEnd">
{{ task.welcomeMsg }}
</div>
<div class="copy-wrapper" v-show="showCopy">
<van-button
:class="'copy-btn_' + task.taskId"
:data-clipboard-text="task.welcomeMsg"
>
复制
</van-button>
</div>
</div>
<div class="content">
<div v-if="task.groupCodeInfo && task.groupCodeInfo.codeUrl">
<van-image width="50" :src="task.groupCodeInfo.codeUrl"></van-image>
</div>
<div class="group">
<span> {{ task.taskName }} </span>
</div>
</div>
<div class="bottom-area">
<span class="time"> {{ task.createTime }} </span>
<van-button type="info" size="mini" @click="send">发送</van-button>
</div>
</div>
<div class="bottom-line"></div>
</div>
</template>
<script>
import ClipboardJS from 'clipboard'
export default {
name: 'KeywordPanel',
props: {
task: {
type: Object,
required: true
}
},
data() {
return {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null,
touch: false
}
},
methods: {
send() {
wx.invoke(
'sendChatMessage',
{
msgtype: 'news',
news: {
link: this.groupCodeUrl,
title: '客户群活码',
desc: '客户群活码',
imgUrl: this.imgUrl
}
},
function(res) {
if (res.err_msg == 'sendChatMessage:ok') {
} else {
}
}
)
},
touchStart() {
clearTimeout(this.copyEvent)
this.copyEvent = setTimeout(() => {
this.touch = true
}, this.touchDelay)
},
touchEnd() {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
}
},
computed: {
keywords() {
if (!this.task || !this.task.keywordList) return []
const keywords = this.task.keywordList.map((k) => k.keyword)
return keywords
},
groupCodeUrl() {
if (window.location.hash[0] === '#') {
return (
window.location.origin +
window.location.pathname +
'#/groupCode?id=' +
this.task.groupCodeInfo.id
)
}
return (
window.location.origin +
window.location.pathname +
'groupCode?id=' +
this.task.groupCodeInfo.id
)
},
imgUrl() {
if (this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl)
return this.task.groupCodeInfo.codeUrl
return ''
}
},
mounted() {
this.clipboard = new ClipboardJS('.copy-btn_' + this.task.taskId)
this.clipboard.on('success', (e) => {
this.showCopy = false
})
this.clipboard.on('error', (e) => {
this.showCopy = false
})
}
}
</script>
<style lang="less" scoped>
.task-wrapper {
padding: 10px 8px;
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 5px 0 12px;
span {
font-size: 18px;
font-weight: bold;
}
}
.keywords {
margin-bottom: 15px;
.van-tag {
margin-right: 10px;
background-color: #f2f2f2;
color: rgba(0, 0, 0, 0.6);
}
}
.guide {
padding: 15px;
background-color: #f2f2f2;
font-size: 16px;
line-height: 20px;
color: #999999;
margin-bottom: 15px;
min-height: 30px;
position: relative;
.copy-wrapper {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: space-around;
}
}
.content {
padding: 10px;
background-color: #f2f2f2;
display: flex;
.group {
padding: 0 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
.group-name {
color: #999999;
}
}
}
.van-cell {
padding: 10px 6px;
}
.bottom-area {
padding: 10px 5px 5px;
display: flex;
justify-content: space-between;
align-items: center;
.time {
color: rgba(0, 0, 0, 0.3);
}
.van-button {
padding: 0 12px;
margin-right: 12px;
border-radius: 4px;
font-size: 12px;
}
}
}
.bottom-line {
background-color: #f2f2f2;
height: 15px;
}
</style>
<template>
<div>
<div class="task-wrapper">
<div class="header">
<span> 老客标签建群 </span>
<div> {{ task.createTime }} </div>
</div>
<div class="guide" v-if="task.welcomeMsg">
<div @touchstart.prevent="touchStart" @touchend="touchEnd">
{{ task.welcomeMsg }}
</div>
<div class="copy-wrapper" v-show="showCopy">
<van-button :class="'copy-btn_' + task.taskId" :data-clipboard-text="task.welcomeMsg"> 复制 </van-button>
</div>
</div>
<div class="content">
<div>
<van-image width="50" :src="task.groupCodeInfo.codeUrl"></van-image>
</div>
<div class="group">
<span> {{ task.taskName }} </span>
<!-- <span class="group-name"> 测试群 </span> -->
</div>
</div>
<div>
<van-cell title="发送给" is-link :value="showMembers"></van-cell>
<van-cell title="已完成成员" is-link :value="showDone" @click="goState(1)"></van-cell>
<van-cell title="未完成成员" is-link :value="showTodo" @click="goState"></van-cell>
</div>
<div class="send-button" v-if="!state">
<van-button type="info" size="mini" @click="send">发送</van-button>
</div>
</div>
<div class="bottom-line"></div>
</div>
</template>
<script>
import ClipboardJS from 'clipboard'
import { changeStatus } from '@/api/community'
export default {
name: 'OldCustomerPanel',
props: {
task: {
type: Object,
required: true
},
// true: 已处理 false: 未处理
state: {
type: Boolean,
required: true
},
isAdmin: {
type: Boolean,
default: true
}
},
data () {
return {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null,
touch: false,
}
},
methods: {
goState (active) {
if (!this.isAdmin) return
this.$router.push({
name: 'taskState',
query: {
taskId: this.task.taskId,
active: active === 1 ? 1 : 0,
taskType: 1,
}
})
},
send () {
const userId = this.$store.state.userId
const taskId = this.task.taskId
wx.invoke("shareToExternalContact", {
title: '客户群活码',
desc: '',
link: this.groupCodeUrl,
imgUrl: ''
}, function(res) {
if (res.err_msg == "shareToExternalContact:ok") {
changeStatus(userId, taskId, 0).then((res) => {
this.$emit('refresh')
}).catch(() => {
this.$emit('refresh')
})
} else {
}
}
)
},
touchStart () {
    clearTimeout(this.copyEvent)
    this.copyEvent = setTimeout(() => {
        this.touch = true
    }, this.touchDelay)
},
touchEnd () {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
}
},
computed: {
todoMembers () {
if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return []
const members = []
for (let member of this.task.scopeList) {
if (!member.done) members.push(member)
}
return members
},
showTodo () {
if (this.todoMembers.length === 0) return '无'
const names = this.todoMembers.map(m => m.name)
if (this.todoMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.todoMembers.length + '人'
},
doneMembers () {
if (!this.task || !this.task.scopeList || this.task.scopeList.length === 0) return []
const members = []
for (let member of this.task.scopeList) {
if (member.done) members.push(member)
}
return members
},
showDone () {
if (this.doneMembers.length === 0) return '无'
const names = this.doneMembers.map(m => m.name)
if (this.doneMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人'
},
showMembers () {
if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return '无'
if (this.task.scopeList.length === 0) return '无'
const names = this.task.scopeList.map(m => m.name)
if (this.task.scopeList.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.task.scopeList.length + '人'
},
groupCodeUrl () {
if (window.location.hash[0] === '#') {
return window.location.origin + window.location.pathname + '#/groupCode?id=' + this.task.groupCodeInfo.uuid
}
return window.location.origin + window.location.pathname + 'groupCode?id=' + this.task.groupCodeInfo.uuid
}
},
mounted() {
this.clipboard = new ClipboardJS('.copy-btn_' + this.task.taskId)
this.clipboard.on('success', (e) => {
this.showCopy = false
})
this.clipboard.on('error', (e) => {
this.showCopy = false
})
},
}
</script>
<style lang="less" scoped>
.task-wrapper {
padding: 10px 8px;
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 5px 0 12px;
span {
font-size: 18px;
font-weight: bold;
}
}
.guide {
padding: 15px;
background-color: #f2f2f2;
font-size: 16px;
line-height: 20px;
color: #999999;
margin-bottom: 15px;
min-height: 30px;
position: relative;
.copy-wrapper {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: space-around;
}
}
.content {
padding: 10px;
background-color: #f2f2f2;
display: flex;
.group {
padding: 0 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
.group-name {
color: #999999;
}
}
}
.van-cell {
padding: 10px 6px;
}
.send-button {
padding: 10px 5px 5px;
display: flex;
flex-direction: row-reverse;
.van-button {
padding: 0 12px;
margin-right: 12px;
border-radius: 4px;
font-size: 12px;
}
}
}
.bottom-line {
background-color: #f2f2f2;
height: 15px;
}
</style>
<template>
<router-view></router-view>
</template>
<template>
<div>
<van-tabs v-model="isDone">
<van-tab :title="'待处理(' + todo.length + ')'" :name="0"></van-tab>
<van-tab :title="'已处理(' + done.length + ')'" :name="1"></van-tab>
</van-tabs>
<div class="type-area">
<van-button round size="small" @click="taskType = 0" :type="taskType === 0 ? 'info' : 'default'">全部</van-button>
<van-button round size="small" @click="taskType = 1" :type="taskType === 1 ? 'info' : 'default'">老客标签建群</van-button>
<van-button round size="small" @click="taskType = 2" :type="taskType === 2 ? 'info' : 'default'">群SOP</van-button>
</div>
<template v-if="!tasks || tasks.length === 0">
<van-empty description="暂无数据" />
</template>
<template v-else>
<template
v-for="task in tasks"
>
<template v-if="task.type === 1">
<OldCustomerPanel :key="task.taskId" :task="task" :state="isDone ? true : false" @refresh="getTasks"></OldCustomerPanel>
</template>
<template v-else>
<SOPPanel :key="task.ruleId" :task="task" :state="isDone ? true : false" @refresh="getTasks"></SOPPanel>
</template>
</template>
</template>
<van-overlay :show="loading" class-name="overlay">
<van-loading type="spinner"></van-loading>
</van-overlay>
</div>
</template>
<script>
import { getTasks } from '@/api/community'
import OldCustomerPanel from '../oldCustomer/panel'
import SOPPanel from '../SOP/panel'
export default {
components: { OldCustomerPanel, SOPPanel },
data () {
return {
isDone: 0, // 0: 待处理 1: 已处理
taskType: 0, // 任务类型 0:全部 1:老客标签建群 2:群SOP
loading: false, // 加载状态
todo: [], // 待处理数据
done: [], // 已处理数据
}
},
methods: {
// 获取老客标签建群和群SOP任务数据
getTasks () {
this.loading = true
getTasks(this.$store.state.userId, this.taskType).then((res) => {
if (res.code === 200) {
this.todo = res.todo || []
this.done = res.done || []
} else {
}
this.loading = false
}).catch((error) => {
this.loading = false
})
},
},
computed: {
userId () {
return this.$store.state.userId
},
tasks () {
if (this.isDone === 1) return this.done
return this.todo
},
},
watch: {
taskType (val) {
if (this.userId) this.getTasks()
},
userId (val) {
if (val) {
this.getTasks()
}
}
},
created () {
this.taskType = parseInt(this.$route.query.type)
}
}
</script>
<style lang="less" scoped>
.type-area {
padding: 8px;
background-color: #f2f2f2;
.van-button {
margin: 0 3px;
}
}
.overlay {
display: flex;
align-items: center;
.van-loading {
margin: auto;
}
}
</style>
<template>
<div>
<van-tabs :active="active" v-model="active">
<van-tab :title="'未完成(' + todoNum + ')'" :name="0">
<template v-if="todoMembers.length === 0">
<van-empty description="暂无数据" />
</template>
<template v-else>
<div v-for="member in todoMembers" :key="member.userId" class="cell">
<van-image width="45" :src="member.avatar"></van-image>
<div class="content"> {{ member.name }} </div>
</div>
</template>
</van-tab>
<van-tab :title="'已完成(' + doneNum + ')'" :name="1">
<template v-if="doneMembers.length === 0">
<van-empty description="暂无数据" />
</template>
<template v-else>
<div v-for="member in doneMembers" :key="member.userId" class="cell">
<van-image width="45" :src="member.avatar"></van-image>
<div class="content"> {{ member.name }} </div>
</div>
</template>
</van-tab>
</van-tabs>
<van-overlay :show="loading" class-name="overlay">
<van-loading type="spinner"></van-loading>
</van-overlay>
</div>
</template>
<script>
import { getState } from '@/api/community'
export default {
data () {
return {
taskId: '', // 任务ID
active: 0, // 0: 未完成 1: 已完成
taskType: 0, // 0: 老客标签建群 1: 群SOP
waitingCustomers: [], // 未完成客户
finishedCustomers: [], // 已完成客户
members: [], // 任务关联员工列表
loading: false, // 加载状态
}
},
methods: {
// 获取任务状态
getState () {
if (!this.taskId) return
this.loading = true
getState(this.taskId, this.taskType).then((res) => {
if (res.code === 200) {
this.members = res.data || []
}
this.loading = false
}).catch(() => {
this.loading = false
})
}
},
computed: {
// 带处理人员
todoMembers () {
const members = this.members.filter((m) => {
return !m.done
})
return members
},
todoNum () {
return this.todoMembers.length
},
// 已处理人员
doneMembers () {
const members = this.members.filter((m) => {
return m.done
})
return members
},
doneNum () {
return this.doneMembers.length
},
},
created () {
this.taskId = this.$route.query.taskId
this.active = this.$route.query.active || 0
this.taskType = this.$route.query.taskType || 0
this.getState()
}
}
</script>
<style lang="less" scoped>
/deep/ .van-tabs__wrap {
border-bottom: 1px solid #EEEEEE;
}
.cell {
display: flex;
align-items: center;
padding: 20px 15px;
border-bottom: 1px solid #EEEEEE;
:nth-child(n+2) {
margin-left: 20px;
}
.content {
font-size: 20px;
// font-weight: bold;
}
}
.overlay {
display: flex;
align-items: center;
.van-loading {
margin: auto;
}
}
</style>
<template>
<div>
<div v-if="!code || !code.actualQRCode">
<van-empty :description="message" />
</div>
<div v-else class="code-wrapper">
<div class="header">
{{ code.activityName }}
</div>
<div class="welcome">
{{ code.guide }}
</div>
<div class="code-name">
{{ code.groupName }}
</div>
<div class="code-image">
<van-image width="300" :src="code.actualQRCode"></van-image>
</div>
<div class="service" v-if="code.isOpenTip === '1'">
<van-button type="danger" @click="dialog = true">无法加群?</van-button>
</div>
<van-dialog
v-model="dialog"
class="service-dialog"
:showConfirmButton="false"
:closeOnClickOverlay="true"
>
<div>
<van-image
:src="code.serviceQrCode"
width="200"
>
</van-image>
<div class="service-message">
{{ code.tipMsg }}
</div>
<div class="tip">
请长按二维码添加客服微信
</div>
</div>
<van-icon name="cross" class="close" @click="dialog = false" />
</van-dialog>
</div>
</div>
</template>
<script>
import { getDetail } from '@/api/groupCode'
export default {
data () {
return {
groupCodeUUID: '', // 群活码ID
code: {
activityName: '', // 活码名称
guide: '', // 加群引导语
actualQRCode: '', // 实际群码
isOpenTip: '', // 是否显示无法加群提示
tipMsg: '', // 无法加群提示语
serviceQrCode: '', // 客服二维码
groupName: '', // 实际群名称
},
dialog: false,
message: '抱歉,暂无可用实际群码',
}
},
methods: {
// 获取群活码详情
getDetail () {
if (!this.groupCodeUUID) return
getDetail(this.groupCodeUUID).then(({ data, msg }) => {
this.code = Object.assign(this.code, data)
if (msg) this.message = msg
}).catch(() => {})
},
},
created () {
this.groupCodeUUID = this.$route.query.id
this.getDetail()
},
}
</script>
<style lang="less" scoped>
.code-wrapper {
margin: 20px 10px;
.header {
font-size: 18px;
margin: 20px 10px;
text-align: center;
}
.welcome {
font-size: 16px;
color: #AAAAAA;
margin: 20px 10px 60px;
}
.code-name {
font-size: 20px;
margin: 20px 10px 2px;
font-weight: bold;
text-align: center;
}
.code-image {
text-align: center;
margin-bottom: 100px;
}
.service {
text-align: center;
.van-button {
border-radius: 4px;
height: 36px;
}
}
}
.service-dialog {
text-align: center;
border-radius: 0;
padding: 20px;
.service-message {
margin-bottom: 30px;
}
.tip {
font-size: 12px;
color: #AAAAAA;
}
.close {
position: absolute;
top: 10px;
right: 10px;
}
}
</style>
<template>
<div>
<!-- 头部 -->
<div class="header">
<span class="title"> 社群关系 </span>
<van-icon
name="cross"
color="#9c9c9c"
size="16"
@click="$router.back()"
/>
</div>
<van-divider />
<!-- 标签页 -->
<div class="labelPge">
<van-tabs
v-model="active"
color="#2C8CF0"
line-width="50%"
line-height="1.4px"
title-active-color="#2C8CF0"
>
<van-tab :title="'添加的员工(' + staff.length + ')'">
<van-list v-model="loading" :finished="finished" @load="onLoad">
<van-cell v-for="(item, index) in staff" :key="index">
<div class="details">
<div class="detail">
<div class="left">
<div class="img">
<img :src="item.headImageUrl" alt="" />
</div>
<div class="right">
<div>
<span>{{ item.userName }} &nbsp; &nbsp;</span>
</div>
<div class="c9">
<span>添加时间:</span>
<span>{{ getTime(item.createTime) }}</span>
</div>
</div>
</div>
</div>
</div>
</van-cell>
</van-list>
</van-tab>
<van-tab :title="'添加的群聊(' + groupChat.length + ')'">
<div class="groupchat1" @click="conGroup">只看与我共同的群聊</div>
<van-list v-model="loading" :finished="finished" @load="onLoad">
<van-cell v-for="(item, index) in groupChat" :key="index">
<div class="details">
<div class="detail">
<div class="left">
<div class="img">
<img src="@/assets/avatar.jpg" alt="" />
</div>
<div class="right">
<div>
{{ item.groupName + '(' + item.groupMemberNum + ')' }}
</div>
<div>
<span class="c9">群主:</span>
<span class="c9">{{ item.ownerName }}</span>
</div>
<div class="c9">
<span>入群时间:</span
><span>{{ getTime(item.joinTime) }}</span>
</div>
</div>
</div>
<div class="groupchat2" v-if="!item.commonGroup">
共同群聊
</div>
</div>
</div>
</van-cell>
</van-list>
</van-tab>
</van-tabs>
</div>
</div>
</template>
<script>
import { findAddaddEmployes, findAddGroupNum } from '@/api/portrait'
export default {
data() {
return {
active: 0,
// 添加员工
list: [],
loading: false,
finished: false,
staff: [], // 添加的员工
groupChat: [], // 添加的群聊
commonGroup: [], // 共同的群聊
// externalUserid: "wmiGuBCgAAIH-T9ekaE-Q52N2lKWeInw",
externalUserid: ''
}
},
computed: {
userId() {
return this.$store.state.userId // 员工Id
}
},
created() {
this.externalUserid = this.$route.query.customerId
this.findAddaddEmployes()
this.findAddGroupNum()
},
methods: {
conGroup() {
this.groupChat = this.commonGroup
// console.log(123);
},
onLoad() {
setTimeout(() => {
for (let i = 0; i < 2; i++) {
this.list.push(this.list.length + 1)
}
// 加载状态结束
this.loading = false
// 数据全部加载完成
if (this.list.length >= 2) {
this.finished = true
}
}, 1000)
},
findAddaddEmployes() {
findAddaddEmployes(this.externalUserid)
.then(({ data }) => {
// console.log(data);
this.staff = data
})
.catch((err) => {
console.log(err)
})
},
findAddGroupNum() {
findAddGroupNum({
externalUserid: this.externalUserid,
userId: this.userId
})
.then(({ data }) => {
// console.log(data);
// debugger
this.groupChat = data
this.commonGroup = this.groupChat.filter((ele) => {
// debugger
return ele.groupMemberNum == 1
})
})
.catch((err) => {
console.log(err)
})
},
// 时间处理器
getTime(data) {
const date = new Date(data)
// console.log(timer.getFullYear());
var Y = date.getFullYear() + '-'
var M =
(date.getMonth() + 1 < 10
? '0' + (date.getMonth() + 1)
: date.getMonth() + 1) + '-'
var D =
date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + ' '
var h =
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
var m =
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return Y + M + D + h + m
}
}
}
</script>
<style lang="less" scoped>
/deep/body {
width: 100%;
height: 600px;
}
.labelPge {
width: 100%;
height: 100%;
background-color: #f2f2f2;
}
.header {
margin: 20px 20px 10px;
vertical-align: center;
text-align: left;
}
.van-icon-cross {
float: right;
}
.title {
text-align: center;
font-size: 14px;
}
/* 添加的员工 */
.details {
margin: 10px;
}
.detail {
display: flex;
justify-content: space-between;
.c9 {
color: #9c9c9c;
font-size: 12px;
}
}
.left {
display: flex;
margin-bottom: 20px;
.img {
width: 50px;
height: 50px;
background-color: #f2f2f2;
margin-right: 10px;
border-radius: 25px;
vertical-align: bottom;
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
// 添加的群聊
.groupchat1 {
width: 120px;
height: 20px;
font-size: 12px;
background-color: #fff;
border-radius: 20px;
text-align: center;
line-height: 20px;
margin: 10px 20px;
}
.groupchat2 {
width: 60px;
height: 20px;
font-size: 12px;
background-color: #fff;
border-radius: 5px;
text-align: center;
line-height: 20px;
margin: 10px 0px;
color: #2c8cf0;
border: 1px solid #2c8cf0;
}
</style>
<template>
<div>
<!-- 头部 -->
<div class="header">
<van-icon
name="arrow-left"
color="#9c9c9c"
size="16"
@click="$router.back()"
/>
<span class="title"> 客户资料 </span>
<div class="data" v-if="flage" @click="edit">编辑</div>
<div class="data" v-else @click="saveUserInformation">保存</div>
</div>
<van-divider />
<!-- 详细资料 -->
<van-form @submit="saveUserInformation" :disabled="flage">
<div class="details">
<div class="detail">
<div class="left">
<div class="img"><img :src="form.avatar" alt="" /></div>
<div class="right">
<div>
<span
>{{
user.remark
? user.remark
: (user.name || '') + '-' + (user.remarkCorpName || '')
}}
</span>
<span class="icon iconfont icon-man" v-if="user.gender == 1">
</span>
<span
class="icon iconfont icon-xingbie"
v-else-if="user.gender == 2"
></span>
<van-icon name="manager" color="#9c9c9c" v-else />
</div>
<div class="c9">
<span>昵称:</span><span>{{ user.name }}</span>
</div>
</div>
</div>
</div>
</div>
<van-field
v-model="form.remarkMobiles"
name="手机号"
label="手机号"
placeholder="手机号"
input-align="right"
/>
<van-field
v-if="flage"
v-model="form.age"
name="年龄"
label="年龄"
placeholder="年龄"
input-align="right"
disabled
/>
<van-field
v-model="form.birthday"
name="生日"
label="生日"
placeholder="生日"
input-align="right"
@click="!flage ? (show = true) : ''"
/>
<van-popup
v-model="show"
position="bottom"
round
:style="{ height: '60%' }"
>
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="minDate"
:max-date="maxDate"
@confirm="confirm"
@cancel="cancel"
/></van-popup>
<!-- -------------------------- -->
<van-field
v-model="form.email"
name="邮箱"
label="邮箱"
placeholder="邮箱"
input-align="right"
/>
<van-field
v-model="form.address"
name="地址"
label="地址"
placeholder="地址"
input-align="right"
/>
<van-field
v-model="form.qq"
name="QQ"
label="QQ"
placeholder="QQ"
input-align="right"
/>
<van-field
v-model="form.position"
name="职业"
label="职业"
placeholder="职业"
input-align="right"
/>
<van-field
v-model="form.remarkCorpName"
name="公司"
label="公司"
placeholder="公司"
input-align="right"
/>
<van-field
v-model="form.description"
name="其他描述"
label="其他描述"
placeholder="其他描述"
input-align="left"
type="textarea"
class="others"
/>
</van-form>
</div>
</template>
<script>
import { getCustomerInfo, getWeCustomerInfo } from '@/api/portrait'
export default {
data() {
return {
flage: true,
// 选择生日
show: false,
minDate: new Date(1940, 0, 1),
maxDate: new Date(),
currentDate: new Date(2000, 0, 17),
// 接口开始
// 表单数据
user: {},
form: {
externalUserid: '', // 客户Id
userId: '', // 员工Id
name: '', // 昵称
remarkMobiles: '', // 手机号
birthday: '', // 客户生日
age: '', // 年龄
email: '', // 邮箱
address: '', // 地址
qq: '', // qq
position: '', // 职业
remarkCorpName: '', // 公司
description: '' // 其他描述
}
}
},
computed: {
userId() {
return this.$store.state.userId // 员工Id
}
},
created() {
this.form.externalUserid = this.$route.query.customerId
// 获取客户详细信息
getCustomerInfo({
externalUserid: this.form.externalUserid,
userId: this.userId
})
.then(({ data }) => {
this.form = data
this.user = Object.assign({}, data)
})
.catch((err) => {
console.log(err)
})
},
methods: {
// 选择生日
confirm(val) {
this.show = false
this.form.birthday = this.getTime(val)
console.log(val)
},
cancel() {
this.show = false
},
edit() {
this.flage = !this.flage
},
// 时间处理器
getTime(data) {
const date = new Date(data)
// console.log(timer.getFullYear());
var Y = date.getFullYear() + '-'
var M =
(date.getMonth() + 1 < 10
? '0' + (date.getMonth() + 1)
: date.getMonth() + 1) + '-'
var D =
date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + ' '
// var h =
// (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
// var m =
// date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return Y + M + D
},
// 点击保存按钮提交表单
saveUserInformation() {
this.$toast.loading({
message: 'loading...',
duration: 0,
forbidClick: true
})
this.flage = !this.flage
this.form.userId = this.userId
getWeCustomerInfo(this.form)
.then((data) => {
this.$toast('操作成功')
})
.catch((err) => {
console.log(err)
})
}
}
}
</script>
<style lang="less" scoped>
.iconfont {
color: #2c8cf0;
}
.icon-xingbie {
color: pink;
}
.header {
margin: 20px 10px 10px;
vertical-align: center;
// text-align: center;
}
.van-icon-cross {
position: absolute;
left: 10px;
}
.title {
text-align: center;
font-size: 14px;
}
// 详细资料
.details {
margin: 10px 16px;
}
.detail {
display: flex;
justify-content: space-between;
.c9 {
color: #c8c9cc;
}
}
.left {
display: flex;
margin-bottom: 20px;
.img {
width: 40px;
height: 40px;
background-color: #f2f2f2;
margin-right: 10px;
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
.data {
font-size: 12px;
color: #5fa7f3;
float: right;
}
.divider {
width: 100%;
height: 10px;
background-color: #f2f2f2;
}
/deep/.others {
line-height: 40px;
flex-direction: column;
.van-field__control--left {
float: left;
line-height: 20px;
.textarea {
margin-top: 20px;
}
}
}
</style>
<template>
<div>
<!-- 头部 -->
<div class="header">
<van-icon
name="arrow-left"
color="#9c9c9c"
size="16"
@click="$router.back()"
/>
<span class="title"> 客户资料 </span>
<div class="data" v-if="flage" @click="edit">编辑</div>
<div class="data" v-else @click="saveUserInformation">保存</div>
</div>
<van-divider />
<!-- 详细资料 -->
<van-form @submit="saveUserInformation" :disabled="flage">
<div class="details">
<div class="detail">
<div class="left">
<div class="img"><img src="" alt="" /></div>
<div class="right">
<div>
<span>张三 &nbsp; &nbsp;</span
><van-icon name="manager" color="#9c9c9c" />
</div>
<div class="c9">
<span>昵称:</span><span>{{ form.name }}</span>
</div>
</div>
</div>
</div>
</div>
<van-field
v-model="form.remarkMobiles"
name="手机号"
label="手机号"
placeholder="手机号"
input-align="right"
/>
<van-field
v-model="form.age"
name="年龄"
label="年龄"
placeholder="年龄"
input-align="right"
/>
<van-field
v-model="form.birthday"
name="生日"
label="生日"
placeholder="生日"
input-align="right"
/>
<!-- -------------------------- -->
<van-field
v-model="form.email"
name="邮箱"
label="邮箱"
placeholder="邮箱"
input-align="right"
/>
<van-field
v-model="form.address"
name="地址"
label="地址"
placeholder="地址"
input-align="right"
/>
<van-field
v-model="form.qq"
name="QQ"
label="QQ"
placeholder="QQ"
input-align="right"
/>
<van-field
v-model="form.position"
name="职业"
label="职业"
placeholder="职业"
input-align="right"
/>
<van-field
v-model="form.remarkCorpName"
name="公司"
label="公司"
placeholder="公司"
input-align="right"
/>
<van-field
v-model="form.description"
name="其他描述"
label="其他描述"
placeholder="其他描述"
input-align="left"
type="textarea"
class="others"
/>
</van-form>
</div>
</template>
<script>
import { getCustomerInfo, getWeCustomerInfo } from '@/api/portrait'
import { getUserInfo } from '@/api/common'
export default {
data() {
return {
flage: true,
// 接口开始
// 表单数据
form: {
externalUserid: '', // 客户Id
userId: this.$store.state.userId, // 员工Id
name: '', // 昵称
remarkMobiles: '', // 手机号
birthday: '', // 客户生日
age: '', // 年龄
email: '', // 邮箱
address: '', // 地址
qq: '', // qq
position: '', // 职业
remarkCorpName: '', // 公司
description: '', // 其他描述
},
}
},
computed: {
// 获取客户年龄
},
created() {
this.form.externalUserid = this.$route.query.customerId
// 获取客户详细信息
getCustomerInfo({
externalUserid: this.form.externalUserid,
userId: this.form.userId,
})
.then(({ data }) => {
console.log(data)
this.form = data
console.log(this.form)
})
.catch((err) => {
console.log(err)
})
},
methods: {
edit() {
this.flage = !this.flage
},
// 点击保存按钮提交表单
saveUserInformation() {
this.flage = !this.flage
getWeCustomerInfo(this.form)
.then((data) => {
console.log(data)
})
.catch((err) => {
console.log(err)
})
},
},
}
</script>
<style lang="less" scoped>
.header {
margin: 20px 10px 10px;
vertical-align: center;
// text-align: center;
}
.van-icon-cross {
position: absolute;
left: 10px;
}
.title {
text-align: center;
font-size: 14px;
}
// 详细资料
.details {
margin: 10px 16px;
}
.detail {
display: flex;
justify-content: space-between;
.c9 {
color: #c8c9cc;
}
}
.left {
display: flex;
margin-bottom: 20px;
.img {
width: 40px;
height: 40px;
background-color: #f2f2f2;
margin-right: 10px;
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
.data {
font-size: 12px;
color: #5fa7f3;
float: right;
}
.divider {
width: 100%;
height: 10px;
background-color: #f2f2f2;
}
/deep/.others {
line-height: 40px;
flex-direction: column;
.van-field__control--left {
float: left;
line-height: 20px;
.textarea {
margin-top: 20px;
}
}
}
</style>
...@@ -13,7 +13,7 @@ process.env.VUE_APP_TITLE = require('./package.json').description ...@@ -13,7 +13,7 @@ process.env.VUE_APP_TITLE = require('./package.json').description
// 如果您的应用程序部署在子路径中,则需要在这指定子路径 // 如果您的应用程序部署在子路径中,则需要在这指定子路径
// 例如:https://www.my-app.com/my-app/ // 例如:https://www.my-app.com/my-app/
// 需要将它改为'/my-app/' // 需要将它改为'/my-app/'
const BASE_URL = process.env.NODE_ENV === 'development' ? '/' : '/mobile' const BASE_URL = process.env.NODE_ENV === 'development' ? '/' : '/mobile/'
module.exports = { module.exports = {
publicPath: BASE_URL, publicPath: BASE_URL,
......
{
"presets": [
"@babel/preset-env"
]
}
\ No newline at end of file \ No newline at end of file
.DS_Store
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea/
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const htmlTemplateProcess = new HtmlWebpackPlugin({
template:
'html-withimg-loader!' + path.resolve(__dirname, '../src/taskProcess.html'),
hash: true,
chunks: ['common', 'taskProcess'],
inject: true,
minify: false,
filename: 'taskProcess.html'
})
const htmlTemplateIndex = new HtmlWebpackPlugin({
template:
'html-withimg-loader!' + path.resolve(__dirname, '../src/index.html'),
hash: true,
// chunks:['common','list'],
chunks: ['common', 'index'],
inject: true,
minify: false,
filename: 'index.html'
})
const htmlTemplateFission = new HtmlWebpackPlugin({
template:
'html-withimg-loader!' + path.resolve(__dirname, '../src/fission.html'),
hash: true,
// chunks:['common','list'],
chunks: ['common', 'fission'],
inject: true,
minify: false,
filename: 'fission.html'
})
var dev = {
entry: {
taskProcess: './src/js/taskProcess.js',
fission: './src/js/fission.js',
index: './src/js/index.js',
common: './src/js/common.js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [
{
test: /\.js$/, // 匹配文件路径的正则表达式,通常我们都是匹配文件类型后缀
exclude: '/node_modules/',
loader: 'babel-loader' // 指定使用的 loader
},
{
test: /\.css$/,
exclude: /node_modules/,
// loader:'style-loader!css-loader?modules&localIdentName=[path][name]---[local]---[hash:base64:5]'
use: ['style-loader', 'css-loader']
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'file-loader',
options: {
esModule: false,
limit: 5 * 1024,
outputPath: 'images'
}
}
]
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000
}
},
{
test: /\.html$/,
// html中的img标签
use: ['html-withimg-loader']
}
]
},
plugins: [
// 全局暴露统一入口
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
}),
htmlTemplateIndex,
htmlTemplateProcess,
htmlTemplateFission,
new webpack.HotModuleReplacementPlugin()
]
}
module.exports = dev
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

1.42 KB | W: | H:

3.13 KB | W: | H:

linkwe-ui/src/assets/logo/logo.png
linkwe-ui/src/assets/logo/logo.png
linkwe-ui/src/assets/logo/logo.png
linkwe-ui/src/assets/logo/logo.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!