adDetail.vue 15 KB

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