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

825 lines
10 KiB

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