多租户商城-商户小程序端
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.

768 lines
9.9 KiB

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