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

761 lines
9.7 KiB

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