index.vue 29 KB

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