info.vue 8.3 KB

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