order.vue 32 KB

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