confirm_delivery.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="wrap">
  3. <navbar :iSimmersive="false" title-color="#ffffff" background="#1b43c4" :placeholder="true" title="确认收货"></navbar>
  4. <info v-if="isError"></info>
  5. <view v-if="!isError">
  6. <view class="goods">
  7. <view class="title">
  8. <text>共{{order.item.length}}件商品</text>
  9. </view>
  10. <view class="goods-box">
  11. <view
  12. class="goods-item clear"
  13. v-for="(value,index) in order.item"
  14. :key="index"
  15. >
  16. <view class="goods-img">
  17. <image :src="value.thumb_image">
  18. </view>
  19. <view class="goods-info">
  20. <view class="t">
  21. <text>{{value.title}}</text>
  22. <text>¥{{value.sell_price}}</text>
  23. </view>
  24. <view class="b">
  25. <text>{{value.spec}}</text>
  26. <text>× {{value.nums}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="order">
  33. <view class="list clear">
  34. <view class="list-box clear">
  35. <view>商品金额:</view>
  36. <view>{{order.real_amount}}</view>
  37. </view>
  38. <view class="list-box clear">
  39. <view>运费金额:</view>
  40. <view>{{order.payable_freight}}</view>
  41. </view>
  42. <view class="list-box clear">
  43. <view>订单总额:</view>
  44. <view class="money">{{order.order_amount}}</view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="btn">
  49. <view @click="onSubmit">确认收货</view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import info from '@/components/tool/info.vue'
  56. export default {
  57. components:{
  58. info
  59. },
  60. data(){
  61. return {
  62. isError: false,
  63. isSubmit: false,
  64. orderId: 0,
  65. order:{
  66. item: [],
  67. order_amount: "",
  68. order_no: "",
  69. payable_freight: '',
  70. payable_amount: "",
  71. promotions: "",
  72. real_amount: ""
  73. }
  74. };
  75. },
  76. onLoad(options) {
  77. this.isError = false;
  78. this.orderId = options.id;
  79. this.$http.getOrderDeliveryList({
  80. id: this.orderId
  81. }).then((res)=>{
  82. if(res.status){
  83. this.order = res.data;
  84. }else{
  85. this.$utils.msg(res.info);
  86. }
  87. this.isError = false;
  88. }).catch((err)=>{
  89. this.isError = true;
  90. });
  91. },
  92. methods: {
  93. onSubmit(){
  94. if(this.isSubmit){
  95. return false;
  96. }
  97. this.$utils.showLoading();
  98. this.isSubmit = true;
  99. this.$http.getOrderConfirmDelivery({
  100. id: this.orderId
  101. }).then(res=>{
  102. this.$utils.hideLoading();
  103. if(res.status){
  104. this.$utils.msg(res.info);
  105. this.$utils.redirectTo('order/detail',{
  106. id: this.orderId
  107. });
  108. }else{
  109. this.$utils.msg(res.info);
  110. }
  111. this.isSubmit = false;
  112. }).catch(err=>{
  113. this.$utils.hideLoading();
  114. this.isSubmit = false;
  115. this.$utils.msg("网络出错,请检查网络是否连接");
  116. });
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .money{ color: #fc4141; }
  123. .goods{
  124. background-color: #fff;
  125. margin-top: 30rpx;
  126. padding-bottom: 20rpx;
  127. .title{
  128. width: 100%;
  129. margin: 0 auto;
  130. color: #666;
  131. font-size: 28rpx;
  132. height: 80rpx;
  133. line-height: 80rpx;
  134. border-bottom: 1px solid #eee;
  135. text {
  136. padding-left: 20rpx;
  137. }
  138. }
  139. .goods-box{
  140. padding: 0 30rpx;
  141. .goods-item {
  142. padding-top: 10px;
  143. .goods-img {
  144. width: 150rpx;
  145. height: 150rpx;
  146. display: inline-block;
  147. float: left;
  148. image {
  149. width: 100%;
  150. height: 100%;
  151. }
  152. }
  153. .goods-info {
  154. display: inline-block;
  155. width: 72%;
  156. font-size: 28rpx;
  157. float: right;
  158. .t {
  159. width: 100%;
  160. height: 90rpx;
  161. text:first-child{
  162. float: left;
  163. display: -webkit-box;overflow: hidden;-webkit-line-clamp: 2;
  164. -webkit-box-orient: vertical;
  165. width: 70%;
  166. }
  167. text:last-child{
  168. width: 30%;
  169. float: right;
  170. text-align: right;
  171. }
  172. }
  173. .b{
  174. width: 100%;
  175. height: 80rpx;
  176. font-size: 26rpx;
  177. text:first-child{
  178. float: left;
  179. color: #999;
  180. }
  181. text:last-child{
  182. float: right;
  183. color: #666;
  184. }
  185. }
  186. }
  187. }
  188. }
  189. }
  190. .order{
  191. background-color: #fff;
  192. margin-top: 30rpx;
  193. padding-bottom: 20rpx;
  194. .list {
  195. width: 100%;
  196. .list-box{
  197. width: 92%;
  198. height: 80rpx;
  199. line-height: 80rpx;
  200. margin: 0 auto;
  201. font-size: 28rpx; color: #333;
  202. border-bottom: 1px solid #ebedf0;
  203. view{ display: inline-block; }
  204. view:first-child { float: left; }
  205. view:last-child { float: right; }
  206. }
  207. }
  208. }
  209. .btn{
  210. width: 90%;
  211. margin: 40rpx auto;
  212. margin-top: 40rpx;
  213. view {
  214. background-color: #1b43c4;
  215. border-radius: 30rpx;
  216. font-size: 28rpx;
  217. text-align: center;
  218. height: 80rpx;
  219. line-height: 80rpx;
  220. color: #fff;
  221. }
  222. }
  223. </style>