adDetail.vue 12 KB

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