fix: 🐛 修改因为Im导致微信小程序编译不通过问题 更改看到的变量名问题 im后续会进行优化
parent
d2ff0b1ea1
commit
b1bde2f105
|
@ -12,8 +12,8 @@ export default {
|
|||
logo: "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/4c864e133c2944efad1f7282ac8a3b9e.png", //logo地址
|
||||
customerServiceMobile: "13161366885", //客服电话
|
||||
customerServiceEmail: "lili@lili.com", //客服邮箱
|
||||
imWebSrc: "http://192.168.0.113:8001/", //IM地址
|
||||
BASE_WS_URL: "ws://192.168.0.113:8885/lili/webSocket",
|
||||
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||
baseWsUrl: "wss://im-api.pickmall.cn/lili/webSocket", // IM WS 地址
|
||||
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||
/**
|
||||
|
|
12
pages.json
12
pages.json
|
@ -274,17 +274,19 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "im/index",
|
||||
"path": "im/list",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
},
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationStyle": "custom" // 隐藏系统导航栏
|
||||
"app-plus": {
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "im/list",
|
||||
"path": "im/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom", // 隐藏系统导航栏
|
||||
"enablePullDownRefresh": true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="wrapper">
|
||||
<u-navbar class="my-title" title-size="32" back-text="" :title="toUser.name"></u-navbar>
|
||||
<u-navbar class="my-title" title-size="32" :title="toUser.name"></u-navbar>
|
||||
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
||||
<view :animation="anData" style="height:0;">
|
||||
</view>
|
||||
|
@ -8,21 +8,20 @@
|
|||
<!-- 用来获取消息体高度 -->
|
||||
<view id="msgList">
|
||||
<!-- 消息 -->
|
||||
<view class="flex-column-start" v-for="(item, index) in msgList" :key="index">
|
||||
<view class="flex-column-start" v-if="msgList.length" v-for="(item, index) in msgList" :key="index">
|
||||
<view class="flex-row-start column-time">
|
||||
<view v-show="compareTime(index, item.createTime)" class="flex-row-start date-text"
|
||||
v-text="beautifyTime(item.createTime)">
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 用户消息 头像可选加入-->
|
||||
<view v-if="item.my" class="flex justify-end padding-right one-show align-start padding-top">
|
||||
<!-- <image class="chat-img flex-row-center" :src="'https://ikeeppet.oss-cn-zhangjiakou.aliyuncs.com/028b7818b78c47ef8f87a7faa1098faf.jpg'" mode="aspectFill" ></image> -->
|
||||
<view class="flex justify-end" style="width: 400rpx;margin-top: 12px;">
|
||||
<view>
|
||||
<view class="user-name">{{ user.nickName }}</view>
|
||||
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
||||
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
||||
<view v-if="item.messageType == 'GOODS'">
|
||||
<!-- <view v-if="item.messageType == 'GOODS'">
|
||||
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||
<view class="imagebox" @click="jumpGoodDelic">
|
||||
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||
|
@ -40,8 +39,8 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.messageType === 'ORDER'">
|
||||
</view> -->
|
||||
<!-- <view v-if="item.messageType === 'ORDER'">
|
||||
<view class="orderSn">
|
||||
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||
<view class="oederList">
|
||||
|
@ -54,7 +53,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -80,7 +79,7 @@
|
|||
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
||||
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
||||
<view v-if="item.messageType === 'GOODS'">
|
||||
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||
<!-- <view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||
<view class="imagebox" @click="jumpGoodDelic">
|
||||
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||
</view>
|
||||
|
@ -96,9 +95,9 @@
|
|||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view v-if="item.messageType === 'ORDER'">
|
||||
<!-- <view v-if="item.messageType === 'ORDER'">
|
||||
<view class="orderSn">
|
||||
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||
<view class="oederList">
|
||||
|
@ -111,7 +110,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -124,20 +123,20 @@
|
|||
<view class="cartMessage" v-if="showHide && !localImGoodsId && showHideModel">
|
||||
<view class="goodsCard u-flex u-row-between u-p-b-0">
|
||||
<view class="imagebox" @click="jumpGoodDelic">
|
||||
<image class="image" :src="goodLiistData.thumbnail" mode="widthFix"></image>
|
||||
<image class="image" :src="goodListData.thumbnail" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
||||
<view class="goodsdesc-name">
|
||||
<text class="goodsCard_goodNmae">{{
|
||||
goodLiistData.goodsName
|
||||
goodListData.goodsName
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text style="font-size:20rpx;">¥{{
|
||||
goodLiistData.price
|
||||
goodListData.price
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancel" @click="cancenModel">X</view>
|
||||
<view class="cancel" @click="cancelModel">X</view>
|
||||
<view class="sendGood" @click="sendGoodsMessage">
|
||||
<view>发送商品</view>
|
||||
</view>
|
||||
|
@ -209,9 +208,9 @@ export default {
|
|||
this.showHideModel = options.goodsid
|
||||
// 发送后刷新页面不显示 发送商品弹窗 local里面imGoodId不为空显示
|
||||
this.localImGoodsId = storage.getImGoodsLink()
|
||||
this.rosolve = options
|
||||
this.resolve = options
|
||||
// 请求商品信息
|
||||
if (this.rosolve.goodsid) {
|
||||
if (this.resolve.goodsid) {
|
||||
this.commodityDetails()
|
||||
}
|
||||
// 如果需要缓存消息缓存msgList即可
|
||||
|
@ -238,7 +237,7 @@ export default {
|
|||
|
||||
l = query.screenWidth / 750
|
||||
wh = query.windowHeight
|
||||
this.srcollHeight = (query.windowHeight - 44) + "px"
|
||||
this.scrollHeight = (query.windowHeight - 44) + "px"
|
||||
this.user = storage.getUserInfo()
|
||||
this.toUser = storage.getTalkToUser()
|
||||
|
||||
|
@ -259,11 +258,10 @@ export default {
|
|||
uni.stopPullDownRefresh();
|
||||
}, 1000);
|
||||
},
|
||||
components: {
|
||||
beautifyTime
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
storage,
|
||||
fixed: 'fixed',
|
||||
bottom: '50px',
|
||||
width: '100%',
|
||||
|
@ -286,10 +284,10 @@ export default {
|
|||
newMessageNum: 0,
|
||||
user: {},
|
||||
toUser: {},
|
||||
srcollHeight: 0,
|
||||
scrollHeight: 0,
|
||||
ws: new SocketService(),
|
||||
rosolve: {},
|
||||
goodLiistData: {}
|
||||
resolve: {},
|
||||
goodListData: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -308,6 +306,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
beautifyTime,
|
||||
//订单详情
|
||||
linkTosOrders (val) {
|
||||
console.log(val);
|
||||
|
@ -319,7 +318,7 @@ export default {
|
|||
// 跳转商品详情页
|
||||
jumpGoodDelic () {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/goods?id=${this.rosolve.skuid}&goodsId=${this.rosolve.goodsid}`,
|
||||
url: `/pages/product/goods?id=${this.resolve.skuid}&goodsId=${this.resolve.goodsid}`,
|
||||
});
|
||||
},
|
||||
//发送商品
|
||||
|
@ -329,11 +328,11 @@ export default {
|
|||
to: this.toUser.userId,
|
||||
from: this.user.id,
|
||||
message_type: "GOODS",
|
||||
context: this.goodLiistData,
|
||||
context: this.goodListData,
|
||||
talk_id: this.params.talkId,
|
||||
}
|
||||
this.ws.send(JSON.stringify(msg))
|
||||
this.msgList.push({ "text": JSON.stringify(this.goodLiistData), "my": true, "messageType": 'GOODS' })
|
||||
this.msgList.push({ "text": JSON.stringify(this.goodListData), "my": true, "messageType": 'GOODS' })
|
||||
this.showHide = false
|
||||
storage.setImGoodsLink(this.params.talkId)
|
||||
//成功发送商品连接后,滚动到底部
|
||||
|
@ -346,16 +345,16 @@ export default {
|
|||
})
|
||||
},
|
||||
//取消发送
|
||||
cancenModel () {
|
||||
cancelModel () {
|
||||
this.showHide = false
|
||||
},
|
||||
// 请求商品详情
|
||||
commodityDetails () {
|
||||
jumpObtain(this.rosolve.skuid, this.rosolve.goodsid).then((res) => {
|
||||
this.goodLiistData = res.data.result.data
|
||||
jumpObtain(this.resolve.skuid, this.resolve.goodsid).then((res) => {
|
||||
this.goodListData = res.data.result.data
|
||||
})
|
||||
},
|
||||
beautifyTime,
|
||||
|
||||
// 切换输入法时移动输入框(按照官方的上推页面的原理应该会自动适应不同的键盘高度-->官方bug)
|
||||
goPag (kh) {
|
||||
this.retractBox(0, 250)
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<u-navbar class="my-title" title-size="32" back-text="" :title="'消息(' + talkList.length + ')'"></u-navbar>
|
||||
<u-navbar class="my-title" title-size="32" :title="'消息(' + talkList.length + ')'"></u-navbar>
|
||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
|
||||
<!-- 空白页 -->
|
||||
<u-empty text="暂无信息" mode="list" v-if="talkList.length === 0"></u-empty>
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<div class="iconBox">
|
||||
<view class="icon-list">
|
||||
|
@ -52,6 +51,8 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空白页 -->
|
||||
<u-empty text="暂无信息" mode="list" v-if="talkList.length === 0"></u-empty>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -63,6 +64,7 @@ import { beautifyTime } from "@/utils/filters.js"
|
|||
export default {
|
||||
data () {
|
||||
return {
|
||||
storage,
|
||||
count: {
|
||||
loadStatus: "more",
|
||||
},
|
||||
|
@ -71,9 +73,7 @@ export default {
|
|||
pointData: {}, //累计获取 未输入 集合
|
||||
};
|
||||
},
|
||||
components: {
|
||||
beautifyTime
|
||||
},
|
||||
|
||||
onShow () {
|
||||
this.userTalkList();
|
||||
},
|
||||
|
|
|
@ -601,10 +601,10 @@ export default {
|
|||
|
||||
linkMsgDetail () {
|
||||
// lili 基础客服
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
|
||||
});
|
||||
this.$options.filters.talkIm(this.storeDetail.storeId)
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
|
||||
// });
|
||||
|
||||
// udesk 代码
|
||||
// if (this.storeDetail.merchantEuid) {
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
<image src="/static/mine/feedback.png" mode=""></image>
|
||||
<view>我的评价</view>
|
||||
</view>
|
||||
<view class="interact-item" @click="linkMsgDetail()">
|
||||
<!-- <view class="interact-item" @click="linkMsgDetail()">
|
||||
<image src="/static/mine/mycommit.png" mode=""></image>
|
||||
<view>我的消息</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
|
||||
|
|
|
@ -34,7 +34,7 @@ export default class SocketService {
|
|||
if (!window.WebSocket) {
|
||||
return console.log("您的浏览器不支持WebSocket");
|
||||
}
|
||||
this.ws = new WebSocket(config.BASE_WS_URL+'/'+storage.getAccessToken());
|
||||
this.ws = new WebSocket(config.baseWsUrl+'/'+storage.getAccessToken());
|
||||
// 连接成功的事件
|
||||
this.ws.onopen = () => {
|
||||
console.log("连接服务端成功");
|
||||
|
|
Loading…
Reference in New Issue