方诺官网改正版
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CreateAn.vue 8.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <div>
  3. <h2 class="createTitle">创建应用</h2>
  4. <div class="createHtml-box">
  5. <div class="createHtml">
  6. <div class="createBody">
  7. <div class="steps-box">
  8. <el-steps :active="component - 1" align-center>
  9. <el-step
  10. title="选择功能板块"
  11. description="选择想要您想要创建的功能,可多选,选择多"
  12. ></el-step>
  13. <el-step
  14. title="选择插件"
  15. description="选择已经您想要添加到您的应用里面的功能模"
  16. ></el-step>
  17. <el-step
  18. title="选择终端"
  19. description="选择想要新建的应用,可多选,选择后前往选"
  20. ></el-step>
  21. <el-step
  22. title="选择支付方式"
  23. description="支付方式为授信模式与付费方式,目前仅导购"
  24. ></el-step>
  25. <el-step
  26. title="创建应用"
  27. description="立即填写应用的名字吧!给你的软件起个响亮"
  28. ></el-step>
  29. </el-steps>
  30. </div>
  31. </div>
  32. </div>
  33. <keep-alive>
  34. <component
  35. ref="createAn"
  36. :is="isComponentName"
  37. :ceateData1="ceateData1"
  38. :ceateData2="ceateData2"
  39. :ceateData3="ceateData3"
  40. :loading8="loading8"
  41. :isSucceed="isSucceed"
  42. ></component>
  43. </keep-alive>
  44. <div class="createrAn-Buttom intro-x" v-if="isButtom1">
  45. <span class="span0 span1" @click="lastStep">{{
  46. component == 1 ? "取消" : "上一步"
  47. }}</span>
  48. <span class="span0 span2" @click="nextStep">下一步</span>
  49. </div>
  50. <div class="createrAn-Buttom intro-x" v-if="isButtom2">
  51. <span class="span9 span1" @click="lastStep2" v-if="!isSucceed"
  52. >返回重新选择支付方式</span
  53. >
  54. <span class="span9 span2" @click="nextStep2">
  55. {{ isSucceed ? "下一步" : "点击前往充值页面进行充值" }}</span
  56. >
  57. </div>
  58. <div class="createrAn-Buttom intro-x" v-if="isButtom3">
  59. <span class="span9 span1" @click="nextStep3('稍后设置')">稍后设置</span>
  60. <span class="span9 span2" @click="nextStep3('下一步')">下一步</span>
  61. </div>
  62. <div class="createrAn-Buttom intro-x" v-if="isButtom4">
  63. <span
  64. class="span9 span2"
  65. :class="{ loading8Clss: loading8 }"
  66. @click="nextStep4"
  67. >前往我的应用页面</span
  68. >
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import createAn1 from "../modules/createAn1";
  75. import createAn2 from "../modules/createAn2";
  76. import createAn3 from "../modules/createAn3";
  77. import createAn4 from "../modules/createAn4";
  78. import createAn5 from "../modules/createAn5";
  79. import createAn6 from "../modules/createAn6";
  80. import createAn7 from "../modules/createAn7";
  81. import createAn8 from "../modules/createAn8";
  82. import { aget } from '../utils/api/myapp'
  83. export default {
  84. data() {
  85. return {
  86. component: 1,
  87. isComponentName: "createAn1",
  88. loading8: true,
  89. isButtom2: false,
  90. isSucceed: true,
  91. isButtom3: false,
  92. isButtom4: false,
  93. ceateData1: [], // 第一步数据
  94. ceateData2: [], //第二步数据
  95. ceateData3: [], // 第三步数据
  96. ceateData7: [], //第七步数据
  97. };
  98. },
  99. mounted() {
  100. this.getInit()
  101. },
  102. methods: {
  103. getInit: function(){
  104. console.log(123)
  105. aget('/api/myapp/list').then(res=>{
  106. console.log(res)
  107. })
  108. },
  109. nextStep: function () {
  110. if (this.component === 1) {
  111. // 第一步
  112. this.ceateData1 = this.$refs.createAn.ceateData1.filter((item) => {
  113. return item.laber === true;
  114. });
  115. if (this.ceateData1.length === 0) {
  116. this.$message.error("请选择功能板块");
  117. return;
  118. }
  119. this.isComponentName = "createAn2";
  120. this.component = 2;
  121. return;
  122. }
  123. if (this.component === 2) {
  124. this.ceateData2 = this.$refs.createAn.ceateData2.filter((item) => {
  125. return item.laber === true;
  126. });
  127. if (this.ceateData2.length >= 1) {
  128. this.isComponentName = "createAn3";
  129. this.component = 3;
  130. return;
  131. } else {
  132. this.$message.error("请选择至少一个模块");
  133. }
  134. }
  135. if (this.component === 3) {
  136. this.ceateData3 = this.$refs.createAn.ceateData3.filter((item) => {
  137. return item.laber === true;
  138. });
  139. if (this.ceateData3.length >= 1) {
  140. this.isComponentName = "createAn4";
  141. this.component = 4;
  142. return;
  143. } else {
  144. this.$message.error("请选择至少一个插件");
  145. }
  146. }
  147. if (this.component === 4) {
  148. if (this.isComponentName === "createAn4") {
  149. console.log("总价:" + this.$refs.createAn.tatalMoneys);
  150. this.isComponentName = "createAn5";
  151. return;
  152. }
  153. if (this.isComponentName === "createAn5") {
  154. console.log(this.$refs.createAn.code);
  155. if (this.$refs.createAn.code == "") {
  156. this.$message.error("请输入验证码");
  157. return;
  158. }
  159. this.isButtom2 = true;
  160. // this.isSucceed = false // 控制支付成功或者失败状态
  161. this.isComponentName = "createAn6";
  162. return;
  163. }
  164. return;
  165. }
  166. },
  167. nextStep2: function () {
  168. // 前往支付页面或者下一步
  169. if (this.isSucceed) {
  170. // 下一步
  171. this.isComponentName = "createAn7";
  172. this.isButtom3 = true;
  173. this.isButtom2 = false;
  174. } else {
  175. console.log("前往支付");
  176. // 前往支付页面
  177. }
  178. },
  179. nextStep3: function (value) {
  180. if (value === "稍后设置") {
  181. this.isComponentName = "createAn8";
  182. } else {
  183. // 下一步
  184. this.isComponentName = "createAn8";
  185. }
  186. this.isButtom3 = false;
  187. this.isButtom4 = true;
  188. this.component = 5;
  189. setTimeout(() => {
  190. this.loading8 = false;
  191. }, 2000);
  192. },
  193. // 前往我的应用页面
  194. nextStep4: function () {
  195. console.log("前往我的应用页面");
  196. this.$router.push("/Dashboard/myApp");
  197. },
  198. // left
  199. lastStep: function () {
  200. if (this.isComponentName === "createAn6") {
  201. this.isComponentName = "createAn5";
  202. return;
  203. }
  204. if (this.isComponentName === "createAn5") {
  205. this.isComponentName = "createAn4";
  206. return;
  207. }
  208. if (this.component >= 2) {
  209. this.component--;
  210. this.isComponentName = "createAn" + this.component;
  211. return;
  212. }
  213. },
  214. lastStep2: function () {
  215. this.isComponentName = "createAn5";
  216. this.isButtom2 = false;
  217. this.isSucceed = true;
  218. },
  219. },
  220. components: {
  221. createAn1,
  222. createAn2,
  223. createAn3,
  224. createAn4,
  225. createAn5,
  226. createAn6,
  227. createAn7,
  228. createAn8,
  229. },
  230. computed: {
  231. isButtom1: function () {
  232. let arr = [
  233. "createAn1",
  234. "createAn2",
  235. "createAn3",
  236. "createAn4",
  237. "createAn5",
  238. ];
  239. let type = false;
  240. for (let i in arr) {
  241. if (this.isComponentName.indexOf(arr[i]) != -1) {
  242. type = true;
  243. break;
  244. } else {
  245. type = false;
  246. }
  247. }
  248. return type;
  249. },
  250. },
  251. };
  252. </script>
  253. <style lang="scss" scoped>
  254. .createTitle {
  255. margin: 41px 0 15px;
  256. color: #2d3748;
  257. font-size: 18px;
  258. display: block;
  259. }
  260. .createHtml-box {
  261. overflow: hidden;
  262. background: #fff;
  263. border-radius: 22px;
  264. box-shadow: 0px 3px 20px rgba(0, 0, 0, 0.03);
  265. }
  266. .createHtml {
  267. border-bottom: 1px solid #f5f5f5;
  268. padding-bottom: 20px;
  269. }
  270. .createBody {
  271. width: 100%;
  272. background: #ffffff;
  273. border-radius: 22px;
  274. }
  275. .steps-box {
  276. padding: 10px 100px 10px;
  277. }
  278. .createrAn-Buttom {
  279. text-align: center;
  280. padding: 40px 0 80px;
  281. .span0 {
  282. display: inline-block;
  283. width: 96px;
  284. height: 37px;
  285. line-height: 37px;
  286. box-sizing: border-box;
  287. text-align: center;
  288. border-radius: 12px;
  289. cursor: pointer;
  290. }
  291. .span9 {
  292. display: inline-block;
  293. width: 208px;
  294. height: 37px;
  295. line-height: 37px;
  296. box-sizing: border-box;
  297. text-align: center;
  298. border-radius: 12px;
  299. cursor: pointer;
  300. }
  301. .span1 {
  302. color: #788598;
  303. background: #edf1f6;
  304. }
  305. .span1:active {
  306. background: #f8f8f8;
  307. }
  308. .span2 {
  309. color: rgb(235, 233, 233);
  310. background: #1890ff;
  311. margin-left: 20px;
  312. }
  313. .span2:active {
  314. background: #2d97fa;
  315. }
  316. }
  317. .loading8Clss {
  318. background: #e2f0ff !important;
  319. cursor: no-drop !important;
  320. color: #ffffff !important;
  321. }
  322. </style>