App.vue 9.7 KB

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