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

846 lines
11 KiB

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