fullscreenAdDetails.vue 14 KB

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