4
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<view class="n-ps-all-base">
|
||||
<uv-parse v-if="content" :content="content"></uv-parse>
|
||||
<view class="n-flex-row" v-if="showButton" :style="{marginTop:'100rpx'}">
|
||||
<uv-button class="n-flex-1 n-ms-base" v-for="(item, idx) in buttonList" :key="idx" @click="switchButton(idx, item)" :text="item.title" :icon="'/static/image/' + item.value + '.png'" :plain="current==idx" :color="current==idx ? item.color:'#f8f8f8'" :customStyle="{height:'80rpx'}" :customTextStyle="{color:current==idx ? item.color:'#333333',marginLeft:'20rpx'}" shape="circle" color="#f8f8f8" throttleTime="1000"></uv-button>
|
||||
</view>
|
||||
<uv-empty :show="empty" icon="/static/image/empty.png" text="暂无数据~" width="200" marginTop="100"></uv-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getArticle} from '@/api/login.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
empty: false,
|
||||
content: '',
|
||||
current: null,
|
||||
questionId: 0,
|
||||
showButton: false,
|
||||
buttonList: [
|
||||
{title:'未解决', value:'unresolved', color:'#fc3463'},
|
||||
{title:'已解决', value:'resolved', color:'#5ac725'}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad(evt) {
|
||||
if(evt.type=='config') this.setConfig(evt)
|
||||
if(evt.type=='question') this.setQuestion(evt)
|
||||
|
||||
uni.setNavigationBarTitle({title:evt.title})
|
||||
},
|
||||
methods: {
|
||||
// 设置配置内容
|
||||
setConfig(evt) {
|
||||
let config = getApp().globalData.config
|
||||
if(evt.name && config[evt.name]){
|
||||
this.content = config[evt.name]
|
||||
}else{
|
||||
this.empty = true
|
||||
}
|
||||
},
|
||||
// 设置问题内容
|
||||
setQuestion(evt) {
|
||||
this.content = evt.content
|
||||
this.questionId = evt.id
|
||||
this.showButton = true
|
||||
},
|
||||
// 切换按钮
|
||||
switchButton(idx, item) {
|
||||
this.current = idx
|
||||
getArticle({id:this.questionId,type:item.value})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,281 +1,267 @@
|
||||
<template>
|
||||
<view class="contact_choose_container">
|
||||
<custom-nav-bar title="联系人" />
|
||||
<view class="contact_choose_container">
|
||||
<custom-nav-bar title="联系人" />
|
||||
|
||||
<view class="search_bar_wrap">
|
||||
<u-search
|
||||
shape="square"
|
||||
placeholder="搜索"
|
||||
:showAction="false"
|
||||
v-model="keyword"
|
||||
/>
|
||||
</view>
|
||||
<view class="search_bar_wrap">
|
||||
<u-search shape="square" placeholder="搜索" :showAction="false" v-model="keyword" />
|
||||
</view>
|
||||
|
||||
<view class="tab_container">
|
||||
<template v-if="activeTab === 0">
|
||||
<setting-item
|
||||
@click="tabChange(tabs[0].idx)"
|
||||
:title="tabs[0].title"
|
||||
:border="false"
|
||||
/>
|
||||
<view class="tab_container">
|
||||
<template v-if="activeTab === 0">
|
||||
<setting-item @click="tabChange(tabs[0].idx)" :title="tabs[0].title" :border="false" />
|
||||
|
||||
<view class="tab_pane"></view>
|
||||
</template>
|
||||
<view class="tab_pane"></view>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<view class="tab_pane" v-show="activeTab === 1">
|
||||
<choose-index-list
|
||||
@updateCheck="updateCheckedUser"
|
||||
:indexList="getChooseData.indexList"
|
||||
:itemArr="getChooseData.dataList"
|
||||
:checkedIDList="checkedUserIDList"
|
||||
:disabledIDList="disabledUserIDList"
|
||||
:showCheck="true"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<choose-index-footer
|
||||
:comfirmLoading="comfirmLoading"
|
||||
@removeItem="updateCheckedUserOrGroup"
|
||||
@confirm="confirm"
|
||||
:choosedData="getCheckedInfo"
|
||||
/>
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="tab_pane" v-show="activeTab === 1">
|
||||
<choose-index-list @updateCheck="updateCheckedUser" :indexList="getChooseData.indexList"
|
||||
:itemArr="getChooseData.dataList" :checkedIDList="checkedUserIDList"
|
||||
:disabledIDList="disabledUserIDList" :showCheck="true" />
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<choose-index-footer :comfirmLoading="comfirmLoading" @removeItem="updateCheckedUserOrGroup" @confirm="confirm"
|
||||
:choosedData="getCheckedInfo" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { ContactChooseTypes } from "@/constant";
|
||||
import { formatChooseData, toastWithCallback } from "@/util/common";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import UserItem from "@/components/UserItem/index.vue";
|
||||
import ChooseIndexList from "@/components/ChooseIndexList/index.vue";
|
||||
import ChooseIndexFooter from "@/components/ChooseIndexFooter/index.vue";
|
||||
import SettingItem from "@/components/SettingItem/index.vue";
|
||||
import {mapGetters} from "vuex";
|
||||
import {ContactChooseTypes} from "@/constant";
|
||||
import {formatChooseData,toastWithCallback} from "@/util/common";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import UserItem from "@/components/UserItem/index.vue";
|
||||
import ChooseIndexList from "@/components/ChooseIndexList/index.vue";
|
||||
import ChooseIndexFooter from "@/components/ChooseIndexFooter/index.vue";
|
||||
import SettingItem from "@/components/SettingItem/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
UserItem,
|
||||
ChooseIndexList,
|
||||
ChooseIndexFooter,
|
||||
SettingItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
type: ContactChooseTypes.Card,
|
||||
activeTab: 0,
|
||||
groupID: "",
|
||||
checkedUserIDList: [],
|
||||
disabledUserIDList: [],
|
||||
comfirmLoading: false,
|
||||
tabs: [
|
||||
{
|
||||
idx: 1,
|
||||
title: "我的好友",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"storeFriendList",
|
||||
"storeCurrentConversation",
|
||||
"storeCurrentUserID",
|
||||
"storeConversationList",
|
||||
]),
|
||||
getChooseData() {
|
||||
if (this.keyword) {
|
||||
return {
|
||||
indexList: ["#"],
|
||||
dataList: [
|
||||
this.storeFriendList.filter(
|
||||
(friend) =>
|
||||
friend.nickname.includes(this.keyword) ||
|
||||
friend.remark.includes(this.keyword)
|
||||
),
|
||||
],
|
||||
};
|
||||
}
|
||||
return formatChooseData(this.storeFriendList);
|
||||
},
|
||||
getCheckedInfo() {
|
||||
const tmpUserIDList = [...this.checkedUserIDList];
|
||||
const checkedFriends = this.storeFriendList.filter((friend) => {
|
||||
const idx = tmpUserIDList.findIndex(
|
||||
(userID) => userID === friend.userID
|
||||
);
|
||||
if (idx > -1) {
|
||||
tmpUserIDList.splice(idx, 1);
|
||||
}
|
||||
return idx > -1;
|
||||
});
|
||||
return [...checkedFriends];
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const {
|
||||
groupID,
|
||||
type,
|
||||
checkedUserIDList,
|
||||
} = options;
|
||||
this.type = type;
|
||||
this.groupID = groupID;
|
||||
this.checkedUserIDList = checkedUserIDList
|
||||
? JSON.parse(checkedUserIDList)
|
||||
: [];
|
||||
if (this.type === ContactChooseTypes.Invite) {
|
||||
this.checkDisabledUser();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkDisabledUser() {
|
||||
const friendIDList = this.storeFriendList.map((friend) => friend.userID);
|
||||
IMSDK.asyncApi("getUsersInGroup", IMSDK.uuid(), {
|
||||
groupID: this.groupID,
|
||||
userIDList: friendIDList,
|
||||
}).then(({ data }) => {
|
||||
this.disabledUserIDList = data;
|
||||
});
|
||||
},
|
||||
tabChange(idx) {
|
||||
this.keyword = "";
|
||||
this.activeTab = idx;
|
||||
},
|
||||
updateCheckedUserOrGroup(item) {
|
||||
if (item.userID) {
|
||||
this.updateCheckedUser(item);
|
||||
}
|
||||
},
|
||||
updateCheckedUser({ userID }) {
|
||||
if (this.checkedUserIDList.includes(userID)) {
|
||||
const idx = this.checkedUserIDList.findIndex((item) => item === userID);
|
||||
const tmpArr = [...this.checkedUserIDList];
|
||||
tmpArr.splice(idx, 1);
|
||||
this.checkedUserIDList = [...tmpArr];
|
||||
} else {
|
||||
this.checkedUserIDList = [...this.checkedUserIDList, userID];
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (this.activeTab) {
|
||||
this.activeTab = 0;
|
||||
return;
|
||||
}
|
||||
this.comfirmLoading = true;
|
||||
if (this.type === ContactChooseTypes.GetList) {
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = pages[pages.length - 2];
|
||||
prevPage.$vm.getCheckedUsers(this.getCheckedInfo);
|
||||
this.comfirmLoading = false;
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
UserItem,
|
||||
ChooseIndexList,
|
||||
ChooseIndexFooter,
|
||||
SettingItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
type: ContactChooseTypes.Card,
|
||||
activeTab: 0,
|
||||
groupID: "",
|
||||
checkedUserIDList: [],
|
||||
disabledUserIDList: [],
|
||||
comfirmLoading: false,
|
||||
tabs: [
|
||||
{
|
||||
idx: 1,
|
||||
title: "我的好友",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"storeFriendList",
|
||||
"storeCurrentConversation",
|
||||
"storeCurrentUserID",
|
||||
"storeConversationList",
|
||||
]),
|
||||
getChooseData() {
|
||||
if (this.keyword) {
|
||||
return {
|
||||
indexList: ["#"],
|
||||
dataList: [
|
||||
this.storeFriendList.filter(
|
||||
(friend) =>
|
||||
friend.nickname.includes(this.keyword) ||
|
||||
friend.remark.includes(this.keyword)
|
||||
),
|
||||
],
|
||||
};
|
||||
}
|
||||
return formatChooseData(this.storeFriendList);
|
||||
},
|
||||
getCheckedInfo() {
|
||||
const tmpUserIDList = [...this.checkedUserIDList];
|
||||
const checkedFriends = this.storeFriendList.filter((friend) => {
|
||||
const idx = tmpUserIDList.findIndex(
|
||||
(userID) => userID === friend.userID
|
||||
);
|
||||
if (idx > -1) {
|
||||
tmpUserIDList.splice(idx, 1);
|
||||
}
|
||||
return idx > -1;
|
||||
});
|
||||
return [...checkedFriends];
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const {groupID,type,checkedUserIDList,} = options;
|
||||
console.log(this.storeFriendList);
|
||||
this.type = type;
|
||||
this.groupID = groupID;
|
||||
this.checkedUserIDList = checkedUserIDList ?
|
||||
JSON.parse(checkedUserIDList) :
|
||||
[];
|
||||
if (this.type === ContactChooseTypes.Invite) {
|
||||
this.checkDisabledUser();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkDisabledUser() {
|
||||
const friendIDList = this.storeFriendList.map((friend) => friend.userID);
|
||||
IMSDK.asyncApi("getUsersInGroup", IMSDK.uuid(), {
|
||||
groupID: this.groupID,
|
||||
userIDList: friendIDList,
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
this.disabledUserIDList = data;
|
||||
});
|
||||
},
|
||||
tabChange(idx) {
|
||||
this.keyword = "";
|
||||
this.activeTab = idx;
|
||||
},
|
||||
updateCheckedUserOrGroup(item) {
|
||||
if (item.userID) {
|
||||
this.updateCheckedUser(item);
|
||||
}
|
||||
},
|
||||
updateCheckedUser({
|
||||
userID
|
||||
}) {
|
||||
if (this.checkedUserIDList.includes(userID)) {
|
||||
const idx = this.checkedUserIDList.findIndex((item) => item === userID);
|
||||
const tmpArr = [...this.checkedUserIDList];
|
||||
tmpArr.splice(idx, 1);
|
||||
this.checkedUserIDList = [...tmpArr];
|
||||
} else {
|
||||
this.checkedUserIDList = [...this.checkedUserIDList, userID];
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (this.activeTab) {
|
||||
this.activeTab = 0;
|
||||
return;
|
||||
}
|
||||
this.comfirmLoading = true;
|
||||
if (this.type === ContactChooseTypes.GetList) {
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = pages[pages.length - 2];
|
||||
prevPage.$vm.getCheckedUsers(this.getCheckedInfo);
|
||||
this.comfirmLoading = false;
|
||||
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.type === ContactChooseTypes.Invite) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.InviteUserToGroup, IMSDK.uuid(), {
|
||||
groupID: this.groupID,
|
||||
reason: "",
|
||||
userIDList: this.getCheckedInfo.map((user) => user.userID),
|
||||
})
|
||||
.then(() => {
|
||||
toastWithCallback("操作成功", () => uni.navigateBack());
|
||||
this.comfirmLoading = false;
|
||||
})
|
||||
.catch(() => toastWithCallback("操作失败"));
|
||||
return;
|
||||
}
|
||||
if (this.type === ContactChooseTypes.Invite) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.InviteUserToGroup, IMSDK.uuid(), {
|
||||
groupID: this.groupID,
|
||||
reason: "",
|
||||
userIDList: this.getCheckedInfo.map((user) => user.userID),
|
||||
})
|
||||
.then(() => {
|
||||
toastWithCallback("操作成功", () => uni.navigateBack());
|
||||
this.comfirmLoading = false;
|
||||
})
|
||||
.catch(() => toastWithCallback("操作失败"));
|
||||
return;
|
||||
}
|
||||
|
||||
this.comfirmLoading = false;
|
||||
},
|
||||
},
|
||||
onBackPress() {
|
||||
if (this.activeTab) {
|
||||
this.activeTab = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
};
|
||||
this.comfirmLoading = false;
|
||||
},
|
||||
},
|
||||
onBackPress() {
|
||||
if (this.activeTab) {
|
||||
this.activeTab = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.u-popup {
|
||||
flex: none;
|
||||
}
|
||||
.contact_choose_container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.search_bar_wrap {
|
||||
height: 34px;
|
||||
padding: 12px 22px;
|
||||
}
|
||||
::v-deep.u-popup {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.tab_container {
|
||||
@include colBox(false);
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
.contact_choose_container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.setting_item {
|
||||
padding: 32rpx 36rpx;
|
||||
}
|
||||
.search_bar_wrap {
|
||||
height: 34px;
|
||||
padding: 12px 22px;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
// padding: 16rpx 8rpx;
|
||||
background: #f8f9fa;
|
||||
color: #8e9ab0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.tab_container {
|
||||
@include colBox(false);
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
|
||||
.tabs_bar {
|
||||
@include vCenterBox();
|
||||
justify-content: space-evenly;
|
||||
.setting_item {
|
||||
padding: 32rpx 36rpx;
|
||||
}
|
||||
|
||||
.tab_item {
|
||||
@include colBox(false);
|
||||
align-items: center;
|
||||
.title {
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
// padding: 16rpx 8rpx;
|
||||
background: #f8f9fa;
|
||||
color: #8e9ab0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tabs_bar {
|
||||
@include vCenterBox();
|
||||
justify-content: space-evenly;
|
||||
|
||||
.tab_pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
.tab_item {
|
||||
@include colBox(false);
|
||||
align-items: center;
|
||||
|
||||
.member_list {
|
||||
flex: 1;
|
||||
height: 80% !important;
|
||||
::v-deepuni-scroll-view {
|
||||
max-height: 100% !important;
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user_list {
|
||||
height: 100% !important;
|
||||
}
|
||||
.tab_pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
|
||||
.member_anchor {
|
||||
background-color: #f8f8f8 !important;
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.member_list {
|
||||
flex: 1;
|
||||
height: 80% !important;
|
||||
|
||||
::v-deepuni-scroll-view {
|
||||
max-height: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.user_list {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
.member_anchor {
|
||||
background-color: #f8f8f8 !important;
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -86,6 +86,7 @@
|
||||
);
|
||||
info = data[0];
|
||||
}
|
||||
console.log(info)
|
||||
if (info) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/groupCard/index?sourceInfo=${JSON.stringify(info,)}`,
|
||||
@@ -103,7 +104,7 @@
|
||||
const {data} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetUsersInfo,
|
||||
IMSDK.uuid(),
|
||||
[res.data[0].id],
|
||||
[res.data[0].id+''],
|
||||
);
|
||||
const imData = data[0];
|
||||
|
||||
@@ -111,9 +112,9 @@
|
||||
...imData,
|
||||
...res.data[0],
|
||||
};
|
||||
console.log(info)
|
||||
}
|
||||
}
|
||||
console.log(info)
|
||||
if (info) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userCard/index?sourceInfo=${JSON.stringify(info,)}`,
|
||||
@@ -123,6 +124,7 @@
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.searching = false;
|
||||
|
||||
@@ -1,125 +1,117 @@
|
||||
<template>
|
||||
<view class="request_join_container">
|
||||
<custom-nav-bar :title="isGroup ? '群聊验证' : '好友验证'">
|
||||
<view class="top_right_btn" slot="more">
|
||||
<u-button @click="sendRequest" text="发送" type="primary"></u-button>
|
||||
</view>
|
||||
</custom-nav-bar>
|
||||
<view class="request_join_container">
|
||||
<custom-nav-bar :title="isGroup ? '群聊验证' : '好友验证'">
|
||||
<view class="top_right_btn" slot="more">
|
||||
<u-button @click="sendRequest" text="发送" type="primary"></u-button>
|
||||
</view>
|
||||
</custom-nav-bar>
|
||||
|
||||
<text class="title">{{ `发送${isGroup ? "入群" : "好友"}申请` }}</text>
|
||||
<text class="title">{{ `发送${isGroup ? "入群" : "好友"}申请` }}</text>
|
||||
|
||||
<view class="input_container">
|
||||
<u--textarea
|
||||
height="120"
|
||||
v-model="reason"
|
||||
border="none"
|
||||
placeholder="请输入内容"
|
||||
maxlength="20"
|
||||
count
|
||||
>
|
||||
</u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input_container">
|
||||
<u--textarea height="120" v-model="reason" border="none" placeholder="请输入内容" maxlength="20" count>
|
||||
</u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK, { GroupJoinSource } from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import { navigateToDesignatedConversation } from "@/util/imCommon";
|
||||
import IMSDK, {GroupJoinSource} from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import {navigateToDesignatedConversation} from "@/util/imCommon";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reason: "",
|
||||
sourceID: "",
|
||||
isGroup: false,
|
||||
isScan: false,
|
||||
notNeedVerification: false,
|
||||
sessionType: 0,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const { isGroup, sourceID, isScan, notNeedVerification, sessionType } =
|
||||
options;
|
||||
this.isGroup = JSON.parse(isGroup);
|
||||
this.isScan = JSON.parse(isScan);
|
||||
this.sourceID = sourceID;
|
||||
this.notNeedVerification = JSON.parse(notNeedVerification);
|
||||
this.sessionType = sessionType ?? 0;
|
||||
},
|
||||
methods: {
|
||||
sendRequest() {
|
||||
let func;
|
||||
if (this.isGroup) {
|
||||
const joinSource = this.isScan
|
||||
? GroupJoinSource.QrCode
|
||||
: GroupJoinSource.Search;
|
||||
func = IMSDK.asyncApi(IMSDK.IMMethods.JoinGroup, IMSDK.uuid(), {
|
||||
groupID: this.sourceID,
|
||||
reqMsg: this.reason,
|
||||
joinSource,
|
||||
});
|
||||
} else {
|
||||
func = IMSDK.asyncApi(IMSDK.IMMethods.AddFriend, IMSDK.uuid(), {
|
||||
toUserID: this.sourceID,
|
||||
reqMsg: this.reason,
|
||||
});
|
||||
}
|
||||
func
|
||||
.then(() => {
|
||||
uni.$u.toast(this.notNeedVerification ? "你已加入该群" : "发送成功");
|
||||
setTimeout(() => {
|
||||
if (this.notNeedVerification) {
|
||||
navigateToDesignatedConversation(
|
||||
this.sourceID,
|
||||
Number(this.sessionType),
|
||||
).catch(() => this.showToast("获取会话信息失败"));
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
uni.$u.toast("发送失败");
|
||||
});
|
||||
},
|
||||
showToast(message) {
|
||||
this.$refs.uToast.show({
|
||||
message,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reason: "",
|
||||
sourceID: "",
|
||||
isGroup: false,
|
||||
isScan: false,
|
||||
notNeedVerification: false,
|
||||
sessionType: 0,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const {isGroup,sourceID,isScan,notNeedVerification,sessionType} = options;
|
||||
this.isGroup = JSON.parse(isGroup);
|
||||
this.isScan = JSON.parse(isScan);
|
||||
this.sourceID = sourceID;
|
||||
this.notNeedVerification = JSON.parse(notNeedVerification);
|
||||
this.sessionType = sessionType ?? 0;
|
||||
},
|
||||
methods: {
|
||||
sendRequest() {
|
||||
let func;
|
||||
if (this.isGroup) {
|
||||
const joinSource = this.isScan ?
|
||||
GroupJoinSource.QrCode :
|
||||
GroupJoinSource.Search;
|
||||
func = IMSDK.asyncApi(IMSDK.IMMethods.JoinGroup, IMSDK.uuid(), {
|
||||
groupID: this.sourceID,
|
||||
reqMsg: this.reason,
|
||||
joinSource,
|
||||
});
|
||||
} else {
|
||||
func = IMSDK.asyncApi(IMSDK.IMMethods.AddFriend, IMSDK.uuid(), {
|
||||
toUserID: this.sourceID,
|
||||
reqMsg: this.reason,
|
||||
});
|
||||
}
|
||||
func
|
||||
.then(() => {
|
||||
uni.$u.toast(this.notNeedVerification ? "你已加入该群" : "发送成功");
|
||||
setTimeout(() => {
|
||||
if (this.notNeedVerification) {
|
||||
navigateToDesignatedConversation(
|
||||
this.sourceID,
|
||||
Number(this.sessionType),
|
||||
).catch(() => this.showToast("获取会话信息失败"));
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
uni.$u.toast(err.errMsg || "发送失败");
|
||||
});
|
||||
},
|
||||
showToast(message) {
|
||||
this.$refs.uToast.show({
|
||||
message,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.request_join_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
background-color: #f6f6f6;
|
||||
.request_join_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
background-color: #f6f6f6;
|
||||
|
||||
.top_right_btn {
|
||||
margin-right: 44rpx;
|
||||
.top_right_btn {
|
||||
margin-right: 44rpx;
|
||||
|
||||
.u-button {
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
.u-button {
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin: 24rpx 44rpx;
|
||||
}
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin: 24rpx 44rpx;
|
||||
}
|
||||
|
||||
.input_container {
|
||||
::v-deep.u-textarea {
|
||||
padding: 24rpx 44rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.input_container {
|
||||
::v-deep.u-textarea {
|
||||
padding: 24rpx 44rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<view class="m-shade n-flex-1 n-align-center n-justify-center">
|
||||
<view :style="{width:'580rpx'}">
|
||||
<image src="/static/image/upgrade.png" mode="widthFix"></image>
|
||||
<view class="n-ps-all-ll n-ms-top-ll n-position-absolute">
|
||||
<text class="n-size-mm n-weight-7 n-color-inverse">发现新版本</text>
|
||||
<text class="n-size-base n-ms-top-ss n-color-inverse">V{{model.version}}</text>
|
||||
</view>
|
||||
<view class="n-ps-all-l n-radius-lb-base" :style="{backgroundColor:'#f3f3f3',borderRadius:'0 0 16rpx 16rpx'}">
|
||||
<view :style="{height:'300rpx'}">
|
||||
<scroll-view class="n-flex-1" :show-scrollbar="false" scroll-y>
|
||||
<rich-text class="n-size-s" :nodes="model.content" :style="{lineHeight:'26rpx'}"></rich-text>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="n-height-base n-justify-center">
|
||||
<view v-if="progress">
|
||||
<uv-line-progress :percentage="value" activeColor="#fc3463"></uv-line-progress>
|
||||
</view>
|
||||
<view class="n-flex-row" v-else>
|
||||
<uv-button class="n-flex-1 n-ms-right-ll" v-if="model.force==0" @click="cancel" :customStyle="{backgroundColor:'#f3f3f3'}" text="暂不更新" color="#fc3463" shape="circle" throttleTime="1000" plain></uv-button>
|
||||
<uv-button class="n-flex-1" @click="upgrade" text="立即更新" color="#fc3463" shape="circle" throttleTime="1000"></uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 0,
|
||||
model: {
|
||||
force: 1,
|
||||
version: '1.0.0',
|
||||
content: ''
|
||||
},
|
||||
progress: false,
|
||||
download: false
|
||||
}
|
||||
},
|
||||
onLoad(evt) {
|
||||
if(evt.model){
|
||||
this.model = {...this.model, ...JSON.parse(evt.model)}
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
if(this.model.force==1){
|
||||
return true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 取消更新
|
||||
cancel() {
|
||||
uni.navigateBack()
|
||||
uni.setStorageSync('skip_version', this.model.version)
|
||||
},
|
||||
// 立即更新
|
||||
upgrade(){
|
||||
// 检测更新方式
|
||||
if(this.model.type==0 || this.model.type==1){
|
||||
this.downloadUpdate()
|
||||
}else{
|
||||
plus.runtime.openURL(this.model.source_text)
|
||||
}
|
||||
},
|
||||
// 下载更新
|
||||
downloadUpdate() {
|
||||
if(!this.download){
|
||||
this.progress = true
|
||||
this.download = true
|
||||
// 下载安装包
|
||||
const download = uni.downloadFile({
|
||||
url: this.model.source_text,
|
||||
success: result=>{
|
||||
// 自动安装软件
|
||||
plus.runtime.install(result.tempFilePath, {force:true}, ()=>{
|
||||
// 防止强制更新无法关闭界面
|
||||
this.model.force = 0
|
||||
if(this.model.type==1){
|
||||
uni.showToast({
|
||||
title:'更新成功,软件重启'
|
||||
})
|
||||
setTimeout(()=>{ plus.runtime.restart() }, 1500)
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: error=>{
|
||||
uni.showToast({
|
||||
title:'下载失败,请检查您的网络情况'
|
||||
})
|
||||
}
|
||||
})
|
||||
// 监听下载进度
|
||||
download.onProgressUpdate(result=>{
|
||||
this.value = result.progress
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.m-shade{
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
@@ -15,7 +15,11 @@
|
||||
<u-button type="primary" icon="man-add" text="添加"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info_row">
|
||||
<user-info-row-item lable="性别" :content="getGender" />
|
||||
<user-info-row-item lable="生日" :content="getBirth" />
|
||||
<user-info-row-item lable="个性签名" :content="sourceUserInfo.bio" />
|
||||
</view>
|
||||
<view v-if="isFriend" class="info_row">
|
||||
<user-info-row-item @click="toMoreInfo" lable="个人资料" arrow />
|
||||
</view>
|
||||
@@ -31,21 +35,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
navigateToDesignatedConversation
|
||||
} from "@/util/imCommon";
|
||||
import IMSDK, {
|
||||
SessionType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {mapGetters} from "vuex";
|
||||
import {navigateToDesignatedConversation} from "@/util/imCommon";
|
||||
import IMSDK, {SessionType,} from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import UserInfoRowItem from "./components/UserInfoRowItem.vue";
|
||||
import {
|
||||
businessSearchUserInfo
|
||||
} from "@/api/login";
|
||||
import {businessSearchUserInfo} from "@/api/login";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -67,6 +64,19 @@
|
||||
"storeFriendList",
|
||||
"storeSelfInfo",
|
||||
]),
|
||||
getGender() {
|
||||
if (this.sourceUserInfo.sex === 0) {
|
||||
return "保密";
|
||||
}
|
||||
if (this.sourceUserInfo.sex === 1) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
},
|
||||
getBirth() {
|
||||
const birth = this.sourceUserInfo.birthday ?? 0;
|
||||
return dayjs(birth).format("YYYY-MM-DD");
|
||||
},
|
||||
isFriend() {
|
||||
return (
|
||||
this.storeFriendList.findIndex(
|
||||
@@ -142,7 +152,7 @@
|
||||
} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetUsersInfo,
|
||||
IMSDK.uuid(),
|
||||
[this.sourceID],
|
||||
[this.sourceID+''],
|
||||
);
|
||||
const imData = data[0]?.friendInfo ?? data[0]?.publicInfo ?? {};
|
||||
info = {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<web-view :src="linkUrl"></web-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
linkUrl: "",
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.linkUrl = 'https://doc.rentsoft.cn/'
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
this.$scope
|
||||
.$getAppWebview()
|
||||
.children()[0]
|
||||
.setStyle({
|
||||
top: uni.getWindowInfo().statusBarHeight,
|
||||
height: uni.getWindowInfo().safeArea.height,
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,74 +1,74 @@
|
||||
<template>
|
||||
<view class="action_item" @click="onClick">
|
||||
<slot name="icon">
|
||||
<view class="action_icon">
|
||||
<image :src="action.icon" mode=""></image>
|
||||
</view>
|
||||
</slot>
|
||||
<view class="action_item" @click="onClick">
|
||||
<slot name="icon">
|
||||
<view class="action_icon">
|
||||
<image :src="action.icon" mode=""></image>
|
||||
</view>
|
||||
</slot>
|
||||
|
||||
<view class="action_details">
|
||||
<text class="title">{{ action.title }}</text>
|
||||
<text class="desc">{{ action.desc }}</text>
|
||||
<view class="bottom_line"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action_details">
|
||||
<text class="title">{{ action.title }}</text>
|
||||
<text class="desc">{{ action.desc }}</text>
|
||||
<view class="bottom_line"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
action: Object,
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
this.$emit("click", this.action);
|
||||
},
|
||||
},
|
||||
};
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
action: Object,
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
this.$emit("click", this.action);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.action_item {
|
||||
@include vCenterBox();
|
||||
padding: 24rpx 44rpx;
|
||||
.action_item {
|
||||
@include vCenterBox();
|
||||
padding: 24rpx 44rpx;
|
||||
|
||||
.action_icon {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
.action_icon {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
|
||||
image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.action_details {
|
||||
@include colBox(false);
|
||||
margin-left: 48rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
.action_details {
|
||||
@include colBox(false);
|
||||
margin-left: 48rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
font-weight: 500;
|
||||
padding-bottom: 12rpx;
|
||||
}
|
||||
.title {
|
||||
font-weight: 500;
|
||||
padding-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.desc {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.bottom_line {
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
background-color: #f0f0f0;
|
||||
position: absolute;
|
||||
bottom: -24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.bottom_line {
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
background-color: #f0f0f0;
|
||||
position: absolute;
|
||||
bottom: -24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,101 +1,91 @@
|
||||
<template>
|
||||
<view class="contact_add_container">
|
||||
<custom-nav-bar title="添加" />
|
||||
<view class="contact_add_container">
|
||||
<custom-nav-bar title="添加" />
|
||||
|
||||
<view class="action_row">
|
||||
<action-item
|
||||
@click="friendAction(item)"
|
||||
v-for="item in friendActionMenus"
|
||||
:action="item"
|
||||
:key="item.idx"
|
||||
/>
|
||||
<action-item
|
||||
@click="groupAction(item)"
|
||||
v-for="item in groupActionMenus"
|
||||
:action="item"
|
||||
:key="item.idx"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action_row">
|
||||
<action-item @click="friendAction(item)" v-for="item in friendActionMenus" :action="item" :key="'f_'+item.idx" />
|
||||
<action-item @click="groupAction(item)" v-for="item in groupActionMenus" :action="item" :key="'g_'+item.idx" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ActionItem from "./ActionItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
ActionItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
groupActionMenus: [
|
||||
{
|
||||
idx: 0,
|
||||
title: "创建群聊",
|
||||
desc: "创建群聊,全面使用OpenIM",
|
||||
icon: require("static/images/contact_add_create_group.png"),
|
||||
},
|
||||
{
|
||||
idx: 1,
|
||||
title: "添加群聊",
|
||||
desc: "向管理员或团队成员询问ID",
|
||||
icon: require("static/images/contact_add_join_group.png"),
|
||||
},
|
||||
],
|
||||
friendActionMenus: [
|
||||
{
|
||||
idx: 0,
|
||||
title: "添加好友",
|
||||
desc: "通过手机号/ID号/搜索添加",
|
||||
icon: require("static/images/contact_add_search_user.png"),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
groupAction({ idx }) {
|
||||
if (idx === 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/createGroup/index`,
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/contact/switchJoinGroup/index",
|
||||
});
|
||||
}
|
||||
},
|
||||
friendAction({ idx }) {
|
||||
if (!idx) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/common/searchUserOrGroup/index?isSearchGroup=false",
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ActionItem from "./ActionItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
ActionItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
groupActionMenus: [
|
||||
{
|
||||
idx: 0,
|
||||
title: "创建群聊",
|
||||
desc: "创建群聊,全面使用OpenIM",
|
||||
icon: require("static/images/contact_add_create_group.png"),
|
||||
},
|
||||
{
|
||||
idx: 1,
|
||||
title: "添加群聊",
|
||||
desc: "向管理员或团队成员询问ID",
|
||||
icon: require("static/images/contact_add_join_group.png"),
|
||||
},
|
||||
],
|
||||
friendActionMenus: [
|
||||
{
|
||||
idx: 0,
|
||||
title: "添加好友",
|
||||
desc: "通过手机号/ID号/搜索添加",
|
||||
icon: require("static/images/contact_add_search_user.png"),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
groupAction({idx}) {
|
||||
if (idx === 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/createGroup/index`,
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/contact/switchJoinGroup/index",
|
||||
});
|
||||
}
|
||||
},
|
||||
friendAction({idx}) {
|
||||
if (!idx) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/common/searchUserOrGroup/index?isSearchGroup=false",
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contact_add_container {
|
||||
height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
.contact_add_container {
|
||||
height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.desc_title {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
padding: 24rpx 44rpx;
|
||||
}
|
||||
.desc_title {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
padding: 24rpx 44rpx;
|
||||
}
|
||||
|
||||
.action_row {
|
||||
margin-top: 24rpx;
|
||||
background-color: #fff;
|
||||
.action_row {
|
||||
margin-top: 24rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.action_item:last-child {
|
||||
.bottom_line {
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.action_item:last-child {
|
||||
.bottom_line {
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,80 +1,112 @@
|
||||
<template>
|
||||
<view class="chat_action_bar">
|
||||
<u-row class="action_row">
|
||||
<u-col
|
||||
v-for="item in actionList"
|
||||
:key="item.idx"
|
||||
@click="actionClick(item)"
|
||||
span="3"
|
||||
>
|
||||
<view class="action_item">
|
||||
<image :src="item.icon" alt="" srcset="" />
|
||||
<text class="action_item_title">{{ item.title }}</text>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
<view class="chat_action_bar">
|
||||
<u-row class="action_row">
|
||||
<u-col v-for="item in actionList" :key="item.idx" @click="actionClick(item)" span="3">
|
||||
<view class="action_item">
|
||||
<image :src="item.icon" alt="" srcset="" />
|
||||
<text class="action_item_title">{{ item.title }}</text>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
ChatingFooterActionTypes,
|
||||
} from "@/constant";
|
||||
import {ChatingFooterActionTypes,} from "@/constant";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
actionList: [
|
||||
{
|
||||
idx: 0,
|
||||
type: ChatingFooterActionTypes.Album,
|
||||
title: "相册",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async actionClick(action) {
|
||||
switch (action.type) {
|
||||
case ChatingFooterActionTypes.Album:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
actionList: [
|
||||
{
|
||||
idx: 0,
|
||||
type: ChatingFooterActionTypes.Album,
|
||||
title: "照片",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
{
|
||||
idx: 1,
|
||||
type: ChatingFooterActionTypes.Camera,
|
||||
title: "拍摄",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
{
|
||||
idx: 2,
|
||||
type: ChatingFooterActionTypes.Video,
|
||||
title: "视频通话",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
{
|
||||
idx: 3,
|
||||
type: ChatingFooterActionTypes.Location,
|
||||
title: "位置",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
// {
|
||||
// idx: 0,
|
||||
// type: ChatingFooterActionTypes.Album,
|
||||
// title: "红包",
|
||||
// icon: require("static/images/chating_action_image.png"),
|
||||
// },
|
||||
// {
|
||||
// idx: 0,
|
||||
// type: ChatingFooterActionTypes.Album,
|
||||
// title: "转账",
|
||||
// icon: require("static/images/chating_action_image.png"),
|
||||
// }
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async actionClick(action) {
|
||||
switch (action.type) {
|
||||
case ChatingFooterActionTypes.Video:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
case ChatingFooterActionTypes.Album:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
case ChatingFooterActionTypes.Camera:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
case ChatingFooterActionTypes.Location:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.chat_action_bar {
|
||||
position: relative;
|
||||
background: #f0f2f6;
|
||||
padding: 24rpx 36rpx;
|
||||
.chat_action_bar {
|
||||
position: relative;
|
||||
background: #f0f2f6;
|
||||
padding: 24rpx 36rpx;
|
||||
|
||||
.action_row {
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.action_row {
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.action_item {
|
||||
@include centerBox();
|
||||
flex-direction: column;
|
||||
margin-top: 24rpx;
|
||||
.action_item {
|
||||
@include centerBox();
|
||||
flex-direction: column;
|
||||
margin-top: 24rpx;
|
||||
|
||||
image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
}
|
||||
image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
}
|
||||
|
||||
&_title {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
&_title {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -25,40 +25,26 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters,
|
||||
mapActions
|
||||
} from "vuex";
|
||||
import {
|
||||
getPurePath,
|
||||
html2Text
|
||||
} from "@/util/common";
|
||||
import {
|
||||
offlinePushInfo
|
||||
} from "@/util/imCommon";
|
||||
import {
|
||||
ChatingFooterActionTypes,
|
||||
UpdateMessageTypes,
|
||||
} from "@/constant";
|
||||
import IMSDK, {
|
||||
IMMethods,
|
||||
MessageStatus,
|
||||
MessageType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {mapGetters,mapActions} from "vuex";
|
||||
import {getPurePath,html2Text} from "@/util/common";
|
||||
import {offlinePushInfo} from "@/util/imCommon";
|
||||
import {ChatingFooterActionTypes,UpdateMessageTypes,} from "@/constant";
|
||||
import IMSDK, {IMMethods,MessageStatus,MessageType,} from "openim-uniapp-polyfill";
|
||||
import UParse from "@/components/gaoyia-parse/parse.vue";
|
||||
import CustomEditor from "./CustomEditor.vue";
|
||||
import ChatingActionBar from "./ChatingActionBar.vue";
|
||||
|
||||
const needClearTypes = [MessageType.TextMessage];
|
||||
|
||||
const albumChoose = [{
|
||||
name: "图片",
|
||||
type: ChatingFooterActionTypes.Album,
|
||||
const rtcChoose = [
|
||||
{
|
||||
name: "视频通话",
|
||||
type: ChatingFooterActionTypes.Video,
|
||||
idx: 0,
|
||||
},
|
||||
{
|
||||
name: "拍照",
|
||||
type: ChatingFooterActionTypes.Camera,
|
||||
name: "语言通话",
|
||||
type: ChatingFooterActionTypes.Voice,
|
||||
idx: 1,
|
||||
},
|
||||
];
|
||||
@@ -133,23 +119,19 @@
|
||||
message,
|
||||
offlinePushInfo,
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
.then(({data}) => {
|
||||
this.updateOneMessage({
|
||||
message: data,
|
||||
isSuccess: true,
|
||||
});
|
||||
})
|
||||
.catch(({
|
||||
data,
|
||||
errCode,
|
||||
errMsg
|
||||
}) => {
|
||||
.catch(({data,errCode,errMsg}) => {
|
||||
uni.$u.toast(errMsg);
|
||||
this.updateOneMessage({
|
||||
message: data,
|
||||
type: UpdateMessageTypes.KeyWords,
|
||||
keyWords: [{
|
||||
keyWords: [
|
||||
{
|
||||
key: "status",
|
||||
value: MessageStatus.Failed,
|
||||
},
|
||||
@@ -186,14 +168,62 @@
|
||||
this.inputHtml = e.detail.html;
|
||||
},
|
||||
prepareMediaMessage(type) {
|
||||
if (type === ChatingFooterActionTypes.Album) {
|
||||
this.actionSheetMenu = [...albumChoose];
|
||||
console.log(type)
|
||||
if (type === ChatingFooterActionTypes.Video) {
|
||||
this.actionSheetMenu = [...rtcChoose];
|
||||
this.showActionSheet = true;
|
||||
}
|
||||
if (type === ChatingFooterActionTypes.Album) {
|
||||
this.chooseOrShotImage(["album"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
}
|
||||
if (type === ChatingFooterActionTypes.Camera) {
|
||||
this.chooseOrShotImage(["camera"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
}
|
||||
if (type === ChatingFooterActionTypes.Location) {
|
||||
uni.chooseLocation({
|
||||
complete(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(res) {
|
||||
console.log(res);
|
||||
}
|
||||
//latitude:1,
|
||||
//longitude:1,
|
||||
})
|
||||
}
|
||||
this.showActionSheet = true;
|
||||
},
|
||||
|
||||
// from comp
|
||||
batchCreateImageMesage(paths) {
|
||||
/*
|
||||
createAdvancedTextMessage
|
||||
createTextAtMessage
|
||||
createLocationMessage
|
||||
createTextMessage
|
||||
createCustomMessage
|
||||
createQuoteMessage
|
||||
createAdvancedQuoteMessage
|
||||
createCardMessage
|
||||
createImageMessage
|
||||
createImageMessage
|
||||
createImageMessageByURL
|
||||
createSoundMessage
|
||||
createSoundMessageFromFullPath
|
||||
createSoundMessageByURL
|
||||
createVideoMessage
|
||||
createVideoMessageFromFullPath
|
||||
createVideoMessageByURL
|
||||
createFileMessage
|
||||
createFileMessageFromFullPath
|
||||
createFileMessageByURL
|
||||
createMergerMessage
|
||||
createFaceMessage
|
||||
createForwardMessage
|
||||
*/
|
||||
paths.forEach(async (path) => {
|
||||
const message = await IMSDK.asyncApi(
|
||||
IMMethods.CreateImageMessageFromFullPath,
|
||||
@@ -203,17 +233,19 @@
|
||||
this.sendMessage(message);
|
||||
});
|
||||
},
|
||||
selectClick({
|
||||
idx
|
||||
}) {
|
||||
selectClick({idx}) {
|
||||
if (idx === 0) {
|
||||
this.chooseOrShotImage(["album"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
uni.$u.toast('根据相关政策,暂时禁用视频通话');
|
||||
//发送视频通话
|
||||
// this.chooseOrShotImage(["album"]).then((paths) =>
|
||||
// this.batchCreateImageMesage(paths)
|
||||
// );
|
||||
} else {
|
||||
this.chooseOrShotImage(["camera"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
uni.$u.toast('根据相关政策,暂时禁用音频通话');
|
||||
//发送音频通话
|
||||
// this.chooseOrShotImage(["camera"]).then((paths) =>
|
||||
// this.batchCreateImageMesage(paths)
|
||||
// );
|
||||
}
|
||||
},
|
||||
chooseOrShotImage(sourceType) {
|
||||
@@ -222,9 +254,7 @@
|
||||
count: 9,
|
||||
sizeType: ["compressed"],
|
||||
sourceType,
|
||||
success: function({
|
||||
tempFilePaths
|
||||
}) {
|
||||
success: function({tempFilePaths}) {
|
||||
resolve(tempFilePaths);
|
||||
},
|
||||
fail: function(err) {
|
||||
@@ -236,9 +266,7 @@
|
||||
},
|
||||
|
||||
// keyboard
|
||||
keyboardChangeHander({
|
||||
height
|
||||
}) {
|
||||
keyboardChangeHander({height}) {
|
||||
if (height > 0) {
|
||||
if (this.actionBarVisible) {
|
||||
this.actionBarVisible = false;
|
||||
|
||||
@@ -1,329 +1,301 @@
|
||||
<template>
|
||||
<view class="chat_header">
|
||||
<view class="self_info">
|
||||
<my-avatar
|
||||
:src="storeSelfInfo.faceURL"
|
||||
:desc="storeSelfInfo.nickname"
|
||||
size="46"
|
||||
/>
|
||||
<view class="self_info_desc">
|
||||
<view class="user_state">
|
||||
<text class="nickname">{{ storeSelfInfo.nickname }}</text>
|
||||
<view v-if="!storeReinstall">
|
||||
<view class="tag" v-if="storeIsSyncing">
|
||||
<img
|
||||
class="loading"
|
||||
style="height: 24rpx; width: 24rpx"
|
||||
src="static/images/loading.png"
|
||||
alt=""
|
||||
/>
|
||||
<text class="status">同步中</text>
|
||||
</view>
|
||||
<view class="tag" v-if="connectStart == 0">
|
||||
<img
|
||||
class="loading"
|
||||
style="height: 24rpx; width: 24rpx"
|
||||
src="static/images/loading.png"
|
||||
alt=""
|
||||
/>
|
||||
<text class="status">连接中</text>
|
||||
</view>
|
||||
<view class="err-tag" v-if="connectStart == -1">
|
||||
<img
|
||||
style="height: 24rpx; width: 24rpx"
|
||||
src="static/images/sync_error.png"
|
||||
alt=""
|
||||
/>
|
||||
<text class="status">连接失败</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right_action">
|
||||
<view class="call_icon"> </view>
|
||||
<view @click="showMore" class="more_icon">
|
||||
<image src="@/static/images/common_circle_add.png"></image>
|
||||
</view>
|
||||
<u-overlay
|
||||
:show="moreMenuVisible"
|
||||
@click="moreMenuVisible = false"
|
||||
opacity="0"
|
||||
>
|
||||
<view
|
||||
:style="{ top: popMenuPosition.top, right: popMenuPosition.right }"
|
||||
class="more_menu"
|
||||
>
|
||||
<view
|
||||
@click="clickMenu(item)"
|
||||
v-for="item in moreMenus"
|
||||
:key="item.idx"
|
||||
class="menu_item"
|
||||
>
|
||||
<image :src="item.icon" mode=""></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
</view>
|
||||
</view>
|
||||
<view class="chat_header">
|
||||
<view class="self_info">
|
||||
<my-avatar :src="storeSelfInfo.faceURL" :desc="storeSelfInfo.nickname" size="46" />
|
||||
<view class="self_info_desc">
|
||||
<view class="user_state">
|
||||
<text class="nickname">{{ storeSelfInfo.nickname }}</text>
|
||||
<view v-if="!storeReinstall">
|
||||
<view class="tag" v-if="storeIsSyncing">
|
||||
<img class="loading" style="height: 24rpx; width: 24rpx" src="static/images/loading.png"
|
||||
alt="" />
|
||||
<text class="status">同步中</text>
|
||||
</view>
|
||||
<view class="tag" v-if="connectStart == 0">
|
||||
<img class="loading" style="height: 24rpx; width: 24rpx" src="static/images/loading.png"
|
||||
alt="" />
|
||||
<text class="status">连接中</text>
|
||||
</view>
|
||||
<view class="err-tag" v-if="connectStart == -1">
|
||||
<img style="height: 24rpx; width: 24rpx" src="static/images/sync_error.png" alt="" />
|
||||
<text class="status">连接失败</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right_action">
|
||||
<view class="call_icon"> </view>
|
||||
<view @click="showMore" class="more_icon">
|
||||
<image src="@/static/images/common_circle_add.png"></image>
|
||||
</view>
|
||||
<u-overlay :show="moreMenuVisible" @click="moreMenuVisible = false" opacity="0">
|
||||
<view :style="{ top: popMenuPosition.top, right: popMenuPosition.right }" class="more_menu">
|
||||
<view @click="clickMenu(item)" v-for="item in moreMenus" :key="item.idx" class="menu_item">
|
||||
<image :src="item.icon" mode=""></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
export default {
|
||||
name: "ChatHeader",
|
||||
components: {
|
||||
MyAvatar,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
connectStart: -2,
|
||||
moreMenuVisible: false,
|
||||
popMenuPosition: {
|
||||
top: 0,
|
||||
right: 0,
|
||||
},
|
||||
moreMenus: [
|
||||
{
|
||||
idx: 1,
|
||||
title: "添加好友",
|
||||
icon: require("static/images/more_add_friend.png"),
|
||||
},
|
||||
{
|
||||
idx: 2,
|
||||
title: "添加群聊",
|
||||
icon: require("static/images/more_add_group.png"),
|
||||
},
|
||||
{
|
||||
idx: 3,
|
||||
title: "创建群聊",
|
||||
icon: require("static/images/more_create_group.png"),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["storeSelfInfo", "storeIsSyncing", "storeReinstall"]),
|
||||
},
|
||||
mounted() {
|
||||
this.subscribeAll();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.unsubscribeAll();
|
||||
},
|
||||
methods: {
|
||||
setStateStart() {
|
||||
this.connectStart = 0;
|
||||
},
|
||||
setStateSuccess() {
|
||||
this.connectStart = 1;
|
||||
},
|
||||
setStateError() {
|
||||
this.connectStart = -1;
|
||||
},
|
||||
subscribeAll() {
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnConnecting, this.setStateStart);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnConnectSuccess, this.setStateSuccess);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnConnectFailed, this.setStateError);
|
||||
},
|
||||
unsubscribeAll() {
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnecting, this.setStateStart);
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnectSuccess, this.setStateSuccess);
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnectFailed, this.setStateError);
|
||||
},
|
||||
clickMenu({ idx }) {
|
||||
switch (idx) {
|
||||
case 1:
|
||||
case 2:
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/searchUserOrGroup/index?isSearchGroup=${
|
||||
idx === 2
|
||||
}`,
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/createGroup/index`,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
async showMore() {
|
||||
const { right, bottom } = await this.getEl(".more_icon");
|
||||
this.popMenuPosition.right =
|
||||
uni.getWindowInfo().windowWidth - right + "px";
|
||||
this.popMenuPosition.top = bottom + "px";
|
||||
this.moreMenuVisible = true;
|
||||
},
|
||||
getEl(el) {
|
||||
return new Promise((resolve) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query
|
||||
.select(el)
|
||||
.boundingClientRect((data) => {
|
||||
// 存在data,且存在宽和高,视为渲染完毕
|
||||
resolve(data);
|
||||
})
|
||||
.exec();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
export default {
|
||||
name: "ChatHeader",
|
||||
components: {
|
||||
MyAvatar,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
connectStart: -2,
|
||||
moreMenuVisible: false,
|
||||
popMenuPosition: {
|
||||
top: 0,
|
||||
right: 0,
|
||||
},
|
||||
moreMenus: [{
|
||||
idx: 1,
|
||||
title: "添加好友",
|
||||
icon: require("static/images/more_add_friend.png"),
|
||||
},
|
||||
{
|
||||
idx: 2,
|
||||
title: "添加群聊",
|
||||
icon: require("static/images/more_add_group.png"),
|
||||
},
|
||||
{
|
||||
idx: 3,
|
||||
title: "创建群聊",
|
||||
icon: require("static/images/more_create_group.png"),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["storeSelfInfo", "storeIsSyncing", "storeReinstall"]),
|
||||
},
|
||||
mounted() {
|
||||
this.subscribeAll();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.unsubscribeAll();
|
||||
},
|
||||
methods: {
|
||||
setStateStart() {
|
||||
this.connectStart = 0;
|
||||
},
|
||||
setStateSuccess() {
|
||||
this.connectStart = 1;
|
||||
},
|
||||
setStateError() {
|
||||
this.connectStart = -1;
|
||||
},
|
||||
subscribeAll() {
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnConnecting, this.setStateStart);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnConnectSuccess, this.setStateSuccess);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnConnectFailed, this.setStateError);
|
||||
},
|
||||
unsubscribeAll() {
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnecting, this.setStateStart);
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnectSuccess, this.setStateSuccess);
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnectFailed, this.setStateError);
|
||||
},
|
||||
clickMenu({idx}) {
|
||||
switch (idx) {
|
||||
case 1:
|
||||
case 2:
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/searchUserOrGroup/index?isSearchGroup=${idx === 2}`,
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/createGroup/index`,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
async showMore() {
|
||||
const {right,bottom} = await this.getEl(".more_icon");
|
||||
this.popMenuPosition.right =
|
||||
uni.getWindowInfo().windowWidth - right + "px";
|
||||
this.popMenuPosition.top = bottom + "px";
|
||||
this.moreMenuVisible = true;
|
||||
},
|
||||
getEl(el) {
|
||||
return new Promise((resolve) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query
|
||||
.select(el)
|
||||
.boundingClientRect((data) => {
|
||||
// 存在data,且存在宽和高,视为渲染完毕
|
||||
resolve(data);
|
||||
})
|
||||
.exec();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@keyframes loading {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
@keyframes loading {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.chat_header {
|
||||
@include btwBox();
|
||||
padding: 36rpx 44rpx;
|
||||
margin-top: var(--status-bar-height);
|
||||
.chat_header {
|
||||
@include btwBox();
|
||||
padding: 36rpx 44rpx;
|
||||
margin-top: var(--status-bar-height);
|
||||
|
||||
.self_info {
|
||||
@include btwBox();
|
||||
.self_info {
|
||||
@include btwBox();
|
||||
|
||||
&_desc {
|
||||
@include colBox(true);
|
||||
margin-left: 24rpx;
|
||||
color: $uni-text-color;
|
||||
&_desc {
|
||||
@include colBox(true);
|
||||
margin-left: 24rpx;
|
||||
color: $uni-text-color;
|
||||
|
||||
.company {
|
||||
@include nomalEllipsis();
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 10rpx;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
.company {
|
||||
@include nomalEllipsis();
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 10rpx;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
|
||||
.user_state {
|
||||
@include vCenterBox();
|
||||
.user_state {
|
||||
@include vCenterBox();
|
||||
|
||||
.nickname {
|
||||
@include nomalEllipsis();
|
||||
font-size: 26rpx;
|
||||
max-width: 240rpx;
|
||||
}
|
||||
.nickname {
|
||||
@include nomalEllipsis();
|
||||
font-size: 26rpx;
|
||||
max-width: 240rpx;
|
||||
}
|
||||
|
||||
.err-tag {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 152rpx;
|
||||
height: 44rpx;
|
||||
background: #ffe1dd;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
margin-left: 8rpx;
|
||||
.status {
|
||||
font-size: 24rpx;
|
||||
margin-left: 8rpx;
|
||||
font-weight: 400;
|
||||
color: #ff381f;
|
||||
}
|
||||
}
|
||||
.err-tag {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 152rpx;
|
||||
height: 44rpx;
|
||||
background: #ffe1dd;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
margin-left: 8rpx;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 152rpx;
|
||||
height: 44rpx;
|
||||
background: #f2f8ff;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
margin-left: 8rpx;
|
||||
.status {
|
||||
font-size: 24rpx;
|
||||
margin-left: 8rpx;
|
||||
font-weight: 400;
|
||||
color: #ff381f;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
animation: loading 1.5s infinite;
|
||||
}
|
||||
.tag {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 152rpx;
|
||||
height: 44rpx;
|
||||
background: #f2f8ff;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
margin-left: 8rpx;
|
||||
|
||||
.status {
|
||||
font-size: 24rpx;
|
||||
margin-left: 8rpx;
|
||||
font-weight: 400;
|
||||
color: #0089ff;
|
||||
}
|
||||
}
|
||||
.loading {
|
||||
animation: loading 1.5s infinite;
|
||||
}
|
||||
|
||||
.online_state {
|
||||
@include vCenterBox();
|
||||
margin-left: 24rpx;
|
||||
font-size: 24rpx;
|
||||
.status {
|
||||
font-size: 24rpx;
|
||||
margin-left: 8rpx;
|
||||
font-weight: 400;
|
||||
color: #0089ff;
|
||||
}
|
||||
}
|
||||
|
||||
.dot {
|
||||
background-color: #10cc64;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.online_state {
|
||||
@include vCenterBox();
|
||||
margin-left: 24rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.right_action {
|
||||
display: flex;
|
||||
position: relative;
|
||||
.dot {
|
||||
background-color: #10cc64;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.call_icon {
|
||||
margin-right: 24rpx;
|
||||
.right_action {
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
}
|
||||
.call_icon {
|
||||
margin-right: 24rpx;
|
||||
|
||||
.more_icon {
|
||||
image {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.more_menu {
|
||||
position: absolute;
|
||||
// bottom: 0;
|
||||
// left: 100%;
|
||||
z-index: 999;
|
||||
// transform: translate(-100%, 100%);
|
||||
box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.16);
|
||||
width: max-content;
|
||||
border-radius: 12rpx;
|
||||
background-color: #fff;
|
||||
.more_icon {
|
||||
image {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.menu_item {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
padding: 20rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: $uni-text-color;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
.more_menu {
|
||||
position: absolute;
|
||||
// bottom: 0;
|
||||
// left: 100%;
|
||||
z-index: 999;
|
||||
// transform: translate(-100%, 100%);
|
||||
box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.16);
|
||||
width: max-content;
|
||||
border-radius: 12rpx;
|
||||
background-color: #fff;
|
||||
|
||||
image {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.menu_item {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
padding: 20rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: $uni-text-color;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
image {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,34 +1,31 @@
|
||||
<template>
|
||||
<view @tap.prevent="clickConversationItem" class="conversation_item">
|
||||
<view class="pinned" v-if="source.isPinned"></view>
|
||||
<view @tap.prevent="clickConversationItem" :class="['conversation_item',source.isPinned?'pinned' : '']">
|
||||
<view class="left_info">
|
||||
<my-avatar :isGroup="isGroup" :isNotify="isNotify" :src="source.faceURL" :desc="source.showName"
|
||||
size="46" />
|
||||
<view class="details">
|
||||
<text class="conversation_name">{{ source.showName }}</text>
|
||||
<view class="title">
|
||||
<text class="conversation_name">
|
||||
{{ source.showName }}
|
||||
</text>
|
||||
<view class="right_desc">
|
||||
<text class="send_time">{{ latestMessageTime }}</text>
|
||||
<u-badge max="99" :value="source.unreadCount"></u-badge>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lastest_msg_wrap">
|
||||
<text class="lastest_msg_content">{{ latestMessage }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right_desc">
|
||||
<text class="send_time">{{ latestMessageTime }}</text>
|
||||
<u-badge max="99" :value="source.unreadCount"></u-badge>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
SessionType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {SessionType,} from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import UParse from "@/components/gaoyia-parse/parse.vue";
|
||||
import {
|
||||
getConversationContent,
|
||||
formatConversionTime,
|
||||
prepareConversationState,
|
||||
} from "@/util/imCommon";
|
||||
import {getConversationContent,formatConversionTime,prepareConversationState,} from "@/util/imCommon";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -81,6 +78,9 @@
|
||||
flex-direction: row;
|
||||
padding: 12rpx 44rpx 20rpx;
|
||||
position: relative;
|
||||
&.pinned{
|
||||
background-color: #ededed;
|
||||
}
|
||||
|
||||
&_active {
|
||||
background-color: #f3f3f3;
|
||||
@@ -88,17 +88,41 @@
|
||||
|
||||
.left_info {
|
||||
@include btwBox();
|
||||
flex:1;
|
||||
|
||||
.details {
|
||||
@include colBox(true);
|
||||
flex:1;
|
||||
margin-left: 24rpx;
|
||||
height: 46px;
|
||||
color: $uni-text-color;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom:20rpx;
|
||||
.title{
|
||||
@include btwBox();
|
||||
.conversation_name {
|
||||
@include nomalEllipsis();
|
||||
max-width: 40vw;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.conversation_name {
|
||||
@include nomalEllipsis();
|
||||
max-width: 40vw;
|
||||
font-size: 28rpx;
|
||||
.right_desc {
|
||||
@include colBox(true);
|
||||
align-items: flex-end;
|
||||
width: max-content;
|
||||
justify-content: space-between;
|
||||
|
||||
.send_time {
|
||||
width: max-content;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-badge {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lastest_msg_wrap {
|
||||
@@ -125,32 +149,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right_desc {
|
||||
@include colBox(true);
|
||||
align-items: flex-end;
|
||||
width: max-content;
|
||||
justify-content: space-between;
|
||||
height: 46px;
|
||||
|
||||
.send_time {
|
||||
width: max-content;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-badge {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
|
||||
.pinned {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 24rpx;
|
||||
width: 17rpx;
|
||||
height: 17rpx;
|
||||
background-image: linear-gradient(to bottom left, #314ffe 50%, white 50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+15
-21
@@ -7,10 +7,10 @@
|
||||
</view>
|
||||
<u-tabs :list="list" :current="active" @click="click"></u-tabs>
|
||||
<u-form class="loginForm" labelPosition="top" :model="loginInfo" :labelStyle="{
|
||||
fontSize: '14px',
|
||||
marginTop: '20rpx',
|
||||
width: 'max-content',
|
||||
}" ref="loginForm">
|
||||
fontSize: '14px',
|
||||
marginTop: '20rpx',
|
||||
width: 'max-content',
|
||||
}" ref="loginForm">
|
||||
<u-form-item v-if="active === 0" label="" prop="phoneNumber">
|
||||
<u-input v-model="loginInfo.phoneNumber" border="surround" placeholder="请输入手机号码" clearable>
|
||||
<view slot="prefix" class="phoneNumber_areacode" @click="showPicker">
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<view class="action_bar">
|
||||
<text>还没有账号?<text class="register" @click="toRegisterOrForget(true)">立即注册</text></text>
|
||||
<text style="margin-bottom: 16rpx" @click="copy">{{ v }}</text>
|
||||
<text style="margin-bottom: 16rpx" @click="copy">{{ appversion }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -62,7 +62,6 @@
|
||||
import { mapGetters } from "vuex";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import md5 from "md5";
|
||||
import { version } from '@/common/config'
|
||||
import { businessLogin, businessSendSms } from "@/api/login";
|
||||
import AreaPicker from "@/components/AreaPicker";
|
||||
import { checkLoginError } from "@/util/common";
|
||||
@@ -89,6 +88,7 @@
|
||||
areaCode: "86",
|
||||
verificationCode: "",
|
||||
},
|
||||
appversion:0,
|
||||
eying: false,
|
||||
loading: false,
|
||||
count: 0,
|
||||
@@ -97,12 +97,7 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"config",
|
||||
]),
|
||||
v() {
|
||||
return this.config.name+' '+version
|
||||
},
|
||||
...mapGetters(["config"]),
|
||||
canLogin() {
|
||||
return (
|
||||
(this.loginInfo.phoneNumber || this.loginInfo.email) &&
|
||||
@@ -111,16 +106,18 @@
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const _this = this;
|
||||
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
|
||||
console.log(inf);
|
||||
_this.appversion = inf.version
|
||||
});
|
||||
// if(options.isRedirect){
|
||||
// plus.navigator.closeSplashscreen();
|
||||
// }
|
||||
this.version = version
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
click({
|
||||
index
|
||||
}) {
|
||||
click({index}) {
|
||||
this.active = index;
|
||||
},
|
||||
copy() {
|
||||
@@ -164,14 +161,11 @@
|
||||
email: this.loginInfo.email,
|
||||
areaCode: `+${this.loginInfo.areaCode}`,
|
||||
password: this.isPwdLogin ? md5(this.loginInfo.password) : "",
|
||||
platform: uni.$u.os() === "ios" ? 1 : 2,
|
||||
platform: uni.$u.os(),
|
||||
type: this.active === 0 ? 'mobile' : 'email',
|
||||
code: this.loginInfo.verificationCode,
|
||||
});
|
||||
const {
|
||||
imToken,
|
||||
userID
|
||||
} = data;
|
||||
const {imToken,userID} = data;
|
||||
await IMSDK.asyncApi(IMSDK.IMMethods.Login, uuidv4(), {
|
||||
userID,
|
||||
token: imToken,
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
areaCode: `+${this.userInfo.areaCode}`,
|
||||
code: this.codeValue,
|
||||
password: this.formData.password,
|
||||
platform: uni.$u.os() === "ios" ? 1 : 2,
|
||||
platform: uni.$u.os(),
|
||||
operationID: Date.now() + "",
|
||||
};
|
||||
businessReset(options)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</u-form>
|
||||
<view class="btn">
|
||||
<u-button :loading="loading" type="primary" @click="doNext">
|
||||
进入OpenIM
|
||||
进入{{config.name}}
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -36,12 +36,9 @@
|
||||
<script>
|
||||
import md5 from "md5";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import {
|
||||
businessRegister
|
||||
} from "@/api/login";
|
||||
import {
|
||||
checkLoginError
|
||||
} from "@/util/common";
|
||||
import { mapGetters } from "vuex";
|
||||
import { businessRegister } from "@/api/login";
|
||||
import { checkLoginError } from "@/util/common";
|
||||
export default {
|
||||
components: {
|
||||
MyAvatar,
|
||||
@@ -100,19 +97,19 @@
|
||||
},
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
...mapGetters(["config"]),
|
||||
},
|
||||
onLoad(options) {
|
||||
const {
|
||||
userInfo,
|
||||
codeValue
|
||||
} = options;
|
||||
const {userInfo,codeValue} = options;
|
||||
this.userInfo = {
|
||||
...this.userInfo,
|
||||
...JSON.parse(userInfo),
|
||||
};
|
||||
this.codeValue = codeValue;
|
||||
if(process.env.NODE_ENV == 'development'){
|
||||
this.userInfo.email = "commiu@outlook.com";
|
||||
this.userInfo.nickname = "commiu";
|
||||
//this.userInfo.email = "commiu@outlook.com";
|
||||
this.userInfo.nickname = "";
|
||||
this.userInfo.password = "qwe123";
|
||||
this.userInfo.confirmPassword = "qwe123";
|
||||
}
|
||||
@@ -135,12 +132,12 @@
|
||||
this.loading = true;
|
||||
const options = {
|
||||
code: this.codeValue,
|
||||
platform: uni.$u.os() === "ios" ? 1 : 2,
|
||||
platform: uni.$u.os(),
|
||||
autoLogin: true,
|
||||
...this.userInfo,
|
||||
areaCode: `+${this.userInfo.areaCode}`,
|
||||
password: md5(this.userInfo.password),
|
||||
mobile: `+${this.userInfo.phoneNumber}`,
|
||||
mobile: this.userInfo.phoneNumber
|
||||
};
|
||||
try {
|
||||
await businessRegister(options);
|
||||
|
||||
+157
-132
@@ -1,144 +1,169 @@
|
||||
<template>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="关于我们" />
|
||||
<view class="logo_area">
|
||||
<image src="@/static/images/about_logo.png" mode=""></image>
|
||||
<view>{{ v }}</view>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="关于我们" />
|
||||
<view class="logo_area">
|
||||
<image src="@/static/images/about_logo.png" mode=""></image>
|
||||
<view>{{ appversion }}</view>
|
||||
|
||||
<info-item @click="checkUpdate" class="check" title="检测更新" content="" />
|
||||
<info-item @click="openurl('http://baidu.com')" class="check" title="官方网站" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=coom&title=商务合作')" class="check" title="商务合作" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=contract&title=用户协议')" class="check" title="用户协议" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=privacy&title=隐私政策')" class="check" title="隐私政策" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=aboutus&title=关于我们')" class="check" title="关于我们" content="" />
|
||||
<info-item @click="clearcache" class="check" title="清除缓存" content="" />
|
||||
<info-item @click="show = true" class="check" title="上传调试日志" content="" />
|
||||
|
||||
<info-item
|
||||
@click="show = true"
|
||||
class="check"
|
||||
title="上传调试日志"
|
||||
content=""
|
||||
/>
|
||||
|
||||
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false" >
|
||||
<view class="slot-content">
|
||||
<u--input
|
||||
placeholder="日志数量"
|
||||
border="surround"
|
||||
v-model="line"
|
||||
></u--input>
|
||||
</view>
|
||||
</u-modal>
|
||||
</view>
|
||||
</view>
|
||||
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
|
||||
<view class="slot-content">
|
||||
<u--input placeholder="日志数量" border="surround" v-model="line"></u--input>
|
||||
</view>
|
||||
</u-modal>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import { version } from '@/common/config'
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import { PageEvents } from "@/constant";
|
||||
import InfoItem from "../selfInfo/InfoItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
InfoItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
line: 10000,
|
||||
version: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
v(){
|
||||
return version
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getAppVersion();
|
||||
uni.$on(PageEvents.CheckForUpdateResp, this.checkRespHandler);
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off(PageEvents.CheckForUpdateResp, this.checkRespHandler);
|
||||
},
|
||||
mounted() {
|
||||
IMSDK.subscribe('uploadLogsProgress', this.uploadHandler);
|
||||
},
|
||||
beforeDestroy() {
|
||||
IMSDK.unsubscribe('uploadLogsProgress', this.uploadHandler);
|
||||
},
|
||||
methods: {
|
||||
uploadLog() {
|
||||
this.show = false
|
||||
IMSDK.asyncApi(
|
||||
'uploadLogs',
|
||||
IMSDK.uuid(),
|
||||
{
|
||||
line: this.line,
|
||||
ex: ""
|
||||
}
|
||||
)
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true,
|
||||
});
|
||||
},
|
||||
uploadHandler({
|
||||
data: { current, size },
|
||||
}) {
|
||||
console.log('uploadHandler',current,size)
|
||||
if (current >= size) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
getAppVersion() {
|
||||
plus.runtime.getProperty(
|
||||
plus.runtime.appid,
|
||||
({ version }) => (this.appVersion = version),
|
||||
);
|
||||
},
|
||||
updateCheck() {
|
||||
this.loading = true;
|
||||
uni.$emit(PageEvents.CheckForUpdate, true);
|
||||
},
|
||||
checkRespHandler() {
|
||||
this.loading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import {version } from '@/common/config'
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import {PageEvents } from "@/constant";
|
||||
import InfoItem from "../selfInfo/InfoItem.vue";
|
||||
import {checkUpgrade} from "@/api/login.js"
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
InfoItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
line: 10000,
|
||||
appversion: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getAppVersion();
|
||||
},
|
||||
mounted() {
|
||||
IMSDK.subscribe('uploadLogsProgress', this.uploadHandler);
|
||||
},
|
||||
beforeDestroy() {
|
||||
IMSDK.unsubscribe('uploadLogsProgress', this.uploadHandler);
|
||||
},
|
||||
methods: {
|
||||
uploadLog() {
|
||||
this.show = false
|
||||
IMSDK.asyncApi('uploadLogs',IMSDK.uuid(), {
|
||||
line: this.line,
|
||||
ex: ""
|
||||
})
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true,
|
||||
});
|
||||
},
|
||||
uploadHandler({data: {current,size},}) {
|
||||
console.log('uploadHandler', current, size)
|
||||
if (current >= size) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
getAppVersion() {
|
||||
let system = uni.getSystemInfoSync();
|
||||
const _this = this;
|
||||
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
|
||||
console.log(inf);
|
||||
_this.appversion = inf.version
|
||||
});
|
||||
},
|
||||
|
||||
checkRespHandler() {
|
||||
this.loading = false;
|
||||
},
|
||||
goto(url){
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
clearcache(){
|
||||
|
||||
},
|
||||
openurl(url){
|
||||
// #ifdef APP
|
||||
plus.runtime.openWeb(url)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
window.open(url);
|
||||
// #endif
|
||||
},
|
||||
// 验证是否升级
|
||||
checkUpdate() {
|
||||
this.loading = true;
|
||||
const _this = this;
|
||||
let system = uni.getSystemInfoSync();
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
||||
_this.loading = false;
|
||||
if(!res.data){
|
||||
uni.showToast({
|
||||
title:"已经是最新版本"
|
||||
})
|
||||
return ;
|
||||
}
|
||||
let skip_version = uni.getStorageSync('skip_version')
|
||||
if(res && res.version!=skip_version){
|
||||
uni.$emit('closeWebview')
|
||||
_this.setShow(_this.current, false)
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/upgrade?model=' + JSON.stringify(res),
|
||||
animationType:"fade-in"
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.logo_area {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 48rpx 0 16rpx 0;
|
||||
color: $uni-text-color;
|
||||
.logo_area {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 48rpx 0 16rpx 0;
|
||||
color: $uni-text-color;
|
||||
|
||||
image {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.check {
|
||||
margin-top: 26rpx;
|
||||
border-top: 1px #e8eaef solid;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 0;
|
||||
width: 90%;
|
||||
}
|
||||
.check {
|
||||
margin-top: 26rpx;
|
||||
border-top: 1px #e8eaef solid;
|
||||
padding: 20rpx;
|
||||
padding-bottom: 0;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.btn_row {
|
||||
padding: 0 44rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.btn_row {
|
||||
padding: 0 44rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -86,19 +86,22 @@
|
||||
});
|
||||
},
|
||||
logoutConfirm() {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid())
|
||||
.then(() => {
|
||||
uni.removeStorage({
|
||||
key: "IMToken",
|
||||
});
|
||||
uni.removeStorage({
|
||||
key: "BusinessToken",
|
||||
});
|
||||
})
|
||||
.catch((err) => console.log(err))
|
||||
.finally(() => {
|
||||
uni.$u.route("/pages/login/index");
|
||||
console.log(1)
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
|
||||
console.log(2)
|
||||
uni.removeStorage({
|
||||
key: "IMToken",
|
||||
});
|
||||
uni.removeStorage({
|
||||
key: "BusinessToken",
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(3)
|
||||
console.log(err)
|
||||
}).finally(() => {
|
||||
console.log(4)
|
||||
uni.$u.route("/pages/login/index");
|
||||
});
|
||||
},
|
||||
profileMenuClick({idx}) {
|
||||
switch (idx) {
|
||||
|
||||
@@ -1,74 +1,71 @@
|
||||
<template>
|
||||
<view @click="clickItem" class="info_item">
|
||||
<view class="left_label">
|
||||
<text>{{ title }}</text>
|
||||
</view>
|
||||
<view class="right_value">
|
||||
<slot name="value">
|
||||
<text class="content">{{ content }}</text>
|
||||
</slot>
|
||||
<u-icon
|
||||
v-if="showArrow"
|
||||
name="arrow-right"
|
||||
size="16"
|
||||
color="#999"
|
||||
></u-icon>
|
||||
</view>
|
||||
<u-loading-icon v-show="loading" class="loading_icon"></u-loading-icon>
|
||||
</view>
|
||||
<view @click="clickItem" class="info_item">
|
||||
<view class="left_label">
|
||||
<text>{{ title }}</text>
|
||||
</view>
|
||||
<view class="right_value">
|
||||
<slot name="value">
|
||||
<text class="content">{{ content }}</text>
|
||||
</slot>
|
||||
<u-icon v-if="showArrow" name="arrow-right" size="16" color="#999"></u-icon>
|
||||
</view>
|
||||
<u-loading-icon v-show="loading" class="loading_icon"></u-loading-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
title: String,
|
||||
content: String,
|
||||
showArrow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
clickItem() {
|
||||
this.$emit("click");
|
||||
},
|
||||
},
|
||||
};
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
title: String,
|
||||
content: String,
|
||||
showArrow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
clickItem() {
|
||||
this.$emit("click");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info_item {
|
||||
@include btwBox();
|
||||
height: 82rpx;
|
||||
padding: 0 44rpx;
|
||||
color: $uni-text-color;
|
||||
// border-bottom: 1px solid rgba(153,153,153,0.3);
|
||||
position: relative;
|
||||
.info_item {
|
||||
@include btwBox();
|
||||
height: 82rpx;
|
||||
padding: 0 44rpx;
|
||||
color: $uni-text-color;
|
||||
// border-bottom: 1px solid rgba(153,153,153,0.3);
|
||||
position: relative;
|
||||
|
||||
.right_value {
|
||||
@include vCenterBox();
|
||||
.content {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.u-icon {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
.right_value {
|
||||
@include vCenterBox();
|
||||
|
||||
.loading_icon {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.content {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.loading_icon {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+166
-202
@@ -1,216 +1,180 @@
|
||||
<template>
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="个人资料" />
|
||||
<view class="page_container">
|
||||
<custom-nav-bar title="个人资料" />
|
||||
|
||||
<view class="info_wrap">
|
||||
<info-item
|
||||
:loading="loadingState.faceURL"
|
||||
@click="updateAvatar"
|
||||
title="头像"
|
||||
>
|
||||
<my-avatar
|
||||
:src="selfInfo.faceURL"
|
||||
:desc="selfInfo.nickname"
|
||||
size="30"
|
||||
slot="value"
|
||||
/>
|
||||
</info-item>
|
||||
<info-item
|
||||
@click="updateNickname"
|
||||
title="姓名"
|
||||
:content="selfInfo.nickname"
|
||||
/>
|
||||
<info-item
|
||||
:loading="loadingState.gender"
|
||||
@click="updateGender"
|
||||
title="性别"
|
||||
:content="getGender"
|
||||
/>
|
||||
<info-item
|
||||
:loading="loadingState.birth"
|
||||
@click="() => (showDatePicker = true)"
|
||||
title="生日"
|
||||
:content="getBirth"
|
||||
/>
|
||||
</view>
|
||||
<view class="info_wrap">
|
||||
<info-item :loading="loadingState.faceURL" @click="updateAvatar" title="头像">
|
||||
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="30" slot="value" />
|
||||
</info-item>
|
||||
<info-item @click="updateNickname" title="姓名" :content="selfInfo.nickname" />
|
||||
<info-item :loading="loadingState.gender" @click="updateGender" title="性别" :content="getGender" />
|
||||
<info-item :loading="loadingState.birth" @click="() => (showDatePicker = true)" title="生日"
|
||||
:content="getBirth" />
|
||||
</view>
|
||||
|
||||
<view class="info_wrap">
|
||||
<info-item
|
||||
:showArrow="false"
|
||||
title="手机号码"
|
||||
:content="selfInfo.phoneNumber || '-'"
|
||||
/>
|
||||
<info-item
|
||||
:showArrow="false"
|
||||
title="邮箱"
|
||||
:content="selfInfo.email || '-'"
|
||||
/>
|
||||
</view>
|
||||
<view class="info_wrap">
|
||||
<info-item :showArrow="false" title="手机号码" :content="selfInfo.mobile || '-'" />
|
||||
<info-item :showArrow="false" title="邮箱" :content="selfInfo.email || '-'" />
|
||||
</view>
|
||||
|
||||
<u-datetime-picker
|
||||
:minDate="0"
|
||||
:maxDate="nowDate"
|
||||
:show="showDatePicker"
|
||||
@confirm="confirmDate"
|
||||
@cancel="() => (showDatePicker = false)"
|
||||
v-model="selfInfo.birth"
|
||||
mode="date"
|
||||
/>
|
||||
</view>
|
||||
<u-datetime-picker :minDate="0" :maxDate="nowDate" :show="showDatePicker" @confirm="confirmDate"
|
||||
@cancel="() => (showDatePicker = false)" v-model="selfInfo.birth" mode="date" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { businessInfoUpdate } from "@/api/login";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import dayjs from "dayjs";
|
||||
import InfoItem from "./InfoItem.vue";
|
||||
import { getPurePath } from "@/util/common";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
MyAvatar,
|
||||
InfoItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showDatePicker: false,
|
||||
loadingState: {
|
||||
faceURL: false,
|
||||
gender: false,
|
||||
birth: false,
|
||||
},
|
||||
nowDate: Date.now(),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
selfInfo() {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
},
|
||||
getGender() {
|
||||
if (this.selfInfo.gender === 0) {
|
||||
return "保密";
|
||||
}
|
||||
if (this.selfInfo.gender === 1) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
},
|
||||
getBirth() {
|
||||
const birth = this.selfInfo.birth ?? 0;
|
||||
return dayjs(birth).format("YYYY-MM-DD");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateNickname() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/markOrIDPage/index?isSelfNickname=true&sourceInfo=${JSON.stringify(
|
||||
import {
|
||||
businessInfoUpdate
|
||||
} from "@/api/login";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import dayjs from "dayjs";
|
||||
import InfoItem from "./InfoItem.vue";
|
||||
import {
|
||||
getPurePath
|
||||
} from "@/util/common";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
MyAvatar,
|
||||
InfoItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showDatePicker: false,
|
||||
loadingState: {
|
||||
faceURL: false,
|
||||
gender: false,
|
||||
birth: false,
|
||||
},
|
||||
nowDate: Date.now(),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
selfInfo() {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
},
|
||||
getGender() {
|
||||
if (this.selfInfo.sex === 0) {
|
||||
return "保密";
|
||||
}
|
||||
if (this.selfInfo.sex === 1) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
},
|
||||
getBirth() {
|
||||
console.log(this.selfInfo);
|
||||
const birth = this.selfInfo.birthday ?? 0;
|
||||
return dayjs(birth).format("YYYY-MM-DD");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateNickname() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/markOrIDPage/index?isSelfNickname=true&sourceInfo=${JSON.stringify(
|
||||
this.selfInfo,
|
||||
)}`,
|
||||
});
|
||||
},
|
||||
updateGender() {
|
||||
uni.showActionSheet({
|
||||
itemList: ["男", "女"],
|
||||
success: async ({ tapIndex }) => {
|
||||
this.loadingState.gender = true;
|
||||
await this.updateSelfInfo(
|
||||
{
|
||||
gender: tapIndex + 1,
|
||||
},
|
||||
"gender",
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
updateAvatar() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
success: async ({ tempFilePaths }) => {
|
||||
const path = tempFilePaths[0];
|
||||
const nameIdx = path.lastIndexOf("/") + 1;
|
||||
const typeIdx = path.lastIndexOf(".") + 1;
|
||||
const fileName = path.slice(nameIdx);
|
||||
const fileType = path.slice(typeIdx);
|
||||
this.loadingState.faceURL = true;
|
||||
const {
|
||||
data: { url },
|
||||
} = await IMSDK.asyncApi(IMSDK.IMMethods.UploadFile, IMSDK.uuid(), {
|
||||
filepath: getPurePath(tempFilePaths[0]),
|
||||
name: fileName,
|
||||
contentType: fileType,
|
||||
uuid: IMSDK.uuid(),
|
||||
});
|
||||
console.log(url);
|
||||
this.updateSelfInfo(
|
||||
{
|
||||
faceURL: url,
|
||||
},
|
||||
"faceURL",
|
||||
);
|
||||
this.loadingState.faceURL = false;
|
||||
},
|
||||
});
|
||||
},
|
||||
toQrCode() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userOrGroupQrCode/index`,
|
||||
});
|
||||
},
|
||||
copyID() {
|
||||
uni.setClipboardData({
|
||||
data: this.selfInfo.userID,
|
||||
success: () => {
|
||||
uni.hideToast();
|
||||
this.$nextTick(() => {
|
||||
uni.$u.toast("复制成功");
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
async updateSelfInfo(data, key) {
|
||||
try {
|
||||
await businessInfoUpdate({
|
||||
userID: this.selfInfo.userID,
|
||||
...data,
|
||||
});
|
||||
await this.$store.dispatch("user/updateBusinessInfo");
|
||||
uni.$u.toast("修改成功");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
uni.$u.toast("修改失败");
|
||||
}
|
||||
this.loadingState[key] = false;
|
||||
},
|
||||
confirmDate({ value }) {
|
||||
this.loadingState.birth = true;
|
||||
this.updateSelfInfo(
|
||||
{
|
||||
birth: value,
|
||||
},
|
||||
"birth",
|
||||
);
|
||||
this.showDatePicker = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
updateGender() {
|
||||
uni.showActionSheet({
|
||||
itemList: ['保密',"男", "女"],
|
||||
success: async ({
|
||||
tapIndex
|
||||
}) => {
|
||||
this.loadingState.gender = true;
|
||||
await this.updateSelfInfo({gender: tapIndex,},"gender",);
|
||||
},
|
||||
});
|
||||
},
|
||||
updateAvatar() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
success: async ({
|
||||
tempFilePaths
|
||||
}) => {
|
||||
const path = tempFilePaths[0];
|
||||
const nameIdx = path.lastIndexOf("/") + 1;
|
||||
const typeIdx = path.lastIndexOf(".") + 1;
|
||||
const fileName = path.slice(nameIdx);
|
||||
const fileType = path.slice(typeIdx);
|
||||
this.loadingState.faceURL = true;
|
||||
const {
|
||||
data: {
|
||||
url
|
||||
},
|
||||
} = await IMSDK.asyncApi(IMSDK.IMMethods.UploadFile, IMSDK.uuid(), {
|
||||
filepath: getPurePath(tempFilePaths[0]),
|
||||
name: fileName,
|
||||
contentType: fileType,
|
||||
uuid: IMSDK.uuid(),
|
||||
});
|
||||
console.log(url);
|
||||
this.updateSelfInfo({
|
||||
faceURL: url,
|
||||
},
|
||||
"faceURL",
|
||||
);
|
||||
this.loadingState.faceURL = false;
|
||||
},
|
||||
});
|
||||
},
|
||||
toQrCode() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userOrGroupQrCode/index`,
|
||||
});
|
||||
},
|
||||
copyID() {
|
||||
uni.setClipboardData({
|
||||
data: this.selfInfo.userID,
|
||||
success: () => {
|
||||
uni.hideToast();
|
||||
this.$nextTick(() => {
|
||||
uni.$u.toast("复制成功");
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
async updateSelfInfo(data, key) {
|
||||
try {
|
||||
console.log(data);
|
||||
await businessInfoUpdate({
|
||||
userID: this.selfInfo.userID,
|
||||
...data,
|
||||
});
|
||||
await this.$store.dispatch("user/updateBusinessInfo");
|
||||
uni.$u.toast("修改成功");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
uni.$u.toast("修改失败");
|
||||
}
|
||||
this.loadingState[key] = false;
|
||||
},
|
||||
confirmDate({value}) {
|
||||
this.loadingState.birth = true;
|
||||
this.updateSelfInfo({birth: value,},"birth",);
|
||||
this.showDatePicker = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.info_wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
.info_wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
|
||||
.qr_icon {
|
||||
width: 22px;
|
||||
height: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.qr_icon {
|
||||
width: 22px;
|
||||
height: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
+264
-25
@@ -1,31 +1,270 @@
|
||||
<template>
|
||||
<web-view :src="linkUrl"></web-view>
|
||||
<view class="content">
|
||||
<u-navbar :is-back="false" title="发现" :background="{ background: '#f4f4f5' }" title-color="#404133"
|
||||
:title-bold="true" title-size="34" :border-bottom="false" z-index="1001">
|
||||
</u-navbar>
|
||||
<view style="background-color: #FFFFFF;">
|
||||
<view>
|
||||
<u-cell-item title="" :title-style="titleStyle" :border-bottom="showBorder(0)" :border-top="false"
|
||||
@tap="linkTo(cellList[0])">
|
||||
<u-icon class="u-m-r-10" slot="icon" name="/static/image/workbench/01.png" color="inherit" :size="44"></u-icon>
|
||||
<view slot="title" class="u-flex u-row-left u-col-center" style="min-width: 200rpx;">
|
||||
<view class="u-m-r-20">
|
||||
<text>朋友圈</text>
|
||||
</view>
|
||||
<view class="u-flex u-row-center u-col-center" v-if="vuex_friendCircleUnreadCount>0"
|
||||
style="width:36rpx;height:36rpx;background-color:#fa3534;border-radius:18rpx;font-size:28rpx;color: #ffffff;">
|
||||
<text>{{vuex_friendCircleUnreadCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view slot="right-icon" v-if="newCircleInfo&&newCircleInfo.userHeadImg.length>0">
|
||||
<u-avatar :src="newCircleInfo.userHeadImg" mode="square" :size="70"></u-avatar>
|
||||
<u-badge :is-dot="true" type="error" :offset="[20,60]"></u-badge>
|
||||
</view>
|
||||
</u-cell-item>
|
||||
<u-gap :height="16" bg-color="#f4f4f5" v-if="showGap(0)"></u-gap>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-for="(item,index) in cellList" :key="index">
|
||||
<template v-if="item.hidden==false&&index!=0">
|
||||
<u-cell-item :title="item.title" :title-style="titleStyle"
|
||||
:border-bottom="showBorder(index)" :border-top="false"
|
||||
@tap="linkTo(item)">
|
||||
<u-icon :class="item.title=='购物'?'u-m-l-6 u-m-r-10':'u-m-r-10'"
|
||||
slot="icon" :name="item.icon" :color="item.color" :size="item.size"></u-icon>
|
||||
</u-cell-item>
|
||||
<u-gap :height="16" bg-color="#f4f4f5" v-if="showGap(index)"></u-gap>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
linkUrl: "",
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.linkUrl = 'https://doc.rentsoft.cn/'
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
this.$scope
|
||||
.$getAppWebview()
|
||||
.children()[0]
|
||||
.setStyle({
|
||||
top: uni.getWindowInfo().statusBarHeight,
|
||||
height: uni.getWindowInfo().safeArea.height,
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
cellList: [
|
||||
{
|
||||
id: 1,
|
||||
title: "朋友圈",
|
||||
icon: "/static/image/workbench/01.png",
|
||||
color: "inherit",
|
||||
bind: "/pages/workbench/friend-circle/friend-circle",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "扫一扫",
|
||||
//icon: "/static/image/wx/saoyisao.png",
|
||||
icon: "/static/image/workbench/04.png",
|
||||
color: "#409eff",
|
||||
bind: "scan",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "摇一摇",
|
||||
//icon: "/static/image/wx/yaoyiyao.png",
|
||||
icon: "/static/image/workbench/05.png",
|
||||
color: "#409eff",
|
||||
bind: "/pages/tabbar/find/yaoyiyao/yyy-index",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
title: "看一看",
|
||||
icon: "/static/image/workbench/06.png",
|
||||
color: "#f29100",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
title: "附近",
|
||||
icon: "/static/image/workbench/08.png",
|
||||
color: "#fab6b6",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
title: "购物",
|
||||
icon: "/static/image/workbench/09.png",
|
||||
color: "#fab6b6",
|
||||
bind: "taobao",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
title: "游戏",
|
||||
icon: "/static/image/workbench/10.png",
|
||||
color: "#fab6b6",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
title: "小程序",
|
||||
//icon: "/static/image/wx/xiaochengxu.png",
|
||||
icon: "/static/image/workbench/11.png",
|
||||
color: "#fab6b6",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
title: "ChatGpt",
|
||||
icon: "/static/image/find/chatgpt.png",
|
||||
color: "#ff9900",
|
||||
bind: "/pages/tabbar/group/chat/chat-gpt-conversion-wss",
|
||||
hidden:true,
|
||||
size:64,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
title: "AI绘画",
|
||||
icon: "http://open.yjai.art/assets/logo-9a019aa3.svg",
|
||||
color: "#ff9900",
|
||||
bind: "/pages/tabbar/find/AI/ai-text-to-create-img/ai-text-to-create-img",
|
||||
hidden:true,
|
||||
size:64,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
title: "免费听歌",
|
||||
icon: "/static/image/find/MP3.png",
|
||||
color: "#19BE6B",
|
||||
bind: "/pages/tabbar/find/music/free-music",
|
||||
hidden:true,
|
||||
size:64,
|
||||
}
|
||||
],
|
||||
titleStyle: {
|
||||
marginLeft: "20rpx",
|
||||
fontSize: "34rpx",
|
||||
color: "#000000"
|
||||
},
|
||||
newCircleInfo: {
|
||||
userHeadImg:""
|
||||
},
|
||||
};
|
||||
},
|
||||
onShow: function() {
|
||||
this.changeDefaultAvatar(1,10);
|
||||
let unreadCount= 1;//this.vuex_friendCircleUnreadCount+"";
|
||||
this.localGroupApi.setTabBarBadge(2,unreadCount);
|
||||
},
|
||||
methods: {
|
||||
changeDefaultAvatar:function(min,max){
|
||||
let that=this;
|
||||
that.$u.api.friendCircle.checkFriendCircleUpdate().then(res => {
|
||||
if(res.code==200){
|
||||
console.log("查询朋友圈更新情况",res.data);
|
||||
if(res.data&&res.data.length>0){
|
||||
that.newCircleInfo=res.data[0];
|
||||
}else{
|
||||
that.newCircleInfo=null;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
showBorder(index){
|
||||
switch (index){
|
||||
case 1:
|
||||
return true;
|
||||
case 3:
|
||||
return true;
|
||||
case 5:
|
||||
return true;
|
||||
case 8:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
showGap(index){
|
||||
switch (index){
|
||||
case 0:
|
||||
return true;
|
||||
case 2:
|
||||
return true;
|
||||
case 4:
|
||||
return true;
|
||||
case 6:
|
||||
return true;
|
||||
case 7:
|
||||
return true;
|
||||
case 9:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
linkTo(item) {
|
||||
let that = this;
|
||||
let url = item.bind;
|
||||
console.log("跳转链接", url);
|
||||
if (url != null && url.length > 0) {
|
||||
if (url == 'taobao') {
|
||||
if (plus.os.name == 'Android') {
|
||||
plus.runtime.launchApplication({
|
||||
pname: 'com.taobao.taobao'
|
||||
},
|
||||
function(e) {
|
||||
console.log('Open system default browser failed: ' + e.message);
|
||||
}
|
||||
);
|
||||
} else if (plus.os.name == 'iOS') {
|
||||
//抖音 snssdk1128://
|
||||
plus.runtime.launchApplication({
|
||||
action: 'snssdk1128://'
|
||||
}, function(e) {
|
||||
console.log('Open system default browser failed: ' + e.message);
|
||||
});
|
||||
}
|
||||
} else if (url == "scan") {
|
||||
this.globalUtil.scanQRcode(that, {
|
||||
complete: function(res) {
|
||||
console.log("扫码结果", res);
|
||||
if (res.resp_code == 1000) {
|
||||
let respData = res.resp_result;
|
||||
that.$u.route({
|
||||
url: '/pages/chat/qr-info/qr-info',
|
||||
params: {
|
||||
qrInfo: respData
|
||||
},
|
||||
animationType: 'slide-in-bottom'
|
||||
});
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
console.log("url", url);
|
||||
this.$u.route(url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss" scoped>
|
||||
.content {}
|
||||
</style>
|
||||
<style>
|
||||
page {
|
||||
background-color: #f4f4f5 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user