create.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  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. await req.silenceLogin(opt.saleNo)
  189. console.log('getUserCard')
  190. await this.getUserInfo()
  191. this.getUserCard()
  192. },
  193. methods: {
  194. getUserInfo(){
  195. return new Promise((resolve,reject)=>{
  196. req.getRequest('/api/user/info',{},res=>{
  197. // this.avatar = res.avatar;
  198. this.phone = res.mobile;
  199. this.saleNo = res.saleNo
  200. req.setStorage('saleNo',this.saleNo)
  201. // this.getEmploymentInfo()
  202. resolve();
  203. })
  204. })
  205. },
  206. getEmploymentInfo(){
  207. return new Promise((resolve,reject)=>{
  208. req.getRequest('/api/visiting/card/employmentInfo',{jobNumber:this.saleNo},res=>{
  209. if(res.name){
  210. this.employmentInfo = res;
  211. this.realName = this.employmentInfo.name;
  212. this.certificateNo = this.employmentInfo.professionalCertificateNo
  213. this.jobNumber = this.employmentInfo.salesNo
  214. this.companyName = this.employmentInfo.branchName
  215. this.job = this.employmentInfo.actrankName
  216. this.inDate = this.employmentInfo.inDate
  217. this.companyCode = this.employmentInfo.branchNo
  218. }
  219. else return req.msg("员工信息不存在")
  220. resolve();
  221. })
  222. })
  223. },
  224. // 用户名片信息
  225. getUserCard(){
  226. req.getRequest('/api/visiting/card/userInfo', {}, res => {
  227. console.log('getUserCard',res)
  228. this.userCard = res
  229. if(!res){
  230. this.isEdit = true
  231. // this.getUserInfo()
  232. }else{
  233. if(!this.isEdit){
  234. if(res.auditState==0){
  235. // 待审核
  236. uni.redirectTo({
  237. url:'/card/success/success?state=0'
  238. })
  239. return false
  240. }else if(res.auditState==1){
  241. // 审核成功
  242. uni.redirectTo({
  243. url:'/card/success/success?state=1'
  244. })
  245. return false
  246. }else if(res.auditState==2){
  247. // 审核失败
  248. uni.redirectTo({
  249. url:'/card/success/success?state=2&&msg='+res.auditFailReason
  250. })
  251. }
  252. }
  253. this.id = res.id
  254. this.avatar = res.avatar;
  255. this.realName = res.realName;
  256. this.jobNumber = res.jobNumber;
  257. this.brief = res.brief;
  258. this.phone = res.phone;
  259. this.wechat = res.wechat;
  260. this.wechatCode = res.wechatCode;
  261. this.email = res.email;
  262. this.honorImgUrls = res.honorImgUrls?res.honorImgUrls:[];
  263. this.styleImgUrls = res.styleImgUrls?res.styleImgUrls:[];
  264. this.companyName = res.companyName;
  265. // this.companyIntroduction = res.companyIntroduction
  266. this.industryName = res.industryName;
  267. this.tradeId = res.tradeId;
  268. this.address = res.address;
  269. this.job = res.job;
  270. this.morCity = [res.areaCode.substring(0,2)+'0000',res.areaCode.substring(0,4)+'00',res.areaCode]
  271. this.city = res.areaCodeName
  272. this.areaCode = this.morCity[2];
  273. this.latitude = res.latitude
  274. this.longitude = res.longitude
  275. }
  276. this.loading = false
  277. this.getEmploymentInfo()
  278. });
  279. },
  280. jumpUrl(url) {
  281. uni.navigateTo({
  282. url: url
  283. });
  284. },
  285. uploadImgsCopper() {
  286. this.copperShow = true
  287. let that = this
  288. this.$nextTick(()=>{
  289. that.$refs.avatar.fChooseImg(0,{
  290. selWidth: "690upx", selHeight: "500upx"
  291. });
  292. })
  293. },
  294. // 裁剪完成时,返回截取图片的临时路径
  295. copperSuccess(tempFilePathObj) {
  296. let that = this
  297. let tempFilePath = tempFilePathObj.path
  298. uni.showLoading({
  299. title:'上传中'
  300. })
  301. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  302. that.avatar = res.src;
  303. uni.hideLoading()
  304. this.copperShow = false
  305. });
  306. },
  307. uploadImgs() {
  308. let that = this;
  309. uni.chooseImage({
  310. count: 1,
  311. sizeType: ['original', 'compressed'],
  312. sourceType: ['album', 'camera'],
  313. success: function({ tempFilePaths }) {
  314. uni.showLoading({
  315. title:'上传中'
  316. })
  317. var promise = Promise.all(
  318. tempFilePaths.map(tempFilePath => {
  319. return new Promise(function(resolve, reject) {
  320. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  321. that.avatar = res.src;
  322. resolve()
  323. });
  324. });
  325. })
  326. );
  327. promise
  328. .then(function(results) {
  329. uni.hideLoading()
  330. console.log(results);
  331. })
  332. .catch(function(err) {
  333. uni.hideLoading()
  334. console.log(err);
  335. });
  336. }
  337. });
  338. },
  339. uploadWechat() {
  340. let that = this;
  341. uni.chooseImage({
  342. count: 1,
  343. sizeType: ['original', 'compressed'],
  344. sourceType: ['album', 'camera'],
  345. success: function({ tempFilePaths }) {
  346. uni.showLoading({
  347. title:'上传中'
  348. })
  349. var promise = Promise.all(
  350. tempFilePaths.map(tempFilePath => {
  351. return new Promise(function(resolve, reject) {
  352. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  353. that.wechatCode = res.src;
  354. resolve()
  355. });
  356. });
  357. })
  358. );
  359. promise
  360. .then(function(results) {
  361. uni.hideLoading()
  362. console.log(results);
  363. })
  364. .catch(function(err) {
  365. uni.hideLoading()
  366. console.log(err);
  367. });
  368. }
  369. });
  370. },
  371. uploadHonor(type,index){
  372. let that = this;
  373. uni.chooseImage({
  374. count: type=='change'?1:(9-that.honorImgUrls.length),
  375. sizeType: ['original', 'compressed'],
  376. sourceType: ['album', 'camera'],
  377. success: function({ tempFilePaths }) {
  378. uni.showLoading({
  379. title:'上传中'
  380. })
  381. var promise = Promise.all(
  382. tempFilePaths.map(tempFilePath => {
  383. return new Promise(function(resolve, reject) {
  384. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  385. if(type=='change'){
  386. that.honorImgUrls[index] = res.src
  387. that.honorImgUrls = JSON.parse(JSON.stringify(that.honorImgUrls))
  388. }else{
  389. that.honorImgUrls = that.honorImgUrls.concat(res.src)
  390. }
  391. resolve()
  392. });
  393. });
  394. })
  395. );
  396. promise
  397. .then(function(results) {
  398. uni.hideLoading()
  399. console.log(results);
  400. })
  401. .catch(function(err) {
  402. uni.hideLoading()
  403. console.log(err);
  404. });
  405. }
  406. });
  407. },
  408. deleteHonor(index){
  409. this.honorImgUrls.splice(index,1)
  410. },
  411. // 个人风采
  412. uploadStyle(type,index){
  413. let that = this;
  414. uni.chooseImage({
  415. count: type=='change'?1:(9-that.styleImgUrls.length),
  416. sizeType: ['original', 'compressed'],
  417. sourceType: ['album', 'camera'],
  418. success: function({ tempFilePaths }) {
  419. uni.showLoading({
  420. title:'上传中'
  421. })
  422. var promise = Promise.all(
  423. tempFilePaths.map(tempFilePath => {
  424. return new Promise(function(resolve, reject) {
  425. req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
  426. if(type=='change'){
  427. that.styleImgUrls[index] = res.src
  428. that.styleImgUrls = JSON.parse(JSON.stringify(that.styleImgUrls))
  429. }else{
  430. that.styleImgUrls = that.styleImgUrls.concat(res.src)
  431. }
  432. resolve()
  433. });
  434. });
  435. })
  436. );
  437. promise
  438. .then(function(results) {
  439. uni.hideLoading()
  440. console.log(results);
  441. })
  442. .catch(function(err) {
  443. uni.hideLoading()
  444. console.log(err);
  445. });
  446. }
  447. });
  448. },
  449. deleteStyle(index){
  450. this.styleImgUrls.splice(index,1)
  451. },
  452. intMessage(e){
  453. this.nums = e.detail.value.length
  454. },
  455. intWechatNumber(){
  456. this.wechat = this.phone
  457. },
  458. bindCity: function(e) {
  459. this.morCity = e.detail.code;
  460. this.city = e.detail.value.join().replace(/[,]/g, '');
  461. this.areaCode = e.detail.code[2];
  462. },
  463. bindAddressChange(data) {
  464. this.morCity = data.ids;
  465. this.city = data.data[0] + data.data[1] + data.data[2];
  466. this.areaCode = data.ids[2];
  467. },
  468. chooseLocation() {
  469. var tha = this;
  470. uni.chooseLocation({
  471. success: function(res) {
  472. if (res.name) {
  473. tha.address = res.name;
  474. tha.reverseGeocoder(res);
  475. console.log('地址数据》》》:', res);
  476. }
  477. }
  478. });
  479. },
  480. reverseGeocoder(location) {
  481. // #ifdef H5
  482. location = location.latitude + ',' + location.longitude
  483. let url = 'https://apis.map.qq.com/ws/geocoder/v1/?address=';
  484. this.$jsonp(url, {
  485. key: req.public.mapLBSKEY,
  486. location: location,
  487. output: 'jsonp'
  488. }).then(data => {
  489. console.log('解析后的地址地址数据:', data);
  490. data = data.result
  491. this.city = data.ad_info.province+data.ad_info.city+data.ad_info.district
  492. this.areaCode = data.ad_info.adcode;
  493. this.morCity = [this.areaCode.substring(0,2)+'0000',this.areaCode.substring(0,4)+'00',this.areaCode]
  494. this.longitude = data.location.lng
  495. this.latitude = data.location.lat
  496. }).catch(err => {
  497. console.log(err);
  498. });
  499. // #endif
  500. // #ifndef H5
  501. QQMapWX.initMap();
  502. QQMapWX.reverseGeocoder(location, data => {
  503. console.log('解析后的地址地址数据:', data);
  504. this.city = data.ad_info.province+data.ad_info.city+data.ad_info.district
  505. this.areaCode = data.ad_info.adcode;
  506. this.morCity = [this.areaCode.substring(0,2)+'0000',this.areaCode.substring(0,4)+'00',this.areaCode]
  507. this.longitude = data.location.lng
  508. this.latitude = data.location.lat
  509. });
  510. //#endif
  511. },
  512. inDateChange(e){
  513. console.log(e.detail.value)
  514. this.inDate = e.detail.value
  515. },
  516. /**
  517. * 提交名片
  518. */
  519. submitCard() {
  520. let that = this;
  521. if (!this.avatar) return req.msg('请上传头像');
  522. if (!this.realName) return req.msg('请填写你的真实姓名');
  523. if (!this.jobNumber) return req.msg('请填写你的工号');
  524. if (!this.brief) return req.msg('请填写个人简介');
  525. if (!this.phone) return req.msg('请填写手机号');
  526. // if (!this.wechat) return req.msg('请填写微信号');
  527. // if (!this.wechatCode) return req.msg('请上传微信二维码');
  528. if (!this.companyName) return req.msg('请填写公司名称');
  529. // if (!this.companyIntroduction) return req.msg('请填写公司简介');
  530. if (!this.job) return req.msg('请填写职位')
  531. if (!this.areaCode) return req.msg('请选择所在地区');
  532. if (!this.address) return req.msg('请填写详细地址');
  533. if (!this.inDate) return req.msg("请选择入司时间")
  534. var dataP = {};
  535. dataP.avatar = this.avatar;
  536. dataP.realName = this.realName;
  537. dataP.brief = this.brief;
  538. dataP.phone = this.phone;
  539. dataP.wechat = this.wechat;
  540. dataP.wechatCode = this.wechatCode;
  541. dataP.companyName = this.companyName;
  542. // dataP.companyIntroduction = this.companyIntroduction;
  543. dataP.job = this.employmentInfo.actrank;
  544. dataP.inDate = this.inDate;
  545. // dataP.areaCode = {
  546. // id:this.areaCode,
  547. // name :this.city
  548. // };
  549. dataP.areaCode = this.areaCode
  550. dataP.areaCodeName = this.city
  551. dataP.address = this.address;
  552. dataP.longitude = this.longitude;
  553. dataP.latitude = this.latitude;
  554. dataP.jobNumber = this.jobNumber;
  555. dataP.honorImg = this.honorImgUrls.join(',');
  556. dataP.styleImg = this.styleImgUrls.join(',');
  557. dataP.companyCode = this.companyCode
  558. var url = '';
  559. console.log(dataP)
  560. if (this.id) {
  561. dataP.id = this.id;
  562. uni.showModal({
  563. title:'提示',
  564. content:'重新提交将会重新审核信息,确定提交?',
  565. success: (con) => {
  566. if(con.confirm){
  567. req.postRequest(
  568. '/api/visiting/card/saveOrUpdate',
  569. dataP,
  570. json => {
  571. if (that.id) {
  572. uni.reLaunch({
  573. url:'/card/success/success'
  574. })
  575. // req.msg('修改成功');
  576. // setTimeout(function() {
  577. // uni.navigateBack({
  578. // delta: 1
  579. // });
  580. // }, 1500);
  581. } else {
  582. uni.reLaunch({
  583. url:'/card/success/success'
  584. })
  585. // req.msg('名片创建成功');
  586. // setTimeout(function() {
  587. // that.jumpUrl('/card/index/index');
  588. // }, 1500);
  589. }
  590. },
  591. true
  592. );
  593. }
  594. }
  595. })
  596. } else{
  597. req.postRequest(
  598. '/api/visiting/card/saveOrUpdate',
  599. dataP,
  600. json => {
  601. if (that.id) {
  602. uni.reLaunch({
  603. url:'/card/success/success'
  604. })
  605. // req.msg('修改成功');
  606. // setTimeout(function() {
  607. // uni.navigateBack({
  608. // delta: 1
  609. // });
  610. // }, 1500);
  611. } else {
  612. uni.reLaunch({
  613. url:'/card/success/success'
  614. })
  615. // req.msg('名片创建成功');
  616. // setTimeout(function() {
  617. // that.jumpUrl('/card/index/index');
  618. // }, 1500);
  619. }
  620. },
  621. true
  622. );
  623. }
  624. }
  625. }
  626. };
  627. </script>
  628. <style>
  629. @import './create.css';
  630. </style>