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

469 lines
11 KiB

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