index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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. // 如果有答案就直接用户消息和客服消息
  184. let nextMsg = h5ChatItem.agentMsg.shift();
  185. message.click = true;
  186. h5ChatItem.messages.push({
  187. id: this.getChatMsgIdMax(),
  188. sender: 'user',
  189. text: option.text,
  190. options: []
  191. })
  192. await this.delay(1000);
  193. if (option.answer) {
  194. h5ChatItem.messages.push({
  195. id: this.getChatMsgIdMax(),
  196. sender: 'agent',
  197. text: option.answer,
  198. options: []
  199. })
  200. }
  201. await this.delay(1000);
  202. // 不管有没有 answer,都添加 nextMsg(如果存在)
  203. if (nextMsg) {
  204. h5ChatItem.messages.push(nextMsg);
  205. if(nextMsg.options){
  206. return;
  207. }
  208. }
  209. while (h5ChatItem.agentMsg.length > 0) {
  210. nextMsg = h5ChatItem.agentMsg.shift();
  211. if (nextMsg && (!nextMsg.options || nextMsg.options.length === 0)) {
  212. await this.delay(500 + (Math.random() * 1000) % 500);
  213. h5ChatItem.messages.push(nextMsg);
  214. } else {
  215. //重新放回去
  216. if(nextMsg){
  217. h5ChatItem.agentMsg.unshift(nextMsg);
  218. }
  219. break;
  220. }
  221. }
  222. if (h5ChatItem.agentMsg.length === 0) {
  223. await this.delay(200);
  224. if(h5ChatItem.addWxFun){
  225. //显示加微按钮
  226. h5ChatItem.showButton = true;
  227. }
  228. h5ChatItem.messages.push({
  229. id: this.getChatMsgIdMax(),
  230. sender: 'agent',
  231. text: h5ChatItem.lastMsg.map(e => {
  232. if(e.type == 0) return e.text;
  233. if(e.type == 1) return "<span style='color: red'>"+ e.text +"</span>";
  234. }).join(""),
  235. options: []
  236. });
  237. }
  238. }catch (err) {
  239. console.error(err);
  240. }finally {
  241. this.isProcessing = false;
  242. }
  243. },
  244. // 辅助函数:延迟
  245. delay(ms) {
  246. return new Promise(resolve => setTimeout(resolve, ms));
  247. },
  248. // 加载计时器数据
  249. loadCountdownData() {
  250. let countdownItems = this.json.filter(e => e.type === 'h5-countdown')
  251. countdownItems.forEach(item => {
  252. // 为每个item启动一个定时器
  253. this.startCountdown(item)
  254. })
  255. },
  256. // 加载聊天组件的消息
  257. async loadChatMessage() {
  258. let h5ChatItem = this.json.filter(e => e.type === 'h5-chat')[0]
  259. if(!h5ChatItem) return;
  260. h5ChatItem.messages = []
  261. // 先输出所有的欢迎信息,欢迎信息为没有options的数据,以及后面一条数据
  262. let isOutputWelcome = 0;
  263. while (h5ChatItem.agentMsg.length > 0) {
  264. let msg = h5ChatItem.agentMsg.shift()
  265. if (!msg.options || msg.options.length === 0) {
  266. isOutputWelcome = 1
  267. await this.delay(1000)
  268. h5ChatItem.messages.push(msg)
  269. } else {
  270. if ((isOutputWelcome === 1) || (isOutputWelcome === 0)) {
  271. isOutputWelcome = 2
  272. await this.delay(2000)
  273. h5ChatItem.messages.push(msg)
  274. break;
  275. }
  276. }
  277. }
  278. if (h5ChatItem.agentMsg.length === 0) {
  279. await this.delay(1000);
  280. h5ChatItem.messages.push({
  281. id: this.getChatMsgIdMax(),
  282. sender: 'agent',
  283. text: "好的,已经为您分配专业老师。<span style='color:red'>【点击下方按钮】</span>添加老师,获取免费上课链接。!",
  284. options: []
  285. });
  286. }
  287. },
  288. startCountdown(item) {
  289. if (!item.active) {
  290. return
  291. }
  292. let intervalId = setInterval(() => {
  293. let timeLeft
  294. if (item.countdownMode == '1') {
  295. // 模式1:now() - endDateTime 的时间差
  296. timeLeft = this.calculateTimePassed(item)
  297. } else if (item.countdownMode == '2') {
  298. // 模式2:timeDisplay 分钟数倒计时
  299. timeLeft = this.calculateTimeLeftFromDisplay(item)
  300. }
  301. // 不再有 total <= 0 的判断, 因为模式1是不断增加的
  302. item.days = timeLeft.days
  303. item.hours = timeLeft.hours
  304. item.minutes = timeLeft.minutes
  305. item.seconds = timeLeft.seconds
  306. }, 1000)
  307. item.intervalId = intervalId // 存储 intervalId
  308. },
  309. calculateTimePassed(item) {
  310. // 如果已经结束,直接返回
  311. if (item.isFinished) {
  312. return {
  313. days: 0,
  314. hours: 0,
  315. minutes: 0,
  316. seconds: 0
  317. }
  318. }
  319. let endTime = new Date(item.endDateTime)
  320. let now = new Date()
  321. let diff = endTime.getTime() - now.getTime() // 毫秒差, end - now
  322. if (diff <= 0) {
  323. // 如果 endDateTime 比当前时间晚, 则显示 0
  324. clearInterval(item.intervalId)
  325. item.intervalId = null
  326. item.isFinished = true
  327. return {
  328. days: 0,
  329. hours: 0,
  330. minutes: 0,
  331. seconds: 0
  332. }
  333. }
  334. return this.millisecondsToTimeObject(diff)
  335. },
  336. calculateTimeLeftFromDisplay(item) {
  337. if (!item.startTime) {
  338. item.startTime = Date.now() // 记录开始时间
  339. }
  340. let totalSeconds = item.timeDisplay * 60 // timeDisplay 是分钟数
  341. let passedSeconds = Math.floor((Date.now() - item.startTime) / 1000)
  342. let timeLeft = totalSeconds - passedSeconds
  343. if (timeLeft <= 0) {
  344. clearInterval(item.intervalId)
  345. item.intervalId = null//清除id
  346. return {
  347. days: 0,
  348. hours: 0,
  349. minutes: 0,
  350. seconds: 0
  351. }
  352. }
  353. return this.secondsToTimeObject(timeLeft)
  354. },
  355. millisecondsToTimeObject(milliseconds) {
  356. let totalSeconds = Math.floor(milliseconds / 1000)
  357. return this.secondsToTimeObject(totalSeconds)
  358. },
  359. secondsToTimeObject(totalSeconds) {
  360. let days = Math.floor(totalSeconds / (3600 * 24))
  361. let hours = Math.floor((totalSeconds % (3600 * 24)) / 3600)
  362. let minutes = Math.floor((totalSeconds % 3600) / 60)
  363. let seconds = Math.floor(totalSeconds % 60)
  364. return {
  365. days: days,
  366. hours: hours,
  367. minutes: minutes,
  368. seconds: seconds
  369. }
  370. },
  371. getAgentAvatar(item) {
  372. console.log(item.style.avatar)
  373. if (item.style.avatar) {
  374. return item.style.avatar
  375. }
  376. return this.agentAvatar
  377. },
  378. isOptionSelected(messageId, option) {
  379. let messages = this.json.find(t => t.type === 'h5-chat').messages
  380. const message = messages.find(m => m.id === messageId)
  381. return message && message.userSelection && message.userSelection.id === option.id
  382. },
  383. handleImageLoad(index, item) {
  384. if (item.classText.indexOf("footer") != -1) {
  385. const imgElement = this.$refs["myImage" + index];
  386. // 获取真实高度(包含以下两种方式)
  387. const naturalHeight = imgElement[0].naturalHeight; // 原始高度
  388. const clientHeight = imgElement[0].clientHeight; // 渲染高度
  389. this.paddingBottom = clientHeight + "px";
  390. }
  391. },
  392. handleImageLoad2(index, item) {
  393. const imgElement = this.$refs["addButton" + index][0]; // 获取图片 DOM 元素
  394. // 1. 获取图片原始宽高
  395. const naturalWidth = imgElement.naturalWidth;
  396. const naturalHeight = imgElement.naturalHeight;
  397. // 2. 获取容器尺寸(假设容器是图片的父元素)
  398. const container = imgElement.parentElement;
  399. const containerWidth = container.clientWidth;
  400. const containerHeight = container.clientHeight;
  401. // 3. 计算缩放后的宽高(保持比例)
  402. const imageAspectRatio = naturalWidth / naturalHeight; // 原始宽高比
  403. const containerAspectRatio = containerWidth / containerHeight; // 容器宽高比
  404. let targetWidth, targetHeight;
  405. // 根据容器宽高比决定以哪一边为基准缩放
  406. if (containerAspectRatio > imageAspectRatio) {
  407. // 容器更宽,以高度为基准
  408. targetHeight = containerHeight;
  409. targetWidth = targetHeight * imageAspectRatio;
  410. } else {
  411. // 容器更高,以宽度为基准
  412. targetWidth = containerWidth;
  413. targetHeight = targetWidth / imageAspectRatio;
  414. }
  415. // 4. 应用缩放后的尺寸
  416. imgElement.style.width = `${targetWidth - 16}px`;
  417. imgElement.style.height = `${targetHeight}px`;
  418. },
  419. confirm() {
  420. this.show = false
  421. },
  422. clickToWx(workUrl) {
  423. if(this.site && this.site.workUrl != null && this.site.workUrl != undefined && this.site.workUrl != ''){
  424. workUrl = this.site.workUrl;
  425. }
  426. // 百度
  427. if (this.type == 0) {
  428. let data = {
  429. id: this.id,
  430. url: window.location.href,
  431. vid: this.vid,
  432. clickType: 79,
  433. };
  434. baiduClickCallback(data).then(e => {
  435. window.location.href = workUrl + "?customer_channel=" + this.vid;
  436. })
  437. }
  438. // 优酷
  439. if (this.type == 1) {
  440. let data = {
  441. id: this.id,
  442. url: window.location.href,
  443. vid: this.vid,
  444. aid: this.aid,
  445. clickId: this.click_id,
  446. ip: this.ip,
  447. clickType: "wechat"
  448. };
  449. youkuClickCallback(data).then(e => {
  450. window.location.href = workUrl + "?customer_channel=" + this.vid;
  451. })
  452. }
  453. // 爱奇艺
  454. if (this.type == 2) {
  455. if (this.id) {
  456. let data = {
  457. url: window.location.href,
  458. id: this.id,
  459. planId: this.order_plan_id,
  460. creativeId: this.creative_id,
  461. vid: this.impress_id,
  462. sign: this.sign,
  463. clickType: "200"
  464. };
  465. iqiyiClickCallback(data).then(e => {
  466. window.location.href = workUrl + "?customer_channel=" + this.impress_id;
  467. })
  468. } else {
  469. let data = {
  470. accountId: this.accountId,
  471. url: window.location.href,
  472. no: this.no,
  473. planId: this.order_plan_id,
  474. creativeId: this.creative_id,
  475. vid: this.impress_id,
  476. sign: this.sign,
  477. clickType: "200"
  478. };
  479. dyClickCallback(data).then(e => {
  480. window.location.href = workUrl + "?customer_channel=" + this.impress_id;
  481. })
  482. }
  483. }
  484. // 爱奇艺
  485. if (this.type == 3) {
  486. let data = {
  487. url: window.location.href,
  488. id: this.id,
  489. clickId: this.click_id,
  490. creativeId: this.creative_id,
  491. vid:this.vid
  492. };
  493. dyClickCallback(data).then(e => {
  494. window.location.href = workUrl + "?customer_channel=" + this.vid;
  495. })
  496. }
  497. if (this.type == 99) {
  498. window.location.href = workUrl + "?customer_channel=" + '{"siteId":'+this.id+'}';
  499. }
  500. },
  501. click(item, type) {
  502. if(type == 0){
  503. console.info(item)
  504. if (!item.addWxFun || item.type === "h5-chat") {
  505. return
  506. }
  507. this.clickToWx(item.workUrl)
  508. }else{
  509. this.clickToWx(item.workUrl)
  510. }
  511. }
  512. }
  513. }
  514. </script>
  515. <style lang="scss" scoped>
  516. .chat-container {
  517. width: 100%;
  518. display: flex;
  519. flex-direction: column;
  520. background-color: #f8f8f8;
  521. font-family: Arial, sans-serif;
  522. min-height: 500px;
  523. box-sizing: border-box;
  524. }
  525. .chat-messages {
  526. flex: 1;
  527. overflow-y: auto;
  528. padding: 12px;
  529. display: flex;
  530. flex-direction: column;
  531. width: 100%;
  532. box-sizing: border-box;
  533. font-weight: bold;
  534. }
  535. .message-wrapper {
  536. display: flex;
  537. margin-bottom: 16px;
  538. max-width: 80%;
  539. width: auto;
  540. align-items: flex-start;
  541. }
  542. .message-wrapper:last-child{
  543. margin-bottom: 0 !important;
  544. }
  545. .agent-message {
  546. align-self: flex-start;
  547. }
  548. .user-message {
  549. align-self: flex-end;
  550. flex-direction: row-reverse;
  551. justify-content: flex-end;
  552. width: auto;
  553. }
  554. .avatar {
  555. font-size: 14px;
  556. display: flex;
  557. padding-right: 5px;
  558. padding-left: 0;
  559. margin-bottom: 0;
  560. flex-shrink: 0;
  561. width: 36px;
  562. }
  563. .avatar img {
  564. width: 32px;
  565. height: 32px;
  566. border-radius: 50%;
  567. }
  568. .message-content {
  569. display: flex;
  570. flex-direction: column;
  571. min-width: 0;
  572. width: auto;
  573. }
  574. .message-content>.message-text,.message-content .option-button{
  575. font-size: 17px;
  576. }
  577. .message-text {
  578. padding: 10px 12px;
  579. border-radius: 18px;
  580. font-size: 14px;
  581. line-height: 1.4;
  582. word-break: break-word;
  583. display: inline-block;
  584. max-width: 100%;
  585. }
  586. .agent-message .message-text {
  587. background-color: white;
  588. color: #333;
  589. border-top-left-radius: 4px;
  590. }
  591. .user-message .message-text {
  592. background-color: #4a90e2;
  593. color: white;
  594. border-top-right-radius: 4px;
  595. }
  596. .options-container {
  597. display: flex;
  598. flex-wrap: wrap;
  599. gap: 8px;
  600. margin-top: 8px;
  601. }
  602. .option-button {
  603. background-color: #4a90e2;
  604. color: white;
  605. border: none;
  606. border-radius: 18px;
  607. padding: 1px 12px;
  608. font-size: 14px;
  609. cursor: pointer;
  610. transition: background-color 0.2s;
  611. white-space: nowrap;
  612. text-overflow: ellipsis;
  613. overflow: hidden;
  614. max-width: 100%;
  615. }
  616. .option-button:hover {
  617. background-color: #045dba;
  618. }
  619. .option-button.selected {
  620. background-color: #2a70c2;
  621. }
  622. /* Media queries for responsive design */
  623. @media screen and (max-width: 768px) {
  624. .chat-messages {
  625. padding: 10px;
  626. }
  627. .message-wrapper {
  628. max-width: 90%;
  629. }
  630. }
  631. @media screen and (max-width: 480px) {
  632. .chat-messages {
  633. padding: 8px;
  634. }
  635. .message-wrapper {
  636. max-width: 95%;
  637. }
  638. .message-text {
  639. padding: 8px 10px;
  640. font-size: 13px;
  641. }
  642. .avatar img {
  643. width: 28px;
  644. height: 28px;
  645. }
  646. .options-container {
  647. gap: 6px;
  648. }
  649. .option-button {
  650. padding: 1px 10px;
  651. font-size: 13px;
  652. }
  653. }
  654. /* Fix for iOS Safari viewport height issues */
  655. @supports (-webkit-touch-callout: none) {
  656. .chat-container {
  657. min-height: -webkit-fill-available;
  658. }
  659. }
  660. /* Fix for potential input and button styling on mobile */
  661. input, button {
  662. -webkit-appearance: none;
  663. -moz-appearance: none;
  664. appearance: none;
  665. }
  666. /* Ensure touch targets are big enough */
  667. .option-button {
  668. min-height: 32px;
  669. }
  670. .item {
  671. position: relative;
  672. display: flex;
  673. flex-direction: column;
  674. flex: 1;
  675. margin: 0;
  676. width: 100%;
  677. .image-child{
  678. position: absolute;
  679. top: 0%;
  680. left: 0;
  681. width: 100%;
  682. height: 100%;
  683. background-color: transparent; /* 设置为透明 */
  684. z-index: 1000;
  685. }
  686. img {
  687. width: 100%;
  688. }
  689. p {
  690. white-space: pre-line;
  691. }
  692. }
  693. .footer {
  694. position: fixed;
  695. bottom: 0;
  696. left: 0;
  697. z-index: 44444;
  698. }
  699. .countdown2-box {
  700. background: url('#') no-repeat center;
  701. background-size: 100%;
  702. width: 100%;
  703. height: 54px;
  704. line-height: 54px;
  705. color: #515A6E;
  706. font-size: 14px;
  707. text-align: center;
  708. }
  709. .countdown2-box span {
  710. display: inline-block;
  711. color: #fff;
  712. width: 22px;
  713. line-height: 20px;
  714. text-align: center;
  715. height: 20px;
  716. border-radius: 3px;
  717. margin: 7px;
  718. background: #FF5A29;
  719. }
  720. </style>