detail.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <style lang="less">
  2. .order-bg{
  3. background: linear-gradient(180deg, #ef4034 0%, rgba(1, 149, 96, 0.00) 100%);
  4. width: 100%;
  5. height: 440rpx;
  6. position: fixed;
  7. }
  8. page {
  9. background: #F5F5F5;
  10. }
  11. .app-body{
  12. position: relative;
  13. z-index: 1;
  14. padding: 10px;
  15. .address-info{
  16. border-radius: 10px;
  17. background: #FFF;
  18. padding: 12px;
  19. .icon{
  20. image{width: 30px;height: 30px;}
  21. }
  22. .info{width: calc(100% - 40px);margin-left: 10px;}
  23. .p-title{
  24. .p-name{color: #000;font-size: 14px;}
  25. .p-tel{font-size: 12px;color: #ccc;margin-left: 10px;}
  26. }
  27. .address{font-size: 14px;color:#000;}
  28. }
  29. .goods{
  30. background: #FFF;
  31. margin-top: 10px;
  32. border-radius: 10px;
  33. padding: 12px;
  34. .goods-item{
  35. margin-bottom: 20px;
  36. .img{
  37. width: 90px;height: 90px;
  38. image{width: 100%;height:100%;margin-right: 15px;border-radius: 10px;}
  39. }
  40. .item{
  41. width: calc(100% - 105px);
  42. margin-left: 15px;
  43. .title{
  44. width: 100%;
  45. color: #484747;
  46. font-size: 14px;
  47. font-weight: 600;
  48. overflow: hidden;
  49. text-overflow: ellipsis;
  50. display: -webkit-box;
  51. -webkit-line-clamp: 2;
  52. -webkit-box-orient: vertical;
  53. }
  54. .tag{
  55. font-size: 12px;
  56. color: #AFAFAF;
  57. font-size: 400;
  58. }
  59. .price{
  60. color: #f1851e;
  61. font-size: 18px;
  62. font-weight: 600;
  63. }
  64. .old-price{
  65. color: #7E7E7E;
  66. font-size: 10px;
  67. text-decoration: line-through;
  68. margin-left: 5px;
  69. }
  70. .xc{
  71. color: #7E7E7E;
  72. font-size: 10px;
  73. }
  74. }
  75. }
  76. }
  77. .detail-item{
  78. padding: 0 15px;
  79. height: 50px;
  80. background-color: #fff;
  81. margin-top: 10px;
  82. display: flex;
  83. align-items: center;
  84. color: #3F3E3E;
  85. font-size: 14px;
  86. border-radius: 10px;
  87. }
  88. .detail-items{
  89. background-color: #fff;
  90. border-radius: 10px;
  91. margin-top: 10px;
  92. .item{
  93. padding: 0 15px;
  94. height: 50px;
  95. display: flex;
  96. align-items: center;
  97. color: #3F3E3E;
  98. font-size: 14px;
  99. .pw-right{
  100. margin-left: auto;
  101. color: #7E7E7E;
  102. }
  103. }
  104. }
  105. }
  106. .zfen-view{height: 18px;}
  107. .zfen-view .zfen{
  108. overflow: hidden;
  109. text-overflow:ellipsis;
  110. white-space: nowrap;
  111. color: #ef4034;font-size: 10px;border: 1px solid #ef4034;padding: 0px 2px;display: inline-block;vertical-align:top;border-radius: 2px;}
  112. .zfen-view .zfen text{font-weight: bold;margin: 0px 1px;}
  113. .pay-btn{
  114. position: fixed;
  115. height: 60px;
  116. bottom: 0;
  117. left: 0;
  118. right: 0;
  119. display: flex;
  120. align-items: center;
  121. justify-content: flex-end;
  122. background-color: #fff;
  123. .bp-left{
  124. color: #7E7E7E;
  125. font-size: 16px;
  126. }
  127. .bp-left text:last-child{
  128. color: #f1851e;
  129. font-weight: 500;
  130. }
  131. .bp-right{
  132. width: 140px;
  133. height: 40px;
  134. text-align: center;
  135. line-height: 40px;
  136. color: #fff;
  137. background: #ef4034;
  138. border-radius: 100px;
  139. font-size: 16px;
  140. margin: 0 15px 0 20px;
  141. }
  142. }
  143. </style>
  144. <template>
  145. <view >
  146. <view class="order-bg"></view>
  147. <view class="app-body">
  148. <view id="mtop">
  149. <uni-nav-bar color="#fff" :border="false" statusBar backgroundColor="transparent" left-icon="left" @clickLeft="utils.navigateBack()" fixed title="订单详情"></uni-nav-bar>
  150. </view>
  151. <scroll-view v-if="order != null" scroll-y :style="'height:calc(100vh - ' + topHeight + 'px - ' + h5Foot + 'px)'">
  152. <view class="address-info fx-r fx-bc">
  153. <view class="icon"><image src="/static/img/shop-address.png"></image></view>
  154. <view class="info">
  155. <view class="p-title">
  156. <text class="p-name">{{order.name}}</text>
  157. <text class="p-tel">{{order.tel}}</text>
  158. </view>
  159. <view class="address">{{order.address}}</view>
  160. </view>
  161. </view>
  162. <view class="goods">
  163. <view class="goods-item fx-r" v-for="(v,k) of order.info" :key="k">
  164. <view class="img">
  165. <image :src="v.img" mode="aspectFill"></image>
  166. </view>
  167. <view class="item">
  168. <view class="title">{{v.title}}</view>
  169. <view class="tag">{{v.sku_text}}</view>
  170. <view class="prices fx-r fx-bc">
  171. <view class="price">¥{{v.price}}</view>
  172. <view class="old-price">¥{{v.old_price}}</view>
  173. <view class="fx-g1"></view>
  174. <view class="xc">x{{v.count}}</view>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <view class="detail-item fx-r">
  180. <view class="title">物流方式</view>
  181. <view class="fx-g1"></view>
  182. <view class="value">包邮</view>
  183. </view>
  184. <view class="detail-items">
  185. <view class="item">
  186. <view class="pw-left">订单编号</view>
  187. <view class="pw-right">{{order.order_id}}</view>
  188. </view>
  189. <view class="item" v-if="order.express_num">
  190. <view class="pw-left">物流单号</view>
  191. <view class="pw-right">{{order.express_num}}</view>
  192. </view>
  193. <view class="item">
  194. <view class="pw-left">订单状态</view>
  195. <view class="pw-right">
  196. <view v-if="order.status == 0">未付款</view>
  197. <view v-if="order.status == 1">买家已付款</view>
  198. <view v-if="order.status == 2">卖家已发货</view>
  199. <view v-if="order.status == 3">买家已收货</view>
  200. <view v-if="order.status == -1">订单已关闭</view>
  201. </view>
  202. </view>
  203. <view class="item">
  204. <view class="pw-left">下单时间</view>
  205. <view class="pw-right">{{order.time}}</view>
  206. </view>
  207. <view class="item">
  208. <view class="pw-left">订单总金额</view>
  209. <view class="pw-right">{{order.allmoney}}</view>
  210. </view>
  211. <view class="item">
  212. <view class="pw-left">提货积分抵扣</view>
  213. <view class="pw-right" style="color: #f1851e;font-weight: bold;">{{order.balance}}</view>
  214. </view>
  215. <view class="item">
  216. <view class="pw-left">实付金额</view>
  217. <view class="pw-right" >{{order.pay_money}}</view>
  218. </view>
  219. <view class="item" v-if="order.pay_time != ''">
  220. <view class="pw-left">支付时间</view>
  221. <view class="pw-right">{{order.pay_time}}</view>
  222. </view>
  223. <view class="item" v-if="order.fa_time != ''">
  224. <view class="pw-left">发货时间</view>
  225. <view class="pw-right">{{order.fa_time}}</view>
  226. </view>
  227. <view class="item" v-if="order.ok_time != ''">
  228. <view class="pw-left">收货时间</view>
  229. <view class="pw-right">{{order.ok_time}}</view>
  230. </view>
  231. </view>
  232. <view style="height: 60px;"></view>
  233. </scroll-view>
  234. <view v-if="order != null">
  235. <view v-if="order.status == 0">
  236. <view class="pay-btn">
  237. <view class="bp-left">
  238. <text>共:</text>
  239. <text>¥{{order.pay_money}}</text>
  240. </view>
  241. <view class="bp-right" @click="toPayClick()">立即购买</view>
  242. </view>
  243. </view>
  244. <view v-if="order.status == 2">
  245. <view class="pay-btn">
  246. <view class="bp-right" @click="flowClick()">查看物流</view>
  247. </view>
  248. </view>
  249. </view>
  250. </view>
  251. <ui-check-pay ref="checkpay"></ui-check-pay>
  252. </view>
  253. </template>
  254. <script>
  255. import uiCheckPay from '@/components/ui-pay/pay.vue';
  256. export default {
  257. components: {
  258. uiCheckPay
  259. },
  260. data() {
  261. return {
  262. order:null,
  263. order_id:0,
  264. topHeight : 50,
  265. h5Foot : 0
  266. }
  267. },
  268. onLoad(options) {
  269. this.order_id = options.id;
  270. this.get_order_info();
  271. // #ifdef H5
  272. this.h5Foot = 50;
  273. // #endif
  274. },
  275. methods: {
  276. // 我的订单详情
  277. get_order_info(){
  278. uni.showLoading({ title: '获取数据中..' });
  279. this
  280. .request
  281. .post("userOrderInfo",{id:this.order_id})
  282. .then(res=>{
  283. uni.hideLoading();
  284. if(res.code == 200) {
  285. this.order = res.data;
  286. this.$nextTick(()=>{
  287. uni.createSelectorQuery().in(this)
  288. .select("#mtop").boundingClientRect(res=>{
  289. this.topHeight = res.height;
  290. }).exec();
  291. });
  292. } else {
  293. uni.showModal({title: '系统提示',content: res.msg,showCancel: false});
  294. }
  295. })
  296. .catch(err=>{
  297. uni.hideLoading();
  298. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  299. });
  300. },
  301. // 查看物流
  302. flowClick() {
  303. uni.navigateTo({
  304. url: `../flow/flow?id=${this.order_id}&orderId=${this.order.order_id}&path_img=${this.order.info[0].img}`
  305. })
  306. },
  307. // 去支付
  308. toPayClick() {
  309. this.$refs.checkpay.show(this.order.order_id,()=>{
  310. this.$refs.checkpay.hide();
  311. });
  312. },
  313. }
  314. }
  315. </script>