diff --git a/components/my-components/my-header-card.vue b/components/my-components/my-header-card.vue index c90ed12..38a96d1 100644 --- a/components/my-components/my-header-card.vue +++ b/components/my-components/my-header-card.vue @@ -2,7 +2,9 @@ - + + + {{ options.name }} diff --git a/pageChat/chat.vue b/pageChat/chat.vue index c6023f7..77ec76f 100644 --- a/pageChat/chat.vue +++ b/pageChat/chat.vue @@ -5,7 +5,7 @@ {{ groupInfo.name }} - (22人) + ({{membersRes.user_list.length}}人) @@ -298,6 +298,7 @@ function sendImg() { } else { } } + uni.hideLoading(); }, }); } @@ -389,12 +390,19 @@ async function getMsgList() { } const options = reactive({}); +const membersRes=reactive({ + user_list:[] +}) onLoad((opt) => { Object.assign(options, opt); init(); chatApi.messageMarkReadAll({ session_ids: options.session_id, }); + chatApi.groupMembers({ group_id: options.group_id }).then((res) => { + console.log(res); + membersRes.user_list=res.user_list||[] + }) // #ifdef H5 scrollView.safeAreaHeight = uni.getSystemInfoSync().safeArea.height; // #endif @@ -468,7 +476,8 @@ function confirmCoupon() { modalData.show = false; const couponJson = JSON.parse(res.couponJson); sendMsg({ - coupon: { ...couponJson, title: modalData.form.title }, + coupon: { ...couponJson, title: modalData.form.title,activity_id:res.id }, + chat_coupon_id:res.id, msg_type: 4, }); } else { diff --git a/pageChat/components/chat-item.vue b/pageChat/components/chat-item.vue index 278a8b4..597ee94 100644 --- a/pageChat/components/chat-item.vue +++ b/pageChat/components/chat-item.vue @@ -16,7 +16,7 @@ @click="previewVideo(item.video_url)" > - 发优惠券了!数量有限!快来领取吧! + {{ item.coupon.title }} @@ -26,8 +26,8 @@ 满{{item.coupon.fullAmount}}可用 - 优惠券名称叫什么 - 有效期:2002.1.22-2022.1.22 + {{item.coupon.couponName}} + 有效期:{{ returnTime(item.coupon) }} @@ -40,6 +40,18 @@ const props = defineProps({ default: () => {}, }, }); +function previewImage(url) { + uni.previewImage({ + urls: [url], + }); +} +function returnTime(coupon){ + let startTime = coupon.useStartTime; + let endTime = coupon.useEndTime; + if(startTime && endTime){ + return startTime.split(' ')[0] + '-' + endTime.split(' ')[0] + } +}