info.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="zero">
  5. <scroll-view scroll-y="true" class="scroll-view">
  6. <view class="list-scroll-view">
  7. <view class="one">
  8. <view class="one_1">
  9. <text class="iconfont icon-dingweixiao"></text>
  10. </view>
  11. <view class="one_2">
  12. <view class="name">
  13. <text>{{info.address.name}}</text>
  14. <text>{{info.address.phone}}</text>
  15. </view>
  16. <view class="address">
  17. <text>{{info.address.province}}</text>
  18. <text>{{info.address.city}}</text>
  19. <text>{{info.address.area}}</text>
  20. <text>{{info.address.address}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="two">
  25. <view class="two_0">
  26. <text>{{info.status=='0'?'待付款':info.status=='1'?'已支付':info.status=='-1'?'取消订单':info.status=='2'?'发货中':info.status=='-2'?'已退款':info.status=='3'?'已收货':info.status=='-3'?'申请售后':info.status=='-4'?'正在售后中':info.status=='-5'?'售后已结束':'未识别'}}</text>
  27. </view>
  28. <view class="two_1" v-if="info.status=='0'">
  29. <view class="list" v-for="(item,index) in info.goods" :key="index">
  30. <view class="list_1">
  31. <text class="iconfont icon-shangdian"></text>
  32. <text>{{item.shop_name}}</text>
  33. </view>
  34. <view class="list_2">
  35. <view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
  36. <view class="url">
  37. <image class="image" :src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''" mode=""></image>
  38. </view>
  39. <view class="goodsname">
  40. {{tag.name}}
  41. </view>
  42. <view class="goodsother">
  43. <view class="price">
  44. ¥{{tag.sell_money}}
  45. </view>
  46. <view class="num">
  47. ×{{tag.buy_num}}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="two_2" v-else>
  55. <view class="list_1">
  56. <text class="iconfont icon-shangdian"></text>
  57. <text>{{info.shop.name}}</text>
  58. </view>
  59. <view class="list_2">
  60. <view class="goods" v-for="(item,index) in info.goods" :key="index">
  61. <view class="url">
  62. <image class="image" :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode=""></image>
  63. </view>
  64. <view class="goodsname">
  65. {{item.name}}
  66. </view>
  67. <view class="goodsother">
  68. <view class="price">
  69. ¥{{item.sell_money}}
  70. </view>
  71. <view class="num">
  72. ×{{item.buy_num}}
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="thr">
  80. <view class="thr_1">
  81. <text>商品金额</text>
  82. <text>¥{{info.total_detail.goods_total}}</text>
  83. </view>
  84. <view class="thr_1">
  85. <text>运费</text>
  86. <text>¥{{info.total_detail.freight_total}}</text>
  87. </view>
  88. <view class="thr_1">
  89. <text>实付金额</text>
  90. <text>¥{{info.total_detail.freight_total+info.total_detail.goods_total}}</text>
  91. </view>
  92. </view>
  93. <view class="four">
  94. <view class="four_1">
  95. <text>订单号</text>
  96. <text>{{info.no}}</text>
  97. </view>
  98. <view class="four_1">
  99. <text>订单状态</text>
  100. <text>{{info.status=='0'?'待付款':info.status=='1'?'已支付':info.status=='-1'?'取消订单':info.status=='2'?'发货中':info.status=='-2'?'已退款':info.status=='3'?'已收货':info.status=='-3'?'申请售后':info.status=='-4'?'正在售后中':info.status=='-5'?'售后已结束':'未识别'}}</text>
  101. </view>
  102. <view class="four_1">
  103. <text>下单时间</text>
  104. <text>{{info.buy_time}}</text>
  105. </view>
  106. <view class="four_1">
  107. <text>订单备注</text>
  108. <text>{{info.remarks}}</text>
  109. </view>
  110. </view>
  111. </view>
  112. </scroll-view>
  113. </view>
  114. <view class="zero_1">
  115. <text>合计</text>
  116. <text>¥{{info.total_detail.freight_total+info.total_detail.goods_total}}</text>
  117. </view>
  118. </view>
  119. </mobile-frame>
  120. </template>
  121. <script>
  122. export default {
  123. data() {
  124. return {
  125. id: '',
  126. status: '',
  127. info: {}
  128. };
  129. },
  130. onLoad: function(e) {
  131. const that = this;
  132. that.$set(that, `id`, e.id);
  133. that.$set(that, `status`, e.status);
  134. that.search()
  135. },
  136. onShow: function() {},
  137. methods: {
  138. // 查询详情
  139. async search() {
  140. uni.showLoading({
  141. title: '加载中'
  142. });
  143. const that = this;
  144. let res;
  145. // 待付款
  146. if (that.id && that.status == '0') {
  147. res = await that.$api(`/order/${that.id}`);
  148. } else {
  149. res = await that.$api(`/orderDetail/${that.id}`);
  150. }
  151. if (res.errcode == '0') {
  152. that.$set(that, `info`, res.data);
  153. uni.hideLoading();
  154. }
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss">
  160. .main {
  161. display: flex;
  162. flex-direction: column;
  163. width: 100vw;
  164. height: 100vh;
  165. background-color: #f5f5f5;
  166. .zero {
  167. position: relative;
  168. flex-grow: 1;
  169. .one {
  170. background-color: #fff;
  171. margin: 0 0 2vw 0;
  172. display: flex;
  173. justify-content: space-between;
  174. padding: 2vw;
  175. border-bottom: 2px dashed #ff0000;
  176. .one_1 {
  177. width: 8vw;
  178. text-align: center;
  179. padding: 3vw 0 0;
  180. }
  181. .one_2 {
  182. width: 86vw;
  183. .name {
  184. font-size: 16px;
  185. margin: 0 0 1vw 0;
  186. text {
  187. padding: 0 0 0 2vw;
  188. }
  189. }
  190. .address {
  191. font-size: 14px;
  192. color: #858585;
  193. text {
  194. padding: 0 0 0 2vw;
  195. }
  196. }
  197. }
  198. }
  199. .two {
  200. background-color: #fff;
  201. margin: 0 0 2vw 0;
  202. padding: 2vw;
  203. .two_0 {
  204. text-align: right;
  205. color: #ff0000;
  206. }
  207. .two_1 {
  208. display: flex;
  209. flex-direction: column;
  210. .list {
  211. margin: 0 0 1vw 0;
  212. .list_1 {
  213. font-size: 16px;
  214. margin: 0 0 1vw 0;
  215. text:last-child {
  216. padding: 0 0 0 2vw;
  217. }
  218. }
  219. .list_2 {
  220. display: flex;
  221. flex-direction: column;
  222. .goods {
  223. display: flex;
  224. border-bottom: 1px dashed #f1f1f1;
  225. padding: 2vw 0;
  226. .url {
  227. width: 20vw;
  228. .image {
  229. width: 100%;
  230. height: 20vw;
  231. border-radius: 5px;
  232. }
  233. }
  234. .goodsname {
  235. width: 60vw;
  236. padding: 0 2vw;
  237. font-size: 16px;
  238. }
  239. .goodsother {
  240. width: 15vw;
  241. text-align: right;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. .two_2 {
  248. .list_1 {
  249. font-size: 16px;
  250. margin: 0 0 1vw 0;
  251. text:last-child {
  252. padding: 0 0 0 2vw;
  253. }
  254. }
  255. .list_2 {
  256. display: flex;
  257. flex-direction: column;
  258. .goods {
  259. display: flex;
  260. border-bottom: 1px dashed #f1f1f1;
  261. padding: 2vw 0;
  262. .url {
  263. width: 20vw;
  264. .image {
  265. width: 100%;
  266. height: 20vw;
  267. border-radius: 5px;
  268. }
  269. }
  270. .goodsname {
  271. width: 60vw;
  272. padding: 0 2vw;
  273. font-size: 16px;
  274. }
  275. .goodsother {
  276. width: 15vw;
  277. text-align: right;
  278. }
  279. }
  280. }
  281. }
  282. }
  283. .thr {
  284. background-color: #fff;
  285. margin: 0 0 2vw 0;
  286. padding: 0 2vw;
  287. .thr_1 {
  288. margin: 2vw 0;
  289. font-size: 15px;
  290. display: flex;
  291. justify-content: space-between;
  292. }
  293. .thr_1:last-child {
  294. text:last-child {
  295. color: #ff0000;
  296. }
  297. }
  298. }
  299. .four {
  300. background-color: #fff;
  301. margin: 0 0 2vw 0;
  302. padding: 0 2vw;
  303. .four_1 {
  304. margin: 2vw 0;
  305. font-size: 15px;
  306. display: flex;
  307. justify-content: space-between;
  308. }
  309. }
  310. }
  311. .zero_1 {
  312. background-color: white;
  313. width: 96vw;
  314. padding: 4vw 2vw;
  315. font-size: 16px;
  316. text:last-child {
  317. color: #ff0000;
  318. padding: 0 0 0 2vw;
  319. }
  320. }
  321. }
  322. .scroll-view {
  323. position: absolute;
  324. top: 0;
  325. left: 0;
  326. right: 0;
  327. bottom: 0;
  328. .list-scroll-view {
  329. display: flex;
  330. flex-direction: column;
  331. }
  332. }
  333. </style>