123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <template>
- <div class="custom" style="font-size: 14px">
- <!-- 发送联系方式 -->
- <template v-if="isCustom.businessID === CHAT_MSG_CUSTOM_TYPE.PHONE">
- <div class="phone">
- <img
- src="https://qcloudimg.tencent-cloud.cn/trisys/assets/product/images/SOOZNXCHkHcm50wX2ndp4.png"
- style="width: 50px; height: 50px; border-radius: 10px"
- />
- <div style="margin-left: 10px; line-height: 30px">
- <p>{{ isCustom.title }}</p>
- <p id="copyPhone">{{ isCustom.iphone }}</p>
- </div>
- </div>
- <div class="xian"></div>
- <div class="phone_footer">
- <span> <a :href="`tel:` + isCustom.iphone" ref="telPhone">拨号</a></span>
- <span>复制</span>
- <!-- <span @tap="PhoneChange('2', isCustom)"> 发短信</span> -->
- </div>
- </template>
- <!-- 面试邀请 -->
- <template v-else-if="isCustom.businessID === CHAT_MSG_CUSTOM_TYPE.ORDER">
- <div class="order">
- <div class="header">
- <img :src="isCustom.imageUrl" />
- <div class="main">
- <h1>您已发起面试邀请</h1>
- <span>云赋能网络信息有限公司</span>
- </div>
- </div>
- <div class="xian"></div>
- <div class="contont">
- <div>
- <p class="title">面试时间</p>
- <p class="value">{{ isCustom.interviewtime }}</p>
- </div>
- <div>
- <p class="title">面试地点</p>
- <p class="value">{{ isCustom.Interviewlocation }}</p>
- </div>
- <div>
- <p class="title">联系方式</p>
- <p class="value">{{ isCustom.name }}{{ isCustom.iphone }}</p>
- </div>
- </div>
- <div class="xian"></div>
- <div class="phone_footer">
- <span style="color: #04c4ab">信息费:4HC</span>
- <span>等待接受</span>
- <!-- <span v-else style="color: #0776eb" @click="AcceptInvitation">接受邀请</span> -->
- <!-- <span @tap="PhoneChange('2', isCustom)"> 发短信</span> -->
- </div>
- </div>
- </template>
- <template v-else>
- <span v-html="content.custom" />
- </template>
- </div>
- </template>
- <script lang="ts" setup>
- import { watchEffect, ref } from "../../../../adapter-vue";
- import { TUITranslateService, IMessageModel } from "@tencentcloud/chat-uikit-engine";
- import { isUrl, JSONToObject } from "../../../../utils/index";
- import { CHAT_MSG_CUSTOM_TYPE } from "../../../../constant";
- import { ICustomMessagePayload } from "../../../../interface";
- import Icon from "../../../common/Icon.vue";
- import star from "../../../../assets/icon/star-light.png";
- interface Props {
- messageItem: IMessageModel;
- content: any;
- }
- const props = withDefaults(defineProps<Props>(), {
- messageItem: undefined,
- content: undefined,
- });
- const userType = ref(uni.getStorageSync("userId").includes("A"));
- console.log("1123123", userType);
- const custom = ref();
- const message = ref<IMessageModel>();
- const extension = ref();
- const isCustom = ref<ICustomMessagePayload>({
- businessID: "",
- });
- const copyPhone = ref();
- const PhoneChange = (index, record) => {
- if (index == "1") {
- //拨号
- } else if (index == "2") {
- //发短信
- } else if (index == "3") {
- var text = isCustom.value.iphone;
- copyTo(text); //把要复制的内容传入到copyTo方法
- }
- };
- function copyTo(content) {
- var oInput = document.createElement("input"); //创建一个input
- oInput.value = content; //给要复制的内容赋值input的value
- document.body.appendChild(oInput); //body中添加input
- oInput.select(); // 选择对象 .select()获取文本域中的内容
- document.execCommand("Copy"); // 执行浏览器复制命令
- oInput.style.display = "none"; // 把input隐藏
- uni.showToast({
- title: "复制成功",
- });
- }
- const AcceptInvitation = () => {
- //普通用户接受邀请
- };
- watchEffect(() => {
- custom.value = props.content;
- message.value = props.messageItem;
- const { payload } = props.messageItem;
- isCustom.value = payload.data || "";
- isCustom.value = JSONToObject(payload.data);
- if (payload.data === CHAT_MSG_CUSTOM_TYPE.SERVICE) {
- extension.value = JSONToObject(payload.extension);
- }
- });
- const openLink = (url: any) => {
- window.open(url);
- };
- </script>
- <style lang="scss" scoped>
- @import "../../../../assets/styles/common";
- .phone {
- min-width: 180px;
- height: 65px;
- border-radius: 10px;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- padding: 2px;
- }
- .xian {
- width: 408rpx;
- height: 1rpx;
- background: #000000;
- opacity: 0.1;
- }
- .phone_footer {
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- position: relative;
- top: 8px;
- height: 25px;
- align-items: center;
- }
- a {
- color: #00b693;
- }
- .custom {
- font-size: 14px;
- h1 {
- font-size: 14px;
- color: #000;
- }
- h1,
- a,
- p {
- font-size: 14px;
- }
- .evaluate {
- ul {
- display: flex;
- padding: 10px 0;
- }
- &-list {
- display: flex;
- flex-direction: row;
- &-item {
- padding: 0 2px;
- }
- }
- }
- .order {
- display: flex;
- min-height: 250px;
- min-width: 215px;
- flex-direction: column;
- padding: 5px;
- .header {
- width: 100%;
- height: 55px;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .contont {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- align-items: flex-start;
- height: 190px;
- .title {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #a1a1a1;
- line-height: 44rpx;
- }
- .value {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 30rpx;
- color: #666666;
- line-height: 44rpx;
- }
- }
- .main {
- padding-left: 5px;
- width: 90%;
- line-height: 25px;
- }
- img {
- width: 45px;
- height: 45px;
- }
- }
- }
- </style>
|