index.vue 28 KB

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