You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mailing_information.vue 14KB

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