info.vue 7.3 KB

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