create.vue 22 KB

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