info.vue 8.8 KB

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