Commit 4c44adb2 authored by xieyishang's avatar xieyishang

11~

parent 98ead2f0
This diff is collapsed.
......@@ -660,9 +660,9 @@ page{
}
.utxstag{
position: absolute;
left: 0;
left: 3upx;
bottom: 0;
width: 66upx;
width: 60upx;
height: 33upx;
line-height: 33upx;
background-color: rgba(0,0,0, 0.3);
......
......@@ -35,7 +35,7 @@ page{
border: 1px solid #f1f1f1;
width: 106upx;
height: 106upx;
border-radius: 50%;
border-radius: 10upx;
}
.chatitem_r{
......@@ -139,4 +139,413 @@ page{
.renlistsbox{
}
\ No newline at end of file
}
.base-avatar-box {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
}
.base-img {
padding: 2px;
box-sizing: border-box;
}
.avatar-box-1 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
border-radius: 10rpx;
}
.avatar-box-1 .img {
padding: 2px;
box-sizing: border-box;
width: 100%;
height: 100%;
}
.avatar-box-2 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
display: flex;
align-items: center;
border-radius: 10rpx;
}
.avatar-box-2 .img {
padding: 2px;
box-sizing: border-box;
width: 50%;
height: 50%;
}
.avatar-box-3 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-3 .img {
padding: 2px;
box-sizing: border-box;
width: 50%;
height: 50%;
}
.avatar-box-3 .img:nth-of-type(1) {
position: absolute;
top: 1px;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-3 .img:nth-last-child(2) {
position: absolute;
bottom: 1px;
left: 1px;
}
.avatar-box-3 .img:nth-last-child(1) {
position: absolute;
bottom: 1px;
right: 1px;
}
.avatar-box-4 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-4 .img {
padding: 2px;
box-sizing: border-box;
width: 50%;
height: 50%;
}
.avatar-box-4 .img:nth-of-type(1) {
position: absolute;
top: 1px;
left: 1px;
}
.avatar-box-4 .img:nth-of-type(2) {
position: absolute;
top: 1px;
right: 1px;
}
.avatar-box-4 .img:nth-last-child(2) {
position: absolute;
bottom: 1px;
left: 1px;
}
.avatar-box-4 .img:nth-last-child(1) {
position: absolute;
bottom: 1px;
right: 1px;
}
.avatar-box-5 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-5 .img {
padding: 2px;
box-sizing: border-box;
width: 33.333333333333336%;
height: 33.333333333333336%;
}
.avatar-box-5 .img:nth-of-type(1) {
position: absolute;
top: 16.666666666666668%;
left: 16.666666666666668%;
}
.avatar-box-5 .img:nth-of-type(2) {
position: absolute;
top: 16.666666666666668%;
right: 16.666666666666668%;
}
.avatar-box-5 .img:nth-last-child(3) {
position: absolute;
bottom: 16.666666666666668%;
left: 1px;
}
.avatar-box-5 .img:nth-last-child(2) {
position: absolute;
bottom: 16.666666666666668%;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-5 .img:nth-last-child(1) {
position: absolute;
bottom: 16.666666666666668%;
right: 1px;
}
.avatar-box-6 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-6 .img {
padding: 2px;
box-sizing: border-box;
width: 33.333333333333336%;
height: 33.333333333333336%;
}
.avatar-box-6 .img:nth-of-type(1) {
position: absolute;
top: 16.666666666666668%;
left: 1px;
}
.avatar-box-6 .img:nth-of-type(2) {
position: absolute;
top: 16.666666666666668%;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-6 .img:nth-of-type(3) {
position: absolute;
top: 16.666666666666668%;
right: 1px;
}
.avatar-box-6 .img:nth-last-child(3) {
position: absolute;
bottom: 16.666666666666668%;
left: 1px;
}
.avatar-box-6 .img:nth-last-child(2) {
position: absolute;
bottom: 16.666666666666668%;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-6 .img:nth-last-child(1) {
position: absolute;
bottom: 16.666666666666668%;
right: 1px;
}
.avatar-box-7 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-7 .img {
padding: 2px;
box-sizing: border-box;
width: 33.333333333333336%;
height: 33.333333333333336%;
}
.avatar-box-7 .img:nth-of-type(1) {
position: absolute;
top: 1px;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-7 .img:nth-last-child(6) {
position: absolute;
top: 33.333333333333336%;
left: 1px;
}
.avatar-box-7 .img:nth-last-child(5) {
position: absolute;
top: 33.333333333333336%;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-7 .img:nth-last-child(4) {
position: absolute;
top: 33.333333333333336%;
right: 1px;
}
.avatar-box-7 .img:nth-last-child(3) {
position: absolute;
bottom: 1px;
left: 1px;
}
.avatar-box-7 .img:nth-last-child(2) {
position: absolute;
bottom: 1px;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-7 .img:nth-last-child(1) {
position: absolute;
bottom: 1px;
right: 1px;
}
.avatar-box-8 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-8 .img {
padding: 2px;
box-sizing: border-box;
width: 33.333333333333336%;
height: 33.333333333333336%;
}
.avatar-box-8 .img:nth-of-type(1) {
position: absolute;
top: 1px;
left: 16.666666666666668%;
}
.avatar-box-8 .img:nth-of-type(2) {
position: absolute;
top: 1px;
right: 16.666666666666668%;
}
.avatar-box-8 .img:nth-last-child(6) {
position: absolute;
top: 33.333333333333336%;
left: 1px;
}
.avatar-box-8 .img:nth-last-child(5) {
position: absolute;
top: 33.333333333333336%;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-8 .img:nth-last-child(4) {
position: absolute;
top: 33.333333333333336%;
right: 1px;
}
.avatar-box-8 .img:nth-last-child(3) {
position: absolute;
bottom: 1px;
left: 1px;
}
.avatar-box-8 .img:nth-last-child(2) {
position: absolute;
bottom: 1px;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-8 .img:nth-last-child(1) {
position: absolute;
bottom: 1px;
right: 1px;
}
.avatar-box-9 {
background-color: #e8e8e8;
width: 106rpx;
height: 106rpx;
position: relative;
border-radius: 10rpx;
}
.avatar-box-9 .img {
padding: 2px;
box-sizing: border-box;
width: 33.333333333333336%;
height: 33.333333333333336%;
}
.avatar-box-9 .img:nth-of-type(1) {
position: absolute;
top: 1px;
left: 1px;
}
.avatar-box-9 .img:nth-of-type(2) {
position: absolute;
top: 1px;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-9 .img:nth-of-type(3) {
position: absolute;
top: 1px;
right: 1px;
}
.avatar-box-9 .img:nth-last-child(6) {
position: absolute;
top: 33.333333333333336%;
left: 1px;
}
.avatar-box-9 .img:nth-last-child(5) {
position: absolute;
top: 33.333333333333336%;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-9 .img:nth-last-child(4) {
position: absolute;
top: 33.333333333333336%;
right: 1px;
}
.avatar-box-9 .img:nth-last-child(3) {
position: absolute;
bottom: 1px;
left: 1px;
}
.avatar-box-9 .img:nth-last-child(2) {
position: absolute;
bottom: 1px;
left: 50%;
transform: translateX(-50%);
}
.avatar-box-9 .img:nth-last-child(1) {
position: absolute;
bottom: 1px;
right: 1px;
}
......@@ -3,12 +3,19 @@
<view class="message">
<!-- 聊天 -->
<view class="liaotiancards">
<view class="emptybox" v-if="conversationList.length==0">
<image class="img" src="/static/base/empty-image-default.png" mode=""></image>
</view>
<view class="chatlist">
<view @tap="tochats(item)" class="chatitem flex" v-for="(item,index) in conversationList" :key="index">
<view @tap="tochats(item)" class="chatitem flex" v-for="(item,index) in conversationListtwo" :key="index">
<view class="usertxbox">
<view class="tagmsgs" v-if="item.unreadCount!=0 && item.unreadCount<99">{{item.unreadCount}}</view>
<view class="tagmsgs" v-else-if="item.unreadCount!=0 && item.unreadCount>=99">99</view>
<image class="usertx" :src="item.avatar|parseurl" mode=""></image>
<view v-if="item.type==2 && item.txlen" :class="'avatar-box-'+item.txlen">
<image class="img" :src="dataa" v-for="(dataa,i) in item.migtxs" :key="i"></image>
</view>
<image v-else class="usertx" :src="item.avatar" mode=""></image>
</view>
<view class="chatitem_r flex1">
<view class="linenamebox flex ali-c jus-b">
......@@ -35,19 +42,7 @@
</view>
</view>
<view class="chatitem flex" @tap="loginfun">
<image class="usertx" src="/static/store/yueicon.png" mode=""></image>
<view class="chatitem_r flex1">
<view class="linenamebox flex ali-c jus-b">
<view class="flex ali-c">
<view class="nikenames">通知</view>
<view class="qiyenames">系统通知</view>
</view>
<view class="istimes">11月2日</view>
</view>
<view class="isliaotcon oneline">恭喜您获得点餐优惠券</view>
</view>
</view>
</view>
</view>
......@@ -61,14 +56,12 @@
//过滤器
filters: {
dateFormat(value) {
console.info("value", value);
return formatMsgTime(value);
}
},
data() {
return {
conversationListtwo:[],
};
},
onLoad() {
......@@ -86,20 +79,41 @@
return this.$store.state.myconversationList;
},
},
watch:{
conversationList(){
this.conversationListtwo = this.conversationList;
}
},
methods: {
loginfun() {
let userInfo = uni.getStorageSync("userInfo");
console.info("userInfo",userInfo);
// || userInfo.user_id=="817163" 9715
if(userInfo.user_id ){
let userids = 'u_'+String(userInfo.user_id)
// this.$store.dispatch("baselogin", "user1"); //登录
this.$store.dispatch("baselogin", userids); //登录
}
let IMUserID = uni.getStorageSync("IMUserID");
this.$store.dispatch("baselogin", IMUserID); //登录
// let IMUserID = 'u_817157';
// this.$store.dispatch("baselogin", IMUserID); //登录
setTimeout(()=>{
if(this.conversationList.length==0){
// #ifdef APP-PLUS
this.getConversationList();
// #endif
}
},4000)
// let userInfo = uni.getStorageSync("userInfo");
// if(userInfo.shop_id ){
// let userids = 'u_'+String(userInfo.shop_id)
// }
},
//获取会话列表 APP
getConversationList() {
this.$store.dispatch("getConversationList", {}); //获取会话列表
this.$store.dispatch("getConversationList", {}).then((res)=>{
console.info("APP获取会话列表成功");
setTimeout(()=>{
this.handchangelist();
},1000)
}); //获取会话列表
},
tochats(item) {
let type = item.type;//1单聊 2群聊
......@@ -108,6 +122,33 @@
uni.navigateTo({
url: `/pages/chat/chat/chat?type=${type}&userId=${userId}&groupId=${groupId}`
})
},
//获取群回话里面的群成员 生成群头像
handchangelist(){
let {conversationList} = this;
for(let i=0;i<conversationList.length;i++){
let item = conversationList[i];
if(item.type==2){//群
this.$store.dispatch("getGroupMemberList", {groupId:item.groupId}).then((res) => {
if(res.code==0){
let ulist = res.members;
let migtxs = [];
for(let j = 0;j<ulist.length;j++){
if(j<10){
migtxs.push(ulist[j].userAvatar);
}
}
conversationList[i].migtxs = migtxs;
conversationList[i].txlen = String(migtxs.length);
this.$set(this.conversationListtwo, i,conversationList[i]);
}
});
}
}
setTimeout(()=>{
console.info("conversationListtwo",this.conversationListtwo);
},6000)
}
}
}
......
......@@ -92,8 +92,11 @@
<script>
import uniIcon from "@/components/uni/uni-icon/uni-icon.vue"
import {userLogin,userUpdatePassword,userSendSms} from "@/utils/api/api.js";
import showxieyi from "@/components/showxieyi/showxieyi.vue"
import {userLogin,userUpdatePassword,userSendSms,importShopAccount} from "@/utils/api/api.js";
import showxieyi from "@/components/showxieyi/showxieyi.vue"
console.info("importShopAccount",importShopAccount);
export default {
components:{
......@@ -241,8 +244,8 @@
password:this.password,
cid : cID.clientid?cID.clientid:''
});
this.$api.msg(res);
// console.info('resaa1',res);
// this.$api.msg(res);
if(res.code==0){
//记住密码
......@@ -261,7 +264,8 @@
uni.setStorageSync('token', tokens);
this.$store.commit('changetoken', tokens);
this.$store.commit('changeuserInfo', res.data.store[0]);
uni.setStorageSync('userInfo', res.data.store[0]);
uni.setStorageSync('userInfo', res.data.store[0]);
this.importShopAccountfun();//去导账号
uni.switchTab({
url:'/pages/index/index'
})
......@@ -270,7 +274,7 @@
//有多个门店 需要切换
uni.setStorageSync('token', tokens);
this.$store.commit('changetoken',tokens);
this.importShopAccountfun();//去导账号
uni.setStorageSync('storelsit', res.data.store);
uni.navigateTo({
url:"/pages/tagglestore/tagglestore?istologin=1"
......@@ -339,8 +343,19 @@
if(e.detail.value.length==0){
this.ischecked = false;
}else{
this.ischecked = true;
this.ischecked = true;
}
},
//导入账号信息
async importShopAccountfun(){
console.info("导入账号66");
let res = await importShopAccount({});
console.info(res,"导入账号");
if(res.code==0){
}
}
}
}
......
......@@ -129,9 +129,9 @@ const Im_store = {
//如果当前对话的人 和 给我发消息的人是一个人 就自动同步一波
if (store.state.dfuserId == result.msg.userId) {
store.dispatch("getC2CHistoryMessageList", {msgId:""}).then((res) => {}); //去刷新聊天界面的消息
store.dispatch("getConversationList", {}); //刷新获取会话列表
store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
} else {
store.dispatch("getConversationList", {}); //刷新获取会话列表
store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
}
if(store.state.groupId==result.msg.groupId){
......@@ -500,8 +500,9 @@ const Im_store = {
//获取群成员列表 start
getGroupMemberList(store, obj){
let groupId = obj.groupId?obj.groupId:store.state.groupId;
return new Promise((reslove, reject) => {
txIm.getGroupMemberList({"groupId":store.state.groupId,"filter":0,"nextSeq":0},result=>{
txIm.getGroupMemberList({"groupId":groupId,"filter":0,"nextSeq":0},result=>{
reslove(result);
})
})
......@@ -511,45 +512,48 @@ const Im_store = {
//获取会话列表
getConversationList(store, obj) {
txIm.getConversationList({
nextSeq: 0,
count: 99999,
}, result => {
let conversationList = result.conversationList; //会话消息列表
let Unread = 0; //未读
conversationList.forEach((item, index) => {
Unread += item.unreadCount;
})
// console.info("未读总", Unread);
// console.info("conversationList",conversationList);
store.commit("setmyconversationList", conversationList); //更新会话列表
// let CornerIndex = 2;
// if (Unread > 0 && Unread <= 99) {
// uni.setTabBarBadge({
// index: CornerIndex,
// text: String(Unread),
// })
// // #ifdef APP-PLUS
// plus.runtime.setBadgeNumber(Unread);
// // #endif
// } else if (Unread > 0 && Unread > 99) {
// uni.setTabBarBadge({
// index: CornerIndex,
// text: "99",
// })
// // #ifdef APP-PLUS
// plus.runtime.setBadgeNumber(99);
// // #endif
// } else {
// uni.removeTabBarBadge({
// index: CornerIndex
// });
// // #ifdef APP-PLUS
// plus.runtime.setBadgeNumber(0);
// // #endif
// }
return new Promise((reslove, reject) => {
txIm.getConversationList({
nextSeq: 0,
count: 99999,
}, result => {
let conversationList = result.conversationList; //会话消息列表
let Unread = 0; //未读
conversationList.forEach((item, index) => {
Unread += item.unreadCount;
})
// console.info("未读总", Unread);
// console.info("conversationList",conversationList);
store.commit("setmyconversationList", conversationList); //更新会话列表
reslove(result);
// let CornerIndex = 2;
// if (Unread > 0 && Unread <= 99) {
// uni.setTabBarBadge({
// index: CornerIndex,
// text: String(Unread),
// })
// // #ifdef APP-PLUS
// plus.runtime.setBadgeNumber(Unread);
// // #endif
// } else if (Unread > 0 && Unread > 99) {
// uni.setTabBarBadge({
// index: CornerIndex,
// text: "99",
// })
// // #ifdef APP-PLUS
// plus.runtime.setBadgeNumber(99);
// // #endif
// } else {
// uni.removeTabBarBadge({
// index: CornerIndex
// });
// // #ifdef APP-PLUS
// plus.runtime.setBadgeNumber(0);
// // #endif
// }
})
})
},
//APP SDK funticon
......@@ -563,7 +567,16 @@ const Im_store = {
//设置tag push is成功
});
// #endif
},
//批量获取指定用户的资料
geIMtUsersInfo(store,obj){
return new Promise((reslove, reject) => {
txIm.getUsersInfo({userIdList:obj.userIdList},result=>{
reslove(result)
})
});
}
}
}
export default Im_store;
\ No newline at end of file
......@@ -580,3 +580,9 @@ export function havepassword(data) {
export function getVoiceToken(data) {
return request.post('store/getVoiceToken', data, { noAuth: false });
}
//导IM 聊天系统账号
export function importShopAccount(data) {
return request.post('User/importShopAccount', data, { noAuth: false });
}
\ No newline at end of file
......@@ -5,8 +5,8 @@ module.exports = {
isdebug:false,//正式
// isdebug:true,//测试
// isdebug:false,//正式
isdebug:true,//测试
// xqdebug:false,//正式权限
xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
......
......@@ -119,6 +119,7 @@ export default function request(api, method, data, {noAuth = false, noVerify = f
header: header,
data: data || {},
success: (res) => {
console.info("res",res);
// uni.hideLoading();
if (noVerify)
reslove(res.data, res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment