App.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <script>
  2. var util = require('./utils/util.js');
  3. var api = require('./config/api.js');
  4. var user = require('./utils/user.js');
  5. export default {
  6. data() {
  7. return {};
  8. },
  9. onLaunch: function () {
  10. const updateManager = uni.getUpdateManager();
  11. uni.getUpdateManager().onUpdateReady(function () {
  12. uni.showModal({
  13. title: '更新提示',
  14. content: '新版本已经准备好,是否重启应用?',
  15. success: function (res) {
  16. if (res.confirm) {
  17. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  18. updateManager.applyUpdate();
  19. }
  20. }
  21. });
  22. });
  23. },
  24. onShow: function (options) {
  25. /*是否授权登录*/
  26. user.checkLogin()
  27. .then((res) => {
  28. this.globalData.hasLogin = true;
  29. if (this.globalData.checkLoginReadyCallback) {
  30. this.globalData.checkLoginReadyCallback();
  31. }
  32. })
  33. .catch(() => {
  34. this.globalData.hasLogin = false;
  35. });
  36. //购物车数据显示
  37. //user.cartcount();
  38. //获取其他小程序传过来的参数
  39. console.info(options);
  40. let query = options.query || {};
  41. if (query.orderId) {
  42. uni.navigateTo({
  43. url: 'pages/ucenter/serviceDetail/serviceDetail?orderId=' + query.orderId
  44. });
  45. }
  46. },
  47. globalData: {
  48. shopId: '',
  49. hasLogin: false,
  50. //是否授权登录
  51. isMember: false,
  52. //是否是会员
  53. userInfo: {},
  54. r_userid: 0,
  55. //推荐人id
  56. iscert: false,
  57. //是否注册过
  58. mapKey: 'JA2BZ-XGOEU-UNZVD-46G64-S6MYJ-6BBF4',
  59. currentLocationName: '位置获取中',
  60. rId: '',
  61. //引荐人ID
  62. shareImage: '',
  63. recommend: {
  64. //引荐人信息
  65. userName: '',
  66. avatarUrl: '',
  67. bCode: '',
  68. phone: '',
  69. unionId: '',
  70. openId: '',
  71. sessionKey: ''
  72. },
  73. infoGoods: {
  74. picUrl: '',
  75. name: '',
  76. brief: '',
  77. type: '0'
  78. },
  79. //信息收集,
  80. infoAddress: {
  81. addressId: '',
  82. addressDetail: ''
  83. },
  84. memberUserInfo: {
  85. nickName: '',
  86. avatarUrl: '/static/images/new/icon-user.png'
  87. },
  88. checkLoginReadyCallback: function () {
  89. //是否登录
  90. this.hasLogin = true;
  91. }
  92. }
  93. };
  94. //购物车隐藏
  95. // {
  96. // "pagePath": "pages/tabBar/cart/cart",
  97. // "iconPath": "static/images/cart.png",
  98. // "selectedIconPath": "static/images/cart@selected.png",
  99. // "text": "购物车"
  100. // },
  101. </script>
  102. <style>
  103. /**app.wxss**/
  104. .container {
  105. box-sizing: border-box;
  106. background-color: #f5f5f5;
  107. /* font-family: PingFangSC-Light, helvetica, 'Heiti SC'; */
  108. font-family: AlibabaPuHuiTi_2_55_Regular;
  109. }
  110. view,
  111. image,
  112. text,
  113. navigator {
  114. box-sizing: border-box;
  115. padding: 0;
  116. margin: 0;
  117. }
  118. page {
  119. color: #2a2a2a; /*主要颜色*/
  120. font-size: 28rpx;
  121. background: #f5f5f5;
  122. }
  123. text,
  124. view {
  125. /* font-family: PingFangSC-Light, helvetica, 'Heiti SC'; */
  126. font-family: AlibabaPuHuiTi_2_55_Regular;
  127. /* font-weight: 500; */
  128. }
  129. .sub-color {
  130. color: #85868a;
  131. }
  132. .jz-color {
  133. color: #09afff; /*鲸致色号00AFFF*/
  134. }
  135. .van-tab > view.van-ellipsis {
  136. color: #888;
  137. }
  138. .van-tab--active.van-tab > view.van-ellipsis {
  139. color: #09afff;
  140. }
  141. van-dialog .van-button {
  142. color: #09afff !important;
  143. }
  144. .van-dialog__message-text {
  145. color: #666;
  146. }
  147. .van-button--info {
  148. background: #09afff !important;
  149. border: none !important;
  150. }
  151. .bottom-fixed-btn-wrapper {
  152. position: fixed;
  153. bottom: 146rpx;
  154. left: 0;
  155. right: 28rpx;
  156. left: 28rpx;
  157. }
  158. .bottom-fixed-btn-wrapper .van-button {
  159. height: 74rpx;
  160. border: none;
  161. }
  162. .common-btn-wrapper {
  163. margin: 0 28rpx 0;
  164. }
  165. .common-btn-wrapper .van-button {
  166. height: 74rpx;
  167. margin: 0 0 48rpx 0;
  168. }
  169. </style>