customerDetails.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. <template>
  2. <view :class="mask ? 'tl-show': ''">
  3. <!-- <u-navbar :title="title" :autoBack="true" :placeholder="true" leftIconColor="#fff"
  4. :titleStyle="{ color: '#ffffff' }" bgColor="#FD4B09">
  5. <template slot="right">
  6. <u-icon name="checkmark" color="#fff" @click="submit"></u-icon>
  7. </template>
  8. </u-navbar> -->
  9. <u-cell-group :border="false">
  10. <u-cell :border="false" center title="基础信息"></u-cell>
  11. </u-cell-group>
  12. <u--form labelPosition="left" :model="form" ref="form" labelWidth="150rpx"
  13. style="margin-top: 10rpx;margin-bottom: 150rpx;">
  14. <view style="width: calc(96%);margin: 0 auto;background-color: #fff;border-radius: 20rpx;">
  15. <view style="padding: 0 10rpx;">
  16. <u-form-item label="公司名称" prop="cname" borderBottom>
  17. <u-input v-model="form.cname" inputAlign="right" border="none" placeholder="请输入" />
  18. </u-form-item>
  19. <u-form-item label="联系人" prop="cname" borderBottom>
  20. <u-input v-model="form.attn" inputAlign="right" border="none" placeholder="请输入" />
  21. </u-form-item>
  22. <u-form-item label="联系电话" prop="cname" borderBottom>
  23. <u-input v-model="form.tel" inputAlign="right" border="none" placeholder="请输入" />
  24. </u-form-item>
  25. <u-form-item label="业务员" :borderBottom="false"
  26. @click="filterAll(['adminProfilesName','adminProfiles'])">
  27. <u-input border="none" inputAlign="right" suffixIcon="plus-circle" disabled
  28. v-model="form.adminProfilesName" disabledColor="#ffffff" />
  29. </u-form-item>
  30. <u-form-item label="送货地址" :borderBottom="false"
  31. @click="filterAll(['corpsAddrList','corpsAddrList'])">
  32. ({{form.corpsAddrList.length}})
  33. <u-input border="none" inputAlign="right" suffixIcon="plus-circle" disabled
  34. disabledColor="#ffffff" />
  35. </u-form-item>
  36. <u-cell-group :border="false">
  37. <u-swipe-action>
  38. <u-swipe-action-item :options="options" v-for="(item,index) in form.corpsAddrList"
  39. :key="index" @click="address(index)">
  40. <u-cell @click="change(item,index)" :iconStyle="{ color: '#fd4b09' }" :titleStyle="{
  41. width:'550rpx',
  42. overflow:'hidden',
  43. whiteSpace: 'nowrap',
  44. textOverflow: 'ellipsis',
  45. oTextOverflow:'ellipsis'
  46. }" :icon="item.type == 0?'map':'car'" :title="item.detailedAddress" :isLink="true"
  47. :borderBottom="form.corpsAddrList.length-1 == index?false:true">
  48. </u-cell>
  49. </u-swipe-action-item>
  50. </u-swipe-action>
  51. </u-cell-group>
  52. </view>
  53. </view>
  54. <u-cell-group :border="false">
  55. <u-cell :border="false" center title="类别信息" :arrow-direction="category==false?'up':'down'"
  56. :value="category==false?'展开':'收起'" :isLink="true" @click="category = !category"></u-cell>
  57. </u-cell-group>
  58. <view style="width: calc(96%);margin: 0 auto;background-color: #fff;border-radius: 20rpx;">
  59. <view style="padding: 0 10rpx;">
  60. <u-form-item label="客户类别" :borderBottom="category==false?false:true"
  61. @click="filterAll(['corpsTypeName','corpsTypeId'])">
  62. <u-input v-model="form.corpsTypeName" inputAlign="right" border="none" placeholder="请选择"
  63. disabled disabledColor="#ffffff">
  64. <template slot="suffix" style="text-align: center;">
  65. <u-icon name="plus-circle" size="18" @click.native.stop="newCategory()"></u-icon>
  66. </template>
  67. </u-input>
  68. </u-form-item>
  69. <view v-if="category">
  70. <u-form-item label="客户标签1" prop="mailbox" borderBottom labelWidth="180rpx">
  71. <u-input v-model="form.labels[0]" inputAlign="right" border="none" placeholder="请输入" />
  72. </u-form-item>
  73. <u-form-item label="客户标签2" prop="mailbox" labelWidth="180rpx" borderBottom>
  74. <u-input v-model="form.labels[1]" inputAlign="right" border="none" placeholder="请输入" />
  75. </u-form-item>
  76. <u-form-item label="客户标签3" prop="mailbox" labelWidth="180rpx" borderBottom>
  77. <u-input v-model="form.labels[2]" inputAlign="right" border="none" placeholder="请输入" />
  78. </u-form-item>
  79. <u-form-item label="客户标签4" prop="mailbox" labelWidth="180rpx" :borderBottom="false">
  80. <u-input v-model="form.labels[3]" inputAlign="right" border="none" placeholder="请输入" />
  81. </u-form-item>
  82. </view>
  83. </view>
  84. </view>
  85. <u-cell-group :border="false">
  86. <u-cell :border="false" center title="商务信息" :arrow-direction="customer==false?'up':'down'"
  87. :value="customer==false?'展开':'收起'" :isLink="true" @click="customer = !customer"></u-cell>
  88. </u-cell-group>
  89. <view style="width: calc(96%);margin: 0 auto;background-color: #fff;border-radius: 20rpx;" v-if="customer">
  90. <view style="padding: 0 10rpx;">
  91. <u-form-item label="客户经理" prop="mailbox" borderBottom>
  92. <u-input v-model="form.adminProfiles" inputAlign="right" border="none" placeholder="请输入" />
  93. </u-form-item>
  94. <u-form-item label="预付款" prop="mailbox" borderBottom>
  95. <u-input v-model="form.creditGrant" inputAlign="right" border="none" placeholder="请输入" />
  96. </u-form-item>
  97. <u-form-item label="欠款额度" prop="mailbox" borderBottom>
  98. <u-input v-model="form.arrears" inputAlign="right" border="none" placeholder="请输入" />
  99. </u-form-item>
  100. <u-form-item label="银行帐号" prop="mailbox" borderBottom>
  101. <u-input v-model="form.accountNo" inputAlign="right" border="none" placeholder="请输入" />
  102. </u-form-item>
  103. <u-form-item label="开户银行" prop="mailbox" :borderBottom="false">
  104. <u-input v-model="form.accountBank" inputAlign="right" border="none" placeholder="请输入" />
  105. </u-form-item>
  106. </view>
  107. </view>
  108. <u-cell-group :border="false">
  109. <u-cell :border="false" center title="图片信息" :arrow-direction="enclosure==false?'up':'down'"
  110. :value="enclosure==false?'展开':'收起'" :isLink="true" @click="enclosure = !enclosure"></u-cell>
  111. </u-cell-group>
  112. <view style="width: calc(96%);margin: 0 auto;background-color: #fff;border-radius: 20rpx;" v-if="enclosure">
  113. <view style="padding: 10rpx 10rpx;">
  114. <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
  115. :maxCount="10"></u-upload>
  116. </view>
  117. </view>
  118. </u--form>
  119. <view style="width: 100%;position: fixed;bottom: 0;background-color: #fff;">
  120. <view style="width: 96%;;margin: 20rpx auto;">
  121. <u-button @click="submit" type="success" color="#fd4b09" shape="circle" text="确认提交"></u-button>
  122. </view>
  123. </view>
  124. <u-popup :show="show" @close="show = false,mask = false,formTwo = {}" closeable :closeOnClickOverlay="false"
  125. zIndex="10070">
  126. <view style="width: 96%;margin: auto auto;margin-top: 20rpx;padding-bottom: 20rpx;">
  127. <text>添加地址</text>
  128. <!-- <u-divider style="margin-bottom: 10rpx;"></u-divider>
  129. <view style="display: flex;justify-content: space-around;" :key="addrType">
  130. <view style="padding-bottom: 10rpx;" :class="addrType == 0?'selectedAddress':''"
  131. @click="selected(0)">客户地址</view>
  132. <view style="padding-bottom: 10rpx;" :class="addrType == 1?'selectedAddress':''"
  133. @click="selected(1)">物流地址</view>
  134. </view>
  135. <u-divider style="margin-top: 0rpx;"></u-divider> -->
  136. <u--form labelPosition="left" :model="formTwo" labelWidth="150rpx">
  137. <!-- <u-form-item label="省市区" borderBottom @click="filterAll(['addr','addr'])">
  138. <u-input v-model="formTwo.addr" border="none" placeholder="请选择" suffixIcon="arrow-right"
  139. disabled disabledColor="#ffffff" />
  140. </u-form-item> -->
  141. <u-form-item label="详细地址" borderBottom>
  142. <u-input v-model="formTwo.detailedAddress" border="none" placeholder="请输入">
  143. <template slot="suffix">
  144. <u-button @tap="getMap" type="success" size="mini" icon="map" color="#fd4b09"></u-button>
  145. </template>
  146. </u-input>
  147. </u-form-item>
  148. </u--form>
  149. <view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
  150. <!-- <view style="width: 45%;">
  151. <u-button text="全部清空" type="warning" @click="confirmEmptying"></u-button>
  152. </view> -->
  153. <view style="width: 96%;margin: 0 auto;background-color: red;">
  154. <u-button text="保存" type="primary" @click="confirmSearch" color="#fd4b09"></u-button>
  155. </view>
  156. </view>
  157. </view>
  158. </u-popup>
  159. <u-picker :show="dropDown" ref="uPicker" :defaultIndex="[0,0,0]" :columns="columns" :keyName="keyName"
  160. @cancel="dropDown = false,mask = false" @confirm="confirm" @change="changeHandler">
  161. </u-picker>
  162. </view>
  163. </template>
  164. <script>
  165. import {
  166. urbanAreas,
  167. customerType,
  168. saveChanges,
  169. queryDetail,
  170. removeAddr,
  171. removeFile,
  172. gainUser
  173. } from "@/api/views/customer/index.js"
  174. import http from '@/http/api.js'
  175. import {
  176. clientId,
  177. clientSecret
  178. } from '@/common/setting'
  179. export default {
  180. data() {
  181. return {
  182. form: {
  183. labels: ["", "", "", ""],
  184. corpsAddrList: []
  185. },
  186. customer: false,
  187. enclosure: false,
  188. category: false,
  189. title: "创建客户",
  190. options: [{
  191. text: '删除',
  192. style: {
  193. backgroundColor: '#fc0107',
  194. }
  195. }],
  196. formTwo: {},
  197. mask: false,
  198. show: false,
  199. dropDown: false,
  200. columns: [],
  201. keyName: "",
  202. addrType: 0,
  203. fileList1: [],
  204. screen: [],
  205. type: false,
  206. iNdex: 0
  207. }
  208. },
  209. onLoad(data) {
  210. if (data.id) {
  211. uni.setNavigationBarTitle({
  212. title: '客户详情'
  213. })
  214. this.title = "客户详情"
  215. this.query(data.id)
  216. } else {
  217. uni.setNavigationBarTitle({
  218. title: '创建客户'
  219. })
  220. this.title = "创建客户"
  221. }
  222. },
  223. methods: {
  224. newCategory(){
  225. uni.$u.route('/pages/views/product/customerType',{
  226. corpType:'KH'
  227. });
  228. },
  229. getMap() {
  230. let this_ = this
  231. uni.chooseLocation({
  232. success: function(res) {
  233. this_.$set(this_.formTwo, "dimension", res.latitude)
  234. this_.$set(this_.formTwo, "longitude", res.longitude)
  235. this_.$set(this_.formTwo, "detailedAddress", res.address)
  236. }
  237. });
  238. },
  239. change(item, index) {
  240. this.show = true
  241. this.mask = true
  242. this.formTwo = item
  243. this.iNdex = index
  244. this.type = true
  245. this.addrType = item.type
  246. // let this_ = this
  247. // uni.chooseLocation({
  248. // success: function (res) {
  249. // this_.$set(this_.form.corpsAddrList[index],"dimension",res.latitude)
  250. // this_.$set(this_.form.corpsAddrList[index],"longitude",res.longitude)
  251. // this_.$set(this_.form.corpsAddrList[index],"detailedAddress",res.address)
  252. // }
  253. // });
  254. },
  255. query(id) {
  256. uni.showLoading({
  257. title: '加载中',
  258. mask: true
  259. });
  260. queryDetail({
  261. id: id
  262. }).then(res => {
  263. this.form = res.data
  264. this.fileList1 = res.data.corpsFiles
  265. this.form.labels = res.data.labels ? res.data.labels.split(',') : []
  266. if (this.form.labels.length < 4) {
  267. for (let item in 4) {
  268. this.form.labels.push("")
  269. }
  270. }
  271. uni.hideLoading();
  272. })
  273. },
  274. //提交
  275. submit() {
  276. if (!this.form.cname) {
  277. return uni.showToast({
  278. title: '客户名称不能为空',
  279. icon: 'none',
  280. mask: true
  281. });
  282. }
  283. if (!this.form.attn) {
  284. return uni.showToast({
  285. title: '联系人不能为空',
  286. icon: 'none',
  287. mask: true
  288. });
  289. }
  290. if (!this.form.tel) {
  291. return uni.showToast({
  292. title: '电话不能为空',
  293. icon: 'none',
  294. mask: true
  295. });
  296. }
  297. if (this.form.corpsAddrList.length == 0) {
  298. return uni.showToast({
  299. title: '送货地址不能为空',
  300. icon: 'none',
  301. mask: true
  302. });
  303. }
  304. if (!this.form.corpsTypeId) {
  305. return uni.showToast({
  306. title: '客户类别不能为空',
  307. icon: 'none',
  308. mask: true
  309. });
  310. }
  311. let data = {
  312. ...this.form,
  313. code: this.form.cname,
  314. corpsFiles: this.fileList1
  315. }
  316. data.corpsFiles.forEach(item => delete item.status)
  317. let this_ = this
  318. uni.showModal({
  319. title: '提示',
  320. content: '是否确认保存',
  321. success: function(rest) {
  322. if (rest.confirm == true) {
  323. uni.showLoading({
  324. title: '加载中',
  325. mask: true
  326. });
  327. let labels = []
  328. for (let item of data.labels) {
  329. if (item) {
  330. labels.push(item)
  331. }
  332. }
  333. saveChanges({
  334. ...data,
  335. corpType: "KH",
  336. labels: labels.join(',')
  337. }).then(res => {
  338. uni.showToast({
  339. icon: "none",
  340. title: '保存成功',
  341. mask: true
  342. });
  343. setTimeout(function() {
  344. this_.query(res.data.id)
  345. }, 1000);
  346. uni.hideLoading();
  347. })
  348. }
  349. }
  350. })
  351. },
  352. //集合筛选条件
  353. filterAll(screen) {
  354. this.screen = screen
  355. switch (screen[1]) {
  356. case "corpsAddrList":
  357. this.show = true
  358. this.mask = true
  359. break;
  360. case "corpsTypeId":
  361. this.mask = true
  362. customerType({
  363. corpType: 'KH',
  364. parentId: 0
  365. }).then(res => {
  366. this.columns = [res.data]
  367. if (res.data.length > 0) {
  368. if (res.data[0].hasChildren == true) {
  369. customerType({
  370. corpType: 'KH',
  371. parentId: res.data[0].id
  372. }).then(rest => {
  373. this.columns.push(rest.data)
  374. this.dropDown = true
  375. this.keyName = "title"
  376. })
  377. } else {
  378. this.dropDown = true
  379. this.keyName = "title"
  380. }
  381. }
  382. })
  383. break;
  384. case "addr":
  385. uni.showLoading({
  386. title: '加载中',
  387. mask: true
  388. });
  389. urbanAreas({
  390. parentCode: "00"
  391. }).then(res => {
  392. this.columns = [res.data]
  393. urbanAreas({
  394. parentCode: res.data[0].id
  395. }).then(rest => {
  396. this.columns.push(rest.data)
  397. urbanAreas({
  398. parentCode: rest.data[0].id
  399. }).then(resth => {
  400. this.columns.push(resth.data)
  401. this.dropDown = true
  402. this.keyName = "name"
  403. uni.hideLoading();
  404. })
  405. })
  406. })
  407. this.show = true
  408. this.mask = true
  409. break;
  410. case "adminProfiles":
  411. uni.showLoading({
  412. title: '加载中',
  413. mask: true
  414. });
  415. gainUser().then(res => {
  416. this.columns = [res.data]
  417. this.dropDown = true
  418. this.keyName = "name"
  419. this.mask = true
  420. uni.hideLoading();
  421. })
  422. break;
  423. }
  424. },
  425. changeHandler(e) {
  426. const {
  427. columnIndex,
  428. index,
  429. // 微信小程序无法将picker实例传出来,只能通过ref操作
  430. picker = this.$refs.uPicker
  431. } = e
  432. if (this.screen[1] == "corpsTypeId") {
  433. if(e.value[e.columnIndex].hasChildren){
  434. if (e.columnIndex == 0) {
  435. uni.showLoading({
  436. title: '加载中',
  437. mask: true
  438. });
  439. customerType({
  440. parentId: e.value[e.columnIndex].id
  441. }).then(res => {
  442. picker.setColumnValues(1, res.data)
  443. if (res.data[0].hasChildren == true) {
  444. customerType({
  445. parentId: res.data[0].id
  446. }).then(rest => {
  447. picker.setColumnValues(2, rest.data)
  448. uni.hideLoading();
  449. })
  450. } else {
  451. uni.hideLoading();
  452. }
  453. })
  454. }
  455. if (e.columnIndex == 1) {
  456. uni.showLoading({
  457. title: '加载中',
  458. mask: true
  459. });
  460. customerType({
  461. parentId: e.value[e.columnIndex].id
  462. }).then(res => {
  463. picker.setColumnValues(2, res.data)
  464. uni.hideLoading();
  465. })
  466. }
  467. }else{
  468. if(e.columnIndex == 0){
  469. if(this.columns.length > 1){
  470. if(!e.value[e.columnIndex].hasChildren){
  471. let data = this.columns[0]
  472. this.columns = [data]
  473. }
  474. }
  475. }
  476. }
  477. }
  478. if (this.screen[1] == "addr") {
  479. if (e.columnIndex == 0) {
  480. uni.showLoading({
  481. title: '加载中',
  482. mask: true
  483. });
  484. urbanAreas({
  485. parentCode: e.value[e.columnIndex].id
  486. }).then(rest => {
  487. picker.setColumnValues(1, rest.data)
  488. urbanAreas({
  489. parentCode: rest.data[0].id
  490. }).then(resth => {
  491. picker.setColumnValues(2, resth.data)
  492. uni.hideLoading();
  493. })
  494. })
  495. }
  496. if (e.columnIndex == 1) {
  497. uni.showLoading({
  498. title: '加载中',
  499. mask: true
  500. });
  501. urbanAreas({
  502. parentCode: e.value[e.columnIndex].id
  503. }).then(rest => {
  504. picker.setColumnValues(2, rest.data)
  505. uni.hideLoading();
  506. })
  507. }
  508. }
  509. },
  510. // 确认选中
  511. confirm(e) {
  512. if (this.screen[1] == "addr") {
  513. this.formTwo.addr = e.value[0].name + e.value[1].name + e.value[2].name
  514. } else if (this.screen[1] == "corpsTypeId") {
  515. this.form[this.screen[0]] = e.value[e.values.length-1].title
  516. this.form[this.screen[1]] = e.value[e.values.length-1].id
  517. } else if(this.screen[1] == "adminProfiles") {
  518. this.form[this.screen[0]] = e.value[0].name
  519. this.form[this.screen[1]] = e.value[0].id
  520. } else {
  521. this.formTwo[this.screen[0]] = e.value[0].cname
  522. this.formTwo[this.screen[1]] = e.value[0].id
  523. }
  524. this.dropDown = false
  525. this.mask = false
  526. this.columns = []
  527. },
  528. //删除地址
  529. address(index) {
  530. let this_ = this
  531. uni.showModal({
  532. title: '提示',
  533. content: '是否确认删除',
  534. success: function(rest) {
  535. if (rest.confirm == true) {
  536. if (this_.form.corpsAddrList[index].id) {
  537. uni.showLoading({
  538. title: '加载中',
  539. mask: true
  540. });
  541. removeAddr({
  542. ids: this_.form.corpsAddrList[index].id
  543. }).then(res => {
  544. this_.form.corpsAddrList.splice(index, 1);
  545. uni.hideLoading();
  546. })
  547. } else {
  548. this_.form.corpsAddrList.splice(index, 1);
  549. }
  550. }
  551. }
  552. })
  553. },
  554. //切换地址信息
  555. selected(type) {
  556. // this.addrType = type
  557. this.$set(this, 'addrType', type)
  558. this.formTwo = {}
  559. },
  560. //保存地址
  561. confirmSearch() {
  562. if (!this.formTwo.detailedAddress) {
  563. return uni.showToast({
  564. title: '请输入详细地址',
  565. icon: 'none',
  566. mask: true
  567. });
  568. }
  569. if (this.type) {
  570. this.form.corpsAddrList[this.iNdex] = {
  571. ...this.formTwo,
  572. type: this.addrType
  573. }
  574. this.type = false
  575. } else {
  576. this.form.corpsAddrList.push({
  577. ...this.formTwo,
  578. type: this.addrType
  579. })
  580. }
  581. this.formTwo = {}
  582. this.addrType = 0
  583. this.show = false
  584. this.mask = false
  585. },
  586. // 删除图片
  587. deletePic(event) {
  588. let this_ = this
  589. uni.showModal({
  590. title: '提示',
  591. content: '是否确认删除',
  592. success: function(rest) {
  593. if (rest.confirm == true) {
  594. if (this_[`fileList${event.name}`][event.index].id) {
  595. removeFile({
  596. ids: this_[`fileList${event.name}`][event.index].id
  597. }).then(res => {
  598. this_[`fileList${event.name}`].splice(event.index, 1)
  599. })
  600. } else {
  601. this_[`fileList${event.name}`].splice(event.index, 1)
  602. }
  603. }
  604. }
  605. })
  606. },
  607. // 新增图片
  608. async afterRead(event) {
  609. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  610. let lists = [].concat(event.file)
  611. let fileListLen = this[`fileList${event.name}`].length
  612. lists.map((item) => {
  613. this[`fileList${event.name}`].push({
  614. ...item,
  615. status: 'uploading',
  616. message: '上传中'
  617. })
  618. })
  619. for (let i = 0; i < lists.length; i++) {
  620. const result = await this.uploadFilePromise(lists[i].url)
  621. let item = this[`fileList${event.name}`][fileListLen]
  622. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  623. status: 'success',
  624. sort: this.fileList1.length,
  625. fileName: JSON.parse(result).data.originalName,
  626. url: JSON.parse(result).data.link
  627. }))
  628. fileListLen++
  629. }
  630. },
  631. uploadFilePromise(url) {
  632. return new Promise((resolve, reject) => {
  633. let a = uni.uploadFile({
  634. url: http.config.baseURL +
  635. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  636. filePath: url,
  637. name: 'file',
  638. formData: {
  639. user: 'test'
  640. },
  641. header: {
  642. // 客户端认证参数
  643. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' + clientSecret),
  644. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  645. },
  646. success: (res) => {
  647. setTimeout(() => {
  648. resolve(res.data)
  649. }, 1000)
  650. }
  651. });
  652. })
  653. },
  654. }
  655. }
  656. </script>
  657. <style lang="scss" scoped>
  658. .tl-show {
  659. overflow: hidden;
  660. position: fixed;
  661. height: 100%;
  662. width: 100%;
  663. }
  664. ::v-deep .u-cell__body {
  665. padding: 0rpx 25rpx;
  666. margin: 10rpx 0;
  667. }
  668. ::v-deep .u-cell__title-text {
  669. color: #244e96;
  670. }
  671. ::v-deep .u-form-item__body__left__content__label {
  672. color: #fd4b09;
  673. }
  674. .selectedAddress {
  675. border-bottom: 1rpx solid #fd4b09;
  676. color: #fd4b09;
  677. }
  678. </style>