fullscreenAdDetails.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. <template>
  2. <view class="page">
  3. <view class="top"></view>
  4. <view class="head">
  5. <view class="handle">
  6. <view class="head_left">
  7. <span class="cuIcon-back" @click="back" style="font-weight: 600;"></span>
  8. </view>
  9. <span class="center">广告详情</span>
  10. <view class="head_right">
  11. </view>
  12. </view>
  13. </view>
  14. <view class="body">
  15. <view class="module dis f-c ">
  16. <text class="module-title ">投放状态:</text>
  17. <view class="views dis a-c j-s ">
  18. <text>{{detailsInfo.statusName}}</text>
  19. </view>
  20. </view>
  21. <view class="module dis f-c ">
  22. <text class="module-title ">基本信息</text>
  23. <view class="views dis a-c j-s ">
  24. <text>投放计划名称</text>
  25. <text>{{detailsInfo.merchantAdDeliveryPlanDTO.planName}}</text>
  26. </view>
  27. <view class="views dis a-c j-s ">
  28. <text>位置名称</text>
  29. <text>{{detailsInfo.merchantAdDeliveryPlanDTO.positionName}}</text>
  30. </view>
  31. </view>
  32. <view class="module dis f-c ">
  33. <text class="module-title ">投放区域</text>
  34. <text class="address">{{detailsInfo.merchantAdDeliveryPlanDTO.coverageArea}}公里(半径)</text>
  35. </view>
  36. <view class="module dis f-c ">
  37. <text class="module-title ">投放时间</text>
  38. <view class="views dis a-c j-s ">
  39. <text>投放开始日期</text>
  40. <text>{{detailsInfo.merchantAdDeliveryPlanDTO.planStartTime}}</text>
  41. </view>
  42. <view class="views dis a-c j-s ">
  43. <text>投放结束日期</text>
  44. <text>{{detailsInfo.merchantAdDeliveryPlanDTO.planEndTime}}</text>
  45. </view>
  46. <view class="views dis a-c j-s ">
  47. <text>生效周期</text>
  48. <text v-if="detailsInfo.merchantAdDeliveryPlanDTO.cycleType==1">每天</text>
  49. <text v-else>
  50. {{
  51. detailsInfo.merchantAdDeliveryPlanDTO.cycleStrategy
  52. .split(',')
  53. .map(num => {
  54. const week = ['周一','周二','周三','周四','周五','周六','周日'];
  55. return week[Number(num)-1] || '';
  56. })
  57. .join('、')
  58. }}
  59. </text>
  60. </view>
  61. <!-- <view class="extendArea dis a-c f-wrap mt-2" style="padding-bottom: 0;"
  62. v-if="detailsInfo.validPeriodType!='0'">
  63. <view class="cycleStrategy dis a-c j-c" v-for="(item,index) in cycleStrategylist" :key="index"
  64. :class="{ 'tcycleStrategy-active': selectedDays.includes(item.value) }">
  65. <text>{{item.label}}</text>
  66. </view>
  67. </view> -->
  68. <view class="views dis a-c j-s ">
  69. <text>生效时段</text>
  70. <text>{{detailsInfo.merchantAdDeliveryPlanDTO.validTimeRangeType==0?'全天':'指定时间段'}}</text>
  71. </view>
  72. <view class="extendArea mt-2" style="font-size: 26rpx;"
  73. v-if="detailsInfo.merchantAdDeliveryPlanDTO.validTimeRangeType=='1'">
  74. <view class="" v-for="(item,index) in detailsInfo.merchantAdDeliveryPlanDTO.localAdvertPlanTimeDTOS"
  75. :key="index">
  76. <span class=" a-c j-s mb-3">
  77. <text style="color: #333;">开始时间:</text>
  78. <text style="color: #333;" class="mr-1"> {{item.startTime}}</text>
  79. </span> --
  80. <span class=" a-c j-s ">
  81. <text style="color: #333;">结束时间:</text>
  82. <text style="color: #333;" class="mr-1"> {{item.endTime }}</text>
  83. </span>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="module dis f-c ">
  88. <text class="module-title ">投放内容</text>
  89. <view class="admaterial mt-3 ">
  90. <!-- <u-swiper :list="imagelist" mode="number" indicator-pos="bottomRight" height="330"
  91. v-if="detailsInfo.imageType=='0'"></u-swiper> -->
  92. <image :src="detailsInfo.taskImage" mode="" v-if="detailsInfo.imageType=='0'" style="width: 100%;"></image>
  93. <video v-else id="myVideo" :src="detailsInfo.taskImage"
  94. :style="{height:'330rpx',width:'100%',borderRadius:'10rpx'}" :muted="false" :enable-progress-gesture="true">
  95. </video>
  96. </view>
  97. </view>
  98. <view class="module dis f-c ">
  99. <text class="module-title ">计费方式</text>
  100. <view class="views dis a-c j-s"
  101. v-for="item in adPricingModelList.filter(item => detailsInfo.merchantAdDeliveryPlanDTO.adPositionPriceRelId == item.id)"
  102. :key="item.id"
  103. >
  104. <text>{{ item.pricingName }}</text>
  105. </view>
  106. </view>
  107. <view class="module dis f-c ">
  108. <text class="module-title ">投放频次</text>
  109. <view class="views dis a-c j-s ">
  110. <text>每人每天展示次数</text>
  111. <text v-if="detailsInfo.merchantAdDeliveryPlanDTO.userDailyImpCount=='-1'">不限</text>
  112. <text v-else>{{detailsInfo.userDailyDisplayLimit}} 次</text>
  113. </view>
  114. <view class="views dis a-c j-s ">
  115. <text>每人展示总次数</text>
  116. <text v-if="detailsInfo.merchantAdDeliveryPlanDTO.userImpCount=='-1'">不限</text>
  117. <text v-else>{{detailsInfo.userTotalDisplayLimit}} 次</text>
  118. </view>
  119. <view class="views dis a-c j-s ">
  120. <text>展示时间间隔</text>
  121. <text v-if="detailsInfo.merchantAdDeliveryPlanDTO.displayTimeInterval=='-1'">不限</text>
  122. <text v-else>{{detailsInfo.showInterval}} 分钟</text>
  123. </view>
  124. </view>
  125. <view class="module dis f-c ">
  126. <text class="module-title ">广告预算</text>
  127. <view class="views dis a-c j-s">
  128. <text>广告预算</text>
  129. <text>{{detailsInfo.adBudget}}元</text>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- <view class="footer-view dis a-c j-s ">
  134. <view class="dis a-c j-c " @click="adEdit">
  135. 编辑
  136. </view>
  137. <view class="dis a-c j-c " @click="delShow=true">
  138. 作废
  139. </view>
  140. </view> -->
  141. <u-popup v-model="rejectReasonShow" mode="center" width="580rpx" :closeable="false" border-radius="20">
  142. <view class="popup">
  143. <view class="header dis a-c j-c ">
  144. <text>驳回原因</text>
  145. </view>
  146. <view class="content dis f-c a-c ">
  147. {{detailsInfo.rejectReason}}
  148. </view>
  149. </view>
  150. <view class="popup-footer dis a-c j-s">
  151. <view class="dis a-c j-c" @click="rejectReasonShow=false">
  152. 我知道了
  153. </view>
  154. <view class="dis a-c j-c" @click="adEdit">
  155. 去修改
  156. </view>
  157. </view>
  158. </u-popup>
  159. <u-popup v-model="delShow" mode="center" width="580rpx" :closeable="false" border-radius="20">
  160. <view class="popup">
  161. <view class="header dis a-c j-c ">
  162. <text>提示</text>
  163. </view>
  164. <view class="content dis f-c a-c ">
  165. <text class="title mb-3">是否将此广告作废?</text>
  166. <text>广告一旦作废将无法使用,只能重新 投放新广告哦~</text>
  167. </view>
  168. </view>
  169. <view class="popup-footer dis a-c j-s">
  170. <view class="dis a-c j-c" @click="delShow=false">
  171. 取消
  172. </view>
  173. <view class="dis a-c j-c" @click="markAsInvalid">
  174. 确定
  175. </view>
  176. </view>
  177. </u-popup>
  178. </view>
  179. </template>
  180. <script>
  181. export default {
  182. data() {
  183. return {
  184. id: '',
  185. rejectReasonShow: false, //驳回弹窗
  186. delShow: false, //作废弹窗
  187. timeSegmentStart: "", //生效开始时间
  188. timeSegmentEnd: "", //生效结束时间
  189. imagelist: [], //图片回显列表
  190. colorList: [{
  191. id: 0,
  192. color: "rgba(230, 141, 0, 1)",
  193. backcolor: "rgba(230, 141, 0, 0.1)",
  194. backcolor1: "rgba(230, 141, 0, 0.2)",
  195. },
  196. {
  197. id: 1,
  198. color: "rgba(255, 19, 19, 1)",
  199. backcolor: "rgba(255, 19, 19, 0.1)",
  200. backcolor1: "rgba(255, 19, 19, 0.2)",
  201. },
  202. {
  203. id: 2,
  204. color: "rgba(100, 166, 255, 1)",
  205. backcolor: "rgba(100, 166, 255, 0.1)",
  206. backcolor1: "rgba(100, 166, 255, 0.2)",
  207. },
  208. {
  209. id: 3,
  210. color: "rgba(119, 119, 120, 1)",
  211. backcolor: "rgba(119, 119, 120, 0.1)",
  212. backcolor1: "rgba(119, 119, 120, 0.2)",
  213. },
  214. {
  215. id: 4,
  216. color: "rgba(100, 166, 255, 1)",
  217. backcolor: "rgba(100, 166, 255, 0.1)",
  218. backcolor1: "rgba(100, 166, 255, 0.2)",
  219. },
  220. {
  221. id: 5,
  222. color: "rgba(0, 129, 171, 1)",
  223. backcolor: "rgba(0, 129, 171, 0.1)",
  224. backcolor1: "rgba(0, 129, 171, 0.2)",
  225. },
  226. {
  227. id: 6,
  228. color: "rgba(175, 96, 255, 1)",
  229. backcolor: "rgba(175, 96, 255, 0.1)",
  230. backcolor1: "rgba(175, 96, 255, 0.2)",
  231. }
  232. ],
  233. detailsInfo: {}, //详情数据
  234. weekList: [], //周
  235. monthList: [], //月
  236. selectedDays: [], //周期策略选中日期
  237. adPricingModelList: [], //计费模式列表
  238. adSlotPriceList: [], //广告位价格列表
  239. headerTitle: "",
  240. }
  241. },
  242. onShow() {
  243. },
  244. computed: {
  245. //区分月和周
  246. cycleStrategylist() {
  247. return this.detailsInfo.validPeriodType == '1' ? this.weekList : this.monthList;
  248. },
  249. //广告类型
  250. adTypeMap() {
  251. const map = {
  252. 0: '全屏广告',
  253. 1: '弹窗广告',
  254. 2: '轮播广告',
  255. 3: '页面嵌入广告',
  256. }
  257. return map[this.detailsInfo.type] || ''
  258. },
  259. //状态
  260. statusTypeMap() {
  261. const map = {
  262. 3: '未开始',
  263. 4: '已生效',
  264. 5: '已作废',
  265. 6: '已结束',
  266. }
  267. return map[this.detailsInfo.status] || ''
  268. }
  269. },
  270. async onLoad(options) {
  271. this.id = options.id
  272. this.generateWeek();
  273. this.generatemonth();
  274. this.getDetail()
  275. this.colorList.map(val => {
  276. if (val.id == this.detailsInfo.status || 4) {
  277. this.detailsInfo.styleCOlor = val;
  278. }
  279. return val;
  280. })
  281. await this.getadBillingModel();
  282. // this.imagelist = this.detailsInfo.taskImage.split(',');
  283. // this.selectedDays = this.detailsInfo?.validPeriodValue.split(',');
  284. // let list = this.detailsInfo?.validTimeRangeValue?.split(',');
  285. // this.timeSegmentStart = list[0];
  286. // this.timeSegmentEnd = list[1];
  287. const map = {
  288. '0': '全屏广告',
  289. '1': '弹窗广告',
  290. '2': '轮播广告',
  291. '3': '页面嵌入广告',
  292. }
  293. },
  294. methods: {
  295. back(){
  296. uni.navigateBack()
  297. },
  298. adEdit() {
  299. uni.navigateTo({
  300. url: '/pages/adManagement/createFullscreenAd?id=' + this.detailsInfo.id,
  301. })
  302. },
  303. getDetail() {
  304. this.$http.post('/advert/localAdvertTask/getQueryById', {
  305. id: this.id,
  306. }).then(res => {
  307. this.detailsInfo = res.data.result
  308. console.log(this.detailsInfo)
  309. })
  310. },
  311. //作废操作
  312. markAsInvalid() {
  313. this.$http.delete('advert/localAdvertTask/cancelDispatch?id=' + this.detailsInfo.id).then(res => {
  314. if (res.data.code == 200) {
  315. uni.navigateBack({
  316. delta: 1
  317. });
  318. }
  319. })
  320. },
  321. //获取计费模式
  322. getadBillingModel() {
  323. this.$http.get('/adPricingPrice/queryPageList', {
  324. params: {
  325. adPositionId: this.detailsInfo.positionId,
  326. city: this.detailsInfo.cityCode,
  327. pageNo: 1,
  328. pageSize: 1000,
  329. }
  330. }).then(res => {
  331. if (res.data.result.records.length > 0) {
  332. this.adSlotPriceList = res.data.result.records[0]?.adPositionPriceRelList;
  333. this.$http.get('/adPricingModel/queryPageList', {
  334. params: {
  335. pageNo: 1,
  336. pageSize: 1000,
  337. isDelete: 0,
  338. }
  339. }).then(res => {
  340. const pricingUnitMap = {
  341. "1": "元/点击",
  342. "2": "元/天",
  343. "3": "元/笔销售",
  344. "4": "元/千次曝光",
  345. }
  346. this.adPricingModelList = res.data.result.records
  347. console.log(this.adPricingModelList)
  348. })
  349. } else {
  350. uni.showToast({
  351. icon: "none",
  352. title: "该区域暂无计费模式相关配置"
  353. })
  354. }
  355. })
  356. },
  357. //周列表
  358. generateWeek() {
  359. const weekList = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'].map((val, index) => {
  360. return {
  361. label: val,
  362. value: (index + 1).toString()
  363. }
  364. })
  365. this.weekList = weekList;
  366. },
  367. // 月列表
  368. generatemonth() {
  369. const monthList = Array.from({
  370. length: 31
  371. }, (_, index) => {
  372. const value = (index + 1).toString();
  373. return {
  374. label: value,
  375. value
  376. };
  377. });
  378. this.monthList = monthList;
  379. },
  380. }
  381. }
  382. </script>
  383. <style lang="scss" scoped>
  384. ::v-deep {
  385. .u-sticky {
  386. background-color: #fff;
  387. }
  388. }
  389. .top {
  390. width: 100%;
  391. height: var(--status-bar-height);
  392. background: #fff;
  393. }
  394. .head {
  395. width: 100%;
  396. background: #ffffff;
  397. .handle {
  398. height: 112rpx;
  399. display: flex;
  400. justify-content: space-between;
  401. align-items: center;
  402. padding: 0px 24rpx;
  403. position: relative;
  404. .head_left {
  405. font-size: 40rpx;
  406. }
  407. .center {
  408. position: absolute;
  409. left: 50%;
  410. top: 50%;
  411. transform: translate(-50%, -50%);
  412. font-size: 34rpx;
  413. font-weight: 600;
  414. }
  415. .head_right {
  416. display: flex;
  417. justify-content: space-between;
  418. align-items: center;
  419. span {
  420. width: 40rpx;
  421. height: 40rpx;
  422. display: flex;
  423. font-size: 28rpx;
  424. justify-content: center;
  425. align-items: center;
  426. }
  427. }
  428. }
  429. }
  430. .page {
  431. background-color: #F7F8FC;
  432. }
  433. .body {
  434. padding: 0 24rpx 154rpx;
  435. box-sizing: border-box;
  436. }
  437. .status-message {
  438. z-index: 9999;
  439. padding: 13rpx 24rpx;
  440. box-sizing: border-box;
  441. text {
  442. font-size: 26rpx;
  443. color: #333;
  444. }
  445. .status {
  446. border-radius: 10rpx;
  447. margin-left: 27rpx;
  448. padding: 10rpx 20rpx;
  449. box-sizing: border-box;
  450. font-size: 26rpx;
  451. font-weight: bold;
  452. line-height: 1;
  453. }
  454. .error {
  455. margin-left: auto;
  456. color: #F00000;
  457. }
  458. }
  459. .module {
  460. padding: 30rpx 20rpx;
  461. box-sizing: border-box;
  462. margin-top: 20rpx;
  463. background-color: #fff;
  464. border-radius: 10rpx;
  465. .module-title {
  466. font-size: 34rpx;
  467. color: #333;
  468. font-weight: bold;
  469. }
  470. .views {
  471. margin-top: 30rpx;
  472. text:first-child {
  473. font-size: 26rpx;
  474. color: #666;
  475. }
  476. text:last-child {
  477. font-size: 26rpx;
  478. color: #333;
  479. }
  480. }
  481. .address {
  482. margin-top: 30rpx;
  483. font-size: 26rpx;
  484. color: #666;
  485. }
  486. .admaterial {
  487. border-radius: 10rpx;
  488. }
  489. }
  490. .footer-view {
  491. z-index: 99;
  492. position: fixed;
  493. bottom: 0;
  494. left: 0;
  495. right: 0;
  496. background-color: #fff;
  497. padding: 17rpx 24rpx;
  498. box-sizing: border-box;
  499. box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(225, 225, 225, 0.3);
  500. >view {
  501. width: 50%;
  502. padding: 26rpx;
  503. box-sizing: border-box;
  504. border-radius: 100rpx;
  505. font-size: 30rpx;
  506. }
  507. :first-child {
  508. background: #fff;
  509. color: #888;
  510. border: 1px solid #E5E5E5;
  511. margin-right: 20rpx;
  512. }
  513. :last-child {
  514. background: #4B9DFF;
  515. color: #fff;
  516. }
  517. }
  518. .extendArea {
  519. padding: 20rpx 20rpx;
  520. box-sizing: border-box;
  521. background: #F6F8FC;
  522. border-radius: 10rpx;
  523. }
  524. .cycleStrategy {
  525. min-width: 100rpx;
  526. background: #FFFFFF;
  527. border-radius: 10rpx;
  528. border: 1px solid #E5E5E5;
  529. font-size: 26rpx;
  530. color: #333;
  531. padding: 10rpx 32rpx;
  532. box-sizing: border-box;
  533. margin-left: 20rpx;
  534. margin-bottom: 20rpx;
  535. text {
  536. line-height: 1;
  537. }
  538. }
  539. .tcycleStrategy-active {
  540. background: #E0EDFF;
  541. color: #006DFF;
  542. border: 1rpx solid #E0EDFF;
  543. }
  544. .popup {
  545. padding: 0 20rpx;
  546. box-sizing: border-box;
  547. .header {
  548. padding: 28rpx;
  549. box-sizing: border-box;
  550. font-size: 34rpx;
  551. color: #333;
  552. font-weight: bold;
  553. border-bottom: 1rpx solid #eee;
  554. }
  555. .content {
  556. min-height: 350rpx;
  557. font-size: 26rpx;
  558. color: #888;
  559. padding: 50rpx;
  560. box-sizing: border-box;
  561. .title {
  562. font-size: 32rpx;
  563. color: #333;
  564. font-weight: bold;
  565. }
  566. }
  567. }
  568. .popup-footer {
  569. position: absolute;
  570. bottom: 0;
  571. width: 100%;
  572. padding: 17rpx 24rpx;
  573. box-sizing: border-box;
  574. background: #fff;
  575. box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(225, 225, 225, 0.3);
  576. font-size: 30rpx;
  577. view:first-child {
  578. width: 50%;
  579. background: #FFFFFF;
  580. padding: 20rpx;
  581. box-sizing: border-box;
  582. border-radius: 100px;
  583. border: 1px solid #E5E5E5;
  584. color: #888;
  585. }
  586. view:last-child {
  587. width: 50%;
  588. background: #4B9DFF;
  589. color: #fff;
  590. padding: 20rpx;
  591. box-sizing: border-box;
  592. border-radius: 100px;
  593. margin-left: 24rpx;
  594. }
  595. }
  596. </style>