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