Compare commits
No commits in common. "56eeede97ec3edd3ac38cfbdd9421cedfe6b690a" and "c9483c48c179aa3bafcacd1a3d55c9222812399d" have entirely different histories.
56eeede97e
...
c9483c48c1
@ -1,5 +1,4 @@
|
|||||||
MP_API_BASE_URL=https://ykt.youcan365.com
|
MP_API_BASE_URL=https://ykt.youcan365.com
|
||||||
MP_CACHE_PREFIX=production
|
MP_CACHE_PREFIX=production
|
||||||
MP_WX_APP_ID=wx6ee11733526b4f04
|
MP_WX_APP_ID=production
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600123876
|
||||||
MP_CORP_ID=wpLgjyawAA8N0gWmXgyJq8wpjGcOT7fg
|
|
||||||
@ -68,7 +68,6 @@ const { useLoad } = useGuard();
|
|||||||
const { account } = storeToRefs(useAccount());
|
const { account } = storeToRefs(useAccount());
|
||||||
const { memberJob, memberList: list } = useJob();
|
const { memberJob, memberList: list } = useJob();
|
||||||
const qrcode = ref('');
|
const qrcode = ref('');
|
||||||
const corpId = ref('')
|
|
||||||
|
|
||||||
const friends = computed(() => {
|
const friends = computed(() => {
|
||||||
const memberList = Array.isArray(team.value?.memberList) ? team.value.memberList : [];
|
const memberList = Array.isArray(team.value?.memberList) ? team.value.memberList : [];
|
||||||
@ -85,11 +84,11 @@ function previewImage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toFriend(userid) {
|
function toFriend(userid) {
|
||||||
uni.navigateTo({ url: `/pages/team/friend?corpId=${corpId.value}&userid=${userid}` })
|
uni.navigateTo({ url: `/pages/team/friend?corpId=${account.value?.corpId}&userid=${userid}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getQrcode(userid) {
|
async function getQrcode(userid) {
|
||||||
const res = await api('addContactWay', { corpUserId: userid, corpId: corpId.value, unionid: account.value?.openid });
|
const res = await api('addContactWay', { corpUserId: userid, corpId: account.value?.corpId, unionid: account.value?.openid });
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
qrcode.value = res.data;
|
qrcode.value = res.data;
|
||||||
}
|
}
|
||||||
@ -105,7 +104,6 @@ async function getTeam(corpId, teamId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useLoad(options => {
|
useLoad(options => {
|
||||||
corpId.value = options.corpId;
|
|
||||||
if (options.teamId && options.corpId) {
|
if (options.teamId && options.corpId) {
|
||||||
getTeam(options.corpId, options.teamId);
|
getTeam(options.corpId, options.teamId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,7 +168,9 @@ async function init() {
|
|||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
getExternalUserId(corpId.value);
|
if (!externalUserId.value) {
|
||||||
|
getExternalUserId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await getBaseForm();
|
await getBaseForm();
|
||||||
if (!customerId.value) {
|
if (!customerId.value) {
|
||||||
|
|||||||
@ -56,6 +56,9 @@ import dayjs from "dayjs";
|
|||||||
import api from "@/utils/api.js";
|
import api from "@/utils/api.js";
|
||||||
import EmptyData from "@/components/empty-data.vue";
|
import EmptyData from "@/components/empty-data.vue";
|
||||||
|
|
||||||
|
const env = __VITE_ENV__;
|
||||||
|
const defaultCorpId = env.MP_CORP_ID;
|
||||||
|
|
||||||
const corpId = ref("");
|
const corpId = ref("");
|
||||||
const enabledIds = ref([]);
|
const enabledIds = ref([]);
|
||||||
const tabs = ref([{ name: "全部", value: "" }]);
|
const tabs = ref([{ name: "全部", value: "" }]);
|
||||||
@ -258,7 +261,7 @@ function goToDetail(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
corpId.value = options?.corpId || "";
|
corpId.value = options?.corpId || defaultCorpId || "";
|
||||||
enabledIds.value = parseIdsParam(options?.ids);
|
enabledIds.value = parseIdsParam(options?.ids);
|
||||||
activeCateId.value = "";
|
activeCateId.value = "";
|
||||||
await loadEnabledArticles();
|
await loadEnabledArticles();
|
||||||
|
|||||||
@ -40,7 +40,6 @@ const articleData = ref({
|
|||||||
});
|
});
|
||||||
|
|
||||||
let articleId = "";
|
let articleId = "";
|
||||||
const corpId = ref('')
|
|
||||||
|
|
||||||
const markArticleRead = async () => {
|
const markArticleRead = async () => {
|
||||||
const unionid = account.value?.unionid;
|
const unionid = account.value?.unionid;
|
||||||
@ -48,7 +47,7 @@ const markArticleRead = async () => {
|
|||||||
try {
|
try {
|
||||||
await api(
|
await api(
|
||||||
"addArticleReadRecord",
|
"addArticleReadRecord",
|
||||||
{ corpId: corpId.value, articleId, unionid },
|
{ corpId: account.value?.corpId, articleId, unionid },
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -91,7 +90,7 @@ const loadArticle = async () => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
error.value = "";
|
error.value = "";
|
||||||
try {
|
try {
|
||||||
const res = await api("getArticle", { id: articleId, corpId: corpId.value });
|
const res = await api("getArticle", { id: articleId, corpId });
|
||||||
|
|
||||||
if (res.success && res.data) {
|
if (res.success && res.data) {
|
||||||
// 格式化日期
|
// 格式化日期
|
||||||
@ -121,7 +120,6 @@ const loadArticle = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
corpId.value = options.corpId;
|
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
articleId = options.id;
|
articleId = options.id;
|
||||||
markArticleRead();
|
markArticleRead();
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bg-gray-100 min-h-screen">
|
<view class="bg-gray-100 min-h-screen">
|
||||||
<!-- Filter Tabs -->
|
<!-- Filter Tabs -->
|
||||||
<scroll-view scroll-x class="bg-white whitespace-nowrap px-15 py-10 sticky top-0 z-10 w-full"
|
<scroll-view scroll-x class="bg-white whitespace-nowrap px-15 py-10 sticky top-0 z-10 w-full" :show-scrollbar="false">
|
||||||
:show-scrollbar="false">
|
<view
|
||||||
<view v-for="(tab, index) in tabs" :key="index"
|
v-for="(tab, index) in tabs"
|
||||||
class="inline-block px-15 py-5 mr-10 text-sm rounded-full border transition-colors" :class="[
|
:key="index"
|
||||||
activeTab === tab.value
|
class="inline-block px-15 py-5 mr-10 text-sm rounded-full border transition-colors"
|
||||||
? 'bg-orange-100 text-orange-500 border-orange-500'
|
:class="[
|
||||||
|
activeTab === tab.value
|
||||||
|
? 'bg-orange-100 text-orange-500 border-orange-500'
|
||||||
: 'bg-white text-gray-600 border-gray-200'
|
: 'bg-white text-gray-600 border-gray-200'
|
||||||
]" @click="selectTab(tab.value)">
|
]"
|
||||||
|
@click="selectTab(tab.value)"
|
||||||
|
>
|
||||||
{{ tab.name }}
|
{{ tab.name }}
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -24,12 +28,16 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else class="p-15">
|
<view v-else class="p-15">
|
||||||
<view v-for="item in articles" :key="item._id" class="bg-white rounded-lg p-15 mb-15 shadow-sm"
|
<view
|
||||||
@click="goToDetail(item)">
|
v-for="item in articles"
|
||||||
|
:key="item._id"
|
||||||
|
class="bg-white rounded-lg p-15 mb-15 shadow-sm"
|
||||||
|
@click="goToDetail(item)"
|
||||||
|
>
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<view class="flex items-start justify-between mb-10">
|
<view class="flex items-start justify-between mb-10">
|
||||||
<view class="flex items-start flex-1 mr-10 relative">
|
<view class="flex items-start flex-1 mr-10 relative">
|
||||||
<!-- Tag -->
|
<!-- Tag -->
|
||||||
<view class="text-xs text-green-600 border border-green-600 px-5 rounded mr-5 flex-shrink-0 mt-1 tag-box">
|
<view class="text-xs text-green-600 border border-green-600 px-5 rounded mr-5 flex-shrink-0 mt-1 tag-box">
|
||||||
宣教文章
|
宣教文章
|
||||||
</view>
|
</view>
|
||||||
@ -38,13 +46,16 @@
|
|||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- Status -->
|
<!-- Status -->
|
||||||
<view class="flex items-center flex-shrink-0 ml-2">
|
<view class="flex items-center flex-shrink-0 ml-2">
|
||||||
<text class="text-sm mr-2" :class="item.status === 'UNREAD' ? 'text-red-500' : 'text-gray-400'">
|
<text
|
||||||
{{ item.status === 'UNREAD' ? '未阅读' : '查看' }}
|
class="text-sm mr-2"
|
||||||
</text>
|
:class="item.status === 'UNREAD' ? 'text-red-500' : 'text-gray-400'"
|
||||||
<uni-icons type="right" size="14" :color="item.status === 'UNREAD' ? '#ef4444' : '#9ca3af'"></uni-icons>
|
>
|
||||||
|
{{ item.status === 'UNREAD' ? '未阅读' : '查看' }}
|
||||||
|
</text>
|
||||||
|
<uni-icons type="right" size="14" :color="item.status === 'UNREAD' ? '#ef4444' : '#9ca3af'"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -58,7 +69,7 @@
|
|||||||
<text class="text-gray-400 mr-2 field-label">团队:</text>
|
<text class="text-gray-400 mr-2 field-label">团队:</text>
|
||||||
<text>{{ item.team || '-' }}</text>
|
<text>{{ item.team || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<view class="text-sm text-gray-400">
|
<view class="text-sm text-gray-400">
|
||||||
发送时间: {{ item.time || '-' }}
|
发送时间: {{ item.time || '-' }}
|
||||||
@ -79,13 +90,15 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
|
import { onShow, onReachBottom } from "@dcloudio/uni-app";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import api from "@/utils/api.js";
|
import api from "@/utils/api.js";
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
import EmptyData from "@/components/empty-data.vue";
|
import EmptyData from "@/components/empty-data.vue";
|
||||||
|
|
||||||
|
const env = __VITE_ENV__;
|
||||||
|
const corpId = env.MP_CORP_ID;
|
||||||
const { account, openid } = storeToRefs(useAccountStore());
|
const { account, openid } = storeToRefs(useAccountStore());
|
||||||
|
|
||||||
const tabs = ref([{ name: "全部", value: "" }]);
|
const tabs = ref([{ name: "全部", value: "" }]);
|
||||||
@ -97,7 +110,6 @@ const page = ref(1);
|
|||||||
const pageSize = 20;
|
const pageSize = 20;
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const inited = ref(false);
|
const inited = ref(false);
|
||||||
const corpId = ref('');
|
|
||||||
|
|
||||||
const selectTab = async (customerId) => {
|
const selectTab = async (customerId) => {
|
||||||
if (activeTab.value === customerId) return;
|
if (activeTab.value === customerId) return;
|
||||||
@ -109,7 +121,7 @@ const loadCustomers = async () => {
|
|||||||
const miniAppId = openid.value || uni.getStorageSync("openid");
|
const miniAppId = openid.value || uni.getStorageSync("openid");
|
||||||
if (!miniAppId) return;
|
if (!miniAppId) return;
|
||||||
try {
|
try {
|
||||||
const res = await api("getMiniAppCustomers", { miniAppId, corpId: corpId.value });
|
const res = await api("getMiniAppCustomers", { miniAppId, corpId });
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
const list = Array.isArray(res.data) ? res.data : [];
|
const list = Array.isArray(res.data) ? res.data : [];
|
||||||
tabs.value = [
|
tabs.value = [
|
||||||
@ -156,7 +168,7 @@ const loadArticleList = async (reset = false) => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
corpId: corpId.value,
|
corpId,
|
||||||
unionid,
|
unionid,
|
||||||
miniAppId,
|
miniAppId,
|
||||||
page: page.value,
|
page: page.value,
|
||||||
@ -184,11 +196,8 @@ const loadArticleList = async (reset = false) => {
|
|||||||
|
|
||||||
function goToDetail(item) {
|
function goToDetail(item) {
|
||||||
if (!item?.articleId) return;
|
if (!item?.articleId) return;
|
||||||
uni.navigateTo({ url: `/pages/article/article-detail?id=${item.articleId}&corpId=${corpId.value}` });
|
uni.navigateTo({ url: `/pages/article/article-detail?id=${item.articleId}` });
|
||||||
}
|
}
|
||||||
onLoad(opts => {
|
|
||||||
corpId.value = opts.corpId;
|
|
||||||
})
|
|
||||||
|
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
if (!inited.value) {
|
if (!inited.value) {
|
||||||
@ -210,224 +219,70 @@ onReachBottom(() => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Utility helpers similar to Windi/Tailwind */
|
/* Utility helpers similar to Windi/Tailwind */
|
||||||
.min-h-screen {
|
.min-h-screen { min-height: 100vh; }
|
||||||
min-height: 100vh;
|
.bg-gray-100 { background-color: #f7f8fa; }
|
||||||
}
|
.bg-white { background-color: #ffffff; }
|
||||||
|
|
||||||
.bg-gray-100 {
|
.p-15 { padding: 30rpx; }
|
||||||
background-color: #f7f8fa;
|
.px-15 { padding-left: 30rpx; padding-right: 30rpx; }
|
||||||
}
|
.py-10 { padding-top: 20rpx; padding-bottom: 20rpx; }
|
||||||
|
.py-5 { padding-top: 10rpx; padding-bottom: 10rpx; }
|
||||||
|
.px-5 { padding-left: 10rpx; padding-right: 10rpx; }
|
||||||
|
|
||||||
.bg-white {
|
.mr-10 { margin-right: 20rpx; }
|
||||||
background-color: #ffffff;
|
.mr-5 { margin-right: 10rpx; }
|
||||||
}
|
.ml-2 { margin-left: 10rpx; }
|
||||||
|
.mr-2 { margin-right: 10rpx; }
|
||||||
|
.mb-15 { margin-bottom: 30rpx; }
|
||||||
|
.mb-10 { margin-bottom: 20rpx; }
|
||||||
|
.mb-5 { margin-bottom: 10rpx; }
|
||||||
|
.mt-1 { margin-top: 6rpx; }
|
||||||
|
.pb-10 { padding-bottom: 20rpx; }
|
||||||
|
|
||||||
.p-15 {
|
.flex { display: flex; }
|
||||||
padding: 30rpx;
|
.items-start { align-items: flex-start; }
|
||||||
}
|
.items-center { align-items: center; }
|
||||||
|
.justify-between { justify-content: space-between; }
|
||||||
|
.flex-1 { flex: 1; }
|
||||||
|
.flex-shrink-0 { flex-shrink: 0; }
|
||||||
|
.relative { position: relative; }
|
||||||
|
|
||||||
.px-15 {
|
.border { border-width: 1px; border-style: solid; }
|
||||||
padding-left: 30rpx;
|
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
|
||||||
padding-right: 30rpx;
|
.rounded-full { border-radius: 9999px; }
|
||||||
}
|
.rounded { border-radius: 8rpx; }
|
||||||
|
.rounded-lg { border-radius: 12rpx; }
|
||||||
|
|
||||||
.py-10 {
|
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
|
||||||
padding-top: 20rpx;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.py-5 {
|
.text-xs { font-size: 22rpx; }
|
||||||
padding-top: 10rpx;
|
.text-sm { font-size: 28rpx; }
|
||||||
padding-bottom: 10rpx;
|
.text-base { font-size: 32rpx; }
|
||||||
}
|
.font-bold { font-weight: 600; }
|
||||||
|
.leading-normal { line-height: 1.4; }
|
||||||
.px-5 {
|
|
||||||
padding-left: 10rpx;
|
|
||||||
padding-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mr-10 {
|
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mr-5 {
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ml-2 {
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mr-2 {
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb-15 {
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb-10 {
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb-5 {
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mt-1 {
|
|
||||||
margin-top: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pb-10 {
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-start {
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-center {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.justify-between {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-1 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-shrink-0 {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relative {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border {
|
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-b {
|
|
||||||
border-bottom-width: 1px;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rounded-full {
|
|
||||||
border-radius: 9999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rounded {
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rounded-lg {
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shadow-sm {
|
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-xs {
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-sm {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-base {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-bold {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leading-normal {
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Colors - Adjusting to match image roughly */
|
/* Colors - Adjusting to match image roughly */
|
||||||
.text-orange-500 {
|
.text-orange-500 { color: #f29e38; }
|
||||||
color: #f29e38;
|
.bg-orange-100 { background-color: #fff8eb; }
|
||||||
}
|
.border-orange-500 { border-color: #f29e38; }
|
||||||
|
|
||||||
.bg-orange-100 {
|
.text-gray-600 { color: #333333; }
|
||||||
background-color: #fff8eb;
|
.text-gray-500 { color: #999999; }
|
||||||
}
|
.text-gray-400 { color: #999999; }
|
||||||
|
.text-gray-800 { color: #1a1a1a; }
|
||||||
|
.border-gray-200 { border-color: #e5e5e5; }
|
||||||
|
.border-gray-100 { border-color: #f5f5f5; }
|
||||||
|
|
||||||
.border-orange-500 {
|
.text-green-600 { color: #4b8d5f; }
|
||||||
border-color: #f29e38;
|
.border-green-600 { border-color: #4b8d5f; }
|
||||||
}
|
.text-red-500 { color: #e04a4a; }
|
||||||
|
|
||||||
.text-gray-600 {
|
.sticky { position: sticky; }
|
||||||
color: #333333;
|
.top-0 { top: 0; }
|
||||||
}
|
.z-10 { z-index: 10; }
|
||||||
|
.w-full { width: 100%; }
|
||||||
.text-gray-500 {
|
.whitespace-nowrap { white-space: nowrap; }
|
||||||
color: #999999;
|
.inline-block { display: inline-block; }
|
||||||
}
|
|
||||||
|
|
||||||
.text-gray-400 {
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-gray-800 {
|
|
||||||
color: #1a1a1a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-gray-200 {
|
|
||||||
border-color: #e5e5e5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-gray-100 {
|
|
||||||
border-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-green-600 {
|
|
||||||
color: #4b8d5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-green-600 {
|
|
||||||
border-color: #4b8d5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-red-500 {
|
|
||||||
color: #e04a4a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sticky {
|
|
||||||
position: sticky;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-0 {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.z-10 {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.w-full {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.whitespace-nowrap {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inline-block {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-box {
|
.tag-box {
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
|
|||||||
@ -314,12 +314,8 @@ const closePreview = () => {
|
|||||||
const sendArticle = async (article) => {
|
const sendArticle = async (article) => {
|
||||||
try {
|
try {
|
||||||
const { globalTimChatManager } = await import("@/utils/tim-chat.js");
|
const { globalTimChatManager } = await import("@/utils/tim-chat.js");
|
||||||
|
|
||||||
if (
|
if (!globalTimChatManager || !globalTimChatManager.tim || !globalTimChatManager.isLoggedIn) {
|
||||||
!globalTimChatManager ||
|
|
||||||
!globalTimChatManager.tim ||
|
|
||||||
!globalTimChatManager.isLoggedIn
|
|
||||||
) {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "IM系统未就绪,请重试",
|
title: "IM系统未就绪,请重试",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
@ -330,9 +326,9 @@ const sendArticle = async (article) => {
|
|||||||
// 设置当前会话ID
|
// 设置当前会话ID
|
||||||
const conversationID = `GROUP${pageParams.value.groupId}`;
|
const conversationID = `GROUP${pageParams.value.groupId}`;
|
||||||
globalTimChatManager.currentConversationID = conversationID;
|
globalTimChatManager.currentConversationID = conversationID;
|
||||||
|
|
||||||
console.log("发送文章,会话ID:", conversationID);
|
console.log("发送文章,会话ID:", conversationID);
|
||||||
|
|
||||||
// 构建自定义消息数据
|
// 构建自定义消息数据
|
||||||
const customMessageData = {
|
const customMessageData = {
|
||||||
type: "article",
|
type: "article",
|
||||||
@ -341,18 +337,16 @@ const sendArticle = async (article) => {
|
|||||||
imgUrl: article.cover || "",
|
imgUrl: article.cover || "",
|
||||||
desc: "点击查看详情",
|
desc: "点击查看详情",
|
||||||
};
|
};
|
||||||
|
|
||||||
// 发送自定义消息
|
// 发送自定义消息
|
||||||
const sendResult = await globalTimChatManager.sendCustomMessage(
|
const sendResult = await globalTimChatManager.sendCustomMessage(customMessageData);
|
||||||
customMessageData
|
|
||||||
);
|
|
||||||
if (sendResult && sendResult.success) {
|
if (sendResult && sendResult.success) {
|
||||||
console.log("✓ 文章消息已发送");
|
console.log("✓ 文章消息已发送");
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "发送成功",
|
title: "发送成功",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
// 延迟返回
|
// 延迟返回
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
|
|||||||
@ -102,7 +102,7 @@ function handleItemClick(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `${item.path}?teamId=${props.teamId}&corpId=${props.corpId}`,
|
url: item.path,
|
||||||
fail: () => {
|
fail: () => {
|
||||||
toast("页面跳转失败");
|
toast("页面跳转失败");
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="bg-gray-100 min-h-screen">
|
<view class="bg-gray-100 min-h-screen">
|
||||||
<!-- Filter Tabs -->
|
<!-- Filter Tabs -->
|
||||||
<scroll-view scroll-x class="bg-white whitespace-nowrap px-15 py-10 sticky top-0 z-10 w-full"
|
<scroll-view scroll-x class="bg-white whitespace-nowrap px-15 py-10 sticky top-0 z-10 w-full" :show-scrollbar="false">
|
||||||
:show-scrollbar="false">
|
<view
|
||||||
<view v-for="(tab, index) in tabs" :key="index"
|
v-for="(tab, index) in tabs"
|
||||||
class="inline-block px-15 py-5 mr-10 text-sm rounded-full border transition-colors" :class="[
|
:key="index"
|
||||||
activeTab === tab.value
|
class="inline-block px-15 py-5 mr-10 text-sm rounded-full border transition-colors"
|
||||||
? 'bg-orange-100 text-orange-500 border-orange-500'
|
:class="[
|
||||||
|
activeTab === tab.value
|
||||||
|
? 'bg-orange-100 text-orange-500 border-orange-500'
|
||||||
: 'bg-white text-gray-600 border-gray-200'
|
: 'bg-white text-gray-600 border-gray-200'
|
||||||
]" @click="selectTab(tab.value)">
|
]"
|
||||||
|
@click="selectTab(tab.value)"
|
||||||
|
>
|
||||||
{{ tab.name }}
|
{{ tab.name }}
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -24,12 +28,16 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else class="p-15">
|
<view v-else class="p-15">
|
||||||
<view v-for="item in surveys" :key="item._id" class="bg-white rounded-lg p-15 mb-15 shadow-sm"
|
<view
|
||||||
@click="goToDetail(item)">
|
v-for="item in surveys"
|
||||||
|
:key="item._id"
|
||||||
|
class="bg-white rounded-lg p-15 mb-15 shadow-sm"
|
||||||
|
@click="goToDetail(item)"
|
||||||
|
>
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<view class="flex items-start justify-between mb-10">
|
<view class="flex items-start justify-between mb-10">
|
||||||
<view class="flex items-start flex-1 mr-10 relative">
|
<view class="flex items-start flex-1 mr-10 relative">
|
||||||
<!-- Tag -->
|
<!-- Tag -->
|
||||||
<view class="text-xs text-green-600 border border-green-600 px-5 rounded mr-5 flex-shrink-0 mt-1 tag-box">
|
<view class="text-xs text-green-600 border border-green-600 px-5 rounded mr-5 flex-shrink-0 mt-1 tag-box">
|
||||||
问卷调查
|
问卷调查
|
||||||
</view>
|
</view>
|
||||||
@ -38,7 +46,7 @@
|
|||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- Status (暂不展示未填写/已填写) -->
|
<!-- Status (暂不展示未填写/已填写) -->
|
||||||
<view class="flex items-center flex-shrink-0 ml-2">
|
<view class="flex items-center flex-shrink-0 ml-2">
|
||||||
<text class="text-sm mr-2 text-gray-400">查看</text>
|
<text class="text-sm mr-2 text-gray-400">查看</text>
|
||||||
@ -56,7 +64,7 @@
|
|||||||
<text class="text-gray-400 mr-2 field-label">团队:</text>
|
<text class="text-gray-400 mr-2 field-label">团队:</text>
|
||||||
<text>{{ item.team || '-' }}</text>
|
<text>{{ item.team || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<view class="text-sm text-gray-400">
|
<view class="text-sm text-gray-400">
|
||||||
发送时间: {{ item.time || '-' }}
|
发送时间: {{ item.time || '-' }}
|
||||||
@ -77,19 +85,19 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
|
import { onShow, onReachBottom } from "@dcloudio/uni-app";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import api from "@/utils/api.js";
|
import api from "@/utils/api.js";
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
import EmptyData from "@/components/empty-data.vue";
|
import EmptyData from "@/components/empty-data.vue";
|
||||||
|
|
||||||
|
const env = __VITE_ENV__;
|
||||||
|
const corpId = env.MP_CORP_ID;
|
||||||
const { openid } = storeToRefs(useAccountStore());
|
const { openid } = storeToRefs(useAccountStore());
|
||||||
|
|
||||||
const tabs = ref([{ name: "全部", value: "" }]);
|
const tabs = ref([{ name: "全部", value: "" }]);
|
||||||
const activeTab = ref("");
|
const activeTab = ref("");
|
||||||
const corpId = ref('')
|
|
||||||
|
|
||||||
const surveys = ref([]);
|
const surveys = ref([]);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
@ -108,7 +116,7 @@ const loadCustomers = async () => {
|
|||||||
const miniAppId = openid.value || uni.getStorageSync("openid");
|
const miniAppId = openid.value || uni.getStorageSync("openid");
|
||||||
if (!miniAppId) return;
|
if (!miniAppId) return;
|
||||||
try {
|
try {
|
||||||
const res = await api("getMiniAppCustomers", { miniAppId, corpId: corpId.value });
|
const res = await api("getMiniAppCustomers", { miniAppId, corpId });
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
const list = Array.isArray(res.data) ? res.data : [];
|
const list = Array.isArray(res.data) ? res.data : [];
|
||||||
tabs.value = [
|
tabs.value = [
|
||||||
@ -154,7 +162,7 @@ const loadSurveyList = async (reset = false) => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
corpId: corpId.value,
|
corpId,
|
||||||
miniAppId,
|
miniAppId,
|
||||||
page: page.value,
|
page: page.value,
|
||||||
pageSize,
|
pageSize,
|
||||||
@ -183,11 +191,6 @@ function goToDetail() {
|
|||||||
uni.showToast({ title: "详情暂未接入", icon: "none" });
|
uni.showToast({ title: "详情暂未接入", icon: "none" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onLoad(opts => {
|
|
||||||
corpId.value = opts.corpId
|
|
||||||
})
|
|
||||||
|
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
if (!inited.value) {
|
if (!inited.value) {
|
||||||
await loadCustomers();
|
await loadCustomers();
|
||||||
@ -208,224 +211,70 @@ onReachBottom(() => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Utility helpers similar to Windi/Tailwind */
|
/* Utility helpers similar to Windi/Tailwind */
|
||||||
.min-h-screen {
|
.min-h-screen { min-height: 100vh; }
|
||||||
min-height: 100vh;
|
.bg-gray-100 { background-color: #f7f8fa; }
|
||||||
}
|
.bg-white { background-color: #ffffff; }
|
||||||
|
|
||||||
.bg-gray-100 {
|
.p-15 { padding: 30rpx; }
|
||||||
background-color: #f7f8fa;
|
.px-15 { padding-left: 30rpx; padding-right: 30rpx; }
|
||||||
}
|
.py-10 { padding-top: 20rpx; padding-bottom: 20rpx; }
|
||||||
|
.py-5 { padding-top: 10rpx; padding-bottom: 10rpx; }
|
||||||
|
.px-5 { padding-left: 10rpx; padding-right: 10rpx; }
|
||||||
|
|
||||||
.bg-white {
|
.mr-10 { margin-right: 20rpx; }
|
||||||
background-color: #ffffff;
|
.mr-5 { margin-right: 10rpx; }
|
||||||
}
|
.ml-2 { margin-left: 10rpx; }
|
||||||
|
.mr-2 { margin-right: 10rpx; }
|
||||||
|
.mb-15 { margin-bottom: 30rpx; }
|
||||||
|
.mb-10 { margin-bottom: 20rpx; }
|
||||||
|
.mb-5 { margin-bottom: 10rpx; }
|
||||||
|
.mt-1 { margin-top: 6rpx; }
|
||||||
|
.pb-10 { padding-bottom: 20rpx; }
|
||||||
|
|
||||||
.p-15 {
|
.flex { display: flex; }
|
||||||
padding: 30rpx;
|
.items-start { align-items: flex-start; }
|
||||||
}
|
.items-center { align-items: center; }
|
||||||
|
.justify-between { justify-content: space-between; }
|
||||||
|
.flex-1 { flex: 1; }
|
||||||
|
.flex-shrink-0 { flex-shrink: 0; }
|
||||||
|
.relative { position: relative; }
|
||||||
|
|
||||||
.px-15 {
|
.border { border-width: 1px; border-style: solid; }
|
||||||
padding-left: 30rpx;
|
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
|
||||||
padding-right: 30rpx;
|
.rounded-full { border-radius: 9999px; }
|
||||||
}
|
.rounded { border-radius: 8rpx; }
|
||||||
|
.rounded-lg { border-radius: 12rpx; }
|
||||||
|
|
||||||
.py-10 {
|
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
|
||||||
padding-top: 20rpx;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.py-5 {
|
.text-xs { font-size: 22rpx; }
|
||||||
padding-top: 10rpx;
|
.text-sm { font-size: 28rpx; }
|
||||||
padding-bottom: 10rpx;
|
.text-base { font-size: 32rpx; }
|
||||||
}
|
.font-bold { font-weight: 600; }
|
||||||
|
.leading-normal { line-height: 1.4; }
|
||||||
.px-5 {
|
|
||||||
padding-left: 10rpx;
|
|
||||||
padding-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mr-10 {
|
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mr-5 {
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ml-2 {
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mr-2 {
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb-15 {
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb-10 {
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mb-5 {
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mt-1 {
|
|
||||||
margin-top: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pb-10 {
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-start {
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-center {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.justify-between {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-1 {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-shrink-0 {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relative {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border {
|
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-b {
|
|
||||||
border-bottom-width: 1px;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rounded-full {
|
|
||||||
border-radius: 9999px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rounded {
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rounded-lg {
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shadow-sm {
|
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-xs {
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-sm {
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-base {
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.font-bold {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leading-normal {
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Colors - Adjusting to match image roughly */
|
/* Colors - Adjusting to match image roughly */
|
||||||
.text-orange-500 {
|
.text-orange-500 { color: #f29e38; }
|
||||||
color: #f29e38;
|
.bg-orange-100 { background-color: #fff8eb; }
|
||||||
}
|
.border-orange-500 { border-color: #f29e38; }
|
||||||
|
|
||||||
.bg-orange-100 {
|
.text-gray-600 { color: #333333; }
|
||||||
background-color: #fff8eb;
|
.text-gray-500 { color: #999999; }
|
||||||
}
|
.text-gray-400 { color: #999999; }
|
||||||
|
.text-gray-800 { color: #1a1a1a; }
|
||||||
|
.border-gray-200 { border-color: #e5e5e5; }
|
||||||
|
.border-gray-100 { border-color: #f5f5f5; }
|
||||||
|
|
||||||
.border-orange-500 {
|
.text-green-600 { color: #4b8d5f; }
|
||||||
border-color: #f29e38;
|
.border-green-600 { border-color: #4b8d5f; }
|
||||||
}
|
.text-red-500 { color: #e04a4a; }
|
||||||
|
|
||||||
.text-gray-600 {
|
.sticky { position: sticky; }
|
||||||
color: #333333;
|
.top-0 { top: 0; }
|
||||||
}
|
.z-10 { z-index: 10; }
|
||||||
|
.w-full { width: 100%; }
|
||||||
.text-gray-500 {
|
.whitespace-nowrap { white-space: nowrap; }
|
||||||
color: #999999;
|
.inline-block { display: inline-block; }
|
||||||
}
|
|
||||||
|
|
||||||
.text-gray-400 {
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-gray-800 {
|
|
||||||
color: #1a1a1a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-gray-200 {
|
|
||||||
border-color: #e5e5e5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-gray-100 {
|
|
||||||
border-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-green-600 {
|
|
||||||
color: #4b8d5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-green-600 {
|
|
||||||
border-color: #4b8d5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-red-500 {
|
|
||||||
color: #e04a4a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sticky {
|
|
||||||
position: sticky;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-0 {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.z-10 {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.w-full {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.whitespace-nowrap {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inline-block {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-box {
|
.tag-box {
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
|
|||||||
@ -105,9 +105,12 @@ export default defineStore("accountStore", () => {
|
|||||||
uni.removeStorageSync('openid');
|
uni.removeStorageSync('openid');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getExternalUserId(corpId) {
|
async function getExternalUserId() {
|
||||||
|
const corpId = account.value?.corpId;
|
||||||
const unionid = account.value?.unionid;
|
const unionid = account.value?.unionid;
|
||||||
const openid = account.value?.openid;
|
const openid = account.value?.openid;
|
||||||
|
console.clear()
|
||||||
|
console.log('corpId', corpId, ',unionid', unionid, ',openid', openid)
|
||||||
if (!(corpId && unionid && openid) || externalUserId.value) return;
|
if (!(corpId && unionid && openid) || externalUserId.value) return;
|
||||||
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false);
|
const res = await api('getUnionidToExternalUserid', { unionid, openid, corpId }, false);
|
||||||
if (res && res.success && typeof res.data === 'string' && res.data.trim()) {
|
if (res && res.success && typeof res.data === 'string' && res.data.trim()) {
|
||||||
@ -115,5 +118,9 @@ export default defineStore("accountStore", () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(account, n => {
|
||||||
|
getExternalUserId()
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
return { account, login, initIMAfterLogin, logout, openid, isIMInitialized, externalUserId, getExternalUserId }
|
return { account, login, initIMAfterLogin, logout, openid, isIMInitialized, externalUserId, getExternalUserId }
|
||||||
})
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user