Commit eb9fa94c by xinla

--no commit message

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