confirm.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <view class="address" v-if="storeInfo && storeInfo.service_type==2">
  4. </view>
  5. <view class="location" @click="toDetail">
  6. <view class="left">
  7. <view class="name">{{poi_name}}</view>
  8. <view class="desc"><image src="/static/image/location.png"></image>距您{{juli}}公里</view>
  9. </view>
  10. <view class="right"><image src="/static/image/right.png"></image></view>
  11. </view>
  12. <view class="goods" v-if="goodsInfo">
  13. <view class="goods-info">
  14. <view class="image"><image :src="goodsInfo.product_img"></image></view>
  15. <view class="info">
  16. <view class="name">{{ goodsInfo.product_name }}</view>
  17. <view class="desc">x {{goodsInfo.count}}</view>
  18. </view>
  19. </view>
  20. <view class="goods-item">
  21. <view class="left">商品总额</view>
  22. <view class="right">¥{{goodsInfo.order_amount}}</view>
  23. </view>
  24. <view class="goods-item">
  25. <view class="left">商品优惠</view>
  26. <view class="right red">¥{{goodsInfo.order_amount}}</view>
  27. </view>
  28. </view>
  29. <view class="empty-data" v-else>
  30. <u-skeleton
  31. rows="3"
  32. title
  33. loading
  34. ></u-skeleton>
  35. </view>
  36. <view class="order-time" v-if="storeInfo && storeInfo.service_type==1">
  37. <view class="title">期望时间</view>
  38. <view class="msg" @click="selectTime(1)">
  39. {{timeStr?timeStr:'请选择'}}
  40. <view class="right"><image src="/static/image/right.png"></image></view>
  41. </view>
  42. </view>
  43. <view class="order-msg">
  44. <view class="title">订单备注</view>
  45. <view class="msg"><textarea class="textarea" placeholder="请输入" v-model="msg" :rows="5"></textarea></view>
  46. </view>
  47. <view class="flx-footer">
  48. <view class="footer-btn">
  49. <view class="price"><text class="desc">已优惠:¥{{goodsInfo.order_amount}},</text>合计<text class="money">¥0</text></view>
  50. <view class="btn-group"><button :disabled="disabled" class="btn">{{disabled?'处理中...':'确认兑换'}}</button></view>
  51. </view>
  52. <view class="footer-safe"></view>
  53. </view>
  54. <uni-popup ref="timepopup" type="bottom" borderRadius="10px 10px 0 0" backgroundColor="#F8F8F8">
  55. <view class="time-select">
  56. <view class="title">选择时间<view class="close" @click="selectTime(2)"><image src="/static/image/round_close.png"></image></view> </view>
  57. </view>
  58. <view class="time-body">
  59. <view class="time-left"></view>
  60. <view class="time-right"></view>
  61. </view>
  62. <view class="time-btn">
  63. <button class="btn">确认选择</button>
  64. </view>
  65. </uni-popup>
  66. </view>
  67. </template>
  68. <script>
  69. var app;
  70. import * as Api from "@/static/api/order.js";
  71. export default {
  72. data() {
  73. return {
  74. disabled:false,
  75. order:"",
  76. poi_name:"",
  77. poi_id:"",
  78. juli:"",
  79. goodsInfo:null,
  80. storeInfo:null,
  81. timeStr:null,
  82. timeState:false,
  83. timeData:[]
  84. }
  85. },
  86. onLoad({order,poi_id,poi_name,juli}) {
  87. app = this;
  88. app.order = order;
  89. app.poi_id = poi_id;
  90. app.poi_name = poi_name;
  91. app.juli = juli;
  92. app.getOrder();
  93. },
  94. methods: {
  95. selectTime(type){
  96. if (type == 1) {
  97. app.$refs.timepopup.open()
  98. }
  99. if (type == 2) {
  100. app.$refs.timepopup.close()
  101. }
  102. },
  103. getOrder(){
  104. Api.detail({"order":app.order}).then((res)=>{
  105. if (res.code == 0) {
  106. return app.$dialog.showSuccess(res.info,"none",function(){
  107. uni.navigateBack()
  108. });
  109. }
  110. app.goodsInfo = res.data.order;
  111. app.storeInfo = res.data.store;
  112. app.timeData = res.data.time
  113. });
  114. },
  115. toDetail(){
  116. uni.navigateTo({
  117. url:"/pages/order/store?type=1&order="+app.order
  118. })
  119. },
  120. }
  121. }
  122. </script>
  123. <style>
  124. .time-body{height: 30vh;}
  125. .time-body .time-left{width: 30%;background-color: #F5FAFD;height: 100%;overflow-y: auto;}
  126. .time-body .time-right{width: calc(70% - 20upx);margin-left: 20upx;}
  127. .time-select .title{height: 100upx;line-height: 100upx;display: flex;align-items: center;justify-content: space-between;font-size: 28upx;padding: 0 20upx;font-weight: bold;}
  128. .time-select image{width: 40upx;height: 40upx;vertical-align: middle;}
  129. .time-btn{padding: 20upx;}
  130. .location,.order-time{background-color: #fff;border-radius: 20upx;padding: 20upx;width: calc(95% - 40upx);margin: 20upx auto;display: flex;align-items: center;justify-content: space-between;}
  131. .location .right image{width: 40upx;height: 40upx;vertical-align: middle;}
  132. .location .name{font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20upx;}
  133. .location .desc{color: #666;font-size: 28upx;display: flex;align-items: center;}
  134. .location .desc image{width: 40upx;height: 40upx;margin-right: 20upx;}
  135. .goods,.order-msg{background-color: #fff;border-radius: 20upx;padding: 20upx;width: calc(95% - 40upx);margin: 20upx auto;}
  136. .goods .goods-info{display: flex;align-items: center;}
  137. .goods .goods-info .info{flex: 1;margin-left: 20upx;}
  138. .goods .goods-info .image image{width: 160upx;height: 160upx;}
  139. .goods .goods-info .name{font-size: 32upx;color: #333;line-height: 46upx;font-weight: bold;margin-bottom: 20upx;}
  140. .goods .goods-info .desc{color: #666;font-size: 28upx;line-height: 48upx;}
  141. .goods .goods-item{display: flex;align-items: center;border-top: 2upx solid #f8f8f8;line-height: 80upx;justify-content: space-between;font-size: 28upx;color: #333;}
  142. .goods .goods-item .right.red{color: #f00;}
  143. .order-time .title{font-size: 28upx;}
  144. .order-time image{width: 40upx;height: 40upx;vertical-align: middle;}
  145. .order-time .msg{display: flex;align-items: center;font-size: 28upx;color: #333;}
  146. .order-msg .title{color: #333;font-size: 28upx;border-bottom: 2upx solid #f8f8f8;margin-bottom: 20upx;padding-bottom: 20upx;}
  147. .order-msg .textarea{width: 100%;height: 120upx;font-size: 28upx;}
  148. .flx-footer{position: fixed;bottom: 0;background-color: #fff;padding: 20upx;border-top: 2upx solid #f8f8f8;left: 0;right: 0;}
  149. .flx-footer .footer-safe {height: env(safe-area-inset-bottom);width: 100%;}
  150. .flx-footer .btn,.time-btn .btn{font-size: 28rpx;height: 80upx;border-radius: 10upx;line-height: 80upx;text-align: center;width: 100%;color: #333;background-color: #224d7a;color: #fff;border:2upx solid #224d7a;}
  151. .flx-footer .btn[disabled],.flx-footer .btn.disabled{background-color: rgba(34, 77, 122, 0.3);}
  152. .flx-footer .footer-btn{display: flex;align-items: center;justify-content: space-between;}
  153. .flx-footer .footer-btn text.desc{color: #666;font-size: 24upx;}
  154. .flx-footer .footer-btn text.money{color: #f00;font-size: 28upx;font-weight: bold;}
  155. .flx-footer .footer-btn .price{color: #333;font-size: 28upx;}
  156. </style>