index.ux 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="index-wrap">
  3. <div class="img-box">
  4. <image class="start-img" src="../../assets/imgs/gidf.gif"></image>
  5. </div>
  6. <div class="img-box">
  7. <text>快用应启动中·····</text>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import router from '@system.router';
  13. import storage from '@system.storage';
  14. import { advShield } from "../../api";
  15. import pkg from '@system.package'
  16. export default {
  17. public: {
  18. send_order_id: "",
  19. push_id: "",
  20. bid: '',
  21. cid: '',
  22. back_name: '',
  23. back_url: '',
  24. back_pkg: '',
  25. platform: '',
  26. checkout_tx: "",
  27. showtoast: false,
  28. params: {}
  29. },
  30. async onInit(option) {
  31. this.params = option;
  32. if (this.push_id) {
  33. await storage.set({ key: "push_id", value: this.push_id });
  34. }
  35. if (this.send_order_id) {
  36. await storage.set({ key: "send_order_id", value: this.send_order_id });
  37. }
  38. if (this.platform) {
  39. await storage.set({ key: "currue_tx_bid", value: this.bid });
  40. await storage.set({ key: "platform", value: this.platform });
  41. }
  42. if (this.platform && (this.platform == 'tx_adq' || this.platform == 'tx_adq_new')) {
  43. if (this.back_url) {
  44. } else {
  45. this.checkout_tx = 'tx-no-ad';
  46. }
  47. }
  48. await this.advShield();
  49. this.gotoPage();
  50. },
  51. gotoPage() {
  52. if (this.params.bid) {
  53. router.replace({
  54. uri: "/views/Reader",
  55. params: this.params
  56. })
  57. } else {
  58. router.replace({
  59. uri: "/views/Index",
  60. })
  61. }
  62. }, async advShield() {
  63. try {
  64. let info = await advShield(this.send_order_id, this.platform, this.checkout_tx);
  65. if (JSON.stringify(info) != '{}' && info.bid && info.cid) {
  66. this.params.bid = info.bid,
  67. this.params.chapter_id = info.cid
  68. this.bid = info.bid;
  69. this.chapter_id = info.cid;
  70. }
  71. } catch (error) {
  72. }
  73. },onBackPress(){
  74. router.replace({
  75. uri: "/views/Index",
  76. })
  77. }
  78. }
  79. </script>
  80. <style lang="less">
  81. .index-wrap {
  82. width: 100%;
  83. background-color: antiquewhite;
  84. flex-direction: column;
  85. display: flex;
  86. justify-content: center;
  87. }.img-box{
  88. width: 100%;
  89. flex-direction: row;
  90. justify-content: center;
  91. }
  92. .start-img{
  93. width: 50%;
  94. }
  95. </style>