Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

mailing_information.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <template>
  2. <!-- <navBar title="补办ETC卡"></navBar>
  3. -->
  4. <view class="oderPage">
  5. <view class="addr-box">
  6. <view class="addr-box-left">
  7. <view class="text-image">{{form.customerName.charAt(0)}} </view>
  8. <view class="content">
  9. <view class="">
  10. <text class="item1">{{form.customerName}}</text>
  11. <text class="item2">{{form.customerTel}}</text>
  12. <text class="item3" v-if="form.defaultAddress ==1">默认</text>
  13. </view>
  14. <view class=""> {{form.area +form.address}}</view>
  15. </view>
  16. </view>
  17. <view class="edit" @click="address.show = true">
  18. <image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
  19. </view>
  20. </view>
  21. <u-form ref="myForm">
  22. <view class="from">
  23. <u-form-item prop="cardState">
  24. <view class="from_item">
  25. <text><text style="color: red">*</text>是否寄回设备:</text>
  26. <!-- <u-radio-group v-model="form.sendStatusName">
  27. <u-radio :customStyle="{ marginBottom: '8px' }" activeColor="#2CE242"
  28. v-for="(item, index) in radiolist1" :key="index" :label="item.disabled"
  29. :name="item.name">
  30. {{ item.name }}
  31. </u-radio>
  32. </u-radio-group> -->
  33. <radio-group @change="sendChange" class="radios">
  34. <block v-for="(item, index) in radiolist1" :key="item.val">
  35. <view class="radio-box">
  36. <radio :value="item.val" :checked="form.sendStatus == item.val" color="#13e7c1"
  37. style="transform:scale(0.75)" />
  38. <view>{{item.name}}</view>
  39. </view>
  40. </block>
  41. </radio-group>
  42. </view>
  43. </u-form-item>
  44. <!-- <u-form-item prop="logistics" v-if="form.sendStatusName == '寄回'"> -->
  45. <view class="from_item" v-if="form.sendStatusName == '寄回'" @click="showPicker">
  46. <text style="font-size: 28rpx;"><text style="color: red">*</text>退货物流公司:</text>
  47. <view style="display: flex;align-items: center;font-size: 28rpx;" >
  48. <u-input v-model="form.courierCompany" class="input" style="visibility: hidden;" placeholder="请选择" />
  49. <text v-if="form.courierCompany">{{form.courierCompany}}</text>
  50. <u-icon name="arrow-right" style="margin-left: 10px"></u-icon>
  51. </view>
  52. </view>
  53. <!-- </u-form-item> -->
  54. <u-form-item prop="returnNum" v-if="form.sendStatusName == '寄回'">
  55. <view class="from_item">
  56. <text><text style="color: red"></text>退货单号:</text>
  57. <u-input v-model="form.courierOrderId" class="input" />
  58. </view>
  59. </u-form-item>
  60. <u-form-item prop="cardState">
  61. <view class="from_item">
  62. <text><text style="color: red">*</text>收货方式:</text>
  63. <!-- <u-radio-group v-model="form.receiveMethodName">
  64. <u-radio :customStyle="{ marginBottom: '8px' }" activeColor="#2CE242"
  65. v-for="(item, index) in radiolist2" :key="index" :label="item.disabled"
  66. :name="item.name">
  67. {{ item.name }}
  68. </u-radio>
  69. </u-radio-group> -->
  70. <radio-group @change="receiveChange" class="radios">
  71. <block v-for="(item, index) in radiolist2" :key="item.val">
  72. <view class="radio-box">
  73. <radio :value="item.val" :checked="form.receiveMethod == item.val" color="#13e7c1"
  74. style="transform:scale(0.75)" />
  75. <view>{{item.name}}</view>
  76. </view>
  77. </block>
  78. </radio-group>
  79. </view>
  80. </u-form-item>
  81. </view>
  82. </u-form>
  83. <!-- 物流弹窗 -->
  84. <view>
  85. <!-- 物流 -->
  86. <u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
  87. </view>
  88. <button class="submit" @click="submit">下一步</button>
  89. </view>
  90. <!-- 地址弹窗 -->
  91. <u-popup mode="bottom" v-model="address.show">
  92. <view class="address-line">
  93. <view v-if="address.list" v-for="(item, index) in address.list" :key="index" @click="addressSelected(item)"
  94. style="margin-bottom: 40rpx" class="flex-bettwen">
  95. <view class="flex">
  96. <view class="xing">
  97. {{ item.consignee.charAt(0) }}
  98. </view>
  99. <view class="content">
  100. <view class="flex">
  101. <view class="name">
  102. {{ item.consignee }}
  103. </view>
  104. <view class="phone">
  105. {{ item.consigneeTel }}
  106. </view>
  107. </view>
  108. <view class="address">
  109. {{ item.region + item.address }}
  110. </view>
  111. </view>
  112. </view>
  113. <view @click.stop="editAddress(item)" style="margin-left: 80rpx" class="picture">
  114. <image :showLoading="true" :src="`${$imgUrl}applyCard/edit.png`"
  115. style="width: 48rpx; height: 48rpx"></image>
  116. </view>
  117. </view>
  118. <view :style="address.list ? 'margin-top: 60rpx;' : ''" class="action-bottom">
  119. <button type="default" class="button" @click="goToAddAddress()">
  120. 添加收货地址
  121. </button>
  122. </view>
  123. </view>
  124. </u-popup>
  125. </template>
  126. <script setup lang="ts">
  127. // import navBar from "../ETCcancellation/components/nav-bar.vue";
  128. import {
  129. reactive,
  130. ref
  131. } from "vue";
  132. import {
  133. onLoad,
  134. onShow,
  135. onReady
  136. } from "@dcloudio/uni-app";
  137. import {
  138. navTo,
  139. checkStr
  140. } from "@/utils/utils";
  141. import {
  142. request
  143. } from "@/utils/network/request.js";
  144. import {
  145. getLogistics,
  146. addressQuery,
  147. cckChangejzCardInfo
  148. } from "@/utils/network/api.js";
  149. import {
  150. stringToJson
  151. } from "@/utils/network/encryption.js";
  152. import {
  153. getItem,
  154. StorageKeys
  155. } from "@/utils/storage";
  156. import {
  157. wechatPayConfigId,
  158. } from "@/utils/network/api";
  159. const list = reactive([]); //物流数据
  160. const address = reactive({
  161. list: [],
  162. show: false
  163. }); //地址list
  164. const form = reactive({
  165. customerName: '',
  166. customerTel: '',
  167. address: '',
  168. area: '',
  169. sendStatusName: '寄回',
  170. sendStatus: '1', //0 --- 不邮寄 1 --- 邮寄
  171. courierCompany: '',
  172. courierOrderId: '',
  173. receiveMethod: '1',
  174. postCode: '',
  175. receiveMethodName: '邮寄',//0 --- 不邮寄 1 --- 邮寄
  176. defaultAddress: 2
  177. });
  178. //入参
  179. const params = reactive({
  180. /* cardId: '',
  181. obuId: '', */
  182. orderId: '',
  183. applyId: '',
  184. });
  185. // 单选数据列表
  186. const radiolist1 = reactive([{
  187. name: "寄回",
  188. val: "1",
  189. },
  190. {
  191. name: "不寄回",
  192. val: "0",
  193. },
  194. ]);
  195. const radiolist2 = reactive([{
  196. name: "邮寄",
  197. val: "1",
  198. },
  199. {
  200. name: "不邮寄",
  201. val: "0",
  202. },
  203. ]);
  204. let show = ref(false);
  205. const goToAddAddress = () => {
  206. uni.navigateTo({
  207. url: "/subpackage/orders/addAddress",
  208. });
  209. };
  210. const editAddress = (val) => {
  211. uni.navigateTo({
  212. url: `/subpackage/orders/editAddress?content=` + JSON.stringify(val),
  213. });
  214. };
  215. const addressSelected = (val : any) => {
  216. console.log(val);
  217. // state.data = {
  218. // ...state.data,
  219. // ...val,
  220. // };
  221. // state.show = false;
  222. form.customerName = val.consignee
  223. form.customerTel = val.consigneeTel
  224. form.address = val.address
  225. form.area = val.region
  226. form.postCode = val.postalCode
  227. form.defaultAddress = val.defaultAddress
  228. address.show = false
  229. };
  230. // 寄回单选
  231. const sendChange = (e : any) => {
  232. console.log(e);
  233. form.sendStatus = e.detail.value
  234. };
  235. // 邮寄单选
  236. const receiveChange = (e : any) => {
  237. console.log(e);
  238. form.receiveMethod = e.detail.value
  239. };
  240. // 打开物流先择器
  241. const showPicker = function () {
  242. show.value = true;
  243. };
  244. const confirm = (e) => {
  245. form.courierCompany = e[0].value;
  246. console.log(e[0].value);
  247. };
  248. onLoad((option) => {
  249. params.orderId = option.orderId
  250. params.applyId = option.applyId
  251. getexpresslist();
  252. });
  253. onShow(() => {
  254. getAddressList();
  255. })
  256. const getexpresslist = () => {
  257. //参数说明
  258. let options = {
  259. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  260. data: {
  261. // opId: getItem("openId"),
  262. // source: "WECHAT",
  263. // tabIndex: "0",
  264. }, //请求参数
  265. method: "POST", //提交方式(默认POST)
  266. showLoading: true, //是否显示加载中(默认显示)
  267. };
  268. //调用方式
  269. request(getLogistics, options)
  270. .then((res) => {
  271. // stringToJson(res.bizContent)
  272. stringToJson(res.bizContent).forEach((item) => {
  273. list.push({
  274. value: item,
  275. label: item,
  276. });
  277. });
  278. })
  279. .catch((err) => {
  280. console.log(err);
  281. });
  282. };
  283. const getAddressList = () => {
  284. var data = {
  285. openId: getItem(StorageKeys.OpenId),
  286. };
  287. const options = {
  288. type: 2,
  289. data: data,
  290. method: "POST",
  291. showLoading: true,
  292. };
  293. request(addressQuery, options).then((res) => {
  294. const data = stringToJson(res.bizContent);
  295. address.list = data.data;
  296. if (address.list.length > 0) {
  297. var defaultAddress = address.list[0]
  298. form.customerName = defaultAddress.consignee
  299. form.customerTel = defaultAddress.consigneeTel
  300. form.address = defaultAddress.address
  301. form.area = defaultAddress.region
  302. form.postCode = defaultAddress.postalCode
  303. form.defaultAddress = defaultAddress.defaultAddress
  304. }
  305. });
  306. };
  307. const submit = () => {
  308. // if (form.sendStatusName === '寄回') {
  309. // form.sendStatus = '1'
  310. // } else {
  311. // form.sendStatus = '0'
  312. // }
  313. // if (form.receiveMethodName === '邮寄') {
  314. // form.receiveMethod = '1'
  315. // } else {
  316. // form.receiveMethod = '0'
  317. // }
  318. queryCckChangejzCardInfo().then(val => {
  319. console.log(val)
  320. navTo(
  321. `/subpackage/after-sale/to-bookkeeping-card/result`
  322. )
  323. })
  324. };
  325. const queryCckChangejzCardInfo = () => {
  326. var data = {
  327. applyId: params.applyId,
  328. orderId: params.orderId,
  329. sendStatus: form.sendStatus,
  330. configId: wechatPayConfigId,
  331. courierCompany: form.courierCompany,
  332. courierOrderId: form.courierOrderId,
  333. receiveMethod: form.receiveMethod,
  334. customerName: form.customerName,
  335. customerTel: form.customerTel,
  336. address: form.address,
  337. area: form.area,
  338. postCode: form.postCode
  339. };
  340. const options = {
  341. type: 2,
  342. data: data,
  343. method: "POST",
  344. showLoading: true,
  345. };
  346. return new Promise(async (resolve, reject) => {
  347. const res = await request(cckChangejzCardInfo, options);
  348. const data = stringToJson(res.bizContent);
  349. resolve(data);
  350. }).catch((error) => {
  351. reject(error);
  352. });
  353. }
  354. </script>
  355. <style>
  356. page {
  357. width: 100%;
  358. height: 100%;
  359. display: flex;
  360. flex-direction: column;
  361. background-color: #f3f3f3;
  362. }
  363. </style>
  364. <style lang="scss" scoped>
  365. .radios {
  366. display: flex;
  367. }
  368. .radio-box {
  369. display: flex;
  370. align-items: center;
  371. padding-left: 20rpx;
  372. }
  373. .oderPage {
  374. flex: 1;
  375. width: 100%;
  376. .addr-box {
  377. margin-top: 20rpx;
  378. display: flex;
  379. background: #fff;
  380. padding: 30rpx;
  381. justify-content: space-between;
  382. align-items: center;
  383. .addr-box-left {
  384. display: flex;
  385. .text-image {
  386. width: 68rpx;
  387. height: 68rpx;
  388. background: #00b38b;
  389. border-radius: 50%;
  390. text-align: center;
  391. font-size: 26rpx;
  392. font-family: Microsoft YaHei;
  393. font-weight: 400;
  394. color: #ffffff;
  395. line-height: 68rpx;
  396. margin-right: 30rpx;
  397. }
  398. .content {
  399. view {
  400. font-size: 26rpx;
  401. font-family: Microsoft YaHei;
  402. font-weight: 400;
  403. color: #333333;
  404. .item1 {
  405. font-size: 30rpx;
  406. font-family: Microsoft YaHei;
  407. font-weight: 400;
  408. color: #333333;
  409. }
  410. .item2 {
  411. font-size: 24rpx;
  412. font-family: Microsoft YaHei;
  413. font-weight: 400;
  414. color: #999999;
  415. margin-left: 10rpx;
  416. }
  417. .item3 {
  418. width: 71rpx;
  419. height: 37rpx;
  420. background: #ffffff;
  421. border: 1px solid #ff8000;
  422. border-radius: 6rpx;
  423. font-size: 22rpx;
  424. font-family: Microsoft YaHei;
  425. font-weight: 400;
  426. color: #ff8000;
  427. padding: 3rpx 6rpx;
  428. margin-left: 10rpx;
  429. }
  430. }
  431. }
  432. }
  433. .edit {
  434. image {
  435. width: 50rpx;
  436. height: 50rpx;
  437. }
  438. }
  439. }
  440. .from {
  441. background-color: #fff;
  442. margin-top: 30rpx;
  443. padding: 0 30rpx;
  444. ::v-deep .u-form-item {
  445. padding: 0;
  446. line-height: normal;
  447. .u-form-item__message {
  448. margin-bottom: 12rpx;
  449. }
  450. }
  451. .from_item {
  452. display: flex;
  453. flex-wrap: nowrap;
  454. justify-content: space-between;
  455. align-items: center;
  456. height: 80rpx;
  457. border-bottom: 1rpx solid #dcdcdc;
  458. .btn {
  459. font-size: 24rpx;
  460. font-family: Microsoft YaHei;
  461. font-weight: 400;
  462. color: #ffffff;
  463. background: #00b38b;
  464. border-radius: 10rpx;
  465. padding: 10rpx 15rpx;
  466. }
  467. ::v-deep .input {
  468. text-align: left;
  469. flex: 1;
  470. input {
  471. text-align: left;
  472. }
  473. }
  474. }
  475. .from_item1 {
  476. display: flex;
  477. flex-wrap: nowrap;
  478. flex-direction: column;
  479. justify-content: space-between;
  480. padding: 30rpx 0;
  481. border-bottom: #dcdcdc 1px solid;
  482. input {
  483. text-align: right;
  484. }
  485. .textarea {
  486. background-color: #f1f1f1;
  487. width: 100%;
  488. border-radius: 20rpx;
  489. margin-top: 10rpx;
  490. text-indent: 1rem;
  491. height: 180rpx;
  492. padding: 20rpx;
  493. box-sizing: border-box;
  494. }
  495. }
  496. }
  497. }
  498. .address-line {
  499. padding: 20px;
  500. .flex-bettwen {
  501. display: flex;
  502. align-items: center;
  503. justify-content: space-between;
  504. }
  505. .xing {
  506. width: 68rpx;
  507. height: 68rpx;
  508. background: rgba(0, 179, 139, 0.2);
  509. border-radius: 50%;
  510. font-size: 26rpx;
  511. font-weight: 400;
  512. color: #00b38b;
  513. line-height: 68rpx;
  514. text-align: center;
  515. }
  516. .content {
  517. margin-left: 20px;
  518. .name {
  519. font-size: 30rpx;
  520. font-family: Microsoft YaHei;
  521. font-weight: 500;
  522. color: #333333;
  523. }
  524. .phone {
  525. margin-left: 10rpx;
  526. font-size: 24rpx;
  527. font-family: Microsoft YaHei;
  528. font-weight: 400;
  529. color: #999999;
  530. line-height: 36rpx;
  531. }
  532. .address {
  533. margin-top: 10rpx;
  534. font-size: 26rpx;
  535. font-family: Microsoft YaHei;
  536. font-weight: 400;
  537. color: #333333;
  538. line-height: 36rpx;
  539. }
  540. .picture {
  541. width: 48rpx;
  542. height: 48rpx;
  543. }
  544. .editIcon {
  545. width: 48rpx;
  546. height: 48rpx;
  547. }
  548. }
  549. }
  550. .action {
  551. padding-bottom: 100rpx;
  552. .button {
  553. height: 80rpx;
  554. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  555. border-radius: 40rpx;
  556. font-size: 32rpx;
  557. font-weight: 400;
  558. color: #ffffff;
  559. line-height: 80rpx;
  560. }
  561. }
  562. .action-bottom {
  563. padding-bottom: 30rpx;
  564. .button {
  565. height: 80rpx;
  566. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  567. border-radius: 40rpx;
  568. font-size: 32rpx;
  569. font-weight: 400;
  570. color: #ffffff;
  571. line-height: 80rpx;
  572. }
  573. }
  574. .flex {
  575. display: flex;
  576. align-items: center;
  577. }
  578. .submit {
  579. width: 670rpx;
  580. height: 80rpx;
  581. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  582. box-shadow: 0rpx 4rpx 11rpx 1rpx rgba(223, 223, 223, 0.5);
  583. border-radius: 40rpx;
  584. font-size: 32rpx;
  585. font-family: Microsoft YaHei;
  586. font-weight: 400;
  587. color: #ffffff;
  588. line-height: 80rpx;
  589. margin-top: 60rpx;
  590. }
  591. </style>