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

767 lines
9.9 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
  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-10 {
  246. margin-top: 10upx;
  247. }
  248. .mar-top-20 {
  249. margin-top: 20upx;
  250. }
  251. .mar-top-30 {
  252. margin-top: 30upx;
  253. }
  254. .mar-top-32 {
  255. margin-top: 32upx;
  256. }
  257. .mar-top-36 {
  258. margin-top: 36upx;
  259. }
  260. .mar-top-40 {
  261. margin-top: 40upx;
  262. }
  263. .mar-top-50 {
  264. margin-top: 50upx;
  265. }
  266. .mar-top-60 {
  267. margin-top: 60upx;
  268. }
  269. .mar-top-70 {
  270. margin-top: 70upx;
  271. }
  272. .mar-top-100 {
  273. margin-top: 100upx;
  274. }
  275. .mar-top-percent40 {
  276. margin-top: 40%;
  277. }
  278. .mar-top-half {
  279. margin-top: 50%;
  280. }
  281. .mar-left-6 {
  282. margin-left: 6upx;
  283. }
  284. .mar-left-5 {
  285. margin-left: 5upx;
  286. }
  287. .mar-left-10 {
  288. margin-left: 10upx;
  289. }
  290. .mar-left-20 {
  291. margin-left: 20upx;
  292. }
  293. .mar-left-30 {
  294. margin-left: 30upx;
  295. }
  296. .mar-left-35 {
  297. margin-left: 35upx;
  298. }
  299. .mar-left-40 {
  300. margin-left: 40upx;
  301. }
  302. .mar-left-50 {
  303. margin-left: 50upx;
  304. }
  305. .mar-left-60 {
  306. margin-left: 60upx;
  307. }
  308. .mar-left-70 {
  309. margin-left: 70upx;
  310. }
  311. .mar-right-10 {
  312. margin-right: 10upx;
  313. }
  314. .mar-right-20 {
  315. margin-right: 20upx;
  316. }
  317. .mar-right-25 {
  318. margin-right: 25upx;
  319. }
  320. .mar-right-30 {
  321. margin-right: 30upx;
  322. }
  323. .mar-right-35 {
  324. margin-right: 35upx;
  325. }
  326. .mar-right-40 {
  327. margin-right: 40upx;
  328. }
  329. .mar-right-50 {
  330. margin-right: 50upx;
  331. }
  332. .pad-left-10 {
  333. padding-left: 10upx;
  334. }
  335. .pad-left-20 {
  336. padding-left: 20upx;
  337. }
  338. .pad-left-40 {
  339. padding-left: 40upx;
  340. }
  341. .pad-right-20 {
  342. padding-right: 20upx;
  343. }
  344. .pad-top-20 {
  345. padding-top: 20upx;
  346. }
  347. .pad-top-40 {
  348. padding-top: 40upx;
  349. }
  350. .pad-bot-20 {
  351. padding-bottom: 20upx;
  352. }
  353. .pad-topbot-20 {
  354. padding: 20upx 0upx;
  355. }
  356. .pad-topbot-5 {
  357. padding: 0upx 5upx;
  358. }
  359. .pad-topbot-10 {
  360. padding: 0upx 10upx;
  361. }
  362. .pad-topbot-50 {
  363. padding: 50upx 0upx;
  364. }
  365. .pad-bot-20 {
  366. padding-bottom: 20upx;
  367. }
  368. .pad-bot-30 {
  369. padding-bottom: 30upx;
  370. }
  371. .pad-bot-40 {
  372. padding-bottom: 40upx;
  373. }
  374. .pad-bot-100 {
  375. padding-bottom: 100upx;
  376. }
  377. .pad-bot-140 {
  378. padding-bottom: 140upx;
  379. }
  380. .bor-rad-30 {
  381. border-radius: 30upx;
  382. }
  383. .bor-rad-45 {
  384. border-radius: 45upx;
  385. }
  386. .bor-rad-half {
  387. border-radius: 50%;
  388. }
  389. .backColor {
  390. background-color: #009688;
  391. }
  392. .backColorFFF {
  393. background-color: #FFFFFF;
  394. }
  395. .pos-abs {
  396. position: absolute;
  397. }
  398. .bor-bot-line {
  399. border-bottom: #C8C7CC 1upx solid;
  400. }
  401. .bor-line-F7F7F7 {
  402. border-bottom: #F7F7F7 1upx solid;
  403. }
  404. .bor-line-E5E5E5 {
  405. border-bottom: #E5E5E5 1upx solid;
  406. }
  407. .borRig-line-E5E5E5 {
  408. border-right: #DDDDDD 2upx solid;
  409. }
  410. .borRig-line-20 {
  411. border-bottom: #F7F7F7 20upx solid;
  412. }
  413. .font-color-red {
  414. color: red;
  415. }
  416. .font-color-FFF {
  417. color: #FFFFFF;
  418. }
  419. .font-color-8A734A {
  420. color: #8A734A;
  421. }
  422. .font-color-71521B {
  423. color: #71521B;
  424. }
  425. .font-color-222 {
  426. color: #222222;
  427. }
  428. .font-color-333 {
  429. color: #333333;
  430. }
  431. .font-color-666 {
  432. color: #666666;
  433. }
  434. .font-color-999 {
  435. color: #999999;
  436. }
  437. .font-color-656 {
  438. color: #656565;
  439. }
  440. .font-color-DDD {
  441. color: #DDDDDD;
  442. }
  443. .font-color-CCC {
  444. color: #CCCCCC;
  445. }
  446. .font-color-FFEBC4 {
  447. color: #FFEBC4;
  448. }
  449. .font-color-1CC363 {
  450. color: #1CC363;
  451. }
  452. .font-color-47A7EE {
  453. color: #47A7EE;
  454. }
  455. .font-color-C5AA7B {
  456. color: #C5AA7B;
  457. }
  458. .font-color-FF7700 {
  459. color: #FF7700;
  460. }
  461. .font-color-FF7911 {
  462. color: #FF7911;
  463. }
  464. .font-color-80 {
  465. color: #808080;
  466. }
  467. .font-color-DD {
  468. color: #DD524D;
  469. }
  470. .font-color-C83732 {
  471. color: #C83732;
  472. }
  473. .font-color-3F {
  474. color: #3F536E;
  475. }
  476. .font-color-009 {
  477. color: #009688;
  478. }
  479. .font-weight-500 {
  480. font-weight: 500;
  481. }
  482. .font-weight-bold {
  483. font-weight: bold;
  484. }
  485. .overflow {
  486. overflow: hidden;
  487. text-overflow: ellipsis;
  488. white-space: nowrap;
  489. }
  490. .overflowNoDot {
  491. display: block;
  492. overflow: hidden;
  493. }
  494. .discountsPriceLine {
  495. text-decoration: line-through;
  496. }
  497. .border-bottom-Line {
  498. border-bottom: 1upx solid #EDEDED;
  499. }
  500. .decoration {
  501. text-decoration: line-through;
  502. }
  503. .anonymous {
  504. margin-top: 25upx;
  505. .uni-checkbox-input {
  506. border-color: #C5AA7B !important;
  507. width: 30upx;
  508. height: 30upx;
  509. }
  510. .uni-checkbox-input-checked:before {
  511. font-size: 30upx !important;
  512. }
  513. .uni-checkbox-input-checked {
  514. background: #C5AA7B;
  515. }
  516. }
  517. .footprint {
  518. .itemList {
  519. .uni-checkbox-input {
  520. border-color: #C5AA7B !important;
  521. width: 36upx;
  522. height: 36upx;
  523. border-radius: 50%;
  524. margin-right: 20upx;
  525. }
  526. .uni-checkbox-input-checked:before {
  527. font-size: 36upx !important;
  528. }
  529. .uni-checkbox-input-checked {
  530. background: #C5AA7B;
  531. }
  532. }
  533. }
  534. .itemInfo {
  535. uni-slider {
  536. margin: 0;
  537. .uni-slider-thumb {
  538. display: none;
  539. }
  540. .uni-slider-handle-wrapper {
  541. height: 18upx;
  542. border-radius: 0;
  543. border: 1upx solid #FF736C;
  544. }
  545. .uni-slider-track {
  546. border-radius: 0;
  547. }
  548. .uni-slider-tap-area {
  549. flex: 0 0 70%;
  550. padding: 0;
  551. }
  552. }
  553. }
  554. .uni-modal {
  555. padding: 20rpx;
  556. box-sizing: border-box;
  557. }
  558. uni-modal .uni-modal__ft:after {
  559. border-top: none;
  560. }
  561. uni-modal .uni-modal__btn {
  562. color: #333333;
  563. border: 2rpx solid #333333;
  564. font-weight: 400;
  565. margin: 0 10rpx;
  566. font-size: 28rpx;
  567. }
  568. .uni-tabbar .uni-tabbar__reddot {
  569. background: #C5AA7B;
  570. color: #FFFFFF;
  571. }
  572. uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
  573. border-color: #C5AA7B;
  574. }
  575. .u-arrow {
  576. display: inline-block;
  577. width: 20rpx;
  578. height: 20rpx;
  579. border-top: 1rpx solid #999;
  580. border-right: 1rpx solid #999;
  581. }
  582. .u-arrow-up {
  583. transform: rotate(-45deg);
  584. }
  585. .u-arrow-down {
  586. transform: rotate(135deg);
  587. }
  588. .u-arrow-left {
  589. transform: rotate(-135deg);
  590. }
  591. .u-arrow-right {
  592. transform: rotate(45deg);
  593. }
  594. .uni-picker-container .uni-picker-action.uni-picker-action-confirm {
  595. color: #C5AA7B;
  596. }
  597. .u-drawer-content {
  598. //border-radius: 0 !important;
  599. }
  600. </style>
  601. <style>
  602. .uni-modal__btn_primary {
  603. background: #333333;
  604. color: #FFEBC4 !important;
  605. }
  606. </style>