您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

mailing_information.vue 10KB

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