confirmOrder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <view class="bg">
  3. <view class="address" >
  4. <view>
  5. <u--image width="40rpx" height="40rpx" src="/static/market/icomm_dizhi.png" ></u--image>
  6. </view>
  7. <view class="address_text">
  8. <view class="flex_start">
  9. <view v-if="orderDetailData.defaultAddress=='1'" class="mr">默认</view>
  10. <!-- <view class="mr1">{{orderDetailData.deliveryAddress}}</view> -->
  11. </view>
  12. <view class="address_conter">
  13. {{orderDetailData.deliveryAddress}}
  14. </view>
  15. <view class="flex_start address_bottom" >
  16. <view>{{orderDetailData.consignee}}</view>
  17. <view style="margin-left:8rpx">{{orderDetailData.contact}}</view>
  18. </view>
  19. </view>
  20. <view @click="openaddress">
  21. <u--image width="40rpx" height="40rpx" src="/static/myinfo/btn_right.png" ></u--image>
  22. </view>
  23. </view>
  24. <view class="commodity">
  25. <view class="commodity_title">厦门海嘉成商城</view>
  26. <view class="mc_item" v-for="(item,index) in orderDetailData.detailVoList" :key="index">
  27. <view class="item_swipe">
  28. <view class="box_img">
  29. <u--image radius='16rpx' width="180rpx" height="180rpx" :src="item.fileList[0].fileUrl" ></u--image>
  30. </view>
  31. <view class="box_text">
  32. <view class="box_title">
  33. {{ item.productTitle }}
  34. </view>
  35. <view class="box_type">
  36. 已选择 {{item.specsName}}
  37. </view>
  38. <view class="box_num">
  39. <view class="bn_left">
  40. ¥{{item.price}}
  41. </view>
  42. <view class="bn_right">
  43. {{ 'x' + item.num }}
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view style="margin-left: 12px;margin-bottom: 12px;" class="PriceInfo_item">
  50. <view>备注</view>
  51. <view @click="openPopup()" style="color: #999999;display: flex;">
  52. <view class="beizhu">{{ remark == ''?'备注留言信息':remark }}</view>
  53. <u--image width="40rpx" height="40rpx" src="/static/myinfo/btn_right.png" ></u--image>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="PriceInfo">
  58. <view class="PriceInfo_title">费用明细</view>
  59. <view class="PriceInfo_item">
  60. <view>商品总额</view>
  61. <view>¥ {{orderDetailData.productPrice}}</view>
  62. </view>
  63. <view class="PriceInfo_item">
  64. <view>加工费用</view>
  65. <view>¥ {{orderDetailData.processPrice}}</view>
  66. </view>
  67. <view class="PriceInfo_item">
  68. <view>包装袋费</view>
  69. <view>¥ {{orderDetailData.packagePrice}}</view>
  70. </view>
  71. <!-- <view class="PriceInfo_item">
  72. <view>优惠券</view>
  73. <view>¥ {{item.price}}</view>
  74. </view> -->
  75. <view class="PriceInfo_item">
  76. <view>总价</view>
  77. <view style="color: #F6514F;font-weight: bold;font-size: 28rpx;">¥ {{orderDetailData.totalPrice}}</view>
  78. </view>
  79. </view>
  80. <u-popup mode="center" :round="10" :show="popupShow" @close="close" @open="open">
  81. <view style="width: 700rpx;height: 300rpx;padding: 20rpx;">
  82. <view>
  83. <u-form-item :labelWidth="labelWidth" label="备注信息" borderBottom >
  84. <u--textarea v-model="beizhu" placeholder="请输入备注信息"
  85. count maxlength="200" ></u--textarea>
  86. </u-form-item>
  87. </view>
  88. <view style="display: flex;
  89. justify-content: center;
  90. margin-top: 10rpx;">
  91. <view @click="submitbeizhu" class="bm_btn2">
  92. 保存
  93. </view>
  94. </view>
  95. </view>
  96. </u-popup>
  97. <view style="height: 200rpx;">
  98. </view>
  99. <view class="btnBox" >
  100. <view class="bm_btn">
  101. <view @click="cancelOrder" class="bm_btn1">取消订单</view>
  102. <view @click="submitOrder" class="bm_btn2">提交订单</view>
  103. </view>
  104. </view>
  105. </view>
  106. </template>
  107. <script>
  108. import {orderDetail,cancelOrderByConfirm,confirmOrder,deliveryAddressList} from '@/http/api/common.js'
  109. import * as util from '@/pages/util/util.js'
  110. export default {
  111. components: {
  112. },
  113. data() {
  114. return {
  115. orderDetailData:{
  116. deliveryAddress:'',
  117. deliveryAddressId:'',
  118. defaultAddress:'',
  119. consignee:'',
  120. contact:'',
  121. detailVoList:[],//订单列表
  122. },
  123. beizhu:'',
  124. remark:'',
  125. labelWidth:100,
  126. popupShow:false,
  127. AddressData:{}
  128. }
  129. },
  130. async onLoad(e) {
  131. if (e?.orderId) {
  132. await this.getOrderDetail(e?.orderId)
  133. }
  134. },
  135. onShow(){
  136. let selectAddress = uni.getStorageSync('selectAddress');
  137. if (selectAddress) {
  138. selectAddress = JSON.parse(selectAddress)
  139. this.orderDetailData.deliveryAddress = selectAddress.address
  140. this.orderDetailData.defaultAddress = selectAddress.defaultAddress
  141. this.orderDetailData.deliveryAddressId = selectAddress.id
  142. }
  143. },
  144. methods: {
  145. async getdeliveryAddressList(){
  146. let res = await deliveryAddressList()
  147. if (res.data.code == 200) {
  148. if (res.data.data) {
  149. this.AddressData = res.data.data.find(v=>v.defaultAddress == '1')
  150. }
  151. }
  152. },
  153. openPopup() {
  154. this.popupShow = true
  155. },
  156. open() {
  157. },
  158. submitbeizhu(){
  159. this.close()
  160. this.remark = this.beizhu
  161. },
  162. close() {
  163. this.popupShow = false
  164. // console.log('close');
  165. },
  166. async getOrderDetail(id){
  167. let res = await orderDetail(id)
  168. if (res.data.code ==200) {
  169. this.orderDetailData = res.data.data
  170. }
  171. },
  172. async cancelOrder(){
  173. //取消订单
  174. let res = await cancelOrderByConfirm(this.orderDetailData.id)
  175. util.toastFunc('取消成功',()=>{
  176. uni.switchTab({
  177. url: '/pages/market/market',
  178. });
  179. })
  180. },
  181. async submitOrder(){
  182. //提交订单
  183. let res = await confirmOrder({
  184. remark:this.remark,
  185. deliveryAddressId:this.orderDetailData.deliveryAddressId,
  186. },this.orderDetailData.id)
  187. util.toastFunc('提交订单成功',()=>{
  188. uni.switchTab({
  189. url: '/pages/market/market',
  190. });
  191. })
  192. },
  193. openaddress(){
  194. uni.navigateTo({
  195. url: '/pages/myinfo/address?selectAddress=1'
  196. });
  197. }
  198. }
  199. }
  200. </script>
  201. <style>
  202. .bg{
  203. width: 750rpx;
  204. height: 100vh;
  205. min-height: 1160rpx;
  206. background: #F1F1F1;
  207. border-radius: 0rpx 0rpx 0rpx 0rpx;
  208. display: flex;
  209. flex-direction: column;
  210. align-items: center;
  211. }
  212. .address{
  213. width: 702rpx;
  214. height: 200rpx;
  215. background: #FFFFFF;
  216. border-radius: 16rpx 16rpx 16rpx 16rpx;
  217. opacity: 1;
  218. margin-top: 24rpx;
  219. display: flex;
  220. flex-direction: row;
  221. align-items: center;
  222. justify-content: space-evenly;
  223. }
  224. .commodity{
  225. width: 702rpx;
  226. height: auto;
  227. background: #FFFFFF;
  228. border-radius: 16rpx 16rpx 16rpx 16rpx;
  229. opacity: 1;
  230. margin-top: 24rpx;
  231. }
  232. .PriceInfo{
  233. width: 702rpx;
  234. height: 400rpx;
  235. background: #FFFFFF;
  236. border-radius: 16rpx 16rpx 16rpx 16rpx;
  237. opacity: 1;
  238. margin-top: 24rpx;
  239. display: flex;
  240. align-items: center;
  241. justify-content: space-evenly;
  242. flex-direction: column;
  243. }
  244. .PriceInfo_item{
  245. display: flex;
  246. justify-content: space-between;
  247. width: 654rpx;
  248. height: 40rpx;
  249. font-size: 28rpx;
  250. font-weight: 500;
  251. color: #666666;
  252. line-height: 36rpx;
  253. }
  254. .PriceInfo_title{
  255. display: flex;
  256. width: 654rpx;
  257. height: 40rpx;
  258. font-size: 32rpx;
  259. font-weight: bold;
  260. color: #333333;
  261. line-height: 36rpx;
  262. margin: 20rpx 0;
  263. }
  264. .btnBox{
  265. width: 750rpx;
  266. height: 100rpx;
  267. background: #FFFFFF;
  268. border-radius: 0rpx 0rpx 0rpx 0rpx;
  269. opacity: 1;
  270. position: fixed;
  271. z-index: 10088;
  272. bottom: 0;
  273. display: flex;
  274. flex-direction: row;
  275. align-items: center;
  276. justify-content: flex-end;
  277. }
  278. .bm_btn{
  279. display: flex;
  280. flex-direction: row;
  281. align-items: center;
  282. width: 450rpx;
  283. height: 72rpx;
  284. justify-content: space-evenly;
  285. }
  286. .bm_btn1{
  287. width: 200rpx;
  288. height: 72rpx;
  289. background: #EEEEEE;
  290. border-radius: 60rpx 60rpx 60rpx 60rpx;
  291. opacity: 1;
  292. font-size: 28rpx;
  293. font-weight: 500;
  294. color: #666;
  295. line-height: 72rpx;
  296. text-align: center;
  297. }
  298. .bm_btn2{
  299. width: 200rpx;
  300. height: 72rpx;
  301. background: #46A6FF;
  302. border-radius: 60rpx 60rpx 60rpx 60rpx;
  303. opacity: 1;
  304. font-size: 28rpx;
  305. font-weight: 500;
  306. color: #FFFFFF;
  307. line-height: 72rpx;
  308. text-align: center;
  309. }
  310. .flex_start{
  311. display: flex;
  312. justify-content: flex-start;
  313. align-items: center;
  314. }
  315. .mr{
  316. width: 64rpx;
  317. height: 32rpx;
  318. background: #FF8C33;
  319. border-radius: 8rpx 8rpx 8rpx 8rpx;
  320. opacity: 1;
  321. font-size: 24rpx;
  322. font-weight: 500;
  323. color: #FFFFFF;
  324. text-align: center;
  325. }
  326. .mr1{
  327. width: 440rpx;
  328. margin-left: 8rpx;
  329. font-size: 28rpx;
  330. font-weight: 500;
  331. color: #333333;
  332. }
  333. .commodity_title{
  334. width: 196rpx;
  335. height: 40rpx;
  336. font-size: 28rpx;
  337. font-weight: bold;
  338. color: #333333;
  339. line-height: 40rpx;
  340. padding: 24rpx 0 0 24rpx;
  341. }
  342. .address_text{
  343. width: 550rpx;
  344. height: 200rpx;
  345. display: flex;
  346. flex-direction: column;
  347. justify-content: center;
  348. }
  349. .address_conter{
  350. width: 550rpx;
  351. height: 45rpx;
  352. font-size: 32rpx;
  353. font-weight: bold;
  354. color: #333333;
  355. line-height: 45rpx;
  356. margin-top: 8rpx;
  357. display: -webkit-box;
  358. word-break: break-all;
  359. text-overflow: ellipsis;
  360. overflow: hidden;
  361. -webkit-box-orient: vertical;
  362. -webkit-line-clamp:1;
  363. }
  364. .address_bottom{
  365. width: 550rpx;
  366. height: 40rpx;
  367. font-size: 28rpx;
  368. font-weight: bold;
  369. color: #999999;
  370. margin-top: 8rpx;
  371. }
  372. .mc_item{
  373. width: 702rpx;
  374. height: 244rpx;
  375. background: #FFFFFF;
  376. border-radius: 16rpx 16rpx 16rpx 16rpx;
  377. opacity: 1;
  378. margin-top: 24rpx;
  379. }
  380. .item_swipe{
  381. width: 678rpx;
  382. height: 244rpx;
  383. background: #FFFFFF;
  384. border-radius: 16rpx 16rpx 16rpx 16rpx;
  385. opacity: 1;
  386. display: flex;
  387. align-items: center;
  388. flex-direction: row;
  389. padding-left: 24rpx;
  390. }
  391. .box_img{
  392. width: 180rpx;
  393. height: 180rpx;
  394. background-color: #999999;
  395. border-radius: 16rpx;
  396. }
  397. .box_text{
  398. width: 392rpx;
  399. height: 200rpx;
  400. margin-left: 20rpx;
  401. display: flex;
  402. flex-direction: column;
  403. justify-content: space-between;
  404. }
  405. .box_title{
  406. width: 392rpx;
  407. height: 40rpx;
  408. font-size: 28rpx;
  409. font-weight: bold;
  410. color: #333333;
  411. line-height: 40rpx;
  412. display: -webkit-box;
  413. word-break: break-all;
  414. text-overflow: ellipsis;
  415. overflow: hidden;
  416. -webkit-box-orient: vertical;
  417. -webkit-line-clamp:1;
  418. }
  419. .box_type{
  420. width: 410rpx;
  421. height: 48rpx;
  422. background: #EEEEEE;
  423. border-radius: 8rpx 8rpx 8rpx 8rpx;
  424. opacity: 1;
  425. font-size: 28rpx;
  426. font-weight: 500;
  427. color: #999999;
  428. padding-left: 24rpx;
  429. line-height: 48rpx;
  430. display: -webkit-box;
  431. word-break: break-all;
  432. text-overflow: ellipsis;
  433. overflow: hidden;
  434. -webkit-box-orient: vertical;
  435. -webkit-line-clamp:1;
  436. }
  437. .box_num{
  438. width: 410rpx;
  439. display: flex;
  440. justify-content: space-between;
  441. align-items: center;
  442. }
  443. .bn_left{
  444. width: 106rpx;
  445. height: 38rpx;
  446. font-size: 28rpx;
  447. font-weight: bold;
  448. color: #333333;
  449. line-height: 36rpx;
  450. }
  451. .beizhu{
  452. max-width: 500rpx;
  453. display: -webkit-box;
  454. word-break: break-all;
  455. text-overflow: ellipsis;
  456. overflow: hidden;
  457. -webkit-box-orient: vertical;
  458. -webkit-line-clamp:1;
  459. }
  460. </style>