registerMerchant.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <template>
  2. <view class="content">
  3. <view class="content">
  4. <view class="inner">
  5. <view class="bg">
  6. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/74645f3b57bc45b08b35e2449fdf90c7.jpg"></image>
  7. <view class="title">商家入驻</view>
  8. </view>
  9. <view class="my-form" >
  10. <u-form :rules="rules" :model="form" ref="uForm" labelPosition="top" errorType="toast">
  11. <u-form-item required labelWidth="auto" label="企业LOGO" prop="logoUrl">
  12. <u-upload
  13. :fileList="fileList1"
  14. @afterRead="afterRead"
  15. @delete="deletePic"
  16. name="1"
  17. :maxCount="1"
  18. ></u-upload>
  19. </u-form-item>
  20. <u-form-item required labelWidth="auto" borderBottom label="企业简称" prop="storeName">
  21. <u-input border="none" placeholder="请输入企业简称" v-model="form.storeName" maxlength="60" />
  22. </u-form-item>
  23. <u-form-item required labelWidth="auto" borderBottom label="企业全称" prop="fullName">
  24. <u-input border="none" placeholder="请输入企业全称" v-model="form.fullName" maxlength="60" />
  25. </u-form-item>
  26. <u-form-item required labelWidth="auto" borderBottom label="电话号码;" prop="phone">
  27. <u-input border="none" placeholder="请输入电话号码;" v-model="form.phone" maxlength="20" />
  28. </u-form-item>
  29. <u-form-item required labelWidth="auto" borderBottom label="所在城市" prop="cityIds" @click="cityShow=true">
  30. <!-- <u-input border="none" placeholder="请输入所在城市" v-model="form.cityIds" /> -->
  31. <u-input
  32. v-model="form.address"
  33. disabled
  34. disabledColor="#ffffff"
  35. placeholder="请选择所在城市"
  36. border="none"
  37. ></u-input>
  38. <template #right>
  39. <u-icon
  40. name="arrow-right"
  41. ></u-icon>
  42. </template>
  43. </u-form-item>
  44. <u-form-item required labelWidth="auto" borderBottom label="企业地址" prop="enterpriseAddress">
  45. <u-input border="none" placeholder="请输入企业地址" v-model="form.enterpriseAddress" maxlength="100" />
  46. </u-form-item>
  47. <u-form-item required labelWidth="auto" borderBottom label="法人姓名" prop="legalPersonName">
  48. <u-input border="none" placeholder="请输入法人姓名" v-model="form.legalPersonName" maxlength="20" />
  49. </u-form-item>
  50. <u-form-item required labelWidth="auto" borderBottom label="统一社会信用代码" prop="unifiedSocialCreditCode">
  51. <u-input border="none" placeholder="请输入统一社会信用代码" v-model="form.unifiedSocialCreditCode" maxlength="60" />
  52. </u-form-item>
  53. <u-form-item required labelWidth="auto" borderBottom label="营业执照" prop="businessLicense">
  54. <u-upload
  55. :fileList="fileList2"
  56. @afterRead="afterRead"
  57. @delete="deletePic"
  58. name="2"
  59. :maxCount="1"
  60. ></u-upload>
  61. </u-form-item>
  62. <u-form-item required labelWidth="auto" borderBottom label="营业执照有效期" prop="businessLicenseExpireStart" @click="openCalendar(1)">
  63. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择营业执照有效期" v-model="businessLicenseExpire" />
  64. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  65. </u-form-item>
  66. <u-form-item required labelWidth="auto" borderBottom label="经营范围" prop="businessScope">
  67. <u-input border="none" placeholder="请输入经营范围" v-model="form.businessScope" maxlength="400" />
  68. </u-form-item>
  69. <u-form-item required labelWidth="auto" borderBottom label="药品经营许可证" prop="drugLicense">
  70. <u-upload
  71. :fileList="fileList3"
  72. @afterRead="afterRead"
  73. @delete="deletePic"
  74. name="3"
  75. :maxCount="1"
  76. ></u-upload>
  77. </u-form-item>
  78. <u-form-item required labelWidth="auto" borderBottom label="药品经营许可证编号有效期" prop="drugLicenseExpiryStart" @click="openCalendar(2)">
  79. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择药品经营许可证编号有效期" v-model="drugLicenseExpiry" />
  80. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  81. </u-form-item>
  82. <u-form-item required labelWidth="auto" borderBottom label="2类器械经营备案" prop="medicalDevice2">
  83. <u-upload
  84. :fileList="fileList4"
  85. @afterRead="afterRead"
  86. @delete="deletePic"
  87. name="4"
  88. :maxCount="1"
  89. ></u-upload>
  90. </u-form-item>
  91. <u-form-item required labelWidth="auto" borderBottom label="2类器械经营备案有效期" prop="medicalDevice2ExpiryStart" @click="openCalendar(3)">
  92. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择2类器械经营备案有效期" v-model="medicalDevice2Expiry" />
  93. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  94. </u-form-item>
  95. <u-form-item labelWidth="auto" borderBottom label="1类器械生产备案" prop="medicalDevice1">
  96. <u-upload
  97. :fileList="fileList5"
  98. @afterRead="afterRead"
  99. @delete="deletePic"
  100. name="5"
  101. :maxCount="1"
  102. ></u-upload>
  103. </u-form-item>
  104. <u-form-item labelWidth="auto" borderBottom label="1类器械生产备案有效期" prop="medicalDevice1ExpiryStart" @click="openCalendar(4)">
  105. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择1类器械生产备案有效期" v-model="medicalDevice1Expiry" />
  106. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  107. </u-form-item>
  108. <u-form-item labelWidth="auto" borderBottom label="3类器械经营许可证" prop="medicalDevice3">
  109. <u-upload
  110. :fileList="fileList6"
  111. @afterRead="afterRead"
  112. @delete="deletePic"
  113. name="6"
  114. :maxCount="1"
  115. ></u-upload>
  116. </u-form-item>
  117. <u-form-item labelWidth="auto" borderBottom label="3类器械经营许可证有效期" prop="medicalDevice3ExpiryStart" @click="openCalendar(5)">
  118. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择3类器械经营许可证有效期" v-model="medicalDevice3Expiry" />
  119. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  120. </u-form-item>
  121. <u-form-item labelWidth="auto" borderBottom label="食品经营许可证" prop="foodLicense">
  122. <u-upload
  123. :fileList="fileList7"
  124. @afterRead="afterRead"
  125. @delete="deletePic"
  126. name="7"
  127. :maxCount="1"
  128. ></u-upload>
  129. </u-form-item>
  130. <u-form-item labelWidth="auto" borderBottom label="食品经营许可证有效期" prop="foodLicenseExpiryStart" @click="openCalendar(6)">
  131. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择食品经营许可证有效期" v-model="foodLicenseExpiry" />
  132. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  133. </u-form-item>
  134. <u-form-item required labelWidth="auto" borderBottom label="医疗机构执业许可证" prop="medicalLicense">
  135. <u-upload
  136. :fileList="fileList8"
  137. @afterRead="afterRead"
  138. @delete="deletePic"
  139. name="8"
  140. :maxCount="1"
  141. ></u-upload>
  142. </u-form-item>
  143. <u-form-item required labelWidth="auto" borderBottom label="医疗机构执业许可证有效期" prop="medicalLicenseExpiryStart" @click="openCalendar(7)">
  144. <u-input disabled disabledColor="#ffffff" border="none" placeholder="请选择医疗机构执业许可证有效期" v-model="medicalLicenseExpiry" />
  145. <template #right> <u-icon name="arrow-right"></u-icon> </template>
  146. </u-form-item>
  147. <u-form-item required labelWidth="auto" borderBottom label="发货联系电话" prop="sendPhone">
  148. <u-input border="none" placeholder="请输入发货联系电话" v-model="form.sendPhone" maxlength="20" />
  149. </u-form-item>
  150. <u-form-item required labelWidth="auto" borderBottom label="佣金类型" prop="shippingType">
  151. <u-radio-group placement="row" v-model="form.shippingType" >
  152. <u-radio activeColor="#2583EB" :customStyle="{marginRight: '8px'}" key="1" label="配送" name="1" > </u-radio>
  153. <u-radio activeColor="#2583EB" :customStyle="{marginRight: '8px'}" key="2" label="到店自提" name="2" > </u-radio>
  154. <u-radio activeColor="#2583EB" :customStyle="{marginRight: '8px'}" key="3" label="配送、自提" name="3" > </u-radio>
  155. </u-radio-group>
  156. </u-form-item>
  157. <u-form-item required labelWidth="auto" borderBottom label="退货联系人" prop="refundConsignee">
  158. <u-input border="none" placeholder="请输入退货联系人" v-model="form.refundConsignee" maxlength="20" />
  159. </u-form-item>
  160. <u-form-item required labelWidth="auto" borderBottom label="退货联系电话" prop="refundPhone">
  161. <u-input border="none" placeholder="请输入退货联系电话" v-model="form.refundPhone" maxlength="20" />
  162. </u-form-item>
  163. <u-form-item required labelWidth="auto" borderBottom label="退货地址" prop="refundAddress">
  164. <u-input border="none" placeholder="请输入退货地址" v-model="form.refundAddress" maxlength="100" />
  165. </u-form-item>
  166. <u-form-item required labelWidth="auto" borderBottom label="佣金类型" prop="brokerageType">
  167. <u-radio-group placement="row" v-model="form.brokerageType" >
  168. <u-radio activeColor="#2583EB" :customStyle="{marginRight: '8px'}" key="1" label="每盒" name="1" > </u-radio>
  169. <u-radio activeColor="#2583EB" :customStyle="{marginRight: '8px'}" key="2" label="总价" name="2" > </u-radio>
  170. </u-radio-group>
  171. </u-form-item>
  172. <u-form-item required labelWidth="auto" borderBottom label="登录帐号" prop="account">
  173. <u-input border="none" placeholder="请输入登录帐号" v-model="form.account" maxlength="50" />
  174. </u-form-item>
  175. </u-form>
  176. </view>
  177. <u-picker ref="cityPicker" @cancel="cityShow = false" keyName="n" @confirm="citySelect" @change="cityChangeHandler" :show="cityShow" :columns="citys"></u-picker>
  178. <u-picker ref="deptPicker" @cancel="deptShow = false" keyName="deptName" @confirm="deptSelect" :show="deptShow" :columns="depts"></u-picker>
  179. <u-picker @cancel="hospitalShow = false" keyName="hospitalName" @confirm="hospitalSelect" :show="hospitalShow" :columns="hospitals"></u-picker>
  180. <u-picker ref="positionPicker" @cancel="positionShow = false" keyName="dictLabel" @confirm="positionSelect" :show="positionShow" :columns="positions"></u-picker>
  181. <uni-calendar ref="calendar" :range="true" :insert="false" @confirm="confirmCalendar" />
  182. </view>
  183. <view class="btn-box">
  184. <view class="sub-btn" @click="submit()">提交</view>
  185. </view>
  186. </view>
  187. </view>
  188. </template>
  189. <script>
  190. import {getDictByKey,getHospitalList,getDepartmentList,sendSmsCode,uploadOSS,getCitys} from '@/api/common.js'
  191. import {storeAdd} from './api/shopping.js'
  192. export default {
  193. data() {
  194. return {
  195. cityIndex1:0,
  196. cityIndex2:0,
  197. allCitys:[],
  198. citys:[[],[],[]],
  199. cityShow:false,
  200. depts:[[]],
  201. deptShow:false,
  202. hospitals:[[]],
  203. hospitalShow:false,
  204. positions:[[]],
  205. positionShow:false,
  206. fileList1:[],
  207. fileList2:[],
  208. fileList3:[],
  209. fileList4:[],
  210. fileList5:[],
  211. fileList6:[],
  212. fileList7:[],
  213. fileList8:[],
  214. checked:0,
  215. form:{
  216. storeName:'',
  217. fullName:'',
  218. phone:'',
  219. cityIds:'',
  220. enterpriseAddress:'',
  221. legalPersonName:'',
  222. unifiedSocialCreditCode:'',
  223. logoUrl:'',
  224. businessLicense:'',
  225. businessLicenseExpireStart:'',
  226. businessLicenseExpireEnd:'',
  227. drugLicense:'',
  228. drugLicenseExpiryStart:'',
  229. drugLicenseExpiryEnd:'',
  230. medicalDevice1:'',
  231. medicalDevice1ExpiryStart:'',
  232. medicalDevice1ExpiryEnd:'',
  233. medicalDevice2:'',
  234. medicalDevice2ExpiryStart:'',
  235. medicalDevice2ExpiryEnd:'',
  236. medicalDevice3:'',
  237. medicalDevice3ExpiryStart:'',
  238. medicalDevice3ExpiryEnd:'',
  239. foodLicense:'',
  240. foodLicenseExpiryStart:'',
  241. foodLicenseExpiryEnd:'',
  242. medicalLicense:'',
  243. medicalLicenseExpiryStart:'',
  244. medicalLicenseExpiryEnd:'',
  245. businessScope:'',
  246. address:'',
  247. refundPhone:'',
  248. refundAddress:'',
  249. refundConsignee:'',
  250. brokerageType: undefined,
  251. account:'',
  252. sendPhone:'',
  253. shippingType: undefined,
  254. },
  255. rules: {
  256. logoUrl: [{required: true, message: '请上传企业LOGO'}],
  257. storeName: [{required: true, message: '请输入企业简称'}],
  258. fullName: [{required: true, message: '请输入企业全称'}],
  259. phone: [{required: true, message: '请输入电话号码;'}],
  260. cityIds: [{required: true, message: '请选择所在城市;'}],
  261. enterpriseAddress: [{required: true, message: '请输入企业地址'}],
  262. legalPersonName: [{required: true, message: '请输入法人姓名'}],
  263. unifiedSocialCreditCode: [{required: true, message: '请输入统一社会信用代码'}],
  264. businessLicense: [{required: true, message: '请上传营业执照'}],
  265. businessLicenseExpireStart: [{required: true, message: '请选择营业执照有效期'}],
  266. drugLicense: [{required: true, message: '请上传药品经营许可证'}],
  267. drugLicenseExpiryStart: [{required: true, message: '请选择药品经营许可证编号有效期'}],
  268. medicalDevice2: [{required: true, message: '请上传2类医疗器械备案'}],
  269. medicalDevice2ExpiryStart: [{required: true, message: '请选择2类医疗器械备案有效期'}],
  270. medicalLicense: [{required: true, message: '请上传医疗机构执业许可证'}],
  271. medicalLicenseExpiryStart: [{required: true, message: '请选择医疗机构执业许可证有效期'}],
  272. refundPhone: [{required: true, message: '请输入经营范围'}],
  273. businessScope: [{required: true, message: '请输入退货联系电话'}],
  274. refundAddress: [{required: true, message: '请输入退货地址'}],
  275. refundConsignee: [{required: true, message: '请输入退货联系人'}],
  276. brokerageType: [{required: true, message: '请选择佣金类型'}],
  277. account: [{required: true, message: '请输入登录帐号'}],
  278. shippingType: [{required: true, message: '请选择配送方式'}],
  279. },
  280. calendarType: 0,
  281. businessLicenseExpire:'',
  282. drugLicenseExpiry:'',
  283. medicalDevice2Expiry:'',
  284. medicalDevice1Expiry:'',
  285. medicalDevice3Expiry:'',
  286. foodLicenseExpiry:'',
  287. medicalLicenseExpiry:''
  288. }
  289. },
  290. onLoad(options) {
  291. this.form.doctorType=options.type;
  292. this.getCitys()
  293. this.getHospitalList();
  294. this.getDepartmentList();
  295. this.getDictByKey("sys_doc_position");
  296. },
  297. onShow() {
  298. },
  299. onReady() {
  300. this.$refs.uForm.setRules(this.rules);
  301. },
  302. methods: {
  303. openCalendar(calendarType){
  304. this.calendarType=calendarType
  305. this.$refs.calendar.open();
  306. },
  307. confirmCalendar(e) {
  308. if(!e.range.before||!e.range.after) {
  309. uni.showToast({
  310. title: '请选择正确的时间范围',
  311. icon: 'none'
  312. })
  313. return
  314. }
  315. if(this.calendarType==1) {
  316. this.form.businessLicenseExpireStart = e.range.before;
  317. this.form.businessLicenseExpireEnd = e.range.after;
  318. this.businessLicenseExpire = this.form.businessLicenseExpireStart+'至'+this.form.businessLicenseExpireEnd
  319. }else if(this.calendarType==2) {
  320. this.form.drugLicenseExpiryStart = e.range.before;
  321. this.form.drugLicenseExpiryEnd = e.range.after;
  322. this.drugLicenseExpiry = this.form.drugLicenseExpiryStart+'至'+this.form.drugLicenseExpiryEnd
  323. }else if(this.calendarType==3) {
  324. this.form.medicalDevice2ExpiryStart = e.range.before;
  325. this.form.medicalDevice2ExpiryEnd = e.range.after;
  326. this.medicalDevice2Expiry = this.form.medicalDevice2ExpiryStart+'至'+this.form.medicalDevice2ExpiryEnd
  327. }else if(this.calendarType==4) {
  328. this.form.medicalDevice1ExpiryStart = e.range.before;
  329. this.form.medicalDevice1ExpiryEnd = e.range.after;
  330. this.medicalDevice1Expiry = this.form.medicalDevice1ExpiryStart+'至'+this.form.medicalDevice1ExpiryEnd
  331. }else if(this.calendarType==5) {
  332. this.form.medicalDevice3ExpiryStart = e.range.before;
  333. this.form.medicalDevice3ExpiryEnd = e.range.after;
  334. this.medicalDevice3Expiry = this.form.medicalDevice3ExpiryStart+'至'+this.form.medicalDevice3ExpiryEnd
  335. }else if(this.calendarType==6) {
  336. this.form.foodLicenseExpiryStart = e.range.before;
  337. this.form.foodLicenseExpiryEnd = e.range.after;
  338. this.foodLicenseExpiry = this.form.foodLicenseExpiryStart+'至'+this.form.foodLicenseExpiryEnd
  339. }else if(this.calendarType==7) {
  340. this.form.medicalLicenseExpiryStart = e.range.before;
  341. this.form.medicalLicenseExpiryEnd = e.range.after;
  342. this.medicalLicenseExpiry = this.form.medicalLicenseExpiryStart+'至'+this.form.medicalLicenseExpiryEnd
  343. }
  344. console.log(e);
  345. },
  346. hospitalSelect(e){
  347. this.form.hospitalId=this.hospitals[0][e.indexs[0]].hospitalId;
  348. this.form.hospitalName=this.hospitals[0][e.indexs[0]].hospitalName;
  349. this.hospitalShow=false;
  350. },
  351. deptSelect(e){
  352. console.log(e)
  353. this.form.deptId=this.depts[0][e.indexs[0]].deptId;
  354. this.form.deptName=this.depts[0][e.indexs[0]].deptName;
  355. this.deptShow=false;
  356. },
  357. positionSelect(e){
  358. console.log(e)
  359. this.form.position=this.positions[0][e.indexs[0]].dictLabel;
  360. this.positionShow=false;
  361. },
  362. getDictByKey(key){
  363. var data={key:key}
  364. getDictByKey(data).then(
  365. res => {
  366. if(res.code==200){
  367. this.positions[0]=res.data;
  368. }
  369. },
  370. err => {
  371. }
  372. );
  373. },
  374. openContent(type){
  375. uni.navigateTo({
  376. url:"agreement?type="+type
  377. })
  378. },
  379. cityChangeHandler(e) {
  380. const {
  381. columnIndex,
  382. index,
  383. // 微信小程序无法将picker实例传出来,只能通过ref操作
  384. picker = this.$refs.cityPicker
  385. } = e
  386. if(columnIndex==0){
  387. this.cityIndex1=index
  388. console.log(this.cityIndex1)
  389. //获取第二列数据
  390. var citys1 = this.allCitys[this.cityIndex1].c;
  391. console.log(citys1)
  392. picker.setColumnValues(1,citys1)
  393. this.cityIndex2=0
  394. var citys2 = this.allCitys[this.cityIndex1].c[this.cityIndex2].c;
  395. picker.setColumnValues(2,citys2)
  396. }
  397. if(columnIndex==1){
  398. this.cityIndex2=index
  399. //获取第三列数据
  400. var citys = this.allCitys[this.cityIndex1].c[this.cityIndex2].c;
  401. console.log(citys)
  402. picker.setColumnValues(2,citys)
  403. }
  404. },
  405. citySelect(e){
  406. console.log(e)
  407. this.form.address=e.value[0].n+""+e.value[1].n+""+e.value[2].n
  408. this.form.cityIds=e.value[0].v+","+e.value[1].v+","+e.value[2].v;
  409. this.cityShow=false;
  410. },
  411. getCitys(){
  412. var that=this;
  413. var data={}
  414. getCitys(data).then(
  415. res => {
  416. if(res.code==200){
  417. that.allCitys=res.data;
  418. that.citys=[[],[],[]];
  419. that.citys[0]=that.allCitys;
  420. that.citys[1]=that.allCitys[0].c;
  421. that.citys[2]=that.allCitys[0].c[0].c;
  422. console.log(that.citys)
  423. }
  424. },
  425. err => {
  426. }
  427. );
  428. },
  429. getHospitalList(){
  430. var that=this;
  431. var data={}
  432. getHospitalList(data).then(
  433. res => {
  434. if(res.code==200){
  435. that.hospitals[0]=res.data;
  436. console.log(111)
  437. console.log(that.hospitals)
  438. }
  439. },
  440. err => {
  441. }
  442. );
  443. },
  444. getDepartmentList(){
  445. var that=this;
  446. var data={}
  447. getDepartmentList(data).then(
  448. res => {
  449. if(res.code==200){
  450. that.depts[0]=res.data;
  451. }
  452. },
  453. err => {
  454. }
  455. );
  456. },
  457. deletePic(event) {
  458. this[`fileList${event.name}`].splice(event.index, 1)
  459. },
  460. async afterRead(event) {
  461. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  462. let lists = [].concat(event.file)
  463. let fileListLen = this[`fileList${event.name}`].length
  464. lists.map((item) => {
  465. this[`fileList${event.name}`].push({
  466. ...item,
  467. status: 'uploading',
  468. message: '上传中'
  469. })
  470. })
  471. for (let i = 0; i < lists.length; i++) {
  472. const result = await this.uploadFilePromise(lists[i].url)
  473. let item = this[`fileList${event.name}`][fileListLen]
  474. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  475. status: 'success',
  476. message: '',
  477. url: result
  478. }))
  479. fileListLen++
  480. }
  481. },
  482. uploadFilePromise(url) {
  483. return new Promise((resolve, reject) => {
  484. let a = uni.uploadFile({
  485. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS',
  486. filePath: url,
  487. name: 'file',
  488. formData: {
  489. user: 'test'
  490. },
  491. success: (res) => {
  492. setTimeout(() => {
  493. console.log(JSON.parse(res.data).url)
  494. resolve(JSON.parse(res.data).url)
  495. }, 1000)
  496. }
  497. });
  498. })
  499. },
  500. register(){
  501. storeAdd(this.form).then(
  502. res => {
  503. console.log(res)
  504. if(res.code==200){
  505. uni.showToast({
  506. icon:'none',
  507. title:res.msg,
  508. });
  509. setTimeout(function() {
  510. uni.navigateBack({
  511. delta: 1
  512. })
  513. }, 2000);
  514. }else{
  515. uni.showToast({
  516. icon:'none',
  517. title: res.msg,
  518. });
  519. }
  520. },
  521. rej => {
  522. console.log(rej)
  523. }
  524. );
  525. },
  526. submit(){
  527. var that=this;
  528. if(this.fileList1.length>0){
  529. this.form.logoUrl=this.fileList1[0].url
  530. }
  531. if(this.fileList2.length>0){
  532. this.form.businessLicense=this.fileList2[0].url
  533. }
  534. if(this.fileList3.length>0){
  535. this.form.drugLicense=this.fileList3[0].url
  536. }
  537. if(this.fileList4.length>0){
  538. this.form.medicalDevice2=this.fileList4[0].url
  539. }
  540. if(this.fileList5.length>0){
  541. this.form.medicalDevice1=this.fileList5[0].url
  542. }
  543. if(this.fileList6.length>0){
  544. this.form.medicalDevice3=this.fileList6[0].url
  545. }
  546. if(this.fileList7.length>0){
  547. this.form.foodLicense=this.fileList7[0].url
  548. }
  549. if(this.fileList8.length>0){
  550. this.form.medicalLicense=this.fileList8[0].url
  551. }
  552. console.log(this.form)
  553. this.$refs.uForm.validate().then(res => {
  554. if(res) {
  555. this.register()
  556. }
  557. })
  558. },
  559. }
  560. }
  561. </script>
  562. <style scoped lang="scss">
  563. .content{
  564. display: flex;
  565. flex-direction: column;
  566. justify-content: flex-start;
  567. .inner{
  568. padding: 20upx 20rpx 120rpx;
  569. .bg{
  570. width: 100%;
  571. height: 300rpx;
  572. position: relative;
  573. display: flex;
  574. flex-direction: column;
  575. justify-content: center;
  576. align-items: flex-start;
  577. image{
  578. position: absolute;
  579. border-radius: 30rpx 30rpx 0rpx 0rpx;
  580. width: 100%;
  581. height: 100%;
  582. }
  583. .title{
  584. z-index: 999;
  585. padding: 0rpx 30rpx;
  586. font-size: 40upx;
  587. font-family: PingFang SC;
  588. font-weight: bold;
  589. color: #FFFFFF;
  590. }
  591. .desc{
  592. z-index: 999;
  593. padding: 0rpx 30rpx;
  594. margin-top: 20rpx;
  595. font-size: 28upx;
  596. opacity: 0.5;
  597. font-family: PingFang SC;
  598. color: #FFFFFF;
  599. }
  600. }
  601. .my-form{
  602. z-index: 1;
  603. background-color: #FFFFFF;
  604. padding: 0 30upx;
  605. input{
  606. text-align: right;
  607. }
  608. }
  609. }
  610. .agree{
  611. padding: 10rpx 20rpx;
  612. display: flex;
  613. align-items: center;
  614. justify-content: flex-start;
  615. .label{
  616. font-size: 24rpx;
  617. }
  618. .text{
  619. margin-left: 10rpx;
  620. color: royalblue;
  621. font-size: 24rpx;
  622. }
  623. }
  624. .btn-box{
  625. z-index: 90;
  626. width: 100%;
  627. position: fixed;
  628. bottom: 0;
  629. height: 120upx;
  630. padding: 0 30upx;
  631. display: flex;
  632. align-items: center;
  633. justify-content: center;
  634. background: #FFFFFF;
  635. .sub-btn{
  636. width: 100%;
  637. height: 88upx;
  638. line-height: 88upx;
  639. text-align: center;
  640. font-size: 30upx;
  641. font-family: PingFang SC;
  642. font-weight: bold;
  643. color: #FFFFFF;
  644. background: #2583EB;
  645. border-radius: 44upx;
  646. }
  647. }
  648. }
  649. </style>