Commit 2d84416f by xinla

--no commit message

1 parent 68155df3
...@@ -81,6 +81,7 @@ export default { ...@@ -81,6 +81,7 @@ export default {
'sendChatMessage', 'sendChatMessage',
'getContext', 'getContext',
'getCurExternalContact', 'getCurExternalContact',
'getCurExternalChat',
'openEnterpriseChat', 'openEnterpriseChat',
'shareToExternalContact', 'shareToExternalContact',
'shareToExternalChat', 'shareToExternalChat',
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<span <span
:style="{ :style="{
color: form.customerType === 1 ? '#4bde03' : '#f9a90b', color: form.customerType === 1 ? '#4bde03' : '#f9a90b',
'font-size': '12px' 'font-size': '12px',
}" }"
> >
{{ { 1: '@微信', 2: '@企业微信' }[form.customerType] }} {{ { 1: '@微信', 2: '@企业微信' }[form.customerType] }}
...@@ -320,14 +320,14 @@ import { ...@@ -320,14 +320,14 @@ import {
findTrajectory, findTrajectory,
addOrEditWaitHandle, addOrEditWaitHandle,
addOrUpdatePersonTags, addOrUpdatePersonTags,
sync sync,
} from '@/api/portrait' } from '@/api/portrait'
// import { getUserInfo } from "@/api/common"; // import { getUserInfo } from "@/api/common";
import StepList from '@/components/StepList.vue' import StepList from '@/components/StepList.vue'
import { param2Obj } from '@/utils/index' import { param2Obj } from '@/utils/index'
export default { export default {
components: { components: {
StepList StepList,
}, },
data() { data() {
return { return {
...@@ -374,7 +374,7 @@ export default { ...@@ -374,7 +374,7 @@ export default {
remarkCorpName: '', // 公司 remarkCorpName: '', // 公司
description: '', // 其他描述 description: '', // 其他描述
tags: [], // 企业标签合集 tags: [], // 企业标签合集
personTags: [] // 个人标签合集 personTags: [], // 个人标签合集
}, },
alllabel: [], // 标签组 alllabel: [], // 标签组
// 点击测试组标签获取的变量 // 点击测试组标签获取的变量
...@@ -394,7 +394,7 @@ export default { ...@@ -394,7 +394,7 @@ export default {
// 客户轨迹 // 客户轨迹
query: { query: {
page: 1, page: 1,
trajectoryType: null trajectoryType: null,
}, },
loading: false, loading: false,
...@@ -407,22 +407,22 @@ export default { ...@@ -407,22 +407,22 @@ export default {
2: { name: '跟进中', color: 'info' }, 2: { name: '跟进中', color: 'info' },
3: { name: '已成交', color: 'primary' }, 3: { name: '已成交', color: 'primary' },
4: { name: '无意向', color: 'warning' }, 4: { name: '无意向', color: 'warning' },
5: { name: '已流失', color: 'danger' } 5: { name: '已流失', color: 'danger' },
}), }),
editLabelType: '', // 编辑标签类型 editLabelType: '', // 编辑标签类型
showAddTag: false, showAddTag: false,
newPersonTag: '' newPersonTag: '',
} }
}, },
watch: { watch: {
'$store.state.agentConfigStatus'(val) { '$store.state.agentConfigStatus'(val) {
val && this.init() val && this.init()
} },
}, },
computed: { computed: {
userId() { userId() {
return process.env.NODE_ENV !== 'development' ? this.$store.state.userId : 'XuXueJun' return process.env.NODE_ENV !== 'development' ? this.$store.state.userId : 'XuXueJun'
} },
// activeLabel : () => { // activeLabel : () => {
// this.addTag.forEach((value) => { // this.addTag.forEach((value) => {
// value.name == this.name // value.name == this.name
...@@ -439,7 +439,7 @@ export default { ...@@ -439,7 +439,7 @@ export default {
this.$toast.loading({ this.$toast.loading({
message: 'loading...', message: 'loading...',
duration: 0, duration: 0,
forbidClick: true forbidClick: true,
}) })
// 获取agentId // 获取agentId
let query = param2Obj(window.location.search) let query = param2Obj(window.location.search)
...@@ -461,7 +461,7 @@ export default { ...@@ -461,7 +461,7 @@ export default {
wx.invoke('getContext', {}, function(res) { wx.invoke('getContext', {}, function(res) {
if (res.err_msg == 'getContext:ok') { if (res.err_msg == 'getContext:ok') {
let entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools let entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools
if (!['single_chat_tools', 'group_chat_tools', 'contact_profile'].includes(entry)) { if (!['single_chat_tools', 'contact_profile'].includes(entry)) {
// _this.$toast.clear() // _this.$toast.clear()
_this.$toast('入口错误:' + entry) _this.$toast('入口错误:' + entry)
return return
...@@ -491,7 +491,7 @@ export default { ...@@ -491,7 +491,7 @@ export default {
// this.$toast('userId:' + this.userId) // this.$toast('userId:' + this.userId)
getCustomerInfo({ getCustomerInfo({
externalUserid: this.externalUserid, externalUserid: this.externalUserid,
userId: this.userId userId: this.userId,
}) })
.then(({ data }) => { .then(({ data }) => {
if (data.tagIds && data.tagNames) { if (data.tagIds && data.tagNames) {
...@@ -499,7 +499,7 @@ export default { ...@@ -499,7 +499,7 @@ export default {
data.tagNames = data.tagNames.split(',') data.tagNames = data.tagNames.split(',')
data.tags = data.tagIds.map((unit, index) => ({ data.tags = data.tagIds.map((unit, index) => ({
tagId: unit, tagId: unit,
name: data.tagNames[index] name: data.tagNames[index],
})) }))
} }
...@@ -508,7 +508,7 @@ export default { ...@@ -508,7 +508,7 @@ export default {
data.personTagNames = data.personTagNames.split(',') data.personTagNames = data.personTagNames.split(',')
data.personTags = data.personTagIds.map((unit, index) => ({ data.personTags = data.personTagIds.map((unit, index) => ({
tagId: unit, tagId: unit,
name: data.personTagNames[index] name: data.personTagNames[index],
})) }))
} }
this.form = data this.form = data
...@@ -522,15 +522,15 @@ export default { ...@@ -522,15 +522,15 @@ export default {
this.$toast.loading({ this.$toast.loading({
message: 'loading...', message: 'loading...',
duration: 0, duration: 0,
forbidClick: true forbidClick: true,
}) })
let params = { let params = {
groupTagType: 1 groupTagType: 1,
} }
if (type === 'person') { if (type === 'person') {
params = { params = {
groupTagType: 3, groupTagType: 3,
userId: this.userId userId: this.userId,
} }
} }
return getAllTags(params) return getAllTags(params)
...@@ -558,7 +558,7 @@ export default { ...@@ -558,7 +558,7 @@ export default {
pageNum: page, pageNum: page,
pageSize: 10, pageSize: 10,
userId: this.userId, userId: this.userId,
externalUserid: this.externalUserid externalUserid: this.externalUserid,
} }
Object.assign(query, this.query) Object.assign(query, this.query)
query.trajectoryType == 0 && (query.trajectoryType = null) query.trajectoryType == 0 && (query.trajectoryType = null)
...@@ -584,7 +584,7 @@ export default { ...@@ -584,7 +584,7 @@ export default {
userId: this.userId, userId: this.userId,
externalUserid: this.externalUserid, externalUserid: this.externalUserid,
content: this.conagency, content: this.conagency,
trackState: this.trackState //1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失 trackState: this.trackState, //1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失
} }
addOrEditWaitHandle(form) addOrEditWaitHandle(form)
.then((data) => { .then((data) => {
...@@ -647,9 +647,9 @@ export default { ...@@ -647,9 +647,9 @@ export default {
this.$router.push({ this.$router.push({
path, path,
query: { query: {
customerId: this.externalUserid customerId: this.externalUserid,
// type // type
} },
}) })
}, },
// 点击编辑按钮 // 点击编辑按钮
...@@ -698,7 +698,7 @@ export default { ...@@ -698,7 +698,7 @@ export default {
this.addTag.push({ this.addTag.push({
groupId: item.groupId, groupId: item.groupId,
name: item.name, name: item.name,
tagId: item.tagId tagId: item.tagId,
}) })
} else { } else {
// 数组里存在该对象,则删除 // 数组里存在该对象,则删除
...@@ -711,7 +711,7 @@ export default { ...@@ -711,7 +711,7 @@ export default {
externalUserid: this.externalUserid, externalUserid: this.externalUserid,
userId: this.userId, userId: this.userId,
isCompanyTag: this.editLabelType !== 'person', //是否是企业标签true是;false:不是 isCompanyTag: this.editLabelType !== 'person', //是否是企业标签true是;false:不是
addTag: this.addTag.map((e) => ({ tagId: e.tagId })) addTag: this.addTag.map((e) => ({ tagId: e.tagId })),
}) })
.then((res) => { .then((res) => {
// console.log(res); // console.log(res);
...@@ -743,7 +743,7 @@ export default { ...@@ -743,7 +743,7 @@ export default {
// this.$toast('userId:' + this.userId) // this.$toast('userId:' + this.userId)
findAddGroupNum({ findAddGroupNum({
externalUserid: this.externalUserid, externalUserid: this.externalUserid,
userId: this.userId userId: this.userId,
}) })
.then(({ data }) => { .then(({ data }) => {
// console.log(data); // console.log(data);
...@@ -762,7 +762,7 @@ export default { ...@@ -762,7 +762,7 @@ export default {
// 添加个人标签 // 添加个人标签
submitNewPersonTag() { submitNewPersonTag() {
let params = { let params = {
weTags: [{ name: this.newPersonTag, owner: this.userId }] weTags: [{ name: this.newPersonTag, owner: this.userId }],
} }
addOrUpdatePersonTags(params) addOrUpdatePersonTags(params)
.then((res) => { .then((res) => {
...@@ -778,15 +778,15 @@ export default { ...@@ -778,15 +778,15 @@ export default {
this.$toast.loading({ this.$toast.loading({
message: 'loading...', message: 'loading...',
duration: 0, duration: 0,
forbidClick: true forbidClick: true,
}) })
sync(this.userId).then((res) => { sync(this.userId).then((res) => {
this.$toast.success('同步成功') this.$toast.success('同步成功')
this.findTrajectory() this.findTrajectory()
this.$toast.clear() this.$toast.clear()
}) })
} },
} },
} }
</script> </script>
......
...@@ -73,28 +73,30 @@ export default { ...@@ -73,28 +73,30 @@ export default {
wx.invoke('getContext', {}, async function(res) { wx.invoke('getContext', {}, async function(res) {
if (res.err_msg == 'getContext:ok') { if (res.err_msg == 'getContext:ok') {
entry = res.entry //返回进入H5页面的入口类型,目前 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)) {
// _this.$toast.clear()
that.$toast('入口错误:' + entry)
return
}
try { try {
if (['single_chat_tools', 'group_chat_tools'].includes(entry)) { let invokeApi = 'getCurExternalContact'
// that.$toast.clear() if (entry === 'single_chat_tools') {
if (entry === 'single_chat_tools') { that.sceneType = 1
that.sceneType = 1 } else if (entry === 'group_chat_tools') {
} else if (entry === 'group_chat_tools') { that.sceneType = 2
that.sceneType = 2 invokeApi = 'getCurExternalChat'
}
wx.invoke('getCurExternalContact', {}, (res) => {
if (res.err_msg == 'getCurExternalContact:ok') {
that.form.externalUserid = res.userId //返回当前外部联系人userId
that.form.chatId = res.chatId //返回当前客户群的群聊ID
} else {
//错误处理
that.$dialog({ message: '进入失败:' + JSON.stringify(res) })
}
that.$toast.clear()
})
} else {
that.$toast('入口错误:' + entry)
} }
wx.invoke(invokeApi, {}, (res) => {
if (res.err_msg == invokeApi + ':ok') {
that.form.externalUserid = res.userId //返回当前外部联系人userId
that.form.chatId = res.chatId //返回当前客户群的群聊ID
} else {
//错误处理
that.$dialog({ message: '进入失败:' + JSON.stringify(res) })
}
that.$toast.clear()
})
} catch (err) { } catch (err) {
that.$dialog({ message: 'err' + JSON.stringify(err.message) }) that.$dialog({ message: 'err' + JSON.stringify(err.message) })
} }
...@@ -131,12 +133,13 @@ export default { ...@@ -131,12 +133,13 @@ export default {
}) })
}, },
showDialog(type, row = {}) { showDialog(type, row = {}) {
this.form = { Object.assign(this.form, {
redEnvelopeAmount: row.money, redEnvelopeAmount: row.money,
redenvelopesId: row.id, redenvelopesId: row.id,
externalUserid: this.form.externalUserid, redEnvelopeName: row.name,
} })
this.redPacketType = type this.redPacketType = type
this.$refs.form.resetValidation()
this.visible = true this.visible = true
}, },
// transMoney(value) { // transMoney(value) {
...@@ -183,6 +186,11 @@ export default { ...@@ -183,6 +186,11 @@ export default {
query, query,
hash hash
) )
for (const key in form) {
if (form.hasOwnProperty.call(form, key)) {
!form[key] && delete form[key]
}
}
delete form.code delete form.code
let formQueryString = obj2query(form) let formQueryString = obj2query(form)
let baseUrl = location.protocol + '//' + location.host + process.env.VUE_APP_BASE_URL let baseUrl = location.protocol + '//' + location.host + process.env.VUE_APP_BASE_URL
...@@ -249,7 +257,7 @@ export default { ...@@ -249,7 +257,7 @@ export default {
v-model="visible" v-model="visible"
:description="(redPacketType.includes('personal') ? '个人' : '企业') + '红包'" :description="(redPacketType.includes('personal') ? '个人' : '企业') + '红包'"
> >
<van-form colon @submit="sendRedPacket"> <van-form ref="form" colon @submit="sendRedPacket">
<!-- 企业红包相关字段 --> <!-- 企业红包相关字段 -->
<van-field <van-field
v-if="redPacketType.includes('enterprise')" v-if="redPacketType.includes('enterprise')"
...@@ -262,8 +270,8 @@ export default { ...@@ -262,8 +270,8 @@ export default {
<van-field v-if="sceneType == 2" name="radio" label="红包类型" required> <van-field v-if="sceneType == 2" name="radio" label="红包类型" required>
<template #input> <template #input>
<van-radio-group v-model="form.redEnvelopesType" direction="horizontal"> <van-radio-group v-model="form.redEnvelopesType" direction="horizontal">
<van-radio name="1">拼手气红包</van-radio> <van-radio :name="1">拼手气红包</van-radio>
<van-radio name="2">普通红包</van-radio> <van-radio :name="2">普通红包</van-radio>
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
......
...@@ -60,7 +60,12 @@ export default { ...@@ -60,7 +60,12 @@ export default {
}, },
getRedPacketInfo() { getRedPacketInfo() {
getRedPacketInfo().then(({ data }) => { getRedPacketInfo().then(({ data }) => {
this.redPacket = data let query = param2Obj(window.location.search)
let hash = param2Obj(window.location.hash)
Object.assign(query, hash)
this.redPacket = query
Object.assign(this.redPacket, data)
this.$toast.clear() this.$toast.clear()
}) })
}, },
...@@ -72,15 +77,12 @@ export default { ...@@ -72,15 +77,12 @@ export default {
duration: 0, duration: 0,
forbidClick: true, forbidClick: true,
}) })
let query = param2Obj(window.location.search)
let hash = param2Obj(window.location.hash)
Object.assign(query, hash)
Object.assign(this.redPacket, query)
let form = { let form = {
orderNo: query.orderId, // 订单id orderNo: this.redPacket.orderId, // 订单id
openId: this.openId, // 客户公众号id openId: this.openId, // 客户公众号id
appId: window.CONFIG.appId, // 微信公众号id appId: window.CONFIG.appId, // 微信公众号id
externalUserid: query.externalUserid, // 客户企微id externalUserid: this.redPacket.externalUserid, // 客户企微id
} }
receiveRedPacket(form) receiveRedPacket(form)
.catch(({ data }) => { .catch(({ data }) => {
...@@ -97,13 +99,13 @@ export default { ...@@ -97,13 +99,13 @@ export default {
data.accpestCustomerList.forEach((element) => { data.accpestCustomerList.forEach((element) => {
element.accpectMoney /= 100 element.accpectMoney /= 100
}) })
this.$toast.clear()
this.$refs.audio.play() this.$refs.audio.play()
this.$toast.clear()
this.animate = true this.animate = true
setTimeout(() => { setTimeout(() => {
this.opened = true this.opened = true
Object.assign(this.redPacket, data) Object.assign(this.redPacket, data)
}, 1000) }, 1500)
}) })
}, },
...@@ -268,11 +270,12 @@ export default { ...@@ -268,11 +270,12 @@ export default {
opacity: 0; opacity: 0;
visibility: hidden; visibility: hidden;
top: 109vw; top: 109vw;
transition: all 1s; transition: all 1.5s;
} }
.tarns { .tarns {
visibility: visible; visibility: visible;
transform: translate(-50%, -30vw) scale(3) rotateX(360deg); transform: translate(-50%, -30vw) scale(2) rotateX(360deg);
-webkit-transform: translate(-50%, -30vw) scale(2) rotateX(360deg);
opacity: 0.8; opacity: 0.8;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!