adDetail.vue 16 KB

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