Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

mailing_information.vue 14KB

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