You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
2.8 KiB

6 months ago
  1. <script>
  2. export default {
  3. // 全局变量定义
  4. globalData:{
  5. dflindex:0,
  6. xflid:0,
  7. dflid:0,
  8. },
  9. onLaunch() {
  10. const updateManager = uni.getUpdateManager();
  11. updateManager.onCheckForUpdate(function (res) {
  12. // 请求完新版本信息的回调
  13. //console.log(res.hasUpdate);
  14. });
  15. updateManager.onUpdateReady(function (res) {
  16. uni.showModal({
  17. title: '更新提示',
  18. content: '新版本已经准备好,是否重启应用?',
  19. success(res) {
  20. if (res.confirm) {
  21. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  22. updateManager.applyUpdate();
  23. }
  24. }
  25. });
  26. });
  27. updateManager.onUpdateFailed(function (res) {
  28. // 新的版本下载失败
  29. uni.showModal({
  30. title: '自动更新提示',
  31. content: '新版本自动更新失败,请删除后重新进',
  32. success(res) {
  33. if (res.confirm) {
  34. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  35. updateManager.applyUpdate();
  36. }
  37. }
  38. });
  39. });
  40. },
  41. onShow() {},
  42. onHide() {},
  43. }
  44. </script>
  45. <style lang='scss'>
  46. /*每个页面公共css */
  47. @font-face {
  48. font-family: yticon;
  49. font-weight: normal;
  50. font-style: normal;
  51. src: url('https://at.alicdn.com/t/font_1078604_w4kpxh0rafi.ttf') format('truetype');
  52. }
  53. @import '/static/iconfont.css';
  54. /* 图片载入替代方案 */
  55. .image-wrapper {
  56. font-size: 0;
  57. background: #f3f3f3;
  58. border-radius: 4px;
  59. image {
  60. width: 100%;
  61. height: 100%;
  62. transition: .6s;
  63. opacity: 0;
  64. &.loaded {
  65. opacity: 1;
  66. }
  67. }
  68. }
  69. .yticon {
  70. font-family: "yticon" !important;
  71. font-size: 16px;
  72. font-style: normal;
  73. -webkit-font-smoothing: antialiased;
  74. -moz-osx-font-smoothing: grayscale;
  75. }
  76. /* 购物车图标 */
  77. .icon-gouwuche_:before {
  78. content: "\e630";
  79. }
  80. .icon-gouwuche:before {
  81. content: "\e609";
  82. }
  83. /*收藏图标 */
  84. .icon-shoucang:before {
  85. content: "\e645";
  86. }
  87. /* 价格上下图标 */
  88. .icon-shang:before {
  89. content: "\e624";
  90. }
  91. .icon-fenlei1:before {
  92. content: "\e620";
  93. }
  94. /* 支付图标 */
  95. .icon-weixinzhifu:before {
  96. content: "\e61a";
  97. }
  98. .icon-erjiye-yucunkuan:before {
  99. content: "\e623";
  100. }
  101. .icon-xuanzhong2:before {
  102. content: "\e62f";
  103. }
  104. /* 订单图标 */
  105. .icon-shouye:before {
  106. content: "\e626";
  107. }
  108. .icon-daifukuan:before {
  109. content: "\e68f";
  110. }
  111. .icon-yishouhuo:before {
  112. content: "\e71a";
  113. }
  114. .icon-shouhoutuikuan:before {
  115. content: "\e631";
  116. }
  117. /* 浏览历史记录 */
  118. .icon-lishijilu:before {
  119. content: "\e6b9";
  120. }
  121. /* 收货地址 */
  122. .icon-dizhi:before {
  123. content: "\e614";
  124. }
  125. .icon-shoucang_xuanzhongzhuangtai:before {
  126. content: "\e6a9";
  127. }
  128. .icon-shezhi1:before {
  129. content: "\e61d";
  130. }
  131. /* 联系客服 */
  132. .icon-pinglun-copy:before {
  133. content: "\e612";
  134. }
  135. </style>