kj-flow.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view>
  3. <view class="u-flex u-row-between">
  4. <view class="" style="width: 28px;height: 28px;"></view>
  5. <view class="title">{{i18n.flow}}</view>
  6. <u-icon name="close" @click="close" color="background: #333333;" size="28"></u-icon>
  7. </view>
  8. <view class="u-flex" style="margin-top: 56rpx;">
  9. <scroll-view scroll-y="true" class="left">
  10. <view v-for="(item,idx) in transportList" :key="idx" @click="changea(item,idx)"
  11. style="height: 134rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;"
  12. :style="{background:idx==leftchange? '':'#F7F7F7'}">
  13. <view class="ititle" v-if="language =='zh-CN'" :style="{fontWeight:idx==leftchange?'600':''}">
  14. {{item.name_cn}}
  15. </view>
  16. <view class="ititle" v-if="language =='en-US'" :style="{fontWeight:idx==leftchange?'600':''}">
  17. {{item.name_en}}
  18. </view>
  19. <view class="ititle" v-if="language =='es-ES'" :style="{fontWeight:idx==leftchange?'600':''}">
  20. {{item.name_es}}
  21. </view>
  22. <view class="ititle" v-if="language =='it-IT'" :style="{fontWeight:idx==leftchange?'600':''}">
  23. {{item.name_ita}}
  24. </view>
  25. <view class="itime" v-if="idx==leftchange&&containerList.length>0">{{i18n.Estimatedtimeofarrival}}
  26. </view>
  27. <view class="itime" v-if="idx==leftchange&&containerList.length>0">{{estimated_arrived_date}}</view>
  28. </view>
  29. </scroll-view>
  30. <scroll-view scroll-y="true" class="right" style="margin-left: 36rpx;">
  31. <view v-for="(item,idx) in containerList" :key="idx" @click="change(item,idx)"
  32. style="display: flex;flex-direction: column;align-items: center;justify-content: center;padding: 20rpx 0 16rpx;"
  33. class="iitem">
  34. <view class="ititle u-flex u-row-between" style="width: 100%;">
  35. <view class="ititle">{{i18n.Shipmentdate}}: {{item.begin_date}}</view>
  36. <view v-if="language =='zh-CN'" style="font-size: 24rpx;
  37. color: #666666;">{{item.name_cn}}</view>
  38. <view v-if="language =='en-US'" style="font-size: 24rpx;
  39. color: #666666;">{{item.name_en}}</view>
  40. <view v-if="language =='es-ES'" style="font-size: 24rpx;
  41. color: #666666;">{{item.name_es}}</view>
  42. <view v-if="language =='it-IT'" style="font-size: 24rpx;
  43. color: #666666;">{{item.name_ita}}</view>
  44. </view>
  45. <view class="u-flex u-row-between" style="margin-top: 16rpx;width: 100%;">
  46. <view class="price">
  47. <text style='font-size="24rpx"'>¥</text>
  48. <text style='font-size="32rpx"'>{{item.unit_price}}</text>
  49. <!-- <text style='font-size="32rpx"' v-else>{{item.special_delivery_fee}}</text> -->
  50. <text style='font-size="28rpx"'>/kg</text>
  51. </view>
  52. <u-icon v-if="idx==rightchange" name="checkbox-mark" color="rgba(248, 50, 36, 1)"
  53. size="28"></u-icon>
  54. <view v-else class="" style="width: 28px;height: 28px;"></view>
  55. </view>
  56. </view>
  57. </scroll-view>
  58. </view>
  59. <view class="bottom">
  60. <view class="btn" @click="enter">{{i18n.enter}}</view>
  61. </view>
  62. <view class=""></view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. props: {
  68. province_id: {
  69. typeof: Number
  70. },
  71. goodstype: {
  72. typeof: '',
  73. default: "normal"
  74. },
  75. leftchangea: {
  76. type: String,
  77. default: ''
  78. },
  79. rightchangea: {
  80. type: String,
  81. default: ''
  82. },
  83. typeida: {
  84. type: String,
  85. default: ''
  86. }
  87. },
  88. name: "kj-flow",
  89. data() {
  90. return {
  91. leftchange: 0,
  92. rightchange: 0,
  93. containerList: [],
  94. transportList: [],
  95. estimated_arrived_date: '',
  96. leftname: '',
  97. rightname: '',
  98. dateid: '',
  99. unit_price: '',
  100. language: 'zh-CN',
  101. typeid: ''
  102. };
  103. },
  104. created() {
  105. if (uni.getStorageSync('language') != '') {
  106. this.language = uni.getStorageSync('language')
  107. }
  108. },
  109. onLoad() {
  110. },
  111. computed: {
  112. i18n() {
  113. return this.$t('index')
  114. }
  115. },
  116. methods: {
  117. //货柜列表
  118. container(id) {
  119. uni.$u.http.get('/api/container-base', {
  120. params: {
  121. is_page: 0,
  122. province_id: this.province_id,
  123. transport_type_id: id
  124. }
  125. }).then((res) => {
  126. this.containerList = res
  127. this.estimated_arrived_date = res[0].estimated_arrived_date
  128. this.dateid = res[0].id
  129. if (this.language == 'en-US') {
  130. this.rightname = res[0].name_en
  131. }
  132. if (this.language == 'es-ES') {
  133. this.rightname = res[0].name_es
  134. }
  135. if (this.language == 'it-IT') {
  136. this.rightname = res[0].name_ita
  137. }
  138. if (this.language == 'zh-CN') {
  139. this.rightname = res[0].name_cn
  140. }
  141. this.unit_price = res[0].unit_price
  142. }).catch(() => {
  143. })
  144. },
  145. transport() {
  146. uni.$u.http.get('/api/transport-type').then((res) => {
  147. this.transportList = res
  148. if (this.typeida) {
  149. console.log(this.typeida);
  150. this.leftchange = this.leftchangea
  151. this.rightchange = this.rightchangea
  152. this.container(this.typeida)
  153. this.typeid = this.transportList[0].id
  154. } else {
  155. this.container(res[0].id)
  156. }
  157. }).catch(() => {
  158. })
  159. },
  160. //左边切换
  161. changea(item, index) {
  162. this.leftchange = index
  163. this.typeid = item.id
  164. this.container(item.id)
  165. this.rightname = '',
  166. this.dateid = ''
  167. if (this.language == 'en-US') {
  168. this.leftname = item.name_en
  169. }
  170. if (this.language == 'es-ES') {
  171. this.leftname = item.name_es
  172. }
  173. if (this.language == 'it-IT') {
  174. this.leftname = item.name_ita
  175. }
  176. if (this.language == 'zh-CN') {
  177. this.leftname = item.name_cn
  178. }
  179. },
  180. //右边切换
  181. change(item, idx) {
  182. this.rightchange = idx
  183. this.dateid = item.id
  184. if (this.language == 'en-US') {
  185. this.rightname = item.name_en
  186. }
  187. if (this.language == 'es-ES') {
  188. this.rightname = item.name_es
  189. }
  190. if (this.language == 'it-IT') {
  191. this.rightname = item.name_ita
  192. }
  193. if (this.language == 'zh-CN') {
  194. this.rightname = item.name_cn
  195. }
  196. this.unit_price = item.unit_price
  197. },
  198. close() {
  199. this.$emit('close')
  200. },
  201. enter() {
  202. if (this.dateid == '') {
  203. this.$u.toast('请选择货柜')
  204. } else {
  205. this.$emit('success', {
  206. dateid: this.dateid,
  207. rightname: this.rightname,
  208. leftname: this.leftname,
  209. unit_price: this.unit_price,
  210. leftchange: this.leftchange,
  211. rightchange: this.rightchange,
  212. typeid: this.typeid
  213. })
  214. }
  215. }
  216. }
  217. }
  218. </script>
  219. <style lang="scss" scoped>
  220. .iitem {
  221. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  222. box-sizing: border-box;
  223. }
  224. .price {
  225. font-family: SFPro, SFPro;
  226. font-weight: 500;
  227. font-size: 24rpx;
  228. color: #F83224;
  229. line-height: 28rpx;
  230. text-align: right;
  231. font-style: normal;
  232. }
  233. .right {
  234. flex: 1;
  235. width: 474rpx;
  236. height: 642rpx;
  237. }
  238. .bottom {
  239. width: 750rpx;
  240. height: 166rpx;
  241. background: #FFFFFF;
  242. padding: 20rpx 24rpx;
  243. box-sizing: border-box;
  244. }
  245. .btn {
  246. width: 702rpx;
  247. height: 84rpx;
  248. background: #F83224;
  249. border-radius: 44rpx;
  250. font-family: PingFangSC, PingFang SC;
  251. font-weight: 500;
  252. font-size: 32rpx;
  253. color: #FFFFFF;
  254. line-height: 84rpx;
  255. text-align: center;
  256. font-style: normal;
  257. }
  258. .title {
  259. font-family: PingFangSC, PingFang SC;
  260. font-weight: 500;
  261. font-size: 36rpx;
  262. color: #333333;
  263. line-height: 50rpx;
  264. text-align: left;
  265. font-style: normal;
  266. }
  267. .left {
  268. width: 212rpx;
  269. height: 642rpx;
  270. }
  271. .ititle {
  272. font-family: PingFangSC, PingFang SC;
  273. font-weight: 500;
  274. font-size: 28rpx;
  275. color: #222222;
  276. line-height: 40rpx;
  277. text-align: right;
  278. font-style: normal;
  279. }
  280. .itime {
  281. font-family: PingFangSC, PingFang SC;
  282. font-weight: 400;
  283. font-size: 20rpx;
  284. color: #333333;
  285. line-height: 28rpx;
  286. text-align: right;
  287. font-style: normal;
  288. }
  289. </style>