index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <template>
  2. <div class="app-container">
  3. <div v-show="step == 1">
  4. <div class="setting_title">开通账号</div>
  5. <el-divider></el-divider>
  6. <div class="tips">说明:开通商户账号是指开通商城后台管理系统的总登录账号。</div>
  7. <el-card shadow="never" class="my-card">
  8. <el-form class="my-form" ref="step1Form" :model="step1Form" :rules="step1FormRules" label-width="100px" label-position="right">
  9. <el-form-item label="商户账号" prop="account">
  10. <el-input v-model="step1Form.account" autocomplete="off" placeholder="请输入商户账号"></el-input>
  11. <el-popover
  12. class="question"
  13. placement="right-start"
  14. title="账号设置"
  15. width="260"
  16. trigger="hover"
  17. content="账号设置需按数字、字母组合设置至少12位账号">
  18. <svg-icon icon-class="question" slot="reference" />
  19. </el-popover>
  20. </el-form-item>
  21. <el-form-item label="账户昵称" prop="nickName">
  22. <el-input v-model="step1Form.nickName" autocomplete="off" placeholder="请输入账户昵称"></el-input>
  23. </el-form-item>
  24. <el-form-item label="小程序名称" prop="appName">
  25. <el-input v-model="step1Form.appName" autocomplete="off" placeholder="请输入小程序名称"></el-input>
  26. </el-form-item>
  27. <el-form-item label="负责人" prop="chargePerson">
  28. <el-input v-model="step1Form.chargePerson" autocomplete="off" placeholder="请输入负责人"></el-input>
  29. </el-form-item>
  30. <el-form-item label="联系电话" prop="phone">
  31. <el-input v-model="step1Form.phone" autocomplete="off" placeholder="请输入联系电话"></el-input>
  32. </el-form-item>
  33. <el-form-item label="电子邮箱" prop="email">
  34. <el-input v-model="step1Form.email" autocomplete="off" placeholder="请输入电子邮箱"></el-input>
  35. </el-form-item>
  36. <el-form-item label="地址" prop="address">
  37. <div style="display:flex;">
  38. <el-input placeholder="请选择地址" autocomplete="off" readonly style="margin-right: 20px;" v-model="step1Form.address"></el-input>
  39. <geographicalPosi :formData="step1Form" @selectPosi="selectAddress"></geographicalPosi>
  40. </div>
  41. </el-form-item>
  42. <el-form-item label="登录密码" prop="newPassword">
  43. <el-input v-model="step1Form.newPassword" ref="password1" autocomplete="off" placeholder="请输入登录密码" :type="passwordType1"></el-input>
  44. <span class="show-pwd" @click="showPwd(1)">
  45. <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
  46. </span>
  47. <el-popover
  48. class="question"
  49. placement="right-start"
  50. title="密码设置"
  51. width="260"
  52. trigger="hover"
  53. content="密码设置需按数字、字母组合设置至少12位密码">
  54. <svg-icon icon-class="question" slot="reference" />
  55. </el-popover>
  56. </el-form-item>
  57. <el-form-item label="确认密码" prop="confirmPassword">
  58. <el-input v-model="step1Form.confirmPassword" ref="password2" autocomplete="off" placeholder="请再次输入密码" :type="passwordType2"></el-input>
  59. <span class="show-pwd" @click="showPwd(2)">
  60. <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
  61. </span>
  62. <el-popover
  63. class="question"
  64. placement="right-start"
  65. title="密码设置"
  66. width="260"
  67. trigger="hover"
  68. content="确认密码需要和登录密码保持一致">
  69. <svg-icon icon-class="question" slot="reference" />
  70. </el-popover>
  71. </el-form-item>
  72. </el-form>
  73. </el-card>
  74. </div>
  75. <div v-show="step == 2">
  76. <div class="setting_title">商城配置</div>
  77. <el-divider></el-divider>
  78. <el-form label-width="100px" label-position="right">
  79. <el-upload
  80. class="avatar-uploader"
  81. :action="baseURL + 'common/upload'"
  82. :headers="myHeaders"
  83. :show-file-list="false"
  84. :on-success="uploadSuccess"
  85. :before-upload="beforeUpload">
  86. </el-upload>
  87. <el-form-item label="主logo:" prop="imgUrl">
  88. <div class="images">
  89. <div class="main-img">
  90. <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
  91. <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  92. <div class="mask" v-show="img1_hover">
  93. <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
  94. <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
  95. </div>
  96. </div>
  97. <div class="add" v-else @click="uploadImage('img1')">
  98. <i class="el-icon-plus avatar-uploader-icon"></i>
  99. </div>
  100. </div>
  101. <div class="tmp-img">
  102. <el-image :src="require('@/assets/template/template_1.png')" :preview-src-list="[require('@/assets/template/template_1.png')]" style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  103. <div class="tmp">示例图</div>
  104. </div>
  105. </div>
  106. <div class="tips">
  107. <span>建议尺寸:400*400</span>
  108. </div>
  109. </el-form-item>
  110. <el-form-item label="通用logo:" prop="imgUrl">
  111. <div class="images">
  112. <div class="main-img">
  113. <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
  114. <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  115. <div class="mask" v-show="img2_hover">
  116. <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
  117. <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
  118. </div>
  119. </div>
  120. <div class="add" v-else @click="uploadImage('img2')">
  121. <i class="el-icon-plus avatar-uploader-icon"></i>
  122. </div>
  123. </div>
  124. <div class="tmp-img">
  125. <el-image :src="require('@/assets/template/template_2.png')" :preview-src-list="[require('@/assets/template/template_2.png')]" style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  126. <div class="tmp">示例图</div>
  127. </div>
  128. </div>
  129. <div class="tips">
  130. <span>建议尺寸:280*60</span>
  131. </div>
  132. </el-form-item>
  133. <el-form-item label="头像logo:" prop="imgUrl">
  134. <div class="images">
  135. <div class="main-img">
  136. <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
  137. <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  138. <div class="mask" v-show="img3_hover">
  139. <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
  140. <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
  141. </div>
  142. </div>
  143. <div class="add" v-else @click="uploadImage('img3')">
  144. <i class="el-icon-plus avatar-uploader-icon"></i>
  145. </div>
  146. </div>
  147. <div class="tmp-img">
  148. <el-image :src="require('@/assets/template/template_3.png')" :preview-src-list="[require('@/assets/template/template_3.png')]" style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  149. <div class="tmp">示例图</div>
  150. </div>
  151. </div>
  152. <div class="tips">
  153. <span>建议尺寸:400*400</span>
  154. </div>
  155. </el-form-item>
  156. <!-- --------------------------- -->
  157. <!-- <el-form-item label="头像logo:" prop="imgUrl">
  158. <div class="images">
  159. <div class="main-img">
  160. <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
  161. <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  162. <div class="mask" v-show="img3_hover">
  163. <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
  164. <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
  165. </div>
  166. </div>
  167. <div class="add" v-else @click="uploadImage('img3')">
  168. <i class="el-icon-plus avatar-uploader-icon"></i>
  169. </div>
  170. </div>
  171. </div>
  172. </el-form-item> -->
  173. <!-- --------------------------- -->
  174. <!-- <el-form-item label="头像logo:" prop="imgUrl">
  175. <div class="images">
  176. <div class="main-img">
  177. <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
  178. <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px" fit="contain"></el-image>
  179. <div class="mask" v-show="img3_hover">
  180. <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
  181. <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
  182. </div>
  183. </div>
  184. <div class="add" v-else @click="uploadImage('img3')">
  185. <i class="el-icon-plus avatar-uploader-icon"></i>
  186. </div>
  187. </div>
  188. </div>
  189. </el-form-item> -->
  190. <!-- --------------------------- -->
  191. </el-form>
  192. </div>
  193. <div v-show="step == 3">
  194. <div class="setting_title">微信配置</div>
  195. <el-divider></el-divider>
  196. <!-- <div class="tips">说明:企微配置是指通过配置企业微信将企微用户和系统打通,实现企业微信用户信息同平台互通,聊天会话信息同步</div> -->
  197. <div class="tips" style="margin-top: 20px">商户名称:{{step1Form.nickName}}</div>
  198. <el-form class="my-form2" ref="step3Form" :model="step3Form" :rules="step3FormRules" label-width="200px" label-position="right">
  199. <!-- <el-card shadow="never" class="my-card">
  200. <div class="title">1.配置企业ID</div>
  201. <div class="box">指引:进入<el-link type="primary" :underline="false" href="https://element.eleme.io" target="_blank">企业微信</el-link>打开【我的企业】,将企业ID分别复制并填写到下方输入框中</div>
  202. <el-form-item label="企业ID" prop="enterpriseId">
  203. <el-input v-model="step3Form.enterpriseId" autocomplete="off" placeholder="请输入企业ID"></el-input>
  204. </el-form-item>
  205. </el-card>
  206. <el-card shadow="never" class="my-card">
  207. <div class="title">2.配置通讯录密钥(Secret)</div>
  208. <div class="box">进入<el-link type="primary" :underline="false" href="https://element.eleme.io" target="_blank">企业微信</el-link>打开【客户联系】-选择【客户】-展开右侧【API】。将外部联系人Secret复制并填写到下方输入框中。如果外部联系人Secret不更新,请将更新后的外部联系人Secret更新复制更新到下方输入框中。</div>
  209. <el-form-item label="通讯录密钥(Secret)" prop="listSecret">
  210. <el-input v-model="step3Form.listSecret" autocomplete="off" placeholder="请输入通讯录密钥(Secret)"></el-input>
  211. </el-form-item>
  212. <el-divider></el-divider>
  213. <div class="title">配置通讯录同步密钥(Secret)</div>
  214. <div class="box">进入<el-link type="primary" :underline="false" href="https://element.eleme.io" target="_blank">企业微信</el-link>打开【管理工具】-选择【通讯录同步】-获取通讯录同步Secret。将通讯录同步Secret复制并填写到下方输入框中。如果通讯录同步Secret不更新,请将更新后的通讯录同步Secret更新复制更新到下方输入框中。</div>
  215. <el-form-item label="通讯录同步密钥(Secret)" prop="listSyncSecret">
  216. <el-input v-model="step3Form.listSyncSecret" autocomplete="off" placeholder="请输入通讯录同步密钥(Secret)"></el-input>
  217. </el-form-item>
  218. </el-card>
  219. <el-card shadow="never" class="my-card">
  220. <div class="title">3.配置小程序</div>
  221. <div class="box">进入<el-link type="primary" :underline="false" href="https://element.eleme.io" target="_blank">企业微信</el-link>打开【应用管理】-选择【应用】-选择【小程序】-获取小程序AgentiD、小程序Secret。将小程序AgentiD、小程序Secret复制并填写到下方输入框中。</div>
  222. <el-form-item label="小程序(AgentiD)" prop="appAgentId">
  223. <el-input v-model="step3Form.appAgentId" autocomplete="off" placeholder="请输入小程序(AgentiD)"></el-input>
  224. </el-form-item>
  225. <el-form-item label="小程序(Secret)" prop="appSecret">
  226. <el-input v-model="step3Form.appSecret" autocomplete="off" placeholder="请输入小程序(Secret)"></el-input>
  227. </el-form-item>
  228. </el-card> -->
  229. <el-card shadow="never" class="my-card">
  230. <div class="title" style="margin-bottom: 20px;">1.其他基础配置</div>
  231. <el-form-item label="小程序appId" prop="appId">
  232. <el-input v-model="step3Form.appId" autocomplete="off" placeholder="请输入小程序appId"></el-input>
  233. </el-form-item>
  234. <el-form-item label="商户号Id" prop="merchantId">
  235. <el-input v-model="step3Form.merchantId" autocomplete="off" placeholder="请输入商户号Id"></el-input>
  236. </el-form-item>
  237. <el-form-item label="商户号Key" prop="merchantKey">
  238. <el-input v-model="step3Form.merchantKey" autocomplete="off" placeholder="请输入商户号Key"></el-input>
  239. </el-form-item>
  240. <el-form-item label="子appId" prop="childAppId">
  241. <el-input v-model="step3Form.childAppId" autocomplete="off" placeholder="请输入子appId"></el-input>
  242. </el-form-item>
  243. <el-form-item label="子密钥" prop="childKey">
  244. <el-input v-model="step3Form.childKey" autocomplete="off" placeholder="请输入子密钥"></el-input>
  245. </el-form-item>
  246. <el-form-item label="子商户号Id" prop="childMerchantId">
  247. <el-input v-model="step3Form.childMerchantId" autocomplete="off" placeholder="请输入子商户号Id"></el-input>
  248. </el-form-item>
  249. <el-form-item label="微信订阅模版" prop="templateId">
  250. <el-input v-model="step3Form.templateId" autocomplete="off" placeholder="请输入微信订阅模版"></el-input>
  251. </el-form-item>
  252. </el-card>
  253. </el-form>
  254. </div>
  255. <div class="page-footer">
  256. <div class="footer" :class="classObj">
  257. <el-button @click="changeStep(0)" v-show="step > 1">上一步</el-button>
  258. <el-button @click="changeStep(1)" v-show="step < 3">下一步</el-button>
  259. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
  260. <el-popconfirm
  261. title="确定关闭吗?"
  262. @confirm="goBack"
  263. style="margin-left: 10px;"
  264. >
  265. <el-button slot="reference">关 闭</el-button>
  266. </el-popconfirm>
  267. </div>
  268. </div>
  269. </div>
  270. </template>
  271. <script>
  272. import { getToken } from '@/utils/auth'
  273. import { addAccount } from "@/api/merchant";
  274. import geographicalPosi from '@/components/geographicalPosi/index.vue'
  275. export default {
  276. components: {geographicalPosi},
  277. data() {
  278. var validateAccount = (rule, value, callback) => {
  279. if (value === '') {
  280. callback(new Error('请输入商户账号'));
  281. } else if (value.length < 12) {
  282. callback(new Error('账号长度至少12位'));
  283. } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
  284. callback(new Error('账号必须包含数字和字母'));
  285. } else {
  286. callback();
  287. }
  288. };
  289. var validatePass3 = (rule, value, callback) => {
  290. if (value === '') {
  291. callback(new Error('请输入登录密码'));
  292. } else if (value.length < 12) {
  293. callback(new Error('密码长度至少12位'));
  294. } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
  295. callback(new Error('密码必须包含数字和字母'));
  296. } else {
  297. if (this.step1Form.confirmPassword !== '') {
  298. this.$refs.step1Form.validateField('confirmPassword');
  299. }
  300. callback();
  301. }
  302. };
  303. var validatePass4 = (rule, value, callback) => {
  304. if (value === '') {
  305. callback(new Error('请再次输入密码'));
  306. } else if (value !== this.step1Form.newPassword) {
  307. callback(new Error('两次输入密码不一致'));
  308. } else {
  309. callback();
  310. }
  311. };
  312. return {
  313. baseURL: process.env.VUE_APP_BASE_API,
  314. myHeaders: {'x-token': getToken()},
  315. step: 1,
  316. step1Form: {
  317. account: '', // 账号
  318. nickName: '', // 用户名
  319. appName: '', // 小程序名称
  320. chargePerson: '', // 负责人
  321. phone: '', // 联系电话
  322. email: '', // 电子邮箱
  323. lat: '',
  324. lng: '',
  325. address: '', // 地址
  326. newPassword: '', // 登录密码
  327. confirmPassword: '', // 确认密码
  328. },
  329. step1FormRules: {
  330. account: [
  331. { required: true, validator: validateAccount, trigger: 'blur' }
  332. ],
  333. nickName: [
  334. { required: true, message: '请输入用户名', trigger: 'blur' }
  335. ],
  336. address: [
  337. { required: true, message: '请选择GPS地址', trigger: 'blur' }
  338. ],
  339. appName: [
  340. { required: true, message: '请输入用户名', trigger: 'blur' }
  341. ],
  342. chargePerson: [
  343. { required: true, message: '请输入负责人', trigger: 'blur' }
  344. ],
  345. phone: [
  346. { required: true, message: '请输入联系电话', trigger: 'blur' }
  347. ],
  348. newPassword: [
  349. { required: true, validator: validatePass3, trigger: 'blur' }
  350. ],
  351. confirmPassword: [
  352. { required: true, validator: validatePass4, trigger: 'blur' }
  353. ],
  354. },
  355. passwordType1: 'password',
  356. passwordType2: 'password',
  357. uploadImageType: null,
  358. img1_url: '',
  359. img1_hover: false,
  360. img2_url: '',
  361. img2_hover: false,
  362. img3_url: '',
  363. img3_hover: false,
  364. step3Form: {
  365. enterpriseId: '',
  366. listSecret: '',
  367. listSyncSecret: '',
  368. appAgentId: '',
  369. appSecret: '',
  370. appId: '',
  371. merchantId: '',
  372. merchantKey: '',
  373. childAppId: '',
  374. childKey: '',
  375. childMerchantId: '',
  376. templateId: '',
  377. },
  378. step3FormRules: {
  379. enterpriseId: [
  380. // { required: true, message: '请输入企业ID', trigger: 'blur' }
  381. ],
  382. listSecret: [
  383. // { required: true, message: '请输入通讯录密钥(Secret)', trigger: 'blur' }
  384. ],
  385. listSyncSecret: [
  386. // { required: true, message: '请输入通讯录同步密钥(Secret)', trigger: 'blur' }
  387. ],
  388. appAgentId: [
  389. // { required: true, message: '请输入小程序(AgentiD)', trigger: 'blur' }
  390. ],
  391. appSecret: [
  392. // { required: true, message: '请输入小程序(Secret)', trigger: 'blur' }
  393. ],
  394. },
  395. formLoading: false,
  396. }
  397. },
  398. computed: {
  399. sidebar() {
  400. return this.$store.state.app.sidebar
  401. },
  402. classObj() {
  403. return {
  404. hideSidebar: !this.sidebar.opened,
  405. openSidebar: this.sidebar.opened
  406. }
  407. },
  408. },
  409. methods: {
  410. goBack() {
  411. this.$router.go(-1);
  412. },
  413. selectAddress(res){
  414. this.step1Form.lng = res.center[0]
  415. this.step1Form.lat = res.center[1]
  416. this.step1Form.address = res.name
  417. },
  418. // 显示隐藏密码
  419. showPwd(num) {
  420. if(num == 1) {
  421. if (this.passwordType1 === 'password') {
  422. this.passwordType1 = ''
  423. } else {
  424. this.passwordType1 = 'password'
  425. }
  426. this.$nextTick(() => {
  427. this.$refs.password1.focus()
  428. })
  429. }
  430. if(num == 2) {
  431. if (this.passwordType2 === 'password') {
  432. this.passwordType2 = ''
  433. } else {
  434. this.passwordType2 = 'password'
  435. }
  436. this.$nextTick(() => {
  437. this.$refs.password2.focus()
  438. })
  439. }
  440. },
  441. // 下一步
  442. nextStep() {
  443. this.$refs.step1Form.validate((valid) => {
  444. if (valid) {
  445. this.step = 2;
  446. }
  447. })
  448. },
  449. uploadImage(type) {
  450. this.uploadImageType = type;
  451. document.querySelector('.avatar-uploader input').click();
  452. },
  453. // 上传图片
  454. uploadSuccess(res, file) {
  455. this[this.uploadImageType + '_url'] = res.data.url;
  456. },
  457. beforeUpload(file) {
  458. const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
  459. const whiteList = ['jpg', 'jpeg', 'png'];
  460. if (whiteList.indexOf(fileSuffix) === -1) {
  461. this.$errorMsg('只支持上传jpg/jpeg/png文件!');
  462. return false;
  463. }
  464. },
  465. // 预览图片
  466. previewImage(type) {
  467. this.$refs[type].showViewer = true;
  468. },
  469. // 切换步骤
  470. changeStep(type) {
  471. if(type == 1) {
  472. this.step ++;
  473. }else {
  474. this.step --;
  475. }
  476. },
  477. // 点击 提交表单
  478. clickSubmitForm() {
  479. // 验证第一步
  480. this.$refs.step1Form.validate((valid) => {
  481. if (valid) {
  482. // 验证第二步
  483. if(this.img1_url && this.img2_url && this.img3_url) {
  484. // 验证第三步
  485. this.$refs.step3Form.validate((valid) => {
  486. if (valid) {
  487. this.submitForm();
  488. }else {
  489. this.step = 3;
  490. }
  491. })
  492. }else {
  493. this.$errorMsg('请完善商城配置');
  494. this.step = 2;
  495. }
  496. }else {
  497. this.step = 1;
  498. }
  499. })
  500. },
  501. // 提交表单
  502. submitForm() {
  503. this.$refs.step3Form.validate((valid) => {
  504. if (valid) {
  505. this.formLoading = true;
  506. let params = {
  507. type: 1,
  508. userName: this.step1Form.account,
  509. nickName: this.step1Form.nickName,
  510. minAppName: this.step1Form.appName,
  511. linkName: this.step1Form.chargePerson,
  512. linkPhone: this.step1Form.phone,
  513. email: this.step1Form.email,
  514. lat: this.step1Form.lat,
  515. lng: this.step1Form.lng,
  516. address: this.step1Form.address,
  517. password: this.step1Form.confirmPassword,
  518. minLogo1: this.img1_url,
  519. minLogo2: this.img2_url,
  520. minLogo3: this.img3_url,
  521. corpId: this.step3Form.enterpriseId,
  522. secret2: this.step3Form.listSecret,
  523. secret3: this.step3Form.listSyncSecret,
  524. agentId1: this.step3Form.appAgentId,
  525. secret1: this.step3Form.appSecret,
  526. appId: this.step3Form.appId,
  527. mchId: this.step3Form.merchantId,
  528. mchKey: this.step3Form.merchantKey,
  529. subAppId: this.step3Form.childAppId,
  530. subSecret: this.step3Form.childKey,
  531. subMchId: this.step3Form.childMerchantId,
  532. template: this.step3Form.templateId,
  533. }
  534. addAccount(params).then(res => {
  535. this.$successMsg('开通成功');
  536. setTimeout(() => {
  537. this.goBack();
  538. }, 1500)
  539. }).finally(res => {
  540. this.formLoading = false;
  541. })
  542. }
  543. })
  544. }
  545. }
  546. }
  547. </script>
  548. <style lang="scss" scoped>
  549. .setting_title {
  550. padding-left: 0;
  551. }
  552. .tips {
  553. font-size: 14px;
  554. }
  555. .my-card {
  556. margin-top: 20px;
  557. .box {
  558. background: rgb(235, 240, 249);
  559. padding: 10px;
  560. font-size: 14px;
  561. margin: 20px 0;
  562. line-height: 18px;
  563. ::v-deep .el-link {
  564. vertical-align: unset;
  565. }
  566. }
  567. }
  568. .my-form {
  569. width: 450px;
  570. margin: 0 auto;
  571. }
  572. .show-pwd {
  573. position: absolute;
  574. right: 15px;
  575. top: 0;
  576. font-size: 16px;
  577. cursor: pointer;
  578. user-select: none;
  579. }
  580. .question {
  581. position: absolute;
  582. right: -30px;
  583. top: 0;
  584. font-size: 20px;
  585. cursor: pointer;
  586. user-select: none;
  587. }
  588. .my-form2 {
  589. ::v-deep input {
  590. width: 400px;
  591. }
  592. }
  593. .tips {
  594. margin-top: 10px;
  595. span {
  596. display: inline-block;
  597. width: 300px;
  598. text-align: center;
  599. line-height: 32px;
  600. background: #ffefef;
  601. font-size: 14px;
  602. color: #f66460;
  603. }
  604. }
  605. .images {
  606. display: flex;
  607. flex-wrap: wrap;
  608. .main-img {
  609. display: flex;
  610. flex-direction: column;
  611. justify-content: center;
  612. align-items: center;
  613. width: 120px;
  614. margin-right: 20px;
  615. .img {
  616. border: 1px dashed #eaeaea;
  617. border-radius: 5px;
  618. overflow: hidden;
  619. position: relative;
  620. .el-image {
  621. display: block;
  622. }
  623. .mask {
  624. position: absolute;
  625. left: 0;
  626. top: 0;
  627. width: 120px;
  628. height: 120px;
  629. background: rgba($color: #000000, $alpha: 0.3);
  630. display: flex;
  631. align-items: center;
  632. justify-content: center;
  633. i {
  634. font-size: 20px;
  635. color: #ffffff;
  636. cursor: pointer;
  637. margin: 0 8px;
  638. }
  639. }
  640. }
  641. .text {
  642. font-size: 14px;
  643. color: #666666;
  644. }
  645. }
  646. .add {
  647. width: 120px;
  648. height: 120px;
  649. border: 1px dashed #eaeaea;
  650. border-radius: 5px;
  651. cursor: pointer;
  652. display: flex;
  653. align-items: center;
  654. justify-content: center;
  655. i {
  656. font-size: 30px;
  657. color: #999;
  658. }
  659. }
  660. .tmp-img {
  661. position: relative;
  662. .tmp {
  663. position: absolute;
  664. left: 0;
  665. top: 0;
  666. line-height: 20px;
  667. padding: 0 8px;
  668. background: #f66460;
  669. border-radius: 0 0 10px 0;
  670. font-size: 12px;
  671. color: #ffffff;
  672. }
  673. }
  674. }
  675. </style>