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

580 lines
13 KiB

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