detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. <template>
  2. <view class="detail">
  3. <view class="contant">
  4. <view class="title">
  5. <text>{{doEmpty(detail.name)}}</text>
  6. <!-- <text class="share" @click="history">历史信息</text> -->
  7. </view>
  8. <view class="update">
  9. 更新时间<text style="margin: 0 5px;">{{doEmpty(detail.updated_at)}}</text>
  10. ({{detail.user ? detail.user.name :'--'}}贡献上传)
  11. </view>
  12. <view class="distance">
  13. <text>距你当前位置{{distance<1000?distance:(distance/1000).toFixed(1)}}{{distance<1000?'m':'km'}}</text>
  14. <view class="daohang" @click="goThere">导航去那</view>
  15. </view>
  16. <view class="time">
  17. <u-icon name="clock-fill" color='#D1D1D1'></u-icon><text style="color: #FF9C1A; " class="time-text">
  18. {{detail.time ? detail.time.replace(/\n/g," ") : '--'}}</text>
  19. </view>
  20. <view class="time">
  21. <u-icon name="map-fill" color='#D1D1D1'></u-icon><text class="time-text">
  22. {{doEmpty(detail.area_name)}}{{doEmpty(detail.street_name)}}{{doEmpty(detail.address)}}</text>
  23. </view>
  24. <!-- -->
  25. <view class="_image" v-if="detail.cover">
  26. <image :src="detail.cover ? detail.cover :'../../static/image/image.jpg'" mode="widthFix"
  27. @click="bigImage"></image>
  28. <view class="image-tip">
  29. 图片点击可放大
  30. </view>
  31. </view>
  32. <view class="empty" v-else style="padding-top:35px;">
  33. <image src="../../static/image/empty.png" mode="widthFix" @click="bigImage"></image>
  34. <view class="empty-text">
  35. 暂无照片
  36. </view>
  37. </view>
  38. </view>
  39. <view class="contant_1">
  40. <view class="pinglun">
  41. <view class="pl-title">
  42. <u-icon name="chat" color="#000000" size="36"></u-icon><text
  43. style="color: #000000; font-size: font-size: 14px;margin-left: 5px;margin-right: 5px;">评论留言区</text><text
  44. style="color: #BFBFBF; font-size: font-size: 12px;;">您的留言评论对他人非常重要!</text>
  45. </view>
  46. </view>
  47. <view class="button-list">
  48. <view class="button" style="background-color: #2680EB;">
  49. 信息真实有效 {{doEmpty(detail.good_nums)}}
  50. </view>
  51. <view class="button" style="background-color:#F3A948;">
  52. 信息有误 {{doEmpty(detail.bad_nums)}}
  53. </view>
  54. <view class="button" style="background-color:#EF7E7E;">
  55. 地点不存在 {{doEmpty(detail.report_nums)}}
  56. </view>
  57. </view>
  58. <scroll-view :class="[detail.cover?'scroll_yes':'scroll_no']" scroll-y="true" @scrolltolower="loadMore" v-if="list.length>0">
  59. <view class="list">
  60. <view class="list-item" v-for="(item,index) in list" :key='index'>
  61. <view class="dian">
  62. </view>
  63. <view class="item-right">
  64. <view class="list-time">
  65. {{item.created_at}}
  66. </view>
  67. <view class="list-text" v-if="item.type==1">
  68. {{item.user.name}} <text style="margin-left: 10px;">鉴定为信息真实有效!</text>
  69. </view>
  70. <view class="list-text" v-if="item.type==2">
  71. {{item.user.name}} <text style="margin-left: 10px;">鉴定为信息有误!</text>
  72. </view>
  73. <view class="list-text" v-if="item.type==4">
  74. {{item.user.name}} <text style="margin-left: 10px;">鉴定为该地点不存在!</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </scroll-view>
  80. <view class="empty" v-else>
  81. <image src="../../static/image/empty.png" mode="widthFix"></image>
  82. <view class="empty-text">
  83. 暂无数据
  84. </view>
  85. </view>
  86. </view>
  87. <view class="do-commit">
  88. <view class="buttom" @click="doCommit">
  89. 我要发表意见<u-icon name="edit-pen-fill"></u-icon>
  90. </view>
  91. </view>
  92. <u-popup v-model="show" mode="center" border-radius="14" width="580rpx" height="300px">
  93. <view class="prop-title">谢谢您,您的意见能帮助到很多人!</view>
  94. <view class="select-button">
  95. <u-radio-group v-model="select" @change="radioGroupChange" :wrap='true' active-color="#2680EB">
  96. <u-radio v-for="(item, index) in selectList" :key="index" :name="item.value">
  97. {{item.name}}
  98. </u-radio>
  99. </u-radio-group>
  100. <view class="prop-button" @click="sureCommit">
  101. 提交<u-icon name="order"></u-icon>
  102. </view>
  103. </view>
  104. <view class="prop-tip">
  105. 温馨提示:如果恶意上传无用信息,将永久封禁账号
  106. </view>
  107. </u-popup>
  108. <u-popup v-model="bigPicture" mode="center" border-radius="14" width="300px" closeable="true">
  109. <image :src="detail.cover" mode="widthFix"></image>
  110. </u-popup>
  111. <view class="share">
  112. <button hover-class='none' class="shareBtn" type="default" data-name="shareBtn" open-type="share" />
  113. </view>
  114. <view class="tips" @click="shuoming = true">
  115. <image src="../../static/image/tip.png" mode=""></image>
  116. <view class="tips_text">
  117. 说明
  118. </view>
  119. </view>
  120. <u-popup v-model="shuoming" mode="center" border-radius="20" width="580rpx">
  121. <view class="pop_wrap">
  122. <view class="title">
  123. 说明
  124. </view>
  125. <view class="pop_content">
  126. <view class="" style="text-align: justify;">
  127. “到那”小程序只提供信息展示,数据均来自政府公开数据和用户主动上传。如果发现信息有误,请及时进入详情页修改信息或者联系我们。<text
  128. style="color:#10C08C ;">信息的准确性和时效性需要大家共同维护,转发分享,发表意见,帮助他人,快乐自己。</text>
  129. </view>
  130. <view class="" style="color: #FF9C1A;">
  131. 温馨提示:前往核酸检测点,配合工作人员,佩戴口罩,注意个人防护。。
  132. </view>
  133. <view class="">
  134. 如有其他问题请联系 xmbin@hopaheal.com
  135. </view>
  136. <view class="">
  137. “到那”小程序服务理念:为用户提供即时、准确的地点标签
  138. </view>
  139. </view>
  140. </view>
  141. </u-popup>
  142. </view>
  143. </template>
  144. <script>
  145. export default {
  146. data() {
  147. return {
  148. shuoming: false,
  149. detail: '',
  150. good: false,
  151. bad: false,
  152. report: false,
  153. show: false,
  154. body: '',
  155. weihu: '',
  156. bigPicture: false,
  157. last: false,
  158. list: [],
  159. page: 1,
  160. select: 0,
  161. selectList: [{
  162. name: '信息真实有效',
  163. value: 0
  164. },
  165. {
  166. name: '信息有误',
  167. value: 1
  168. },
  169. {
  170. name: '地点不存在',
  171. value: 2
  172. }
  173. ],
  174. distance: '',
  175. id: ''
  176. }
  177. },
  178. onLoad(options) {
  179. this.page = 1
  180. this.list = []
  181. this.last = false
  182. console.log(options)
  183. let slug = options.slug
  184. this.distance = options.distance
  185. this.id = options.id
  186. this.getDetail(slug)
  187. this.getComit()
  188. },
  189. onPullDownRefresh() {
  190. this.page = 1
  191. this.list = []
  192. this.last = false
  193. this.getComit()
  194. },
  195. methods: {
  196. //获取用户信息
  197. getUserProfile(e) {
  198. // 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
  199. // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
  200. wx.getUserProfile({
  201. desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
  202. success: (res) => {
  203. let userInfo = res.userInfo
  204. this.tongBu(userInfo)
  205. }
  206. })
  207. },
  208. //同步
  209. tongBu(data) {
  210. this.$u.post('/base/auth/weapp/user-info-sync', data).then(res => {
  211. console.log(res, 'opopop')
  212. this.show = true
  213. this.$u.vuex('vuex_user', res.data);
  214. })
  215. },
  216. //加载更多
  217. loadMore() {
  218. console.log(this.last,'this.last')
  219. if (!this.last) {
  220. this.page++
  221. this.getComit()
  222. }else{
  223. uni.showToast({
  224. title: '暂无更多',
  225. icon: 'none'
  226. })
  227. }
  228. },
  229. //评论列表
  230. getComit(id) {
  231. this.$u.get('/qunali/record', {
  232. id: this.id,
  233. page:this.page
  234. }).then(res => {
  235. let data = res.data.list
  236. console.log(res, 'course1')
  237. if (this.page > 1 && data.length == 0) {
  238. uni.showToast({
  239. title: '暂无更多',
  240. icon: 'none'
  241. })
  242. this.last = true
  243. } else {
  244. this.list = this.list.concat(data)
  245. }
  246. uni.stopPullDownRefresh()
  247. })
  248. },
  249. //历史信息
  250. history() {
  251. uni.navigateTo({
  252. url: './history?slug=' + this.detail.slug
  253. })
  254. },
  255. //图片放大
  256. bigImage() {
  257. this.bigPicture = true
  258. },
  259. //判断数据为空
  260. doEmpty(value) {
  261. if (value || value == 0) {
  262. return value
  263. } else {
  264. return '--'
  265. }
  266. },
  267. getDetail(slug) {
  268. this.$u.get('/qunali/info', {
  269. slug: slug
  270. }).then(res => {
  271. console.log(res, '详情')
  272. this.detail = res.data.point
  273. this.weihu = res.data.preserve
  274. })
  275. },
  276. //有用
  277. doGood() {
  278. this.$u.get('/qunali/good', {
  279. id: this.detail.id
  280. }).then(res => {
  281. this.show = false
  282. this.detail.good_nums++
  283. this.getComit()
  284. })
  285. },
  286. //无用
  287. doBad() {
  288. let that=this
  289. this.$u.get('/qunali/bad', {
  290. id: this.detail.id
  291. }).then(res => {
  292. this.show = false
  293. this.detail.bad_nums++
  294. uni.showModal({
  295. title: '提示',
  296. content: '诚邀您对这条信息进行修改',
  297. cancelText: '拒绝',
  298. confirmText: '去修改',
  299. success: (res) => {
  300. if (res.confirm) {
  301. uni.reLaunch({
  302. url: '../help/index?slug=' + that.detail.slug
  303. })
  304. }
  305. if (res.cancel) {
  306. that.getComit()
  307. }
  308. }
  309. })
  310. })
  311. },
  312. // showProp() {
  313. // this.show = true
  314. // this.body = ''
  315. // },
  316. //举报
  317. doReport() {
  318. this.$u.post('/qunali/report', {
  319. id: this.detail.id,
  320. body: this.body
  321. }).then(res => {
  322. this.detail.report_nums++
  323. this.show = false
  324. this.getComit()
  325. })
  326. },
  327. //去那
  328. goThere() {
  329. let address = this.detail.area_name + this.detail.street_name + this.detail.address
  330. uni.openLocation({
  331. // 传入你要去的纬度
  332. latitude: this.detail.lat,
  333. // 传入你要去的经度
  334. longitude: this.detail.lng,
  335. // 传入你要去的地址信息 不填则为空
  336. address: address,
  337. // 缩放大小
  338. scale: 18,
  339. success: function() {
  340. console.log('成功的回调success');
  341. }
  342. })
  343. },
  344. //去修改
  345. goChange() {
  346. uni.reLaunch({
  347. url: '../help/index?slug=' + this.detail.slug
  348. })
  349. },
  350. //分享好友
  351. shareFriend() {
  352. },
  353. //doCommit
  354. doCommit() {
  355. let that = this
  356. let user = this.vuex_user.is_sync_info
  357. if (user == 1) {
  358. that.show = true
  359. } else {
  360. that.getUserProfile()
  361. }
  362. },
  363. //确定提交
  364. sureCommit() {
  365. if (this.select == 0) {
  366. this.doGood()
  367. }
  368. if (this.select == 1) {
  369. this.doBad()
  370. }
  371. if (this.select == 2) {
  372. this.doReport()()
  373. }
  374. }
  375. },
  376. onShareAppMessage(res) {
  377. return {
  378. title: this.detail.name,
  379. path: `/pages/index/detail?slug=${this.detail.slug}`
  380. }
  381. }
  382. }
  383. </script>
  384. <style lang="scss" scoped>
  385. .empty {
  386. padding-top: 60px;
  387. text-align: center;
  388. image {
  389. margin: 0 auto;
  390. width: 50%;
  391. }
  392. .empty-text {
  393. text-align: center;
  394. margin-top: 8px;
  395. color: #B5B5B5;
  396. }
  397. }
  398. .do-commit {
  399. padding: 8px 0;
  400. position: fixed;
  401. background-color: #F5F5F5;
  402. width: 100%;
  403. bottom: 0;
  404. z-index: 9999;
  405. .buttom {
  406. height: 40px;
  407. border-radius: 18px;
  408. line-height: 40px;
  409. background-color: #10C08C;
  410. text-align: center;
  411. margin: 0 auto;
  412. color: #FFFFFF;
  413. width: 90%;
  414. }
  415. }
  416. ::v-deep {
  417. .u-radio {
  418. margin-bottom: 10px !important;
  419. }
  420. }
  421. .detail {
  422. background: #F8F8F8;
  423. }
  424. .go-there {
  425. height: 33px;
  426. width: 33px;
  427. border-radius: 50%;
  428. background-color: #16BA63;
  429. position: fixed;
  430. right: 20px;
  431. background-image: url(../../static/image/go.png);
  432. background-position: center;
  433. background-size: 100%;
  434. bottom: 15%;
  435. }
  436. .go-change {
  437. height: 33px;
  438. width: 33px;
  439. border-radius: 50%;
  440. background-color: #16BA63;
  441. position: fixed;
  442. right: 20px;
  443. background-position: center;
  444. background-size: 100%;
  445. text-align: center;
  446. line-height: 33px;
  447. bottom: 8%;
  448. }
  449. .contant,
  450. .contant_1 {
  451. padding: 12px;
  452. background-color: #FFFFFF;
  453. .scroll_yes{
  454. height: calc(100vh - 422px);
  455. }
  456. .scroll_no{
  457. height: calc(100vh - 400px);
  458. }
  459. }
  460. .contant_1 {
  461. padding-bottom: 70px;
  462. margin-top: 5px;
  463. }
  464. .title {
  465. font-size: 18px;
  466. color: #333333;
  467. font-weight: bold;
  468. .share {
  469. display: inline-block;
  470. margin-left: 12px;
  471. color: #16BA63;
  472. background: #C7EFDA;
  473. padding: 3px;
  474. font-size: 12px;
  475. border-radius: 3px;
  476. }
  477. }
  478. .update {
  479. font-size: 12px;
  480. font-weight: bold;
  481. color: #6D6D6D;
  482. line-height: 12px;
  483. margin-top: 6px;
  484. }
  485. .distance {
  486. font-size: 14px;
  487. color: #333333;
  488. margin-top: 8px;
  489. text {
  490. display: inline-block;
  491. margin-right: 10px;
  492. line-height: 20px;
  493. // height: 20px;
  494. }
  495. .daohang {
  496. display: inline-block;
  497. vertical-align: middle;
  498. width: 89px;
  499. padding-right: 15px;
  500. background-image: url(../../static/image/fly.png);
  501. background-repeat: no-repeat;
  502. background-size: 12px 10px;
  503. background-position: 85% center;
  504. height: 20px;
  505. background-color: #10C08C;
  506. font-size: 12px;
  507. font-weight: bold;
  508. border-radius: 100px 100px 100px 100px;
  509. color: #FFFFFF;
  510. line-height: 20px;
  511. text-align: center;
  512. }
  513. }
  514. .time {
  515. font-size: 13px;
  516. margin-top: 13px;
  517. font-weight: 400;
  518. color: #9F9F9F;
  519. margin-top: 8px;
  520. display: flex;
  521. }
  522. .time-text {
  523. display: inline-block;
  524. vertical-align: top;
  525. margin-left: 8px;
  526. }
  527. ._image {
  528. position: relative;
  529. margin-top: 23px;
  530. overflow: hidden;
  531. height: 194px;
  532. width: 100%;
  533. border-radius: 12px;
  534. image {
  535. width: 100%;
  536. }
  537. .image-tip {
  538. position: absolute;
  539. bottom: 0;
  540. left: 0;
  541. height: 30px;
  542. line-height: 30px;
  543. font-size: 20px;
  544. color: #FFFFFF;
  545. }
  546. }
  547. .posi {
  548. font-size: 18px;
  549. font-weight: 400;
  550. color: #000000;
  551. margin-top: 32px;
  552. }
  553. .button-list {
  554. margin-top: 19px;
  555. margin-bottom: 25px;
  556. .button {
  557. display: inline-block;
  558. vertical-align: middle;
  559. padding: 3px 10px;
  560. border-radius: 3px;
  561. color: #FFFFFF;
  562. font-size: 12px;
  563. margin-right: 10px;
  564. }
  565. }
  566. .footer {
  567. margin-bottom: 15px;
  568. .tip {
  569. margin-bottom: 7px;
  570. border-radius: 3px;
  571. border: 1px solid #707070;
  572. padding: 3px 8px;
  573. display: inline-block;
  574. color: #707070;
  575. font-size: 13px;
  576. }
  577. .text,
  578. .title {
  579. line-height: 22px;
  580. font-size: 13px;
  581. color: #707070;
  582. }
  583. }
  584. button {}
  585. .footer-share {
  586. margin: 0 auto;
  587. width: 145px;
  588. padding: 7px 0;
  589. background: #16BA63;
  590. line-height: 29px !important;
  591. border-radius: 10px;
  592. text-align: center;
  593. border: 1px solid #16BA63;
  594. font-size: 16px;
  595. color: #FFFFFF;
  596. margin-top: 24px;
  597. margin-bottom: 20px;
  598. }
  599. .prop-title {
  600. padding: 15px 20px;
  601. background-color: #10C08C;
  602. color: #fff;
  603. text-align: center;
  604. }
  605. .select-button {
  606. padding: 30px 30px 0;
  607. }
  608. .prop-tip {
  609. font-size: 10px;
  610. margin-top: 13px;
  611. text-align: center;
  612. color: #666666;
  613. line-height: 28px;
  614. }
  615. .prop-text {
  616. margin: 0px 20px;
  617. }
  618. .prop-button {
  619. margin-top: 10px;
  620. padding: 5px 0;
  621. background: #10C08C;
  622. line-height: 32px !important;
  623. border-radius: 30px;
  624. text-align: center;
  625. border: 1px solid #16BA63;
  626. font-size: 14px;
  627. color: #FFFFFF;
  628. margin-bottom: 10px;
  629. }
  630. .list {
  631. .list-item {
  632. padding-left: 5px;
  633. position: relative;
  634. .item-right {
  635. // margin-top: 5px;
  636. border-left: solid 2px #10C08C;
  637. padding-bottom: 20px;
  638. padding-left: 8px;
  639. }
  640. .list-time {
  641. font-size: 14px;
  642. color: #FF9C1A;
  643. }
  644. .list-text {
  645. font-size: 14px;
  646. color: #7F7F7F;
  647. }
  648. }
  649. .dian {
  650. position: absolute;
  651. height: 12px;
  652. width: 12px;
  653. top: 0px;
  654. left: 0px;
  655. background-color: #10C08C;
  656. border-radius: 50%;
  657. z-index: 80;
  658. }
  659. }
  660. .share {
  661. position: fixed;
  662. z-index: 2;
  663. right: 7px;
  664. bottom: 110px;
  665. button {
  666. width: 60px;
  667. height: 60px;
  668. border-radius: 50%;
  669. background-image: url(../../static/image/share.png);
  670. background-position: center;
  671. background-size: 100%;
  672. box-shadow: 0px 0px 6px rgba(16, 192, 140, 0.6);
  673. padding: 0 !important;
  674. margin: 0 !important;
  675. border: none !important;
  676. box-sizing: border-box;
  677. }
  678. }
  679. .tips {
  680. position: fixed;
  681. z-index: 2;
  682. right: 17px;
  683. bottom: 64px;
  684. width: 39px;
  685. height: 39px;
  686. background: #FFFFFF;
  687. box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16);
  688. border-radius: 5px;
  689. display: flex;
  690. flex-direction: column;
  691. justify-content: center;
  692. align-items: center;
  693. image {
  694. width: 17px;
  695. height: 17px;
  696. }
  697. .tips_text {
  698. font-size: 9px;
  699. font-weight: bold;
  700. color: #858482;
  701. padding-top: 2px;
  702. }
  703. }
  704. .pop_wrap {
  705. .title {
  706. background-color: #10c08c;
  707. color: #fff;
  708. font-size: 18px;
  709. text-align: center;
  710. height: 40px;
  711. line-height: 40px;
  712. }
  713. .pop_content {
  714. padding: 15px 12px;
  715. view {
  716. margin-bottom: 10px;
  717. }
  718. }
  719. }
  720. </style>