delivery.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  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);" @click="transport">《{{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'
  138. @success='success' @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. transport() {
  186. uni.$u.http.get('/api/agreement?code=international_express_service').then((res) => {
  187. console.log(res);
  188. }).catch(() => {
  189. })
  190. },
  191. //跨境物流选择
  192. success(msg) {
  193. this.logshow = false
  194. this.leftname = msg.leftname
  195. this.container_id = msg.dateid
  196. this.rightname = msg.rightname
  197. this.unit_price = msg.unit_price
  198. },
  199. //改变地址
  200. changeadd() {
  201. var a = {}
  202. a = this.topadd
  203. this.topadd = this.bottomadd
  204. this.bottomadd = a
  205. this.province_id = this.bottomadd.province_id
  206. },
  207. //正则匹配手机号
  208. replacePhoneToStar: function(phone) {
  209. if (phone) {
  210. return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  211. }
  212. },
  213. //物流选择
  214. changewu() {
  215. if (this.province_id && this.goodinfo.goodname) {
  216. this.logshow = true
  217. setTimeout(() => {
  218. this.$refs.child.transport();
  219. }, 800)
  220. } else {
  221. this.$u.toast('请先选择城市和物品信息')
  222. }
  223. },
  224. //地址薄
  225. addbook(index) {
  226. var that = this
  227. uni.navigateTo({
  228. url: "/pageC/addressManagement/addressManagement?index=" + index,
  229. events: {
  230. getadd(res) {
  231. if (index == 0) {
  232. that.topadd = res
  233. console.log('topadd', that.topadd);
  234. } else {
  235. that.bottomadd = res
  236. console.log('bottom', that.bottomadd);
  237. that.province_id = that.bottomadd.province_id
  238. }
  239. }
  240. }
  241. })
  242. },
  243. //物品信息
  244. goods() {
  245. var that = this
  246. uni.navigateTo({
  247. url: '/pageB/goods',
  248. events: {
  249. goodinfo: function(res) {
  250. console.log(res);
  251. that.goodinfo = res
  252. }
  253. }
  254. })
  255. },
  256. close() {
  257. this.logshow = true
  258. },
  259. send() {
  260. uni.navigateTo({
  261. url: '/pageB/Senderinfor'
  262. })
  263. },
  264. recipe() {
  265. uni.navigateTo({
  266. url: '/pageB/recipientinfo'
  267. })
  268. },
  269. checkboxChange(n) {
  270. console.log('change', n);
  271. },
  272. next() {
  273. if (this.checkboxValue1.length == 0) {
  274. this.$u.toast('请勾选协议')
  275. } else if (JSON.stringify(this.goodinfo) === '{}') {
  276. this.$u.toast('请填写物品信息')
  277. } else if (this.leftname == '') {
  278. this.$u.toast('请选择物流方式')
  279. } else {
  280. uni.navigateTo({
  281. url: "/pageB/end?goodinfo=" + encodeURIComponent(JSON.stringify(this.goodinfo)) +
  282. "&topadd=" + encodeURIComponent(JSON.stringify(
  283. this.topadd)) + "&bottom=" + encodeURIComponent(JSON.stringify(this.bottomadd)) +
  284. '&leftname=' + this
  285. .leftname + "&rightname=" + this.rightname + "&container_id=" + this.container_id +
  286. "&unit_price=" + this.unit_price + '&all=' + this.all
  287. })
  288. }
  289. }
  290. }
  291. }
  292. </script>
  293. <style lang="scss" scoped>
  294. .topname {
  295. font-family: PingFangSC, PingFang SC;
  296. font-weight: 500;
  297. font-size: 30rpx;
  298. color: #222222;
  299. line-height: 42rpx;
  300. text-align: left;
  301. font-style: normal;
  302. }
  303. .topaddress {
  304. font-family: PingFangSC, PingFang SC;
  305. font-weight: 400;
  306. font-size: 26rpx;
  307. color: #777777;
  308. line-height: 36rpx;
  309. text-align: left;
  310. font-style: normal;
  311. }
  312. .pop {
  313. font-family: PingFangSC, PingFang SC;
  314. font-weight: 500;
  315. font-size: 36rpx;
  316. color: #333333;
  317. line-height: 50rpx;
  318. text-align: left;
  319. font-style: normal;
  320. padding: 32rpx 28rpx 0 0;
  321. box-sizing: border-box;
  322. }
  323. .sum {
  324. font-family: PingFangSC, PingFang SC;
  325. font-weight: 500;
  326. font-size: 24rpx;
  327. color: #222222;
  328. line-height: 34rpx;
  329. text-align: left;
  330. font-style: normal;
  331. }
  332. .deal {
  333. font-family: PingFangSC, PingFang SC;
  334. font-weight: 400;
  335. font-size: 20rpx;
  336. color: #666666;
  337. line-height: 28rpx;
  338. text-align: left;
  339. font-style: normal;
  340. }
  341. .tonext {
  342. width: 286rpx;
  343. height: 88rpx;
  344. background: #F83224;
  345. box-shadow: 0rpx 16rpx 40rpx -12rpx rgba(255, 21, 21, 0.5);
  346. border-radius: 44rpx;
  347. font-family: PingFangSC, PingFang SC;
  348. font-weight: 500;
  349. font-size: 32rpx;
  350. color: #FFFFFF;
  351. line-height: 88rpx;
  352. text-align: center;
  353. font-style: normal;
  354. }
  355. .next {
  356. width: 750rpx;
  357. height: 166rpx;
  358. background: #FFFFFF;
  359. position: fixed;
  360. bottom: 0;
  361. left: 0;
  362. padding: 12rpx 24rpx;
  363. box-sizing: border-box;
  364. }
  365. .wup {
  366. width: 704rpx;
  367. height: 220rpx;
  368. background: #FFFFFF;
  369. border-radius: 16rpx;
  370. margin-top: 20rpx;
  371. padding: 0rpx 20rpx;
  372. box-sizing: border-box;
  373. }
  374. .info {
  375. height: 100rpx;
  376. border-bottom: 2rpx solid rgba(151, 151, 151, 0.08);
  377. .wupin {
  378. font-family: PingFangSC, PingFang SC;
  379. font-weight: 400;
  380. font-size: 28rpx;
  381. color: #333333;
  382. line-height: 40rpx;
  383. text-align: left;
  384. font-style: normal;
  385. }
  386. .change {
  387. font-family: PingFangSC, PingFang SC;
  388. font-weight: 400;
  389. font-size: 28rpx;
  390. color: #666666;
  391. line-height: 40rpx;
  392. text-align: left;
  393. font-style: normal;
  394. }
  395. .mast {
  396. // width: 62rpx;
  397. height: 30rpx;
  398. border-radius: 16rpx;
  399. border: 1rpx solid #F83224;
  400. font-family: PingFangSC, PingFang SC;
  401. font-weight: 400;
  402. font-size: 20rpx;
  403. color: #FF1515;
  404. line-height: 30rpx;
  405. text-align: center;
  406. font-style: normal;
  407. margin-left: 12rpx;
  408. padding: 4rpx 10rpx;
  409. box-sizing: border-box;
  410. }
  411. }
  412. .mon {
  413. font-family: HarmonyOS_Sans_Medium;
  414. font-size: 20rpx;
  415. color: #F83224;
  416. line-height: 26rpx;
  417. text-align: left;
  418. font-style: normal;
  419. }
  420. .bigtitle {
  421. font-family: PingFangSC, PingFang SC;
  422. font-weight: 600;
  423. font-size: 28rpx;
  424. color: #222222;
  425. line-height: 40rpx;
  426. text-align: left;
  427. font-style: normal;
  428. }
  429. .timeb {
  430. font-family: PingFangSC, PingFang SC;
  431. font-weight: 400;
  432. font-size: 22rpx;
  433. color: #666666;
  434. line-height: 32rpx;
  435. text-align: left;
  436. font-style: normal;
  437. }
  438. .timea {
  439. font-family: PingFangSC, PingFang SC;
  440. font-weight: 400;
  441. font-size: 22rpx;
  442. color: #555555;
  443. line-height: 32rpx;
  444. text-align: left;
  445. font-style: normal;
  446. }
  447. .pinb {
  448. width: 148rpx;
  449. height: 64rpx;
  450. background: #FF1515;
  451. border-radius: 42rpx;
  452. font-family: PingFangSC, PingFang SC;
  453. font-weight: 500;
  454. font-size: 28rpx;
  455. color: #FFFFFF;
  456. line-height: 64rpx;
  457. text-align: center;
  458. font-style: normal;
  459. }
  460. .label {
  461. margin-top: 20rpx;
  462. width: 702rpx;
  463. height: 288rpx;
  464. background: #FFFFFF;
  465. border-radius: 16rpx;
  466. padding: 32rpx 20rpx;
  467. box-sizing: border-box;
  468. .left {
  469. width: 144rpx;
  470. height: 144rpx;
  471. background: #F5F5F5;
  472. border-radius: 8rpx;
  473. .bourn {
  474. font-family: PingFangSC, PingFang SC;
  475. font-weight: 400;
  476. font-size: 20rpx;
  477. color: #222222;
  478. line-height: 28rpx;
  479. text-align: left;
  480. font-style: normal;
  481. }
  482. .addres {
  483. font-family: PingFangSC, PingFang SC;
  484. font-weight: 500;
  485. font-size: 28rpx;
  486. color: #222222;
  487. line-height: 40rpx;
  488. text-align: left;
  489. font-style: normal;
  490. }
  491. }
  492. }
  493. .flexc {
  494. display: flex;
  495. flex-direction: column;
  496. justify-content: center;
  497. align-items: center;
  498. }
  499. .hai {
  500. font-family: PingFangSC, PingFang SC;
  501. font-weight: 600;
  502. font-size: 32rpx;
  503. color: #222222;
  504. line-height: 44rpx;
  505. text-align: left;
  506. font-style: normal;
  507. margin-right: 10rpx;
  508. }
  509. .more {
  510. font-family: PingFangSC, PingFang SC;
  511. font-weight: 400;
  512. font-size: 24rpx;
  513. color: #F83224;
  514. line-height: 34rpx;
  515. text-align: left;
  516. font-style: normal;
  517. }
  518. .parcel {
  519. width: 702rpx;
  520. height: 260rpx;
  521. background: #FFFFFF;
  522. border-radius: 16rpx;
  523. margin-top: 20rpx;
  524. padding: 24rpx;
  525. box-sizing: border-box;
  526. .myparcel {
  527. font-family: PingFangSC, PingFang SC;
  528. font-weight: 600;
  529. font-size: 28rpx;
  530. color: #222222;
  531. line-height: 40rpx;
  532. text-align: left;
  533. font-style: normal;
  534. }
  535. .add {
  536. width: 240rpx;
  537. height: 48rpx;
  538. background: rgba(248, 50, 36, 0.06);
  539. border-radius: 24rpx;
  540. .addtext {
  541. font-family: PingFangSC, PingFang SC;
  542. font-weight: 600;
  543. font-size: 20rpx;
  544. color: #000000;
  545. line-height: 28rpx;
  546. text-align: left;
  547. font-style: normal;
  548. }
  549. }
  550. }
  551. .address {
  552. width: 702rpx;
  553. // height: 776rpx;
  554. background: #FFFFFF;
  555. border-radius: 20rpx;
  556. padding: 48rpx 24rpx 36rpx;
  557. box-sizing: border-box;
  558. margin-top: 38rpx;
  559. .bottom {
  560. padding: 0 76rpx;
  561. box-sizing: border-box;
  562. margin-top: 48rpx;
  563. .friend {
  564. font-family: PingFangSC, PingFang SC;
  565. font-weight: 400;
  566. font-size: 28rpx;
  567. color: #555555;
  568. line-height: 40rpx;
  569. text-align: left;
  570. font-style: normal;
  571. margin-left: 12rpx;
  572. }
  573. }
  574. .mail {
  575. width: 646rpx;
  576. height: 84rpx;
  577. background: #F83224;
  578. box-shadow: 0rpx 16rpx 40rpx -12rpx rgba(255, 21, 21, 0.5);
  579. border-radius: 44rpx;
  580. font-family: PingFangSC, PingFang SC;
  581. font-weight: 500;
  582. font-size: 32rpx;
  583. color: #FFFFFF;
  584. line-height: 84rpx;
  585. text-align: center;
  586. font-style: normal;
  587. }
  588. .left {
  589. height: 128rpx;
  590. .pople {
  591. font-family: PingFangSC, PingFang SC;
  592. font-weight: 500;
  593. font-size: 30rpx;
  594. color: #222222;
  595. line-height: 42rpx;
  596. text-align: left;
  597. font-style: normal;
  598. }
  599. .jiadd {
  600. font-family: PingFangSC, PingFang SC;
  601. font-weight: 400;
  602. font-size: 26rpx;
  603. color: #777777;
  604. line-height: 36rpx;
  605. text-align: left;
  606. font-style: normal;
  607. }
  608. .right {
  609. font-family: PingFangSC, PingFang SC;
  610. font-weight: 500;
  611. font-size: 26rpx;
  612. color: #222222;
  613. line-height: 36rpx;
  614. text-align: left;
  615. font-style: normal;
  616. margin-left: 18rpx;
  617. }
  618. }
  619. }
  620. ::v-deep .u-navbar__content.data-v-1194bf80 {
  621. background-color: rgba(0, 0, 0, 0) !important;
  622. }
  623. ::v-deep .u-status-bar.data-v-13f16680 {
  624. background-color: rgba(0, 0, 0, 0) !important;
  625. }
  626. ::v-deep .u-subsection--button.data-v-b14d3440 {
  627. /* padding: 6rpx 34rpx !important; */
  628. border-radius: 64rpx !important;
  629. }
  630. ::v-deep .u-subsection--button__bar.data-v-b14d3440 {
  631. border-radius: 32rpx !important;
  632. }
  633. </style>