index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. <template>
  2. <view class="content" :style="{paddingBottom: paddingBottom}">
  3. <view class="item" v-for="(item, index) in json" :class="item.classText.join(' ')" @click="click(item, 0)">
  4. <p v-if="item.type === 'h5-text'" :style="item.style">{{ item.content }}</p>
  5. <img :ref="'myImage' + index" @load="handleImageLoad(index, item)" v-if="item.type === 'h5-image'" :src="item.url"/>
  6. <view class="image-child" v-if="item.type === 'h5-image'"></view>
  7. <div v-if="item.type === 'h5-sep'" :class="item.classText.join(' ')"></div>
  8. <div class="countdown2-box"
  9. :style="{ backgroundImage: item.bgImage && item.bgImage !== '#' ? `url(${item.bgImage})` : '' }"
  10. v-if="item.type==='h5-countdown'"
  11. >
  12. 距结束<span id="days" :style="{background: item.mainColor}">{{ item.days }}</span>天
  13. <span id="hours" :style="{background: item.mainColor}">{{ item.hours }}</span>时
  14. <span id="minutes" :style="{background: item.mainColor}">{{ item.minutes }}</span>分
  15. <span id="seconds" :style="{background: item.mainColor}">{{ item.seconds }}</span>秒
  16. </div>
  17. <div :class="item.classText.join(' ')" v-if="item.type==='h5-chat'">
  18. <div class="chat-container">
  19. <div class="chat-messages">
  20. <!-- Messages -->
  21. <div v-for="(message, index) in item.messages" :key="index"
  22. :class="['message-wrapper', message.sender === 'user' ? 'user-message' : 'agent-message']"
  23. >
  24. <div class="avatar">
  25. <img :src="message.sender === 'user' ? userAvatar : getAgentAvatar(item)" alt="Avatar"/>
  26. </div>
  27. <div class="message-content">
  28. <div v-if="message.text" class="message-text" v-html="message.text"></div>
  29. <!-- Options buttons -->
  30. <div v-if="message.options && message.options.length > 0 && !message.click" class="options-container">
  31. <button
  32. v-for="(option, optIndex) in message.options"
  33. :key="optIndex"
  34. :style="{color: item.style.btnTextColor,backgroundColor: item.style.buttonColor}"
  35. class="option-button"
  36. :class="{ 'selected': isOptionSelected(message.id, option) }"
  37. @click="selectOption(message, option)"
  38. v-once
  39. >
  40. {{ option.text }}
  41. </button>
  42. </div>
  43. </div>
  44. </div>
  45. <img v-if="item.showButton" :ref="'addButton' + index" @load="handleImageLoad2(index, item)" :style="item.addWxButtonStyle" :src="item.addWxButtonImg" @click.stop="click(item, 1)" style="width: 100%;" />
  46. </div>
  47. </div>
  48. </div>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. // 引入Clipboard
  54. import {getTemplateByNo, getTemplateById, baiduClickCallback, callback, youkuClickCallback, iqiyiClickCallback, dyClickCallback} from '../../api/api.js'
  55. import agentAvatar from '../../static/customer.png'
  56. import userAvatar from '../../static/profile.png'
  57. export default {
  58. data() {
  59. return {
  60. userAvatar: userAvatar, // Placeholder for user avatar
  61. agentAvatar: agentAvatar,
  62. images: [],
  63. params: {},
  64. site: {},
  65. data: {},
  66. json: [],
  67. vid: '',
  68. click_id: '',
  69. aid: '',
  70. id: null,
  71. no: null,
  72. type: 0,
  73. show: false,
  74. name: '',
  75. url: "",
  76. tel: '',
  77. accountId: '',
  78. ip: '',
  79. paddingBottom: 0,
  80. order_plan_id: '',
  81. creative_id: '',
  82. impress_id: '',
  83. sign: '',
  84. isProcessing: false // 防止按钮重复点击
  85. }
  86. },
  87. mounted() {
  88. window.vueInstance = this // 将 Vue 实例暴露到全局
  89. },
  90. onLoad(option) {
  91. this.url = window.location.href;
  92. this.params = option;
  93. this.no = this.params.no;
  94. this.id = this.params.tid;
  95. if ((this.id == null || this.id == '' || this.id == undefined) && (this.no == null || this.no == '' || this.no == undefined)) {
  96. uni.showToast({
  97. icon: 'none',
  98. title: '推广链接错误'
  99. })
  100. return
  101. }
  102. this.accountId = this.params.accountId;
  103. this.type = this.params.type;
  104. this.no = this.params.no;
  105. if (this.id) {
  106. getTemplateById(this.id).then(e => {
  107. this.data = e.data;
  108. this.site = e.site;
  109. this.type = e.site.type;
  110. this.json = JSON.parse(e.data.json)
  111. }).finally(() => {
  112. this.setData();
  113. })
  114. } else if (this.no) {
  115. getTemplateByNo(this.no).then(e => {
  116. this.data = e.data;
  117. this.json = JSON.parse(e.data.json)
  118. }).finally(() => {
  119. this.setData();
  120. })
  121. }
  122. },
  123. beforeDestroy() {
  124. this.json.filter(e => e.type === 'h5-countdown').forEach(item => {
  125. if (item.intervalId) {
  126. clearInterval(item.intervalId)
  127. }
  128. })
  129. },
  130. methods: {
  131. setData() {
  132. // 百度
  133. if (this.type == 0) {
  134. this.vid = this.params.bd_vid;
  135. }
  136. // 优酷
  137. if (this.type == 1) {
  138. this.vid = this.params.bd_vid;
  139. this.aid = this.params.aid;
  140. this.click_id = this.params.click_id;
  141. this.ip = this.params.ip;
  142. }
  143. // 爱奇艺
  144. if (this.type == 2) {
  145. this.order_plan_id = this.params.order_plan_id;
  146. this.creative_id = this.params.creative_id;
  147. this.impress_id = this.params.impress_id;
  148. this.sign = this.params.sign;
  149. }
  150. // 巨量(抖音)
  151. if (this.type == 3) {
  152. this.click_id = this.params.clickid;
  153. this.creative_id = this.params.creativeid;
  154. this.vid = this.params.adid;
  155. }
  156. console.info(this.params.adid)
  157. this.loadCountdownData();
  158. this.loadChatMessage();
  159. },
  160. getChatMsgIdMax() {
  161. let h5ChatItem = this.json.filter(e => e.type === 'h5-chat')[0]
  162. let maxId = Math.max(0, ...h5ChatItem.messages.map(e => e.id))
  163. return maxId + 1
  164. },
  165. // 聊天组件选择了选项
  166. async selectOption(message, option) {
  167. try{
  168. if(this.isProcessing){
  169. return;
  170. }
  171. this.isProcessing = true;
  172. let h5ChatItem = this.json.filter(e => e.type === 'h5-chat')[0]
  173. // 防止重复点击
  174. if(message.handle){
  175. return;
  176. } else {
  177. message.handle = true;
  178. }
  179. if (!h5ChatItem) {
  180. console.error("未找到类型为 'h5-chat' 的元素");
  181. return;
  182. }
  183. //2025-8-14 新增需求是否为立即结束聊天的选择
  184. if(!!option.endChatOption){
  185. await this.delay(1000);
  186. let endMsg = {
  187. id:-1,
  188. text:!!option.endChatMsg?option.endChatMsg:"默认结束聊天了"
  189. }
  190. h5ChatItem.messages.push(endMsg);
  191. return;
  192. }
  193. // 如果有答案就直接用户消息和客服消息
  194. let nextMsg = h5ChatItem.agentMsg.shift();
  195. message.click = true;
  196. h5ChatItem.messages.push({
  197. id: this.getChatMsgIdMax(),
  198. sender: 'user',
  199. text: option.text,
  200. options: []
  201. })
  202. await this.delay(1000);
  203. if (option.answer) {
  204. h5ChatItem.messages.push({
  205. id: this.getChatMsgIdMax(),
  206. sender: 'agent',
  207. text: option.answer,
  208. options: []
  209. })
  210. }
  211. await this.delay(1000);
  212. // 不管有没有 answer,都添加 nextMsg(如果存在)
  213. if (nextMsg) {
  214. h5ChatItem.messages.push(nextMsg);
  215. if(nextMsg.options){
  216. return;
  217. }
  218. }
  219. while (h5ChatItem.agentMsg.length > 0) {
  220. nextMsg = h5ChatItem.agentMsg.shift();
  221. if (nextMsg && (!nextMsg.options || nextMsg.options.length === 0)) {
  222. await this.delay(500 + (Math.random() * 1000) % 500);
  223. h5ChatItem.messages.push(nextMsg);
  224. } else {
  225. //重新放回去
  226. if(nextMsg){
  227. h5ChatItem.agentMsg.unshift(nextMsg);
  228. }
  229. break;
  230. }
  231. }
  232. if (h5ChatItem.agentMsg.length === 0) {
  233. await this.delay(200);
  234. if(h5ChatItem.addWxFun){
  235. //显示加微按钮
  236. h5ChatItem.showButton = true;
  237. }
  238. h5ChatItem.messages.push({
  239. id: this.getChatMsgIdMax(),
  240. sender: 'agent',
  241. text: h5ChatItem.lastMsg.map(e => {
  242. if(e.type == 0) return e.text;
  243. if(e.type == 1) return "<span style='color: red'>"+ e.text +"</span>";
  244. }).join(""),
  245. options: []
  246. });
  247. }
  248. }catch (err) {
  249. console.error(err);
  250. }finally {
  251. this.isProcessing = false;
  252. }
  253. },
  254. // 辅助函数:延迟
  255. delay(ms) {
  256. return new Promise(resolve => setTimeout(resolve, ms));
  257. },
  258. // 加载计时器数据
  259. loadCountdownData() {
  260. let countdownItems = this.json.filter(e => e.type === 'h5-countdown')
  261. countdownItems.forEach(item => {
  262. // 为每个item启动一个定时器
  263. this.startCountdown(item)
  264. })
  265. },
  266. // 加载聊天组件的消息
  267. async loadChatMessage() {
  268. let h5ChatItem = this.json.filter(e => e.type === 'h5-chat')[0]
  269. if(!h5ChatItem) return;
  270. h5ChatItem.messages = []
  271. // 先输出所有的欢迎信息,欢迎信息为没有options的数据,以及后面一条数据
  272. let isOutputWelcome = 0;
  273. while (h5ChatItem.agentMsg.length > 0) {
  274. let msg = h5ChatItem.agentMsg.shift()
  275. if (!msg.options || msg.options.length === 0) {
  276. isOutputWelcome = 1
  277. await this.delay(1000)
  278. h5ChatItem.messages.push(msg)
  279. } else {
  280. if ((isOutputWelcome === 1) || (isOutputWelcome === 0)) {
  281. isOutputWelcome = 2
  282. await this.delay(2000)
  283. h5ChatItem.messages.push(msg)
  284. break;
  285. }
  286. }
  287. }
  288. if (h5ChatItem.agentMsg.length === 0) {
  289. await this.delay(1000);
  290. h5ChatItem.messages.push({
  291. id: this.getChatMsgIdMax(),
  292. sender: 'agent',
  293. text: "好的,已经为您分配专业老师。<span style='color:red'>【点击下方按钮】</span>添加老师,获取免费上课链接。!",
  294. options: []
  295. });
  296. }
  297. },
  298. startCountdown(item) {
  299. if (!item.active) {
  300. return
  301. }
  302. let intervalId = setInterval(() => {
  303. let timeLeft
  304. if (item.countdownMode == '1') {
  305. // 模式1:now() - endDateTime 的时间差
  306. timeLeft = this.calculateTimePassed(item)
  307. } else if (item.countdownMode == '2') {
  308. // 模式2:timeDisplay 分钟数倒计时
  309. timeLeft = this.calculateTimeLeftFromDisplay(item)
  310. }
  311. // 不再有 total <= 0 的判断, 因为模式1是不断增加的
  312. item.days = timeLeft.days
  313. item.hours = timeLeft.hours
  314. item.minutes = timeLeft.minutes
  315. item.seconds = timeLeft.seconds
  316. }, 1000)
  317. item.intervalId = intervalId // 存储 intervalId
  318. },
  319. calculateTimePassed(item) {
  320. // 如果已经结束,直接返回
  321. if (item.isFinished) {
  322. return {
  323. days: 0,
  324. hours: 0,
  325. minutes: 0,
  326. seconds: 0
  327. }
  328. }
  329. let endTime = new Date(item.endDateTime)
  330. let now = new Date()
  331. let diff = endTime.getTime() - now.getTime() // 毫秒差, end - now
  332. if (diff <= 0) {
  333. // 如果 endDateTime 比当前时间晚, 则显示 0
  334. clearInterval(item.intervalId)
  335. item.intervalId = null
  336. item.isFinished = true
  337. return {
  338. days: 0,
  339. hours: 0,
  340. minutes: 0,
  341. seconds: 0
  342. }
  343. }
  344. return this.millisecondsToTimeObject(diff)
  345. },
  346. calculateTimeLeftFromDisplay(item) {
  347. if (!item.startTime) {
  348. item.startTime = Date.now() // 记录开始时间
  349. }
  350. let totalSeconds = item.timeDisplay * 60 // timeDisplay 是分钟数
  351. let passedSeconds = Math.floor((Date.now() - item.startTime) / 1000)
  352. let timeLeft = totalSeconds - passedSeconds
  353. if (timeLeft <= 0) {
  354. clearInterval(item.intervalId)
  355. item.intervalId = null//清除id
  356. return {
  357. days: 0,
  358. hours: 0,
  359. minutes: 0,
  360. seconds: 0
  361. }
  362. }
  363. return this.secondsToTimeObject(timeLeft)
  364. },
  365. millisecondsToTimeObject(milliseconds) {
  366. let totalSeconds = Math.floor(milliseconds / 1000)
  367. return this.secondsToTimeObject(totalSeconds)
  368. },
  369. secondsToTimeObject(totalSeconds) {
  370. let days = Math.floor(totalSeconds / (3600 * 24))
  371. let hours = Math.floor((totalSeconds % (3600 * 24)) / 3600)
  372. let minutes = Math.floor((totalSeconds % 3600) / 60)
  373. let seconds = Math.floor(totalSeconds % 60)
  374. return {
  375. days: days,
  376. hours: hours,
  377. minutes: minutes,
  378. seconds: seconds
  379. }
  380. },
  381. getAgentAvatar(item) {
  382. console.log(item.style.avatar)
  383. if (item.style.avatar) {
  384. return item.style.avatar
  385. }
  386. return this.agentAvatar
  387. },
  388. isOptionSelected(messageId, option) {
  389. let messages = this.json.find(t => t.type === 'h5-chat').messages
  390. const message = messages.find(m => m.id === messageId)
  391. return message && message.userSelection && message.userSelection.id === option.id
  392. },
  393. handleImageLoad(index, item) {
  394. if (item.classText.indexOf("footer") != -1) {
  395. const imgElement = this.$refs["myImage" + index];
  396. // 获取真实高度(包含以下两种方式)
  397. const naturalHeight = imgElement[0].naturalHeight; // 原始高度
  398. const clientHeight = imgElement[0].clientHeight; // 渲染高度
  399. this.paddingBottom = clientHeight + "px";
  400. }
  401. },
  402. handleImageLoad2(index, item) {
  403. const imgElement = this.$refs["addButton" + index][0]; // 获取图片 DOM 元素
  404. // 1. 获取图片原始宽高
  405. const naturalWidth = imgElement.naturalWidth;
  406. const naturalHeight = imgElement.naturalHeight;
  407. // 2. 获取容器尺寸(假设容器是图片的父元素)
  408. const container = imgElement.parentElement;
  409. const containerWidth = container.clientWidth;
  410. const containerHeight = container.clientHeight;
  411. // 3. 计算缩放后的宽高(保持比例)
  412. const imageAspectRatio = naturalWidth / naturalHeight; // 原始宽高比
  413. const containerAspectRatio = containerWidth / containerHeight; // 容器宽高比
  414. let targetWidth, targetHeight;
  415. // 根据容器宽高比决定以哪一边为基准缩放
  416. if (containerAspectRatio > imageAspectRatio) {
  417. // 容器更宽,以高度为基准
  418. targetHeight = containerHeight;
  419. targetWidth = targetHeight * imageAspectRatio;
  420. } else {
  421. // 容器更高,以宽度为基准
  422. targetWidth = containerWidth;
  423. targetHeight = targetWidth / imageAspectRatio;
  424. }
  425. // 4. 应用缩放后的尺寸
  426. imgElement.style.width = `${targetWidth - 16}px`;
  427. imgElement.style.height = `${targetHeight}px`;
  428. },
  429. confirm() {
  430. this.show = false
  431. },
  432. clickToWx(workUrl) {
  433. if(this.site && this.site.workUrl != null && this.site.workUrl != undefined && this.site.workUrl != ''){
  434. workUrl = this.site.workUrl;
  435. }
  436. // 百度
  437. if (this.type == 0) {
  438. let data = {
  439. id: this.id,
  440. url: window.location.href,
  441. vid: this.vid,
  442. clickType: 79,
  443. };
  444. baiduClickCallback(data).then(e => {
  445. window.location.href = workUrl + "?customer_channel=" + this.vid;
  446. })
  447. }
  448. // 优酷
  449. if (this.type == 1) {
  450. let data = {
  451. id: this.id,
  452. url: window.location.href,
  453. vid: this.vid,
  454. aid: this.aid,
  455. clickId: this.click_id,
  456. ip: this.ip,
  457. clickType: "wechat"
  458. };
  459. youkuClickCallback(data).then(e => {
  460. window.location.href = workUrl + "?customer_channel=" + this.vid;
  461. })
  462. }
  463. // 爱奇艺
  464. if (this.type == 2) {
  465. if (this.id) {
  466. let data = {
  467. url: window.location.href,
  468. id: this.id,
  469. planId: this.order_plan_id,
  470. creativeId: this.creative_id,
  471. vid: this.impress_id,
  472. sign: this.sign,
  473. clickType: "200"
  474. };
  475. iqiyiClickCallback(data).then(e => {
  476. window.location.href = workUrl + "?customer_channel=" + this.impress_id;
  477. })
  478. } else {
  479. let data = {
  480. accountId: this.accountId,
  481. url: window.location.href,
  482. no: this.no,
  483. planId: this.order_plan_id,
  484. creativeId: this.creative_id,
  485. vid: this.impress_id,
  486. sign: this.sign,
  487. clickType: "200"
  488. };
  489. dyClickCallback(data).then(e => {
  490. window.location.href = workUrl + "?customer_channel=" + this.impress_id;
  491. })
  492. }
  493. }
  494. // 爱奇艺
  495. if (this.type == 3) {
  496. let data = {
  497. url: window.location.href,
  498. id: this.id,
  499. clickId: this.click_id,
  500. creativeId: this.creative_id,
  501. vid:this.vid
  502. };
  503. dyClickCallback(data).then(e => {
  504. window.location.href = workUrl + "?customer_channel=" + this.vid;
  505. })
  506. }
  507. if (this.type == 99) {
  508. window.location.href = workUrl + "?customer_channel=" + '{"siteId":'+this.id+'}';
  509. }
  510. },
  511. click(item, type) {
  512. if(type == 0){
  513. console.info(item)
  514. if (!item.addWxFun || item.type === "h5-chat") {
  515. return
  516. }
  517. this.clickToWx(item.workUrl)
  518. }else{
  519. this.clickToWx(item.workUrl)
  520. }
  521. }
  522. }
  523. }
  524. </script>
  525. <style lang="scss" scoped>
  526. .chat-container {
  527. width: 100%;
  528. display: flex;
  529. flex-direction: column;
  530. background-color: #f8f8f8;
  531. font-family: Arial, sans-serif;
  532. min-height: 500px;
  533. box-sizing: border-box;
  534. }
  535. .chat-messages {
  536. flex: 1;
  537. overflow-y: auto;
  538. padding: 12px;
  539. display: flex;
  540. flex-direction: column;
  541. width: 100%;
  542. box-sizing: border-box;
  543. font-weight: bold;
  544. }
  545. .message-wrapper {
  546. display: flex;
  547. margin-bottom: 16px;
  548. max-width: 80%;
  549. width: auto;
  550. align-items: flex-start;
  551. }
  552. .message-wrapper:last-child{
  553. margin-bottom: 0 !important;
  554. }
  555. .agent-message {
  556. align-self: flex-start;
  557. }
  558. .user-message {
  559. align-self: flex-end;
  560. flex-direction: row-reverse;
  561. justify-content: flex-end;
  562. width: auto;
  563. }
  564. .avatar {
  565. font-size: 14px;
  566. display: flex;
  567. padding-right: 5px;
  568. padding-left: 0;
  569. margin-bottom: 0;
  570. flex-shrink: 0;
  571. width: 36px;
  572. }
  573. .avatar img {
  574. width: 32px;
  575. height: 32px;
  576. border-radius: 50%;
  577. }
  578. .message-content {
  579. display: flex;
  580. flex-direction: column;
  581. min-width: 0;
  582. width: auto;
  583. }
  584. .message-content>.message-text,.message-content .option-button{
  585. font-size: 17px;
  586. }
  587. .message-text {
  588. padding: 10px 12px;
  589. border-radius: 18px;
  590. font-size: 14px;
  591. line-height: 1.4;
  592. word-break: break-word;
  593. display: inline-block;
  594. max-width: 100%;
  595. }
  596. .agent-message .message-text {
  597. background-color: white;
  598. color: #333;
  599. border-top-left-radius: 4px;
  600. }
  601. .user-message .message-text {
  602. background-color: #4a90e2;
  603. color: white;
  604. border-top-right-radius: 4px;
  605. }
  606. .options-container {
  607. display: flex;
  608. flex-wrap: wrap;
  609. gap: 8px;
  610. margin-top: 8px;
  611. }
  612. .option-button {
  613. background-color: #4a90e2;
  614. color: white;
  615. border: none;
  616. border-radius: 18px;
  617. padding: 1px 12px;
  618. font-size: 14px;
  619. cursor: pointer;
  620. transition: background-color 0.2s;
  621. white-space: nowrap;
  622. text-overflow: ellipsis;
  623. overflow: hidden;
  624. max-width: 100%;
  625. }
  626. .option-button:hover {
  627. background-color: #045dba;
  628. }
  629. .option-button.selected {
  630. background-color: #2a70c2;
  631. }
  632. /* Media queries for responsive design */
  633. @media screen and (max-width: 768px) {
  634. .chat-messages {
  635. padding: 10px;
  636. }
  637. .message-wrapper {
  638. max-width: 90%;
  639. }
  640. }
  641. @media screen and (max-width: 480px) {
  642. .chat-messages {
  643. padding: 8px;
  644. }
  645. .message-wrapper {
  646. max-width: 95%;
  647. }
  648. .message-text {
  649. padding: 8px 10px;
  650. font-size: 13px;
  651. }
  652. .avatar img {
  653. width: 28px;
  654. height: 28px;
  655. }
  656. .options-container {
  657. gap: 6px;
  658. }
  659. .option-button {
  660. padding: 1px 10px;
  661. font-size: 13px;
  662. }
  663. }
  664. /* Fix for iOS Safari viewport height issues */
  665. @supports (-webkit-touch-callout: none) {
  666. .chat-container {
  667. min-height: -webkit-fill-available;
  668. }
  669. }
  670. /* Fix for potential input and button styling on mobile */
  671. input, button {
  672. -webkit-appearance: none;
  673. -moz-appearance: none;
  674. appearance: none;
  675. }
  676. /* Ensure touch targets are big enough */
  677. .option-button {
  678. min-height: 32px;
  679. }
  680. .item {
  681. position: relative;
  682. display: flex;
  683. flex-direction: column;
  684. flex: 1;
  685. margin: 0;
  686. width: 100%;
  687. .image-child{
  688. position: absolute;
  689. top: 0%;
  690. left: 0;
  691. width: 100%;
  692. height: 100%;
  693. background-color: transparent; /* 设置为透明 */
  694. z-index: 1000;
  695. }
  696. img {
  697. width: 100%;
  698. }
  699. p {
  700. white-space: pre-line;
  701. }
  702. }
  703. .footer {
  704. position: fixed;
  705. bottom: 0;
  706. left: 0;
  707. z-index: 44444;
  708. }
  709. .countdown2-box {
  710. background: url('#') no-repeat center;
  711. background-size: 100%;
  712. width: 100%;
  713. height: 54px;
  714. line-height: 54px;
  715. color: #515A6E;
  716. font-size: 14px;
  717. text-align: center;
  718. }
  719. .countdown2-box span {
  720. display: inline-block;
  721. color: #fff;
  722. width: 22px;
  723. line-height: 20px;
  724. text-align: center;
  725. height: 20px;
  726. border-radius: 3px;
  727. margin: 7px;
  728. background: #FF5A29;
  729. }
  730. </style>