方诺官网改正版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

365 řádky
9.0 KiB

  1. <template>
  2. <div class="createAn4-box">
  3. <div class="laber-box intro-x">
  4. <div
  5. class="laberItem-box"
  6. :class="{
  7. isLaberTrue: payment == index,
  8. available: index == 0 || index == 1,
  9. }"
  10. v-for="(item, index) in ceateData4"
  11. :key="index"
  12. @click="getPayment(index)"
  13. >
  14. <img class="itemLeftImg" :src="item.icon" alt="" />
  15. <div class="laberContent">
  16. <div class="item1">{{ item.title }}</div>
  17. <div class="item2">{{ item.content }}</div>
  18. </div>
  19. <div
  20. class="float-yuan"
  21. :class="{ 'el-icon-check': payment === index }"
  22. v-show="payment === index"
  23. ></div>
  24. </div>
  25. </div>
  26. <div class="table-box intro-x">
  27. <el-table :data="tableData" style="width: 100%">
  28. <el-table-column label="账单明细" show-overflow-tooltip>
  29. <!-- eslint-disable-next-line -->
  30. <template slot-scope="scope">
  31. <div class="scopeTitle">{{ scope.row.content }}</div>
  32. <span class="scopeCotnent">{{
  33. scope.$index == 0
  34. ? "已选择功能模块"
  35. : scope.$index == 1
  36. ? "已选择插件"
  37. : "已选择终端"
  38. }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column
  42. align="right"
  43. prop="num"
  44. label="数量"
  45. width="103"
  46. show-overflow-tooltip
  47. >
  48. <!-- eslint-disable-next-line -->
  49. <template slot-scope="scope">
  50. <span>x{{ scope.row.num }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column
  54. align="right"
  55. label="优惠"
  56. width="100"
  57. show-overflow-tooltip
  58. >
  59. <!-- eslint-disable-next-line -->
  60. <template slot-scope="scope">
  61. <span class="scopeDiscounts">{{ scope.row.discounts }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column
  65. align="right"
  66. prop="money"
  67. label="金额"
  68. width="80"
  69. show-overflow-tooltip
  70. >
  71. </el-table-column>
  72. </el-table>
  73. </div>
  74. <div class="promotionCode-box intro-x">
  75. <div class="promotionCode">
  76. <span>优惠码</span>
  77. <div class="el-Input">
  78. <el-input placeholder="输入优惠码可在当前价格上再打折扣"></el-input>
  79. </div>
  80. </div>
  81. <div class="promotionMoney" v-if="CodeMoney >= 1">
  82. - ¥ {{ CodeMoney }}
  83. </div>
  84. </div>
  85. <div class="totalMoney-box intro-x">
  86. <div class="totalMoney-right">
  87. <div class="div1">总计金额</div>
  88. <!-- 使用 Vue filters过滤器 -->
  89. <div class="div2">¥ {{ tatalMoneys | formatMoney }}</div>
  90. <!-- <div class="div3">共省 ¥6234</div> -->
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. // import { formatMoney } from "../utils/formatMoney";
  97. export default {
  98. props: ["ceateData1", "ceateData2", "ceateData3"],
  99. filters: {
  100. formatMoney: function (
  101. number,
  102. decimals = 2,
  103. decPoint = ".",
  104. thousandsSep = ","
  105. ) {
  106. number = (number + "").replace(/[^0-9+-Ee.]/g, "");
  107. let n = !isFinite(+number) ? 0 : +number;
  108. let prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);
  109. let sep = typeof thousandsSep === "undefined" ? "," : thousandsSep;
  110. let dec = typeof decPoint === "undefined" ? "." : decPoint;
  111. let s = "";
  112. let toFixedFix = function (n, prec) {
  113. let k = Math.pow(10, prec);
  114. return "" + Math.ceil(n * k) / k;
  115. };
  116. s = (prec ? toFixedFix(n, prec) : "" + Math.round(n)).split(".");
  117. let re = /(-?\d+)(\d{3})/;
  118. while (re.test(s[0])) {
  119. s[0] = s[0].replace(re, "$1" + sep + "$2");
  120. }
  121. if ((s[1] || "").length < prec) {
  122. s[1] = s[1] || "";
  123. s[1] += new Array(prec - s[1].length + 1).join("0");
  124. }
  125. return s.join(dec);
  126. },
  127. },
  128. computed: {
  129. tableData: function () {
  130. let arr = [];
  131. let obj = {
  132. content: [],
  133. discounts: "享受打包价",
  134. money: 0,
  135. };
  136. for (let i in this.ceateData1) {
  137. obj.content.push(this.ceateData1[i].title);
  138. obj.num = Number(i) + 1;
  139. obj.money = obj.money + this.ceateData1[i].money;
  140. }
  141. obj.content = obj.content.join("、");
  142. arr.push(obj);
  143. obj = {
  144. content: [],
  145. discounts: "享受打包价",
  146. money: 0,
  147. };
  148. for (let i in this.ceateData2) {
  149. obj.content.push(this.ceateData2[i].content);
  150. obj.num = Number(i) + 1;
  151. obj.money = obj.money + Number(this.ceateData2[i].preferential);
  152. }
  153. obj.content = obj.content.join("、");
  154. arr.push(obj);
  155. obj = {
  156. content: [],
  157. discounts: "享受打包价",
  158. money: 0,
  159. };
  160. for (let i in this.ceateData3) {
  161. obj.content.push(this.ceateData3[i].title);
  162. obj.num = Number(i) + 1;
  163. obj.money = obj.money + Number(this.ceateData3[i].preferential);
  164. }
  165. obj.content = obj.content.join("、");
  166. arr.push(obj);
  167. return arr;
  168. },
  169. tatalMoneys: function () {
  170. let money = 0;
  171. for (let i in this.tableData) {
  172. money = money + this.tableData[i].money;
  173. }
  174. return money;
  175. },
  176. },
  177. data() {
  178. return {
  179. payment: 2,
  180. CodeMoney: 0,
  181. ceateData4: [
  182. {
  183. icon: require("../assets/images/xinyong.png"),
  184. title: "授信模式",
  185. content:
  186. "每个认证账户可以免费获得一次授信开通机会,认证芝麻信用分可以享受先用后付的权利(每月将从盈利订单中扣除相应服务费,最多扣除14000元),可随时切换成付费模式。",
  187. laber: true,
  188. },
  189. {
  190. icon: require("../assets/images/zhifubao.png"),
  191. title: "支付宝支付",
  192. content:
  193. "一次付费即可享用相应购买版本的所有内容,购买满足条件可享受打包价格,完善认证信息可享500元优惠券,可用于购买服务抵扣费用。",
  194. laber: false,
  195. },
  196. {
  197. icon: require("../assets/images/qianbao.png"),
  198. title: "余额支付",
  199. content:
  200. "选择账号内所充值的金额来进行支付,支付前会检测当前账号余额是否充足。支付成功后会奖励500元优惠券,可以用购买服务抵扣费用。",
  201. laber: false,
  202. },
  203. ],
  204. };
  205. },
  206. methods: {
  207. getPayment: function (index) {
  208. if (index === 0 || index === 1) {
  209. this.$alert("授权模式暂未开放,请选择其他方式", "提示", {
  210. confirmButtonText: "确定",
  211. callback: (action) => {},
  212. });
  213. return;
  214. }
  215. this.payment = index;
  216. },
  217. created() {},
  218. },
  219. };
  220. </script>
  221. <style lang="scss" scoped>
  222. .createAn4-box {
  223. margin-top: 30px;
  224. padding: 0 116px;
  225. .laber-box {
  226. width: 100%;
  227. overflow: hidden;
  228. .laberItem-box {
  229. float: left;
  230. width: 32%;
  231. min-width: 355px;
  232. max-width: 430px;
  233. height: 132px;
  234. background: #fff;
  235. padding: 20px;
  236. box-sizing: border-box;
  237. overflow: hidden;
  238. border: 1px solid #eef2f7;
  239. cursor: pointer;
  240. border-radius: 22px;
  241. margin: 0 2% 2% 0;
  242. }
  243. .laberItem-box:last-child {
  244. margin: 0;
  245. }
  246. }
  247. .itemLeftImg {
  248. width: 48px;
  249. height: 48px;
  250. margin: 22px 20px 42px 0;
  251. float: left;
  252. }
  253. .laberContent {
  254. float: left;
  255. width: 76%;
  256. min-width: 250px;
  257. .item1 {
  258. color: #333333;
  259. font-size: 14px;
  260. }
  261. .item2 {
  262. font-size: 12px;
  263. color: #999999;
  264. }
  265. }
  266. .float-yuan {
  267. width: 20px;
  268. height: 20px;
  269. background: #1890ff;
  270. border-radius: 50%;
  271. float: right;
  272. margin-top: 38px;
  273. text-align: center;
  274. line-height: 20px;
  275. color: #ffffff;
  276. font-weight: bold;
  277. box-shadow: #e2e2e2 0px 0px 2px;
  278. }
  279. .isLaberTrue {
  280. border-color: #1890ff !important;
  281. }
  282. }
  283. .available {
  284. background: #f5f4f4 !important;
  285. cursor: not-allowed !important;
  286. }
  287. .scopeTitle {
  288. color: #333;
  289. font-size: 14px;
  290. }
  291. .scopeCotnent {
  292. color: #999999 !important;
  293. font-size: 12px !important;
  294. }
  295. .scopeDiscounts {
  296. color: #ff4242;
  297. }
  298. .promotionCode-box {
  299. overflow: hidden;
  300. margin-top: 13px;
  301. .promotionCode {
  302. float: left;
  303. span {
  304. display: inline-block;
  305. height: 40px;
  306. line-height: 40px;
  307. margin-right: 10px;
  308. color: #333333;
  309. font-size: 14px;
  310. }
  311. .el-Input {
  312. display: inline-block;
  313. height: 40px;
  314. width: 465px;
  315. }
  316. }
  317. .promotionMoney {
  318. float: right;
  319. height: 40px;
  320. line-height: 40px;
  321. color: #ff4242;
  322. font-size: 14px;
  323. }
  324. }
  325. .totalMoney-box {
  326. overflow: hidden;
  327. .totalMoney-right {
  328. float: right;
  329. text-align: right;
  330. .div1 {
  331. font-size: 16px;
  332. color: #728196;
  333. }
  334. .div2 {
  335. color: #1890ff;
  336. font-weight: bold;
  337. font-size: 20px;
  338. margin: 4px 0;
  339. }
  340. .div3 {
  341. font-size: 14px;
  342. color: #394251;
  343. }
  344. }
  345. }
  346. </style>