package.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <div
  3. class="packageSty"
  4. :style="borderSty"
  5. @mouseover="mouseOver()"
  6. @mouseleave="mouseLeave()"
  7. @click="mouseClick()"
  8. >
  9. <div class="topSty">
  10. <div class="packageName" :style="`color:` + color">试用版</div>
  11. <div class="discription">体验全新XXX服务</div>
  12. <div class="price">
  13. <span class="yuan">¥</span><span class="num">10000.00</span
  14. ><span class="nian">/年 起</span>
  15. </div>
  16. <div class="memberCount">仅限5人</div>
  17. <div class="ktBtn">
  18. <el-button class="btnSty">开通</el-button>
  19. </div>
  20. </div>
  21. <div class="middleSty">
  22. <div class="mid">
  23. <el-tag size="mini" style="width: 100%">网页端应用</el-tag>
  24. </div>
  25. <div class="mid">
  26. <el-tree
  27. :data="data1"
  28. :props="defaultProps"
  29. :default-expand-all="true"
  30. ></el-tree>
  31. </div>
  32. <div class="mid">
  33. <el-tag size="mini" type="success" style="width: 100%"
  34. >小程序端应用</el-tag
  35. >
  36. </div>
  37. <div class="mid">
  38. <el-tree
  39. :data="data2"
  40. :props="defaultProps"
  41. :default-expand-all="true"
  42. ></el-tree>
  43. </div>
  44. </div>
  45. <div class="bottomSty">
  46. <div style="display: block">
  47. <div class="fuwuSty">使用培训:√</div>
  48. <div class="fuwuSty">疑问解答:√</div>
  49. <div class="fuwuSty">业务咨询:×</div>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. export default {
  56. name: "package-module",
  57. props: {
  58. color: {
  59. type: String,
  60. default: "#000000",
  61. },
  62. packName: {
  63. type: String,
  64. default: "nullName",
  65. },
  66. changeSty: {
  67. type: Function,
  68. },
  69. },
  70. data() {
  71. return {
  72. borderSty: "border-top:3px " + this.color + " solid",
  73. styFlag: false,
  74. data1: [
  75. {
  76. label: "一级 1",
  77. children: [
  78. {
  79. label: "二级 1-1",
  80. children: [
  81. {
  82. label: "三级 1-1-1",
  83. },
  84. ],
  85. },
  86. ],
  87. },
  88. {
  89. label: "一级 2",
  90. children: [
  91. {
  92. label: "二级 2-1",
  93. children: [
  94. {
  95. label: "三级 2-1-1",
  96. },
  97. ],
  98. },
  99. {
  100. label: "二级 2-2",
  101. children: [
  102. {
  103. label: "三级 2-2-1",
  104. },
  105. ],
  106. },
  107. ],
  108. },
  109. {
  110. label: "一级 3",
  111. children: [
  112. {
  113. label: "二级 3-1",
  114. children: [
  115. {
  116. label: "三级 3-1-1",
  117. },
  118. ],
  119. },
  120. {
  121. label: "二级 3-2",
  122. children: [
  123. {
  124. label: "三级 3-2-1",
  125. },
  126. ],
  127. },
  128. ],
  129. },
  130. ],
  131. data2: [
  132. {
  133. label: "一级 1",
  134. children: [
  135. {
  136. label: "二级 1-1",
  137. children: [
  138. {
  139. label: "三级 1-1-1",
  140. },
  141. ],
  142. },
  143. ],
  144. },
  145. {
  146. label: "一级 2",
  147. children: [
  148. {
  149. label: "二级 2-1",
  150. children: [
  151. {
  152. label: "三级 2-1-1",
  153. },
  154. ],
  155. },
  156. {
  157. label: "二级 2-2",
  158. children: [
  159. {
  160. label: "三级 2-2-1",
  161. },
  162. ],
  163. },
  164. ],
  165. },
  166. {
  167. label: "一级 3",
  168. children: [
  169. {
  170. label: "二级 3-1",
  171. children: [
  172. {
  173. label: "三级 3-1-1",
  174. },
  175. ],
  176. },
  177. {
  178. label: "二级 3-2",
  179. children: [
  180. {
  181. label: "三级 3-2-1",
  182. },
  183. ],
  184. },
  185. ],
  186. },
  187. ],
  188. defaultProps: {
  189. children: "children",
  190. label: "label",
  191. },
  192. };
  193. },
  194. mounted() {},
  195. methods: {
  196. changeStyFlag(flag) {
  197. this.styFlag = flag;
  198. if (!flag) this.mouseLeave();
  199. },
  200. mouseClick() {
  201. this.changeSty(this.packName);
  202. },
  203. mouseOver() {
  204. this.borderSty = "border:3px " + this.color + " solid";
  205. },
  206. mouseLeave() {
  207. if (!this.styFlag)
  208. this.borderSty = "border-top:3px " + this.color + " solid";
  209. },
  210. },
  211. };
  212. </script>
  213. <style scoped>
  214. .fuwuSty {
  215. width: 100%;
  216. text-align: center;
  217. font-family: Microsoft YaHei, Microsoft YaHei;
  218. font-weight: 400;
  219. font-size: 14px;
  220. color: #6f6f6f;
  221. line-height: 16px;
  222. letter-spacing: 1px;
  223. font-style: normal;
  224. text-transform: none;
  225. margin-top: 10px;
  226. }
  227. .mid {
  228. width: 90%;
  229. margin: 0 auto 10px auto;
  230. }
  231. .btnSty {
  232. background-color: #1890ff;
  233. width: 134px;
  234. height: 34px;
  235. font-family: Microsoft YaHei, Microsoft YaHei;
  236. font-weight: bold;
  237. font-size: 14px;
  238. color: #ffffff;
  239. line-height: 16px;
  240. letter-spacing: 1px;
  241. font-style: normal;
  242. text-transform: none;
  243. }
  244. .ktBtn {
  245. width: 100%;
  246. text-align: center;
  247. padding-top: 10px;
  248. }
  249. .memberCount {
  250. width: 100%;
  251. font-family: Microsoft YaHei, Microsoft YaHei;
  252. font-weight: 400;
  253. font-size: 14px;
  254. color: #333333;
  255. line-height: 16px;
  256. letter-spacing: 1px;
  257. text-align: center;
  258. font-style: normal;
  259. text-transform: none;
  260. }
  261. .yuan {
  262. font-size: 14px;
  263. color: #333333;
  264. }
  265. .num {
  266. font-size: 32px;
  267. color: #333333;
  268. }
  269. .nian {
  270. font-size: 14px;
  271. color: #333333;
  272. }
  273. .price {
  274. width: 100%;
  275. text-align: center;
  276. padding-top: 5px;
  277. }
  278. .discription {
  279. width: 100%;
  280. font-family: Microsoft YaHei, Microsoft YaHei;
  281. font-weight: 400;
  282. font-size: 14px;
  283. color: #333333;
  284. line-height: 16px;
  285. letter-spacing: 1px;
  286. text-align: center;
  287. font-style: normal;
  288. text-transform: none;
  289. margin-top: 10px;
  290. }
  291. .packageName {
  292. width: 100%;
  293. text-align: center;
  294. font-family: Microsoft YaHei, Microsoft YaHei;
  295. font-weight: 400;
  296. font-size: 20px;
  297. line-height: 23px;
  298. letter-spacing: 1px;
  299. font-style: normal;
  300. text-transform: none;
  301. }
  302. .topSty {
  303. width: 95%;
  304. height: 200px;
  305. margin: 5px auto 0 auto;
  306. border-bottom: 1px solid #ebebeb;
  307. }
  308. .middleSty {
  309. width: 95%;
  310. height: 450px;
  311. margin: 5px auto;
  312. overflow-y: scroll;
  313. padding-bottom: 15px;
  314. border-bottom: 1px solid #ebebeb;
  315. }
  316. /**隐藏滚动条 */
  317. ::-webkit-scrollbar {
  318. display: none;
  319. }
  320. .bottomSty {
  321. width: 95%;
  322. height: 100px;
  323. margin: 1px auto 5px auto;
  324. display: flex;
  325. justify-content: center;
  326. align-items: center;
  327. }
  328. .packageSty {
  329. width: 16%;
  330. float: left;
  331. margin-left: 2%;
  332. margin-right: 2%;
  333. border-radius: 10px;
  334. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  335. }
  336. </style>