create.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. <template>
  2. <view v-if="!loading">
  3. <view class="form">
  4. <view class="li ddflex">
  5. <view class="label">名片页背景</view>
  6. <view class="photo ddflex flex" @tap="uploadImgsCopper()">
  7. <image :src="avatar ? avatar : '../../static/images/userimg.png'" mode="aspectFill" class="userimg"></image>
  8. <image src="../../static/images/rico.png" class="rico"></image>
  9. </view>
  10. </view>
  11. <view class="li ddflex">
  12. <view class="label">姓名</view>
  13. <input v-model="realName" :disabled="true" placeholder="请填写你的真实姓名" placeholder-class="placeholder" class="ipt flex" />
  14. </view>
  15. <view class="li ddflex">
  16. <view class="label">工号</view>
  17. <input v-model="jobNumber" :disabled="true" placeholder="请输入工号" placeholder-class="placeholder" class="ipt flex" />
  18. </view>
  19. <view class="li ddflex">
  20. <view class="label">个人简介</view>
  21. <input v-if="!brief" @tap="jumpUrl('/card/editDesc/editDesc')" :disabled="true" maxlength="11" type="number" placeholder="请作简单自我介绍" placeholder-class="placeholder" class="ipt flex" />
  22. <view class="fflex" v-else style="color: #47C776;" @tap="jumpUrl('/card/editDesc/editDesc')">已完善</view>
  23. <image src="../../static/images/rico.png" class="rico"></image>
  24. </view>
  25. <view class="li ddflex">
  26. <view class="label">执业证书</view>
  27. <input v-model="certificateNo" :disabled="true" placeholder="请输入执业证书编号" placeholder-class="placeholder" class="ipt flex" />
  28. </view>
  29. </view>
  30. <view class="form">
  31. <view class="tit ddflex"><view class="flex">联系信息</view></view>
  32. <view class="li ddflex">
  33. <view class="label">手机</view>
  34. <input v-model="phone" maxlength="11" type="number" placeholder="请填写手机号" placeholder-class="placeholder" class="ipt flex" />
  35. <!-- <view class="tong ddflex" @click="intWechatNumber"><image src="../static/images/wxth.png"></image>微信同号</view> -->
  36. </view>
  37. <view class="li ddflex">
  38. <view class="label">微信号</view>
  39. <input v-model="wechat" placeholder="请填写微信号" placeholder-class="placeholder" class="ipt flex" />
  40. </view>
  41. <!-- <view class="li ddflex">
  42. <view class="label">邮箱</view>
  43. <input v-model="email" placeholder="请填写邮箱地址" placeholder-class="placeholder" class="ipt flex" />
  44. </view> -->
  45. <view class="li dflex">
  46. <view class="label">微信二维码</view>
  47. <view v-if="!wechatCode" class="upload-box ddflex" @tap="uploadWechat()">
  48. <image src="../static/images/pic.png"></image>
  49. <view>点击上传</view>
  50. </view>
  51. <view v-else class="upload-box-image ddflex" @tap="uploadWechat()">
  52. <image class="upload-image" :src="wechatCode"></image>
  53. <image class="upload-close" src="../../static/pages/images/close3.png" @click.stop="wechatCode=''"></image>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="form">
  58. <view class="li dflex">
  59. <view class="label">所获荣誉</view>
  60. <view class="ddflex upload-group flex">
  61. <view class="upload-box-image ddflex" v-for="item,index in honorImgUrls" @click="uploadHonor('change',index)">
  62. <image class="upload-image" :src="item"></image>
  63. <image class="upload-close" src="../../static/pages/images/close3.png" @click.stop="deleteHonor(index)"></image>
  64. </view>
  65. <view class="upload-box ddflex" @tap="uploadHonor()" v-if="honorImgUrls.length<9">
  66. <image src="../static/images/pic.png"></image>
  67. <view>点击上传</view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="li dflex">
  72. <view class="label">个人风采</view>
  73. <view class="ddflex upload-group flex">
  74. <view class="upload-box-image ddflex" v-for="item,index in styleImgUrls" @click="uploadStyle('change',index)">
  75. <image class="upload-image" :src="item"></image>
  76. <image class="upload-close" src="../../static/pages/images/close3.png" @click.stop="deleteStyle(index)"></image>
  77. </view>
  78. <view class="upload-box ddflex" @tap="uploadStyle()" v-if="styleImgUrls.length<9">
  79. <image src="../static/images/pic.png"></image>
  80. <view>点击上传</view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="form">
  86. <view class="tit ddflex"><view class="flex">公司信息</view></view>
  87. <view class="li ddflex">
  88. <view class="label">公司</view>
  89. <input v-model="companyName" :disabled="true" placeholder="请填写公司名称" placeholder-class="placeholder" class="ipt flex" />
  90. </view>
  91. <!-- <view class="li ddflex">
  92. <view class="label">公司简介</view>
  93. <input v-if="!companyIntroduction" @tap="jumpUrl('/card/editDesc/editDesc?isCompanyIntroduction=true')" :disabled="true" maxlength="11" type="number" placeholder="请填写公司简介" placeholder-class="placeholder" class="ipt flex" />
  94. <view class="fflex" v-else style="color: #47C776;" @tap="jumpUrl('/card/editDesc/editDesc?isCompanyIntroduction=true')">已完善</view>
  95. <image src="../../static/images/rico.png" class="rico"></image>
  96. </view> -->
  97. <view class="li ddflex">
  98. <view class="label">入司时间</view>
  99. <picker mode="date" v-model="inDate" :disabled="true" @change="inDateChange">
  100. {{inDate?inDate:'请填写入司时间'}}
  101. </picker>
  102. <!-- <input v-model="companyName" :disabled="true" placeholder="请填写公司名称" placeholder-class="placeholder" class="ipt flex" /> -->
  103. </view>
  104. <view class="li ddflex">
  105. <view class="label">职位</view>
  106. <input v-model="job" :disabled="true" placeholder="请填写职位" placeholder-class="placeholder" class="ipt flex" />
  107. </view>
  108. <!-- <view class="li ddflex" @click="jumpUrl('/card/industry/industry?isPoistion=true')">
  109. <view class="label">行业</view>
  110. <view :class="'flex' + (industryName ? '' :' placeholder')">{{industryName ? industryName : '请填写行业'}}</view>
  111. <image src="../../static/images/rico.png" class="rico"></image>
  112. </view> -->
  113. <view class="li ddflex">
  114. <view class="label">所在地区</view>
  115. <view :class="['item flex', city ? 'active' : '']" @click="chooseLocation()">
  116. <!-- <pickerAddress class="picker flex" @change="bindAddressChange" :disabled="true" @click="chooseLocation()"> -->
  117. <view :class="city?'':'placeholder'">{{ city ? city : '请选择地区' }}</view>
  118. <!-- </pickerAddress> -->
  119. </view>
  120. <image src="../../static/images/rico.png" class="rico"></image>
  121. <!-- <picker class="picker flex">
  122. <view class="placeholder">请选择省份城市</view>
  123. <image src="../../static/images/rico.png" class="rico"></image>
  124. </picker> -->
  125. </view>
  126. <view class="li ddflex">
  127. <view class="label">地址</view>
  128. <input v-model="address" placeholder="填写街道地址" placeholder-class="placeholder" class="ipt flex" />
  129. </view>
  130. </view>
  131. <view class="bot">
  132. <view class="btn" @click="submitCard()">{{ isEdit ? '保存' : '确认创建' }}</view>
  133. </view>
  134. <yqAvatar v-if="copperShow" @upload="copperSuccess" ref="avatar"></yqAvatar>
  135. </view>
  136. </template>
  137. <script>
  138. const req = require('../../utils/request.js');
  139. const util = require('../../utils/util.js');
  140. var QQMapWX = require('../../utils/qqmap.js');
  141. var app = getApp();
  142. import pickerAddress from '../components/wangding-pickerAddress/wangding-pickerAddress.vue';
  143. import yqAvatar from '../../card/components/yq-avatar/yq-avatar.vue';
  144. export default {
  145. components: { pickerAddress,yqAvatar },
  146. data() {
  147. return {
  148. avatar: '',
  149. realName: '',
  150. phone: '',
  151. jobNumber:'',
  152. wechat: '',
  153. wechatCode:'',
  154. email: '',
  155. companyName: '',
  156. job:'',//职业
  157. industryName: '',//行业
  158. tradeId: '',//行业id
  159. message: '',
  160. isEdit: false,
  161. id: '' ,//名片id
  162. nums: 0,
  163. brief:'',//简介
  164. address:'',//详细地址
  165. inDate:'',//入司时间
  166. companyIntroduction:'',//公司简介
  167. honorImgUrls:[],//荣誉
  168. styleImgUrls:[],//风采
  169. city: '',
  170. areaCode: '',
  171. morCity: [],
  172. companyCode:'',
  173. location:{},
  174. longitude:'',
  175. latitude:'',
  176. userCard:null,//用户IP名片
  177. employmentInfo:'',
  178. saleNo:null,
  179. certificateNo:null,
  180. loading:true,
  181. copperShow:false,
  182. copperUrl:''
  183. };
  184. },
  185. async onLoad(opt) {
  186. this.isEdit = opt.isEdit?true:false;
  187. this.id = opt.id;
  188. // if(opt.saleNo){
  189. // console.log(opt.saleNo)
  190. // this.saleNo = opt.saleNo
  191. // req.setStorage('saleNo',this.saleNo)
  192. // }else{
  193. // console.log(req.getStorage('saleNo'))
  194. // opt.saleNo = req.getStorage('saleNo')
  195. // this.saleNo = opt.saleNo
  196. // }
  197. await req.silenceLogin()
  198. console.log('getUserCard')
  199. this.getUserCard()
  200. this.getEmploymentInfo()
  201. },
  202. methods: {
  203. getUserInfo(){
  204. return new Promise((resolve,reject)=>{
  205. req.getRequest('/api/user/info',{},res=>{
  206. // this.avatar = res.avatar;
  207. this.phone = res.mobile;
  208. resolve();
  209. })
  210. })
  211. },
  212. getEmploymentInfo(){
  213. return new Promise((resolve,reject)=>{
  214. req.getRequest('/api/visiting/card/employmentInfo',{jobNumber:req.getStorage('userInfo').saleNo},res=>{
  215. if(res.name){
  216. this.employmentInfo = res;
  217. this.realName = this.employmentInfo.name;
  218. this.certificateNo = this.employmentInfo.professionalCertificateNo
  219. this.jobNumber = this.employmentInfo.salesNo
  220. this.companyName = this.employmentInfo.branchName
  221. this.job = this.employmentInfo.actrankName
  222. this.inDate = this.employmentInfo.inDate
  223. this.companyCode = this.employmentInfo.branchNo
  224. }
  225. else return req.msg("员工信息不存在")
  226. resolve();
  227. })
  228. })
  229. },
  230. // 用户名片信息
  231. getUserCard(){
  232. req.getRequest('/api/visiting/card/userInfo', {}, res => {
  233. console.log('getUserCard',res)
  234. this.userCard = res
  235. if(!res){
  236. this.isEdit = true
  237. this.getUserInfo()
  238. }else{
  239. if(!this.isEdit){
  240. if(res.auditState==0){
  241. // 待审核
  242. uni.redirectTo({
  243. url:'/card/success/success?state=0'
  244. })
  245. return false
  246. }else if(res.auditState==1){
  247. // 审核成功
  248. uni.redirectTo({
  249. url:'/card/success/success?state=1'
  250. })
  251. return false
  252. }else if(res.auditState==2){
  253. // 审核失败
  254. uni.redirectTo({
  255. url:'/card/success/success?state=2&&msg='+res.auditFailReason
  256. })
  257. }
  258. }
  259. this.id = res.id
  260. this.avatar = res.avatar;
  261. this.realName = res.realName;
  262. this.jobNumber = res.jobNumber;
  263. this.brief = res.brief;
  264. this.phone = res.phone;
  265. this.wechat = res.wechat;
  266. this.wechatCode = res.wechatCode;
  267. this.email = res.email;
  268. this.companyName = res.companyName;
  269. this.companyIntroduction = res.companyIntroduction?res.companyIntroduction:''
  270. this.industryName = res.industryName;
  271. this.tradeId = res.tradeId;
  272. this.address = res.address;
  273. this.job = res.job;
  274. this.morCity = [res.areaCode.substring(0,2)+'0000',res.areaCode.substring(0,4)+'00',res.areaCode]
  275. this.city = res.areaCodeName
  276. this.areaCode = this.morCity[2];
  277. this.latitude = res.latitude
  278. this.longitude = res.longitude
  279. }
  280. this.loading = false
  281. this.getEmploymentInfo()
  282. });
  283. },
  284. jumpUrl(url) {
  285. uni.navigateTo({
  286. url: url
  287. });
  288. },
  289. uploadImgsCopper() {
  290. this.copperShow = true
  291. let that = this
  292. this.$nextTick(()=>{
  293. that.$refs.avatar.fChooseImg(0,{
  294. selWidth: "690upx", selHeight: "500upx"
  295. });
  296. })
  297. },
  298. // 裁剪完成时,返回截取图片的临时路径
  299. copperSuccess(tempFilePathObj) {
  300. let that = this
  301. let tempFilePath = tempFilePathObj.path
  302. uni.showLoading({
  303. title:'上传中'
  304. })
  305. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  306. that.avatar = res.src;
  307. uni.hideLoading()
  308. this.copperShow = false
  309. });
  310. },
  311. uploadImgs() {
  312. let that = this;
  313. uni.chooseImage({
  314. count: 1,
  315. sizeType: ['original', 'compressed'],
  316. sourceType: ['album', 'camera'],
  317. success: function({ tempFilePaths }) {
  318. uni.showLoading({
  319. title:'上传中'
  320. })
  321. var promise =Promise.all(
  322. tempFilePaths.map(tempFilePath => {
  323. return new Promise(function(resolve, reject) {
  324. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  325. that.avatar = res.src;
  326. resolve()
  327. });
  328. });
  329. })
  330. );
  331. promise
  332. .then(function(results) {
  333. console.log(results);
  334. uni.hideLoading()
  335. })
  336. .catch(function(err) {
  337. console.log(err);
  338. uni.hideLoading()
  339. });
  340. }
  341. });
  342. },
  343. uploadWechat() {
  344. let that = this;
  345. uni.chooseImage({
  346. count: 1,
  347. sizeType: ['original', 'compressed'],
  348. sourceType: ['album', 'camera'],
  349. success: function({ tempFilePaths }) {
  350. uni.showLoading({
  351. title:'上传中'
  352. })
  353. var promise = Promise.all(
  354. tempFilePaths.map(tempFilePath => {
  355. return new Promise(function(resolve, reject) {
  356. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  357. that.wechatCode = res.src;
  358. resolve()
  359. });
  360. });
  361. })
  362. );
  363. promise
  364. .then(function(results) {
  365. console.log(results);
  366. uni.hideLoading()
  367. })
  368. .catch(function(err) {
  369. console.log(err);
  370. uni.hideLoading()
  371. });
  372. }
  373. });
  374. },
  375. uploadHonor(type,index){
  376. let that = this;
  377. uni.chooseImage({
  378. count: type=='change'?1:(9-that.honorImgUrls.length),
  379. sizeType: ['original', 'compressed'],
  380. sourceType: ['album', 'camera'],
  381. success: function({ tempFilePaths }) {
  382. uni.showLoading({
  383. title:'上传中'
  384. })
  385. var promise = Promise.all(
  386. tempFilePaths.map(tempFilePath => {
  387. return new Promise(function(resolve, reject) {
  388. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  389. if(type=='change'){
  390. that.honorImgUrls[index] = res.src
  391. that.honorImgUrls = JSON.parse(JSON.stringify(that.honorImgUrls))
  392. }else{
  393. that.honorImgUrls = that.honorImgUrls.concat(res.src)
  394. }
  395. resolve()
  396. });
  397. });
  398. })
  399. );
  400. promise
  401. .then(function(results) {
  402. console.log(results);
  403. uni.hideLoading()
  404. })
  405. .catch(function(err) {
  406. console.log(err);
  407. uni.hideLoading()
  408. });
  409. }
  410. });
  411. },
  412. deleteHonor(index){
  413. this.honorImgUrls.splice(index,1)
  414. },
  415. // 个人风采
  416. uploadStyle(type,index){
  417. let that = this;
  418. uni.chooseImage({
  419. count: type=='change'?1:(9-that.styleImgUrls.length),
  420. sizeType: ['original', 'compressed'],
  421. sourceType: ['album', 'camera'],
  422. success: function({ tempFilePaths }) {
  423. uni.showLoading({
  424. title:'上传中'
  425. })
  426. var promise = Promise.all(
  427. tempFilePaths.map(tempFilePath => {
  428. return new Promise(function(resolve, reject) {
  429. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  430. if(type=='change'){
  431. that.styleImgUrls[index] = res.src
  432. that.styleImgUrls = JSON.parse(JSON.stringify(that.styleImgUrls))
  433. }else{
  434. that.styleImgUrls = that.styleImgUrls.concat(res.src)
  435. }
  436. resolve()
  437. });
  438. });
  439. })
  440. );
  441. promise
  442. .then(function(results) {
  443. console.log(results);
  444. uni.hideLoading()
  445. })
  446. .catch(function(err) {
  447. console.log(err);
  448. uni.hideLoading()
  449. });
  450. }
  451. });
  452. },
  453. deleteStyle(index){
  454. this.styleImgUrls.splice(index,1)
  455. },
  456. intMessage(e){
  457. this.nums = e.detail.value.length
  458. },
  459. intWechatNumber(){
  460. this.wechat = this.phone
  461. },
  462. bindCity: function(e) {
  463. this.morCity = e.detail.code;
  464. this.city = e.detail.value.join().replace(/[,]/g, '');
  465. this.areaCode = e.detail.code[2];
  466. },
  467. bindAddressChange(data) {
  468. this.morCity = data.ids;
  469. this.city = data.data[0] + data.data[1] + data.data[2];
  470. this.areaCode = data.ids[2];
  471. },
  472. chooseLocation() {
  473. var tha = this;
  474. uni.chooseLocation({
  475. success: function(res) {
  476. if (res.name) {
  477. tha.address = res.name;
  478. tha.reverseGeocoder(res);
  479. console.log('地址数据》》》:', res);
  480. }
  481. }
  482. });
  483. },
  484. reverseGeocoder(location) {
  485. // #ifdef H5
  486. location = location.latitude + ',' + location.longitude
  487. let url = 'https://apis.map.qq.com/ws/geocoder/v1/?address=';
  488. this.$jsonp(url, {
  489. key: req.public.mapLBSKEY,
  490. location: location,
  491. output: 'jsonp'
  492. }).then(data => {
  493. console.log('解析后的地址地址数据:', data);
  494. data = data.result
  495. this.city = data.ad_info.province+data.ad_info.city+data.ad_info.district
  496. this.areaCode = data.ad_info.adcode;
  497. this.morCity = [this.areaCode.substring(0,2)+'0000',this.areaCode.substring(0,4)+'00',this.areaCode]
  498. this.longitude = data.location.lng
  499. this.latitude = data.location.lat
  500. }).catch(err => {
  501. console.log(err);
  502. });
  503. // #endif
  504. // #ifndef H5
  505. QQMapWX.initMap();
  506. QQMapWX.reverseGeocoder(location, data => {
  507. console.log('解析后的地址地址数据:', data);
  508. this.city = data.ad_info.province+data.ad_info.city+data.ad_info.district
  509. this.areaCode = data.ad_info.adcode;
  510. this.morCity = [this.areaCode.substring(0,2)+'0000',this.areaCode.substring(0,4)+'00',this.areaCode]
  511. this.longitude = data.location.lng
  512. this.latitude = data.location.lat
  513. });
  514. //#endif
  515. },
  516. inDateChange(e){
  517. console.log(e.detail.value)
  518. this.inDate = e.detail.value
  519. },
  520. /**
  521. * 提交名片
  522. */
  523. submitCard() {
  524. let that = this;
  525. if (!this.avatar) return req.msg('请上传头像');
  526. if (!this.realName) return req.msg('请填写你的真实姓名');
  527. if (!this.jobNumber) return req.msg('请填写你的工号');
  528. if (!this.brief) return req.msg('请填写个人简介');
  529. if (!this.phone) return req.msg('请填写手机号');
  530. // if (!this.wechat) return req.msg('请填写微信号');
  531. // if (!this.wechatCode) return req.msg('请上传微信二维码');
  532. if (!this.companyName) return req.msg('请填写公司名称');
  533. // if (!this.companyIntroduction) return req.msg('请填写公司简介');
  534. if (!this.job) return req.msg('请填写职位')
  535. if (!this.areaCode) return req.msg('请选择所在地区');
  536. if (!this.address) return req.msg('请填写详细地址');
  537. if (!this.inDate) return req.msg("请选择入司时间")
  538. var dataP = {};
  539. dataP.avatar = this.avatar;
  540. dataP.realName = this.realName;
  541. dataP.brief = this.brief;
  542. dataP.phone = this.phone;
  543. dataP.wechat = this.wechat;
  544. dataP.wechatCode = this.wechatCode;
  545. dataP.companyName = this.companyName;
  546. dataP.companyIntroduction = this.companyIntroduction;
  547. dataP.job = this.employmentInfo.actrank;
  548. dataP.inDate = this.inDate;
  549. // dataP.areaCode = {
  550. // id:this.areaCode,
  551. // name :this.city
  552. // };
  553. dataP.areaCode = this.areaCode
  554. dataP.areaCodeName = this.city
  555. dataP.address = this.address;
  556. dataP.longitude = this.longitude;
  557. dataP.latitude = this.latitude;
  558. dataP.jobNumber = this.jobNumber;
  559. dataP.honorImg = this.honorImgUrls.join(',');
  560. dataP.styleImg = this.styleImgUrls.join(',');
  561. dataP.companyCode = this.companyCode
  562. var url = '';
  563. if (this.id) {
  564. dataP.id = this.id;
  565. uni.showModal({
  566. title:'提示',
  567. content:'重新提交将会重新审核信息,确定提交?',
  568. success: (con) => {
  569. if(con.confirm){
  570. req.postRequest(
  571. '/api/visiting/card/saveOrUpdate',
  572. dataP,
  573. json => {
  574. if (that.id) {
  575. uni.reLaunch({
  576. url:'/card/success/success'
  577. })
  578. // req.msg('修改成功');
  579. // setTimeout(function() {
  580. // uni.navigateBack({
  581. // delta: 1
  582. // });
  583. // }, 1500);
  584. } else {
  585. uni.reLaunch({
  586. url:'/card/success/success'
  587. })
  588. // req.msg('名片创建成功');
  589. // setTimeout(function() {
  590. // that.jumpUrl('/card/index/index');
  591. // }, 1500);
  592. }
  593. },
  594. true
  595. );
  596. }
  597. }
  598. })
  599. } else{
  600. req.postRequest(
  601. '/api/visiting/card/saveOrUpdate',
  602. dataP,
  603. json => {
  604. if (that.id) {
  605. uni.reLaunch({
  606. url:'/card/success/success'
  607. })
  608. // req.msg('修改成功');
  609. // setTimeout(function() {
  610. // uni.navigateBack({
  611. // delta: 1
  612. // });
  613. // }, 1500);
  614. } else {
  615. uni.reLaunch({
  616. url:'/card/success/success'
  617. })
  618. // req.msg('名片创建成功');
  619. // setTimeout(function() {
  620. // that.jumpUrl('/card/index/index');
  621. // }, 1500);
  622. }
  623. },
  624. true
  625. );
  626. }
  627. }
  628. }
  629. };
  630. </script>
  631. <style>
  632. @import './create.css';
  633. </style>