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 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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">默认</text>
  13. </view>
  14. <view class=""> {{form.area +form.address}}</view>
  15. </view>
  16. </view>
  17. <view class="edit">
  18. <image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
  19. </view>
  20. </view>
  21. <u-form :model="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">
  46. <text><text style="color: red">*</text>退货物流公司:</text>
  47. <view style="display: flex" @click="showPicker">
  48. <u-input v-model="form.courierCompany" class="input" disabled placeholder="请选择" />
  49. <u-icon name="arrow-right" style="margin-left: 10px"></u-icon>
  50. </view>
  51. </view>
  52. </u-form-item>
  53. <u-form-item prop="returnNum" v-if="form.sendStatusName == '寄回'">
  54. <view class="from_item">
  55. <text><text style="color: red"></text>退货单号:</text>
  56. <u-input v-model="form.courierOrderId" class="input" />
  57. </view>
  58. </u-form-item>
  59. <u-form-item prop="cardState">
  60. <view class="from_item">
  61. <text><text style="color: red">*</text>收货方式:</text>
  62. <!-- <u-radio-group v-model="form.receiveMethodName">
  63. <u-radio :customStyle="{ marginBottom: '8px' }" activeColor="#2CE242"
  64. v-for="(item, index) in radiolist2" :key="index" :label="item.disabled"
  65. :name="item.name">
  66. {{ item.name }}
  67. </u-radio>
  68. </u-radio-group> -->
  69. <radio-group @change="receiveChange" class="radios">
  70. <block v-for="(item, index) in radiolist2" :key="item.val">
  71. <view class="radio-box">
  72. <radio :value="item.val" :checked="form.receiveMethod == item.val" color="#13e7c1"
  73. style="transform:scale(0.75)" />
  74. <view>{{item.name}}</view>
  75. </view>
  76. </block>
  77. </radio-group>
  78. </view>
  79. </u-form-item>
  80. </view>
  81. </u-form>
  82. <!-- 物流弹窗 -->
  83. <view>
  84. <!-- 物流 -->
  85. <u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
  86. </view>
  87. <button class="submit" @click="submit">下一步</button>
  88. </view>
  89. </template>
  90. <script setup lang="ts">
  91. // import navBar from "../ETCcancellation/components/nav-bar.vue";
  92. import {
  93. reactive,
  94. ref
  95. } from "vue";
  96. import {
  97. onLoad,
  98. onShow,
  99. onReady
  100. } from "@dcloudio/uni-app";
  101. import {
  102. navTo,
  103. checkStr
  104. } from "@/utils/utils";
  105. import {
  106. request
  107. } from "../../utils/network/request.js";
  108. import {
  109. getLogistics,
  110. addressQuery,
  111. cckChangejzCardInfo
  112. } from "../../utils/network/api.js";
  113. import {
  114. stringToJson
  115. } from "../../utils/network/encryption.js";
  116. import {
  117. getItem,
  118. StorageKeys
  119. } from "@/utils/storage";
  120. import {
  121. wechatPayConfigId,
  122. } from "@/utils/network/api";
  123. const list = reactive([]); //物流数据
  124. const address = reactive({
  125. list: []
  126. }); //地址list
  127. const form = reactive({
  128. customerName: '',
  129. customerTel: '',
  130. address: '',
  131. area: '',
  132. sendStatusName: '寄回',
  133. sendStatus: '1', //0 --- 不邮寄 1 --- 邮寄
  134. courierCompany: '',
  135. courierOrderId: '',
  136. receiveMethod: '1',
  137. postCode: '',
  138. receiveMethodName: '邮寄' //0 --- 不邮寄 1 --- 邮寄
  139. });
  140. //入参
  141. const params = reactive({
  142. /* cardId: '',
  143. obuId: '', */
  144. orderId: '',
  145. applyId: '',
  146. });
  147. // 单选数据列表
  148. const radiolist1 = reactive([{
  149. name: "寄回",
  150. val: "1",
  151. },
  152. {
  153. name: "不寄回",
  154. val: "0",
  155. },
  156. ]);
  157. const radiolist2 = reactive([{
  158. name: "邮寄",
  159. val: "1",
  160. },
  161. {
  162. name: "不邮寄",
  163. val: "0",
  164. },
  165. ]);
  166. let show = ref(false);
  167. // 寄回单选
  168. const sendChange = (e : any) => {
  169. console.log(e);
  170. form.sendStatus = e.detail.value
  171. };
  172. // 邮寄单选
  173. const receiveChange = (e : any) => {
  174. console.log(e);
  175. form.receiveMethod = e.detail.value
  176. };
  177. // 打开物流先择器
  178. const showPicker = function() {
  179. show.value = true;
  180. };
  181. const confirm = (e) => {
  182. form.courierCompany = e[0].value;
  183. console.log(e[0].value);
  184. };
  185. onLoad((option) => {
  186. params.orderId = option.orderId
  187. params.applyId = option.applyId
  188. getexpresslist();
  189. getAddressList();
  190. });
  191. const getexpresslist = () => {
  192. //参数说明
  193. let options = {
  194. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  195. data: {
  196. // opId: getItem("openId"),
  197. // source: "WECHAT",
  198. // tabIndex: "0",
  199. }, //请求参数
  200. method: "POST", //提交方式(默认POST)
  201. showLoading: true, //是否显示加载中(默认显示)
  202. };
  203. //调用方式
  204. request(getLogistics, options)
  205. .then((res) => {
  206. // stringToJson(res.bizContent)
  207. stringToJson(res.bizContent).forEach((item) => {
  208. list.push({
  209. value: item,
  210. label: item,
  211. });
  212. });
  213. })
  214. .catch((err) => {
  215. console.log(err);
  216. });
  217. };
  218. const getAddressList = () => {
  219. var data = {
  220. openId: getItem(StorageKeys.OpenId),
  221. };
  222. const options = {
  223. type: 2,
  224. data: data,
  225. method: "POST",
  226. showLoading: true,
  227. };
  228. request(addressQuery, options).then((res) => {
  229. const data = stringToJson(res.bizContent);
  230. address.list = data.data;
  231. if (address.list.length > 0) {
  232. var defaultAddress = address.list[0]
  233. form.customerName = defaultAddress.consignee
  234. form.customerTel = defaultAddress.consigneeTel
  235. form.address = defaultAddress.address
  236. form.area = defaultAddress.region
  237. form.postCode = defaultAddress.postalCode
  238. }
  239. });
  240. };
  241. const submit = () => {
  242. // if (form.sendStatusName === '寄回') {
  243. // form.sendStatus = '1'
  244. // } else {
  245. // form.sendStatus = '0'
  246. // }
  247. // if (form.receiveMethodName === '邮寄') {
  248. // form.receiveMethod = '1'
  249. // } else {
  250. // form.receiveMethod = '0'
  251. // }
  252. queryCckChangejzCardInfo().then(val => {
  253. console.log(val)
  254. navTo(
  255. `/after-sale/to-bookkeeping-card/result`
  256. )
  257. })
  258. };
  259. const queryCckChangejzCardInfo = () => {
  260. var data = {
  261. applyId: params.applyId,
  262. orderId: params.orderId,
  263. sendStatus: form.sendStatus,
  264. configId: wechatPayConfigId,
  265. courierCompany: form.courierCompany,
  266. courierOrderId: form.courierOrderId,
  267. receiveMethod: form.receiveMethod,
  268. customerName: form.customerName,
  269. customerTel: form.customerTel,
  270. address: form.address,
  271. area: form.area,
  272. postCode: form.postCode
  273. };
  274. const options = {
  275. type: 2,
  276. data: data,
  277. method: "POST",
  278. showLoading: true,
  279. };
  280. return new Promise(async (resolve, reject) => {
  281. const res = await request(cckChangejzCardInfo, options);
  282. const data = stringToJson(res.bizContent);
  283. resolve(data);
  284. }).catch((error) => {
  285. reject(error);
  286. });
  287. }
  288. </script>
  289. <style>
  290. page {
  291. width: 100%;
  292. height: 100%;
  293. display: flex;
  294. flex-direction: column;
  295. background-color: #f3f3f3;
  296. }
  297. </style>
  298. <style lang="scss" scoped>
  299. .radios{
  300. display: flex;
  301. }
  302. .radio-box{
  303. display: flex;
  304. align-items: center;
  305. padding-left: 20rpx;
  306. }
  307. .oderPage {
  308. flex: 1;
  309. width: 100%;
  310. .addr-box {
  311. margin-top: 20rpx;
  312. display: flex;
  313. background: #fff;
  314. padding: 30rpx;
  315. justify-content: space-between;
  316. align-items: center;
  317. .addr-box-left {
  318. display: flex;
  319. .text-image {
  320. width: 68rpx;
  321. height: 68rpx;
  322. background: #00b38b;
  323. border-radius: 50%;
  324. text-align: center;
  325. font-size: 26rpx;
  326. font-family: Microsoft YaHei;
  327. font-weight: 400;
  328. color: #ffffff;
  329. line-height: 68rpx;
  330. margin-right: 30rpx;
  331. }
  332. .content {
  333. view {
  334. font-size: 26rpx;
  335. font-family: Microsoft YaHei;
  336. font-weight: 400;
  337. color: #333333;
  338. .item1 {
  339. font-size: 30rpx;
  340. font-family: Microsoft YaHei;
  341. font-weight: 400;
  342. color: #333333;
  343. }
  344. .item2 {
  345. font-size: 24rpx;
  346. font-family: Microsoft YaHei;
  347. font-weight: 400;
  348. color: #999999;
  349. margin-left: 10rpx;
  350. }
  351. .item3 {
  352. width: 71rpx;
  353. height: 37rpx;
  354. background: #ffffff;
  355. border: 1px solid #ff8000;
  356. border-radius: 6rpx;
  357. font-size: 22rpx;
  358. font-family: Microsoft YaHei;
  359. font-weight: 400;
  360. color: #ff8000;
  361. padding: 3rpx 6rpx;
  362. margin-left: 10rpx;
  363. }
  364. }
  365. }
  366. }
  367. .edit {
  368. image {
  369. width: 50rpx;
  370. height: 50rpx;
  371. }
  372. }
  373. }
  374. .from {
  375. background-color: #fff;
  376. margin-top: 30rpx;
  377. padding: 0 30rpx;
  378. ::v-deep .u-form-item {
  379. padding: 0;
  380. line-height: normal;
  381. .u-form-item__message {
  382. margin-bottom: 12rpx;
  383. }
  384. }
  385. .from_item {
  386. display: flex;
  387. flex-wrap: nowrap;
  388. justify-content: space-between;
  389. align-items: center;
  390. height: 80rpx;
  391. border-bottom: 1rpx solid #dcdcdc;
  392. .btn {
  393. font-size: 24rpx;
  394. font-family: Microsoft YaHei;
  395. font-weight: 400;
  396. color: #ffffff;
  397. background: #00b38b;
  398. border-radius: 10rpx;
  399. padding: 10rpx 15rpx;
  400. }
  401. ::v-deep .input {
  402. text-align: left;
  403. flex: 1;
  404. input {
  405. text-align: left;
  406. }
  407. }
  408. }
  409. .from_item1 {
  410. display: flex;
  411. flex-wrap: nowrap;
  412. flex-direction: column;
  413. justify-content: space-between;
  414. padding: 30rpx 0;
  415. border-bottom: #dcdcdc 1px solid;
  416. input {
  417. text-align: right;
  418. }
  419. .textarea {
  420. background-color: #f1f1f1;
  421. width: 100%;
  422. border-radius: 20rpx;
  423. margin-top: 10rpx;
  424. text-indent: 1rem;
  425. height: 180rpx;
  426. padding: 20rpx;
  427. box-sizing: border-box;
  428. }
  429. }
  430. }
  431. }
  432. .submit {
  433. width: 670rpx;
  434. height: 80rpx;
  435. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  436. box-shadow: 0rpx 4rpx 11rpx 1rpx rgba(223, 223, 223, 0.5);
  437. border-radius: 40rpx;
  438. font-size: 32rpx;
  439. font-family: Microsoft YaHei;
  440. font-weight: 400;
  441. color: #ffffff;
  442. line-height: 80rpx;
  443. margin-top: 60rpx;
  444. }
  445. </style>