index.vue 28 KB

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