铝交易,微信公众号
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

477 lines
10 KiB

4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="now-order">
  3. <navbar :title="$t('pageTitle.immediateOrder')" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <view class="title">
  6. <span
  7. style="width: 10rpx;height: 40rpx;background-color: #1f1c39;border-radius: 10rpx;overflow: hidden;"></span>
  8. <span>{{ $t('other.aluminumProducts') }}</span>
  9. </view>
  10. <view class="basic-info">
  11. <!--商品规格-->
  12. <view class="item">
  13. <view>{{ $t('components.productSpe') }}</view>
  14. <view>
  15. 铝制品(Al>96%)
  16. </view>
  17. </view>
  18. <!--<uv-divider text="" :hairline="true"></uv-divider>-->
  19. <!--提货地点-->
  20. <view class="currentRegion">
  21. <view>{{ $t('components.pickupLocation') }}</view>
  22. <!-- <view @click.stop="selectAddr">
  23. <input class="input" disabled v-model="form.currentRegion" placeholder="请选择所在地区"></input>
  24. <view class="orientation">
  25. <img src="../../static/image/address/selectIcon.png"
  26. style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">
  27. </view>
  28. </view> -->
  29. <view class="">
  30. {{ fatherData.address }}
  31. </view>
  32. </view>
  33. <!--详细地址-->
  34. <view class="item">
  35. <view>{{ $t('components.detailedAddress') }}</view>
  36. <view>
  37. <!-- <input v-model="form.address" placeholder="请输入详细地址" clearable></input> -->
  38. </view>
  39. </view>
  40. <!--交货日期-->
  41. <view class="delivery-date">
  42. <view>{{ $t('components.deliveryDate') }}</view>
  43. <view class="value">
  44. <view class="dateTimeCls">
  45. <view class="date" @click="startDateOpen">
  46. {{ form.deliveryDate }}
  47. <uv-datetime-picker ref="startDateRef"
  48. v-model="form.deliveryDate"
  49. mode="date"
  50. @confirm="startDateChange"></uv-datetime-picker>
  51. </view>
  52. <view class="img">
  53. >
  54. <!--<img src="../static/address/1.svg" style="width: 40rpx;-->
  55. <!--height: 40rpx;">-->
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <!--暂定数量-->
  61. <view class="tentativeQuantity">
  62. <view class="key">{{ $t('other.tentativeQuantity') }}</view>
  63. <view class="value">
  64. <uv-number-box
  65. inputWidth="200rpx"
  66. v-model="form.tentativeQuantity" :max="fatherData.num"></uv-number-box>
  67. </view>
  68. </view>
  69. <!--单价-->
  70. <view class="item">
  71. <view>{{ $t('components.unitPrice') }}</view>
  72. <view>
  73. <input v-model="fatherData.price" disabled clearable></input>
  74. </view>
  75. </view>
  76. <!--履约保证金-->
  77. <view class="performanceBond">
  78. <view class="key">{{ $t('other.performanceDeposit') }}</view>
  79. <view class="value">
  80. <input v-model="form.performanceBond" clearable></input>
  81. </view>
  82. </view>
  83. <view class="Tip">
  84. <span class="span">{{ $t('other.priceQuantityPercentage') }}</span>
  85. </view>
  86. <!--立即下单和联系我们-->
  87. <view class="btns">
  88. <span @click="ljxd" class="ljxd">
  89. {{ $t('components.immediateOrder') }}
  90. </span>
  91. <span @click="contactUs" class="lxwm">
  92. {{ $t('components.contactUs') }}
  93. </span>
  94. <span class="tip">{{ $t('components.contactUsIfAnyProblems') }}</span>
  95. </view>
  96. </view>
  97. </view>
  98. <!-- 联系客服弹框 -->
  99. <customerServicePopup ref="customerServicePopup" />
  100. </view>
  101. </template>
  102. <script>
  103. import topbar from "@/components/base/topbar.vue";
  104. import {
  105. mapGetters
  106. } from 'vuex'
  107. import Position from '@/utils/position.js'
  108. import dayjs from "dayjs";
  109. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  110. export default {
  111. name: "nowOrder",
  112. components: {
  113. topbar,
  114. customerServicePopup,
  115. },
  116. computed: {
  117. ...mapGetters(['userShop']),
  118. },
  119. onLoad(options) {
  120. if (options.params) {
  121. const fatherData = JSON.parse(decodeURIComponent(options.params));
  122. console.log(fatherData, "fatherData==========")
  123. this.fatherData = fatherData;
  124. }
  125. },
  126. data() {
  127. return {
  128. fatherData: {},
  129. form: {
  130. currentRegion: '',
  131. address: '',
  132. tentativeQuantity: 0,
  133. deliveryDate: dayjs(new Date()).format("YYYY-MM-DD"),
  134. price: 0,
  135. performanceBond: 0,
  136. latitude: '',
  137. longitude: '',
  138. },
  139. phoneNumber: '00000000000'
  140. }
  141. },
  142. methods: {
  143. // 立即下单
  144. ljxd() {
  145. var itemStr = encodeURIComponent(JSON.stringify(this.form));
  146. uni.navigateTo({
  147. url: `/pages_order/tradingPlatform/confirmOrder?params=${itemStr}`,
  148. });
  149. },
  150. // 联系我们
  151. contactUs() {
  152. this.$refs.customerServicePopup.open()
  153. },
  154. startDateChange(val) {
  155. this.$nextTick(() => {
  156. this.form.deliveryDate = dayjs(val.value).format("YYYY-MM-DD")
  157. });
  158. },
  159. startDateOpen() {
  160. this.$refs.startDateRef.open();
  161. },
  162. //地图上选择地址
  163. selectAddr() {
  164. Position.getLocation(res => {
  165. Position.selectAddress(res.longitude, res.latitude, success => {
  166. this.setAddress(success)
  167. })
  168. })
  169. Position.getLocationDetail(res => {
  170. console.log(res);
  171. this.form.address = res
  172. })
  173. },
  174. //提取用户选择的地址信息复制给表单数据
  175. setAddress(res) {
  176. //经纬度信息
  177. this.form.latitude = res.latitude
  178. this.form.longitude = res.longitude
  179. if (!res.address && res.name) { //用户直接选择城市的逻辑
  180. return this.form.currentRegion = res.name
  181. }
  182. if (res.address || res.name) {
  183. return this.form.currentRegion = res.address + res.name
  184. }
  185. this.form.currentRegion = '' //用户啥都没选就点击勾选
  186. },
  187. }
  188. }
  189. </script>
  190. <style scoped lang="scss">
  191. .now-order {
  192. background-color: #FFF;
  193. height: 100vh;
  194. .frame {
  195. .title {
  196. display: flex;
  197. font-size: 30rpx;
  198. font-weight: 700;
  199. padding: 0rpx 0 0rpx 20rpx;
  200. margin: 20rpx 0 0 0;
  201. >span:nth-of-type(1) {
  202. margin: 4rpx 0 0 8rpx;
  203. background-color: #FFF;
  204. }
  205. >span:nth-of-type(2) {
  206. margin: 0 0 0 8rpx;
  207. background-color: #FFF;
  208. }
  209. }
  210. .basic-info {
  211. display: flex;
  212. flex-direction: column;
  213. gap: 5rpx;
  214. background-color: #FFF;
  215. //margin-top: 20rpx;
  216. padding: 20rpx 20rpx 20rpx 20rpx;
  217. .delivery-date {
  218. display: flex;
  219. align-items: center;
  220. background-color: #FFF;
  221. height: 80rpx;
  222. // margin: 10rpx 0 0 0;
  223. padding: 10rpx 0 0 20rpx;
  224. >view:nth-of-type(1) {
  225. width: 30%;
  226. // font-weight: 700;
  227. }
  228. .value {
  229. width: 70%;
  230. border-radius: 10rpx;
  231. overflow: hidden;
  232. .dateTimeCls {
  233. display: flex;
  234. align-items: center;
  235. justify-content: space-between;
  236. width: 100%;
  237. height: 80%;
  238. //border: 1px solid #b0b2b3;
  239. padding: 5rpx;
  240. border-radius: 20rpx;
  241. .date {
  242. font-size: 30rpx;
  243. display: flex;
  244. align-items: center;
  245. width: 80%;
  246. height: 100%;
  247. color: #000;
  248. }
  249. .img {
  250. display: flex;
  251. justify-content: center;
  252. align-items: center;
  253. //margin-left: 50rpx;
  254. width: 20%;
  255. //height: 100%;
  256. }
  257. }
  258. }
  259. }
  260. .tentativeQuantity {
  261. display: flex;
  262. align-items: center;
  263. background-color: #FFF;
  264. height: 80rpx;
  265. // margin: 10rpx 0 0 0;
  266. padding: 10rpx 0 0 20rpx;
  267. .key {
  268. width: 30%;
  269. }
  270. .value {
  271. width: 70%;
  272. border-radius: 10rpx;
  273. overflow: hidden;
  274. }
  275. }
  276. .Tip {
  277. display: flex;
  278. align-items: center;
  279. justify-content: center;
  280. .span {
  281. color: #999;
  282. font-size: 24rpx;
  283. }
  284. }
  285. .btns {
  286. width: 100%;
  287. display: flex;
  288. flex-direction: column;
  289. align-items: center;
  290. justify-content: center;
  291. gap: 20rpx;
  292. .ljxd {
  293. display: flex;
  294. align-items: center;
  295. justify-content: center;
  296. width: 500rpx;
  297. height: 70rpx;
  298. border-radius: 40rpx;
  299. color: #FFF;
  300. font-size: 28rpx;
  301. margin: 20rpx 10rpx 0 0;
  302. background: $uni-color;
  303. //margin-top: 20rpx;
  304. border-radius: 40rpx;
  305. }
  306. .lxwm {
  307. display: flex;
  308. align-items: center;
  309. justify-content: center;
  310. width: 500rpx;
  311. height: 70rpx;
  312. border-radius: 40rpx;
  313. color: #000000;
  314. font-size: 28rpx;
  315. margin: 20rpx 10rpx 0 0;
  316. background: #f1f1f1;
  317. //margin-top: 20rpx;
  318. border-radius: 40rpx;
  319. }
  320. .tip {
  321. display: flex;
  322. align-items: center;
  323. justify-content: center;
  324. font-size: 24rpx;
  325. color: #999;
  326. //width: 500rpx;
  327. }
  328. }
  329. .item {
  330. display: flex;
  331. align-items: center;
  332. background-color: #FFF;
  333. height: 80rpx;
  334. // margin: 10rpx 0 0 0;
  335. padding: 10rpx 0 0 20rpx;
  336. >view:nth-of-type(1) {
  337. width: 30%;
  338. // font-weight: 700;
  339. }
  340. >view:nth-of-type(2) {
  341. width: 70%;
  342. border-radius: 10rpx;
  343. overflow: hidden;
  344. input {
  345. background-color: #FFF;
  346. font-size: 28rpx;
  347. padding: 16rpx 8rpx 16rpx 15rpx;
  348. }
  349. }
  350. }
  351. .performanceBond {
  352. display: flex;
  353. align-items: center;
  354. background-color: #FFF;
  355. height: 80rpx;
  356. // margin: 10rpx 0 0 0;
  357. padding: 10rpx 0 0 20rpx;
  358. .key {
  359. width: 30%;
  360. // font-weight: 700;
  361. }
  362. .value {
  363. width: 70%;
  364. border-radius: 10rpx;
  365. overflow: hidden;
  366. input {
  367. background-color: #FFF;
  368. font-size: 28rpx;
  369. padding: 16rpx 8rpx 16rpx 15rpx;
  370. }
  371. }
  372. }
  373. .currentRegion {
  374. display: flex;
  375. align-items: center;
  376. background-color: #FFF;
  377. height: 80rpx;
  378. // margin: 10rpx 0 0 0;
  379. padding: 10rpx 0 0 20rpx;
  380. >view:nth-of-type(1) {
  381. width: 30%;
  382. // font-weight: 700;
  383. }
  384. >view:nth-of-type(2) {
  385. width: 70%;
  386. padding: 0 20rpx 0 0;
  387. display: flex;
  388. .input {
  389. background-color: #f5f5f5;
  390. // color: #a4a4a4;
  391. font-size: 28rpx;
  392. padding: 8rpx 8rpx 8rpx 15rpx;
  393. width: 350rpx;
  394. }
  395. .orientation {
  396. display: flex;
  397. padding: 10rpx 10rpx 10rpx 20rpx;
  398. font-size: 30rpx;
  399. color: #FBAB32;
  400. flex-direction: column;
  401. justify-content: center;
  402. align-items: center;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. </style>