index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <style>
  2. .form-body {
  3. padding: 20px 50% 20px 20px;
  4. background-color: #fff;
  5. margin-bottom: 20px;
  6. min-width: 1000px
  7. }
  8. .form-button {
  9. margin: 0;
  10. }
  11. .form-button .el-form-item__content {
  12. margin-left: 0 !important;
  13. }
  14. .button-item {
  15. padding: 9px 25px;
  16. }
  17. .red {
  18. color: #ff4544
  19. }
  20. .id-card {
  21. position: relative;
  22. /*height: 170px;*/
  23. width: 190px;
  24. float: left;
  25. text-align: center;
  26. /*margin-bottom: 20px;*/
  27. font-size: 12px;
  28. color: #666;
  29. margin-right: 30px;
  30. }
  31. .id-card img {
  32. max-height: 134px;
  33. max-width: 190px;
  34. background-color: #EEEFF3;
  35. }
  36. .card-upload .el-button {
  37. position: absolute;
  38. left: 50%;
  39. top: 50%;
  40. margin-top: -16px;
  41. margin-left: -16px;
  42. z-index: 1;
  43. }
  44. .com-attachment .card-upload {
  45. width: 100%;
  46. height: 100%;
  47. }
  48. .background-box {
  49. width: 100%;
  50. background-size: cover;
  51. background-repeat: no-repeat;
  52. background-position: center;
  53. padding-top: 100px;
  54. }
  55. .background-box .title {
  56. width: 280px;
  57. height: 138px;
  58. margin: auto;
  59. background-size: contain;
  60. background-repeat: no-repeat;
  61. margin-bottom: 50px;
  62. }
  63. .all-components {
  64. background: #fff;
  65. padding: 20px;
  66. }
  67. .all-components .component-group {
  68. border: 1px solid #eeeeee;
  69. width: 300px;
  70. margin-bottom: 20px;
  71. }
  72. .all-components .component-group:last-child {
  73. margin-bottom: 0;
  74. }
  75. .all-components .component-group-name {
  76. height: 35px;
  77. line-height: 35px;
  78. background: #f7f7f7;
  79. padding: 0 20px;
  80. border-bottom: 1px solid #eeeeee;
  81. }
  82. .all-components .component-list {
  83. margin-right: -2px;
  84. margin-top: -2px;
  85. flex-wrap: wrap;
  86. }
  87. .all-components .component-list .component-item {
  88. width: 100px;
  89. height: 100px;
  90. border: 0 solid #eeeeee;
  91. border-width: 0 1px 1px 0;
  92. text-align: center;
  93. padding: 15px 0 0;
  94. cursor: pointer;
  95. }
  96. .all-components .component-list .component-icon {
  97. width: 40px;
  98. height: 40px;
  99. /*border: 1px solid #eee;*/
  100. }
  101. .all-components .component-list .component-name {}
  102. #diy-list {
  103. width: 95%;
  104. padding: 20px;
  105. float: left;
  106. margin: 20px;
  107. border: 1px solid #eeeeee;
  108. }
  109. .all-components {
  110. background: #fff;
  111. padding: 20px;
  112. }
  113. .all-components .component-group {
  114. border: 1px solid #eeeeee;
  115. width: 300px;
  116. margin-bottom: 20px;
  117. }
  118. .all-components .component-group:last-child {
  119. margin-bottom: 0;
  120. }
  121. .all-components .component-group-name {
  122. height: 35px;
  123. line-height: 35px;
  124. background: #f7f7f7;
  125. padding: 0 20px;
  126. border-bottom: 1px solid #eeeeee;
  127. }
  128. .all-components .component-list {
  129. margin-right: -2px;
  130. margin-top: -2px;
  131. flex-wrap: wrap;
  132. }
  133. .all-components .component-list .component-item {
  134. width: 100px;
  135. height: 100px;
  136. border: 0 solid #eeeeee;
  137. border-width: 0 1px 1px 0;
  138. text-align: center;
  139. padding: 15px 0 0;
  140. cursor: pointer;
  141. }
  142. .all-components .component-list .component-icon {
  143. width: 40px;
  144. height: 40px;
  145. /*border: 1px solid #eee;*/
  146. }
  147. .all-components .component-list .component-name {}
  148. .mobile-framework {
  149. width: 375px;
  150. height: 100%;
  151. }
  152. .mobile-framework-header {
  153. height: 60px;
  154. line-height: 60px;
  155. background: #333;
  156. color: #fff;
  157. text-align: center;
  158. background: url("<?= Yii::getAlias('@attachurl') ?>"+"/static/addons/DepositPresale/head.png") no-repeat;
  159. }
  160. .mobile-framework-body {
  161. min-height: 645px;
  162. border: 1px solid #e2e2e2;
  163. background: #f5f7f9;
  164. }
  165. .mobile-framework .diy-component-preview {
  166. cursor: pointer;
  167. position: relative;
  168. zoom: 0.5;
  169. -moz-transform: scale(0.5);
  170. -moz-transform-origin: top left;
  171. font-size: 28px;
  172. }
  173. @-moz-document url-prefix() {
  174. .mobile-framework .diy-component-preview {
  175. cursor: pointer;
  176. position: relative;
  177. -moz-transform: scale(0.5);
  178. -moz-transform-origin: top left;
  179. font-size: 28px;
  180. width: 200% !important;
  181. height: 100%;
  182. margin-bottom: auto;
  183. }
  184. .mobile-framework .active .diy-component-preview {
  185. border: 2px dashed #409EFF;
  186. left: -2px;
  187. right: -2px;
  188. width: calc(200% + 4px) !important;
  189. }
  190. }
  191. .mobile-framework .diy-component-preview:hover {
  192. box-shadow: inset 0 0 10000px rgba(0, 0, 0, .03);
  193. }
  194. .mobile-framework .diy-component-edit {
  195. width: 100%;
  196. position: absolute;
  197. top: 0;
  198. bottom: 0;
  199. left: 465px;
  200. right: 0;
  201. background: #fff;
  202. padding: 20px;
  203. display: none;
  204. overflow: auto;
  205. }
  206. .diy-component-options {
  207. position: relative;
  208. }
  209. .diy-component-options .el-button {
  210. height: 25px;
  211. line-height: 25px;
  212. width: 25px;
  213. padding: 0;
  214. text-align: center;
  215. border: none;
  216. border-radius: 0;
  217. position: absolute;
  218. margin-left: 0;
  219. }
  220. .mobile-framework .active .diy-component-preview {
  221. border: 2px dashed #409EFF;
  222. left: -2px;
  223. right: -2px;
  224. width: calc(100% + 4px);
  225. }
  226. .mobile-framework .active .diy-component-edit {
  227. display: block;
  228. padding-right: 20%;
  229. min-width: 650px;
  230. }
  231. .all-components {
  232. max-height: 725px;
  233. overflow-y: auto;
  234. }
  235. .bottom-menu {
  236. text-align: center;
  237. height: 54px;
  238. width: 100%;
  239. }
  240. .bottom-menu .el-card__body {
  241. padding-top: 10px;
  242. }
  243. .el-dialog {
  244. min-width: 800px;
  245. }
  246. /* 公共样式 */
  247. .flex {
  248. display: -webkit-box;
  249. display: -webkit-flex;
  250. /* #ifndef APP-NVUE */
  251. display: flex;
  252. /* #endif */
  253. }
  254. .flex-x-center {
  255. display: -webkit-box;
  256. display: -webkit-flex;
  257. /* #ifndef APP-NVUE */
  258. display: flex;
  259. /* #endif */
  260. -webkit-box-pack: center;
  261. -webkit-justify-content: center;
  262. -ms-flex-pack: center;
  263. justify-content: center;
  264. }
  265. .flex-x-between {
  266. display: -webkit-box;
  267. display: -webkit-flex;
  268. /* #ifndef APP-NVUE */
  269. display: flex;
  270. /* #endif */
  271. -webkit-box-pack: space-between;
  272. -webkit-justify-content: space-between;
  273. -ms-flex-pack: space-between;
  274. justify-content: space-between;
  275. }
  276. .flex-y-center {
  277. display: -webkit-box;
  278. display: -webkit-flex;
  279. /* #ifndef APP-NVUE */
  280. display: flex;
  281. /* #endif */
  282. -webkit-box-align: center;
  283. -webkit-align-items: center;
  284. -ms-flex-align: center;
  285. -ms-grid-row-align: center;
  286. align-items: center;
  287. }
  288. /* 溢出隐藏 */
  289. .over1 {
  290. text-overflow: -o-ellipsis-lastline;
  291. overflow: hidden;
  292. text-overflow: ellipsis;
  293. display: -webkit-box;
  294. -webkit-line-clamp: 1;
  295. -webkit-box-orient: vertical;
  296. }
  297. .over2 {
  298. text-overflow: -o-ellipsis-lastline;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. display: -webkit-box;
  302. -webkit-line-clamp: 2;
  303. -webkit-box-orient: vertical;
  304. }
  305. .sava_btn .el-button {
  306. width: 150px;
  307. height: 40px;
  308. border-radius: 5px;
  309. }
  310. .page_msg_box {
  311. padding: 22px 23px;
  312. border-radius: 5px 5px 0 0;
  313. }
  314. </style>
  315. <?php
  316. use common\helpers\ComponentHelper;
  317. ComponentHelper::loadComponentView('com-rich-text');
  318. ?>
  319. <div id="app" v-cloak>
  320. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  321. <div slot="header">
  322. <span>基础设置</span>
  323. </div>
  324. <el-tabs type="border-card">
  325. <el-tab-pane label="基础设置">
  326. <div class="form-body">
  327. <el-form :model="ruleForm" label-width="auto" ref="ruleForm" size="small" v-loading="loading">
  328. <?= ComponentHelper::loadComponentView('notice', __DIR__ . '/'); ?>
  329. </el-form>
  330. </div>
  331. <el-button type="primary" class="button-item" size="small" :loading=btnLoading @click="onSubmit">提交</el-button>
  332. </el-tab-pane>
  333. </el-tabs>
  334. </el-card>
  335. </div>
  336. <style>
  337. .el-textarea__inner {
  338. padding: 0 15px;
  339. }
  340. </style>
  341. <script>
  342. const app = new Vue({
  343. el: '#app',
  344. data() {
  345. return {
  346. loading: false,
  347. time: null,
  348. btnLoading: false,
  349. tabNotice: 'left',
  350. ruleForm: {
  351. general_settings: {
  352. is_refund_deposit: {
  353. title: "只付定金未付尾款是否退定金",
  354. value: '0',
  355. remark: ''
  356. }
  357. },
  358. notice_wechat: {
  359. is_logging: {
  360. title: "开启消息模板推送",
  361. value: '0',
  362. remark: ''
  363. },
  364. // template_no: {
  365. // title: "模板编号",
  366. // value: '',
  367. // remark: ''
  368. // },
  369. // template_id: {
  370. // title: "模板ID",
  371. // value: '',
  372. // remark: ''
  373. // },
  374. is_miniapp_priority: {
  375. title: "是否跳转链接小程序优先",
  376. value: '0',
  377. remark: ''
  378. },
  379. is_open: {
  380. title: "是否记录数据库日志",
  381. value: '0',
  382. remark: ''
  383. },
  384. template_message: {
  385. value: {
  386. order_deposit: {
  387. name: '订单支付定金',
  388. tempid: '',
  389. tem_key: '',
  390. },
  391. order_final_payment:{
  392. name: '订单支付尾款',
  393. tempid: '',
  394. tem_key: '',
  395. }
  396. }
  397. },
  398. },
  399. notice_sms: {
  400. status: {
  401. title: "状态",
  402. value: '0',
  403. remark: ''
  404. },
  405. platform: {
  406. title: "平台",
  407. value: 'aliyun',
  408. remark: ''
  409. },
  410. access_key_id: {
  411. title: "access_key_id",
  412. value: '',
  413. remark: ''
  414. },
  415. access_key_secret: {
  416. title: "access_key_secret",
  417. value: '',
  418. remark: ''
  419. },
  420. template_name: {
  421. title: "模板签名",
  422. value: '',
  423. remark: ''
  424. },
  425. register_template_id: {
  426. title: "模板ID",
  427. value: '',
  428. remark: ''
  429. },
  430. register_template_variable: {
  431. title: "模板签名",
  432. value: '',
  433. remark: ''
  434. },
  435. order_template_id: {
  436. title: "模板ID",
  437. value: '',
  438. remark: ''
  439. },
  440. order_template_variable: {
  441. title: "模板签名",
  442. value: '',
  443. remark: ''
  444. },
  445. sale_template_id: {
  446. title: "模板ID",
  447. value: '',
  448. remark: ''
  449. },
  450. sale_template_variable: {
  451. title: "模板签名",
  452. value: '',
  453. remark: ''
  454. },
  455. captcha_template_id: {
  456. title: "模板ID",
  457. value: '',
  458. remark: ''
  459. },
  460. captcha_template_variable: {
  461. title: "模板签名",
  462. value: '',
  463. remark: ''
  464. },
  465. },
  466. },
  467. FormRules: {
  468. },
  469. };
  470. },
  471. methods: {
  472. onSubmit() {
  473. this.$refs.ruleForm.validate((valid) => {
  474. if (valid) {
  475. this.btnLoading = true;
  476. console.log(this.ruleForm);
  477. request({
  478. params: {
  479. r: 'deposit-presale/setting/index',
  480. },
  481. data: {
  482. setting: this.ruleForm
  483. },
  484. method: 'post'
  485. }).then(e => {
  486. this.btnLoading = false;
  487. if (e.data.code === 0) {
  488. this.$message({
  489. message: e.data.msg,
  490. type: 'success'
  491. });
  492. } else {
  493. this.$message.error(e.data.msg);
  494. }
  495. }).catch(e => {
  496. this.btnLoading = false;
  497. this.$message.error(e.data.msg);
  498. });
  499. }
  500. });
  501. },
  502. getList() {
  503. this.loading = true;
  504. request({
  505. params: {
  506. r: 'deposit-presale/setting/index',
  507. },
  508. }).then(e => {
  509. this.loading = false;
  510. if (e.data.data) { //有选中的
  511. let data = e.data.data
  512. Object.keys(this.ruleForm).forEach((key) => {
  513. Object.keys(this.ruleForm[key]).forEach((k) => {
  514. if (!isEmpty(data[key][k])) {
  515. var dataValue = data[key][k].value;
  516. if (data[key][k].value != null && data[key][k].value != "") {
  517. if (typeof dataValue == 'string' && (dataValue.indexOf("{") !== -1 || dataValue.indexOf("[") !== -1)) {
  518. // 将json字符串转为对象
  519. this.ruleForm[key][k].value = JSON.parse(data[key][k].value);
  520. } else {
  521. this.ruleForm[key][k].value = data[key][k].value;
  522. }
  523. }
  524. }
  525. });
  526. });
  527. } else {
  528. this.$message.error(e.data.msg);
  529. }
  530. }).catch(e => {
  531. this.loading = false;
  532. });
  533. },
  534. },
  535. mounted: function() {
  536. this.getList();
  537. }
  538. })
  539. </script>