App.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. <script>
  2. // // #ifdef MP-WEIXIN
  3. // const miniShopPlugin = requirePlugin('mini-shop-plugin');
  4. // // #endif
  5. import NET from "@/utils/request";
  6. import API from "@/config/api";
  7. export default {
  8. onLaunch: function (options) {
  9. if (options && options.path === 'pages_category_page1/goodsModule/goodsDetails' && options.query) {
  10. this.globalData.productShareItem = options.query
  11. }
  12. if (options && options.path === 'pages_category_page1/store/index' && options.query) {
  13. this.globalData.shopShareItem = options.query
  14. }
  15. if (options && options.path === 'pages_category_page1/distributionModule/recruit' && options.query) {
  16. this.globalData.distributeRecruitItem = options.query
  17. }
  18. if (options && options.path === 'pages_category_page1/goodsModule/inviteSpell' && options.query) {
  19. this.globalData.inviteSpellShareItem = options.query
  20. }
  21. //判断设备是否为 iPhone
  22. const self = this
  23. uni.getSystemInfo({
  24. success: function (res) {
  25. console.log(res, '检查机型')
  26. // 根据 model 进行判断
  27. // const iphoneModels = [
  28. // 'iPhone X',
  29. // 'iPhone XR',
  30. // 'iPhone XS Max',
  31. // 'iPhone 11',
  32. // 'iPhone 11 Pro',
  33. // 'iPhone 11 Pro Max',
  34. // 'iPhone 12/13 (Pro)',
  35. // 'iPhone 12/13 mini',
  36. // 'iPhone 12/13 Pro Max'
  37. // ]
  38. if (res.safeArea.top > 20 && res.model.indexOf('iPhone') !== -1) {
  39. self.globalData.isIphone = true
  40. }
  41. }
  42. })
  43. // 购物车右上角数量
  44. if(uni.getStorageSync('storage_key')){
  45. NET.request(API.ShoppingCart, {}, 'GET').then(resCart => {
  46. let cartNum = 0
  47. resCart.data.forEach(shopItem=>{
  48. shopItem.skus.forEach(goodsItem=>{
  49. if (goodsItem.shelveState !== 0) {
  50. cartNum += goodsItem.number
  51. }
  52. })
  53. })
  54. uni.setStorageSync('allCartNum', cartNum)
  55. if (cartNum > 0) {
  56. uni.setTabBarBadge({
  57. index: 2,
  58. text: cartNum.toString()
  59. })
  60. }
  61. })
  62. }
  63. }
  64. ,
  65. globalData: {
  66. isIphone: false,
  67. }
  68. ,
  69. }
  70. ;
  71. </script>
  72. <style lang="scss">
  73. /*每个页面公共css */
  74. @import "uview-ui/index.scss";
  75. uni-rich-text img {
  76. max-width: 100% !important;
  77. }
  78. // 图片占位图
  79. .pic-img{
  80. width: 100%;
  81. height: 100%;
  82. }
  83. .default-img {
  84. background: url(./static/images/default.png) no-repeat center;
  85. background-size: 100% 100%;
  86. }
  87. .line1 {
  88. text-overflow: ellipsis;
  89. white-space: nowrap;
  90. overflow: hidden;
  91. }
  92. .wid {
  93. width: 100%;
  94. }
  95. .fs4 {
  96. font-size: 4upx;
  97. }
  98. .fs18 {
  99. font-size: 18upx;
  100. }
  101. .fs20 {
  102. font-size: 20upx;
  103. }
  104. .fs22 {
  105. font-size: 22upx;
  106. }
  107. .fs24 {
  108. font-size: 24upx;
  109. }
  110. .fs26 {
  111. font-size: 26upx;
  112. }
  113. .fs28 {
  114. font-size: 28upx;
  115. }
  116. .fs30 {
  117. font-size: 30upx;
  118. }
  119. .fs32 {
  120. font-size: 32upx;
  121. }
  122. .fs34 {
  123. font-size: 34upx;
  124. }
  125. .fs36 {
  126. font-size: 36upx;
  127. }
  128. .fs38 {
  129. font-size: 38upx;
  130. }
  131. .fs40 {
  132. font-size: 40upx;
  133. }
  134. .fs42 {
  135. font-size: 42upx;
  136. }
  137. .fs44 {
  138. font-size: 44upx;
  139. }
  140. .fs46 {
  141. font-size: 46upx;
  142. }
  143. .fs48 {
  144. font-size: 46upx;
  145. }
  146. .fs50 {
  147. font-size: 50upx;
  148. }
  149. .fs60 {
  150. font-size: 60upx;
  151. }
  152. .fs-bold {
  153. font-weight: bold;
  154. }
  155. .fs-weight-300 {
  156. font-weight: 300;
  157. }
  158. .fs-weight-200 {
  159. font-weight: 200;
  160. }
  161. .fs-weight-400 {
  162. font-weight: 400;
  163. }
  164. .flex-display {
  165. display: flex;
  166. }
  167. .flex-center {
  168. display: flex;
  169. justify-content: center;
  170. }
  171. .flex-items {
  172. display: flex;
  173. align-items: center;
  174. }
  175. .flex-items-plus {
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. .flex-start {
  181. display: flex;
  182. justify-content: flex-start;
  183. }
  184. .flex-end {
  185. display: flex;
  186. justify-content: flex-end;
  187. }
  188. .flex-end-plus {
  189. display: flex;
  190. justify-content: flex-end;
  191. align-items: center;
  192. }
  193. .flex-column {
  194. flex-direction: column
  195. }
  196. .flex-column-plus {
  197. display: flex;
  198. flex-direction: column
  199. }
  200. .flex-row {
  201. flex-direction: row
  202. }
  203. .flex-row-plus {
  204. display: flex;
  205. flex-direction: row
  206. }
  207. .flex-sp-around {
  208. justify-content: space-around;
  209. }
  210. .flex-sp-between {
  211. justify-content: space-between;
  212. }
  213. .text-align {
  214. text-align: center;
  215. }
  216. .flex-wrap-1 {
  217. display: flex;
  218. flex-wrap: wrap
  219. }
  220. .flex-nowrap-1 {
  221. display: flex;
  222. flex-wrap: nowrap
  223. }
  224. .align-end {
  225. display: flex;
  226. align-items: flex-end;
  227. }
  228. .align-sp-between {
  229. align-content: space-between;
  230. }
  231. .mar-top-5 {
  232. margin-top: 5upx;
  233. }
  234. .mar-top-10 {
  235. margin-top: 10upx;
  236. }
  237. .mar-top-20 {
  238. margin-top: 20upx;
  239. }
  240. .mar-top-30 {
  241. margin-top: 30upx;
  242. }
  243. .mar-top-32 {
  244. margin-top: 32upx;
  245. }
  246. .mar-top-36 {
  247. margin-top: 36upx;
  248. }
  249. .mar-top-40 {
  250. margin-top: 40upx;
  251. }
  252. .mar-top-50 {
  253. margin-top: 50upx;
  254. }
  255. .mar-top-60 {
  256. margin-top: 60upx;
  257. }
  258. .mar-top-70 {
  259. margin-top: 70upx;
  260. }
  261. .mar-top-100 {
  262. margin-top: 100upx;
  263. }
  264. .mar-top-percent40 {
  265. margin-top: 40%;
  266. }
  267. .mar-top-half {
  268. margin-top: 50%;
  269. }
  270. .mar-left-6 {
  271. margin-left: 6upx;
  272. }
  273. .mar-left-5 {
  274. margin-left: 5upx;
  275. }
  276. .mar-left-10 {
  277. margin-left: 10upx;
  278. }
  279. .mar-left-20 {
  280. margin-left: 20upx;
  281. }
  282. .mar-left-30 {
  283. margin-left: 30upx;
  284. }
  285. .mar-left-35 {
  286. margin-left: 35upx;
  287. }
  288. .mar-left-40 {
  289. margin-left: 40upx;
  290. }
  291. .mar-left-50 {
  292. margin-left: 50upx;
  293. }
  294. .mar-left-60 {
  295. margin-left: 60upx;
  296. }
  297. .mar-left-70 {
  298. margin-left: 70upx;
  299. }
  300. .mar-right-10 {
  301. margin-right: 10upx;
  302. }
  303. .mar-right-20 {
  304. margin-right: 20upx;
  305. }
  306. .mar-right-25 {
  307. margin-right: 25upx;
  308. }
  309. .mar-right-30 {
  310. margin-right: 30upx;
  311. }
  312. .mar-right-35 {
  313. margin-right: 35upx;
  314. }
  315. .mar-right-40 {
  316. margin-right: 40upx;
  317. }
  318. .mar-right-50 {
  319. margin-right: 50upx;
  320. }
  321. .pad-left-10 {
  322. padding-left: 10upx;
  323. }
  324. .pad-left-20 {
  325. padding-left: 20upx;
  326. }
  327. .pad-left-40 {
  328. padding-left: 40upx;
  329. }
  330. .pad-right-20 {
  331. padding-right: 20upx;
  332. }
  333. .pad-top-20 {
  334. padding-top: 20upx;
  335. }
  336. .pad-top-40 {
  337. padding-top: 40upx;
  338. }
  339. .pad-bot-20 {
  340. padding-bottom: 20upx;
  341. }
  342. .pad-topbot-20 {
  343. padding: 20upx 0upx;
  344. }
  345. .pad-topbot-5 {
  346. padding: 0upx 5upx;
  347. }
  348. .pad-topbot-10 {
  349. padding: 0upx 10upx;
  350. }
  351. .pad-topbot-50 {
  352. padding: 50upx 0upx;
  353. }
  354. .pad-bot-20 {
  355. padding-bottom: 20upx;
  356. }
  357. .pad-bot-30 {
  358. padding-bottom: 30upx;
  359. }
  360. .pad-bot-40 {
  361. padding-bottom: 40upx;
  362. }
  363. .pad-bot-100 {
  364. padding-bottom: 100upx;
  365. }
  366. .pad-bot-140 {
  367. padding-bottom: 140upx;
  368. }
  369. .bor-rad-30 {
  370. border-radius: 30upx;
  371. }
  372. .bor-rad-45 {
  373. border-radius: 45upx;
  374. }
  375. .bor-rad-half {
  376. border-radius: 50%;
  377. }
  378. .backColor {
  379. background-color: #009688;
  380. }
  381. .backColorFFF {
  382. background-color: #FFFFFF;
  383. }
  384. .pos-abs {
  385. position: absolute;
  386. }
  387. .bor-bot-line {
  388. border-bottom: #C8C7CC 1upx solid;
  389. }
  390. .bor-line-F7F7F7 {
  391. border-bottom: #F7F7F7 1upx solid;
  392. }
  393. .bor-line-E5E5E5 {
  394. border-bottom: #E5E5E5 1upx solid;
  395. }
  396. .borRig-line-E5E5E5 {
  397. border-right: #DDDDDD 2upx solid;
  398. }
  399. .borRig-line-20 {
  400. border-bottom: #F7F7F7 20upx solid;
  401. }
  402. .font-color-red {
  403. color: red;
  404. }
  405. .font-color-FFF {
  406. color: #FFFFFF;
  407. }
  408. .font-color-8A734A {
  409. color: #8A734A;
  410. }
  411. .font-color-71521B {
  412. color: #71521B;
  413. }
  414. .font-color-222 {
  415. color: #222222;
  416. }
  417. .font-color-333 {
  418. color: #333333;
  419. }
  420. .font-color-666 {
  421. color: #666666;
  422. }
  423. .font-color-999 {
  424. color: #999999;
  425. }
  426. .font-color-656 {
  427. color: #656565;
  428. }
  429. .font-color-DDD {
  430. color: #DDDDDD;
  431. }
  432. .font-color-CCC {
  433. color: #CCCCCC;
  434. }
  435. .font-color-FFEBC4 {
  436. color: #FFEBC4;
  437. }
  438. .font-color-1CC363 {
  439. color: #1CC363;
  440. }
  441. .font-color-47A7EE {
  442. color: #47A7EE;
  443. }
  444. .font-color-C5AA7B {
  445. color: #C5AA7B;
  446. }
  447. .font-color-FF7700 {
  448. color: #FF7700;
  449. }
  450. .font-color-FF7911 {
  451. color: #FF7911;
  452. }
  453. .font-color-80 {
  454. color: #808080;
  455. }
  456. .font-color-DD {
  457. color: #DD524D;
  458. }
  459. .font-color-C83732 {
  460. color: #C83732;
  461. }
  462. .font-color-3F {
  463. color: #3F536E;
  464. }
  465. .font-color-009 {
  466. color: #009688;
  467. }
  468. .font-weight-500 {
  469. font-weight: 500;
  470. }
  471. .font-weight-bold {
  472. font-weight: bold;
  473. }
  474. .overflow {
  475. overflow: hidden;
  476. text-overflow: ellipsis;
  477. white-space: nowrap;
  478. }
  479. .overflowNoDot {
  480. display: block;
  481. overflow: hidden;
  482. }
  483. .discountsPriceLine {
  484. text-decoration: line-through;
  485. }
  486. .border-bottom-Line {
  487. border-bottom: 1upx solid #EDEDED;
  488. }
  489. .decoration {
  490. text-decoration: line-through;
  491. }
  492. .anonymous {
  493. margin-top: 25upx;
  494. .uni-checkbox-input {
  495. border-color: #C5AA7B !important;
  496. width: 30upx;
  497. height: 30upx;
  498. }
  499. .uni-checkbox-input-checked:before {
  500. font-size: 30upx !important;
  501. }
  502. .uni-checkbox-input-checked {
  503. background: #C5AA7B;
  504. }
  505. }
  506. .footprint {
  507. .itemList {
  508. .uni-checkbox-input {
  509. border-color: #C5AA7B !important;
  510. width: 36upx;
  511. height: 36upx;
  512. border-radius: 50%;
  513. margin-right: 20upx;
  514. }
  515. .uni-checkbox-input-checked:before {
  516. font-size: 36upx !important;
  517. }
  518. .uni-checkbox-input-checked {
  519. background: #C5AA7B;
  520. }
  521. }
  522. }
  523. .itemInfo {
  524. uni-slider {
  525. margin: 0;
  526. .uni-slider-thumb {
  527. display: none;
  528. }
  529. .uni-slider-handle-wrapper {
  530. height: 18upx;
  531. border-radius: 0;
  532. border: 1upx solid #FF736C;
  533. }
  534. .uni-slider-track {
  535. border-radius: 0;
  536. }
  537. .uni-slider-tap-area {
  538. flex: 0 0 70%;
  539. padding: 0;
  540. }
  541. }
  542. }
  543. .uni-modal {
  544. padding: 20rpx;
  545. box-sizing: border-box;
  546. }
  547. uni-modal .uni-modal__ft:after {
  548. border-top: none;
  549. }
  550. uni-modal .uni-modal__btn {
  551. color: #333333;
  552. border: 2rpx solid #333333;
  553. font-weight: 400;
  554. margin: 0 10rpx;
  555. font-size: 28rpx;
  556. }
  557. .uni-tabbar .uni-tabbar__reddot {
  558. background: #C5AA7B;
  559. color: #FFFFFF;
  560. }
  561. uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
  562. border-color: #C5AA7B;
  563. }
  564. .u-arrow {
  565. display: inline-block;
  566. width: 20rpx;
  567. height: 20rpx;
  568. border-top: 1rpx solid #999;
  569. border-right: 1rpx solid #999;
  570. }
  571. .u-arrow-up {
  572. transform: rotate(-45deg);
  573. }
  574. .u-arrow-down {
  575. transform: rotate(135deg);
  576. }
  577. .u-arrow-left {
  578. transform: rotate(-135deg);
  579. }
  580. .u-arrow-right {
  581. transform: rotate(45deg);
  582. }
  583. .uni-picker-container .uni-picker-action.uni-picker-action-confirm {
  584. color: #C5AA7B;
  585. }
  586. .u-drawer-content {
  587. border-radius: 0 !important;
  588. }
  589. </style>
  590. <style>
  591. .uni-modal__btn_primary {
  592. background: #333333;
  593. color: #FFEBC4 !important;
  594. }
  595. </style>