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

587 lines
13 KiB

6 months ago
3 months ago
4 months ago
3 months ago
4 months ago
6 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
3 months ago
6 months ago
5 months ago
4 months ago
5 months ago
6 months ago
4 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
5 months ago
5 months ago
6 months ago
  1. <template>
  2. <view class="now-order">
  3. <navbar :title="$t('pageTitle.immediateOrder')" leftClick @leftClick="$utils.navigateBack" />
  4. <!-- <uv-swiper
  5. v-if="fatherData.picDetail"
  6. :list="fatherData.picDetail.split(',')"
  7. height="420rpx"
  8. >
  9. </uv-swiper> -->
  10. <view class="frame">
  11. <view class="title">
  12. <span
  13. style="width: 10rpx;height: 40rpx;background-color: #1f1c39;border-radius: 10rpx;overflow: hidden;"></span>
  14. <span>{{ $t('other.aluminumProducts') }}</span>
  15. </view>
  16. <view class="basic-info">
  17. <!--商品规格-->
  18. <view class="item">
  19. <view>{{ $t('components.productSpe') }}</view>
  20. <view>
  21. {{ fatherData.specsName }}
  22. </view>
  23. </view>
  24. <!--详情图-->
  25. <!-- <view class="item"
  26. v-if="fatherData.picDetail">
  27. <view>详情图</view>
  28. <view>
  29. <uv-album :urls="fatherData.picDetail.split(',')"></uv-album>
  30. </view>
  31. </view> -->
  32. <!--详情视频-->
  33. <!-- <view class="item"
  34. v-if="fatherData.video">
  35. <view>详情视频</view>
  36. <view class="list-video">
  37. <view class="video"
  38. :key="index"
  39. v-for="(item, index) in fatherData.video.split(',')">
  40. <video :src="item"></video>
  41. </view>
  42. </view>
  43. </view> -->
  44. <!--检测报告-->
  45. <!-- <view class="item"
  46. v-if="fatherData.report">
  47. <view>检测报告</view>
  48. <view>
  49. <uv-album :urls="fatherData.report.split(',')"></uv-album>
  50. </view>
  51. </view> -->
  52. <!--检测视频-->
  53. <!-- <view class="item"
  54. v-if="fatherData.reportVideo">
  55. <view>检测视频</view>
  56. <view class="list-video">
  57. <view class="video"
  58. :key="index"
  59. v-for="(item, index) in fatherData.reportVideo.split(',')">
  60. <video :src="item"></video>
  61. </view>
  62. </view>
  63. </view> -->
  64. <!--<uv-divider text="" :hairline="true"></uv-divider>-->
  65. <!--提货地点-->
  66. <!-- <view class="currentRegion">
  67. <view>{{ $t('components.pickupLocation') }}</view>
  68. &lt;!&ndash; <view @click.stop="selectAddr">
  69. <input class="input" disabled v-model="form.currentRegion" placeholder="请选择所在地区"></input>
  70. <view class="orientation">
  71. <img src="../../static/image/address/selectIcon.png"
  72. style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;">
  73. </view>
  74. </view> &ndash;&gt;
  75. <view class="">
  76. {{ fatherData.address }}
  77. </view>
  78. </view> -->
  79. <!-- <view class="addressA" @click="openAddress">
  80. <view class="title">提货地点</view>
  81. <view class="address" style="width: 70%">
  82. <image mode="" src="/static/image/address/selectIcon.png"></image>
  83. <view class="">
  84. {{ address.name }}
  85. </view>
  86. <view class="icon">
  87. <uv-icon name="arrow-right" size="30rpx"></uv-icon>
  88. </view>
  89. </view>
  90. </view>
  91. 详细地址
  92. <view v-if="address.addressDetail" class="item">
  93. <view>{{ $t('components.detailedAddress') }}</view>
  94. <view>
  95. <view class="">
  96. {{ address.address + ' ' + address.addressDetail }}
  97. </view>
  98. </view>
  99. </view> -->
  100. <view class="item">
  101. <view>提货地点</view>
  102. <view>
  103. {{ fatherData.address }}
  104. </view>
  105. </view>
  106. <!--&lt;!&ndash;详细地址&ndash;&gt;-->
  107. <!--<view class="item">-->
  108. <!-- <view>{{ $t('components.detailedAddress') }}</view>-->
  109. <!-- <view>-->
  110. <!-- &lt;!&ndash; <input v-model="form.address" placeholder="请输入详细地址" clearable></input> &ndash;&gt;-->
  111. <!-- </view>-->
  112. <!--</view>-->
  113. <!--交货日期-->
  114. <!-- <view class="item">
  115. <view>{{ $t('components.deliveryDate') }}</view>
  116. <view class="value">
  117. <view class="dateTimeCls" @click="startDateOpen">
  118. <view class="date">
  119. {{ form.takeTime }}
  120. <uv-datetime-picker ref="startDateRef" v-model="form.takeTime" mode="date"
  121. :minDate="$dayjs(fatherData.transactionTime).valueOf()"
  122. @confirm="startDateChange"></uv-datetime-picker>
  123. </view>
  124. <view class="img">
  125. >
  126. </view>
  127. </view>
  128. </view>
  129. </view> -->
  130. <view class="item"
  131. @click="startDateOpen">
  132. <view>{{ $t('components.deliveryDate') }}</view>
  133. <view class="date">
  134. {{ form.takeTime }}
  135. <uv-datetime-picker ref="startDateRef" v-model="form.takeTime" mode="date"
  136. :minDate="$dayjs(fatherData.transactionTime).valueOf()"
  137. @confirm="startDateChange"></uv-datetime-picker>
  138. </view>
  139. <view class="icon">
  140. <uv-icon name="arrow-right" size="30rpx"></uv-icon>
  141. </view>
  142. </view>
  143. <!--暂定数量-->
  144. <view class="item">
  145. <view>{{ $t('other.tentativeQuantity') }}</view>
  146. <view>
  147. <uv-number-box inputWidth="200rpx" v-model="form.num"
  148. :max="fatherData.num"></uv-number-box>
  149. </view>
  150. </view>
  151. <!-- 库存 -->
  152. <view class="item">
  153. <view>库存</view>
  154. <view>
  155. {{ fatherData.num }}
  156. </view>
  157. </view>
  158. <!--单价-->
  159. <view class="item">
  160. <view>{{ $t('components.unitPrice') }}</view>
  161. <view>
  162. <input v-model="fatherData.price" disabled clearable></input>
  163. </view>
  164. </view>
  165. <!--履约保证金-->
  166. <view class="item">
  167. <view>{{ $t('other.performanceDeposit') }}</view>
  168. <view>
  169. <!-- <input v-model="form.deposit" clearable></input> -->
  170. {{ deposit }}
  171. </view>
  172. </view>
  173. <view class="Tip">
  174. <span class="span">{{ $t('other.priceQuantityPercentage', [10]) }}</span>
  175. </view>
  176. <!--立即下单和联系我们-->
  177. <view class="btns">
  178. <span @click="ljxd" class="ljxd">
  179. {{ $t('components.immediateOrder') }}
  180. </span>
  181. <span @click="contactUs" class="lxwm">
  182. {{ $t('components.contactUs') }}
  183. </span>
  184. <span class="tip">{{ $t('components.contactUsIfAnyProblems') }}</span>
  185. </view>
  186. </view>
  187. </view>
  188. <!-- 联系客服弹框 -->
  189. <customerServicePopup ref="customerServicePopup" />
  190. <!-- 地址选择弹框 -->
  191. <uv-popup ref="addressPopup" :round="30">
  192. <addressList ref="addressList" height="60vh" @select="selectAddress" />
  193. </uv-popup>
  194. </view>
  195. </template>
  196. <script>
  197. import topbar from "@/components/base/topbar.vue";
  198. import {
  199. mapGetters
  200. } from 'vuex'
  201. import Position from '@/utils/position.js'
  202. import dayjs from "dayjs";
  203. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  204. import AddressList from "@/pages_order/components/address/addressList.vue";
  205. export default {
  206. name: "nowOrder",
  207. components: {
  208. AddressList,
  209. topbar,
  210. customerServicePopup,
  211. },
  212. computed: {
  213. ...mapGetters(['userShop']),
  214. deposit() {
  215. return (this.fatherData.price * this.form.num * (0.1)).toFixed(2)
  216. },
  217. },
  218. onLoad(options) {
  219. // if (options.params) {
  220. // const fatherData = JSON.parse(decodeURIComponent(options.params));
  221. // 从vuex里面拿
  222. const fatherData = this.$store.state.productDetail
  223. console.log(fatherData, "fatherData==========")
  224. this.fatherData = fatherData;
  225. // 计算保证金 这个改成计算属性
  226. // this.form.deposit = (fatherData.price * this.form.num * (0.02)).toFixed(2);
  227. // }
  228. },
  229. data() {
  230. return {
  231. fatherData: {},
  232. form: {
  233. "address": "",
  234. "addressId": "",
  235. "deposit": 0,
  236. "id": "",
  237. "num": 1,
  238. "price": 0,
  239. "productId": "",
  240. "takeTime": dayjs(new Date()).format("YYYY-MM-DD"),
  241. },
  242. id: 0,
  243. address: {
  244. name: '请选择地址',
  245. addressDetail: '',
  246. },
  247. }
  248. },
  249. methods: {
  250. // 立即下单
  251. ljxd() {
  252. // var itemStr = encodeURIComponent(JSON.stringify(this.form));
  253. // uni.navigateTo({
  254. // url: `/pages_order/tradingPlatform/confirmOrder`,
  255. // });
  256. this.form.deposit = this.deposit
  257. this.form.productId = this.fatherData.id
  258. if (this.$utils.verificationAll(this.form, {
  259. "takeTime": '请选择交货时间',
  260. })) {
  261. return
  262. }
  263. this.$api('addProductOrder', this.form, res => {
  264. if (res.code == 200) {
  265. // 从vuex里面拿
  266. this.$store.state.cartInfo = res.result
  267. uni.navigateTo({
  268. url: `/pages_order/tradingPlatform/confirmOrder`,
  269. });
  270. }
  271. })
  272. },
  273. // 联系我们
  274. contactUs() {
  275. this.$refs.customerServicePopup.open()
  276. },
  277. // 选择地址
  278. selectAddress(e) {
  279. this.address = e
  280. this.$refs.addressPopup.close()
  281. },
  282. startDateChange(val) {
  283. this.$nextTick(() => {
  284. this.form.takeTime = dayjs(val.value).format("YYYY-MM-DD")
  285. });
  286. },
  287. startDateOpen() {
  288. console.log(1);
  289. this.$refs.startDateRef.open();
  290. },
  291. //地图上选择地址
  292. selectAddr() {
  293. Position.getLocation(res => {
  294. Position.selectAddress(res.longitude, res.latitude, success => {
  295. this.setAddress(success)
  296. })
  297. })
  298. Position.getLocationDetail(res => {
  299. console.log(res);
  300. this.form.address = res
  301. })
  302. },
  303. openAddress() {
  304. this.$refs.addressPopup.open('bottom')
  305. // this.getAddressList()
  306. this.$nextTick(() => {
  307. this.getAddressListA()
  308. })
  309. },
  310. //获取地址列表
  311. getAddressListA() {
  312. this.$refs.addressList
  313. .getAddressList()
  314. .then(res => {
  315. if (res == 0) {
  316. this.$refs.popup.close()
  317. return uni.navigateTo({
  318. url: '/pages_order/mine/address?type=back'
  319. })
  320. }
  321. })
  322. },
  323. //提取用户选择的地址信息复制给表单数据
  324. setAddress(res) {
  325. //经纬度信息
  326. this.form.latitude = res.latitude
  327. this.form.longitude = res.longitude
  328. if (!res.address && res.name) { //用户直接选择城市的逻辑
  329. return this.form.currentRegion = res.name
  330. }
  331. if (res.address || res.name) {
  332. return this.form.currentRegion = res.address + res.name
  333. }
  334. this.form.currentRegion = '' //用户啥都没选就点击勾选
  335. },
  336. }
  337. }
  338. </script>
  339. <style scoped lang="scss">
  340. .now-order {
  341. background-color: #FFF;
  342. height: 100vh;
  343. .frame {
  344. .title {
  345. display: flex;
  346. font-size: 30rpx;
  347. font-weight: 700;
  348. padding: 0rpx 0 0rpx 20rpx;
  349. margin: 20rpx 0 0 0;
  350. >span:nth-of-type(1) {
  351. margin: 4rpx 0 0 8rpx;
  352. background-color: #FFF;
  353. }
  354. >span:nth-of-type(2) {
  355. margin: 0 0 0 8rpx;
  356. background-color: #FFF;
  357. }
  358. }
  359. .basic-info {
  360. display: flex;
  361. flex-direction: column;
  362. gap: 5rpx;
  363. background-color: #FFF;
  364. //margin-top: 20rpx;
  365. padding: 20rpx 20rpx 20rpx 20rpx;
  366. .Tip {
  367. display: flex;
  368. align-items: center;
  369. justify-content: center;
  370. .span {
  371. color: #999;
  372. font-size: 24rpx;
  373. }
  374. }
  375. .btns {
  376. width: 100%;
  377. display: flex;
  378. flex-direction: column;
  379. align-items: center;
  380. justify-content: center;
  381. gap: 20rpx;
  382. .ljxd {
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. width: 500rpx;
  387. height: 70rpx;
  388. border-radius: 40rpx;
  389. color: #FFF;
  390. font-size: 28rpx;
  391. margin: 20rpx 10rpx 0 0;
  392. background: $uni-color;
  393. //margin-top: 20rpx;
  394. border-radius: 40rpx;
  395. }
  396. .lxwm {
  397. display: flex;
  398. align-items: center;
  399. justify-content: center;
  400. width: 500rpx;
  401. height: 70rpx;
  402. border-radius: 40rpx;
  403. color: #000000;
  404. font-size: 28rpx;
  405. margin: 20rpx 10rpx 0 0;
  406. background: #f1f1f1;
  407. //margin-top: 20rpx;
  408. border-radius: 40rpx;
  409. }
  410. .tip {
  411. display: flex;
  412. align-items: center;
  413. justify-content: center;
  414. font-size: 24rpx;
  415. color: #999;
  416. //width: 500rpx;
  417. }
  418. }
  419. .item {
  420. display: flex;
  421. align-items: center;
  422. background-color: #FFF;
  423. margin: 10rpx 0;
  424. padding: 10rpx 20rpx;
  425. >view:nth-of-type(1) {
  426. width: 30%;
  427. // font-weight: 700;
  428. }
  429. >view:nth-of-type(2) {
  430. flex: 1;
  431. border-radius: 10rpx;
  432. overflow: hidden;
  433. input {
  434. background-color: #FFF;
  435. font-size: 28rpx;
  436. padding: 16rpx 8rpx 16rpx 15rpx;
  437. }
  438. }
  439. .list-video{
  440. display: flex;
  441. flex-wrap: wrap;
  442. video{
  443. width: 480rpx;
  444. height: 270rpx;
  445. }
  446. }
  447. }
  448. .performanceBond {
  449. display: flex;
  450. align-items: center;
  451. background-color: #FFF;
  452. height: 80rpx;
  453. // margin: 10rpx 0 0 0;
  454. padding: 10rpx 0 0 20rpx;
  455. .key {
  456. width: 30%;
  457. // font-weight: 700;
  458. }
  459. .value {
  460. width: 70%;
  461. border-radius: 10rpx;
  462. overflow: hidden;
  463. input {
  464. background-color: #FFF;
  465. font-size: 28rpx;
  466. padding: 16rpx 8rpx 16rpx 15rpx;
  467. }
  468. }
  469. }
  470. .addressA {
  471. display: flex;
  472. align-items: center;
  473. background-color: #FFF;
  474. // height: 80rpx;
  475. // margin: 10rpx 0 0 0;
  476. //padding: 10rpx 0 0 20rpx;
  477. .title {
  478. display: flex;
  479. align-items: center;
  480. justify-content: flex-start;
  481. font-weight: 400;
  482. width: 30%;
  483. }
  484. .address {
  485. width: 70%;
  486. display: flex;
  487. padding: 20rpx;
  488. background-color: #fff;
  489. image {
  490. width: 30rpx;
  491. height: 30rpx;
  492. margin: 10rpx;
  493. }
  494. view {
  495. //margin: 20rpx;
  496. overflow: hidden; //超出的文本隐藏
  497. text-overflow: ellipsis; //溢出用省略号显示
  498. white-space: nowrap; //溢出不换行
  499. }
  500. .icon {
  501. display: flex;
  502. justify-content: center;
  503. align-items: center;
  504. margin-left: auto;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. }
  511. </style>