Commit eb9fa94c by xinla

--no commit message

1 parent 46df7d96
...@@ -4,24 +4,24 @@ import { ...@@ -4,24 +4,24 @@ import {
getCollectionList, getCollectionList,
addCollection, addCollection,
cancleCollection, cancleCollection,
getMaterialMediaId getMaterialMediaId,
} from '@/api/chat' } from '@/api/chat'
export default { export default {
components: {}, components: {},
props: { props: {
sideId: { sideId: {
type: String, type: String,
default: '' default: '',
}, },
// mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报 // mediaType 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报
mediaType: { mediaType: {
type: String, type: String,
default: '0' default: '0',
}, },
keyword: { keyword: {
type: String, type: String,
default: '' default: '',
} },
}, },
data() { data() {
return { return {
...@@ -39,19 +39,19 @@ export default { ...@@ -39,19 +39,19 @@ export default {
'2': '视频', '2': '视频',
'3': '普通文件', '3': '普通文件',
'4': '文本', '4': '文本',
'5': '海报' '5': '海报',
} },
} }
}, },
watch: { watch: {
userId() { userId() {
this.getList(1) this.getList(1)
} },
}, },
computed: { computed: {
userId() { userId() {
return this.$store.state.userId return this.$store.state.userId
} },
}, },
created() { created() {
this.getList() this.getList()
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
mediaType: this.mediaType, mediaType: this.mediaType,
pageSize, pageSize,
pageNum, pageNum,
keyword keyword,
}) })
: getCollectionList({ userId: this.userId, pageSize, pageNum, keyword }) : getCollectionList({ userId: this.userId, pageSize, pageNum, keyword })
) )
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
this.$toast.loading({ this.$toast.loading({
message: '正在发送...', message: '正在发送...',
duration: 0, duration: 0,
forbidClick: true forbidClick: true,
}) })
let entry = undefined let entry = undefined
let _this = this let _this = this
...@@ -139,13 +139,13 @@ export default { ...@@ -139,13 +139,13 @@ export default {
2: 'video', 2: 'video',
3: 'file', 3: 'file',
4: 'text', 4: 'text',
5: 'image' 5: 'image',
} }
switch (data.mediaType) { switch (data.mediaType) {
case '4': case '4':
default: default:
mes.text = { mes.text = {
content: data.content //文本内容 content: data.content, //文本内容
} }
break break
case '0': case '0':
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
let dataMediaId = { let dataMediaId = {
url: data.materialUrl, url: data.materialUrl,
type: msgtype[data.mediaType], type: msgtype[data.mediaType],
name: data.materialName name: data.materialName,
} }
let resMaterialId = await getMaterialMediaId(dataMediaId) let resMaterialId = await getMaterialMediaId(dataMediaId)
if (!resMaterialId.data) { if (!resMaterialId.data) {
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
return return
} }
mes[msgtype[data.mediaType]] = { mes[msgtype[data.mediaType]] = {
mediaid: resMaterialId.data.media_id // mediaid: resMaterialId.data.media_id, //
} }
break break
// case '5': // case '5':
...@@ -190,12 +190,13 @@ export default { ...@@ -190,12 +190,13 @@ export default {
_this.$dialog({ message: 'err' + JSON.stringify(err) }) _this.$dialog({ message: 'err' + JSON.stringify(err) })
} }
wx.invoke('sendChatMessage', mes, function(resSend) { wx.invoke('sendChatMessage', mes, function(resSend) {
if (resSend.err_msg == 'sendChatMessage:ok') { // if (resSend.err_msg == 'sendChatMessage:ok') {
//发送成功 sdk会自动弹出成功提示,无需再加 // //发送成功 sdk会自动弹出成功提示,无需再加
// _this.$toast('发送成功') // // _this.$toast('发送成功')
} else { // } else
if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(resSend.err_msg) < 0) {
//错误处理 //错误处理
// _this.$dialog({ message: '发送失败:' + JSON.stringify(resSend) }) _this.$dialog({ message: '发送失败:' + JSON.stringify(resSend) })
} }
}) })
_this.$toast.clear() _this.$toast.clear()
...@@ -210,12 +211,12 @@ export default { ...@@ -210,12 +211,12 @@ export default {
this.$toast.loading({ this.$toast.loading({
message: 'loading...', message: 'loading...',
duration: 0, duration: 0,
forbidClick: true forbidClick: true,
}) })
// collection 是否收藏 0未收藏 1 已收藏 // collection 是否收藏 0未收藏 1 已收藏
;(data.collection == 1 ? cancleCollection : addCollection)({ ;(data.collection == 1 ? cancleCollection : addCollection)({
userId: this.userId, userId: this.userId,
materialId: data.materialId materialId: data.materialId,
}) })
.then(() => { .then(() => {
data.collection = [1, 0][data.collection] data.collection = [1, 0][data.collection]
...@@ -226,8 +227,8 @@ export default { ...@@ -226,8 +227,8 @@ export default {
this.$toast('操作失败') this.$toast('操作失败')
console.log(err) console.log(err)
}) })
} },
} },
} }
</script> </script>
......
...@@ -77,19 +77,19 @@ export default { ...@@ -77,19 +77,19 @@ export default {
props: { props: {
task: { task: {
type: Object, type: Object,
required: true required: true,
}, },
// true: 已处理 false: 未处理 // true: 已处理 false: 未处理
state: { state: {
type: Boolean, type: Boolean,
required: true required: true,
}, },
isAdmin: { isAdmin: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
data() { data() {
...@@ -110,8 +110,8 @@ export default { ...@@ -110,8 +110,8 @@ export default {
query: { query: {
taskId: this.task.ruleId, taskId: this.task.ruleId,
active: active === 1 ? 1 : 0, active: active === 1 ? 1 : 0,
taskType: 2 taskType: 2,
} },
}) })
}, },
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
this.$toast.loading({ this.$toast.loading({
message: '正在发送...', message: '正在发送...',
duration: 0, duration: 0,
forbidClick: true forbidClick: true,
}) })
// mes.link || delete mes.link // mes.link || delete mes.link
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
(this.task.materialList && (this.task.materialList &&
this.task.materialList[0] && this.task.materialList[0] &&
this.task.materialList[0].materialUrl) || this.task.materialList[0].materialUrl) ||
' ' // 封面 ' ', // 封面
}, },
async function(res) { async function(res) {
if (res.err_msg == 'shareToExternalChat:ok') { if (res.err_msg == 'shareToExternalChat:ok') {
...@@ -158,13 +158,9 @@ export default { ...@@ -158,13 +158,9 @@ export default {
// this.$emit('refresh') // this.$emit('refresh')
// }) // })
_this.$toast.clear() _this.$toast.clear()
this.$emit('refresh') _this.$emit('refresh')
} else { } else if ('shareToExternalChat:cancel'.indexOf(res.err_msg) < 0) {
if (res.err_code == 1) { _this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
// 用户取消发送
} else {
_this.$dialog({ message: 'shareToExternalChat失败:' + JSON.stringify(res) })
}
} }
_this.$toast.clear() _this.$toast.clear()
} }
...@@ -172,7 +168,7 @@ export default { ...@@ -172,7 +168,7 @@ export default {
} catch (error) { } catch (error) {
this.$dialog({ message: '代码错误:' + JSON.stringify(error.message) }) this.$dialog({ message: '代码错误:' + JSON.stringify(error.message) })
} }
} },
// touchStart() { // touchStart() {
// clearTimeout(this.copyEvent) // clearTimeout(this.copyEvent)
...@@ -236,7 +232,7 @@ export default { ...@@ -236,7 +232,7 @@ export default {
if (this.doneMembers.length <= 2) return names.join('、') if (this.doneMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人' return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人'
} },
}, },
mounted() { mounted() {
...@@ -249,7 +245,7 @@ export default { ...@@ -249,7 +245,7 @@ export default {
this.clipboard.on('error', (e) => { this.clipboard.on('error', (e) => {
this.showCopy = false this.showCopy = false
}) })
} },
} }
</script> </script>
......
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
}, },
function(res) { function(res) {
if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(res.err_msg) < 0) { if ('sendChatMessage:cancel,sendChatMessage:ok'.indexOf(res.err_msg) < 0) {
_this.$dialog({ message: 'sendChatMessage失败:' + JSON.stringify(res) }) _this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
} }
_this.$toast.clear() _this.$toast.clear()
} }
......
...@@ -53,19 +53,19 @@ export default { ...@@ -53,19 +53,19 @@ export default {
props: { props: {
task: { task: {
type: Object, type: Object,
required: true required: true,
}, },
// true: 已处理 false: 未处理 // true: 已处理 false: 未处理
state: { state: {
type: Boolean, type: Boolean,
required: true required: true,
}, },
isAdmin: { isAdmin: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
data() { data() {
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
showCopy: false, // 展示复制按钮 showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常 touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null, copyEvent: null,
touch: false touch: false,
} }
}, },
...@@ -86,8 +86,8 @@ export default { ...@@ -86,8 +86,8 @@ export default {
query: { query: {
taskId: this.task.taskId, taskId: this.task.taskId,
active: active === 1 ? 1 : 0, active: active === 1 ? 1 : 0,
taskType: 1 taskType: 1,
} },
}) })
}, },
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
title: this.task.taskName, title: this.task.taskName,
desc: this.task.welcomeMsg, desc: this.task.welcomeMsg,
link: this.groupCodeUrl, link: this.groupCodeUrl,
imgUrl: this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl imgUrl: this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl,
}, },
function(res) { function(res) {
if (res.err_msg == 'shareToExternalContact:ok') { if (res.err_msg == 'shareToExternalContact:ok') {
...@@ -111,7 +111,8 @@ export default { ...@@ -111,7 +111,8 @@ export default {
.catch(() => { .catch(() => {
this.$emit('refresh') this.$emit('refresh')
}) })
} else { } else if ('shareToExternalContact:cancel'.indexOf(res.err_msg) < 0) {
_this.$dialog({ message: '发送失败:' + JSON.stringify(res) })
} }
} }
) )
...@@ -129,7 +130,7 @@ export default { ...@@ -129,7 +130,7 @@ export default {
clearTimeout(this.copyEvent) clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true if (this.touch) this.showCopy = true
this.touch = false this.touch = false
} },
}, },
computed: { computed: {
...@@ -202,7 +203,7 @@ export default { ...@@ -202,7 +203,7 @@ export default {
'groupCode?id=' + 'groupCode?id=' +
(groupCodeInfo && groupCodeInfo.id) (groupCodeInfo && groupCodeInfo.id)
) )
} },
}, },
mounted() { mounted() {
...@@ -215,7 +216,7 @@ export default { ...@@ -215,7 +216,7 @@ export default {
this.clipboard.on('error', (e) => { this.clipboard.on('error', (e) => {
this.showCopy = false this.showCopy = false
}) })
} },
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!