index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  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. let that = this;
  565. // 只允许通过相机扫码
  566. uni.scanCode({
  567. onlyFromCamera: false,
  568. scanType: 'qrCode',
  569. success: function(res) {
  570. console.log('条码类型:' + res.scanType);
  571. console.log('条码内容:' + res.result);
  572. setTimeout(function() {
  573. uni.navigateTo({
  574. url: `/pages/game_dazi/code_content/index?link=${encodeURIComponent(res.result)}`
  575. });
  576. }, 1000);
  577. myGameJoinIdApi(that.noteDetails.id).then(res => {
  578. that.$util.Tips({
  579. title: '加入成功'
  580. });
  581. that.$refs.joinDialog.close();
  582. that.$refs.codeRef.close();
  583. }).catch(err => {
  584. uni.showToast({
  585. title: err,
  586. icon: 'none'
  587. })
  588. });
  589. }
  590. });
  591. },
  592. onSavePicture() {
  593. // 保存到相册
  594. // imageUrl是你要保存的图片地址
  595. const imageUrl = this.noteDetails.qrCode;
  596. // 向用户请求保存图片到相册的权限
  597. uni.authorize({
  598. scope: 'scope.writePhotosAlbum',
  599. success() {
  600. // 用户已授权,可以下载并保存图片
  601. uni.downloadFile({
  602. url: imageUrl,
  603. success: (downloadRes) => {
  604. if (downloadRes.statusCode === 200) {
  605. // 下载成功,保存图片到相册
  606. uni.saveImageToPhotosAlbum({
  607. filePath: downloadRes.tempFilePath,
  608. success(res) {
  609. // 图片保存成功,弹出提示框
  610. uni.showToast({
  611. title: '保存成功',
  612. icon: 'success'
  613. });
  614. },
  615. fail(err) {
  616. console.error('图片保存失败', err);
  617. // 图片保存失败,弹出提示框
  618. uni.showToast({
  619. title: '保存失败',
  620. icon: 'none'
  621. });
  622. }
  623. });
  624. } else {
  625. console.error('下载失败', downloadRes);
  626. // 下载失败,弹出提示框
  627. uni.showToast({
  628. title: '下载失败',
  629. icon: 'none'
  630. });
  631. }
  632. },
  633. fail(err) {
  634. console.error('下载失败', err);
  635. // 下载失败,弹出提示框
  636. uni.showToast({
  637. title: '下载失败',
  638. icon: 'none'
  639. });
  640. }
  641. });
  642. },
  643. fail() {
  644. console.log('用户未授权');
  645. // 用户未授权,弹出提示框
  646. uni.showToast({
  647. title: '需要授权才能保存图片',
  648. icon: 'none'
  649. });
  650. }
  651. });
  652. },
  653. onScanCancel() {
  654. this.$refs.codeRef.close()
  655. }
  656. }
  657. }
  658. </script>
  659. <style lang="scss" scoped>
  660. .author-follow {
  661. background: none !important;
  662. @include coupons_border_color(theme);
  663. }
  664. .footer_bar {
  665. background-color: #fff;
  666. flex-shrink: 0;
  667. width: 100%;
  668. position: fixed; // input 所在盒子设置绝对定位
  669. left: 0;
  670. z-index: 9;
  671. display: flex;
  672. bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  673. bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  674. align-items: center;
  675. justify-content: space-between;
  676. padding: 0 24rpx;
  677. border-top: 1px solid #F5F5F5;
  678. }
  679. .release_bar_detail {
  680. height: calc(90rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  681. height: calc(90rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  682. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  683. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  684. background-color: #fff;
  685. }
  686. .author {
  687. display: flex;
  688. align-items: center;
  689. position: relative;
  690. .level_icon {
  691. position: absolute;
  692. width: 20rpx;
  693. height: 20rpx;
  694. margin: 4rpx 0 0 -4rpx;
  695. border: none;
  696. z-index: 1;
  697. bottom: 2rpx;
  698. left: 50rpx;
  699. }
  700. .picture,
  701. uni-image {
  702. width: 60rpx;
  703. height: 60rpx;
  704. border-radius: 100%;
  705. }
  706. .name {
  707. margin-left: 20rpx;
  708. color: #282828;
  709. font-size: 32rpx;
  710. font-weight: bold;
  711. align-items: center;
  712. }
  713. }
  714. /deep/.uni-swiper-dots-horizontal {
  715. bottom: 40rpx !important;
  716. }
  717. .shareImg {
  718. z-index: 1000;
  719. position: fixed;
  720. left: 0;
  721. top: 0;
  722. width: 100%;
  723. height: 100%;
  724. }
  725. .isPay {
  726. padding: 3rpx 5rpx;
  727. @include main_color(theme);
  728. @include coupons_border_color(theme);
  729. font-size: 20rpx;
  730. border-radius: 3px 3px 3px 3px;
  731. }
  732. .more {
  733. font-weight: 600;
  734. margin-left: 6rpx;
  735. }
  736. .ml24 {
  737. margin-left: 24rpx;
  738. }
  739. .follow_btn {
  740. color: #282828 !important;
  741. border: 1px solid #282828 !important;
  742. }
  743. .approval_status {
  744. padding: 24rpx 24rpx 0 24rpx;
  745. .status_count {
  746. padding: 26rpx 30rpx 20rpx;
  747. border-radius: 10rpx;
  748. .title {
  749. margin-left: 10rpx;
  750. font-size: 28rpx;
  751. font-weight: bold;
  752. }
  753. &.status0 {
  754. background: #FDF3F2;
  755. .title {
  756. color: #E93323;
  757. }
  758. }
  759. &.status1 {
  760. background: #FFF4EB;
  761. .title {
  762. color: #FC8327;
  763. }
  764. }
  765. .iconfont {
  766. font-size: 30rpx;
  767. }
  768. .icon-shijian {
  769. color: #FC8327;
  770. }
  771. .icon-tishi {
  772. color: #E93323;
  773. }
  774. .status_info {
  775. font-size: 22rpx;
  776. color: #666666;
  777. margin: 10rpx 0 0 36rpx;
  778. }
  779. }
  780. }
  781. .createTime {
  782. font-size: 24rpx;
  783. font-family: PingFang SC-Regular, PingFang SC;
  784. font-weight: 400;
  785. color: #999999;
  786. }
  787. .tab-conts {
  788. // /deep/.container {
  789. // padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  790. // padding-bottom: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  791. // }
  792. }
  793. .bodyNo {
  794. border: none !important;
  795. }
  796. .foot_bar {
  797. display: flex;
  798. align-items: center;
  799. justify-content: space-between;
  800. .item {
  801. display: flex;
  802. align-items: center;
  803. color: #282828;
  804. &.icon-fenxiang {
  805. font-size: 46rpx;
  806. }
  807. }
  808. .item_count {
  809. font-size: 26rpx;
  810. display: flex;
  811. align-items: center;
  812. margin-left: 30rpx;
  813. &:first-child {
  814. margin-left: 0;
  815. }
  816. .iconfont {
  817. font-size: 40rpx;
  818. margin-right: 5rpx;
  819. }
  820. .icon-shoucang1 {
  821. @include main_color(theme);
  822. }
  823. }
  824. }
  825. .create_time {
  826. color: #909399;
  827. font-size: 22rpx;
  828. margin-top: 28rpx;
  829. }
  830. .pro_describle {
  831. overflow-x: hidden;
  832. .product_info {
  833. // line-height: 45rpx;
  834. margin-top: 30rpx;
  835. .noteTitle {
  836. font-size: 30rpx;
  837. font-family: PingFang SC-Medium, PingFang SC;
  838. font-weight: 700;
  839. color: #282828;
  840. margin-bottom: 14rpx;
  841. }
  842. .text {
  843. font-size: 28rpx;
  844. color: #282828;
  845. text-align: justify;
  846. text-justify: newspaper;
  847. word-break: break-all;
  848. }
  849. .unfold_btn {
  850. margin-left: 30rpx;
  851. font-size: 30rpx;
  852. color: #282828;
  853. font-weight: bold;
  854. }
  855. }
  856. .topicList {
  857. margin-right: -20rpx;
  858. >view {
  859. display: flex;
  860. align-items: center;
  861. border-radius: 30rpx;
  862. margin-right: 20rpx;
  863. // line-height: 62rpx;
  864. // height: 62rpx;
  865. @include main_color(theme);
  866. .text {
  867. font-size: 28rpx;
  868. }
  869. .icon {
  870. font-size: 35rpx;
  871. }
  872. }
  873. }
  874. }
  875. .imageBox {
  876. width: 702rpx;
  877. // height: 702rpx;
  878. position: relative;
  879. swiper {
  880. width: 100%;
  881. height: 100%;
  882. position: relative;
  883. }
  884. .cover {
  885. width: 702rpx;
  886. position: relative;
  887. border-radius: 10px 10px 10px 10px;
  888. /deep/image,
  889. /deep/.easy-loadimage,
  890. uni-image {
  891. width: 702rpx;
  892. border-radius: 10px 10px 10px 10px;
  893. overflow: hidden;
  894. }
  895. .circle {
  896. width: 100rpx;
  897. height: 100rpx;
  898. border-radius: 50%;
  899. background: rgba(0, 0, 0, .5);
  900. position: absolute;
  901. top: 50%;
  902. left: 50%;
  903. margin-left: -50rpx;
  904. margin-top: -50rpx;
  905. z-index: 10;
  906. line-height: 50px;
  907. text-align: center;
  908. color: #fff;
  909. }
  910. }
  911. .slide-image {
  912. width: 100%;
  913. height: 100%;
  914. border-radius: 16rpx;
  915. }
  916. .pages {
  917. position: absolute;
  918. background-color: #fff;
  919. height: 34rpx;
  920. padding: 0 10rpx;
  921. border-radius: 3rpx;
  922. right: 30rpx;
  923. bottom: 30rpx;
  924. line-height: 34rpx;
  925. font-size: 24rpx;
  926. color: #050505;
  927. }
  928. }
  929. .tab-cont {
  930. background: #fff;
  931. }
  932. .follow_count {
  933. padding: 30rpx 24rpx 20rpx 24rpx;
  934. border-bottom: 1px solid #F5F5F5;
  935. .title {
  936. padding: 0 10rpx;
  937. display: flex;
  938. align-items: center;
  939. justify-content: space-between;
  940. }
  941. .author {
  942. display: flex;
  943. align-items: center;
  944. position: relative;
  945. .level_icon {
  946. position: absolute;
  947. width: 26rpx;
  948. height: 26rpx;
  949. margin: 4rpx 0 0 6rpx;
  950. border: none;
  951. z-index: 1;
  952. bottom: 2rpx;
  953. left: 50rpx;
  954. }
  955. .picture,
  956. uni-image {
  957. width: 78rpx;
  958. height: 78rpx;
  959. border-radius: 100%;
  960. }
  961. .name {
  962. margin-left: 20rpx;
  963. color: #282828;
  964. font-size: 32rpx;
  965. font-weight: bold;
  966. align-items: center;
  967. }
  968. }
  969. .icon-fenxiang {
  970. font-size: 40rpx !important;
  971. }
  972. .time {
  973. color: #282828;
  974. font-size: 46rpx;
  975. }
  976. .product {
  977. margin-top: 20rpx;
  978. border-radius: 16rpx;
  979. }
  980. }
  981. .manage {
  982. width: 100%;
  983. background: #ffffff;
  984. box-shadow: 0 2rpx 15rpx rgba(0, 0, 0, 0.1);
  985. padding: 30rpx 24rpx;
  986. z-index: 10;
  987. border-radius: 40rpx 40rpx 0 0;
  988. .items {
  989. // border-bottom: 1px solid #EEEEEE;
  990. color: #333333;
  991. font-size: 28rpx;
  992. display: flex;
  993. justify-content: center;
  994. margin-bottom: 64rpx;
  995. &:last-child {
  996. border-bottom: none;
  997. }
  998. .iconfont {
  999. margin: 0 16rpx 0;
  1000. }
  1001. }
  1002. }
  1003. .dazi-info {
  1004. font-weight: 500;
  1005. font-size: 23rpx;
  1006. color: #FFFFFF;
  1007. background: #FF6600;
  1008. padding: 6rpx 25rpx;
  1009. border-radius: 8rpx;
  1010. }
  1011. .tui-modal-custom {
  1012. width: 600rpx;
  1013. position: relative;
  1014. box-sizing: border-box;
  1015. padding: 40rpx;
  1016. border-radius: 16px;
  1017. background-color: #fff;
  1018. z-index: 9999;
  1019. .h-342 {
  1020. min-height: 268rpx;
  1021. max-height: 268rpx;
  1022. overflow-y: scroll;
  1023. }
  1024. }
  1025. </style>