adDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <!-- 广告服务 -->
  3. <div>
  4. <!-- 广告页面头部 -->
  5. <HomePageHead></HomePageHead>
  6. <HomePageNavigation1></HomePageNavigation1>
  7. <div class="adDetail">
  8. <div class="inner">
  9. <!-- 标题 -->
  10. <h3>广告基本信息</h3>
  11. <!-- 工单头部 -->
  12. <div class="order">
  13. <div class="title">
  14. <span class="statusGreen left" v-if="order.status == 1">{{ orderstate[order.status] }}</span>
  15. <span class="statusOrange left" v-else-if="order.status == 6">{{ orderstate[order.status]
  16. }}</span>
  17. <span class="statusGray left" v-else>{{ orderstate[order.status] }}</span>
  18. <span class="code left">
  19. 工单编号:
  20. <span>{{ order.order_num }}</span>
  21. </span>
  22. <span class="createTime right">{{ order.created_at }}</span>
  23. </div>
  24. <!-- 工单内容 -->
  25. <div class="text">
  26. <span>开始时间:{{ order.sttime }}</span>
  27. <span>结束时间:{{ order.edtime }}</span>
  28. <span>
  29. <!-- <span class="money">{{ order.price ? order.price : 260 }}</span> -->
  30. <span class="money">{{ order.price }}</span>
  31. </span>
  32. <!-- <NuxtLink :to="`/advertising?activeName=${'1'}&ad=${1}`">
  33. <button>再次申请</button>
  34. </NuxtLink> -->
  35. <button @click="goReapply">再次申请</button>
  36. </div>
  37. </div>
  38. <div class="detail">
  39. <el-table :data="orderDetail" style="width: 100%">
  40. <el-table-column prop="" label="图片信息" align="center">
  41. <template #default="scope">
  42. <div class="content">
  43. <img :src="scope.row.image_src" alt="" class="left">
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="" label="">
  48. <template #default="scope">
  49. <div class="content">
  50. <h5>{{ scope.row.apname }}</h5>
  51. <p>{{ scope.row.adname }}</p>
  52. </div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="website_name" label="网站" width="200px" align="center" />
  56. <el-table-column prop="days" label="天数" width="200px" align="center">
  57. <template #default="scope">
  58. {{ order.days }}
  59. <!-- {{ orderstate[scope.row.status] }} -->
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="" label="审核状态" width="200px" align="center">
  63. <template #default="scope">
  64. {{ orderstate[order.status] }}
  65. <!-- {{ orderstate[scope.row.status] }} -->
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="广告状态" width="200px" align="center">
  69. <template #default="scope">
  70. {{ order_adstate[order.ad_status] }}
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. </div>
  75. <div class="pagination">
  76. <HomePagination></HomePagination>
  77. </div>
  78. </div>
  79. </div>
  80. <!-- 广告页面底部 -->
  81. <HomeFoot1></HomeFoot1>
  82. </div>
  83. </template>
  84. <script setup>
  85. import { onMounted } from 'vue';
  86. import { ElTable, ElTableColumn } from 'element-plus'
  87. import { useStatusStore } from "@/store/status.js"
  88. const statusStore = useStatusStore()
  89. const { $webUrl, $CwebUrl, $BwebUrl } = useNuxtApp()
  90. // axios请求
  91. const nuxtApp = useNuxtApp();
  92. const axios = nuxtApp.$axios;
  93. //工单列表页面跳转传递到的参数
  94. let route = useRoute()
  95. let order_id = route.query.id
  96. let days = route.query.days
  97. let state = route.query.status
  98. let ad_status = route.query.status
  99. console.log(order_id);
  100. let pageSize = useState("pageSize", () => 10)
  101. let page = useState("page", () => 1)
  102. let orderstate = useState("orderstate", () => 1) //审核状态
  103. let order_adstate = useState("order_adstate", () => 1) //广告状态
  104. let order = useState("order", () => "")
  105. let orderDetail = useState("orderDetail", () => "")
  106. let newArr = useState("newArr", () => "")
  107. // 定义响应式数据
  108. const seoData = ref({
  109. title: '广告服务',
  110. description: '默认描述',
  111. keywords: '默认关键词',
  112. image: 'https://example.com/default-image.jpg'
  113. });
  114. // 在 onMounted 钩子中获取数据
  115. onMounted(()=>{
  116. seoData.value.title = '广告服务';
  117. seoData.value.description = '默认描述';
  118. seoData.value.keywords = '默认关键词';
  119. })
  120. //获取订单状态
  121. const getOrderstatus = async () => {
  122. try {
  123. const response = await axios.get(`/order/getStatus`);
  124. console.log(response);
  125. orderstate.value = response.data.order
  126. order_adstate.value = response.data.order_ad
  127. } catch (error) {
  128. console.error(error);
  129. }
  130. }
  131. // 获取订单详情
  132. const getOrderDetail = async () => {
  133. try {
  134. const response = await axios.get(`/order/getOrderDetail?order_id=${order_id}&pageSize=${pageSize.value}&page=${page.value}`);
  135. console.log("response", response.data);
  136. order.value = response.data.order
  137. orderDetail.value = response.data.orderads
  138. // 将state和days添加到orderDetail里面
  139. newArr.value = orderDetail.value.map((item) => {
  140. item.state = statusStore.orderStatus[state] //审核状态
  141. // item.state = state //审核状态
  142. // item.ad_status =ad_status //广告状态
  143. item.ad_status = statusStore.adStatus[ad_status] //广告状态
  144. item.days = days + '天' // 过期时间
  145. return item
  146. })
  147. } catch (error) {
  148. console.error(error);
  149. }
  150. }
  151. let goReapply = () => {
  152. // ad.value = 1
  153. // window.location.href = (`http://localhost:3000/advertising?activeName=${'1'}`)
  154. let url = $CwebUrl + '/advertising?activeName=1';
  155. window.location.href = url;
  156. }
  157. onMounted(() => {
  158. // 获取订单详情
  159. getOrderDetail()
  160. //获取订单状态
  161. getOrderstatus()
  162. })
  163. //seo
  164. useSeoMeta({
  165. title: "广告服务" + "_" + "三农资讯网_全国政务信息一体化应用平台",
  166. meta: [
  167. { name: 'description', content: "三农资讯网以服务于党和国家各级职能部门三农政务资讯发布及政务公开信息公示为基点,为全国县级以上各级党政机关及其职能部门配置各自公开独立网络发布平台。主要频道有:三农政务资讯,农科资讯,农资购销,农产购销,农贸资讯,三农致富信息,农村文化生活,三农政策法规,三农之窗,三农调查,三农服务,三农知识,农民工,打假维权等。三农资讯网打造最具影响力的三农信息发布平台,并成为最具权威的三农资讯网。_三农资讯网-测试专用_全国政务信息一体化应用平台" , tagPriority: 10 },
  168. { name: 'keywords', content: "三农资讯,农业,三农,三农在线,农业新闻,三农资讯网_三农资讯网-测试专用_全国政务信息一体化应用平台" , tagPriority: 10 }
  169. ]
  170. });
  171. </script>
  172. <style lang="less" scoped>
  173. .adDetail {
  174. width: 100%;
  175. overflow: hidden;
  176. .inner {
  177. width: 1200px;
  178. overflow: hidden;
  179. h3 {
  180. font-family: Microsoft YaHei, Microsoft YaHei;
  181. font-weight: 400;
  182. font-size: 20px;
  183. color: #333333;
  184. margin: 40px 0;
  185. }
  186. .order {
  187. width: 1198px;
  188. height: 160px;
  189. border: 1px solid #e1e1e1;
  190. .title {
  191. height: 60px;
  192. line-height: 30px;
  193. border-bottom: 1px solid #e1e1e1;
  194. padding: 15px 24px 15px 50px;
  195. box-sizing: border-box;
  196. background-color: #fafafa;
  197. >span {
  198. display: inline-block;
  199. text-align: center;
  200. font-family: Microsoft YaHei, Microsoft YaHei;
  201. }
  202. .statusGreen {
  203. width: 70px;
  204. height: 32px;
  205. line-height: 32px;
  206. margin-right: 50px;
  207. background: #d5ecd2;
  208. color: #33B023;
  209. font-weight: 400;
  210. font-size: 16px;
  211. }
  212. .statusOrange {
  213. width: 70px;
  214. height: 32px;
  215. line-height: 32px;
  216. margin-right: 50px;
  217. background: #fbebd5;
  218. color: #FFAA33;
  219. font-weight: 400;
  220. font-size: 16px;
  221. }
  222. .statusGray {
  223. width: 70px;
  224. height: 32px;
  225. line-height: 32px;
  226. margin-right: 50px;
  227. background: #e8e8e8;
  228. color: #999999;
  229. font-weight: 400;
  230. font-size: 16px;
  231. }
  232. .code {
  233. font-weight: 400;
  234. font-size: 16px;
  235. color: #333333;
  236. }
  237. .createTime {
  238. font-weight: bold;
  239. font-size: 16px;
  240. color: #333333;
  241. }
  242. }
  243. .text {
  244. padding: 33px 70px 33px 50px;
  245. position: relative;
  246. span {
  247. font-weight: 400;
  248. font-size: 16px;
  249. color: #333333;
  250. .money {
  251. font-weight: bold;
  252. font-size: 24px;
  253. color: #028E21;
  254. padding-right: 10px;
  255. }
  256. }
  257. >span:first-child {
  258. padding-right: 80px;
  259. }
  260. >span:nth-child(2) {
  261. padding-right: 200px;
  262. }
  263. >span:nth-child(3) {
  264. padding-right: 183px;
  265. }
  266. button {
  267. width: 82px;
  268. height: 34px;
  269. font-size: 13px;
  270. background: #33B023;
  271. color: #fff;
  272. border: none;
  273. border-radius: 4px;
  274. position: absolute;
  275. right: 70px;
  276. top: 32px;
  277. }
  278. }
  279. }
  280. .detail {
  281. width: 1198px;
  282. overflow: hidden;
  283. border-right: 1px solid #e1e1e1;
  284. border-left: 1px solid #e1e1e1;
  285. /deep/.el-table .cell {
  286. box-sizing: border-box;
  287. line-height: 23px;
  288. overflow: hidden;
  289. overflow-wrap: break-word;
  290. padding: 12px 12px;
  291. text-overflow: ellipsis;
  292. white-space: normal;
  293. font-size: 16px;
  294. font-weight: 400;
  295. }
  296. /deep/.el-table__header th {
  297. color: #999999;
  298. /* 设置表头颜色 */
  299. }
  300. /deep/.el-table__body td {
  301. color: #333333;
  302. /* 设置表格内容字体颜色 */
  303. }
  304. .content {
  305. height: 95px;
  306. >img {
  307. width: 150px;
  308. height: 95px;
  309. margin: 20px;
  310. }
  311. >h5 {
  312. // margin-top: 20px;
  313. width: 170px;
  314. font-family: Microsoft YaHei, Microsoft YaHei;
  315. color: #333333;
  316. margin-bottom: 20px;
  317. font-weight: 400;
  318. font-size: 16px;
  319. }
  320. >p {
  321. // margin-top: 40px;
  322. width: 170px;
  323. font-family: Microsoft YaHei, Microsoft YaHei;
  324. font-weight: 400;
  325. font-size: 16px;
  326. color: #333333;
  327. }
  328. }
  329. }
  330. .pagination {
  331. margin-top: 60px;
  332. margin-bottom: 90px;
  333. }
  334. }
  335. }
  336. </style>