adDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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 seoData = ref({
  107. title: '广告服务',
  108. description: '默认描述',
  109. keywords: '默认关键词',
  110. image: 'https://example.com/default-image.jpg'
  111. });
  112. // 在 onMounted 钩子中获取数据
  113. onMounted(()=>{
  114. seoData.value.title = '广告服务';
  115. seoData.value.description = '默认描述';
  116. seoData.value.keywords = '默认关键词';
  117. })
  118. //获取订单状态
  119. const getOrderstatus = async () => {
  120. try {
  121. const response = await axios.get(`/order/getStatus`);
  122. console.log(response);
  123. orderstate.value = response.data.order
  124. order_adstate.value = response.data.order_ad
  125. } catch (error) {
  126. console.error(error);
  127. }
  128. }
  129. // 获取订单详情
  130. const getOrderDetail = async () => {
  131. try {
  132. const response = await axios.get(`/order/getOrderDetail?order_id=${order_id}&pageSize=${pageSize.value}&page=${page.value}`);
  133. console.log("response", response.data);
  134. order.value = response.data.order
  135. orderDetail.value = response.data.orderads
  136. // 将state和days添加到orderDetail里面
  137. newArr.value = orderDetail.value.map((item) => {
  138. item.state = statusStore.orderStatus[state] //审核状态
  139. // item.state = state //审核状态
  140. // item.ad_status =ad_status //广告状态
  141. item.ad_status = statusStore.adStatus[ad_status] //广告状态
  142. item.days = days + '天' // 过期时间
  143. return item
  144. })
  145. } catch (error) {
  146. console.error(error);
  147. }
  148. }
  149. let goReapply = () => {
  150. // ad.value = 1
  151. // window.location.href = (`http://localhost:3000/advertising?activeName=${'1'}`)
  152. window.location.href = (`http://nwdev.bjzxtw.org.cn/advertising?activeName=${'1'}`)
  153. }
  154. onMounted(() => {
  155. // 获取订单详情
  156. getOrderDetail()
  157. //获取订单状态
  158. getOrderstatus()
  159. })
  160. </script>
  161. <style lang="less" scoped>
  162. .adDetail {
  163. width: 100%;
  164. overflow: hidden;
  165. .inner {
  166. width: 1200px;
  167. overflow: hidden;
  168. h3 {
  169. font-family: Microsoft YaHei, Microsoft YaHei;
  170. font-weight: 400;
  171. font-size: 20px;
  172. color: #333333;
  173. margin: 40px 0;
  174. }
  175. .order {
  176. width: 1198px;
  177. height: 160px;
  178. border: 1px solid #e1e1e1;
  179. .title {
  180. height: 60px;
  181. line-height: 30px;
  182. border-bottom: 1px solid #e1e1e1;
  183. padding: 15px 24px 15px 50px;
  184. box-sizing: border-box;
  185. background-color: #fafafa;
  186. >span {
  187. display: inline-block;
  188. text-align: center;
  189. font-family: Microsoft YaHei, Microsoft YaHei;
  190. }
  191. .statusGreen {
  192. width: 70px;
  193. height: 32px;
  194. line-height: 32px;
  195. margin-right: 50px;
  196. background: #d5ecd2;
  197. color: #33B023;
  198. font-weight: 400;
  199. font-size: 16px;
  200. }
  201. .statusOrange {
  202. width: 70px;
  203. height: 32px;
  204. line-height: 32px;
  205. margin-right: 50px;
  206. background: #fbebd5;
  207. color: #FFAA33;
  208. font-weight: 400;
  209. font-size: 16px;
  210. }
  211. .statusGray {
  212. width: 70px;
  213. height: 32px;
  214. line-height: 32px;
  215. margin-right: 50px;
  216. background: #e8e8e8;
  217. color: #999999;
  218. font-weight: 400;
  219. font-size: 16px;
  220. }
  221. .code {
  222. font-weight: 400;
  223. font-size: 16px;
  224. color: #333333;
  225. }
  226. .createTime {
  227. font-weight: bold;
  228. font-size: 16px;
  229. color: #333333;
  230. }
  231. }
  232. .text {
  233. padding: 33px 70px 33px 50px;
  234. position: relative;
  235. span {
  236. font-weight: 400;
  237. font-size: 16px;
  238. color: #333333;
  239. .money {
  240. font-weight: bold;
  241. font-size: 24px;
  242. color: #028E21;
  243. padding-right: 10px;
  244. }
  245. }
  246. >span:first-child {
  247. padding-right: 80px;
  248. }
  249. >span:nth-child(2) {
  250. padding-right: 200px;
  251. }
  252. >span:nth-child(3) {
  253. padding-right: 183px;
  254. }
  255. button {
  256. width: 82px;
  257. height: 34px;
  258. font-size: 13px;
  259. background: #33B023;
  260. color: #fff;
  261. border: none;
  262. border-radius: 4px;
  263. position: absolute;
  264. right: 70px;
  265. top: 32px;
  266. }
  267. }
  268. }
  269. .detail {
  270. width: 1198px;
  271. overflow: hidden;
  272. border-right: 1px solid #e1e1e1;
  273. border-left: 1px solid #e1e1e1;
  274. /deep/.el-table .cell {
  275. box-sizing: border-box;
  276. line-height: 23px;
  277. overflow: hidden;
  278. overflow-wrap: break-word;
  279. padding: 12px 12px;
  280. text-overflow: ellipsis;
  281. white-space: normal;
  282. font-size: 16px;
  283. font-weight: 400;
  284. }
  285. /deep/.el-table__header th {
  286. color: #999999;
  287. /* 设置表头颜色 */
  288. }
  289. /deep/.el-table__body td {
  290. color: #333333;
  291. /* 设置表格内容字体颜色 */
  292. }
  293. .content {
  294. height: 95px;
  295. >img {
  296. width: 150px;
  297. height: 95px;
  298. margin: 20px;
  299. }
  300. >h5 {
  301. // margin-top: 20px;
  302. width: 170px;
  303. font-family: Microsoft YaHei, Microsoft YaHei;
  304. color: #333333;
  305. margin-bottom: 20px;
  306. font-weight: 400;
  307. font-size: 16px;
  308. }
  309. >p {
  310. // margin-top: 40px;
  311. width: 170px;
  312. font-family: Microsoft YaHei, Microsoft YaHei;
  313. font-weight: 400;
  314. font-size: 16px;
  315. color: #333333;
  316. }
  317. }
  318. }
  319. .pagination {
  320. margin-top: 60px;
  321. margin-bottom: 90px;
  322. }
  323. }
  324. }
  325. </style>