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

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