detail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <template>
  2. <view v-if="isShowView">
  3. <view class="user ddflex" @click="toUserHomePage(detail.userDTO)">
  4. <image :src="detail.userDTO.avatar?detail.userDTO.avatar:'/static/images/def_head.png'" mode="aspectFill" class="userimg"></image>
  5. <view class="fflex">
  6. <view class="namea ddflex">
  7. <view class="name fflex ddflex">
  8. {{ detail.userDTO.nickName }}
  9. <image v-if="detail.userDTO.levelGrade > 0" src="../../static/images/vip_tag.png" class="vip-tag"></image>
  10. </view>
  11. <view class="time">{{ detail.time }}</view>
  12. </view>
  13. <view class="area" v-if="detail.userDTO.cityName">{{ detail.userDTO.provinceName }} {{ detail.userDTO.cityName }}</view>
  14. </view>
  15. </view>
  16. <view class="con">
  17. <!-- //提问 -->
  18. <view v-if="detail.type == 2" class="des tovers">
  19. <view class="wen">提问</view>
  20. {{ removeHtml(detail.content) }}
  21. </view>
  22. <view class="des" v-else><rich-text :nodes="detail.content"></rich-text></view>
  23. <view class="video" v-if="detail.isHaveVideo && config.open_community_video == 1">
  24. <video :src="detail.url" :show-center-play-btn="false" :controls="detail.isControls" :autoplay="detail.isControls" id="myVideo" @pause="videoPause" @ended="videoEnded"></video>
  25. <view class="video-play ddflex" @click="videoPlay()" v-if="detail.isShowPlayBtn"><image src="../../static/images/play.png"></image></view>
  26. </view>
  27. <view class="imgbox ddflex" v-if="!detail.isHaveVideo&&detail.url">
  28. <image mode="aspectFill" v-for="(it, idx) in styleImgList(detail.url)" :src="it" @click="previewImgss(styleImgList(detail.url), idx)" :key="idx"></image>
  29. </view>
  30. <view :class="'vote-box' + (detail.qyPoll.isEnd ? ' ends' : '')" v-if="detail.qyPoll">
  31. <view class="vote-tit">{{ detail.qyPoll.title }}</view>
  32. <block v-if="detail.qyPoll.isVote == 1">
  33. <!-- 已投 -->
  34. <view class="vote-list end">
  35. <view :class="'lis ddflex ' + (itpy.isVote == 1 ? 'active' : '')" v-for="(itpy, idex) in styleList(detail.qyPoll.optionJson)" :key="idex">
  36. <view class="percent" :style="'width:' + parseFloat(itpy.proportion) + '%;'"></view>
  37. <view class="fflex">{{ itpy.name }}</view>
  38. <view>{{ parseFloat(itpy.proportion) + '%' }}</view>
  39. </view>
  40. </view>
  41. </block>
  42. <block v-else>
  43. <!-- 未投票 -->
  44. <view class="vote-list">
  45. <!-- <view class="lis" @tap="submitPolls(idex)">我是选项</view> -->
  46. <view class="lis" @click="submitPolls(idx)" v-for="(itp, idx) in styleList(detail.qyPoll.optionJson)" :key="idx">{{ itp.name }}</view>
  47. </view>
  48. </block>
  49. <view class="vote-can" v-if="detail.qyPoll.isEnd">
  50. <text>{{ detail.qyPoll.voteCount }}人参与</text>
  51. 投票已结束
  52. </view>
  53. </view>
  54. <view class="que ddflex" v-if="detail.question" @click="jumpUrl('/learn/topic/index?questId=' + detail.question.id)">
  55. <!-- <image src="../../static/images/ht_ico1.png" class="st-ico"></image> -->
  56. <view class="fflex"><rich-text :nodes="detail.question.title" class="tovers"></rich-text></view>
  57. <!-- <image src="../../static/images/ht_ico2.png" class="st-rico"></image> -->
  58. </view>
  59. <!-- <view class="cates ddflex" v-if="detail.question && detail.question.cateName">
  60. <text>{{ detail.question.cateName }}</text>
  61. </view> -->
  62. <view class="ddflex" v-if="detail.qyDialogu">
  63. <view class="topic ddflex" @click="jumpUrl('/topics/detail/detail?topicId=' + detail.qyDialogu.id)">
  64. <image src="../../static/images/topic.png"></image>
  65. <view class="fflex tover">{{ detail.qyDialogu.title }}</view>
  66. </view>
  67. </view>
  68. <view class="ds ddflex">
  69. <view class="loca ddflex fflex" @click="jumpUrlPoi(detail,'/office/poi/index')" v-if="detail.poiName"><image :src="picUrlss+'office_images/loca.png'"></image><text v-if="detail.poiDistance > 0">{{detail.poiDistance ? detail.poiDistance < 1000 ? detail.poiDistance+'m' : (detail.poiDistance/1000).toFixed(1)+'km' : ''}}</text>{{detail.poiName}}</view>
  70. <view class="ddflex" style="justify-content: flex-end;">
  71. <view>{{ detail.count.browseCount }}次浏览</view>
  72. <!-- #ifdef MP-WEIXIN -->
  73. <button open-type="share" hover-class="none" class="opt-share ddflex">
  74. <image src="../../static/images/share.png"></image>
  75. 分享
  76. </button>
  77. <!-- #endif -->
  78. <!-- #ifdef APP-PLUS -->
  79. <view class="opt-share ddflex" @click="appToShare()">
  80. <image src="../../static/images/share.png"></image>
  81. 分享
  82. </view>
  83. <!-- #endif -->
  84. </view>
  85. </view>
  86. <block v-if="detail.type==10||detail.type==11">
  87. <view v-if="detail.type==10" class="ddflex step-box" style="justify-content: space-between;" @click="jumpUrl('/exercise/record/record?userId=' + detail.userId)">
  88. <view>
  89. <view class="step-date">{{detail.wxRun.step}}</view>
  90. <view class="step-label">步数</view>
  91. </view>
  92. <view>
  93. <view class="step-date">{{detail.wxRun.index}}</view>
  94. <view class="step-label" style="text-align: right;">名次</view>
  95. </view>
  96. </view>
  97. <view v-if="detail.type==11" class="ddflex step-box" style="justify-content: space-between;" @click="jumpUrl('/match/activityDetail/activityDetail?id=' + detail.matchContent.id)">
  98. <image class="step-pic" :src="detail.matchContent.pic" mode="aspectFill"></image>
  99. <view class="fflex">
  100. <view class="step-title tovers">{{detail.matchContent.title}}</view>
  101. <view class="ddflex" style="justify-content: space-between;margin-top: 10rpx;">
  102. <view class="step-price">{{detail.matchContent.endTime}}</view>
  103. <view class="step-btn">查看</view>
  104. </view>
  105. </view>
  106. </view>
  107. </block>
  108. <view v-if="detail.userGroupId" class="ddflex step-box" style="padding: 25rpx 21rpx;" @click="jumpUrl('/office/team/index?id=' + detail.userGroupId)">
  109. <image style="width: 24rpx;height: 24rpx;margin-right: 13rpx;" src="../../static/images/link.png"></image>
  110. <view style="font-weight: 500;color: #999999;">Team:</view>
  111. <view>{{detail.userGroupTitle}}</view>
  112. </view>
  113. <block v-else>
  114. <view class="product" v-if="detail.products && detail.products.length > 0">
  115. <view scroll-x="true" :class="'pro-view' + (detail.products.length == 1 ? ' pro-view1' : '')">
  116. <view class="li" v-for="(item, index) in detail.products" :key="index" @click="toProductDetail(item)">
  117. <view class="ddflex">
  118. <image :src="item.pic + '?x-oss-process=style/w375'" mode="aspectFill" class="pic"></image>
  119. <view class="fflex">
  120. <view class="title tovers">{{ item.title }}</view>
  121. <view class="opt ddflex">
  122. <view class="money">¥{{ item.salePrice }}</view>
  123. <view class="pro-btn">购买</view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </block>
  131. <!-- <view class="shares ddflex">
  132. <button open-type="share" class="share-btn ddflex">
  133. <image src="../static/images/wechat.png"></image>
  134. 微信好友
  135. </button>
  136. <button open-type="share" class="share-btn ddflex">
  137. <image src="../static/images/wechat_1.png"></image>
  138. 朋友圈
  139. </button>
  140. </view> -->
  141. </view>
  142. <view class="line"></view>
  143. <view class="comments">
  144. <view class="tits">
  145. 评论
  146. <text>({{ detail.count.commentCount }})</text>
  147. </view>
  148. <view class="list" v-if="commentList && commentList.length > 0">
  149. <view class="li ddflex" v-for="(item, index) in commentList" :key="index">
  150. <image
  151. :src="item.userDTO.avatar ? item.userDTO.avatar : '/static/images/def_head.png'"
  152. mode="scaleToFill"
  153. class="userimg"
  154. @click="toUserHomePage(item.userDTO)"
  155. ></image>
  156. <view class="fflex">
  157. <view class="c-user ddflex">
  158. <view class="fflex" @click="toUserHomePage(item.userDTO)">
  159. <view class="name fflex ddflex">
  160. {{ item.userDTO.nickName }}
  161. <text class="lz" v-if="item.userDTO.isLandlord == 1">楼主</text>
  162. </view>
  163. <view class="area" v-if="item.userDTO.cityName">{{ item.userDTO.provinceName }} {{ item.userDTO.cityName }}</view>
  164. </view>
  165. <view class="zan ddflex" @click="submitFabulous(2, item.id, index)">
  166. <image :src="'../../static/images/' + (item.isPraise == 1 ? 'like_h' : 'like') + '.png'"></image>
  167. {{ item.praiseNO }}
  168. </view>
  169. </view>
  170. <view class="c-des">{{ item.content }}</view>
  171. <view class="sta ddflex">
  172. <view class="reply ddflex" @click="showReply(item, '', index)">
  173. 回复
  174. <image src="../../static/images/rico1.png"></image>
  175. </view>
  176. <view class="time">{{ item.time }}</view>
  177. </view>
  178. <view class="replys" v-if="item.plist && item.plist.length > 0">
  179. <view class="lis" @click="showReply(item, itm, index)" v-for="(itm, idx) in item.plist" :key="idx">
  180. <text>{{ itm.userDTO.nickName }}</text>
  181. <text class="lz" v-if="itm.userDTO.isLandlord == 1">楼主</text>
  182. <block v-if="itm.toUserDTO && itm.toUserDTO.nickName">
  183. 回复
  184. <text>{{ itm.toUserDTO.nickName }}</text>
  185. <text class="lz" v-if="itm.toUserDTO.isLandlord == 1">楼主</text>
  186. </block>
  187. : {{ itm.content }}
  188. </view>
  189. <!-- @click="jumpUrl('/office/comments/comments')" -->
  190. <view class="check" @click="loadMoreComment(item, index)" v-if="item.commentsNo > 3 && item.plist.length < item.commentsNo">
  191. 查看全部{{ item.commentsNo - item.plist.length }}条回复
  192. </view>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. <view class="nodata" v-else>
  198. <image :src="picUrlss + 'empty_kt.png'"></image>
  199. <text>暂无评论</text>
  200. </view>
  201. </view>
  202. <view class="bot ddflex" v-if="!isShowReply">
  203. <view class="c-ipt fflex ddflex" @click="showReply()">
  204. <image src="../static/images/pl_ico.png"></image>
  205. <view class="ipt">说点什么吧</view>
  206. </view>
  207. <view class="bot-btn" @click="submitFabulous(5)">
  208. <image :src="'../static/images/' + (detail.isCollection == 1 ? 'collect_h' : 'collect') + '.png'"></image>
  209. <view>收藏</view>
  210. </view>
  211. <view class="bot-btn" @click="submitFabulous(2)">
  212. <image :src="'../../static/images/' + (detail.isPraise == 1 ? 'like_h' : 'like') + '.png'"></image>
  213. <view>点赞</view>
  214. <text class="num">{{ detail.count.fabulousCount < 99 ? detail.count.fabulousCount : '99+' }}</text>
  215. </view>
  216. <view class="bot-btn" @click="showReply()">
  217. <image src="../static/images/comment.png"></image>
  218. <view>评论</view>
  219. <text class="num">{{ detail.count.commentCount < 99 ? detail.count.commentCount : '99+' }}</text>
  220. </view>
  221. </view>
  222. <view class="ceng" v-if="isShowReply" @click="hideReply()"></view>
  223. <view class="bot1 ddflex" v-if="isShowReply">
  224. <view class="reply-sr ddflex fflex">
  225. <input
  226. v-model="commentContent"
  227. :placeholder="checkUserDTO ? '回复' + checkUserDTO.nickName : '输入的内容'"
  228. placeholder-class="placeholder"
  229. class="ipt fflex"
  230. focus="true"
  231. />
  232. <view class="submit" @click="submitComment()">提交</view>
  233. </view>
  234. </view>
  235. </view>
  236. </template>
  237. <script>
  238. const app = getApp();
  239. const req = require('../../utils/request.js');
  240. const util = require('../../utils/util.js');
  241. const requsetmessage = require('../../utils/requestmessage.js');
  242. const QQMapWX = require("../../utils/qqmap.js");
  243. export default {
  244. data() {
  245. return {
  246. picUrlss: req.public.picUrls,
  247. isShowView: false,
  248. isShowReply: false,
  249. isLoad: true,
  250. form: {
  251. page: 1,
  252. limit: 10
  253. },
  254. moreCommentForm: {
  255. page: 0,
  256. limit: 20
  257. },
  258. contentId: '', //动态id
  259. detail: '', //动态详情
  260. commentList: '', //评论详情
  261. commentContent: '',
  262. commentType: 1, //1评论动态,2回复外层评论,3回复二级评论
  263. checkConmmentItem: '',
  264. checkUserDTO: '',
  265. checkPositionIndex: '', //选中的下标
  266. checkItm: '',
  267. isNews: false, //是否从消息列表进入
  268. commentId: '',
  269. isSubmit: false,
  270. videoContext: '',
  271. config: {},
  272. pois: '',
  273. currentPoi: {}
  274. };
  275. },
  276. onLoad(opt) {
  277. this.contentId = opt.contentId;
  278. if (opt.isNews) {
  279. this.isNews = true;
  280. this.commentId = opt.commentId;
  281. }
  282. if(req.getStorage('loctionAddressMap')){
  283. this.pois = {
  284. poiLongitude: req.getStorage('loctionAddressMap').location.lng,
  285. poiLatitude: req.getStorage('loctionAddressMap').location.lat
  286. }
  287. this.getDetail();
  288. }else{
  289. QQMapWX.initMap();
  290. req.getLocation(res => {
  291. const to = {
  292. latitude: res.latitude,
  293. longitude: res.longitude
  294. };
  295. QQMapWX.reverseGeocoder(to, resp => {
  296. if(resp){
  297. resp.pois.map(it=>{
  298. it.poiName = it.title;
  299. it.poiAddress = it.address;
  300. it.poiLongitude = it.location.lng;
  301. it.poiLatitude = it.location.lat
  302. return it;
  303. })
  304. this.pois = resp.pois[0];
  305. }
  306. this.getDetail();
  307. });
  308. });
  309. }
  310. this.getCommentList();
  311. },
  312. onShow() {
  313. this.config = JSON.parse(req.getStorage('configRes'))
  314. },
  315. onShareAppMessage() {
  316. var url = '/office/detail/detail?contentId=' + this.contentId;
  317. var img = '';
  318. if (this.detail.url) {
  319. var imgList = this.detail.url.split(',');
  320. img = imgList[0];
  321. } else {
  322. }
  323. return {
  324. title: util.removeHtml(this.detail.content),
  325. imageUrl: img,
  326. path: url
  327. };
  328. },
  329. onReachBottom() {
  330. this.form.page++;
  331. this.getCommentList();
  332. },
  333. methods: {
  334. removeHtml(content) {
  335. return util.removeHtml(content);
  336. },
  337. styleList(json) {
  338. var obj = JSON.parse(json);
  339. return obj;
  340. },
  341. styleImgList(str) {
  342. if (str) {
  343. var imgList = str.split(',');
  344. return imgList;
  345. } else {
  346. return [];
  347. }
  348. },
  349. jumpUrl(url) {
  350. if (!req.isLogins(true)) {
  351. return;
  352. }
  353. uni.navigateTo({
  354. url: url
  355. });
  356. },
  357. jumpUrlPoi(item,url){
  358. this.currentPoi = item;
  359. uni.navigateTo({
  360. url: url
  361. })
  362. },
  363. toUserHomePage(userObj) {
  364. if (userObj.isApiUser != 1) {
  365. //不是后台用户,则可跳转
  366. this.jumpUrl('/topics/home/home?userId=' + userObj.id);
  367. }
  368. },
  369. showReply(conmmentItem, itm, position) {
  370. if (!req.isLogins(true)) {
  371. return;
  372. }
  373. this.commentContent = '';
  374. this.isShowReply = true;
  375. this.checkConmmentItem = conmmentItem;
  376. if (itm) {
  377. this.checkItm = itm; //二级评论
  378. this.checkUserDTO = itm.userDTO;
  379. }
  380. this.checkPositionIndex = position;
  381. if (!conmmentItem) {
  382. this.commentType = 1;
  383. } else {
  384. if (!itm.userDTO) {
  385. this.commentType = 2;
  386. } else {
  387. this.commentType = 3;
  388. }
  389. }
  390. },
  391. hideReply() {
  392. this.isShowReply = false;
  393. },
  394. //预览图片
  395. previewImgss(picUrls, index) {
  396. //预览合同图片
  397. var src = picUrls[index];
  398. let imgs = picUrls;
  399. uni.previewImage({
  400. current: src, // 当前显示图片的http链接
  401. urls: imgs
  402. });
  403. },
  404. toProductDetail(item) {
  405. if (!req.isLogins(true)) {
  406. return;
  407. }
  408. if (item.actId) {
  409. app.globalData.openPage('group/detail/detail?id=' + item.id + '&groupId=' + item.actId);
  410. } else {
  411. app.globalData.openPage('product/detail/detail?id=' + item.id);
  412. }
  413. },
  414. sum(arr) {
  415. var s = 0;
  416. for (var i = arr.length - 1; i >= 0; i--) {
  417. if (arr[i].count) {
  418. s += Number(arr[i].count);
  419. }
  420. }
  421. return s;
  422. },
  423. getDetail() {
  424. let params = {
  425. id: this.contentId
  426. }
  427. if(this.pois){
  428. params.poiLatitude = this.pois.poiLatitude;
  429. params.poiLongitude = this.pois.poiLongitude;
  430. }
  431. req.getRequest('/api/v3/moments/info', params, data => {
  432. if (data.qyPoll && data.qyPoll.isEnd) {
  433. data.qyPoll.voteCount = this.sum(JSON.parse(data.qyPoll.optionJson));
  434. }
  435. if(data.url){
  436. let h = data.url.substring(data.url.lastIndexOf('.') + 1)
  437. if(h.indexOf('mp4')>-1||h.indexOf('MP4')>-1){
  438. console.log('视频',h,h.indexOf('mp4'),h.indexOf('MP4'))
  439. data.isHaveVideo = true
  440. data.isControls = false
  441. data.isShowPlayBtn = true
  442. }
  443. }
  444. this.detail = data;
  445. this.isShowView = true;
  446. if (this.isNews) {
  447. this.getUpdateIsSee();
  448. }
  449. });
  450. },
  451. getUpdateIsSee() {
  452. let params = {
  453. id: this.commentId
  454. };
  455. req.postRequest('/api/v3/fabulous/updateIsSee', { id: this.commentId }, res => {});
  456. },
  457. //获取评论列表
  458. getCommentList() {
  459. if (!this.isLoad) return false;
  460. this.isLoad = false;
  461. let form = this.form;
  462. form.momentsId = this.contentId;
  463. form.type = 3;
  464. form.isQueryPid = 1;
  465. req.getRequest('/api/v3/fabulous/list', form, data => {
  466. if (data && data.length >= 10) {
  467. this.isLoad = true;
  468. }
  469. if (this.form.page > 1) {
  470. data = this.commentList.concat(data);
  471. }
  472. this.commentList = data;
  473. });
  474. },
  475. loadMoreComment(item, index) {
  476. if (!req.isLogins(true)) {
  477. return;
  478. }
  479. this.moreCommentForm.page++;
  480. var dataPram = this.moreCommentForm;
  481. dataPram.type = 3;
  482. dataPram.pid = item.id;
  483. req.getRequest('/api/v3/fabulous/listV1', dataPram, data => {
  484. if (this.moreCommentForm.page == 1) {
  485. this.commentList[index].plist = [];
  486. }
  487. this.commentList[index].plist = this.commentList[index].plist.concat(data);
  488. });
  489. },
  490. //提交点赞、取消点赞;收藏、取消收藏
  491. submitFabulous(type, pid, commentIndex) {
  492. if (!req.isLogins(true)) {
  493. return;
  494. }
  495. var dataP = {};
  496. dataP.type = type; //1,观看 ,2点赞,3评论,4分享,5收藏
  497. if (pid) {
  498. dataP.pid = pid;
  499. }
  500. dataP.momentsId = this.contentId;
  501. req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
  502. if (type == 2) {
  503. //点赞
  504. if (pid) {
  505. //评论点赞点赞
  506. if (this.commentList[commentIndex].isPraise == 1) {
  507. this.commentList[commentIndex].isPraise = 0;
  508. this.commentList[commentIndex].praiseNO--;
  509. } else {
  510. this.commentList[commentIndex].isPraise = 1;
  511. this.commentList[commentIndex].praiseNO++;
  512. }
  513. } else {
  514. //动态点赞
  515. if (this.detail.isPraise == 1) {
  516. //已赞
  517. this.detail.isPraise = 0;
  518. this.detail.count.fabulousCount--;
  519. } else {
  520. this.detail.isPraise = 1;
  521. this.detail.count.fabulousCount++;
  522. }
  523. }
  524. } else if (type == 5) {
  525. //收藏
  526. if (this.detail.isCollection == 1) {
  527. this.detail.isCollection = 0;
  528. } else {
  529. this.detail.isCollection = 1;
  530. }
  531. }
  532. });
  533. },
  534. //提交评论
  535. async submitComment() {
  536. console.log('this.isSubmit==', this.isSubmit);
  537. if (this.isSubmit) return false;
  538. var dataP = {};
  539. dataP.type = 3;
  540. if (this.commentContent) {
  541. dataP.content = this.commentContent;
  542. } else {
  543. req.msg('请输入评论内容');
  544. return;
  545. }
  546. //1评论动态,2回复外层评论,3回复二级评论
  547. if (this.commentType == 2) {
  548. dataP.pid = this.checkConmmentItem.id;
  549. } else if (this.commentType == 3) {
  550. dataP.pid = this.checkConmmentItem.id;
  551. dataP.replyId = this.checkItm.id;
  552. dataP.toUserId = this.checkUserDTO.id;
  553. }
  554. //为提问时,需要加匿名参数
  555. if (this.detail.type == 2) {
  556. dataP.momentsType = 2; //匿名
  557. }
  558. dataP.momentsId = this.contentId;
  559. this.isSubmit = true;
  560. // await requsetmessage.remindIntegral().then(res => {});
  561. req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
  562. this.detail.count.commentCount++;
  563. req.msg('评论成功');
  564. this.hideReply();
  565. if (this.commentType == 1) {
  566. //在评论列表首位插入
  567. this.commentList.splice(0, 0, data);
  568. } else {
  569. //在评论列表二级列表末尾处插入
  570. this.commentList[this.checkPositionIndex].plist.push(data);
  571. }
  572. setTimeout(res => {
  573. this.isSubmit = false;
  574. }, 200);
  575. });
  576. },
  577. //提交投票
  578. submitPolls(pollIndex) {
  579. if (!req.isLogins(true)) {
  580. return;
  581. }
  582. if (this.detail.qyPoll.isEnd) return req.msg('投票已结束');
  583. var dataP = {};
  584. dataP.pollId = this.detail.qyPoll.id;
  585. var pollObjList = JSON.parse(this.detail.qyPoll.optionJson);
  586. dataP.pollOptionCode = pollObjList[pollIndex].code;
  587. req.postRequest('/api/v3/poll/saveDetails', dataP, data => {
  588. req.msg('投票成功');
  589. //图片完之后要将该投票的对象返回,便于做渲染%
  590. this.detail.qyPoll = data;
  591. });
  592. },
  593. appToShare() {
  594. console.log('数据>>>>');
  595. var img = '';
  596. if (this.detail.url) {
  597. var imgList = this.detail.url.split(',');
  598. img = imgList[0] + '?x-oss-process=style/w375';
  599. } else {
  600. let config = JSON.parse(req.getStorage('configRes'));
  601. img = config.share_pic;
  602. }
  603. console.log('数据>>>>', img);
  604. var text = util.removeHtml(this.detail.content);
  605. console.log('数据>>>>', text);
  606. uni.share({
  607. provider: 'weixin',
  608. scene: 'WXSceneSession',
  609. type: 5,
  610. imageUrl: img,
  611. title: text,
  612. summary: text,
  613. miniProgram: {
  614. id: req.public.miniProgramGh_id,
  615. path: 'office/detail/detail?contentId=' + this.contentId,
  616. type: 0,
  617. webUrl: 'http://www.lemonban.com'
  618. },
  619. success: ret => {
  620. console.log(ret);
  621. },
  622. fail: ret => {
  623. console.log(ret);
  624. }
  625. });
  626. },
  627. videoPlay(){
  628. var that = this;
  629. this.detail.isControls = true
  630. this.detail.isShowPlayBtn = false
  631. var videoContext = uni.createVideoContext('myVideo') // 对应的视频id
  632. videoContext.play()
  633. },
  634. videoPause(index){
  635. this.detail.isControls = false
  636. this.detail.isShowPlayBtn = true
  637. },
  638. videoEnded(index){
  639. this.detail.isControls = false
  640. this.detail.isShowPlayBtn = true
  641. }
  642. }
  643. };
  644. </script>
  645. <style>
  646. @import './detail.css';
  647. </style>