delivery.vue 17 KB

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