adDetail.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <!-- 广告服务 -->
  3. <div>
  4. <!-- 广告页面头部 -->
  5. <AdvertisingHead></AdvertisingHead>
  6. <div class="adDetail">
  7. <div class="inner">
  8. <!-- 标题 -->
  9. <h3>广告基本信息</h3>
  10. <!-- 工单头部 -->
  11. <div class="order">
  12. <div class="title">
  13. <span class="status left">{{ statusStore.orderStatus[order.status] }}</span>
  14. <!-- <span class="status left">{{ order.status }}</span> -->
  15. <span class="code left">
  16. 工单编号:
  17. <span>{{ order.order_num }}</span>
  18. </span>
  19. <span class="createTime right">{{ order.created_at }}</span>
  20. </div>
  21. <!-- 工单内容 -->
  22. <div class="text">
  23. <span>开始时间:{{ order.sttime }}</span>
  24. <span>结束时间:{{ order.edtime }}</span>
  25. <span>
  26. <span class="money">{{ order.price ? order.price : 260 }}</span>
  27. </span>
  28. <button>再次申请</button>
  29. </div>
  30. </div>
  31. <div class="detail">
  32. <el-table :data="orderDetail" style="width: 100%">
  33. <el-table-column prop="" label="图片信息" align="center">
  34. <template #default="scope">
  35. <div class="content">
  36. <img :src="scope.row.image_src" alt="" class="left">
  37. </div>
  38. </template>
  39. </el-table-column>
  40. <el-table-column prop="" label="">
  41. <template #default="scope">
  42. <div class="content">
  43. <h5>{{ scope.row.apname }}</h5>
  44. <p>{{ scope.row.adname }}</p>
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="website_name" label="网址" width="200px" align="center" />
  49. <el-table-column prop="days" label="天数" width="200px" align="center" />
  50. <el-table-column prop="state" label="审核状态" width="200px" align="center" />
  51. <el-table-column prop="ad_status" label="广告状态" width="200px" align="center" />
  52. </el-table>
  53. </div>
  54. <div class="pagination">
  55. <HomePagination></HomePagination>
  56. </div>
  57. </div>
  58. </div>
  59. <!-- 广告页面底部 -->
  60. <AdvertisingFoot></AdvertisingFoot>
  61. </div>
  62. </template>
  63. <script setup>
  64. import { onMounted } from 'vue';
  65. import { ElTable, ElTableColumn } from 'element-plus'
  66. import { useStatusStore } from "@/store/status.js"
  67. const statusStore = useStatusStore()
  68. // axios请求
  69. const nuxtApp = useNuxtApp();
  70. const axios = nuxtApp.$axios;
  71. //工单列表页面跳转传递到的参数
  72. let route = useRoute()
  73. let order_id = route.query.id
  74. let days = route.query.days
  75. let state = route.query.status
  76. let ad_status = route.query.status
  77. console.log(order_id);
  78. let order = useState("order", () => "")
  79. let orderDetail = useState("orderDetail", () => "")
  80. let newArr = useState("newArr", () => "")
  81. // 获取订单详情
  82. const getOrderDetail = async () => {
  83. try {
  84. const response = await axios.get(`/order/getOrderDetail?order_id=${order_id}&pageSize=${10}&page=${1}`);
  85. // console.log(response.data);
  86. order.value = response.data.order
  87. orderDetail.value = response.data.orderads
  88. // 将state和days添加到orderDetail里面
  89. newArr.value = orderDetail.value.map((item) => {
  90. item.state = statusStore.orderStatus[state] //审核状态
  91. // item.state = state //审核状态
  92. // item.ad_status =ad_status //广告状态
  93. item.ad_status = statusStore.adStatus[ad_status] //广告状态
  94. item.days = days + '天' // 过期时间
  95. return item
  96. })
  97. } catch (error) {
  98. console.error(error);
  99. }
  100. }
  101. onMounted(() => {
  102. // 获取订单详情
  103. getOrderDetail()
  104. })
  105. </script>
  106. <style lang="less" scoped>
  107. .adDetail {
  108. width: 100%;
  109. overflow: hidden;
  110. .inner {
  111. width: 1200px;
  112. overflow: hidden;
  113. h3 {
  114. font-family: Microsoft YaHei, Microsoft YaHei;
  115. font-weight: 400;
  116. font-size: 20px;
  117. color: #333333;
  118. margin: 40px 0;
  119. }
  120. .order {
  121. width: 1198px;
  122. height: 160px;
  123. border: 1px solid #e1e1e1;
  124. .title {
  125. height: 60px;
  126. line-height: 30px;
  127. border-bottom: 1px solid #e1e1e1;
  128. padding: 15px 24px 15px 50px;
  129. box-sizing: border-box;
  130. background-color: #fafafa;
  131. >span {
  132. display: inline-block;
  133. text-align: center;
  134. font-family: Microsoft YaHei, Microsoft YaHei;
  135. }
  136. .status {
  137. width: 70px;
  138. height: 32px;
  139. line-height: 32px;
  140. margin-right: 50px;
  141. background: #d5ecd2;
  142. color: #33B023;
  143. font-weight: 400;
  144. font-size: 16px;
  145. }
  146. .code {
  147. font-weight: 400;
  148. font-size: 16px;
  149. color: #333333;
  150. }
  151. .createTime {
  152. font-weight: bold;
  153. font-size: 16px;
  154. color: #333333;
  155. }
  156. }
  157. .text {
  158. padding: 33px 70px 33px 50px;
  159. position: relative;
  160. span {
  161. font-weight: 400;
  162. font-size: 16px;
  163. color: #333333;
  164. .money {
  165. font-weight: bold;
  166. font-size: 24px;
  167. color: #028E21;
  168. padding-right: 10px;
  169. }
  170. }
  171. >span:first-child {
  172. padding-right: 80px;
  173. }
  174. >span:nth-child(2) {
  175. padding-right: 200px;
  176. }
  177. >span:nth-child(3) {
  178. padding-right: 183px;
  179. }
  180. button {
  181. width: 82px;
  182. height: 34px;
  183. font-size: 13px;
  184. background: #33B023;
  185. color: #fff;
  186. border: none;
  187. border-radius: 4px;
  188. position: absolute;
  189. right: 70px;
  190. top: 32px;
  191. }
  192. }
  193. }
  194. .detail {
  195. width: 1198px;
  196. overflow: hidden;
  197. border-right: 1px solid #e1e1e1;
  198. border-left: 1px solid #e1e1e1;
  199. /deep/.el-table .cell {
  200. box-sizing: border-box;
  201. line-height: 23px;
  202. overflow: hidden;
  203. overflow-wrap: break-word;
  204. padding: 12px 12px;
  205. text-overflow: ellipsis;
  206. white-space: normal;
  207. font-size: 16px;
  208. font-weight: 400;
  209. }
  210. /deep/.el-table__header th {
  211. color: #999999;
  212. /* 设置表头颜色 */
  213. }
  214. /deep/.el-table__body td {
  215. color: #333333;
  216. /* 设置表格内容字体颜色 */
  217. }
  218. .content {
  219. height: 95px;
  220. >img {
  221. width: 150px;
  222. height: 95px;
  223. margin: 20px;
  224. }
  225. >h5 {
  226. // margin-top: 20px;
  227. width: 170px;
  228. font-family: Microsoft YaHei, Microsoft YaHei;
  229. color: #333333;
  230. margin-bottom: 20px;
  231. font-weight: 400;
  232. font-size: 16px;
  233. }
  234. >p {
  235. // margin-top: 40px;
  236. width: 170px;
  237. font-family: Microsoft YaHei, Microsoft YaHei;
  238. font-weight: 400;
  239. font-size: 16px;
  240. color: #333333;
  241. }
  242. }
  243. }
  244. .pagination {
  245. margin-top: 60px;
  246. margin-bottom: 90px;
  247. }
  248. }
  249. }
  250. </style>