order.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. <template>
  2. <view class="back">
  3. <!-- 地址 -->
  4. <view class="address" @click="toadd">
  5. <view class="u-flex u-row-between">
  6. <view class="add" v-if="addinfo">{{ addinfo.full_address }}</view>
  7. <view class="" v-else>{{ i18n.shippingaddress }}</view>
  8. <u-icon name="arrow-right" size="16"></u-icon>
  9. </view>
  10. <view class="info" v-if="addinfo">
  11. <text>{{ addinfo.name }}</text>
  12. <text style="margin-left: 20rpx">{{
  13. replacePhoneToStar(addinfo.mobile)
  14. }}</text>
  15. </view>
  16. </view>
  17. <!-- 商品 -->
  18. <view class="shop">
  19. <view class="" v-if="typea == 'shop'">
  20. <view
  21. class="u-flex"
  22. style="margin-top: 32rpx"
  23. v-for="(item, idx) in selelist"
  24. :key="idx"
  25. >
  26. <image
  27. :src="item.image"
  28. style="width: 184rpx; height: 184rpx"
  29. mode=""
  30. ></image>
  31. <view
  32. class=" "
  33. style="
  34. margin-left: 20rpx;
  35. flex-direction: column;
  36. justify-content: space-between;
  37. height: 184rpx;
  38. display: flex;
  39. flex: 1;
  40. "
  41. >
  42. <view class="">
  43. <text class="toptitle" v-if="language == 'zh-CN'">{{
  44. item.name_cn
  45. }}</text>
  46. <text class="toptitle" v-if="language == 'en-US'">{{
  47. item.name_en
  48. }}</text>
  49. <text class="toptitle" v-if="language == 'es-ES'">{{
  50. item.name_es
  51. }}</text>
  52. <text class="toptitle" v-if="language == 'it-IT'">{{
  53. item.name_ita
  54. }}</text>
  55. <view class="weight">{{ item.sku_item[0].item }} </view>
  56. </view>
  57. <view class="u-flex u-row-between">
  58. <view class="">
  59. <text class="money">¥</text>
  60. <text class="money" style="font-size: 34rpx">{{
  61. item.sku_item[0].discount_price
  62. }}</text>
  63. </view>
  64. <view class=""> x {{ item.cart.goods_num }}</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="" v-else>
  70. <view class="">
  71. <image
  72. :src="goodinfo.merchant.image"
  73. style="width: 38rpx; height: 38rpx"
  74. mode=""
  75. ></image>
  76. <text class="name">{{ goodinfo.merchant.merchant_name }}</text>
  77. </view>
  78. <view class="u-flex" style="margin-top: 32rpx">
  79. <image
  80. :src="sku_info.image"
  81. style="width: 184rpx; height: 184rpx"
  82. mode=""
  83. ></image>
  84. <view
  85. class=" "
  86. style="
  87. margin-left: 20rpx;
  88. flex-direction: column;
  89. justify-content: space-between;
  90. height: 184rpx;
  91. display: flex;
  92. flex: 1;
  93. "
  94. >
  95. <view class="">
  96. <text class="toptitle" v-if="language == 'zh-CN'">{{
  97. goodinfo.name_cn
  98. }}</text>
  99. <text class="toptitle" v-if="language == 'en-US'">{{
  100. goodinfo.name_en
  101. }}</text>
  102. <text class="toptitle" v-if="language == 'es-ES'">{{
  103. goodinfo.name_es
  104. }}</text>
  105. <text class="toptitle" v-if="language == 'it-IT'">{{
  106. goodinfo.name_ita
  107. }}</text>
  108. <view class="weight">{{ sku_info.item }} </view>
  109. <!-- <view class="">{{Number(sku_info.weight)*value}}kg</view> -->
  110. </view>
  111. <view class="u-flex u-row-between">
  112. <view class="">
  113. <text class="money">¥</text>
  114. <text class="money" style="font-size: 34rpx">{{
  115. goodinfo.is_discount == 1
  116. ? (Number(sku_info.price * 1000) * Number(value * 1000)) /
  117. 1000000
  118. : (Number(sku_info.discount_price * 1000) *
  119. Number(value) *
  120. 1000) /
  121. 1000000
  122. }}</text>
  123. </view>
  124. <u-number-box @change="valChange" v-model="value">
  125. <view slot="minus" class="">
  126. <u-icon name="minus" size="12"></u-icon>
  127. </view>
  128. <input
  129. slot="input"
  130. v-model="value"
  131. style="width: 40px; text-align: center"
  132. class="input"
  133. />
  134. <view slot="plus" class="">
  135. <u-icon name="plus" size="12"></u-icon>
  136. </view>
  137. </u-number-box>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. <!-- 物流 -->
  144. <view class="logistics u-flex u-row-between">
  145. <text style="font-weight: 600; width: 320rpx">{{ i18n.flow }}</text>
  146. <view class="u-flex" @click="changwu">
  147. <text class="change">{{
  148. containname1 ? type1 + " | " + containname1 : i18n.selection
  149. }}</text>
  150. <u-icon name="arrow-right" size="16"></u-icon>
  151. </view>
  152. </view>
  153. <!-- 推荐 -->
  154. <view class="recommend">
  155. <view class="top">
  156. <image
  157. v-if="language == 'zh-CN'"
  158. src="static/images/recommend.png"
  159. style="width: 124rpx; height: 30rpx"
  160. mode=""
  161. ></image>
  162. <image
  163. v-if="language == 'en-US'"
  164. src="static/images/recommend1.png"
  165. style="width: 200rpx; height: 30rpx"
  166. mode=""
  167. >
  168. </image>
  169. <image
  170. v-if="language == 'es-ES'"
  171. src="static/images/recommend2.png"
  172. style="width: 200rpx; height: 30rpx"
  173. mode=""
  174. >
  175. </image>
  176. <image
  177. v-if="language == 'it-IT'"
  178. src="static/images/recommend3.png"
  179. style="width: 200rpx; height: 30rpx"
  180. mode=""
  181. >
  182. </image>
  183. </view>
  184. <view class="bottom">
  185. <scroll-view
  186. scroll-x
  187. class="u-flex"
  188. style="column: gap 28rpx; display: flex"
  189. >
  190. <view class="u-flex" style="column-gap: 16rpx">
  191. <view
  192. class=""
  193. v-for="(item, idx) in swiptlist"
  194. :key="idx"
  195. @click="todetail(item.id)"
  196. >
  197. <image
  198. :src="item.image"
  199. style="width: 156rpx; height: 156rpx"
  200. mode=""
  201. >
  202. </image>
  203. <view class="title" v-if="language == 'zh-CN'">
  204. {{ item.name_cn }}
  205. </view>
  206. <view class="title" v-if="language == 'en-US'">
  207. {{ item.name_en }}
  208. </view>
  209. <view class="title" v-if="language == 'es-ES'">
  210. {{ item.name_es }}
  211. </view>
  212. <view class="title" v-if="language == 'it-IT'">
  213. {{ item.name_ita }}
  214. </view>
  215. <view class="money" style="color: #f83224; font-size: 20rpx">
  216. <text>¥</text>
  217. <text style="font-size: 28rpx">{{
  218. item.is_discount == 0
  219. ? item.discount_price.slice(0, -3)
  220. : item.price.slice(0, -3)
  221. }}</text>
  222. <text>{{
  223. item.is_discount == 0
  224. ? item.discount_price.slice(-3)
  225. : item.price.slice(-3)
  226. }}</text>
  227. </view>
  228. </view>
  229. </view>
  230. </scroll-view>
  231. </view>
  232. </view>
  233. <!-- 商品相关 -->
  234. <view class="abount" style="margin-top: 20rpx">
  235. <view class="u-flex u-row-between" style="margin-bottom: 40rpx">
  236. <view class="name">{{ i18n.Commodityamount }}</view>
  237. <view class="" v-if="typea == 'shop'">{{ goodsPrice }}</view>
  238. <view class="money" v-else>
  239. ¥{{
  240. goodinfo.is_discount == 1
  241. ? (Number(sku_info.price * 100) * Number(value * 100)) / 10000
  242. : (Number(sku_info.discount_price * 100) * Number(value * 100)) /
  243. 10000
  244. }}
  245. </view>
  246. </view>
  247. <view class="u-flex u-row-between" v-show="containname1">
  248. <view class="name">{{ i18n.Grosscommodityweight }}</view>
  249. <!-- <view class="money" v-if="typea=='shop'">{{
  250. goodsWeight
  251. }}kg</view> -->
  252. <!-- <view class="money" v-else>{{Number(sku_info.weight)*value}}kg</view> -->
  253. <view class="money">{{ weight_total }}</view>
  254. </view>
  255. <view class="back u-flex" v-if="containname1">
  256. <image
  257. src="static/images/warning.png"
  258. style="width: 32rpx; height: 32rpx"
  259. mode=""
  260. ></image>
  261. <text style="margin-left: 12rpx; font-size: 24rpx"
  262. >{{ i18n.buy }}{{ recommend_weight }}kg{{ i18n.price }}¥{{
  263. unit_fee
  264. }},{{ i18n.morefavorable }}</text
  265. >
  266. </view>
  267. <view
  268. class="u-flex u-row-between"
  269. style="margin-bottom: 40rpx; margin-top: 20rpx"
  270. >
  271. <view class="name">{{ i18n.Costperkilogram }}</view>
  272. <view class="money">{{
  273. containname1 ? unit_price : i18n.shippingmethod
  274. }}</view>
  275. </view>
  276. <view class="u-flex u-row-between">
  277. <view class="name">{{ i18n.freight }}</view>
  278. <view class="money">{{
  279. containname1 ? sum : i18n.shippingmethod
  280. }}</view>
  281. </view>
  282. <view class="zong u-flex u-row-right">
  283. <view class="">
  284. <text class="small">{{ i18n.subtotal }}</text>
  285. <text class="mon">¥</text>
  286. <text class="mon" v-if="typea == 'shop'">{{ goodsPrice }}</text>
  287. <text class="mon" v-else style="font-size: 40rpx">{{
  288. goodinfo.is_discount == 1
  289. ? (Number(sku_info.price * 100) * Number(value * 100)) / 10000
  290. : (Number(sku_info.discount_price * 100) * Number(value * 100)) /
  291. 10000
  292. }}</text>
  293. </view>
  294. </view>
  295. </view>
  296. <view class="" style="height: 166rpx"></view>
  297. <view class="btn u-flex u-row-right">
  298. <view class="u-flex">
  299. <!-- <text v-if="typea == 'shop'">{{i18n.Atotalof}}{{goodsWeight}}kg,</text>
  300. <text v-else class="kg">{{i18n.Atotalof}}{{Number(sku_info.weight) * value}}kg,</text> -->
  301. <text class="kg" v-show="containname1"
  302. >{{ i18n.Atotalof }}{{ weight_total }}kg,</text
  303. >
  304. <text>{{ i18n.total }}:</text>
  305. <text class="money" style="font-size: 28rpx">¥</text>
  306. <text style="font-weight: bold" class="money" v-if="typea == 'shop'">{{
  307. Number(sum * 10000 + Number(goodsPrice) * 10000) / 10000
  308. }}</text>
  309. <view class="" v-else>
  310. <text
  311. class="money"
  312. v-if="goodinfo.is_discount == 1"
  313. style="font-weight: bold"
  314. >{{
  315. Number(
  316. sum * 10000 + Number(sku_info.price) * Number(value) * 10000
  317. ) / 10000
  318. }}</text
  319. >
  320. <text
  321. class="money"
  322. v-if="goodinfo.is_discount == 0"
  323. style="font-weight: bold"
  324. >{{
  325. Number(
  326. sum * 10000 +
  327. Number(sku_info.discount_price) * Number(value) * 10000
  328. ) / 10000
  329. }}</text
  330. >
  331. </view>
  332. </view>
  333. <view class="order" @click="topay">
  334. {{ i18n.Submitorder }}
  335. </view>
  336. </view>
  337. <!-- 跨境物流 -->
  338. <u-popup
  339. :show="show"
  340. @close="close"
  341. mode="bottom"
  342. closeIconPos="top-right"
  343. round="28"
  344. >
  345. <view style="padding: 40rpx 28rpx; box-sizing: border-box">
  346. <view class="u-flex u-row-between">
  347. <view class="" style="width: 28px; height: 28px"></view>
  348. <view class="poptitle">
  349. {{ i18n.flow }}
  350. </view>
  351. <u-icon
  352. name="close"
  353. @click="close"
  354. color="background: #333333;"
  355. size="28"
  356. ></u-icon>
  357. </view>
  358. <view
  359. class="u-flex"
  360. style="margin-top: 60rpx; flex-wrap: wrap; column-gap: 16rpx"
  361. >
  362. <view
  363. :class="index == idx ? 'active' : 'unactive'"
  364. v-for="(item, idx) in containerList"
  365. @click="change(item, idx)"
  366. style="
  367. display: flex;
  368. flex-direction: column;
  369. align-items: center;
  370. justify-content: center;
  371. margin-bottom: 28rpx;
  372. position: relative;
  373. "
  374. >
  375. <image
  376. v-if="index == idx"
  377. src="static/images/change.png"
  378. style="
  379. width: 36rpx;
  380. height: 32rpx;
  381. position: absolute;
  382. top: 0;
  383. right: 0;
  384. "
  385. mode=""
  386. ></image>
  387. <view class="logname" v-if="language == 'zh-CN'">{{
  388. item.name_cn
  389. }}</view>
  390. <view class="logname" v-if="language == 'en-US'">{{
  391. item.name_en
  392. }}</view>
  393. <view class="logname" v-if="language == 'es-ES'">{{
  394. item.name_es
  395. }}</view>
  396. <view class="logname" v-if="language == 'it-IT'">{{
  397. item.name_ita
  398. }}</view>
  399. <!-- <view class="wei">¥{{goodinfo.cate==0?item.normal_delivery_fee:item.special_delivery_fee}}/kg</view> -->
  400. <view class="wei" style="font-size: 32rpx; font-weight: 600"
  401. >¥{{ item.unit_price }}/kg</view
  402. >
  403. </view>
  404. </view>
  405. <view class="nextto" @click="next">{{ i18n.next }}</view>
  406. </view>
  407. </u-popup>
  408. <!-- 跨境物流下一步 -->
  409. <u-popup
  410. :safeAreaInsetTop="true"
  411. :show="show1"
  412. @close="close"
  413. mode="bottom"
  414. closeIconPos="top-right"
  415. round="28"
  416. bgColor="#F4F4F4"
  417. >
  418. <view
  419. style="padding: 40rpx 28rpx; box-sizing: border-box; position: relative"
  420. >
  421. <view class="u-flex u-row-between">
  422. <view class="" style="width: 28px; height: 28px"></view>
  423. <view class="poptitle">
  424. {{ i18n.flow }}
  425. </view>
  426. <u-icon
  427. name="close"
  428. @click="close"
  429. color="background: #333333;"
  430. size="28"
  431. ></u-icon>
  432. </view>
  433. <scroll-view :scroll-y="true" style="500rpx">
  434. <view
  435. class="transport"
  436. style="margin-top: 32rpx"
  437. @click="activea(item, idx)"
  438. v-for="(item, idx) in containlist"
  439. v-if="item.sum != 0"
  440. >
  441. <view class="u-flex u-row-between">
  442. <text class="yundate"
  443. >{{ i18n.Shipmentdate }} {{ item.end_date }}</text
  444. >
  445. <image
  446. v-if="datechan == idx"
  447. src="/pageA/static/images/active.png"
  448. style="width: 36rpx; height: 36rpx"
  449. mode=""
  450. ></image>
  451. <image
  452. v-else
  453. src="/pageA/static/images/unactive.png"
  454. style="width: 36rpx; height: 36rpx"
  455. mode=""
  456. ></image>
  457. </view>
  458. <view class="u-flex u-row-between" style="margin-top: 28rpx">
  459. <view class="chest">
  460. <text v-if="language == 'zh-CN'">{{ item.name_cn }}</text>
  461. <text v-if="language == 'en-US'">{{ item.name_en }}</text>
  462. <text v-if="language == 'es-ES'">{{ item.name_es }}</text>
  463. <text v-if="language == 'it-IT'">{{ item.name_ita }}</text>
  464. <text style="margin: 0 16rpx">|</text>
  465. <text
  466. >{{ i18n.Estimatedtimeofarrival }}{{ item.transport_days
  467. }}{{ i18n.Workingday }}</text
  468. >
  469. </view>
  470. <view class="mone">
  471. <text>¥</text>
  472. <text style="font-size: 48rpx; font-weight: 600">{{
  473. item.sum
  474. }}</text>
  475. </view>
  476. </view>
  477. </view>
  478. </scroll-view>
  479. <view class="" style="height: 166rpx"></view>
  480. <view class="enbottom u-flex u-row-between">
  481. <view class="cancel" @click="close">{{ i18n.Cancel }}</view>
  482. <view class="confirm" @click="confirm">{{ i18n.enter }}</view>
  483. </view>
  484. </view>
  485. </u-popup>
  486. </view>
  487. </template>
  488. <script>
  489. export default {
  490. data() {
  491. return {
  492. value: 1,
  493. show: false,
  494. index: "",
  495. show1: false,
  496. datechan: "",
  497. sku_info: {},
  498. goodinfo: {},
  499. swiptlist: [], //推荐列表
  500. language: "zh-CN",
  501. containerList: [], //列表
  502. province_id: "",
  503. transport_type_id: "",
  504. containlist: [],
  505. containid: "", //货柜id
  506. containname: "", //货柜名称
  507. type: "", //货运方式名称
  508. containname1: "",
  509. type1: "",
  510. sum: "",
  511. unit_price: "",
  512. recommend_weight: "",
  513. sum1: "",
  514. unit_price1: "",
  515. recommend_weight1: "",
  516. max_weight: "",
  517. min_weight: "",
  518. unit_fee: "",
  519. addinfo: "",
  520. huoid: "",
  521. selelist: [],
  522. typea: "",
  523. goodsPrice: "",
  524. goodsWeight: "",
  525. stringcheck: "",
  526. cartid: "",
  527. weight_total: "",
  528. valuenum: false,
  529. };
  530. },
  531. computed: {
  532. i18n() {
  533. return this.$t("index");
  534. },
  535. },
  536. onLoad(options) {
  537. // url: '/pageA/order?sku=' + this.sku_info + '&value=' + this.value+'&goodinfo='+this.goodinfo
  538. if (options.typea) {
  539. console.log(22222);
  540. this.typea = options.typea;
  541. this.selelist = JSON.parse(decodeURIComponent(options.selelist));
  542. this.goodsPrice = options.goodsPrice;
  543. this.goodsWeight = options.goodsWeight;
  544. this.stringcheck = options.stringcheck;
  545. this.cartid = options.cartid;
  546. } else if (options) {
  547. this.value = options.value;
  548. this.sku_info = JSON.parse(decodeURIComponent(options.sku));
  549. this.goodinfo = JSON.parse(decodeURIComponent(options.goodinfo));
  550. if (options.share_merchant_id) {
  551. this.share_merchant_id = options.share_merchant_id;
  552. }
  553. }
  554. },
  555. onShow() {
  556. if (uni.getStorageSync("language") != "") {
  557. this.language = uni.getStorageSync("language");
  558. }
  559. this.recommend();
  560. // this.container()
  561. },
  562. methods: {
  563. changwu() {
  564. if (this.addinfo) {
  565. this.show = true;
  566. } else {
  567. this.$u.toast(this.i18n.shippingaddress);
  568. }
  569. },
  570. valChange() {
  571. this.valuenum = true;
  572. },
  573. todetail(id) {
  574. uni.navigateTo({
  575. url: "/pageA/productdetails?id=" + id,
  576. });
  577. },
  578. //正则匹配手机号
  579. replacePhoneToStar: function (phone) {
  580. if (phone) {
  581. return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
  582. }
  583. },
  584. //推荐重量
  585. recommendweight() {
  586. uni.$u.http
  587. .get("/api/express-order/recommend-container", {
  588. params: {
  589. container_id: this.containid,
  590. type: this.goodinfo.cate == 0 ? "normal" : "special",
  591. },
  592. })
  593. .then((res) => {
  594. console.log(res);
  595. this.max_weight = res.max_weight;
  596. this.min_weight = res.min_weight;
  597. this.unit_fee = res.unit_fee;
  598. })
  599. .catch(() => {});
  600. },
  601. //货运类型列表
  602. transport() {
  603. uni.$u.http
  604. .get("/api/transport-type", {
  605. params: {
  606. province_id: this.province_id,
  607. },
  608. })
  609. .then((res) => {
  610. this.containerList = res;
  611. this.transport_type_id = res[0].id;
  612. if (this.language == "zh-CN") {
  613. this.type = res[0].name_cn;
  614. }
  615. if (this.language == "en-US") {
  616. this.type = res[0].name_en;
  617. }
  618. if (this.language == "es-ES") {
  619. this.type = res[0].name_es;
  620. }
  621. if (this.language == "it-IT") {
  622. this.type = res[0].name_ita;
  623. }
  624. })
  625. .catch(() => {});
  626. },
  627. //跳转到填写地址
  628. toadd() {
  629. var that = this;
  630. uni.navigateTo({
  631. url: "/pageC/addressManagement/addressManagement?tabs=" + Number(0),
  632. events: {
  633. getadd(res) {
  634. that.addinfo = res;
  635. that.province_id = res.province_id;
  636. that.transport();
  637. },
  638. },
  639. });
  640. },
  641. //货柜列表
  642. container() {
  643. this.containlist = [];
  644. uni.$u.http
  645. .get("/api/container-base", {
  646. params: {
  647. is_page: 0,
  648. province_id: this.province_id,
  649. transport_type_id: this.transport_type_id,
  650. weight:
  651. this.typea == "shop"
  652. ? ""
  653. : Number(this.sku_info.weight) * this.value,
  654. type:
  655. this.typea == "shop"
  656. ? ""
  657. : this.goodinfo.cate == 0
  658. ? "normal"
  659. : "special",
  660. length:
  661. this.typea == "shop"
  662. ? ""
  663. : Number(this.sku_info.length) * this.value, // 是 String 长
  664. width: this.sku_info.width, // 是 String 宽
  665. height: this.sku_info.height, // 是 String 高
  666. cart_id: this.cartid,
  667. // cart_id: '147,148'
  668. },
  669. })
  670. .then((res) => {
  671. res.forEach((item) => {
  672. if (item.sum != 0) {
  673. this.containlist.push(item);
  674. }
  675. console.log(this.containlist);
  676. });
  677. if (this.cartid.length == 0 && this.typea == "shop") {
  678. console.log("his.cartid.length", this.cartid.length);
  679. this.sum = 0;
  680. }
  681. // this.sum = this.containlist[0].sum
  682. // this.unit_price = this.containlist[0].unit_price
  683. if (this.goodinfo.is_shipping == 0) {
  684. this.sum = 0;
  685. } else {
  686. this.sum = this.containlist[0].sum;
  687. }
  688. if (this.goodinfo.is_shipping == 0) {
  689. this.unit_price = 0;
  690. } else {
  691. this.unit_price = this.containlist[0].unit_price;
  692. }
  693. this.recommend_weight = this.containlist[0].recommend_weight;
  694. this.weight_total = this.containlist[0].weight_total;
  695. this.containid = this.containlist[0].id;
  696. if (this.language == "zh-CN") {
  697. this.containname = this.containlist[0].name_cn;
  698. }
  699. if (this.language == "en-US") {
  700. this.containname = this.containlist[0].name_en;
  701. }
  702. if (this.language == "es-ES") {
  703. this.containname = this.containlist[0].name_es;
  704. }
  705. if (this.language == "it-IT") {
  706. this.containname = this.containlist[0].name_ita;
  707. }
  708. })
  709. .catch(() => {});
  710. },
  711. //运费满减
  712. config() {
  713. var that = this;
  714. uni.$u.http
  715. .get("/api/config", {
  716. params: {
  717. module: "free_shipping",
  718. },
  719. })
  720. .then((res) => {
  721. if (
  722. Number(that.goodsPrice) > res.free_shipping &&
  723. that.typea == "shop"
  724. ) {
  725. console.log("goodsPrice", that.goodsPrice);
  726. console.log("res.free_shipping", res.free_shipping);
  727. that.sum = 0;
  728. that.unit_price = 0;
  729. }
  730. let goodsum = "";
  731. if (that.goodinfo.is_discount == 1) {
  732. goodsum =
  733. (Number(that.sku_info.price * 100) * Number(that.value * 100)) /
  734. 10000;
  735. console.log("that.sum", that.sum);
  736. console.log("that.goodsum", goodsum);
  737. if (goodsum > res.free_shipping) {
  738. that.sum = 0;
  739. that.unit_price = 0;
  740. }
  741. } else {
  742. goodsum =
  743. (Number(that.sku_info.discount_price * 100) *
  744. Number(that.value * 100)) /
  745. 10000;
  746. if (goodsum > res.free_shipping) {
  747. that.sum = 0;
  748. that.unit_price = 0;
  749. }
  750. }
  751. })
  752. .catch(() => {});
  753. },
  754. //商品推荐
  755. recommend() {
  756. uni.$u.http
  757. .post("/api/goods/recommend", {
  758. keyword: "",
  759. })
  760. .then((res) => {
  761. this.swiptlist = res;
  762. })
  763. .catch(() => {});
  764. },
  765. change(item, index) {
  766. this.transport_type_id = item.id;
  767. this.index = index;
  768. if (this.language == "zh-CN") {
  769. this.type = item.name_cn;
  770. }
  771. if (this.language == "en-US") {
  772. this.type = item.name_en;
  773. }
  774. if (this.language == "es-ES") {
  775. this.type = item.name_es;
  776. }
  777. if (this.language == "it-IT") {
  778. this.type = item.name_ita;
  779. }
  780. },
  781. next() {
  782. this.show = false;
  783. this.show1 = true;
  784. this.type1 = this.type;
  785. this.container();
  786. },
  787. activea(item, idx) {
  788. this.datechan = idx;
  789. this.sum = item.sum;
  790. this.unit_price = item.unit_price;
  791. this.recommend_weight = item.recommend_weight;
  792. this.containid = item.id;
  793. this.weight_total = item.weight_total;
  794. if (this.language == "zh-CN") {
  795. this.containname = item.name_cn;
  796. }
  797. if (this.language == "en-US") {
  798. this.containname = item.name_en;
  799. }
  800. if (this.language == "es-ES") {
  801. this.containname = item.name_es;
  802. }
  803. if (this.language == "it-IT") {
  804. this.containname = item.name_ita;
  805. }
  806. },
  807. //确定
  808. confirm() {
  809. this.valuenum = false;
  810. this.show1 = false;
  811. this.containname1 = this.containname;
  812. this.recommendweight();
  813. this.config();
  814. },
  815. // 取消
  816. close() {
  817. this.show = false;
  818. this.show1 = false;
  819. },
  820. //提交订单
  821. topay() {
  822. if (this.valuenum) {
  823. this.$u.toast(this.i18n.newcontainer);
  824. } else {
  825. uni.$u.http
  826. .post("/api/order", {
  827. address_id: this.addinfo.id, //3 是 String 地址ID
  828. goods_id: this.goodinfo.id, //65 是 String 商品id
  829. goods_num: this.value, //2 是 String 商品数量
  830. sku_item_id: this.sku_info.id, //60 是 String 规格id
  831. cart_ids: this.stringcheck, //8,9 是 String 购物车id
  832. remark: "", //备注 是 String 备注
  833. merchant_goods_id: this.goodinfo.merchant_goods_id || "", //39 是 String 团长商品id
  834. container_id: this.containid, //1 是 String 货柜id
  835. share_member_id: this.share_merchant_id, // 是 String 分享团长id 分享商品的时候传
  836. belong: this.goodinfo.source || "", //0 是 String 商品归属 0团长 1平台自营 2团长发布或者分享的平台自营商品、供应链商品
  837. })
  838. .then((res) => {
  839. console.log("share_merchant_id", this.share_merchant_id);
  840. console.log(res);
  841. uni.navigateTo({
  842. // url: '/pageA/payorder?sum=' + (Number(this.sum*10000+ Number(this.sku_info.discount_price)*Number(this.value)*10000))/10000 +'&orderid=' + res.id
  843. url: "/pageA/payorder?orderid=" + res.id + "&sum=" + res.amount,
  844. });
  845. })
  846. .catch(() => {});
  847. }
  848. },
  849. },
  850. };
  851. </script>
  852. <style lang="scss" scoped>
  853. .toptitle {
  854. font-family: PingFangSC, PingFang SC;
  855. font-weight: 400;
  856. // font-size: 22rpx;
  857. color: #222222;
  858. line-height: 32rpx;
  859. text-align: left;
  860. font-style: normal;
  861. // width: 148rpx;
  862. width: 100%;
  863. overflow: hidden;
  864. text-overflow: ellipsis;
  865. -webkit-line-clamp: 1;
  866. display: -webkit-box;
  867. -webkit-box-orient: vertical;
  868. word-break: break-all;
  869. }
  870. ::v-deep .u-status-bar {
  871. height: 0 !important;
  872. }
  873. .confirm {
  874. width: 398rpx;
  875. height: 84rpx;
  876. background: #f83224;
  877. border-radius: 42rpx;
  878. text-align: center;
  879. font-family: PingFangSC, PingFang SC;
  880. font-weight: 500;
  881. font-size: 32rpx;
  882. color: #ffffff;
  883. line-height: 84rpx;
  884. text-align: center;
  885. font-style: normal;
  886. }
  887. .cancel {
  888. width: 280rpx;
  889. height: 84rpx;
  890. border-radius: 42rpx;
  891. border: 2rpx solid rgba(151, 151, 151, 0.3);
  892. font-family: PingFangSC, PingFang SC;
  893. font-weight: 400;
  894. font-size: 32rpx;
  895. color: #444444;
  896. line-height: 84rpx;
  897. text-align: center;
  898. font-style: normal;
  899. }
  900. .enbottom {
  901. width: 750rpx;
  902. height: 166rpx;
  903. background: #ffffff;
  904. position: absolute;
  905. left: 0rpx;
  906. bottom: 0;
  907. padding: 0 24rpx;
  908. box-sizing: border-box;
  909. }
  910. .mone {
  911. font-family: JDZhengHT, JDZhengHT;
  912. font-weight: 400;
  913. font-size: 26rpx;
  914. color: #f83224;
  915. line-height: 32rpx;
  916. text-align: left;
  917. font-style: normal;
  918. }
  919. .yundate {
  920. font-family: PingFangSC, PingFang SC;
  921. font-weight: 550;
  922. font-size: 32rpx;
  923. color: #333333;
  924. line-height: 44rpx;
  925. text-align: left;
  926. font-style: normal;
  927. }
  928. .chest {
  929. font-family: SFPro, SFPro;
  930. font-weight: 400;
  931. font-size: 24rpx;
  932. color: #555555;
  933. line-height: 28rpx;
  934. text-align: left;
  935. font-style: normal;
  936. }
  937. .act {
  938. width: 702rpx;
  939. height: 164rpx;
  940. background: #ffffff;
  941. border-radius: 12rpx;
  942. padding: 24rpx 20rpx;
  943. box-sizing: border-box;
  944. border: 1rpx solid #f83224;
  945. }
  946. .transport {
  947. width: 702rpx;
  948. height: 164rpx;
  949. background: #ffffff;
  950. border-radius: 12rpx;
  951. padding: 24rpx 20rpx;
  952. box-sizing: border-box;
  953. }
  954. .nextto {
  955. width: 702rpx;
  956. height: 84rpx;
  957. background: #f83224;
  958. border-radius: 44rpx;
  959. font-family: PingFangSC, PingFang SC;
  960. font-weight: 500;
  961. font-size: 32rpx;
  962. color: #ffffff;
  963. line-height: 84rpx;
  964. text-align: center;
  965. font-style: normal;
  966. margin-top: 108rpx;
  967. }
  968. .logname {
  969. font-family: PingFangSC, PingFang SC;
  970. font-weight: 400;
  971. font-size: 28rpx;
  972. color: #333333;
  973. line-height: 40rpx;
  974. text-align: right;
  975. font-style: normal;
  976. overflow: hidden;
  977. width: 220rpx;
  978. white-space: nowrap;
  979. text-overflow: ellipsis;
  980. text-align: center;
  981. word-break: break-all;
  982. }
  983. .wei {
  984. font-family: JDZhengHT, JDZhengHT;
  985. font-weight: 400;
  986. font-size: 32rpx;
  987. color: #f83224;
  988. line-height: 40rpx;
  989. text-align: right;
  990. font-style: normal;
  991. margin-top: 8rpx;
  992. }
  993. .active {
  994. width: 218rpx;
  995. height: 148rpx;
  996. background: rgba(247, 50, 36, 0.05);
  997. border-radius: 8rpx;
  998. border: 1rpx solid #f83224;
  999. }
  1000. .unactive {
  1001. width: 218rpx;
  1002. height: 148rpx;
  1003. border-radius: 12rpx;
  1004. border: 1rpx solid #c3c3c3;
  1005. }
  1006. .poptitle {
  1007. width: 142rpx;
  1008. height: 50rpx;
  1009. font-family: PingFangSC, PingFang SC;
  1010. font-weight: 600;
  1011. font-size: 36rpx;
  1012. color: #333333;
  1013. text-align: center;
  1014. width: 100%;
  1015. }
  1016. .back {
  1017. background: rgba(244, 244, 244, 1);
  1018. padding: 20rpx 24rpx;
  1019. box-sizing: border-box;
  1020. .btn {
  1021. width: 750rpx;
  1022. height: 166rpx;
  1023. background: #ffffff;
  1024. box-shadow: 0rpx -1rpx 0rpx 0rpx rgba(0, 0, 0, 0.05);
  1025. position: fixed;
  1026. bottom: 0;
  1027. left: 0;
  1028. padding: 0 24rpx 5rpx 5rpx;
  1029. box-sizing: border-box;
  1030. .money {
  1031. font-family: HarmonyOS_Sans_Medium;
  1032. font-size: 48rpx;
  1033. color: #f83224;
  1034. line-height: 38rpx;
  1035. text-align: left;
  1036. font-style: normal;
  1037. // font-weight: 500;
  1038. font-weight: bold;
  1039. }
  1040. .kg {
  1041. font-family: PingFangSC, PingFang SC;
  1042. font-weight: 400;
  1043. font-size: 24rpx;
  1044. color: #333333;
  1045. line-height: 34rpx;
  1046. text-align: left;
  1047. font-style: normal;
  1048. }
  1049. .order {
  1050. width: 232rpx;
  1051. height: 80rpx;
  1052. background: #f83224;
  1053. border-radius: 40rpx;
  1054. font-family: PingFangTC, PingFangTC;
  1055. font-weight: 500;
  1056. font-size: 32rpx;
  1057. color: #ffffff;
  1058. line-height: 80rpx;
  1059. text-align: center;
  1060. font-style: normal;
  1061. margin-left: 20rpx;
  1062. }
  1063. }
  1064. //商品相关
  1065. .abount {
  1066. padding: 28rpx 24rpx;
  1067. box-sizing: border-box;
  1068. background: #ffffff;
  1069. border-radius: 16rpx;
  1070. width: 702rpx;
  1071. .zong {
  1072. width: 654rpx;
  1073. padding: 22rpx 0 0 0;
  1074. border-top: 2rpx solid rgba(151, 151, 151, 0.1);
  1075. margin-top: 32rpx;
  1076. .small {
  1077. font-family: PingFangTC, PingFangTC;
  1078. font-weight: 400;
  1079. font-size: 24rpx;
  1080. color: #444444;
  1081. line-height: 34rpx;
  1082. text-align: left;
  1083. font-style: normal;
  1084. }
  1085. .mon {
  1086. font-family: HarmonyOS_Sans_Medium;
  1087. font-size: 28rpx;
  1088. color: #f83224;
  1089. line-height: 38rpx;
  1090. text-align: left;
  1091. font-style: normal;
  1092. margin-left: 12rpx;
  1093. font-weight: bold;
  1094. }
  1095. }
  1096. .back {
  1097. background: rgba(244, 244, 244, 1);
  1098. padding: 22rpx 16rpx;
  1099. box-sizing: border-box;
  1100. margin-top: 10rpx;
  1101. // margin-bottom: 20rpx;
  1102. }
  1103. .name {
  1104. font-family: PingFangSC, PingFang SC;
  1105. font-weight: 400;
  1106. font-size: 28rpx;
  1107. color: #333333;
  1108. line-height: 40rpx;
  1109. text-align: left;
  1110. font-style: normal;
  1111. }
  1112. .money {
  1113. font-family: HarmonyOS_Sans_Medium;
  1114. font-size: 28rpx;
  1115. color: #222222;
  1116. line-height: 38rpx;
  1117. text-align: left;
  1118. font-style: normal;
  1119. font-weight: 600;
  1120. }
  1121. }
  1122. .recommend {
  1123. margin-top: 20rpx;
  1124. .title {
  1125. font-family: PingFangSC, PingFang SC;
  1126. font-weight: 400;
  1127. font-size: 22rpx;
  1128. color: #222222;
  1129. line-height: 32rpx;
  1130. text-align: left;
  1131. font-style: normal;
  1132. width: 148rpx;
  1133. height: 64rpx;
  1134. overflow: hidden;
  1135. text-overflow: ellipsis;
  1136. -webkit-line-clamp: 2;
  1137. display: -webkit-box;
  1138. -webkit-box-orient: vertical;
  1139. word-break: break-all;
  1140. }
  1141. .top {
  1142. width: 702rpx;
  1143. height: 64rpx;
  1144. background: linear-gradient(
  1145. 180deg,
  1146. #ffe7e3 0%,
  1147. rgba(255, 255, 255, 1) 100%
  1148. );
  1149. border-radius: 16rpx 16rpx 0 0;
  1150. padding: 24rpx 22rpx;
  1151. box-sizing: border-box;
  1152. }
  1153. .bottom {
  1154. padding: 0 20rpx 22rpx;
  1155. box-sizing: border-box;
  1156. background: #fff;
  1157. }
  1158. }
  1159. //物流
  1160. .logistics {
  1161. width: 702rpx;
  1162. // height: 96rpx;
  1163. background: #ffffff;
  1164. border-radius: 16rpx;
  1165. padding: 28rpx 22rpx;
  1166. box-sizing: border-box;
  1167. margin-top: 20rpx;
  1168. .change {
  1169. font-family: PingFangSC, PingFang SC;
  1170. font-weight: 400;
  1171. font-size: 28rpx;
  1172. color: #f83224;
  1173. line-height: 40rpx;
  1174. text-align: left;
  1175. font-style: normal;
  1176. margin-right: 8rpx;
  1177. }
  1178. }
  1179. //商城
  1180. .shop {
  1181. width: 702rpx;
  1182. // height: 322rpx;
  1183. background: #ffffff;
  1184. border-radius: 16rpx;
  1185. padding: 30rpx 24rpx;
  1186. margin-top: 20rpx;
  1187. box-sizing: border-box;
  1188. .bu {
  1189. width: 120rpx;
  1190. height: 40rpx;
  1191. border-radius: 20rpx;
  1192. border: 1rpx solid rgba(151, 151, 151, 0.3);
  1193. }
  1194. .money {
  1195. font-family: HarmonyOS_Sans_Medium;
  1196. font-size: 24rpx;
  1197. color: #f83224;
  1198. line-height: 34rpx;
  1199. text-align: left;
  1200. font-style: normal;
  1201. font-weight: 600;
  1202. }
  1203. .name {
  1204. font-family: PingFangSC, PingFang SC;
  1205. font-weight: 400;
  1206. font-size: 30rpx;
  1207. color: #222222;
  1208. line-height: 42rpx;
  1209. text-align: left;
  1210. font-style: normal;
  1211. margin-left: 10rpx;
  1212. }
  1213. .weight {
  1214. font-family: PingFangSC, PingFang SC;
  1215. font-weight: 400;
  1216. font-size: 24rpx;
  1217. color: rgba(34, 34, 34, 0.6);
  1218. line-height: 34rpx;
  1219. text-align: left;
  1220. font-style: normal;
  1221. margin-top: 16rpx;
  1222. }
  1223. }
  1224. // 地址
  1225. .address {
  1226. width: 702rpx;
  1227. // height: 182rpx;
  1228. background: #ffffff;
  1229. border-radius: 16rpx;
  1230. padding: 32rpx 24rpx;
  1231. box-sizing: border-box;
  1232. .add {
  1233. font-family: SFPro, SFPro;
  1234. font-weight: 500;
  1235. font-size: 32rpx;
  1236. color: #222222;
  1237. line-height: 36rpx;
  1238. text-align: left;
  1239. font-style: normal;
  1240. }
  1241. .info {
  1242. font-family: SFPro, SFPro;
  1243. font-weight: 400;
  1244. font-size: 24rpx;
  1245. color: #555555;
  1246. line-height: 28rpx;
  1247. text-align: left;
  1248. font-style: normal;
  1249. margin-top: 20rpx;
  1250. }
  1251. }
  1252. }
  1253. .minus {
  1254. width: 22px;
  1255. height: 22px;
  1256. border-width: 1px;
  1257. border-color: #e6e6e6;
  1258. border-style: solid;
  1259. border-top-left-radius: 100px;
  1260. border-top-right-radius: 100px;
  1261. border-bottom-left-radius: 100px;
  1262. border-bottom-right-radius: 100px;
  1263. @include flex;
  1264. justify-content: center;
  1265. align-items: center;
  1266. }
  1267. .input {
  1268. padding: 0 10px;
  1269. }
  1270. .plus {
  1271. width: 22px;
  1272. height: 22px;
  1273. background-color: #ff0000;
  1274. border-radius: 50%;
  1275. /* #ifndef APP-NVUE */
  1276. display: flex;
  1277. /* #endif */
  1278. justify-content: center;
  1279. align-items: center;
  1280. }
  1281. </style>