index.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. <template>
  2. <view class="tab-conts" :data-theme="theme">
  3. <!-- 0-待审核,1-审核通过,2-审核失败,3-平台关闭 -->
  4. <view v-if="noteDetails.auditStatus == 0 || noteDetails.auditStatus == 2 || noteDetails.auditStatus == 3" class="approval_status">
  5. <view class="status_count" :class="noteDetails.auditStatus == 0 ? 'status1' : 'status0'">
  6. <view class="status_title">
  7. <text class="iconfont" :class="(noteDetails.auditStatus == 2 || noteDetails.auditStatus == 3) ? 'icon-tishi' : 'icon-shijian'"></text>
  8. <text v-if="noteDetails.auditStatus == 2" class="title">审核未通过,内容仅自己可见</text>
  9. <text v-if="noteDetails.auditStatus == 3" class="title">平台关闭,内容仅自己可见</text>
  10. <text v-if="noteDetails.auditStatus == 0" class="title">正在审核,内容仅自己可见</text>
  11. </view>
  12. <view v-if="noteDetails.auditStatus == 2 || noteDetails.auditStatus == 3" class="status_info">
  13. {{noteDetails.refusal}}
  14. </view>
  15. <view v-if="noteDetails.auditStatus == 0" class="status_info">
  16. 发布的内容审核通过后,将展示在首页!
  17. </view>
  18. </view>
  19. </view>
  20. <view class="follow_count" :class="(type=='list' || type =='follow' || !noteDetails.platReplySwitch)?'bodyNo':''">
  21. <view class="list_count">
  22. <view class="imageBox">
  23. <swiper v-if="noteDetails.type ===1 && noteDetails.image && noteDetails.image.split(',').length>1" :indicator-dots="indicatorDots"
  24. indicator-active-color="#e93323" :circular="circular" :interval="interval" :duration="duration" :style="{height:imageH + 'px'}">
  25. <block v-for="(item,index) in noteDetails.image.split(',')" :key='index'>
  26. <swiper-item class="cover">
  27. <!-- <image class="w-full" show-menu-by-longpress :src="item"
  28. :mode="isAuto ? 'aspectFill' : 'heightFix'" :style="{height:imageH + 'px'}"
  29. @tap="proview(item)"></image> -->
  30. <easy-loadimage mode="heightFix" :image-src="item" :style="{height:imageH + 'px'}"></easy-loadimage>
  31. </swiper-item>
  32. </block>
  33. </swiper>
  34. <view v-if="noteDetails.type ===2 || (noteDetails.type ===1 &&noteDetails.image && noteDetails.image.split(',').length===1)">
  35. <view class="cover" @click="goDetail(noteDetails)" :style="{height:imageH + 'px'}">
  36. <easy-loadimage mode="heightFix" :image-src="noteDetails.cover" :style="{height:imageH + 'px'}"></easy-loadimage>
  37. <view v-if="noteDetails.type ===2" class="circle">
  38. <text class="iconfont icon-24gf-play"></text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 查看TA提到的宝贝 -->
  44. <view class="pro_describle">
  45. <view class="product_info">
  46. <view class="noteTitle flex-between-center">
  47. <view>{{noteDetails.title}}</view>
  48. <view v-if="dazi && noteDetails.authorId !== uid && !noteDetails.userIsJoin" class="dazi-info" @tap="onJoin">加入</view>
  49. <view v-if="dazi && noteDetails.authorId !== uid && noteDetails.userIsJoin" class="dazi-info" @tap="onJoinColse">取消</view>
  50. </view>
  51. <view>
  52. <view class="text" v-if="noteDetails.isMore || (noteDetails.content && noteDetails.content.length<=70)">
  53. <text class="info">{{noteDetails.content}}</text>
  54. </view>
  55. <view class="text mt10" v-else>
  56. <text v-show="noteDetails.content" class="info">{{noteDetails.content && noteDetails.content.slice(0,70)}}...</text>
  57. <text class="more" v-if="noteDetails.content && noteDetails.content.length>70" @click.stop="moreTap(noteDetails,i)">
  58. 展开</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="topicList acea-row" v-if="noteDetails.topicList && noteDetails.topicList.length>0">
  63. <view style="line-height: 1.2;" @click="goTopic(item.id)" v-for="(item, j) in noteDetails.topicList" :key="j">
  64. <text class="icon">#</text><text class="text">{{item.name}}</text>
  65. </view>
  66. </view>
  67. <view v-if="type==='detail'" class="create_time">{{noteDetails.createTime}}</view>
  68. <scroll-view v-if="noteDetails.productList && noteDetails.productList.length" scroll-x="true" class="white-nowrap vertical-middle w-full mt-22 mb-12"
  69. show-scrollbar="false">
  70. <mentioned :list="noteDetails.productList" @close="popup" class=""></mentioned>
  71. </scroll-view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="footer_bar acea-row fixed release_bar_detail" style="bottom: 0;">
  76. <view class="acea-row items-center">
  77. <template v-if="!dazi">
  78. <view class="author mr-16" @click="goUser(noteDetails)">
  79. <image v-if="noteDetails.authorLevelIcon" class="level_icon" :src="noteDetails.authorLevelIcon" alt="">
  80. <image class="picture" :src="noteDetails.authorAvatar || urlDomain+'crmebimage/presets/morenT.png'">
  81. </image>
  82. <view class="name acea-row">
  83. <text>{{noteDetails.authorName}}</text>
  84. </view>
  85. </view>
  86. <!-- 1关注 -->
  87. <view v-if="noteDetails.authorId!==uid && type !=='follow'" @click.stop="followAuthor(noteDetails)">
  88. <view v-if="!noteDetails.isConcerned" class="author-follow flex-around-center font-color"><text class="iconfont icon-shangpinshuliang-jia"></text>
  89. <view class="line-heightOne">关注</view>
  90. </view>
  91. <view v-else class="author-focused flex-around-center">
  92. <view class="line-heightOne">已关注</view>
  93. </view>
  94. </view>
  95. </template>
  96. <!-- 管理 -->
  97. <view class="manageCount" v-if="noteDetails.authorId==uid && type==='detail'">
  98. <view class="follow_btn author-focused flex-around-center" @click.stop="handleManage">
  99. <view class="line-heightOne">管理</view>
  100. </view>
  101. </view>
  102. </view>
  103. <!-- 末尾处分享、关注、评论 -->
  104. <view class="foot_bar">
  105. <view class="item">
  106. <view class="item_count" @click.stop="likeToggle(noteDetails)" v-if="!dazi">
  107. <text class="iconfont" :class="noteDetails.userIsLike ? 'icon-shoucang1' : 'icon-dianzan'"></text>
  108. <text>{{noteDetails.likeNum > 0 ? noteDetails.likeNum < 10000 ? noteDetails.likeNum : (noteDetails.likeNum / 10000).toFixed(2) : '点赞'}}</text>
  109. </view>
  110. <!-- -->
  111. <view v-if="noteDetails.platReplySwitch" class="item_count" @click="openCommon(noteDetails)">
  112. <text class="iconfont icon-pinglun"></text>
  113. <text>{{noteDetails.replyNum > 0 ? noteDetails.replyNum : '评论'}}</text>
  114. </view>
  115. </view>
  116. <!-- #ifdef MP -->
  117. <button v-if="noteDetails.auditStatus == 1" class="time iconfont icon-fenxiang ml-20" open-type="share" hover-class='none'
  118. :data-id="noteDetails.id" :data-cover="noteDetails.cover" :data-uid="uid" :data-title="noteDetails.title" @click="shareFriend(noteDetails)"></button>
  119. <!-- #endif -->
  120. <!-- #ifdef APP -->
  121. <button v-if="noteDetails.auditStatus == 1" @click="appShare('WXSceneSession',noteDetails)" class="time iconfont icon-fenxiang ml-20"
  122. hover-class='none'></button>
  123. <!-- #endif -->
  124. <!-- #ifdef H5 -->
  125. <button v-if="noteDetails.auditStatus == 1 && isWeixin" @click="appShare('WXSceneSession',noteDetails)" class="time iconfont icon-fenxiang ml-20"
  126. hover-class='none'></button>
  127. <button></button>
  128. <!-- #endif -->
  129. </view>
  130. </view>
  131. <!-- 分享按钮 -->
  132. <image v-if="H5ShareBox" class="shareImg" :src="urlDomain+'crmebimage/presets/share-info.png'" @click="H5ShareBox = false">
  133. </image>
  134. <!-- 商品列表 -->
  135. <uni-popup type="bottom" ref="goods">
  136. <mentioned v-if="popupShow" :list="proList" @close="popup" class=""></mentioned>
  137. </uni-popup>
  138. <!-- 评论弹窗 -->
  139. <uni-popup type="bottom" ref="comment">
  140. <view :style="'width: 100%; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
  141. <discoverComment v-if="showComment" @getReplyNum="getReplyNum" :noteId="noteDetails.id" fromTo="popupView"
  142. :noteDetails="noteDetails" @close="close" :isShowCommentView="isShowCommentView">
  143. </discoverComment>
  144. </view>
  145. </uni-popup>
  146. <!-- 管理弹窗 -->
  147. <uni-popup type="bottom" ref="manageRef">
  148. <view class="manage">
  149. <popup-header title="内容管理" @close="closeManage"></popup-header>
  150. <navigator hover-class="none" :url="'/pages/discover/discover_release/index?noteId='+noteDetails.id + '&dazi=' + dazi"
  151. class="items">
  152. <text>编辑</text>
  153. </navigator>
  154. <view class="items" @click.stop="deleteTopic(noteDetails)">
  155. <text>删除</text>
  156. </view>
  157. <view v-if="!dazi" disabled="true" class="items" @click.stop="replySwitch(noteDetails)">
  158. <text>{{noteDetails.replyStatus ==1 ? '禁止评论' : '开启评论'}}</text>
  159. </view>
  160. </view>
  161. </uni-popup>
  162. <!-- 加入 -->
  163. <uni-popup ref="joinDialog" type="dialog">
  164. <view class="tui-modal-custom">
  165. <view class="fs-32 fw-500 lh-44rpx text-center">加入群聊</view>
  166. <view class="mt-24 bg--w111-f5f5f5 rd-16rpx p-24">
  167. <image :src="noteDetails.qrCode" mode="widthFix" class="h-604 w-full" @longpress="onLongPress"></image>
  168. </view>
  169. </view>
  170. </uni-popup>
  171. <!-- 扫一扫 -->
  172. <uni-popup type="bottom" ref="codeRef">
  173. <view class="manage">
  174. <view class="items" @click="onSavePicture">
  175. <text>保存图片</text>
  176. </view>
  177. <view class="items" @click="onScan">
  178. <text>扫一扫</text>
  179. </view>
  180. <view class="items" @click.stop="onScanCancel">
  181. <text>取消</text>
  182. </view>
  183. </view>
  184. </uni-popup>
  185. </view>
  186. </template>
  187. <script>
  188. import discoverComment from '@/components/discoverComment/index.vue';
  189. import {
  190. mapGetters
  191. } from "vuex";
  192. import {
  193. toLogin
  194. } from '@/libs/login.js';
  195. import {
  196. discoverNoteLike
  197. } from '@/libs/follow.js';
  198. import {
  199. noteDelApi,
  200. noteReplySwitchApi
  201. } from '@/api/discover.js';
  202. import {
  203. noteGameApi,
  204. myGameJoinIdApi
  205. } from '@/api/gameDazi.js';
  206. import {
  207. discoverFollowAuthor
  208. } from '@/libs/follow.js';
  209. import {
  210. Debounce
  211. } from '@/utils/validate.js'
  212. import mentioned from '@/components/mentioned.vue';
  213. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  214. import popupHeader from '@/components/popupHeader.vue'
  215. import animationType from '@/utils/animationType.js'
  216. import {
  217. HTTP_H5_URL
  218. } from '@/config/app.js';
  219. let app = getApp();
  220. export default {
  221. computed: mapGetters(['globalData', 'isLogin', 'userInfo', 'uid', 'bottomNavigationIsCustom']),
  222. components: {
  223. discoverComment,
  224. easyLoadimage,
  225. mentioned,
  226. popupHeader
  227. },
  228. data() {
  229. return {
  230. urlDomain: this.$Cache.get("imgHost"),
  231. H5ShareBox: false,
  232. isMore: false,
  233. theme: app.globalData.theme,
  234. popupShow: false, //商品弹窗
  235. showManage: false, //管理展示
  236. indicatorDots: true,
  237. circular: true,
  238. autoplay: true,
  239. interval: 5000,
  240. duration: 500,
  241. currents: "1",
  242. controls: true,
  243. isPlay: true,
  244. videoContext: '',
  245. proList: [], //商品列表
  246. showComment: false, //评论弹窗
  247. imageList: [], //轮播图
  248. isPay: false, //是否买过。true买过
  249. isWeixin: false, //是否是微信
  250. noteIndex: 0, //当前的索引
  251. noteDetails: this.noteRecommendList,
  252. windowWidth: 0, //获取屏幕宽度🌟💗
  253. heightH: 0,
  254. qrCode: ''
  255. }
  256. },
  257. props: {
  258. /* 内容详情 */
  259. noteRecommendList: {
  260. type: Object,
  261. default: function() {
  262. return {};
  263. },
  264. },
  265. /* 跳入组件类型,关注 follow 推荐页list,详情detail */
  266. type: {
  267. type: String,
  268. default: function() {
  269. return '';
  270. },
  271. },
  272. imageH: {
  273. type: Number,
  274. default: function() {
  275. return 0;
  276. },
  277. },
  278. // 评论列表是否出现在详情视图内,出现就展示弹窗
  279. isShowCommentView: {
  280. type: Boolean,
  281. default: function() {
  282. return false;
  283. },
  284. },
  285. dazi: {
  286. type: String,
  287. default: function() {
  288. return '';
  289. },
  290. }
  291. },
  292. watch: {
  293. noteRecommendList: {
  294. immediate: true,
  295. deep: true,
  296. handler(nVal, oVal) {
  297. this.noteDetails = nVal
  298. if (this.noteDetails.productList && this.noteDetails.productList.length !== 0) {
  299. this.noteDetails.isPay = this.noteDetails.productList.some(function(items) {
  300. if (items.isPay == 1) {
  301. return true;
  302. }
  303. })
  304. }
  305. }
  306. }
  307. },
  308. onLoad() {
  309. this.windowWidth = uni.getSystemInfoSync().screenWidth; //获取屏幕宽度
  310. this.isWeixin = this.$wechat.isWeixin()
  311. },
  312. // 滚动监听
  313. onPageScroll(e) {
  314. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  315. uni.$emit('scroll');
  316. },
  317. methods: {
  318. //关闭操作管理
  319. closeManage() {
  320. this.$refs.manageRef.close();
  321. },
  322. //操作管理
  323. handleManage() {
  324. this.$refs.manageRef.open('bottom');
  325. },
  326. appShare(scene, noteDetails) {
  327. let that = this
  328. let data = noteDetails;
  329. // #ifdef APP-PLUS
  330. uni.showLoading({
  331. title: '加载中',
  332. mask: true
  333. });
  334. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  335. let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
  336. uni.share({
  337. provider: "weixin",
  338. scene: scene,
  339. type: 0,
  340. href: `${HTTP_H5_URL}${curRoute}&sd=${that.uid}&id=${data.id}`,
  341. title: data.title || '',
  342. summary: data.content || '',
  343. imageUrl: data.cover || '',
  344. success: function(res) {
  345. uni.showToast({
  346. title: '分享成功',
  347. icon: 'success'
  348. })
  349. uni.hideLoading();
  350. },
  351. fail: function(err) {
  352. uni.hideLoading();
  353. uni.showToast({
  354. title: '分享失败',
  355. icon: 'none',
  356. duration: 2000
  357. })
  358. },
  359. });
  360. uni.hideLoading();
  361. // #endif
  362. // #ifdef H5
  363. if (that.$wechat.isWeixin()) {
  364. uni.showLoading({
  365. title: '加载中',
  366. mask: true
  367. });
  368. let configAppMessage = {
  369. desc: data.content || '',
  370. title: data.title || '',
  371. link: `/pages/goods/goods_details/index?id=${that.noteDetails.id}&mt=0&sd=${that.uid}`,
  372. imgUrl: data.cover || ''
  373. };
  374. uni.hideLoading();
  375. that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
  376. configAppMessage);
  377. } else {
  378. this.H5ShareBox = true;
  379. }
  380. // #endif
  381. },
  382. //分享信息
  383. shareFriend(item) {
  384. this.noteDetails = item
  385. },
  386. //修改完评论之后的数量
  387. getReplyNum(n) {
  388. //this.noteRecommendListNew[this.noteIndex].replyNum = n;
  389. },
  390. // 关注作者
  391. followAuthor: Debounce(function(noteDetails) {
  392. if (this.isLogin) {
  393. discoverFollowAuthor(noteDetails.authorId).then(() => {
  394. this.$set(noteDetails, 'isConcerned', !noteDetails.isConcerned);
  395. });
  396. } else {
  397. toLogin();
  398. }
  399. }),
  400. moreTap(noteDetails, i) {
  401. this.$set(noteDetails, 'isMore', true);
  402. },
  403. popup() {
  404. this.$refs.goods.close();
  405. this.popupShow = false;
  406. },
  407. /*查看提到的宝贝*/
  408. openMore(item) {
  409. //此处为了处理小程序的兼容性,在父组件中去调取子组件的内容
  410. if (this.type === 'follow') {
  411. this.$emit('getPro', item);
  412. } else {
  413. this.proList = item.productList;
  414. this.$refs.goods.open('bottom');
  415. this.popupShow = true;
  416. }
  417. },
  418. //禁止评论
  419. replySwitch(noteDetails) {
  420. if (!noteDetails.platReplySwitch && noteDetails.replyStatus === 3) {
  421. this.$util.Tips({
  422. title: '平台设置不可评论'
  423. });
  424. } else {
  425. noteReplySwitchApi(noteDetails.id).then(res => {
  426. this.$emit('onChangeReplyStatus', noteDetails.replyStatus)
  427. }).catch(err => {
  428. uni.showToast({
  429. title: err,
  430. icon: 'none'
  431. })
  432. });
  433. }
  434. },
  435. // 去个人主人
  436. goUser(noteDetails) {
  437. // #ifdef MP || H5
  438. uni.navigateTo({
  439. url: `/pages/discover/discover_user/index?id=${noteDetails.authorId}`
  440. })
  441. // #endif
  442. // #ifdef APP-PLUS
  443. uni.navigateTo({
  444. animationType: animationType.type,
  445. animationDuration: animationType.duration,
  446. url: `/pages/discover/discover_user/index?id=${noteDetails.authorId}`
  447. })
  448. // #endif
  449. },
  450. // 删除内容
  451. deleteTopic(noteDetails) {
  452. let that = this;
  453. uni.showModal({
  454. content: '确定要删除该内容么?',
  455. success: function(res) {
  456. if (res.confirm) {
  457. let api = that.dazi ? noteGameApi : noteDelApi;
  458. api(noteDetails.id).then(res => {
  459. that.$util.Tips({
  460. title: '删除成功'
  461. });
  462. setTimeout(function() {
  463. let url = that.dazi ? '/pages/discover/discover_user/index?dazi=dazi' : '/pages/discover/discover_user/index';
  464. uni.redirectTo({
  465. url: url
  466. })
  467. }, 1000);
  468. }).catch(err => {
  469. uni.showToast({
  470. title: err,
  471. icon: 'none'
  472. })
  473. });
  474. } else if (res.cancel) {
  475. console.log('用户点击取消');
  476. }
  477. }
  478. });
  479. },
  480. //点赞
  481. likeToggle: Debounce(function(item) {
  482. if (this.isLogin) {
  483. discoverNoteLike(item.id).then(() => {
  484. this.$set(item, 'userIsLike', !item.userIsLike);
  485. if (!item.userIsLike) {
  486. item.likeNum--;
  487. item.likeNum = item.likeNum == 0 ? 0 : item.likeNum
  488. } else {
  489. item.likeNum++;
  490. }
  491. });
  492. } else {
  493. toLogin();
  494. }
  495. }),
  496. close() {
  497. this.$refs.comment.close('bottom');
  498. this.showComment = false;
  499. },
  500. //打开评论弹窗
  501. openCommon(item) {
  502. if (!this.isLogin) {
  503. toLogin();
  504. } else {
  505. //如果评论列表展示在视图中,就展示评论输入框
  506. //如果没在试图中,就展示评论弹窗
  507. if (this.isShowCommentView) {
  508. this.$emit('getComment', item);
  509. } else {
  510. uni.hideTabBar();
  511. this.$refs.comment.open('bottom');
  512. this.showComment = true
  513. }
  514. }
  515. },
  516. goTopic(id) {
  517. // #ifdef MP || H5
  518. uni.navigateTo({
  519. url: `/pages/discover/discover_note_topic/index?topicId=${id}`
  520. })
  521. // #endif
  522. // #ifdef APP-PLUS
  523. uni.navigateTo({
  524. animationType: animationType.type,
  525. animationDuration: animationType.duration,
  526. url: `/pages/discover/discover_note_topic/index?topicId=${id}`
  527. })
  528. // #endif
  529. },
  530. goDetail(noteDetails) {
  531. if (noteDetails.type === 2) {
  532. uni.navigateTo({
  533. //#ifdef APP
  534. url: '/pages/discover/discover_video/appVideo/index?noteId=' + noteDetails.id + `&sd=${this.uid}`,
  535. //#endif
  536. //#ifndef APP
  537. url: '/pages/discover/discover_video/routineVideo/index?noteId=' + noteDetails.id + `&sd=${this.uid}`,
  538. //#endif
  539. });
  540. }
  541. },
  542. onJoin() {
  543. this.$refs.joinDialog.open()
  544. },
  545. onJoinColse() {
  546. myGameJoinIdApi(this.noteDetails.id).then(res => {
  547. that.$util.Tips({
  548. title: '取消成功'
  549. });
  550. }).catch(err => {
  551. uni.showToast({
  552. title: err,
  553. icon: 'none'
  554. })
  555. });
  556. },
  557. handleInputClose() {
  558. this.$refs.joinDialog.close()
  559. },
  560. onLongPress(e) {
  561. this.$refs.codeRef.open('bottom')
  562. },
  563. onScan() {
  564. // 只允许通过相机扫码
  565. uni.scanCode({
  566. onlyFromCamera: false,
  567. scanType: 'qrCode',
  568. success: function(res) {
  569. console.log('条码类型:' + res.scanType);
  570. console.log('条码内容:' + res.result);
  571. let that = this;
  572. setTimeout(function() {
  573. uni.navigateTo({
  574. url: res.result
  575. });
  576. }, 1000);
  577. myGameJoinIdApi(that.noteDetails.id).then(res => {
  578. that.$util.Tips({
  579. title: '加入成功'
  580. });
  581. }).catch(err => {
  582. uni.showToast({
  583. title: err,
  584. icon: 'none'
  585. })
  586. });
  587. }
  588. });
  589. },
  590. onSavePicture() {
  591. // 保存到相册
  592. // imageUrl是你要保存的图片地址
  593. const imageUrl = this.noteDetails.qrCode;
  594. // 向用户请求保存图片到相册的权限
  595. uni.authorize({
  596. scope: 'scope.writePhotosAlbum',
  597. success() {
  598. // 用户已授权,可以下载并保存图片
  599. uni.downloadFile({
  600. url: imageUrl,
  601. success: (downloadRes) => {
  602. if (downloadRes.statusCode === 200) {
  603. // 下载成功,保存图片到相册
  604. uni.saveImageToPhotosAlbum({
  605. filePath: downloadRes.tempFilePath,
  606. success(res) {
  607. // 图片保存成功,弹出提示框
  608. uni.showToast({
  609. title: '保存成功',
  610. icon: 'success'
  611. });
  612. },
  613. fail(err) {
  614. console.error('图片保存失败', err);
  615. // 图片保存失败,弹出提示框
  616. uni.showToast({
  617. title: '保存失败',
  618. icon: 'none'
  619. });
  620. }
  621. });
  622. } else {
  623. console.error('下载失败', downloadRes);
  624. // 下载失败,弹出提示框
  625. uni.showToast({
  626. title: '下载失败',
  627. icon: 'none'
  628. });
  629. }
  630. },
  631. fail(err) {
  632. console.error('下载失败', err);
  633. // 下载失败,弹出提示框
  634. uni.showToast({
  635. title: '下载失败',
  636. icon: 'none'
  637. });
  638. }
  639. });
  640. },
  641. fail() {
  642. console.log('用户未授权');
  643. // 用户未授权,弹出提示框
  644. uni.showToast({
  645. title: '需要授权才能保存图片',
  646. icon: 'none'
  647. });
  648. }
  649. });
  650. },
  651. onScanCancel() {
  652. this.$refs.codeRef.close()
  653. }
  654. }
  655. }
  656. </script>
  657. <style lang="scss" scoped>
  658. .author-follow {
  659. background: none !important;
  660. @include coupons_border_color(theme);
  661. }
  662. .footer_bar {
  663. background-color: #fff;
  664. flex-shrink: 0;
  665. width: 100%;
  666. position: fixed; // input 所在盒子设置绝对定位
  667. left: 0;
  668. z-index: 9;
  669. display: flex;
  670. bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  671. bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  672. align-items: center;
  673. justify-content: space-between;
  674. padding: 0 24rpx;
  675. border-top: 1px solid #F5F5F5;
  676. }
  677. .release_bar_detail {
  678. height: calc(90rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  679. height: calc(90rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  680. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  681. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  682. background-color: #fff;
  683. }
  684. .author {
  685. display: flex;
  686. align-items: center;
  687. position: relative;
  688. .level_icon {
  689. position: absolute;
  690. width: 20rpx;
  691. height: 20rpx;
  692. margin: 4rpx 0 0 -4rpx;
  693. border: none;
  694. z-index: 1;
  695. bottom: 2rpx;
  696. left: 50rpx;
  697. }
  698. .picture,
  699. uni-image {
  700. width: 60rpx;
  701. height: 60rpx;
  702. border-radius: 100%;
  703. }
  704. .name {
  705. margin-left: 20rpx;
  706. color: #282828;
  707. font-size: 32rpx;
  708. font-weight: bold;
  709. align-items: center;
  710. }
  711. }
  712. /deep/.uni-swiper-dots-horizontal {
  713. bottom: 40rpx !important;
  714. }
  715. .shareImg {
  716. z-index: 1000;
  717. position: fixed;
  718. left: 0;
  719. top: 0;
  720. width: 100%;
  721. height: 100%;
  722. }
  723. .isPay {
  724. padding: 3rpx 5rpx;
  725. @include main_color(theme);
  726. @include coupons_border_color(theme);
  727. font-size: 20rpx;
  728. border-radius: 3px 3px 3px 3px;
  729. }
  730. .more {
  731. font-weight: 600;
  732. margin-left: 6rpx;
  733. }
  734. .ml24 {
  735. margin-left: 24rpx;
  736. }
  737. .follow_btn {
  738. color: #282828 !important;
  739. border: 1px solid #282828 !important;
  740. }
  741. .approval_status {
  742. padding: 24rpx 24rpx 0 24rpx;
  743. .status_count {
  744. padding: 26rpx 30rpx 20rpx;
  745. border-radius: 10rpx;
  746. .title {
  747. margin-left: 10rpx;
  748. font-size: 28rpx;
  749. font-weight: bold;
  750. }
  751. &.status0 {
  752. background: #FDF3F2;
  753. .title {
  754. color: #E93323;
  755. }
  756. }
  757. &.status1 {
  758. background: #FFF4EB;
  759. .title {
  760. color: #FC8327;
  761. }
  762. }
  763. .iconfont {
  764. font-size: 30rpx;
  765. }
  766. .icon-shijian {
  767. color: #FC8327;
  768. }
  769. .icon-tishi {
  770. color: #E93323;
  771. }
  772. .status_info {
  773. font-size: 22rpx;
  774. color: #666666;
  775. margin: 10rpx 0 0 36rpx;
  776. }
  777. }
  778. }
  779. .createTime {
  780. font-size: 24rpx;
  781. font-family: PingFang SC-Regular, PingFang SC;
  782. font-weight: 400;
  783. color: #999999;
  784. }
  785. .tab-conts {
  786. // /deep/.container {
  787. // padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  788. // padding-bottom: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  789. // }
  790. }
  791. .bodyNo {
  792. border: none !important;
  793. }
  794. .foot_bar {
  795. display: flex;
  796. align-items: center;
  797. justify-content: space-between;
  798. .item {
  799. display: flex;
  800. align-items: center;
  801. color: #282828;
  802. &.icon-fenxiang {
  803. font-size: 46rpx;
  804. }
  805. }
  806. .item_count {
  807. font-size: 26rpx;
  808. display: flex;
  809. align-items: center;
  810. margin-left: 30rpx;
  811. &:first-child {
  812. margin-left: 0;
  813. }
  814. .iconfont {
  815. font-size: 40rpx;
  816. margin-right: 5rpx;
  817. }
  818. .icon-shoucang1 {
  819. @include main_color(theme);
  820. }
  821. }
  822. }
  823. .create_time {
  824. color: #909399;
  825. font-size: 22rpx;
  826. margin-top: 28rpx;
  827. }
  828. .pro_describle {
  829. overflow-x: hidden;
  830. .product_info {
  831. // line-height: 45rpx;
  832. margin-top: 30rpx;
  833. .noteTitle {
  834. font-size: 30rpx;
  835. font-family: PingFang SC-Medium, PingFang SC;
  836. font-weight: 700;
  837. color: #282828;
  838. margin-bottom: 14rpx;
  839. }
  840. .text {
  841. font-size: 28rpx;
  842. color: #282828;
  843. text-align: justify;
  844. text-justify: newspaper;
  845. word-break: break-all;
  846. }
  847. .unfold_btn {
  848. margin-left: 30rpx;
  849. font-size: 30rpx;
  850. color: #282828;
  851. font-weight: bold;
  852. }
  853. }
  854. .topicList {
  855. margin-right: -20rpx;
  856. >view {
  857. display: flex;
  858. align-items: center;
  859. border-radius: 30rpx;
  860. margin-right: 20rpx;
  861. // line-height: 62rpx;
  862. // height: 62rpx;
  863. @include main_color(theme);
  864. .text {
  865. font-size: 28rpx;
  866. }
  867. .icon {
  868. font-size: 35rpx;
  869. }
  870. }
  871. }
  872. }
  873. .imageBox {
  874. width: 702rpx;
  875. // height: 702rpx;
  876. position: relative;
  877. swiper {
  878. width: 100%;
  879. height: 100%;
  880. position: relative;
  881. }
  882. .cover {
  883. width: 702rpx;
  884. position: relative;
  885. border-radius: 10px 10px 10px 10px;
  886. /deep/image,
  887. /deep/.easy-loadimage,
  888. uni-image {
  889. width: 702rpx;
  890. border-radius: 10px 10px 10px 10px;
  891. overflow: hidden;
  892. }
  893. .circle {
  894. width: 100rpx;
  895. height: 100rpx;
  896. border-radius: 50%;
  897. background: rgba(0, 0, 0, .5);
  898. position: absolute;
  899. top: 50%;
  900. left: 50%;
  901. margin-left: -50rpx;
  902. margin-top: -50rpx;
  903. z-index: 10;
  904. line-height: 50px;
  905. text-align: center;
  906. color: #fff;
  907. }
  908. }
  909. .slide-image {
  910. width: 100%;
  911. height: 100%;
  912. border-radius: 16rpx;
  913. }
  914. .pages {
  915. position: absolute;
  916. background-color: #fff;
  917. height: 34rpx;
  918. padding: 0 10rpx;
  919. border-radius: 3rpx;
  920. right: 30rpx;
  921. bottom: 30rpx;
  922. line-height: 34rpx;
  923. font-size: 24rpx;
  924. color: #050505;
  925. }
  926. }
  927. .tab-cont {
  928. background: #fff;
  929. }
  930. .follow_count {
  931. padding: 30rpx 24rpx 20rpx 24rpx;
  932. border-bottom: 1px solid #F5F5F5;
  933. .title {
  934. padding: 0 10rpx;
  935. display: flex;
  936. align-items: center;
  937. justify-content: space-between;
  938. }
  939. .author {
  940. display: flex;
  941. align-items: center;
  942. position: relative;
  943. .level_icon {
  944. position: absolute;
  945. width: 26rpx;
  946. height: 26rpx;
  947. margin: 4rpx 0 0 6rpx;
  948. border: none;
  949. z-index: 1;
  950. bottom: 2rpx;
  951. left: 50rpx;
  952. }
  953. .picture,
  954. uni-image {
  955. width: 78rpx;
  956. height: 78rpx;
  957. border-radius: 100%;
  958. }
  959. .name {
  960. margin-left: 20rpx;
  961. color: #282828;
  962. font-size: 32rpx;
  963. font-weight: bold;
  964. align-items: center;
  965. }
  966. }
  967. .icon-fenxiang {
  968. font-size: 40rpx !important;
  969. }
  970. .time {
  971. color: #282828;
  972. font-size: 46rpx;
  973. }
  974. .product {
  975. margin-top: 20rpx;
  976. border-radius: 16rpx;
  977. }
  978. }
  979. .manage {
  980. width: 100%;
  981. background: #ffffff;
  982. box-shadow: 0 2rpx 15rpx rgba(0, 0, 0, 0.1);
  983. padding: 30rpx 24rpx;
  984. z-index: 10;
  985. border-radius: 40rpx 40rpx 0 0;
  986. .items {
  987. // border-bottom: 1px solid #EEEEEE;
  988. color: #333333;
  989. font-size: 28rpx;
  990. display: flex;
  991. justify-content: center;
  992. margin-bottom: 64rpx;
  993. &:last-child {
  994. border-bottom: none;
  995. }
  996. .iconfont {
  997. margin: 0 16rpx 0;
  998. }
  999. }
  1000. }
  1001. .dazi-info {
  1002. font-weight: 500;
  1003. font-size: 23rpx;
  1004. color: #FFFFFF;
  1005. background: #FF6600;
  1006. padding: 6rpx 25rpx;
  1007. border-radius: 8rpx;
  1008. }
  1009. .tui-modal-custom {
  1010. width: 600rpx;
  1011. position: relative;
  1012. box-sizing: border-box;
  1013. padding: 40rpx;
  1014. border-radius: 16px;
  1015. background-color: #fff;
  1016. z-index: 9999;
  1017. .h-342 {
  1018. min-height: 268rpx;
  1019. max-height: 268rpx;
  1020. overflow-y: scroll;
  1021. }
  1022. }
  1023. </style>