create.vue 22 KB

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