DiyEnum.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <?php
  2. namespace common\enums;
  3. /**
  4. *
  5. * 装修枚举
  6. *
  7. * Class DiyEnum
  8. * @package common\enums
  9. */
  10. class DiyEnum
  11. {
  12. const HOME_PAGE = 'home_page';
  13. const GOODS_DETAIL = 'goods_detail';
  14. const USER_CENTER = 'user_center';
  15. const CUSTOM_PAGE = 'custom_page';
  16. const GOODS_TEMPLATE = 'goods_template';
  17. const HOME_PAGE_PATH = '/pages/index/index';
  18. const GOODS_DETAIL_PATH = '/plugins/pages/goods/detail';
  19. const GOODS_CATE_PATH = '/plugins/pages/goods/list';// 商品搜索
  20. const GOODS_MENU_PATH = '/pages/menu/index';// 商品分类
  21. const USER_CENTER_PATH = '/pages/user/index';
  22. const CUSTOM_PAGE_PATH = '/plugins/pages/diy_page/detail';
  23. const GROUP_BUY_GOODS_DETAIL = '/plugins/group_buy/groupDetail';// 拼团分享使用
  24. const GROUP_BUY_GOODS_INFO = '/plugins/group_buy/goodsDetail';// 拼团商品详情
  25. const GROUP_BUY_GOODS_LIST = '/plugins/group_buy/list';
  26. const GROUP_BUY_GOODS_COPY_LIST = '/plugins2/GroupBuyCopy/list';
  27. const SCORE_MALL_GOODS_LIST = '/plugins/score_mall/cateList';
  28. const FUN_MALL_GOODS_LIST = '/plugins4/FunMall/cateList';
  29. const BARGAIN_SHARE = '/plugins/bargain/bargain';
  30. const BARGAIN_GOODS_DETAIL = '/plugins/bargain/goodsDetail';
  31. const BARGAIN_GOODS_LIST = '/plugins/bargain/list';
  32. const COURSE_PATH = '/plugins/course/details';
  33. const OPERATING_NOTE_CONTENT_LIST = '/plugins/operating_note/detail';
  34. const LUCKY_GROUP_GOODS_DETAIL = '/plugins/LuckyGroup/productDetail';
  35. const LUCKY_GROUP_GOODS_LIST = '/plugins/LuckyGroup/cateList';
  36. const O2O_STORE_DETAIL = '/plugins2/Store/store/index';
  37. const O2O_STORE_CATE = '/plugins2/Store/store/salesroomclassify';
  38. const O2O_MCH_DETAIL = '/plugins/Mch/store/index';
  39. const O2O_MCH_CATE = '/plugins/Mch/store/salesroomclassify';
  40. const O2O_STORE_GOODS = '/plugins2/Store/store/storeDetail';
  41. const O2O_MCH_GOODS = '/plugins/Mch/store/index';
  42. const O2O_GOODS_DETAIL_PATH = '/plugins2/Store/store/storeDetail';
  43. const SECKILL_GOODS_INFO = '/plugins/pages/goods/detail';
  44. const SECONDARY_CARD_LIST = '/customAddons/SecondaryCard/myCardList';
  45. const PRODUCT_GIFT_GOODS_DETAIL = '/plugins/pages/goods/detail';
  46. const DEPOSIT_PRESALE_GOODS_DETAIL = '/plugins/deposit_presale/groupDetail';
  47. // const DEPOSIT_PRESALE_GOODS_LIST = '/plugins/deposit_presale/list';
  48. const DEPOSIT_PRESALE_CATEGORY_GOODS_LIST = 'plugins/earnest/list';
  49. const SMART_FORM_PAGE = '/plugins/SmartForm/SmartForm'; # 自定义表单
  50. const ALIPAY_MCH_COUPON_PAGE = '/plugins2/merchantVoucher/activeCoupon'; # 支付宝商家券
  51. // 底部导航默认数据
  52. const DEFULT_BUTTOM_NAV = '[{"selectedIconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590503_gCYTr0cg.png","iconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590503_gLpL5nCX.png","text":"首页","url":"\/pages\/index\/index","open_type":"page","params":{"title":"QMALL","route":"\/pages\/index\/index","open_type":"page","navigate":"navigateTo"}},{"selectedIconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590386_pCEjG1TB.png","text":"分类","iconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590382_COLL9mew.png","url":"\/pages\/menu\/index","open_type":"page","params":{"id":"2","name":"","title":"全部分类","cat_id":"4","open_type":"page","route":"\/pages\/menu\/index","remark":""}},{"selectedIconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590508_DXUc05dJ.png","text":"购物车","iconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590508_NKBUkndD.png","url":"\/pages\/cart\/index","open_type":"page","params":{"id":"4","name":"","title":"购物车","cat_id":"4","open_type":"page","route":"\/pages\/cart\/index","remark":""}},{"selectedIconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590515_p2Mq97rw.png","text":"我的","iconPath":"https:\/\/shuzixiangdao.oss-cn-guangzhou.aliyuncs.com\/images\/2021\/12\/04\/image_1638590515_bVB7u7gb.png","url":"\/pages\/user\/index","open_type":"page","params":{"id":"3","title":"我的","template":"user_center","created_at":"1619431341","route":"\/pages\/user\/index","open_type":"page"}}]';
  53. //登录页面
  54. const USER_LOGIN = '/pages/public/login'; # 登录页面
  55. const APP_DOWNLOAD_GUIDE = '/pages/public/registered'; # app下载引导页
  56. const STORE_GUARDIAN_TEMPLATE = '/pages/AntTechnology/storeIndex/index'; // 门店管家页面
  57. const GROUP_BUY_COPY_GOODS_DETAIL = '/plugins2/GroupBuyCopy/groupDetail';// 拼团新分享使用
  58. const GROUP_BUY_COPY_GOODS_INFO = '/plugins2/GroupBuyCopy/goodsDetail';// 拼团商品详情
  59. const GROUP_BUY_COPY_GOODS_LIST = '/plugins2/GroupBuyCopy/list';
  60. const LAO_DA_FU_GOODS_DETAIL_PATH = '/plugins2/LaoDaFu/store/storeDetail';
  61. const SCORE_GAME_SHOP_TYPE = '/customAddons/ScoreGame/physicalStore/storeList'; //积分增长赢-实体店分类
  62. const SCORE_GAME_MENBER_TYPE = '/customAddons/PhysicalTherapist/index';//积分增长赢-理疗师分类
  63. const SCORE_GAME_CONSUMER_CARD = '/customAddons/ScoreGame/consumerCardRecharge';//积分增长赢-消费卡充值
  64. const SCORE_GAME_SECONDARY_CARD = '/customAddons/ScoreSecondaryCard/cardList';//积分增长赢-次卡
  65. const O2O_STEWARD_STORE_CATE_SEARCH = '/customDesigns/AntTechnology/search/index';
  66. /**
  67. * 模板
  68. * @return array
  69. */
  70. public static function template(): array
  71. {
  72. return [
  73. self::HOME_PAGE => '系统首页',
  74. self::GOODS_DETAIL => '商品详情',
  75. self::USER_CENTER => '用户中心',
  76. self::CUSTOM_PAGE => '自定义页面',
  77. ];
  78. }
  79. /**
  80. * 页面对应路由
  81. * @Author: lun
  82. * @DateTime: 2021/11/4 0004 16:09
  83. * @Copyright: copyright (c) 2021 广东七件事集团
  84. * @return array|string[]
  85. */
  86. public static function templateRoute($template = '')
  87. {
  88. $data = [
  89. self::HOME_PAGE => self::HOME_PAGE_PATH,
  90. self::GOODS_DETAIL => self::GOODS_DETAIL_PATH,
  91. self::USER_CENTER => self::USER_CENTER_PATH,
  92. self::CUSTOM_PAGE => self::CUSTOM_PAGE_PATH,
  93. self::GOODS_TEMPLATE => self::GOODS_DETAIL_PATH,
  94. ];
  95. return $template ? $data[$template] : $data;
  96. }
  97. /**
  98. * 根据模板获取对应的组件分组
  99. * @Author: lun
  100. * @DateTime: 2021/9/27 0027 17:32
  101. * @Copyright: copyright (c) 2021 广东七件事集团
  102. * @param string $template
  103. * @return string[]|\string[][]
  104. */
  105. public static function getGroup($template = 'custom_page')
  106. {
  107. $groupArr = [
  108. 'home_page' => ['img_text', 'base_goods', 'marketing', 'store', 'other'],
  109. 'goods_detail' => ['goods', 'img_text', 'base_goods'],
  110. 'user_center' => ['member', 'img_text'],
  111. 'custom_page' => ['img_text', 'base_goods', 'marketing', 'store', 'other'],
  112. 'goods_template' => ['goods', 'img_text', 'goods_template'],
  113. ];
  114. return $template ? $groupArr[$template] : $groupArr;
  115. }
  116. /** 组件分类 **/
  117. public static function groupName(): array
  118. {
  119. return [
  120. /** 特殊组件开始 **/
  121. 'member' => '会员组件',
  122. 'goods' => '商品组件',
  123. /** 特殊组件结束 **/
  124. /** 基础组件开始 **/
  125. 'img_text' => '图文类',
  126. 'base_goods' => '商品类',
  127. 'marketing' => '营销类',
  128. 'store' => '门店组件',
  129. 'other' => '其他组件',
  130. 'goods_template' => '商品类',
  131. /** 基础组件结束 **/
  132. ];
  133. }
  134. /**
  135. * 模板分类
  136. * @Author: lun
  137. * @DateTime: 2021/12/13 0013 18:42
  138. * @Copyright: copyright (c) 2021 广东七件事集团
  139. * @param null $cate_id
  140. * @return string|string[]
  141. */
  142. public static function getTemplateCate($cate_id = null)
  143. {
  144. $data = [
  145. 1 => '其他',
  146. 2 => '美妆',
  147. 3 => '母婴用品',
  148. 4 => '珠宝',
  149. 5 => '日用百货',
  150. 6 => '服饰箱包',
  151. 7 => '家具',
  152. 8 => '节日',
  153. 9 => '食品/水果/生鲜',
  154. 10 => '家电',
  155. 11 => '百货市场',
  156. 12 => '线上教育',
  157. 13 => '门店',
  158. ];
  159. return $cate_id ? $data[$cate_id] : $data;
  160. }
  161. }