living.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. var api_live = require("../../api/live.js");
  4. require("../../api/order.js");
  5. var api_home = require("../../api/home.js");
  6. var common_assets = require("../../common/assets.js");
  7. require("../../common/request.js");
  8. var wsUrl = "ws://nd383294.natappfree.cc/app/webSocket";
  9. var pingpangTimes = null;
  10. var isSocketOpen = false;
  11. var socket = null;
  12. const _sfc_main = {
  13. data() {
  14. return {
  15. boxHeight: 300,
  16. isFollow: true,
  17. liveViewData: {},
  18. liveViewers: [],
  19. likeName: 0,
  20. hlsPlayer: null,
  21. livingUrl: "",
  22. products: {},
  23. store: {},
  24. orderUser: {},
  25. userType: 0,
  26. timestamp: "",
  27. liveId: null,
  28. livedata: {},
  29. codeimg: "",
  30. placeholderText: "\u8BF4\u70B9\u4EC0\u4E48...",
  31. isZoom: false,
  32. userinfo: "",
  33. path: "http://v56c9b8e.natappfree.cc",
  34. value: "",
  35. talkdisabled: false,
  36. autoplay: false,
  37. showadd: false,
  38. talklist: [],
  39. scrollIntoView: "",
  40. bufferRate: 0,
  41. playDuration: 0,
  42. videoContext: "",
  43. thistime: common_vendor.index.$u.timeFormat(new Date(), "yyyy-mm-dd hh:MM:ss"),
  44. upDown: true,
  45. isLongPress: false,
  46. timeout: null,
  47. showWelcomeMessage: false,
  48. isSubmit: false,
  49. messageContent: "",
  50. showziliao: false,
  51. isScreen: true,
  52. showAnswer: false,
  53. Answerlistall: {},
  54. answerlist: {},
  55. answerfrist: 0,
  56. checkboxValue: [],
  57. checkboxFormValue: "",
  58. allAnswerLists: [],
  59. showAnswerred: false,
  60. answerbtn: false,
  61. redallAnswerLists: [],
  62. redanswerAll: [],
  63. redanswerList: [],
  64. redanswertips: [],
  65. shopping: false,
  66. scrollTop: 0,
  67. old: {
  68. scrollTop: 0
  69. },
  70. liveData: {}
  71. };
  72. },
  73. onLoad(options) {
  74. if (options.liveId) {
  75. this.liveId = options.liveId;
  76. console.log("\u63A5\u6536\u5230\u7684liveId:", this.liveId);
  77. }
  78. },
  79. computed: {
  80. filteredViewers() {
  81. return this.liveViewers.slice(0, 3);
  82. }
  83. },
  84. mounted() {
  85. this.getliveViewData();
  86. this.intervalId = setInterval(() => {
  87. this.getliveViewData();
  88. }, 60 * 1e3);
  89. this.getliveOrder();
  90. this.getliveStore();
  91. this.getliveUser();
  92. this.initTime();
  93. this.initSocket();
  94. var that = this;
  95. common_vendor.index.$on("initSocket", () => {
  96. that.initSocket();
  97. });
  98. common_vendor.index.$on("sendMsg", (item) => {
  99. that.sendMsg(item);
  100. });
  101. common_vendor.index.$on("closeWebSocket", () => {
  102. that.closeWebSocket();
  103. });
  104. this.getEWechatSdk();
  105. this.getliving();
  106. this.gettalklist();
  107. this.userinfo = JSON.parse(common_vendor.index.getStorageSync("userInfo"));
  108. },
  109. onReady: function(res) {
  110. this.videoContext = common_vendor.index.createVideoContext("myVideo");
  111. },
  112. onUnload() {
  113. if (this.hlsPlayer) {
  114. this.hlsPlayer.destroy();
  115. this.hlsPlayer = null;
  116. }
  117. },
  118. methods: {
  119. goStore() {
  120. common_vendor.index.navigateTo({
  121. url: "/pages_shop/store?liveId=" + this.liveId
  122. });
  123. },
  124. goOrderList() {
  125. common_vendor.index.navigateTo({
  126. url: "/pages_shop/order"
  127. });
  128. },
  129. initHlsPlayer() {
  130. if (common_vendor.Hls.isSupported() && this.livingUrl) {
  131. const video = document.getElementById("myVideo");
  132. if (video) {
  133. this.hlsPlayer = new common_vendor.Hls();
  134. this.hlsPlayer.loadSource(this.livingUrl);
  135. this.hlsPlayer.attachMedia(video);
  136. this.hlsPlayer.on(common_vendor.Hls.Events.MANIFEST_PARSED, () => {
  137. video.play();
  138. });
  139. }
  140. }
  141. },
  142. videoError(e) {
  143. console.error("\u89C6\u9891\u64AD\u653E\u9519\u8BEF:", e.detail.errMsg);
  144. if (this.livingUrl) {
  145. setTimeout(() => {
  146. this.videoContext.play();
  147. }, 2e3);
  148. }
  149. },
  150. getliving() {
  151. const param = {
  152. id: this.liveId
  153. };
  154. api_home.getlive(param).then((res) => {
  155. if (res.code == 200) {
  156. this.livedata = res.data;
  157. this.livingUrl = res.data.livingUrl;
  158. if (this.livingUrl && this.livingUrl.indexOf(".m3u8") > -1) {
  159. this.$nextTick(() => {
  160. if (this.videoContext) {
  161. this.videoContext.play();
  162. }
  163. });
  164. } else {
  165. if (this.livedata.liveType == 1) {
  166. this.autoplay = true;
  167. this.livingUrl = res.videoUrl;
  168. this.videoContext.seek(this.livedata.nowDuration);
  169. } else if (this.livedata.liveType == 2) {
  170. this.autoplay = true;
  171. this.getLiveinformation();
  172. } else {
  173. this.autoplay = false;
  174. this.placeholderText = "\u76F4\u64AD\u5F00\u59CB\u624D\u80FD\u53D1\u8A00\u8BA8\u8BBA";
  175. this.talkdisabled = true;
  176. }
  177. }
  178. } else {
  179. common_vendor.index.showToast({
  180. title: res.msg,
  181. icon: "none",
  182. duration: 2e3
  183. });
  184. }
  185. });
  186. },
  187. maskString(str, maskChar = "*") {
  188. if (!str)
  189. return "";
  190. const strVal = String(str);
  191. return strVal.split("").map((char, index) => index === 0 ? char : maskChar).join("");
  192. },
  193. getPureDecimal(num, precision = 6) {
  194. const decimalPart = Math.abs(num).toFixed(precision).split(".")[1];
  195. return (decimalPart == null ? void 0 : decimalPart.replace(/0+$/, "")) || "";
  196. },
  197. goBack() {
  198. common_vendor.index.navigateBack();
  199. closeWebSocket();
  200. },
  201. getliveViewData() {
  202. api_live.getLiveViewData(this.liveId).then((res) => {
  203. if (res.code == 200) {
  204. this.liveViewData = res;
  205. } else {
  206. common_vendor.index.showToast({
  207. title: res.msg,
  208. icon: "none"
  209. });
  210. }
  211. }, (rej) => {
  212. });
  213. },
  214. getliveOrder() {
  215. api_live.liveOrderUser(this.liveId).then((res) => {
  216. if (res.code == 200) {
  217. console.log("\u6B63\u5728\u8D2D\u4E70>>>>", res);
  218. this.orderUser = res;
  219. } else {
  220. common_vendor.index.showToast({
  221. title: res.msg,
  222. icon: "none"
  223. });
  224. }
  225. }, (rej) => {
  226. });
  227. },
  228. getliveStore() {
  229. let data = {
  230. pageSize: 10,
  231. page: 1
  232. };
  233. api_live.liveStore(this.liveId, data).then((res) => {
  234. if (res.code == 200) {
  235. console.log("\u5C0F\u9EC4\u8F66 \u5E97\u94FA\u5C55\u793A>>>>", res);
  236. this.products = res.data;
  237. } else {
  238. common_vendor.index.showToast({
  239. title: res.msg,
  240. icon: "none"
  241. });
  242. }
  243. }, (rej) => {
  244. });
  245. },
  246. getLiveinformation() {
  247. api_live.getLiveInfo(this.liveId).then((res) => {
  248. if (res.code == 200) {
  249. console.log("\u83B7\u53D6\u76F4\u64AD\u95F4\u4FE1\u606F\u63A5\u53E3>>>>", res);
  250. this.livingUrl = res.livingUrl;
  251. } else {
  252. common_vendor.index.showToast({
  253. title: res.msg,
  254. icon: "none"
  255. });
  256. }
  257. }, (rej) => {
  258. });
  259. },
  260. getliveUser() {
  261. api_live.getRecentLiveViewers(this.liveId).then((res) => {
  262. if (res.code == 200) {
  263. console.log("\u83B7\u53D6\u76F4\u64AD\u95F4\u7528\u6237>>>>", res);
  264. this.liveViewers = res.recentLiveViewers;
  265. } else {
  266. common_vendor.index.showToast({
  267. title: res.msg,
  268. icon: "none"
  269. });
  270. }
  271. }, (rej) => {
  272. });
  273. },
  274. onLike() {
  275. api_live.liveDataLike(this.liveId).then((res) => {
  276. if (res.code == 200) {
  277. if (typeof res.msg === "number" || typeof res.msg === "string" && /^\d+$/.test(res.msg.trim())) {
  278. this.liveData++;
  279. } else {
  280. common_vendor.index.showToast({
  281. title: res.msg,
  282. icon: "none"
  283. });
  284. }
  285. } else {
  286. common_vendor.index.showToast({
  287. title: res.msg,
  288. icon: "none"
  289. });
  290. }
  291. }, (rej) => {
  292. });
  293. },
  294. goShop(item) {
  295. console.log("\u53BB\u8D2D\u4E70,\u8DF3\u5546\u54C1\u8BE6\u60C5", item);
  296. common_vendor.index.navigateTo({
  297. url: "/pages_shop/goods?productId=" + item + "&liveId=" + this.liveId
  298. });
  299. },
  300. onCollect(item) {
  301. console.log("item>>>", item.productId);
  302. common_vendor.index.setStorageSync("storeId", storeId);
  303. let data = {
  304. liveId: this.liveId,
  305. productId: item.productId,
  306. storeId: this.store.storeId
  307. };
  308. api_live.collectStore(data).then((res) => {
  309. if (res.code == 200) {
  310. console.log("\u6536\u85CFlcollectStore>>>>", res);
  311. } else {
  312. common_vendor.index.showToast({
  313. title: res.msg,
  314. icon: "none"
  315. });
  316. }
  317. }, (rej) => {
  318. });
  319. },
  320. onFollow() {
  321. api_live.follow(this.liveId).then((res) => {
  322. this.isFollow = !this.isFollow;
  323. common_vendor.index.showToast({
  324. title: res.msg,
  325. icon: "none"
  326. });
  327. }, (rej) => {
  328. });
  329. },
  330. initTime() {
  331. const now = new Date();
  332. this.timestamp = now.getTime();
  333. },
  334. lowerChat: function(e) {
  335. console.log(e);
  336. },
  337. scroll: function(e) {
  338. console.log(e);
  339. this.old.scrollTop = e.detail.scrollTop;
  340. },
  341. loadmore() {
  342. },
  343. scrollchat() {
  344. },
  345. noredanswer() {
  346. if (this.Answerlistall > 0) {
  347. this.showAnswer = !this.this.showAnswer;
  348. } else {
  349. common_vendor.index.showToast({
  350. title: "\u6682\u65E0\u9898\u76EE",
  351. icon: "none"
  352. });
  353. }
  354. },
  355. redbagAnswer() {
  356. this.showAnswerred = !this.showAnswerred;
  357. this.answerbtn = !this.answerbtn;
  358. },
  359. submitAnswers() {
  360. if (this.isSubmit)
  361. return;
  362. this.isSubmit = true;
  363. const data = {
  364. questionId: this.answerlist.id,
  365. answer: this.checkboxFormValue
  366. };
  367. api_home.submitAnswer(data).then((res) => {
  368. if (res.code == 200) {
  369. common_vendor.index.showToast({
  370. title: res.msg,
  371. icon: "none"
  372. });
  373. }
  374. if (this.answerfrist < this.Answerlistall - 1) {
  375. this.answerfrist++;
  376. this.answerlist = this.allAnswerLists[this.answerfrist];
  377. this.answerlist.content = JSON.parse(this.answerlist.content);
  378. } else {
  379. common_vendor.index.showToast({
  380. title: "\u5DF2\u662F\u6700\u540E\u4E00\u9898",
  381. icon: "none"
  382. });
  383. this.showAnswer = false;
  384. }
  385. this.checkboxValue = [];
  386. this.checkboxFormValue = "";
  387. common_vendor.index.showToast({
  388. title: res.msg,
  389. icon: "none"
  390. });
  391. }).finally((e) => {
  392. this.isSubmit = false;
  393. });
  394. },
  395. handleCheckboxSelect(value) {
  396. const index = this.checkboxValue.indexOf(value);
  397. console.log(value);
  398. if (this.answerlist.type == 1) {
  399. this.checkboxValue = [value];
  400. this.checkboxFormValue = this.checkboxValue.join(",");
  401. this.submitAnswers();
  402. console.log(this.checkboxValue);
  403. } else if (this.answerlist.type == 2) {
  404. if (index > -1) {
  405. this.checkboxValue.splice(index, 1);
  406. this.checkboxFormValue = this.checkboxValue.join(",");
  407. } else {
  408. this.checkboxValue.push(value);
  409. this.checkboxFormValue = this.checkboxValue.join(",");
  410. }
  411. console.log(this.checkboxFormValue);
  412. }
  413. },
  414. getAnswerlists() {
  415. console.log(123);
  416. const data = {
  417. liveId: this.liveId
  418. };
  419. api_home.getAnswerlist(data).then((res) => {
  420. if (res.code == 200) {
  421. if (res.data.length > 0) {
  422. this.allAnswerLists = res.data;
  423. this.Answerlistall = res.data.length;
  424. if (this.allAnswerLists.length > 0) {
  425. this.answerlist = this.allAnswerLists[0];
  426. this.answerlist.content = JSON.parse(this.allAnswerLists[0].content);
  427. }
  428. this.showAnswer = true;
  429. } else {
  430. this.showAnswer = false;
  431. }
  432. }
  433. });
  434. },
  435. gettalklist() {
  436. const param = {
  437. id: this.liveId
  438. };
  439. api_home.gettextlist(param).then((res) => {
  440. if (res.code == 200) {
  441. this.talklist = res.data;
  442. this.$nextTick(() => {
  443. this.scrollIntoView = `list_${this.talklist.length - 1}`;
  444. });
  445. }
  446. });
  447. },
  448. open() {
  449. },
  450. close() {
  451. this.showadd = !this.showadd;
  452. },
  453. closes() {
  454. this.showziliao = !this.showziliao;
  455. },
  456. closest() {
  457. this.showAnswer = !this.showAnswer;
  458. },
  459. closestred() {
  460. this.showAnswerred = !this.showAnswerred;
  461. },
  462. closeanswer() {
  463. this.answerbtn = !this.answerbtn;
  464. },
  465. closeshop() {
  466. this.shopping = !this.shopping;
  467. },
  468. longPress() {
  469. this.timeout = setTimeout(() => {
  470. this.isLongPress = true;
  471. common_vendor.index.saveImageToPhotosAlbum({
  472. filePath: this.livedata.qwQrCode,
  473. success: () => {
  474. common_vendor.index.showToast({
  475. title: "\u4FDD\u5B58\u6210\u529F"
  476. });
  477. },
  478. fail: () => {
  479. common_vendor.index.showToast({
  480. title: "",
  481. icon: "none"
  482. });
  483. }
  484. });
  485. }, 500);
  486. },
  487. cancelLongPress() {
  488. clearTimeout(this.timeout);
  489. this.isLongPress = false;
  490. },
  491. handleTouchStart() {
  492. this.isZoom = true;
  493. },
  494. handleTouchEnd() {
  495. this.isZoom = false;
  496. },
  497. getEWechatSdk() {
  498. },
  499. closeWebSocket() {
  500. if (socket != null) {
  501. common_vendor.index.closeSocket();
  502. }
  503. clearInterval(pingpangTimes);
  504. },
  505. reConnect() {
  506. var that = this;
  507. try {
  508. common_vendor.index.closeSocket();
  509. } catch (e) {
  510. }
  511. setTimeout(function() {
  512. that.initSocket();
  513. }, 1e4);
  514. },
  515. initSocket() {
  516. this.userinfo = JSON.parse(common_vendor.index.getStorageSync("userInfo"));
  517. let signature = common_vendor.CryptoJS.HmacSHA256(common_vendor.CryptoJS.enc.Utf8.parse(this.liveId.toString() + this.userinfo.userId + this.userType + this.timestamp), common_vendor.CryptoJS.enc.Utf8.parse(this.timestamp)).toString(common_vendor.CryptoJS.enc.Hex);
  518. var that = this;
  519. socket = common_vendor.index.connectSocket({
  520. url: wsUrl + "?userId=" + this.userinfo.userId + "&liveId=" + this.liveId + "&userType=" + this.userType + "&timestamp=" + this.timestamp + "&signature=" + signature,
  521. multiple: true,
  522. success: (res) => {
  523. clearInterval(pingpangTimes);
  524. common_vendor.index.onSocketMessage((res2) => {
  525. if (res2.data.code == 500) {
  526. common_vendor.index.showToast({
  527. title: res2.data.msg,
  528. icon: "none",
  529. duration: 2e3
  530. });
  531. }
  532. const redata = JSON.parse(res2.data);
  533. console.log("WebSocket\u62FF\u5230\u7684\u4E1C\u897F", redata);
  534. this.talklist.push(redata.data);
  535. this.$nextTick(() => {
  536. this.scrollIntoView = `list_${this.talklist.length - 1}`;
  537. });
  538. if (redata.cmd == "deleteId") {
  539. common_vendor.index.$emit("deleteId");
  540. } else if (redata.cmd == "init") {
  541. common_vendor.index.$emit("init", redata.data);
  542. } else if (redata.cmd == "reload") {
  543. common_vendor.index.$emit("reload");
  544. } else if (redata.data.cmd == "sendRedPacketQuestion") {
  545. const list = JSON.parse(redata.data.data);
  546. this.redanswerAll = [...this.redanswerAll, ...list];
  547. if (this.redanswerAll[1].randomAmount !== null) {
  548. this.redanswertips = JSON.parse(this.redanswerAll[0].randomAmount);
  549. }
  550. console.log(this.redanswertips);
  551. console.log(this.redanswerAll);
  552. } else if (redata.data.cmd == "entry") {
  553. this.showWelcomeMessage = true;
  554. common_vendor.index.$emit("entry", redata.data);
  555. }
  556. });
  557. },
  558. error: (res) => {
  559. common_vendor.index.$emit("websocket", 0);
  560. console.log(res);
  561. }
  562. });
  563. common_vendor.index.onSocketOpen(() => {
  564. isSocketOpen = true;
  565. console.log("WebSocket\u8FDE\u63A5\u5DF2\u6253\u5F00\uFF01!");
  566. common_vendor.index.showToast({
  567. title: "\u63D2\u4EF6\u5DF2\u6253\u5F00",
  568. icon: "none"
  569. });
  570. });
  571. common_vendor.index.onSocketClose(() => {
  572. isSocketOpen = false;
  573. clearInterval(pingpangTimes);
  574. console.log("WebSocket\u8FDE\u63A5\u5DF2\u5173\u95ED\uFF01");
  575. common_vendor.index.showToast({
  576. title: "\u63D2\u4EF6\u79BB\u7EBF",
  577. icon: "none"
  578. });
  579. that.reConnect();
  580. });
  581. common_vendor.index.onSocketError(() => {
  582. isSocketOpen = false;
  583. clearInterval(pingpangTimes);
  584. console.log("WebSocket\u8FDE\u63A5\u6253\u5F00\u5931\u8D25");
  585. common_vendor.index.showToast({
  586. title: "\u63D2\u4EF6\u79BB\u7EBF",
  587. icon: "none"
  588. });
  589. common_vendor.index.showModal({
  590. content: "\u804A\u5929\u8FDE\u63A5\u5931\u8D25\u662F\u5426\u91CD\u65B0\u5C1D\u8BD5\u8FDE\u63A5",
  591. success() {
  592. that.reConnect();
  593. }
  594. });
  595. });
  596. },
  597. sendMsg() {
  598. if (isSocketOpen) {
  599. const data = {
  600. liveId: this.liveId,
  601. userId: this.userinfo.userId,
  602. userType: 0,
  603. cmd: "sendMsg",
  604. msg: this.value,
  605. nickName: this.userinfo.nickName,
  606. avatar: this.userinfo.avatar
  607. };
  608. if (this.value == "") {
  609. common_vendor.index.showToast({
  610. title: "\u4E0D\u80FD\u53D1\u9001\u7A7A\u6D88\u606F",
  611. icon: "none"
  612. });
  613. } else {
  614. socket.send({
  615. data: JSON.stringify(data),
  616. success: () => {
  617. console.log("\u53D1\u9001\u6210\u529F");
  618. this.value = "";
  619. },
  620. fail: () => {
  621. console.log("\u53D1\u9001\u5931\u8D25");
  622. }
  623. });
  624. }
  625. }
  626. }
  627. }
  628. };
  629. if (!Array) {
  630. const _easycom_u_avatar2 = common_vendor.resolveComponent("u-avatar");
  631. const _easycom_u_input2 = common_vendor.resolveComponent("u-input");
  632. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  633. const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
  634. (_easycom_u_avatar2 + _easycom_u_input2 + _easycom_u_icon2 + _easycom_u_popup2)();
  635. }
  636. const _easycom_u_avatar = () => "../../uni_modules/uview-plus/components/u-avatar/u-avatar.js";
  637. const _easycom_u_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
  638. const _easycom_u_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js";
  639. const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
  640. if (!Math) {
  641. (_easycom_u_avatar + _easycom_u_input + _easycom_u_icon + _easycom_u_popup)();
  642. }
  643. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  644. return common_vendor.e({
  645. a: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
  646. b: common_assets._imports_0,
  647. c: common_vendor.p({
  648. src: $data.livedata.liveImgUrl,
  649. size: "32"
  650. }),
  651. d: common_vendor.t($data.livedata.liveName ? $data.livedata.liveName : "\u82B3\u534E\u672A\u6765"),
  652. e: common_vendor.t($data.liveViewData.follow || $data.liveViewData.follow === 0 ? $data.liveViewData.follow : 0),
  653. f: $data.isFollow
  654. }, $data.isFollow ? {
  655. g: common_vendor.o((...args) => $options.onFollow && $options.onFollow(...args))
  656. } : {
  657. h: common_vendor.o((...args) => $options.onFollow && $options.onFollow(...args))
  658. }, {
  659. i: common_vendor.f($options.filteredViewers, (item, index, i0) => {
  660. return {
  661. a: index,
  662. b: item.avatar
  663. };
  664. }),
  665. j: common_vendor.t($data.liveViewData.online),
  666. k: common_vendor.o(($event) => $options.onLike()),
  667. l: common_vendor.t($data.liveViewData.like),
  668. m: common_vendor.o(($event) => $options.goStore()),
  669. n: common_vendor.t($data.orderUser.userName ? $options.maskString($data.orderUser.userName) : ""),
  670. o: common_vendor.t($data.orderUser.count || 0),
  671. p: $data.livingUrl,
  672. q: $data.autoplay,
  673. r: common_vendor.o((...args) => $options.videoError && $options.videoError(...args)),
  674. s: $data.isScreen ? "100vh" : "",
  675. t: common_vendor.f($data.talklist, (item, index, i0) => {
  676. return {
  677. a: common_vendor.t(item.msg),
  678. b: item.index,
  679. c: `list_${index}`,
  680. d: item.cmd == "announcement"
  681. };
  682. }),
  683. v: common_vendor.t($data.messageContent),
  684. w: common_vendor.f($data.talklist, (item, index, i0) => {
  685. return {
  686. a: common_vendor.t(item.nickName),
  687. b: common_vendor.t(item.msg),
  688. c: item.index,
  689. d: `list_${index}`,
  690. e: item.cmd == "sendMsg"
  691. };
  692. }),
  693. x: $data.showWelcomeMessage
  694. }, $data.showWelcomeMessage ? {
  695. y: common_vendor.f($data.talklist, (item, index, i0) => {
  696. return {
  697. a: common_vendor.t(item.nickName),
  698. b: common_vendor.t(item.msg),
  699. c: item.index,
  700. d: `list_${index}`,
  701. e: item.cmd == "entry" || item.cmd == "out"
  702. };
  703. }),
  704. z: common_vendor.t($data.messageContent)
  705. } : {}, {
  706. A: $data.scrollIntoView,
  707. B: common_vendor.o($options.sendMsg),
  708. C: common_vendor.o($options.sendMsg),
  709. D: common_vendor.o(($event) => $data.value = $event),
  710. E: common_vendor.p({
  711. placeholder: $data.placeholderText,
  712. border: "none",
  713. customStyle: "font-size:24rpx;",
  714. shape: "circle",
  715. color: "#fff",
  716. placeholderStyle: "color:#e7e7e7",
  717. modelValue: $data.value
  718. }),
  719. F: common_vendor.o(($event) => $data.shopping = !$data.shopping),
  720. G: common_vendor.o(($event) => $data.showziliao = !$data.showziliao),
  721. H: common_vendor.o(($event) => $data.showziliao = !$data.showziliao),
  722. I: common_vendor.p({
  723. name: "close",
  724. size: "18"
  725. }),
  726. J: $data.livedata.liveDesc,
  727. K: common_vendor.o($options.closes),
  728. L: common_vendor.p({
  729. show: $data.showziliao,
  730. round: "20",
  731. bgColor: "#fffee1"
  732. }),
  733. M: common_vendor.p({
  734. src: $data.livedata.liveImgUrl,
  735. size: "36"
  736. }),
  737. N: common_assets._imports_1,
  738. O: common_assets._imports_2,
  739. P: common_vendor.o((...args) => $options.onCollect && $options.onCollect(...args)),
  740. Q: common_assets._imports_3,
  741. R: common_vendor.o((...args) => $options.goOrderList && $options.goOrderList(...args)),
  742. S: common_vendor.f($data.products, (item, index, i0) => {
  743. return common_vendor.e({
  744. a: item.imgUrl,
  745. b: common_vendor.t(index + 1),
  746. c: common_vendor.t(item.productName),
  747. d: common_vendor.t(item.productIntroduce),
  748. e: common_vendor.t(item.sales),
  749. f: common_vendor.t(Math.trunc(item.price)),
  750. g: common_vendor.t($options.getPureDecimal(item.price) ? $options.getPureDecimal(item.price) : "00"),
  751. h: common_vendor.o(($event) => $options.onCollect(item)),
  752. i: item.status == 1
  753. }, item.status == 1 ? {
  754. j: common_vendor.o(($event) => $options.goShop(item.productId))
  755. } : item.status == 0 ? {
  756. l: common_vendor.o(($event) => $options.goShop(item.productId))
  757. } : {}, {
  758. k: item.status == 0,
  759. m: index
  760. });
  761. }),
  762. T: $data.boxHeight + "px",
  763. U: common_vendor.o($options.closeshop),
  764. V: common_vendor.o($options.open),
  765. W: common_vendor.p({
  766. show: $data.shopping,
  767. round: "20rpx",
  768. bgColor: "#f3f5f9"
  769. })
  770. });
  771. }
  772. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-55719d20"], ["__file", "C:/Users/Administrator/Desktop/\u9879\u76EE/\u76F4\u64AD/liveH5-v3/pages/home/living.vue"]]);
  773. wx.createPage(MiniProgramPage);