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

755 lines
9.6 KiB

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