adDetail.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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 @click="goReapply">再次申请</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 pageSize = useState("pageSize", () => 10)
  79. let page = useState("page", () => 1)
  80. let order = useState("order", () => "")
  81. let orderDetail = useState("orderDetail", () => "")
  82. let newArr = useState("newArr", () => "")
  83. // 获取订单详情
  84. const getOrderDetail = async () => {
  85. try {
  86. const response = await axios.get(`/order/getOrderDetail?order_id=${order_id}&pageSize=${pageSize.value}&page=${page.value}`);
  87. // console.log(response.data);
  88. order.value = response.data.order
  89. orderDetail.value = response.data.orderads
  90. // 将state和days添加到orderDetail里面
  91. newArr.value = orderDetail.value.map((item) => {
  92. item.state = statusStore.orderStatus[state] //审核状态
  93. // item.state = state //审核状态
  94. // item.ad_status =ad_status //广告状态
  95. item.ad_status = statusStore.adStatus[ad_status] //广告状态
  96. item.days = days + '天' // 过期时间
  97. return item
  98. })
  99. } catch (error) {
  100. console.error(error);
  101. }
  102. }
  103. let goReapply=()=>{
  104. navigateTo('/advertising')
  105. }
  106. onMounted(() => {
  107. // 获取订单详情
  108. getOrderDetail()
  109. })
  110. </script>
  111. <style lang="less" scoped>
  112. .adDetail {
  113. width: 100%;
  114. overflow: hidden;
  115. .inner {
  116. width: 1200px;
  117. overflow: hidden;
  118. h3 {
  119. font-family: Microsoft YaHei, Microsoft YaHei;
  120. font-weight: 400;
  121. font-size: 20px;
  122. color: #333333;
  123. margin: 40px 0;
  124. }
  125. .order {
  126. width: 1198px;
  127. height: 160px;
  128. border: 1px solid #e1e1e1;
  129. .title {
  130. height: 60px;
  131. line-height: 30px;
  132. border-bottom: 1px solid #e1e1e1;
  133. padding: 15px 24px 15px 50px;
  134. box-sizing: border-box;
  135. background-color: #fafafa;
  136. >span {
  137. display: inline-block;
  138. text-align: center;
  139. font-family: Microsoft YaHei, Microsoft YaHei;
  140. }
  141. .status {
  142. width: 70px;
  143. height: 32px;
  144. line-height: 32px;
  145. margin-right: 50px;
  146. background: #d5ecd2;
  147. color: #33B023;
  148. font-weight: 400;
  149. font-size: 16px;
  150. }
  151. .code {
  152. font-weight: 400;
  153. font-size: 16px;
  154. color: #333333;
  155. }
  156. .createTime {
  157. font-weight: bold;
  158. font-size: 16px;
  159. color: #333333;
  160. }
  161. }
  162. .text {
  163. padding: 33px 70px 33px 50px;
  164. position: relative;
  165. span {
  166. font-weight: 400;
  167. font-size: 16px;
  168. color: #333333;
  169. .money {
  170. font-weight: bold;
  171. font-size: 24px;
  172. color: #028E21;
  173. padding-right: 10px;
  174. }
  175. }
  176. >span:first-child {
  177. padding-right: 80px;
  178. }
  179. >span:nth-child(2) {
  180. padding-right: 200px;
  181. }
  182. >span:nth-child(3) {
  183. padding-right: 183px;
  184. }
  185. button {
  186. width: 82px;
  187. height: 34px;
  188. font-size: 13px;
  189. background: #33B023;
  190. color: #fff;
  191. border: none;
  192. border-radius: 4px;
  193. position: absolute;
  194. right: 70px;
  195. top: 32px;
  196. }
  197. }
  198. }
  199. .detail {
  200. width: 1198px;
  201. overflow: hidden;
  202. border-right: 1px solid #e1e1e1;
  203. border-left: 1px solid #e1e1e1;
  204. /deep/.el-table .cell {
  205. box-sizing: border-box;
  206. line-height: 23px;
  207. overflow: hidden;
  208. overflow-wrap: break-word;
  209. padding: 12px 12px;
  210. text-overflow: ellipsis;
  211. white-space: normal;
  212. font-size: 16px;
  213. font-weight: 400;
  214. }
  215. /deep/.el-table__header th {
  216. color: #999999;
  217. /* 设置表头颜色 */
  218. }
  219. /deep/.el-table__body td {
  220. color: #333333;
  221. /* 设置表格内容字体颜色 */
  222. }
  223. .content {
  224. height: 95px;
  225. >img {
  226. width: 150px;
  227. height: 95px;
  228. margin: 20px;
  229. }
  230. >h5 {
  231. // margin-top: 20px;
  232. width: 170px;
  233. font-family: Microsoft YaHei, Microsoft YaHei;
  234. color: #333333;
  235. margin-bottom: 20px;
  236. font-weight: 400;
  237. font-size: 16px;
  238. }
  239. >p {
  240. // margin-top: 40px;
  241. width: 170px;
  242. font-family: Microsoft YaHei, Microsoft YaHei;
  243. font-weight: 400;
  244. font-size: 16px;
  245. color: #333333;
  246. }
  247. }
  248. }
  249. .pagination {
  250. margin-top: 60px;
  251. margin-bottom: 90px;
  252. }
  253. }
  254. }
  255. </style>