adDetail.vue 16 KB

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