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

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