message-custom.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div class="custom" style="font-size: 14px">
  3. <template v-if="isCustom.businessID === 'interview_consult_message'">
  4. <div class="Consultation">
  5. <div class="contont">
  6. <div>
  7. <img
  8. src="https://qianzhiy-applet.oss-rg-china-mainland.aliyuncs.com/h5/newImages/jl.png"
  9. style="width: 76rpx; height: 76rpx"
  10. />
  11. </div>
  12. <div>
  13. <span style="font-weight: 500; font-size: 32rpx; color: #333333"
  14. > {{isCustom.title}}</span
  15. >
  16. <span style="font-weight: 400; font-size: 36rpx; color: #cd2121">
  17. ¥ {{isCustom.amount}}</span
  18. >
  19. </div>
  20. </div>
  21. <div class="tips">{{ isCustom.desc }}</div>
  22. </div>
  23. </template>
  24. <!-- 发送联系方式 -->
  25. <!-- <template v-else-if="isCustom.businessID === CHAT_MSG_CUSTOM_TYPE.PHONE">
  26. <div class="phone">
  27. <img
  28. src="https://qcloudimg.tencent-cloud.cn/trisys/assets/product/images/SOOZNXCHkHcm50wX2ndp4.png"
  29. style="width: 50px; height: 50px; border-radius: 10px"
  30. />
  31. <div style="margin-left: 10px; line-height: 30px">
  32. <p>{{ isCustom.title }}</p>
  33. <p id="copyPhone">{{ isCustom.iphone }}</p>
  34. </div>
  35. </div>
  36. <div class="xian"></div>
  37. <div class="phone_footer">
  38. <span>
  39. <a :href="`tel:` + isCustom.iphone" ref="telPhone">拨号</a></span
  40. >
  41. <span>复制</span>
  42. </div>
  43. </template> -->
  44. <!-- 面试邀请 -->
  45. <template v-else-if="isCustom.businessID === 'interview_message'">
  46. <div class="order">
  47. <div class="header">
  48. <img
  49. :src="
  50. isCustom.companyLogo
  51. ? isCustom.companyLogo
  52. : 'https://oss.qianzhi-y.com/h5/images/static/my/set/my-head-ico.png'
  53. "
  54. />
  55. <div class="main">
  56. <h1>发起面试邀请</h1>
  57. <span>{{ isCustom.companyName }}</span>
  58. </div>
  59. </div>
  60. <div class="contont">
  61. <div>
  62. <p class="title">面试时间</p>
  63. <p class="value">{{ isCustom.interviewTime }}</p>
  64. </div>
  65. <div>
  66. <p class="title">面试地点</p>
  67. <p class="value">{{ isCustom.interviewAddress }}</p>
  68. </div>
  69. <div>
  70. <p class="title">联系方式</p>
  71. <p class="value">{{ isCustom.contact }}</p>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. </div>
  77. </template>
  78. <script lang="ts" setup>
  79. import { watchEffect, ref } from "../../../../adapter-vue";
  80. import {
  81. TUITranslateService,
  82. IMessageModel,
  83. } from "@tencentcloud/chat-uikit-engine";
  84. import { isUrl, JSONToObject } from "../../../../utils/index";
  85. import { CHAT_MSG_CUSTOM_TYPE } from "../../../../constant";
  86. import { ICustomMessagePayload } from "../../../../interface";
  87. import Icon from "../../../common/Icon.vue";
  88. import star from "../../../../assets/icon/star-light.png";
  89. interface Props {
  90. messageItem: IMessageModel;
  91. content: any;
  92. }
  93. const props = withDefaults(defineProps<Props>(), {
  94. messageItem: undefined,
  95. content: undefined,
  96. });
  97. const userType = ref(uni.getStorageSync("recruitUserId").includes("A"));
  98. console.log("1123123", userType);
  99. const custom = ref();
  100. const message = ref<IMessageModel>();
  101. const extension = ref();
  102. const isCustom = ref<ICustomMessagePayload>({
  103. businessID: "",
  104. });
  105. const copyPhone = ref();
  106. const PhoneChange = (index, record) => {
  107. if (index == "1") {
  108. //拨号
  109. } else if (index == "2") {
  110. //发短信
  111. } else if (index == "3") {
  112. var text = isCustom.value.iphone;
  113. copyTo(text); //把要复制的内容传入到copyTo方法
  114. }
  115. };
  116. function copyTo(content) {
  117. var oInput = document.createElement("input"); //创建一个input
  118. oInput.value = content; //给要复制的内容赋值input的value
  119. document.body.appendChild(oInput); //body中添加input
  120. oInput.select(); // 选择对象 .select()获取文本域中的内容
  121. document.execCommand("Copy"); // 执行浏览器复制命令
  122. oInput.style.display = "none"; // 把input隐藏
  123. uni.showToast({
  124. title: "复制成功",
  125. });
  126. }
  127. const AcceptInvitation = () => {
  128. //普通用户接受邀请
  129. };
  130. watchEffect(() => {
  131. custom.value = props.content;
  132. message.value = props.messageItem;
  133. const { payload } = props.messageItem;
  134. isCustom.value = payload.data || "";
  135. isCustom.value = JSONToObject(payload.data);
  136. console.log(isCustom.value)
  137. if (payload.data === CHAT_MSG_CUSTOM_TYPE.SERVICE) {
  138. extension.value = JSONToObject(payload.extension);
  139. }
  140. });
  141. const openLink = (url: any) => {
  142. window.open(url);
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. @import "../../../../assets/styles/common";
  147. .Consultation {
  148. padding: 15px 10px 15px 10px;
  149. width: 200px;
  150. height: 74px;
  151. background: linear-gradient(180deg, #ffdeb2 0%, #ffecc7 100%);
  152. border-radius: 16rpx;
  153. .contont {
  154. display: flex;
  155. flex-direction: row;
  156. align-items: center;
  157. }
  158. .tips {
  159. font-size: 12px;
  160. margin-top: 10px;
  161. color: #666666;
  162. }
  163. }
  164. ::v-deep .message-body-content {
  165. background: transparent !important;
  166. }
  167. .phone {
  168. min-width: 180px;
  169. height: 65px;
  170. border-radius: 10px;
  171. display: flex;
  172. flex-direction: row;
  173. align-items: center;
  174. justify-content: center;
  175. padding: 2px;
  176. }
  177. .xian {
  178. width: 408rpx;
  179. height: 1rpx;
  180. background: #000000;
  181. opacity: 0.1;
  182. }
  183. .phone_footer {
  184. display: flex;
  185. flex-direction: row;
  186. justify-content: space-around;
  187. position: relative;
  188. top: 8px;
  189. height: 25px;
  190. align-items: center;
  191. }
  192. a {
  193. color: #00b693;
  194. }
  195. .custom {
  196. font-size: 14px;
  197. h1 {
  198. font-size: 14px;
  199. color: #000;
  200. }
  201. h1,
  202. a,
  203. p {
  204. font-size: 14px;
  205. }
  206. .evaluate {
  207. ul {
  208. display: flex;
  209. padding: 10px 0;
  210. }
  211. &-list {
  212. display: flex;
  213. flex-direction: row;
  214. &-item {
  215. padding: 0 2px;
  216. }
  217. }
  218. }
  219. .order {
  220. display: flex;
  221. min-height: 250px;
  222. min-width: 215px;
  223. flex-direction: column;
  224. padding: 5px;
  225. .header {
  226. width: 100%;
  227. height: 55px;
  228. display: flex;
  229. flex-direction: row;
  230. justify-content: space-between;
  231. }
  232. .contont {
  233. display: flex;
  234. flex-direction: column;
  235. justify-content: space-around;
  236. align-items: flex-start;
  237. height: 190px;
  238. .title {
  239. font-family: PingFang SC;
  240. font-weight: 500;
  241. font-size: 26rpx;
  242. color: #a1a1a1;
  243. line-height: 44rpx;
  244. }
  245. .value {
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. font-size: 30rpx;
  249. color: #666666;
  250. line-height: 44rpx;
  251. }
  252. }
  253. .main {
  254. padding-left: 5px;
  255. width: 90%;
  256. line-height: 25px;
  257. }
  258. img {
  259. width: 45px;
  260. height: 45px;
  261. }
  262. }
  263. }
  264. </style>