index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <div id="app" v-cloak>
  2. <el-card
  3. v-loading="loading"
  4. style="border:0; min-width: 800px;"
  5. shadow="never"
  6. body-style="background-color: #f3f3f3;padding: 10px 0 0;"
  7. >
  8. <div slot="header">
  9. <span>配置</span>
  10. </div>
  11. <el-form
  12. :model="formData"
  13. ref="elForm"
  14. label-width="172px"
  15. style="position: relative"
  16. size="small"
  17. :rules="rules"
  18. >
  19. <el-row>
  20. <el-col :span="24">
  21. <div class="form-body">
  22. <!-- 应用ID -->
  23. <el-form-item label="APPID" prop="app_id">
  24. <el-input v-model="formData.app_id" placeholder="请输入应用ID" clearable :style="{width: '100%'}"></el-input>
  25. </el-form-item>
  26. <!-- 应用私钥 -->
  27. <el-form-item label="应用私钥" prop="private_key">
  28. <el-input v-model="formData.private_key" type="textarea" placeholder="请输入应用私钥"
  29. :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
  30. </el-form-item>
  31. <!-- 支付宝公钥证书 -->
  32. <el-form-item label="支付宝公钥证书" prop="alipay_public_key">
  33. <el-input v-model="formData.alipay_public_key" type="textarea" placeholder="请输入支付宝公钥证书"
  34. :autosize="{minRows: 8, maxRows: 8}" :style="{width: '100%'}"></el-input>
  35. </el-form-item>
  36. <!-- 应用公钥证书 -->
  37. <el-form-item label="应用公钥证书" prop="app_cert">
  38. <el-input v-model="formData.app_cert" type="textarea" placeholder="请输入应用公钥证书"
  39. :autosize="{minRows: 8, maxRows: 8}" :style="{width: '100%'}"></el-input>
  40. </el-form-item>
  41. <!-- 支付宝根证书 -->
  42. <el-form-item label="支付宝根证书" prop="root_cert">
  43. <el-input v-model="formData.root_cert" type="textarea" placeholder="请输入支付宝根证书"
  44. :autosize="{minRows: 8, maxRows: 8}" :style="{width: '100%'}"></el-input>
  45. </el-form-item>
  46. <el-form-item label="提现免审核">
  47. <div>
  48. <el-switch v-model="formData.withdrawal_no_check" :active-value="1" :inactive-value="0"></el-switch>
  49. </div>
  50. <div class="tips-text" style="line-height: 24px;">
  51. 开启后,会员进行提现,后台无需审核,直接调用打款流程
  52. </div>
  53. </el-form-item>
  54. <el-form-item size="large">
  55. <el-button type="primary" size="small" @click="submitForm">提交</el-button>
  56. <el-button size="small" @click="resetForm">重置</el-button>
  57. </el-form-item>
  58. </div>
  59. </el-col>
  60. </el-row>
  61. </el-form>
  62. </el-card>
  63. </div>
  64. <script>
  65. const app = new Vue({
  66. el: '#app',
  67. data() {
  68. return {
  69. loading:false,
  70. submitLoading:false,
  71. formData: {
  72. app_id : undefined,
  73. name : undefined,
  74. private_key : undefined,
  75. public_key : undefined,
  76. alipay_public_key : undefined,
  77. app_cert : undefined,
  78. root_cert : undefined,
  79. use_scene : [],
  80. withdrawal_no_check:0,
  81. },
  82. rules: {
  83. app_id: [{
  84. required: true,
  85. message: '请输入APPID',
  86. trigger: 'blur'
  87. }],
  88. private_key: [{
  89. required: true,
  90. message: '请输入应用私钥',
  91. trigger: 'blur'
  92. }],
  93. app_public_key: [{
  94. required: true,
  95. message: '请输入应用公钥证书',
  96. trigger: 'blur'
  97. }],
  98. alipay_public_key: [{
  99. required: true,
  100. message: '请输入支付宝公钥证书',
  101. trigger: 'blur'
  102. }],
  103. app_cert: [{
  104. required: true,
  105. message: '请输入应用公钥证书',
  106. trigger: 'blur'
  107. }],
  108. root_cert: [{
  109. required: true,
  110. message: '请输入支付宝根证书',
  111. trigger: 'blur'
  112. }],
  113. },
  114. }
  115. },
  116. computed: {},
  117. watch: {},
  118. created() {
  119. this.readConfig()
  120. },
  121. mounted() {},
  122. methods: {
  123. submitForm() {
  124. this.$refs['elForm'].validate(valid => {
  125. if (valid) {
  126. this.submitLoading = true;
  127. request({
  128. params: {
  129. r: 'alitopay/setting/index',
  130. },
  131. method: 'post',
  132. data: this.formData,
  133. }).then(e => {
  134. this.submitLoading = false;
  135. if (e.data.code === 0) {
  136. this.$message.success(e.data.msg);
  137. } else {
  138. this.$message.error(e.data.msg);
  139. }
  140. }).catch(e => {
  141. });
  142. } else {
  143. this.$message.error('部分参数验证不通过');
  144. }
  145. })
  146. },
  147. resetForm() {
  148. this.$refs['elForm'].resetFields()
  149. },
  150. readConfig(){
  151. request({
  152. params: {
  153. r: 'alitopay/setting/read',
  154. },
  155. method: 'get',
  156. }).then(e => {
  157. this.submitLoading = false
  158. if (e.data.code === 0 && e.data.data) {
  159. this.formData = e.data.data.setting
  160. }
  161. }).catch(e => {
  162. })
  163. },
  164. }
  165. });
  166. </script>
  167. <style>
  168. .el-tabs__header {
  169. padding: 0 20px;
  170. height: 56px;
  171. line-height: 56px;
  172. background-color: #fff;
  173. margin-bottom: 0;
  174. }
  175. .title {
  176. margin-top: 10px;
  177. padding: 18px 20px;
  178. border-top: 1px solid #F3F3F3;
  179. border-bottom: 1px solid #F3F3F3;
  180. background-color: #fff;
  181. }
  182. .form-body {
  183. background-color: #fff;
  184. padding: 20px 50% 20px 0;
  185. }
  186. .button-item {
  187. margin-top: 12px;
  188. padding: 9px 25px;
  189. }
  190. .form-body .item {
  191. width: 300px;
  192. margin-bottom: 50px;
  193. margin-right: 25px;
  194. }
  195. .item-img {
  196. height: 550px;
  197. padding: 25px 10px;
  198. border-radius: 30px;
  199. border: 1px solid #CCCCCC;
  200. background-color: #fff;
  201. }
  202. .item .el-form-item {
  203. width: 300px;
  204. margin: 20px auto;
  205. }
  206. .left-setting-menu {
  207. width: 260px;
  208. }
  209. .left-setting-menu .el-form-item {
  210. height: 60px;
  211. padding-left: 20px;
  212. display: flex;
  213. align-items: center;
  214. margin-bottom: 0;
  215. cursor: pointer;
  216. }
  217. .left-setting-menu .el-form-item .el-form-item__label {
  218. cursor: pointer;
  219. }
  220. .left-setting-menu .el-form-item.active {
  221. background-color: #F3F5F6;
  222. border-top-left-radius: 10px;
  223. width: 105%;
  224. border-bottom-left-radius: 10px;
  225. }
  226. .left-setting-menu .el-form-item .el-form-item__content {
  227. margin-left: 0 !important
  228. }
  229. .no-radius {
  230. border-top-left-radius: 0 !important;
  231. }
  232. .del-btn {
  233. position: absolute;
  234. right: -8px;
  235. top: -8px;
  236. padding: 4px 4px;
  237. }
  238. .reset {
  239. position: absolute;
  240. top: 3px;
  241. left: 90px;
  242. }
  243. .app-tip {
  244. position: absolute;
  245. right: 24px;
  246. top: 16px;
  247. height: 72px;
  248. line-height: 72px;
  249. max-width: calc(100% - 78px);
  250. }
  251. .app-tip:before {
  252. content: ' ';
  253. width: 0;
  254. height: 0;
  255. border-color: inherit;
  256. position: absolute;
  257. top: -32px;
  258. right: 100px;
  259. border-width: 16px;
  260. border-style: solid;
  261. }
  262. .tip-content {
  263. display: block;
  264. white-space: nowrap;
  265. width: 100%;
  266. overflow: hidden;
  267. text-overflow: ellipsis;
  268. margin: 0 28px;
  269. font-size: 28px;
  270. }
  271. .el-tabs__header {
  272. padding: 0 20px;
  273. height: 56px;
  274. line-height: 56px;
  275. background-color: #fff;
  276. margin-bottom: 0;
  277. }
  278. .title {
  279. margin-top: 10px;
  280. padding: 18px 20px;
  281. border-top: 1px solid #F3F3F3;
  282. border-bottom: 1px solid #F3F3F3;
  283. background-color: #fff;
  284. }
  285. .form-body {
  286. background-color: #fff;
  287. padding: 20px 50% 20px 0;
  288. }
  289. .button-item {
  290. padding: 9px 25px;
  291. }
  292. .form-body .item {
  293. width: 300px;
  294. margin-bottom: 50px;
  295. margin-right: 25px;
  296. }
  297. .item-img {
  298. height: 550px;
  299. padding: 25px 10px;
  300. border-radius: 30px;
  301. border: 1px solid #CCCCCC;
  302. background-color: #fff;
  303. }
  304. .item .el-form-item {
  305. width: 300px;
  306. margin: 20px auto;
  307. }
  308. .left-setting-menu {
  309. width: 260px;
  310. }
  311. .left-setting-menu .el-form-item {
  312. height: 60px;
  313. padding-left: 20px;
  314. display: flex;
  315. align-items: center;
  316. margin-bottom: 0;
  317. cursor: pointer;
  318. }
  319. .left-setting-menu .el-form-item .el-form-item__label {
  320. cursor: pointer;
  321. }
  322. .left-setting-menu .el-form-item.active {
  323. background-color: #F3F5F6;
  324. border-top-left-radius: 10px;
  325. width: 105%;
  326. border-bottom-left-radius: 10px;
  327. }
  328. .left-setting-menu .el-form-item .el-form-item__content {
  329. margin-left: 0 !important
  330. }
  331. .no-radius {
  332. border-top-left-radius: 0 !important;
  333. }
  334. .del-btn {
  335. position: absolute;
  336. right: -8px;
  337. top: -8px;
  338. padding: 4px 4px;
  339. }
  340. .reset {
  341. position: absolute;
  342. top: 3px;
  343. left: 90px;
  344. }
  345. .app-tip {
  346. position: absolute;
  347. right: 24px;
  348. top: 16px;
  349. height: 72px;
  350. line-height: 72px;
  351. max-width: calc(100% - 78px);
  352. }
  353. .app-tip:before {
  354. content: ' ';
  355. width: 0;
  356. height: 0;
  357. border-color: inherit;
  358. position: absolute;
  359. top: -32px;
  360. right: 100px;
  361. border-width: 16px;
  362. border-style: solid;
  363. }
  364. .tip-content {
  365. display: block;
  366. white-space: nowrap;
  367. width: 100%;
  368. overflow: hidden;
  369. text-overflow: ellipsis;
  370. margin: 0 28px;
  371. font-size: 28px;
  372. }
  373. .btn-abs{
  374. position: absolute;
  375. top: 12px;
  376. right: 18px;
  377. }
  378. .form-body .app-share {
  379. padding-top: 12px;
  380. border-top: 1px solid #e2e2e2;
  381. margin-top: -20px;
  382. }
  383. .form-body .app-share .app-share-bg {
  384. position: relative;
  385. width: 310px;
  386. height: 360px;
  387. background-repeat: no-repeat;
  388. background-size: contain;
  389. background-position: center
  390. }
  391. .form-body .app-share .app-share-bg .title {
  392. width: 160px;
  393. height: 29px;
  394. line-height: 1;
  395. word-break: break-all;
  396. text-overflow: ellipsis;
  397. display: -webkit-box;
  398. -webkit-box-orient: vertical;
  399. -webkit-line-clamp: 2;
  400. overflow: hidden;
  401. }
  402. .form-body .app-share .app-share-bg .pic-image {
  403. background-repeat: no-repeat;
  404. background-position: 0 0;
  405. background-size: cover;
  406. width: 160px;
  407. height: 130px;
  408. }
  409. .form-body .tab_tpis {
  410. font-size: 12px;
  411. color: #737373;
  412. }
  413. .redio-center {
  414. display: flex;
  415. align-items: center;
  416. }
  417. .redio-input {
  418. margin-left: -28px;
  419. margin-right: 20px;
  420. }
  421. .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
  422. /* margin-bottom: 0; */
  423. }
  424. </style>