circle.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. <template>
  2. <view class="template-edit tn-safe-area-inset-bottom">
  3. <!-- 顶部自定义导航 -->
  4. <tn-nav-bar fixed customBack>
  5. <view slot="back" class='tn-custom-nav-bar__back' @click="goBack">
  6. <text class='icon tn-icon-left'></text>
  7. </view>
  8. <view slot="default" style="display: flex;">
  9. <view style="flex:1;margin-left:25px">
  10. <text :style="{fontSize:(wxFontSize)+'px'}">发布需求</text>
  11. </view>
  12. <view>
  13. <button v-if="!canSave" :disabled="!canSave" plain="true" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#0003;border-color:#0003;" @click="saveForm(1)" :style="{fontSize:(wxFontSize-3)+'px'}">暂存</button>
  14. <button v-if="canSave" plain="true" :disabled="!canSave" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#1d60b1;border-color:#1d60b1;" @click="saveForm(1)" :style="{fontSize:(wxFontSize-3)+'px'}">暂存</button>
  15. </view>
  16. </view>
  17. </tn-nav-bar>
  18. <view class="tn-safe-area-inset-bottom" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
  19. <tn-steps style="pointer-events:none;" :list="stepList" :current="stepIndex" mode="dotIcon" :fontSize="(wxFontSize-3)+'px'"></tn-steps>
  20. <view v-show="stepIndex==1">
  21. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top tn-margin">
  22. <view class="tn-flex justify-content-item">
  23. <view class="tn-text-lg tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">以下三种方式可任选其一,若有可都输入</view>
  24. </view>
  25. </view>
  26. <view class="tn-margin tn-bg-gray--light tn-padding" style="border-radius: 10rpx;">
  27. <textarea maxlength="500" v-model="content" placeholder="请描述您的需求..." :style="{fontSize:(wxFontSize-3)+'px'}" :placeholder-style="styleString"></textarea>
  28. </view>
  29. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin" style="margin-top:40px;margin-bottom: 0;">
  30. <view class="tn-flex justify-content-item">
  31. <view class=" tn-text-center"
  32. style="border-radius: 100rpx;margin-right: 8rpx;width: 45rpx;height: 45rpx;line-height: 45rpx;">
  33. <text class="tn-icon-image" style="font-size: 20px;" :style="{fontSize:(wxFontSize+3)+'px'}"></text>
  34. </view>
  35. <view class="tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">上传图片</view>
  36. </view>
  37. <!-- <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
  38. <text class="tn-padding-xs">清空上传</text>
  39. <text class="tn-icon-delete"></text>
  40. </view> -->
  41. </view>
  42. <view class="tn-margin-left tn-padding-top-xs">
  43. <uni-file-picker
  44. v-model="imgList" :limit="6" @delete="deleteFile" :auto-upload="false" @select="select" @success="success">
  45. </uni-file-picker>
  46. <view style="margin-top: 8px;">
  47. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">一次只能上传六张图片</text>
  48. </view>
  49. </view>
  50. <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top-xl tn-margin" style="margin-bottom: 0;">
  51. <view class="tn-flex justify-content-item">
  52. <view class=" tn-text-center"
  53. style="border-radius: 100rpx;margin-right: 8rpx;width: 45rpx;height: 45rpx;line-height: 45rpx;">
  54. <text class="tn-icon-link" style="font-size: 20px;" :style="{fontSize:(wxFontSize+3)+'px'}"></text>
  55. </view>
  56. <view class="tn-padding-right-xs tn-text-bold" style="font-size: 16px;" :style="{fontSize:(wxFontSize-1)+'px'}">上传文件</view>
  57. </view>
  58. <!-- <view class="justify-content-item tn-text-df tn-color-grey" @tap="clear">
  59. <text class="tn-padding-xs">清空上传</text>
  60. <text class="tn-icon-delete"></text>
  61. </view> -->
  62. </view>
  63. <view class="tn-margin-left tn-padding-top-xs">
  64. <uni-file-picker
  65. v-model="fileList" :limit="3" mode="grid" @delete="deleteFile" file-mediatype="all" file-extname="pdf,docx,doc,xls,xlsx" :auto-upload="false" @select="select" @success="success">
  66. <!-- <button size="default">上传文件</button> -->
  67. <view style="text-align: left;">
  68. <button size="mini" style="color:#1d60b1;border-color:#1d60b1;" plain="true" :style="{fontSize:(wxFontSize-5)+'px'}">上传文件</button>
  69. </view>
  70. <!-- <tn-button shadow shape="round" fontColor="tn-color-white" size="lg" backgroundColor="tn-bg-blue" :fontSize="24" height="auto" padding="20rpx 36rpx">上传文件</tn-button>
  71. -->
  72. </uni-file-picker>
  73. <view style="margin-top: 4px;">
  74. <text style="color: #999;font-size: 12px;" :style="{fontSize:(wxFontSize-5)+'px'}">一次只能上传三个文件,支持格式 pdf .doc .xls,不超过5MB。</text>
  75. </view>
  76. </view>
  77. <view style="margin-top:20px;padding: 16px">
  78. <text style="font-size: 16px;line-height: 30px;" :style="{fontSize:(wxFontSize-1)+'px'}">需求有效期:</text>
  79. <uni-data-select
  80. v-model="selectValue"
  81. :localdata="selectList"
  82. @change="changeSelect"
  83. placement="top"
  84. placeholder="请选择"
  85. :fontSize="(wxFontSize-3)+'px'"
  86. ></uni-data-select>
  87. </view>
  88. <!-- 悬浮按钮-->
  89. <view class="tn-flex tn-footerfixed">
  90. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  91. <button type="default" plain="true" style="border-radius: 24px;" :disabled="!canNext"
  92. @click="nextStep()" :style="{fontSize:(wxFontSize-2)+'px'}">
  93. 下一步
  94. </button>
  95. </view>
  96. </view>
  97. </view>
  98. <view v-show="stepIndex==2">
  99. <view style="padding:16px">
  100. <uni-forms :modelValue="formData" label-width="0">
  101. <view style="margin:16px 0" :style="{fontSize:(wxFontSize-3)+'px'}">
  102. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" >*</text><text>公司名称:</text>
  103. <w-select
  104. style="width: 100%;"
  105. v-model='searchValue'
  106. :list='items'
  107. valueName='name'
  108. keyName="regNumber"
  109. @change='selectChange'
  110. :filterable="true"
  111. :fontSize="(wxFontSize-3)+'px'"
  112. >
  113. </w-select>
  114. </view>
  115. <!-- <uni-forms-item label="公司名称" name="name">
  116. <uni-easyinput type="text" v-model="userInfo.company" placeholder="请输入所在公司名称" />
  117. </uni-forms-item> -->
  118. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-3)+'px'}">*</text><text :style="{fontSize:(wxFontSize-3)+'px'}">您的职称:</text>
  119. <uni-forms-item label="" name="realName" label-width="0">
  120. <uni-easyinput type="text" v-model="formInfo.jobTitle" :inputSize="wxFontSize-3" :placeholder-style="styleString" :clearable="false" placeholder="请输入您的职称" />
  121. </uni-forms-item>
  122. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-3)+'px'}">*</text><text :style="{fontSize:(wxFontSize-3)+'px'}">联系人姓名:</text>
  123. <uni-forms-item label="联系人姓名" name="contactMethod">
  124. <uni-easyinput type="text" v-model="formInfo.contactPerson" :inputSize="wxFontSize-3" :placeholder-style="styleString" :clearable="false" placeholder="请输入联系人姓名" />
  125. </uni-forms-item>
  126. <text style="color: red;line-height: 30px;vertical-align: middle;margin-right: 4px;" :style="{fontSize:(wxFontSize-3)+'px'}">*</text><text :style="{fontSize:(wxFontSize-3)+'px'}">联系方式:</text>
  127. <uni-forms-item label="联系方式" name="phone">
  128. <uni-easyinput type="text" v-model="formInfo.contactMethod" :inputSize="wxFontSize-3" :placeholder-style="styleString" :clearable="false" placeholder="请输入联系手机/微信/邮箱" />
  129. </uni-forms-item>
  130. <uni-forms-item label="11" name="check">
  131. <tn-checkbox v-model="formInfo.agree" activeColor="#45c05d" :size="wxFontSize+17" name="选项1">
  132. <text :style="{fontSize:(wxFontSize-4)+'px',color:formInfo.agree?'#45c05d':'#666666'}">同意平台核查所填信息的真实性</text>
  133. </tn-checkbox>
  134. <text :style="{fontSize:(wxFontSize-4)+'px',color:'#888',paddingTop:'8px',display:'block'}">系统将短信通知您审核结果。如需关闭通知功能,请前往我的页面自行关闭</text>
  135. </uni-forms-item>
  136. </uni-forms>
  137. </view>
  138. <view class="tn-flex tn-footerfixed">
  139. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  140. <button type="default" plain="true" style="border-radius: 24px;"
  141. @click="preStep()" :disabled="!canSave" :style="{fontSize:(wxFontSize-2)+'px'}">
  142. 上一步
  143. </button>
  144. </view>
  145. <view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center">
  146. <button v-if="canSave&&canNext" type="primary" style="background-color:#1d60b1;border-radius: 23px" @click="saveForm()" :style="{fontSize:(wxFontSize-2)+'px'}">提交审核</button>
  147. <button v-if="!canSave||!canNext" type="primary" :disabled="!canSave||!canNext" style="background-color:#0003;border-radius: 23px" @click="saveForm()" :style="{fontSize:(wxFontSize-2)+'px'}">提交审核</button>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. <view class='tn-tabbar-height'></view>
  153. </view>
  154. </template>
  155. <script>
  156. import template_page_mixin from '@/libs/mixin/template_page_mixin.js';
  157. import request from '../utils/request';
  158. export default {
  159. name: 'TemplateEdit',
  160. mixins: [template_page_mixin],
  161. data() {
  162. return {
  163. wxFontSize:17,
  164. canSave: true,
  165. selectValue: '',
  166. //非常紧急/两周/一月/长期
  167. selectList: [{
  168. value: '一周',
  169. text: '一周'
  170. },
  171. {
  172. value: '两周',
  173. text: '两周'
  174. },
  175. {
  176. value: '一月',
  177. text: '一月'
  178. }
  179. ],
  180. content:'',
  181. formInfo:{
  182. jobTitle:'',
  183. agree:false,
  184. contactPerson:JSON.parse(uni.getStorageSync('userInfo')).contactNickName,
  185. contactMethod:JSON.parse(uni.getStorageSync('userInfo')).contactMethod||JSON.parse(uni.getStorageSync('userInfo')).userName
  186. },
  187. imgList:[],
  188. fileDetailList:[],
  189. stepIndex:1,
  190. stepList: [{
  191. name: '填写需求',
  192. icon: 'circle',
  193. selectIcon: 'circle-fill'
  194. },
  195. {
  196. name: '填写联系方式',
  197. icon: 'trusty',
  198. selectIcon: 'trusty-fill'
  199. }
  200. ],
  201. formData: {
  202. apiType: 'this,ali',
  203. token: 'dffc1e06e636cff0fdf7d877b6ae6a2e',
  204. image: null
  205. },
  206. fileList: [],
  207. showUploadList: true,
  208. customBtn: false,
  209. autoUpload: true,
  210. showProgress: false,
  211. deleteable: true,
  212. customStyle: false,
  213. maxCount: 9,
  214. disabled: false,
  215. searchValue: '',
  216. items: [],
  217. org:{
  218. name:'',
  219. regNumber:''
  220. },
  221. editItem:{},
  222. styleString:'font-size:'+14+'px',
  223. canNext:true
  224. }
  225. },
  226. watch: {
  227. searchValue(val, oldval) {
  228. console.error(val,this.org.name);
  229. if(val!==this.org.name){
  230. this.current = null;
  231. }
  232. if(this.stepIndex==2){
  233. this.search(val)
  234. }
  235. }
  236. },
  237. onLoad(props) {
  238. const appBaseInfo = wx.getAppBaseInfo();
  239. this.wxFontSize = uni.getStorageSync('fontSize')||appBaseInfo.fontSizeSetting||17;
  240. this.styleString='font-size:'+(this.wxFontSize-3)+'px';
  241. if(props.sid){
  242. this.isEdit = true;
  243. this.editItem = JSON.parse(uni.getStorageSync(props.sid)||'{}');
  244. this.content = this.editItem.content;
  245. this.fileDetailList = this.editItem.fileDetailList;
  246. for(let i=0;i<this.fileDetailList.length;i++){
  247. this.fileDetailList[i].path = this.fileDetailList[i].ftpUrl
  248. if(this.isImage(this.fileDetailList[i].fileName)){
  249. this.imgList.push({
  250. name: this.fileDetailList[i].fileName,
  251. url: this.fileDetailList[i].ftpUrl,
  252. path: this.fileDetailList[i].path
  253. })
  254. }else{
  255. this.fileList.push({
  256. name: this.fileDetailList[i].fileName,
  257. url: this.fileDetailList[i].ftpUrl,
  258. path: this.fileDetailList[i].path
  259. })
  260. }
  261. }
  262. this.org.name = this.editItem.company;
  263. this.formInfo.jobTitle = this.editItem.jobTitle;
  264. this.formInfo.contactPerson = this.editItem.contactPerson;
  265. this.formInfo.contactMethod = this.editItem.contactMethod;
  266. }
  267. this.getCompany();
  268. },
  269. methods: {
  270. isImage(fileName) {
  271. const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'ico']
  272. const extension = fileName.split('.').pop().toLowerCase();
  273. return imageExtensions.includes(extension);
  274. },
  275. getCompany(){
  276. let that = this;
  277. request.post('/slbUserCompanyRel/show/my', {
  278. userNo: uni.getStorageSync('userNo')
  279. }).then(res => {
  280. if (res.success) {
  281. let list = res.list || [];
  282. for(let i=0;i<list.length;i++){
  283. list[i].name = list[i].company;
  284. list[i].regNumber= list[i].company;
  285. if(!that.isEdit&&list[i].isDefault=='1'){
  286. that.searchValue = list[i].name
  287. that.current = list[i].name;
  288. that.org = list[i];
  289. if(list[i].jobTitle){
  290. that.formInfo.jobTitle = list[i].jobTitle
  291. }
  292. if(list[i].contactPerson){
  293. that.formInfo.contactPerson = list[i].contactPerson
  294. }
  295. if(list[i].contactMethod){
  296. that.formInfo.contactMethod = list[i].contactMethod;
  297. }
  298. that.getAddress(list[i].name);
  299. }
  300. if(that.isEdit&&list[i].name==that.editItem.company){
  301. that.searchValue = list[i].name
  302. that.current = list[i].name;
  303. that.formInfo.jobTitle = list[i].jobTitle;
  304. that.formInfo.contactPerson = list[i].contactPerson;
  305. that.formInfo.contactMethod = list[i].contactMethod;
  306. that.org = list[i];
  307. that.getAddress(list[i].name);
  308. }
  309. }
  310. that.items = list;
  311. }else{
  312. if(res._redirect){
  313. uni.showToast({
  314. title: '操作过期,请重试',
  315. duration: 2000,
  316. icon:'none'
  317. });
  318. that.goBack();
  319. }
  320. }
  321. })
  322. },
  323. preStep(){
  324. this.stepIndex = 1;
  325. },
  326. nextStep(){
  327. console.warn(this.searchValue);
  328. if(this.content==''&&this.fileDetailList.length===0){
  329. uni.showToast({
  330. title:'请输入您的需求或上传图片/文件',
  331. icon:'none'
  332. })
  333. this.stepIndex = 1;
  334. return false;
  335. }
  336. this.stepIndex = 2;
  337. },
  338. changeSelect(e) {
  339. this.selectValue = e;
  340. },
  341. saveForm(status){
  342. if(!this.canSave){
  343. return false;
  344. }
  345. let that = this;
  346. let params = {
  347. };
  348. if(status!=1&&!this.org.name){
  349. uni.showToast({
  350. title: '请输入公司名称',
  351. duration: 2000,
  352. icon:'none'
  353. });
  354. return false;
  355. }
  356. if(status!=1&&this.formInfo.jobTitle.length<1){
  357. uni.showToast({
  358. title: '请输入您的职称',
  359. duration: 2000,
  360. icon:'none'
  361. });
  362. return false;
  363. }
  364. if(status!=1&&this.formInfo.contactPerson.length<1){
  365. uni.showToast({
  366. title: '请输入联系人姓名',
  367. duration: 2000,
  368. icon:'none'
  369. });
  370. return false;
  371. }
  372. if(status!=1&&this.formInfo.contactMethod.length<1){
  373. uni.showToast({
  374. title: '请输入联系方式',
  375. duration: 2000,
  376. icon:'none'
  377. });
  378. return false;
  379. }
  380. if(status!=1&&!this.formInfo.agree){
  381. uni.showToast({
  382. title: '请勾选同意平台核查所填信息的真实性',
  383. duration: 2000,
  384. icon:'none'
  385. });
  386. return false;
  387. }
  388. if(!that.canNext){
  389. uni.showToast({
  390. title: '照片/文件正在上传中,请耐心等待',
  391. duration: 2000,
  392. icon:'none'
  393. });
  394. return false;
  395. }
  396. uni.showToast({
  397. title: '提交中...',
  398. icon:'none'
  399. });
  400. that.canSave = false;
  401. params.slbResourceDemand = {
  402. type:'3',
  403. company:this.org.name,
  404. jobTitle:this.formInfo.jobTitle,
  405. contactPerson:this.formInfo.contactPerson,
  406. contactMethod:this.formInfo.contactMethod,
  407. content:that.content,
  408. userNo:uni.getStorageSync('userNo'),
  409. validDate:this.selectValue,
  410. status: status==1?status:3,
  411. showFlag:'是',
  412. id: that.isEdit?that.editItem.id:undefined,
  413. bisNo: that.isEdit?that.editItem.bisNo:undefined,
  414. version: that.isEdit?that.editItem.version:undefined
  415. };
  416. params.slbResourceDemand.companyEntity = {};
  417. params.slbResourceDemand.companyEntity.company = params.slbResourceDemand.company;
  418. params.slbResourceDemand.companyEntity.jobTitle = params.slbResourceDemand.jobTitle;
  419. params.slbResourceDemand.companyEntity.creditCode = this.org.creditCode;
  420. params.slbResourceDemand.companyEntity.address = this.org.base;
  421. params.slbResourceDemand.companyEntity.regStatus = this.org.regStatus;
  422. params.slbResourceDemand.companyEntity.contactPerson = params.slbResourceDemand.contactPerson;
  423. params.slbResourceDemand.companyEntity.contactMethod = params.slbResourceDemand.contactMethod;
  424. params.slbResourceDemand.slbUserExt = {
  425. contactPerson:params.slbResourceDemand.contactPerson,
  426. contactMethod:params.slbResourceDemand.contactMethod,
  427. userNo:uni.getStorageSync('userNo'),
  428. };
  429. params.slbResourceDemand = JSON.stringify(params.slbResourceDemand);
  430. // params.slbResourceDemand.companyEntity.contactNickName = params.slbResourceDemand.contactNickName;
  431. // params.slbUserExt = JSON.stringify({
  432. // jobTitle:this.formInfo.jobTitle,
  433. // contactPerson:this.formInfo.contactPerson,
  434. // contactMethod:this.formInfo.contactMethod,
  435. // userNo:uni.getStorageSync('userNo'),
  436. // });
  437. params.fileDetailList = JSON.stringify(this.fileDetailList);
  438. request.post(that.isEdit?'/slbResourceDemand/update':'/slbResourceDemand/add', params).then(res => {
  439. if(res.success){
  440. uni.showToast({
  441. title:status==1?'信息已暂存,请在我的需求中查看暂存信息':'发布已提交,请在我的需求中查看进度',
  442. icon:'none',
  443. success:()=>{
  444. setTimeout(()=>{
  445. uni.redirectTo({
  446. url: "/pages/mine/need?tab="+(status==1?2:1)
  447. });
  448. },1500)
  449. }
  450. })
  451. }else{
  452. uni.showToast({
  453. title:res.msg,
  454. icon:'none'
  455. })
  456. that.canSave = true;
  457. }
  458. console.warn(res);
  459. })
  460. },
  461. // 跳转
  462. tn(e) {
  463. uni.navigateTo({
  464. url: e,
  465. });
  466. },
  467. // 手动上传文件
  468. upload() {
  469. console.warn(121212);
  470. },
  471. // 手动清空列表
  472. clear() {
  473. this.$refs.imageUpload.clear()
  474. },
  475. // 图片拖拽重新排序
  476. onSortList(list) {
  477. console.log(list);
  478. },
  479. select(e) {
  480. console.log('选择文件:', e)
  481. let tempFiles = e.tempFiles;
  482. for (let i in tempFiles) {
  483. this.upfile(tempFiles[i])
  484. }
  485. },
  486. deleteFile(e, index) {
  487. if(!this.canNext){
  488. uni.showToast({
  489. title: '照片/文件正在上传中,请耐心等待',
  490. icon:'none'
  491. });
  492. return false;
  493. }
  494. for(let i=0;i<this.fileDetailList.length;i++){
  495. if(e.tempFile.path===this.fileDetailList[i].path){
  496. this.fileDetailList.splice(i, 1);
  497. }
  498. }
  499. },
  500. upfile(file) {
  501. let that = this;
  502. console.warn(file);
  503. this.canNext = false;
  504. uni.showToast({
  505. title: '照片/文件正在上传中,请耐心等待',
  506. icon:'none'
  507. });
  508. uni.uploadFile({
  509. url: 'https://slb-m.lx-device.com/oss/upload/userFeedback', //仅为示例,非真实的接口地址
  510. filePath: file.url,
  511. name: 'file',
  512. success: (uploadFileRes) => {
  513. that.canNext = true;
  514. uni.hideToast();
  515. console.warn(JSON.parse(uploadFileRes.data));
  516. if(JSON.parse(uploadFileRes.data).success){
  517. let resultMap = JSON.parse(uploadFileRes.data).resultMap;
  518. that.fileDetailList.push({
  519. name: file.name,
  520. fileName: file.name, // 原始文件名
  521. ftpUrl: resultMap.uploadUrl, // 文件访问url
  522. path: file.path
  523. })
  524. }else{
  525. uni.showToast({
  526. title: JSON.parse(uploadFileRes.data).msg+',请删除后重试',
  527. icon:'none'
  528. });
  529. }
  530. },
  531. fail:(err)=>{
  532. uni.showToast({
  533. title: '上传失败,请删除后重试',
  534. icon:'none'
  535. });
  536. }
  537. });
  538. },
  539. // 上传成功
  540. success(e) {
  541. console.log('上传成功')
  542. },
  543. selectChange(e){
  544. console.error(e);
  545. this.searchValue = e.name
  546. this.current = e.regNumber;
  547. if(e.jobTitle){
  548. this.formInfo.jobTitle = e.jobTitle;
  549. }
  550. this.org = e;
  551. this.getAddress(e.name);
  552. },
  553. getAddress(name){
  554. let that = this;
  555. request.post('/member/getEnterPriseInfo', {
  556. keyWord: name
  557. }).then(res => {
  558. if(res&&res.success&&res.resultMap.data){
  559. if( res.resultMap.data.creditCode){
  560. that.org.creditCode = res.resultMap.data.creditCode
  561. }
  562. if( res.resultMap.data.regStatus){
  563. that.org.regStatus = res.resultMap.data.regStatus
  564. }
  565. if( res.resultMap.data.regLocation){
  566. that.org.base = res.resultMap.data.regLocation
  567. }
  568. }
  569. })
  570. },
  571. search: function(val) {
  572. let that = this;
  573. if (val && val.length > 3) {
  574. request.post('/member/searchCompys', {
  575. keyWord: val
  576. }).then(res => {
  577. if(res&&res.success){
  578. let list = res.resultMap.data || [];
  579. that.items = list;
  580. }else{
  581. if(res._redirect){
  582. uni.showToast({
  583. title: '操作过期,请重试',
  584. duration: 2000,
  585. icon:'none'
  586. });
  587. that.goBack();
  588. }
  589. }
  590. })
  591. }else{
  592. that.items = [];
  593. that.org = {};
  594. }
  595. },
  596. goBack() {
  597. const pages = getCurrentPages()
  598. // 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回
  599. if (pages.length > 1) {
  600. uni.navigateBack()
  601. return;
  602. }else{
  603. uni.navigateTo({
  604. url: '/pages/index/index'
  605. })
  606. }
  607. },
  608. }
  609. }
  610. </script>
  611. <style lang="scss" scoped>
  612. .template-edit {}
  613. /* 胶囊*/
  614. .tn-custom-nav-bar__back {
  615. width: 60%;
  616. height: 100%;
  617. position: relative;
  618. display: flex;
  619. justify-content: space-evenly;
  620. align-items: center;
  621. box-sizing: border-box;
  622. // background-color: rgba(0, 0, 0, 0.15);
  623. border-radius: 1000rpx;
  624. border: 1rpx solid rgba(255, 255, 255, 0.5);
  625. // color: #FFFFFF;
  626. font-size: 18px;
  627. .icon {
  628. display: block;
  629. flex: 1;
  630. margin: auto;
  631. text-align: center;
  632. }
  633. &:before {
  634. content: " ";
  635. width: 1rpx;
  636. height: 110%;
  637. position: absolute;
  638. top: 22.5%;
  639. left: 0;
  640. right: 0;
  641. margin: auto;
  642. transform: scale(0.5);
  643. transform-origin: 0 0;
  644. pointer-events: none;
  645. box-sizing: border-box;
  646. opacity: 0.7;
  647. background-color: #FFFFFF;
  648. }
  649. }
  650. /* 底部悬浮按钮 start*/
  651. .tn-tabbar-height {
  652. min-height: 100rpx;
  653. height: calc(120rpx + env(safe-area-inset-bottom) / 2);
  654. }
  655. .tn-footerfixed {
  656. position: fixed;
  657. width: 100%;
  658. bottom: calc(env(safe-area-inset-bottom));
  659. z-index: 1024;
  660. box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
  661. background: #fff;
  662. }
  663. /* 底部悬浮按钮 end*/
  664. /* 标签内容 start*/
  665. .tn-tag-content {
  666. &__item {
  667. display: inline-block;
  668. line-height: 45rpx;
  669. padding: 10rpx 30rpx;
  670. margin: 20rpx 20rpx 5rpx 0rpx;
  671. &--prefix {
  672. padding-right: 10rpx;
  673. }
  674. }
  675. }
  676. /deep/ .uni-forms-item__label {
  677. display: none;
  678. }
  679. /deep/ .uni-stat__select .uni-select__input-placeholder {
  680. font-size: 14px;
  681. }
  682. /* 标签内容 end*/
  683. </style>