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

essential-information-two.vue 14KB

6 个月前
7 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
7 个月前
7 个月前
6 个月前
6 个月前
6 个月前
8 个月前
8 个月前
6 个月前
6 个月前
6 个月前
8 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
7 个月前
6 个月前
1年前
1年前
1年前
1年前
1年前
1年前
8 个月前
6 个月前
7 个月前
7 个月前
7 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
1年前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
6 个月前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. <template>
  2. <navBar title="九州ETC" navbgClass="nav-bgXin" fontColor='#fff' :scrollTop="scrollTop" :type="state.data.vanType"
  3. :userType="state.data.userType"></navBar>
  4. <navBgCar :activeNum='2'></navBgCar>
  5. <view class="content-wrap">
  6. <view>
  7. <!-- 收货地址 -->
  8. <view v-if="!state.data.region" class="address-lane">
  9. <view class="title">请选择或新增收货地址</view>
  10. <view style="margin-top: 30rpx" class="action">
  11. <button type="default" class="ui-btn" @click="state.show = true">
  12. 添加收货地址
  13. </button>
  14. </view>
  15. </view>
  16. <view v-if="state.data.region" class="address-lane">
  17. <view class="title">收货地址</view>
  18. <view @click="state.show = true" class="address-content" style="margin-top: 30rpx">
  19. <view class="flex l-info">
  20. <image :showLoading="true" :src="`${$imgUrl}issuance/l-icon.png`" class="l-icon">
  21. </image>
  22. <view style="margin-left: 18rpx;flex: 1 1 auto;" class="">
  23. <view class="address">
  24. {{ state.data.region + state.data.address }}
  25. </view>
  26. <view style="margin-top: 15rpx" class="flex">
  27. <view class="name">
  28. {{ state.data.consignee }}
  29. </view>
  30. <view class="phone">
  31. {{ state.data.consigneeTel }}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="arror">
  37. <image :src="`${$imgUrl}issuance/r-more.png`" class="icon" mode='aspectFit'></image>
  38. </view>
  39. </view>
  40. <view style="margin-top: 30rpx" class="action">
  41. <button type="default" class="button" @click="nextAction()">
  42. 下一步
  43. </button>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 地址弹窗 -->
  49. <u-popup mode="bottom" v-model="state.show">
  50. <view class="address-line">
  51. <view v-if="state.addressArray" v-for="(item, index) in state.addressArray" :key="index"
  52. @click="addressSelected(item)" style="margin-bottom: 60rpx" class="flex-bettwen">
  53. <view class="flex">
  54. <view class="xing">
  55. {{ item.consignee.charAt(0) }}
  56. </view>
  57. <view class="content">
  58. <view class="flex">
  59. <view class="name">
  60. {{ item.consignee }}
  61. </view>
  62. <view class="phone">
  63. {{ item.consigneeTel }}
  64. <text class="default" v-if="item.defaultAddress==1">默认</text>
  65. </view>
  66. </view>
  67. <view class="address">
  68. {{ item.region + item.address }}
  69. </view>
  70. </view>
  71. </view>
  72. <view @click.stop="editAddress(item)" style="margin-left: 80rpx" class="picture">
  73. <image :showLoading="true" :src="`${$imgUrl}applyCard/edit.png`" style="width: 48rpx; height: 48rpx"></image>
  74. </view>
  75. </view>
  76. <view :style="state.addressArray ? 'margin-top: 60rpx;' : ''" class="action-bottom">
  77. <button type="default" class="ui-btn" @click="goToAddAddress()">
  78. 添加收货地址
  79. </button>
  80. </view>
  81. </view>
  82. </u-popup>
  83. </template>
  84. <script setup lang="ts">
  85. /*导航*/
  86. import navBgCar from "./components/nav-bg-car1";
  87. import numberplateColor from "./components/layout-numberplate-color";
  88. import { getItem, StorageKeys } from "@/utils/storage";
  89. import { stringToJson } from "@/utils/network/encryption";
  90. import navBar from "@/components/nav-bar/nav-bar2.vue";
  91. import { onLoad, onShow, onPageScroll, onUnload } from "@dcloudio/uni-app";
  92. import {
  93. addressQueryNew,
  94. productReCode,
  95. orderAdd, orderDetailQuery
  96. } from "@/utils/network/api.js";
  97. import { request, requestNew } from "@/utils/network/request.js";
  98. import { reactive, ref } from "vue";
  99. import { msg, noticeUse,navTo } from "@/utils/utils";
  100. const scrollTop = ref(0);
  101. const state = reactive({
  102. data: {
  103. vehiclePlate: undefined, //车牌号
  104. vehiclePlateNumber: "", //车牌号
  105. vehiclePlateColor: 0, //车牌颜色
  106. vanType: 1, //客货类型
  107. userType: 1,
  108. whetherToMail: getItem(StorageKeys.OpenId) ? true : "", //是否需要邮寄 小程序默认邮寄 true邮寄||1不邮寄 不登录为1
  109. orderSource: "WECHAT",
  110. opId: "",
  111. consignee: "", //收货人
  112. consigneeTel: "", //收货电话
  113. region: "",
  114. address: "",
  115. postalCode: "",
  116. longitude: "",
  117. latitude: "",
  118. detailedAddress: '', //通过经纬度转的地址
  119. cardType: '', //卡类型
  120. productId: "",//产品编号
  121. },
  122. show: false,
  123. addressArray: [],
  124. isSign: '',
  125. isValueCard: '',
  126. agreeURL: "",
  127. orderId: "",
  128. totalAmount: "",
  129. equityId: ""
  130. });
  131. const goToAddAddress = () => {
  132. navTo(
  133. "/subpackage/orders/addAddress",
  134. );
  135. };
  136. const editAddress = (val) => {
  137. console.log("val", val)
  138. navTo(
  139. `/subpackage/orders/editAddress?content=` + JSON.stringify(val),
  140. );
  141. };
  142. const addressSelected = (val : any) => {
  143. console.log("val", val)
  144. state.data = {
  145. ...state.data,
  146. ...val,
  147. };
  148. console.log("state.data.address", state.data.address)
  149. state.show = false;
  150. };
  151. const nextAction = () => {
  152. nextActionRequest()
  153. };
  154. const nextActionRequest = () => {
  155. var data = state.data;
  156. // #ifdef MP-ALIPAY
  157. data.orderSource = 'ALI'
  158. // #endif
  159. const options = {
  160. type: 2,
  161. data: data,
  162. method: "POST",
  163. showLoading: true,
  164. };
  165. requestNew(orderAdd, options).then((res) => {
  166. console.log("res===", res);
  167. if (res.statusCode === 600) {
  168. orderGoAction();
  169. } else {
  170. const data = res;
  171. state.orderId = data.orderId
  172. console.log(data);
  173. var vehicleId = state.data.vehiclePlate + "_" + state.data.vehiclePlateColor
  174. console.log("state.data.vehiclePlate", state.data.vehiclePlate, state.data.vehiclePlateColor, vehicleId)
  175. if (state.data.userType == 1) {
  176. navTo(
  177. `/subpackage/orders/opening-account-people?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&vanType=${state.data.vanType}&vehicleId=${vehicleId}`,
  178. );
  179. } else {
  180. navTo(
  181. `/subpackage/orders/opening-account-unit?orderId=${data.orderId}&&vehiclePlateColor=${state.data.vehiclePlateColor}&isSign=${state.isValueCard}&vanType=${state.data.vanType}&vehicleId=${vehicleId}`,
  182. );
  183. }
  184. }
  185. });
  186. }
  187. //按照订单阶段去跳转
  188. const orderGoAction = () => {
  189. var orderParmas = {
  190. vehicleId: state.data.vehiclePlate + "_" + state.data.vehiclePlateColor,
  191. opId: getItem(StorageKeys.OpenId),
  192. source: "WECHAT",
  193. };
  194. const options = {
  195. type: 2,
  196. data: orderParmas,
  197. method: "POST",
  198. showLoading: true,
  199. };
  200. requestNew(orderDetailQuery, options).then((res) => {
  201. const data = res;
  202. console.log(data);
  203. orderStepGoActon(data);
  204. });
  205. };
  206. //订单状态舔砖
  207. const orderStepGoActon = (val : any) => {
  208. console.log("订单状态舔砖", val);
  209. //完成填写基本信息
  210. if (val.orderStep === 1) {
  211. if (state.data.userType === 1 || val.orderStep === 27) {
  212. uni.redirectTo({
  213. url: `/ subpackage / orders / opening - account - people ? orderId = ${val.orderId}&& vehiclePlateColor=${val.vehiclePlateColor} `,
  214. });
  215. } else {
  216. uni.redirectTo({
  217. url: `/ subpackage / orders / opening - account - unit ? orderId = ${val.orderId}&& vehiclePlateColor=${val.vehiclePlateColor} `,
  218. });
  219. }
  220. } else if (val.orderStep === 2) {
  221. uni.redirectTo({
  222. url: `/ subpackage / orders / car - release ? orderId = ${val.orderId}&& vehiclePlateColor=${val.vehiclePlateColor} `,
  223. });
  224. } else if (val.orderStep === 3) {
  225. uni.redirectTo({
  226. url: `/ subpackage / orders / choice - product ? orderId = ${val.orderId} `,
  227. });
  228. } else if (val.orderStep === 4) {
  229. uni.redirectTo({
  230. url: `/ subpackage / orders / product - detail ? orderId = ${val.orderId}&& clientFee=${val.product.clientFee}&& id=${val.productId} `,
  231. });
  232. } else if (val.orderStep === 26) {
  233. uni.redirectTo({
  234. url: `/ subpackage / orders / product - detail ? orderId = ${val.orderId}&& clientFee=${val.product.clientFee}&& id=${val.productId} `,
  235. });
  236. }
  237. };
  238. onLoad((option : any) => {
  239. state.data.vanType = Number(option.vanType); //1客车 2货车
  240. state.data.opId = getItem(StorageKeys.OpenId);
  241. state.data.userType = Number(option.userType);
  242. state.data.productId = option.productId;
  243. state.data.vehiclePlate = option.vehiclePlate;
  244. state.data.vehiclePlateColor = option.vehiclePlateColor;
  245. state.isValueCard = option.isValueCard
  246. state.data.cardType = option.cardType
  247. state.totalAmount = option.totalAmount;
  248. state.equityId = option.equityId;
  249. console.log("订单选择推广发行产品接口", option)
  250. uni.getLocation({
  251. type: 'wgs84',
  252. success: function (res) {
  253. state.data.longitude = res.longitude;
  254. state.data.latitude = res.latitude;
  255. console.log("成功回调", res)
  256. uni.request({
  257. url: 'https://apis.map.qq.com/ws/geocoder/v1/',
  258. data: {
  259. location: (res.latitude + "," + res.longitude),
  260. key: 'U3EBZ-EITC3-SRW3P-3PKVC-LWFD6-SJBAE',
  261. },
  262. success: function (res) {
  263. console.log("成功回调", res)
  264. state.data.detailedAddress = res.data.result.address; // 详细地址信息
  265. // 处理获取到的地址信息
  266. },
  267. fail: function (error) {
  268. // 请求失败的处理
  269. }
  270. });
  271. }
  272. });
  273. });
  274. //监听页面滚动
  275. onPageScroll((e) => {
  276. scrollTop.value = e.scrollTop;
  277. });
  278. onShow((option) => {
  279. var data = {
  280. openId: getItem(StorageKeys.OpenId),
  281. };
  282. if (getItem(StorageKeys.OpenId)) {
  283. const options = {
  284. type: 2,
  285. data: data,
  286. method: "POST",
  287. showLoading: true,
  288. };
  289. requestNew(addressQueryNew, options).then((res) => {
  290. const data = res;
  291. console.log("111", data);
  292. state.addressArray = data.result ? data.result : [];
  293. for (var i = 0; i < state.addressArray.length; i++) {
  294. if (state.addressArray[i]['defaultAddress'] == 1) {
  295. state.data = {
  296. ...state.data,
  297. ...state.addressArray[i],
  298. };
  299. }
  300. }
  301. });
  302. }
  303. uni.$on('updateData', function (data) {
  304. var arr = [];
  305. arr.push(data)
  306. state.addressArray = arr
  307. console.log("dizhi", arr)
  308. })
  309. // 删除地址
  310. if (option) {
  311. if (option.del == 1) {
  312. state.addressArray = [];
  313. }
  314. }
  315. });
  316. onUnload(() => {
  317. uni.$off('updateData');
  318. })
  319. const productReCodeAction = (orderId) => {
  320. var data = {
  321. promoteId: state.data.productId,
  322. orderId: orderId,
  323. isValueCard: state.isValueCard,
  324. loginSource: getItem("loginSource")
  325. };
  326. const options = {
  327. type: 2,
  328. data: data,
  329. method: "POST",
  330. showLoading: true,
  331. };
  332. return new Promise(async (resolve, reject) => {
  333. const res = await request(productReCode, options);
  334. const data = stringToJson(res.bizContent);
  335. console.log("111")
  336. resolve(data);
  337. }).catch((error) => {
  338. console.log("222")
  339. reject(error);
  340. });
  341. };
  342. </script>
  343. <style lang="scss" scoped>
  344. .flex {
  345. display: flex;
  346. align-items: center;
  347. }
  348. .content-wrap {
  349. position: absolute;
  350. padding: 0rpx 30rpx;
  351. top: 370rpx;
  352. min-height: calc(100% - 370rpx);
  353. box-sizing: border-box;
  354. width: 100%;
  355. .title {
  356. font-size: 30rpx;
  357. font-family: Noto Sans S Chinese;
  358. font-weight: 400;
  359. color: #000000;
  360. line-height: 30rpx;
  361. margin-bottom: 30rpx;
  362. }
  363. .car-input {}
  364. .chepai-lane {
  365. margin-top: 60rpx;
  366. margin-bottom: 20rpx;
  367. }
  368. .address-lane {
  369. background-color: #fff;
  370. padding: 30rpx;
  371. border-radius: 12rpx;
  372. .title {
  373. font-size: 30rpx;
  374. font-weight: bold;
  375. line-height: 30rpx;
  376. margin-bottom: 30rpx;
  377. font-family: SourceHanSansSC, SourceHanSansSC;
  378. color: #01243A;
  379. }
  380. }
  381. }
  382. .address-content {
  383. display: flex;
  384. align-items: center;
  385. justify-content: space-between;
  386. padding-bottom: 30rpx;
  387. border-bottom: 1rpx solid #dcdcdc;
  388. .l-info {
  389. flex: 1 1 auto;
  390. .l-icon {
  391. flex-shrink: 0;
  392. width: 74rpx;
  393. height: 74rpx;
  394. }
  395. }
  396. .arror {
  397. flex-shrink: 0;
  398. .icon {
  399. width: 24rpx;
  400. height: 24rpx;
  401. }
  402. }
  403. .name {
  404. font-size: 26rpx;
  405. font-family: Microsoft YaHei;
  406. font-weight: 400;
  407. color: #999999;
  408. font-size: 26rpx;
  409. }
  410. .phone {
  411. font-size: 26rpx;
  412. font-family: Microsoft YaHei;
  413. font-weight: 400;
  414. color: #999999;
  415. line-height: 26rpx;
  416. margin-left: 20rpx;
  417. }
  418. .address {
  419. font-size: 32rpx;
  420. font-family: Microsoft YaHei;
  421. font-weight: 400;
  422. color: #333333;
  423. line-height: 32rpx;
  424. width: 86%;
  425. word-break: break-word;
  426. }
  427. }
  428. .address-line {
  429. padding: 20px;
  430. .flex-bettwen {
  431. display: flex;
  432. align-items: center;
  433. justify-content: space-between;
  434. }
  435. .xing {
  436. width: 68rpx;
  437. height: 68rpx;
  438. background: rgba(0, 52, 87, 0.2);
  439. border-radius: 50%;
  440. font-size: 26rpx;
  441. font-weight: 400;
  442. color: #fff;
  443. line-height: 68rpx;
  444. text-align: center;
  445. }
  446. .content {
  447. margin-left: 20px;
  448. .name {
  449. font-size: 30rpx;
  450. font-family: Microsoft YaHei;
  451. font-weight: 500;
  452. color: #333333;
  453. }
  454. .phone {
  455. margin-left: 10rpx;
  456. font-size: 24rpx;
  457. font-family: Microsoft YaHei;
  458. font-weight: 400;
  459. color: #999999;
  460. line-height: 36rpx;
  461. }
  462. .address {
  463. margin-top: 10rpx;
  464. font-size: 26rpx;
  465. font-family: Microsoft YaHei;
  466. font-weight: 400;
  467. color: #333333;
  468. line-height: 36rpx;
  469. }
  470. .picture {
  471. width: 48rpx;
  472. height: 48rpx;
  473. }
  474. .editIcon {
  475. width: 48rpx;
  476. height: 48rpx;
  477. }
  478. }
  479. }
  480. .action {
  481. position: absolute;
  482. bottom: 0rpx;
  483. left: 0;
  484. height: 128rpx;
  485. background-color: #fff;
  486. border-radius: 30rpx 30rpx 0 0;
  487. width: 100vw;
  488. display: flex;
  489. align-items: center;
  490. justify-content: center;
  491. .button {
  492. height: 88rpx;
  493. background: radial-gradient(at 0% 0%, #01243A 0%, #004576 100%);
  494. border-radius: 40rpx;
  495. font-size: 32rpx;
  496. font-weight: 400;
  497. color: #ffffff;
  498. line-height: 88rpx;
  499. width: 660rpx;
  500. margin: 0 auto;
  501. }
  502. }
  503. .action-bottom {
  504. padding-bottom: 30rpx;
  505. .button {
  506. height: 88rpx;
  507. background: radial-gradient(at 0% 0%, #01243A 0%, #004576 100%);
  508. border-radius: 40rpx;
  509. font-size: 32rpx;
  510. font-weight: 400;
  511. color: #ffffff;
  512. line-height: 88rpx;
  513. width: 660rpx;
  514. margin: 0 auto;
  515. }
  516. }
  517. :deep(.numberplates .numberplate-bg) {
  518. width: 190rpx;
  519. }
  520. :deep(.numberplates .numberplate) {
  521. margin-right: 0rpx !important;
  522. width: 190rpx;
  523. }
  524. :deep(.numberplates) {
  525. justify-content: space-between;
  526. }
  527. .default {
  528. border: 1rpx solid #00b38b;
  529. border-radius: 5rpx;
  530. padding: 2rpx 4rpx;
  531. color: #00b38b;
  532. margin-left: 4rpx;
  533. }
  534. </style>