delivery.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. <template>
  2. <!-- 寄快递 -->
  3. <view class="" style="padding: 0 24rpx;">
  4. <view style="position: relative;padding-bottom: 20rpx;">
  5. <!-- 自定义导航栏 -->
  6. <image src="/static/images/index/back.png"
  7. style="width: 750rpx;height: 1200rpx;position: absolute;top: 0;z-index: -1;left:-24rpx;" mode="">
  8. </image>
  9. <u-navbar :autoBack='true' title='寄快递' bgColor="rgba(248, 50, 36, 0.2)" :placeholder='true'
  10. :safeAreaInsetTop="true" style="position: absolute;z-index: 110;background-color: rgba(0,0,0,0);">
  11. <view class="u-nav-slot" slot="left" style="display: flex;">
  12. <u-icon name="arrow-left" color="rgba(0, 0, 0, 1)" size="24" @click="uni.navigateBack()"></u-icon>
  13. </view>
  14. </u-navbar>
  15. <!-- 地址 -->
  16. <view class="address">
  17. <view class="left u-flex" style="display: flex;" @click="send">
  18. <view class="u-row-between left" style="display: flex;flex-direction: column;">
  19. <image src="/static/express/ji.png" style='width: 40rpx;;height:40rpx ;' mode=""></image>
  20. <image @click.stop="changeadd" src="/static/express/change.png"
  21. style='width: 40rpx;;height:40rpx ;' mode="">
  22. </image>
  23. </view>
  24. <view class=" u-row-between left"
  25. style="flex: 1;margin-left: 28rpx;border-bottom:2rpx solid rgba(151, 151, 151, 0.08) ;display: flex;">
  26. <view v-if="JSON.stringify(topadd)==='{}'" class="u-row-between " style="">
  27. <view class="pople">{{i18n.sender}}</view>
  28. <view class="jiadd" style="margin-top: 14rpx;">{{i18n.informat}}</view>
  29. </view>
  30. <view v-else class="u-row-between " style="" @click="send">
  31. <view class="">
  32. <text class="topname">{{topadd.name}}</text>
  33. <text class="topaddress"
  34. style="margin-left: 8rpx;">{{replacePhoneToStar(topadd.mobile)}}</text>
  35. </view>
  36. <view class="topaddress" style="margin-top: 14rpx;">{{topadd.full_address}}</view>
  37. </view>
  38. <view class="u-flex" @click.stop="addbook(0)">
  39. <view class="" style="color: rgba(151, 151, 151, 1);">|</view>
  40. <text class="right">{{i18n.addressbook}}</text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="left u-flex"
  45. style="display: flex;margin-top: 26rpx;border-bottom:2rpx solid rgba(151, 151, 151, 0.08)"
  46. @click="recipe">
  47. <view class="u-row-between left" style="display: flex;flex-direction: column;">
  48. <image src="/static/express/shou.png" style='width: 40rpx;;height:40rpx ;' mode=""></image>
  49. <!-- <image src="../../static/express/change.png" style='width: 40rpx;;height:40rpx ;' mode=""> -->
  50. </image>
  51. </view>
  52. <view class=" u-row-between left" style="flex: 1;margin-left: 28rpx;display: flex;">
  53. <view v-if="JSON.stringify(bottomadd)==='{}'" class="u-row-between " style="">
  54. <view class="pople">{{i18n.recipient}}</view>
  55. <view class="jiadd" style="margin-top: 14rpx;">{{i18n.informat}}</view>
  56. </view>
  57. <view v-else class="u-row-between " style="" @click="send">
  58. <view class="">
  59. <text class="topname">{{bottomadd.name}}</text>
  60. <text class="topaddress"
  61. style="margin-left: 8rpx;">{{replacePhoneToStar(bottomadd.mobile)}}</text>
  62. </view>
  63. <view class="topaddress" style="margin-top: 14rpx;">{{bottomadd.full_address}}</view>
  64. </view>
  65. <view class="u-flex" @click.stop="addbook(1)">
  66. <view class="" style="color: rgba(151, 151, 151, 1);">|</view>
  67. <text class="right">{{i18n.addressbook}}</text>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="wup">
  73. <!-- 物品信息 -->
  74. <view class="info u-flex u-row-between">
  75. <view class="u-flex">
  76. <text class="wupin">{{i18n.item}}</text>
  77. <view class="mast">{{i18n.required}}</view>
  78. </view>
  79. <view v-if="JSON.stringify(goodinfo)==='{}'" class="u-flex" @click='goods'>
  80. <view class="change">{{i18n.selection}}</view>
  81. <image src="/static/express/next1.png" style="width: 28rpx;height: 28rpx;margin-left: 6rpx;"
  82. mode=""></image>
  83. </view>
  84. <view v-else class="goodname" @click='goods'>
  85. {{goodinfo.goodname}},{{goodinfo.weight}}kg
  86. </view>
  87. <!-- <view class="u-flex">
  88. <text class="change">{{i18n.select}}</text>
  89. <image src="/static/express/next1.png" style="width: 28rpx;height: 28rpx;margin-left: 6rpx;"
  90. mode=""></image>
  91. </view> -->
  92. </view>
  93. <!-- 跨境物流 -->
  94. <view class="info u-flex u-row-between" @click="changewu">
  95. <view class="u-flex">
  96. <text class="wupin">{{i18n.flow}}</text>
  97. </view>
  98. <view class="u-flex">
  99. <text class="change"
  100. style="color: rgba(248, 50, 36, 1);">{{leftname?leftname+' | '+rightname : i18n.selection}}</text>
  101. <!-- <text class="change" style="color: rgba(248, 50, 36, 1);">{{i18n.selection}}</text> -->
  102. <image v-if="leftname==''" src="/static/express/next1.png"
  103. style="width: 28rpx;height: 28rpx;margin-left: 6rpx;" mode=""></image>
  104. </view>
  105. </view>
  106. </view>
  107. <!-- 下一步 -->
  108. <view class="next u-flex-between" style="display: flex;">
  109. <view class="" style="flex: 1;">
  110. <view class="sum">
  111. <text>{{i18n.Estimatedprice}}</text>
  112. <text style="color: rgba(248, 50, 36, 1);">¥{{all?all:'--'}}</text>
  113. </view>
  114. <view class="deal u-flex" style="margin-top: 16rpx;">
  115. <u-checkbox-group shape='circle' v-model="checkboxValue1" placement="column"
  116. @change="checkboxChange">
  117. <u-checkbox :customStyle="{marginBottom: '8px',marginTop:'5px'}" :name="deal">
  118. </u-checkbox>
  119. </u-checkbox-group>
  120. <text>{{i18n.readandagree}}</text>
  121. <text style="color: rgba(248, 50, 36, 1);">《{{i18n.International}}》</text>
  122. </view>
  123. </view>
  124. <view class="tonext " style="" @click="next">
  125. {{i18n.next}}
  126. </view>
  127. </view>
  128. </view>
  129. <u-popup round='28' :show="logshow" @close="close">
  130. <view class="pop">
  131. <kj-flow ref="child" :goodstype="this.goodinfo.goodtype" @success='success'
  132. @close='logshow=false'></kj-flow>
  133. </view>
  134. </u-popup>
  135. </view>
  136. </template>
  137. <script>
  138. export default {
  139. data() {
  140. return {
  141. deal: -1,
  142. checkboxValue1: [],
  143. logshow: false, //物流选择
  144. language: 'zh-CN',
  145. goodinfo: {},
  146. topadd: {},
  147. bottomadd: {},
  148. leftname: '',
  149. rightname: '',
  150. container_id: '',
  151. unit_price: '',
  152. number: '',
  153. all:0
  154. }
  155. },
  156. onLoad(options) {
  157. this.goodinfo = JSON.parse(decodeURIComponent(options.goodinfo))
  158. this.topadd = JSON.parse(decodeURIComponent(options.topadd))
  159. this.bottomadd = JSON.parse(decodeURIComponent(options.bottom))
  160. this.leftname = options.leftname
  161. this.rightname = options.rightname
  162. this.container_id = options.container_id
  163. this.unit_price = options.unit_price
  164. this.number = options.number
  165. },
  166. onShow() {
  167. if (uni.getStorageSync('language') != '') {
  168. this.language = uni.getStorageSync('language')
  169. }
  170. },
  171. computed: {
  172. i18n() {
  173. return this.$t('index')
  174. },
  175. },
  176. methods: {
  177. //价格计算
  178. calculate() {
  179. uni.$u.http.get('/api/express-order/calculate', {
  180. params: {
  181. container_id:this.container_id,// 是 String 货柜ID
  182. weight:this.goodinfo.weight, //是 String 重量(kg)
  183. length:this.goodinfo.length, //是 String 长(m)
  184. width:this.goodinfo.width, //是 String 宽(m)
  185. height:this.goodinfo.height, //是 String 高(m)
  186. type:this.goodinfo.goodtype //是 String 商品类型: normal.普通商品,
  187. }
  188. }).then((res) => {
  189. console.log(res);
  190. this.all = res
  191. }).catch(() => {
  192. })
  193. },
  194. //跨境物流选择
  195. success(msg) {
  196. this.logshow = false
  197. this.leftname = msg.leftname
  198. this.container_id = msg.dateid
  199. this.rightname = msg.rightname
  200. this.unit_price = msg.unit_price
  201. this.calculate()
  202. },
  203. //改变地址
  204. changeadd() {
  205. var a = {}
  206. a = this.topadd
  207. this.topadd = this.bottomadd
  208. this.bottomadd = a
  209. this.province_id = this.bottomadd.province_id
  210. },
  211. //正则匹配手机号
  212. replacePhoneToStar: function(phone) {
  213. if (phone) {
  214. return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  215. }
  216. },
  217. //物流选择
  218. changewu() {
  219. if (this.province_id && this.goodinfo.goodname) {
  220. this.logshow = true
  221. setTimeout(() => {
  222. this.$refs.child.transport();
  223. }, 800)
  224. } else {
  225. this.$u.toast('请先选择城市和物品信息')
  226. }
  227. },
  228. //地址薄
  229. addbook(index) {
  230. var that = this
  231. uni.navigateTo({
  232. url: "/pageC/addressManagement/addressManagement?index=" + index,
  233. events: {
  234. getadd(res) {
  235. if (index == 0) {
  236. that.topadd = res
  237. console.log('topadd', that.topadd);
  238. } else {
  239. that.bottomadd = res
  240. console.log('bottom', that.bottomadd);
  241. that.province_id = that.bottomadd.province_id
  242. }
  243. }
  244. }
  245. })
  246. },
  247. //物品信息
  248. goods() {
  249. var that = this
  250. uni.navigateTo({
  251. url: '/pageB/goods',
  252. events: {
  253. goodinfo: function(res) {
  254. console.log(res);
  255. that.goodinfo = res
  256. }
  257. }
  258. })
  259. },
  260. close() {
  261. this.logshow = true
  262. },
  263. send() {
  264. uni.navigateTo({
  265. url: '/pageB/Senderinfor'
  266. })
  267. },
  268. recipe() {
  269. uni.navigateTo({
  270. url: '/pageB/recipientinfo'
  271. })
  272. },
  273. checkboxChange(n) {
  274. console.log('change', n);
  275. },
  276. next() {
  277. if (this.checkboxValue1.length == 0) {
  278. this.$u.toast('请勾选协议')
  279. } else if (JSON.stringify(this.goodinfo) === '{}') {
  280. this.$u.toast('请填写物品信息')
  281. } else if (this.leftname == '') {
  282. this.$u.toast('请选择物流方式')
  283. } else {
  284. uni.navigateTo({
  285. url: "/pageB/end?goodinfo=" + encodeURIComponent(JSON.stringify(this.goodinfo)) +
  286. "&topadd=" + encodeURIComponent(JSON.stringify(
  287. this.topadd)) + "&bottom=" + encodeURIComponent(JSON.stringify(this.bottomadd)) +
  288. '&leftname=' + this
  289. .leftname + "&rightname=" + this.rightname + "&container_id=" + this.container_id +
  290. "&unit_price=" + this.unit_price + '&all=' +this.all
  291. })
  292. }
  293. }
  294. }
  295. }
  296. </script>
  297. <style lang="scss" scoped>
  298. .topname {
  299. font-family: PingFangSC, PingFang SC;
  300. font-weight: 500;
  301. font-size: 30rpx;
  302. color: #222222;
  303. line-height: 42rpx;
  304. text-align: left;
  305. font-style: normal;
  306. }
  307. .topaddress {
  308. font-family: PingFangSC, PingFang SC;
  309. font-weight: 400;
  310. font-size: 26rpx;
  311. color: #777777;
  312. line-height: 36rpx;
  313. text-align: left;
  314. font-style: normal;
  315. }
  316. .pop {
  317. font-family: PingFangSC, PingFang SC;
  318. font-weight: 500;
  319. font-size: 36rpx;
  320. color: #333333;
  321. line-height: 50rpx;
  322. text-align: left;
  323. font-style: normal;
  324. padding: 32rpx 28rpx 0 0;
  325. box-sizing: border-box;
  326. }
  327. .sum {
  328. font-family: PingFangSC, PingFang SC;
  329. font-weight: 500;
  330. font-size: 24rpx;
  331. color: #222222;
  332. line-height: 34rpx;
  333. text-align: left;
  334. font-style: normal;
  335. }
  336. .deal {
  337. font-family: PingFangSC, PingFang SC;
  338. font-weight: 400;
  339. font-size: 20rpx;
  340. color: #666666;
  341. line-height: 28rpx;
  342. text-align: left;
  343. font-style: normal;
  344. }
  345. .tonext {
  346. width: 286rpx;
  347. height: 88rpx;
  348. background: #F83224;
  349. box-shadow: 0rpx 16rpx 40rpx -12rpx rgba(255, 21, 21, 0.5);
  350. border-radius: 44rpx;
  351. font-family: PingFangSC, PingFang SC;
  352. font-weight: 500;
  353. font-size: 32rpx;
  354. color: #FFFFFF;
  355. line-height: 88rpx;
  356. text-align: center;
  357. font-style: normal;
  358. }
  359. .next {
  360. width: 750rpx;
  361. height: 166rpx;
  362. background: #FFFFFF;
  363. position: fixed;
  364. bottom: 0;
  365. left: 0;
  366. padding: 12rpx 24rpx;
  367. box-sizing: border-box;
  368. }
  369. .wup {
  370. width: 704rpx;
  371. height: 220rpx;
  372. background: #FFFFFF;
  373. border-radius: 16rpx;
  374. margin-top: 20rpx;
  375. padding: 0rpx 20rpx;
  376. box-sizing: border-box;
  377. }
  378. .info {
  379. height: 100rpx;
  380. border-bottom: 2rpx solid rgba(151, 151, 151, 0.08);
  381. .wupin {
  382. font-family: PingFangSC, PingFang SC;
  383. font-weight: 400;
  384. font-size: 28rpx;
  385. color: #333333;
  386. line-height: 40rpx;
  387. text-align: left;
  388. font-style: normal;
  389. }
  390. .change {
  391. font-family: PingFangSC, PingFang SC;
  392. font-weight: 400;
  393. font-size: 28rpx;
  394. color: #666666;
  395. line-height: 40rpx;
  396. text-align: left;
  397. font-style: normal;
  398. }
  399. .mast {
  400. width: 62rpx;
  401. height: 30rpx;
  402. border-radius: 16rpx;
  403. border: 1rpx solid #F83224;
  404. font-family: PingFangSC, PingFang SC;
  405. font-weight: 400;
  406. font-size: 20rpx;
  407. color: #FF1515;
  408. line-height: 30rpx;
  409. text-align: center;
  410. font-style: normal;
  411. margin-left: 12rpx;
  412. }
  413. }
  414. .mon {
  415. font-family: HarmonyOS_Sans_Medium;
  416. font-size: 20rpx;
  417. color: #F83224;
  418. line-height: 26rpx;
  419. text-align: left;
  420. font-style: normal;
  421. }
  422. .bigtitle {
  423. font-family: PingFangSC, PingFang SC;
  424. font-weight: 600;
  425. font-size: 28rpx;
  426. color: #222222;
  427. line-height: 40rpx;
  428. text-align: left;
  429. font-style: normal;
  430. }
  431. .timeb {
  432. font-family: PingFangSC, PingFang SC;
  433. font-weight: 400;
  434. font-size: 22rpx;
  435. color: #666666;
  436. line-height: 32rpx;
  437. text-align: left;
  438. font-style: normal;
  439. }
  440. .timea {
  441. font-family: PingFangSC, PingFang SC;
  442. font-weight: 400;
  443. font-size: 22rpx;
  444. color: #555555;
  445. line-height: 32rpx;
  446. text-align: left;
  447. font-style: normal;
  448. }
  449. .pinb {
  450. width: 148rpx;
  451. height: 64rpx;
  452. background: #FF1515;
  453. border-radius: 42rpx;
  454. font-family: PingFangSC, PingFang SC;
  455. font-weight: 500;
  456. font-size: 28rpx;
  457. color: #FFFFFF;
  458. line-height: 64rpx;
  459. text-align: center;
  460. font-style: normal;
  461. }
  462. .label {
  463. margin-top: 20rpx;
  464. width: 702rpx;
  465. height: 288rpx;
  466. background: #FFFFFF;
  467. border-radius: 16rpx;
  468. padding: 32rpx 20rpx;
  469. box-sizing: border-box;
  470. .left {
  471. width: 144rpx;
  472. height: 144rpx;
  473. background: #F5F5F5;
  474. border-radius: 8rpx;
  475. .bourn {
  476. font-family: PingFangSC, PingFang SC;
  477. font-weight: 400;
  478. font-size: 20rpx;
  479. color: #222222;
  480. line-height: 28rpx;
  481. text-align: left;
  482. font-style: normal;
  483. }
  484. .addres {
  485. font-family: PingFangSC, PingFang SC;
  486. font-weight: 500;
  487. font-size: 28rpx;
  488. color: #222222;
  489. line-height: 40rpx;
  490. text-align: left;
  491. font-style: normal;
  492. }
  493. }
  494. }
  495. .flexc {
  496. display: flex;
  497. flex-direction: column;
  498. justify-content: center;
  499. align-items: center;
  500. }
  501. .hai {
  502. font-family: PingFangSC, PingFang SC;
  503. font-weight: 600;
  504. font-size: 32rpx;
  505. color: #222222;
  506. line-height: 44rpx;
  507. text-align: left;
  508. font-style: normal;
  509. margin-right: 10rpx;
  510. }
  511. .more {
  512. font-family: PingFangSC, PingFang SC;
  513. font-weight: 400;
  514. font-size: 24rpx;
  515. color: #F83224;
  516. line-height: 34rpx;
  517. text-align: left;
  518. font-style: normal;
  519. }
  520. .parcel {
  521. width: 702rpx;
  522. height: 260rpx;
  523. background: #FFFFFF;
  524. border-radius: 16rpx;
  525. margin-top: 20rpx;
  526. padding: 24rpx;
  527. box-sizing: border-box;
  528. .myparcel {
  529. font-family: PingFangSC, PingFang SC;
  530. font-weight: 600;
  531. font-size: 28rpx;
  532. color: #222222;
  533. line-height: 40rpx;
  534. text-align: left;
  535. font-style: normal;
  536. }
  537. .add {
  538. width: 240rpx;
  539. height: 48rpx;
  540. background: rgba(248, 50, 36, 0.06);
  541. border-radius: 24rpx;
  542. .addtext {
  543. font-family: PingFangSC, PingFang SC;
  544. font-weight: 600;
  545. font-size: 20rpx;
  546. color: #000000;
  547. line-height: 28rpx;
  548. text-align: left;
  549. font-style: normal;
  550. }
  551. }
  552. }
  553. .address {
  554. width: 702rpx;
  555. // height: 776rpx;
  556. background: #FFFFFF;
  557. border-radius: 20rpx;
  558. padding: 48rpx 24rpx 36rpx;
  559. box-sizing: border-box;
  560. margin-top: 38rpx;
  561. .bottom {
  562. padding: 0 76rpx;
  563. box-sizing: border-box;
  564. margin-top: 48rpx;
  565. .friend {
  566. font-family: PingFangSC, PingFang SC;
  567. font-weight: 400;
  568. font-size: 28rpx;
  569. color: #555555;
  570. line-height: 40rpx;
  571. text-align: left;
  572. font-style: normal;
  573. margin-left: 12rpx;
  574. }
  575. }
  576. .mail {
  577. width: 646rpx;
  578. height: 84rpx;
  579. background: #F83224;
  580. box-shadow: 0rpx 16rpx 40rpx -12rpx rgba(255, 21, 21, 0.5);
  581. border-radius: 44rpx;
  582. font-family: PingFangSC, PingFang SC;
  583. font-weight: 500;
  584. font-size: 32rpx;
  585. color: #FFFFFF;
  586. line-height: 84rpx;
  587. text-align: center;
  588. font-style: normal;
  589. }
  590. .left {
  591. height: 128rpx;
  592. .pople {
  593. font-family: PingFangSC, PingFang SC;
  594. font-weight: 500;
  595. font-size: 30rpx;
  596. color: #222222;
  597. line-height: 42rpx;
  598. text-align: left;
  599. font-style: normal;
  600. }
  601. .jiadd {
  602. font-family: PingFangSC, PingFang SC;
  603. font-weight: 400;
  604. font-size: 26rpx;
  605. color: #777777;
  606. line-height: 36rpx;
  607. text-align: left;
  608. font-style: normal;
  609. }
  610. .right {
  611. font-family: PingFangSC, PingFang SC;
  612. font-weight: 500;
  613. font-size: 26rpx;
  614. color: #222222;
  615. line-height: 36rpx;
  616. text-align: left;
  617. font-style: normal;
  618. margin-left: 18rpx;
  619. }
  620. }
  621. }
  622. ::v-deep .u-navbar__content.data-v-1194bf80 {
  623. background-color: rgba(0, 0, 0, 0) !important;
  624. }
  625. ::v-deep .u-status-bar.data-v-13f16680 {
  626. background-color: rgba(0, 0, 0, 0) !important;
  627. }
  628. ::v-deep .u-subsection--button.data-v-b14d3440 {
  629. /* padding: 6rpx 34rpx !important; */
  630. border-radius: 64rpx !important;
  631. }
  632. ::v-deep .u-subsection--button__bar.data-v-b14d3440 {
  633. border-radius: 32rpx !important;
  634. }
  635. </style>