铝交易,微信公众号
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.

470 lines
11 KiB

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