处理商品发送显示空的问题

feature/1.0.1-im-ch
ch 3 years ago
parent ae7a2e8400
commit f5a52891a9

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-18 14:54:47 * @Date: 2022-05-18 14:54:47
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-21 15:27:05 * @LastEditTime: 2022-05-21 16:11:44
* @Description: file content * @Description: file content
*/ */
import { CreateUUID, FormatDate, ToAsyncAwait } from "@/common/utils"; import { CreateUUID, FormatDate, ToAsyncAwait } from "@/common/utils";

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-20 11:00:07 * @Date: 2022-05-20 11:00:07
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-21 15:44:06 * @LastEditTime: 2022-05-21 15:59:39
* @Description: file content * @Description: file content
*/ */

@ -3,7 +3,7 @@
components: { UiCell },: ch components: { UiCell },: ch
* @Date: 2019-08-22 19:41:20 * @Date: 2019-08-22 19:41:20
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-17 18:00:28 * @LastEditTime: 2022-05-21 16:00:44
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -95,7 +95,8 @@ export default {
this.statistic = result; this.statistic = result;
}, },
service(){ service(){
uni.$u.toast('客服休息中'); // uni.$u.toast('');
this.$Router.push('/messageChat');
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-11 11:45:08 * @Date: 2022-05-11 11:45:08
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-21 11:38:36 * @LastEditTime: 2022-05-21 16:11:51
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -45,7 +45,7 @@
</view> </view>
</template> </template>
<script> <script>
import {Im} from '@/common/utils'; import {Im, ToAsyncAwait} from '@/common/utils';
import {MSG_TYPE} from '@/common/dicts/im'; import {MSG_TYPE} from '@/common/dicts/im';
import {Request} from '@/common/utils'; import {Request} from '@/common/utils';
import {ApiPutUser} from '@/common/api/account'; import {ApiPutUser} from '@/common/api/account';
@ -64,6 +64,10 @@ export default {
goodsInfo : { goodsInfo : {
type : Object, type : Object,
default : () => ({}) default : () => ({})
},
sessionId : {
type : Number | String,
default : ''
} }
}, },
data(){ data(){
@ -130,15 +134,19 @@ export default {
break; break;
} }
let res = await Im.sendMsg({ const {error, result} = await ToAsyncAwait(Im.sendMsg({
fromId : this.$store.state.userInfo.id, fromId : this.$store.state.userInfo.id,
content: { content: {
toSessionId : this.$Route.query.sessionId, toSessionId : this.sessionId,
payload : payload, payload : payload,
toId : 1, toId : 1,
type : type type : type
} }
}) }));
if(error){
uni.$u.toast(error.message);
return false
}
this.msgCtx = ''; this.msgCtx = '';
this.focus = false; this.focus = false;
this.$nextTick(() => { this.$nextTick(() => {

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-26 14:32:03 * @Date: 2022-03-26 14:32:03
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-21 15:43:32 * @LastEditTime: 2022-05-21 16:08:32
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -42,7 +42,7 @@
</view> </view>
</view> </view>
</template> </template>
<Footer :goodsInfo="goodsInfo" :orderInfo="orderInfo"></Footer> <Footer :goodsInfo="goodsInfo" :orderInfo="orderInfo" :sessionId="sessionId"></Footer>
</view> </view>
</template> </template>
<script> <script>
@ -68,10 +68,7 @@ export default {
}, },
computed:{ computed:{
curSessionData(){ curSessionData(){
const data = this.$store.state.imData.find(i =>{ const data = this.$store.state.imData.find(i => i.id == this.sessionId) || {};
return i.id == this.sessionId
}) || {};
if(data.id){ if(data.id){
Im.setCurSessionId(data.id); Im.setCurSessionId(data.id);
} }
@ -138,8 +135,9 @@ export default {
storeId : 1 storeId : 1
} }
})); }));
if(error){ if(error){
uni.$u.toast(error); uni.$u.toast(error.message);
return false; return false;
} }
this.sessionId = result.content.id this.sessionId = result.content.id

Loading…
Cancel
Save