adDetail.vue 13 KB

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