kj-flow.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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. },
  76. name: "kj-flow",
  77. data() {
  78. return {
  79. leftchange: 0,
  80. rightchange: 0,
  81. containerList: [],
  82. transportList: [],
  83. estimated_arrived_date: '',
  84. leftname: '',
  85. rightname: '',
  86. dateid: '',
  87. unit_price: '',
  88. language: 'zh-CN',
  89. };
  90. },
  91. created() {
  92. if (uni.getStorageSync('language') != '') {
  93. this.language = uni.getStorageSync('language')
  94. }
  95. },
  96. onLoad() {
  97. },
  98. computed: {
  99. i18n() {
  100. return this.$t('index')
  101. }
  102. },
  103. methods: {
  104. //货柜列表
  105. container(id) {
  106. uni.$u.http.get('/api/container-base', {
  107. params: {
  108. is_page: 0,
  109. province_id: this.province_id,
  110. transport_type_id: id
  111. }
  112. }).then((res) => {
  113. this.containerList = res
  114. this.estimated_arrived_date = res[0].estimated_arrived_date
  115. this.dateid = res[0].id
  116. this.rightname = res[0].name
  117. if (this.language == 'en-US') {
  118. this.rightname = res[0].name_en
  119. }
  120. if (this.language == 'es-ES') {
  121. this.rightname = res[0].name_es
  122. }
  123. if (this.language == 'it-IT') {
  124. this.rightname = res[0].name_ita
  125. }
  126. if (this.language == 'zh-CN') {
  127. this.rightname = res[0].name_cn
  128. }
  129. this.unit_price = res[0].unit_price
  130. }).catch(() => {
  131. })
  132. },
  133. transport() {
  134. uni.$u.http.get('/api/transport-type').then((res) => {
  135. this.transportList = res
  136. this.container(res[0].id)
  137. }).catch(() => {
  138. })
  139. },
  140. //左边切换
  141. changea(item, index) {
  142. this.leftchange = index
  143. this.container(item.id)
  144. if (this.language == 'en-US') {
  145. this.leftname = item.name_en
  146. }
  147. if (this.language == 'es-ES') {
  148. this.leftname = item.name_es
  149. }
  150. if (this.language == 'it-IT') {
  151. this.leftname = item.name_ita
  152. }
  153. if (this.language == 'zh-CN') {
  154. this.leftname = item.name_cn
  155. }
  156. },
  157. //右边切换
  158. change(item, idx) {
  159. this.rightchange = idx
  160. this.dateid = item.id
  161. if (this.language == 'en-US') {
  162. this.rightname = item.name_en
  163. }
  164. if (this.language == 'es-ES') {
  165. this.rightname = item.name_es
  166. }
  167. if (this.language == 'it-IT') {
  168. this.rightname = item.name_ita
  169. }
  170. if (this.language == 'zh-CN') {
  171. this.rightname = item.name_cn
  172. }
  173. this.unit_price = item.unit_price
  174. },
  175. close() {
  176. this.$emit('close')
  177. },
  178. enter() {
  179. if (this.dateid == '') {
  180. this.$u.toast('请选择货柜')
  181. } else {
  182. this.$emit('success', {
  183. dateid: this.dateid,
  184. rightname: this.rightname,
  185. leftname: this.leftname,
  186. unit_price: this.unit_price
  187. })
  188. }
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .iitem {
  195. border-bottom: 2rpx solid rgba(151, 151, 151, 0.1);
  196. box-sizing: border-box;
  197. }
  198. .price {
  199. font-family: SFPro, SFPro;
  200. font-weight: 500;
  201. font-size: 24rpx;
  202. color: #F83224;
  203. line-height: 28rpx;
  204. text-align: right;
  205. font-style: normal;
  206. }
  207. .right {
  208. flex: 1;
  209. width: 474rpx;
  210. height: 642rpx;
  211. }
  212. .bottom {
  213. width: 750rpx;
  214. height: 166rpx;
  215. background: #FFFFFF;
  216. padding: 20rpx 24rpx;
  217. box-sizing: border-box;
  218. }
  219. .btn {
  220. width: 702rpx;
  221. height: 84rpx;
  222. background: #F83224;
  223. border-radius: 44rpx;
  224. font-family: PingFangSC, PingFang SC;
  225. font-weight: 500;
  226. font-size: 32rpx;
  227. color: #FFFFFF;
  228. line-height: 84rpx;
  229. text-align: center;
  230. font-style: normal;
  231. }
  232. .title {
  233. font-family: PingFangSC, PingFang SC;
  234. font-weight: 500;
  235. font-size: 36rpx;
  236. color: #333333;
  237. line-height: 50rpx;
  238. text-align: left;
  239. font-style: normal;
  240. }
  241. .left {
  242. width: 212rpx;
  243. height: 642rpx;
  244. }
  245. .ititle {
  246. font-family: PingFangSC, PingFang SC;
  247. font-weight: 500;
  248. font-size: 28rpx;
  249. color: #222222;
  250. line-height: 40rpx;
  251. text-align: right;
  252. font-style: normal;
  253. }
  254. .itime {
  255. font-family: PingFangSC, PingFang SC;
  256. font-weight: 400;
  257. font-size: 20rpx;
  258. color: #333333;
  259. line-height: 28rpx;
  260. text-align: right;
  261. font-style: normal;
  262. }
  263. </style>