方诺官网改正版
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.
 
 
 

307 lines
6.3 KiB

  1. <template>
  2. <div>
  3. <div class="createAn2-header intro-x">
  4. <span
  5. class="span1"
  6. :class="{ spanActive: item.laber }"
  7. @click="setIsList(index)"
  8. v-for="(item, index) in ceateData"
  9. :key="index"
  10. >{{ item.title }}</span
  11. >
  12. </div>
  13. <div class="createAn2-title intro-x">
  14. <div class="left">
  15. <div class="div1">全选享受套餐价 ¥ 12999</div>
  16. <div class="div2">终端全选享受套餐价</div>
  17. </div>
  18. <div class="right">
  19. <span class="span1" v-show="spanNum >= 1">已选{{ spanNum }}个</span>
  20. <span class="span2" @click="getMokuaiDataLabel">{{ laberText }}</span>
  21. </div>
  22. </div>
  23. <div class="createAn2-html">
  24. <div class="createAn2-content intro-x">
  25. <div
  26. :class="{ ActiveIiem: item.laber }"
  27. class="item-box"
  28. v-for="(item, index) in ceateData3"
  29. :key="index"
  30. @click="item.laber = !item.laber"
  31. >
  32. <div class="div-top">
  33. <img
  34. class="mokuai-img"
  35. :src="item.laber ?item.url2 : item.url1"
  36. alt=""
  37. />
  38. </div>
  39. <div style="float: left">
  40. <div class="yuanMoney">{{ item.title }}</div>
  41. <div class="taoMoney">套餐价¥ {{ item.preferential }}</div>
  42. </div>
  43. <div
  44. class="float-yuan"
  45. v-show="item.laber == true"
  46. :class="{ 'el-icon-check': item.laber }"
  47. ></div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. export default {
  55. props: ["ceateData1"],
  56. computed: {
  57. spanNum: function () {
  58. return this.ceateData3.filter((item) => {
  59. return item.laber === true;
  60. }).length;
  61. },
  62. // 数据二次处理
  63. ceateData: function () {
  64. this.ceateData1.forEach((item, index) => {
  65. if (index === 0) {
  66. item.laber = true;
  67. } else [(item.laber = false)];
  68. });
  69. return this.ceateData1;
  70. },
  71. },
  72. data() {
  73. return {
  74. isList: 1,
  75. laberText: "全选",
  76. ceateData3: [
  77. {
  78. title: "安卓端",
  79. url1: require("../assets/images/anzhuo1.png"),
  80. url2: require("../assets/images/anzhuo2.png"),
  81. laber: false,
  82. preferential: 12999,
  83. },
  84. {
  85. title: "IOS端",
  86. url1: require("../assets/images/ios1.png"),
  87. url2: require("../assets/images/ios2.png"),
  88. laber: false,
  89. preferential: 12999,
  90. },
  91. {
  92. title: "WEB端",
  93. url1: require("../assets/images/h51.png"),
  94. url2: require("../assets/images/h52.png"),
  95. laber: false,
  96. preferential: 12999,
  97. },
  98. {
  99. title: "小程序端",
  100. url1: require("../assets/images/xiaochengxu1.png"),
  101. url2: require("../assets/images/xiaochengxu2.png"),
  102. laber: false,
  103. preferential: 12999.12,
  104. },
  105. ],
  106. };
  107. },
  108. methods: {
  109. // 全选/反选
  110. getMokuaiDataLabel: function () {
  111. // 全选
  112. if (this.laberText === "全选") {
  113. this.ceateData3.forEach((item) => {
  114. return (item.laber = true);
  115. });
  116. this.laberText = "反选";
  117. } else {
  118. this.laberText = "全选";
  119. this.ceateData3.forEach((item) => {
  120. return (item.laber = false);
  121. });
  122. }
  123. },
  124. setIsList: function (i) {
  125. this.ceateData.forEach((item, index) => {
  126. if (i === index) {
  127. item.laber = true;
  128. } else {
  129. item.laber = false;
  130. }
  131. });
  132. },
  133. },
  134. };
  135. </script>
  136. <style lang="scss" scoped>
  137. .ActiveIiem {
  138. background: #1890ff !important;
  139. .rightTitle {
  140. color: #fff !important;
  141. }
  142. .rightContent {
  143. color: #74bcfe !important;
  144. }
  145. .yuanMoney {
  146. color: #74bcfe !important;
  147. }
  148. .taoMoney {
  149. color: #fff !important;
  150. }
  151. }
  152. .createAn2-header {
  153. width: 100%;
  154. text-align: center;
  155. padding: 30px 0;
  156. font-size: 18px;
  157. color: #333333;
  158. span {
  159. display: inline-block;
  160. padding-bottom: 4px;
  161. position: relative;
  162. cursor: pointer;
  163. }
  164. .span1 {
  165. margin-right: 30px;
  166. }
  167. .spanActive {
  168. color: #1890fe;
  169. }
  170. .spanActive::after {
  171. content: "";
  172. position: absolute;
  173. height: 4px;
  174. background: #1890ff;
  175. border-radius: 2px;
  176. bottom: 0;
  177. width: 90%;
  178. left: 5%;
  179. }
  180. }
  181. .createAn2-title {
  182. width: 45.6%;
  183. min-width: 812px;
  184. overflow: hidden;
  185. margin: auto;
  186. .left {
  187. float: left;
  188. .div1 {
  189. color: #333333;
  190. font-size: 16px;
  191. }
  192. .div2 {
  193. color: #999999;
  194. font-size: 12px;
  195. }
  196. }
  197. .right {
  198. float: right;
  199. .span1 {
  200. font-size: 18px;
  201. color: #333333;
  202. }
  203. .span2 {
  204. margin-left: 5px;
  205. background: #1890ff;
  206. font-size: 14px;
  207. color: #fff;
  208. width: 68px;
  209. height: 30px;
  210. line-height: 30px;
  211. text-align: center;
  212. display: inline-block;
  213. border-radius: 15px;
  214. }
  215. .span2:active {
  216. background: #2d97fa;
  217. }
  218. }
  219. }
  220. .createAn2-html {
  221. width: calc(45.6% + 12px);
  222. margin: 40px auto 0;
  223. min-width: 812px;
  224. }
  225. .createAn2-content {
  226. width: calc(100% + 12px);
  227. overflow: hidden;
  228. margin: auto;
  229. .item-box {
  230. width: 194px;
  231. height: 98px;
  232. box-sizing: border-box;
  233. background: #fcfcfd;
  234. border: 1px solid #f4f4f7;
  235. opacity: 1;
  236. border-radius: 16px;
  237. float: left;
  238. margin: 0 12px 12px 0;
  239. padding: 10px 12px;
  240. cursor: pointer;
  241. }
  242. .mokuai-img {
  243. width: 34px;
  244. height: 34px;
  245. float: left;
  246. margin-right: 4px;
  247. }
  248. .mokuai-right {
  249. float: left;
  250. width: 77%;
  251. .rightTitle {
  252. color: #333333;
  253. font-size: 14px;
  254. height: 18px;
  255. width: 100%;
  256. overflow: hidden;
  257. text-overflow: ellipsis;
  258. white-space: nowrap;
  259. }
  260. .rightContent {
  261. color: #999999;
  262. font-size: 12px;
  263. width: 100%;
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. }
  268. }
  269. .div-top {
  270. overflow: hidden;
  271. margin-bottom: 4px;
  272. }
  273. .yuanMoney {
  274. font-size: 12px;
  275. color: #999999;
  276. }
  277. .taoMoney {
  278. color: #1890ff;
  279. font-size: 12px;
  280. }
  281. .float-yuan {
  282. width: 20px;
  283. height: 20px;
  284. background: #ffffff;
  285. border-radius: 50%;
  286. float: right;
  287. margin-top: 15px;
  288. text-align: center;
  289. line-height: 20px;
  290. color: #1890ff;
  291. font-weight: bold;
  292. }
  293. }
  294. </style>