index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view class="top-c ddflex">
  5. <view class="top-tab">
  6. <view class="filter ddflex" @click="showSearch">{{searchList[currentTab].label}}<image src="../../static/pages/images/bico.png" class="bico"></image></view>
  7. <view class="filter-list" v-if="isSearch">
  8. <view class="li" v-for="(item,index) in searchList" :key="index" @click="swiType(index)">{{item.label}}</view>
  9. </view>
  10. </view>
  11. <view class="search ddflex fflex">
  12. <image src="../../static/images/ssico.png"></image>
  13. <input v-model="searchText" :placeholder="'搜'+searchList[currentTab].label" placeholder-class="placeholder" @focus="focusSearch" @confirm="confirmSearch" class="ipt fflex" />
  14. </view>
  15. </view>
  16. </view>
  17. <view style="height: 90rpx;"></view>
  18. <block v-if="currentTab == 0 || currentTab == 1">
  19. <view class="cons-b">
  20. <view class="list" v-if="officeList && officeList.length > 0">
  21. <view class="li" v-for="(item, index) in officeList" :key="index">
  22. <view class="user ddflex" @click="jumpUrl('/topics/home/home?userId=' + item.userDTO.id)">
  23. <image :src="item.userDTO.avatar?item.userDTO.avatar:'/static/images/def_head.png'" mode="aspectFill" class="userimg"></image>
  24. <view class="fflex">
  25. <view class="namea ddflex">
  26. <view class="name fflex ddflex">{{ item.userDTO.nickName }}
  27. <!-- <image src="../../static/images/vip_tag.png" class="vip-tag" v-if="item.userDTO.levelGrade > 0"></image> -->
  28. <image v-if="item.userDTO.isOpenWeRunData" style="width:15rpx;height:20rpx;margin-left: 10rpx;" src="../../static/images/yd.png"></image>
  29. </view>
  30. <view class="time">{{ item.time }}</view>
  31. </view>
  32. <view class="area" v-if="item.userDTO.cityName">{{ item.userDTO.provinceName }} {{ item.userDTO.cityName }}</view>
  33. </view>
  34. </view>
  35. <view class="des" @click="jumpUrlDetail(item)"><rich-text :nodes="item.content"></rich-text></view>
  36. <!-- //如果有投票,就不显示图片 -->
  37. <block v-if="!item.qyPoll">
  38. <view class="video" v-if="item.isHaveVideo && config.open_community_video == 1">
  39. <video :src="item.url" :show-center-play-btn="false" :controls="item.isControls" :autoplay="item.isControls" :id="'myVideo'+index" @pause="videoPause(index)" @ended="videoEnded(index)"></video>
  40. <view class="video-play ddflex" @click="videoPlay(index)" v-if="item.isShowPlayBtn"><image src="../../static/images/play.png"></image></view>
  41. </view>
  42. <view class="imgbox ddflex" @click="jumpUrlDetail(item)" v-if="!item.isHaveVideo"><!-- @click="previewImgss(item.url, idx)" -->
  43. <block v-if="item.url&&item.url.length>0">
  44. <image mode="aspectFill" v-for="(it, idx) in item.url" :src="it" :key="idx"></image>
  45. </block>
  46. </view>
  47. </block>
  48. <!-- 话题 -->
  49. <view class="ddflex" v-if="item.qyDialogu">
  50. <view class="topic ddflex" @click="jumpUrl('/topics/detail/detail?topicId=' + item.qyDialogu.id)">
  51. <image src="../../static/images/topic.png"></image>
  52. {{ item.qyDialogu.title }}
  53. </view>
  54. <!-- <view class="topic ddflex" @click="jumpUrl('/topics/detail/detail?topicId=' + item.qyDialogu.id)">
  55. <image src="../../static/images/topic.png"></image>
  56. {{ item.qyDialogu.title }}
  57. </view> -->
  58. </view>
  59. <view class="loca ddflex" @click="jumpUrlPoi(item,'/office/poi/index')" v-if="item.poiName"><image :src="picUrlss+'office_images/loca.png'"></image><text v-if="item.poiDistance > 0">{{item.poiDistance ? item.poiDistance < 1000 ? item.poiDistance+'m' : (item.poiDistance/1000).toFixed(1)+'km' : ''}}</text>{{item.poiName}}</view>
  60. <!-- 投票 -->
  61. <view :class="'vote-box' + (item.qyPoll.isEnd ? ' ends' : '')" v-if="item.qyPoll">
  62. <view class="vote-tit">{{ item.qyPoll.title }}</view>
  63. <block v-if="item.qyPoll.isVote == 1">
  64. <view class="vote-list end" @click="jumpUrlDetail(item)">
  65. <view :class="'lis ddflex ' + (itpy.isVote == 1 ? 'active' : '')" v-for="(itpy, idex) in JSON.parse(item.qyPoll.optionJson)" :key="idex">
  66. <view class="percent" :style="'width:' + parseFloat(itpy.proportion) + '%;'"></view>
  67. <view class="fflex">{{ itpy.name }}</view>
  68. <view>{{ parseFloat(itpy.proportion) + '%' }}</view>
  69. </view>
  70. </view>
  71. </block>
  72. <block v-else>
  73. <view class="vote-list">
  74. <view class="lis" v-for="(itpy, idex) in JSON.parse(item.qyPoll.optionJson)" :key="idex" @click="submitPoll(item, index, idex)">
  75. {{ itpy.name }}
  76. </view>
  77. </view>
  78. </block>
  79. <view class="vote-can" v-if="item.qyPoll.isEnd"><text>{{item.qyPoll.voteCount}}人参与</text>投票已结束</view>
  80. </view>
  81. <block v-if="item.type==10||item.type==11">
  82. <view v-if="item.type==10" class="ddflex step-box" style="justify-content: space-between;" @click="jumpUrl('/exercise/record/record?userId=' + item.userId)">
  83. <view>
  84. <view class="step-date">{{item.wxRun.step}}</view>
  85. <view class="step-label">步数</view>
  86. </view>
  87. <view>
  88. <view class="step-date">{{item.wxRun.index}}</view>
  89. <view class="step-label" style="text-align: right;">名次</view>
  90. </view>
  91. </view>
  92. <view v-if="item.type==11" class="ddflex step-box" style="justify-content: space-between;" @click="jumpUrl('/match/activityDetail/activityDetail?id=' + item.matchContent.id)">
  93. <image class="step-pic" :src="item.matchContent.pic" mode="aspectFill"></image>
  94. <view class="fflex">
  95. <view class="step-title tovers">{{item.matchContent.title}}</view>
  96. <view class="ddflex" style="justify-content: space-between;margin-top: 10rpx;">
  97. <view class="step-price">{{item.matchContent.endTime}}</view>
  98. <view class="step-btn">查看</view>
  99. </view>
  100. </view>
  101. </view>
  102. </block>
  103. <view v-if="item.userGroupId" class="ddflex step-box" style="padding: 25rpx 21rpx;" @click="jumpUrl('/office/team/index?id=' + item.userGroupId)">
  104. <image style="width: 24rpx;height: 24rpx;margin-right: 13rpx;" src="../../static/images/link.png"></image>
  105. <view style="font-weight: 500;color: #999999;">Team:</view>
  106. <view>{{item.userGroupTitle}}</view>
  107. </view>
  108. <block v-else>
  109. <view class="product" v-if="item.products && item.products.length > 0">
  110. <view scroll-x="true" class="pro-view pro-view1" v-if="item.products.length == 1">
  111. <view class="lis" v-for="(it, idx) in item.products" :key="idx" @click="toProductDetail(it)">
  112. <view class="ddflex">
  113. <image :src="it.pic" mode="aspectFill" class="pic"></image>
  114. <view class="fflex">
  115. <view class="title tover">{{ it.title }}</view>
  116. <view class="opts ddflex">
  117. <view class="money"><text>¥</text>{{ it.salePrice }}</view>
  118. <view class="pro-btn"><image src="../../static/pages/images/n_cart.png"></image></view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <scroll-view scroll-x="true" class="pro-view" v-else>
  125. <view class="lis" v-for="(it, idx) in item.products" :key="idx" @click="toProductDetail(it)">
  126. <view class="ddflex">
  127. <image :src="it.pic" mode="aspectFill" class="pic"></image>
  128. <view class="fflex">
  129. <view class="title tover">{{ it.title }}</view>
  130. <view class="opts ddflex">
  131. <view class="money"><text>¥</text>{{ it.salePrice }}</view>
  132. <view class="pro-btn"><image src="../../static/pages/images/n_cart.png"></image></view>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. </scroll-view>
  138. </view>
  139. </block>
  140. <view class="opt ddflex" v-if="!item.source">
  141. <view class="fflex" @click="jumpUrlDetail(item)">{{fomatNumbers(item.count.browseCount)}}次浏览</view>
  142. <view class="ddflex" @click="submitFabulous(2, item.id, index)">
  143. <image :src="'../../static/images/' + (item.isPraise == 1 ? 'like_h' : 'like') + '.png'"></image>
  144. {{fomatNumbers(item.count.fabulousCount)}}
  145. </view>
  146. <view class="ddflex" @click="jumpUrlDetail(item)" v-if="config.is_show_create_btn == 1">
  147. <image src="../../static/images/comment.png"></image>
  148. {{fomatNumbers(item.count.commentCount)}}
  149. </view>
  150. <button open-type="share" hover-class="none" class="opt-share ddflex">
  151. <image src="../../static/images/share.png"></image>
  152. 分享
  153. </button>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="nodata" v-if="isNoData">
  158. <image :src="picUrlss + 'empty_jl.png'"></image>
  159. <text>未找到相关{{searchList[currentTab].label}}</text>
  160. </view>
  161. </view>
  162. </block>
  163. <block v-if="currentTab == 2">
  164. <view class="team-list">
  165. <view v-for="(item,index) in teamList" :key="index">
  166. <view class="li ddflex" @click="jumpUrl('/office/team/index?id='+item.id)">
  167. <image :src="item.url?item.url:picUrlss+'office_images/team_default.png'" mode="aspectFill" class="team-img"></image>
  168. <view class="fflex">
  169. <view class="ddflex">
  170. <view class="team-tit tover" style="max-width: calc(100% - 80rpx);">{{item.title}}</view>
  171. <view v-if="item.relationMatch" style="margin-left: 10rpx; width: 60rpx;line-height: 29rpx;font-size: 20rpx;color: #FFFFFF;background: linear-gradient(56deg, #FF7000 0%, #FF9100 100%);border-radius: 5rpx;text-align: center;">赛事</view>
  172. <view v-else style="margin-left: 10rpx;width: 60rpx;line-height: 29rpx;font-size: 20rpx;color: #FFFFFF;background: linear-gradient(48deg, #5190FF 0%, #78A9FF 100%);border-radius: 5rpx;text-align: center;">社区</view>
  173. </view>
  174. <view class="team-sta">
  175. <text>{{item.memberNum}}成员</text>
  176. <text>{{item.momentsNum}}帖子</text>
  177. </view>
  178. </view>
  179. <view class="join-btn" @click.stop="joinTeam(item,index)">{{item.isJoin == 1 ? '已加入':'加入'}}</view>
  180. </view>
  181. <view v-if="item.relationMatch" class="ddflex"
  182. style="background: #F7F8FC;border-radius: 10rpx;padding: 18rpx 20rpx;margin-top: 20rpx;margin-left: 96rpx;color: #999;font-size: 24rpx;"
  183. @click="jumpUrl('/match/activityDetail/activityDetail?id='+item.relationMatch.id)">
  184. 来自
  185. <view class="fflex tover" style="color: var(--main);">{{item.relationMatch.title}}</view>
  186. </view>
  187. </view>
  188. </view>
  189. <view class="nodata" v-if="isNoData">
  190. <image :src="picUrlss + 'empty_yq.png'"></image>
  191. <text>未找到团队</text>
  192. </view>
  193. </block>
  194. </view>
  195. </template>
  196. <script>
  197. const app = getApp();
  198. const api = require('../../utils/api.js');
  199. const req = require('../../utils/request.js');
  200. const util = require('../../utils/util.js');
  201. const QQMapWX = require("../../utils/qqmap.js");
  202. export default {
  203. components: {
  204. },
  205. data() {
  206. return {
  207. picUrlss: req.public.picUrls,
  208. currentTab: 0,
  209. isSearch: false,
  210. searchText: '',
  211. searchList: [
  212. {
  213. value: 1,
  214. label: '话题'
  215. },
  216. {
  217. value: 2,
  218. label: '投票'
  219. },
  220. {
  221. value: 3,
  222. label: '团队'
  223. }
  224. ],
  225. isNoData: false,
  226. isShowPage: false,
  227. isLoad: true,
  228. form: {
  229. page: 1,
  230. limit: 10
  231. },
  232. pType: 1, //排序: 1综合, 2最新,3浏览最多,4评论最多,5热门
  233. officeList: [], //聊一聊
  234. videoCurrent: null,
  235. videoContext: '',
  236. teamForm: {
  237. page: 1,
  238. limit: 10
  239. },
  240. isTeamLoad: true,
  241. teamList: [],
  242. config: {},
  243. currentPoi: {},
  244. }
  245. },
  246. onLoad(options) {
  247. if(options.currentTab) this.currentTab = options.currentTab-1;
  248. },
  249. onShow() {
  250. this.config = JSON.parse(req.getStorage('configRes'))
  251. },
  252. onReachBottom() {
  253. if(this.currentTab > 1){
  254. this.teamForm.page++;
  255. this.getTeamPage();
  256. }else{
  257. this.form.page++;
  258. this.getOfficeList();
  259. }
  260. },
  261. methods: {
  262. showSearch(){
  263. this.isSearch = !this.isSearch;
  264. },
  265. swiType(index){
  266. if(this.currentTab == index){
  267. this.isSearch = false;
  268. return false;
  269. }
  270. this.currentTab = index;
  271. this.isSearch = false;
  272. this.officeList = [];
  273. this.teamList = [];
  274. this.isNoData = false;
  275. this.$forceUpdate();
  276. console.log(this.officeList,this.teamList)
  277. },
  278. focusSearch(){
  279. this.isSearch = false;
  280. },
  281. confirmSearch(){
  282. if(this.currentTab > 1){
  283. this.isTeamLoad = true;
  284. this.teamForm.page = 1;
  285. this.getTeamPage();
  286. }else{
  287. this.isLoad = true;
  288. this.form.page = 1;
  289. this.getOfficeList();
  290. }
  291. },
  292. //预览图片
  293. previewImgss(picUrls, index) {
  294. //预览合同图片
  295. var src = picUrls[index];
  296. let imgs = picUrls;
  297. uni.previewImage({
  298. current: src, // 当前显示图片的http链接
  299. urls: imgs
  300. });
  301. },
  302. removeHtml(content) {
  303. return util.removeHtml(content);
  304. },
  305. createJump(url) {
  306. if (!req.isLogins(true)) {
  307. return;
  308. }
  309. this.jumpUrl(url);
  310. },
  311. jumpUrl(url){
  312. uni.navigateTo({
  313. url: url
  314. })
  315. },
  316. jumpUrlPoi(item,url){
  317. this.currentPoi = item;
  318. uni.navigateTo({
  319. url: url
  320. })
  321. },
  322. jumpToPractice(item,url){
  323. let checkCategory = {
  324. id: item.question.cateId,
  325. name: item.question.cateName
  326. }
  327. req.setStorage('checkCategory',checkCategory)
  328. this.jumpUrl(url);
  329. },
  330. jumpUrlDetail(item) {
  331. this.jumpUrl('/office/detail/detail?contentId=' + item.id);
  332. },
  333. toProductDetail(item) {
  334. this.jumpUrl('/product/detail/detail?id=' + item.id);
  335. },
  336. sum(arr) {
  337. var s = 0;
  338. for (var i=arr.length-1; i>=0; i--) {
  339. if(arr[i].count){
  340. s += Number(arr[i].count);
  341. }
  342. }
  343. return s;
  344. },
  345. fomatNumbers(num){
  346. return util.formatNumbers(num)
  347. },
  348. getOfficeList() {
  349. let that = this;
  350. var pramData = {};
  351. pramData.page = this.form.page;
  352. pramData.limit = this.form.limit;
  353. // pramData.type = 4;
  354. if (this.pType == 5) {
  355. //热门
  356. pramData.isEssence = 2;
  357. } else {
  358. pramData.orderType = this.pType;
  359. }
  360. if(this.treeId) {
  361. pramData.treeId = this.treeId
  362. pramData.orderType = 1
  363. }else delete pramData.treeId
  364. pramData.searchType = this.currentTab+1;//1话题 2投票 3团队
  365. if(this.searchText) pramData.content = this.searchText;
  366. else delete pramData.content;
  367. if (!this.isLoad) return false;
  368. this.isLoad = false;
  369. req.getRequest('/api/v3/moments/page', pramData, data => {
  370. if(data.list&&data.list.length > 0){
  371. data.list.map(it=>{
  372. if(it.qyPoll && it.qyPoll.isEnd){
  373. it.qyPoll.voteCount = that.sum(JSON.parse(it.qyPoll.optionJson))
  374. }
  375. if(it.url){
  376. let h = it.url.substring(it.url.lastIndexOf('.') + 1)
  377. if(h.indexOf('mp4')<0&&h.indexOf('MP4')<0){
  378. it.url = it.url.split(',');
  379. }else{
  380. it.isHaveVideo = true
  381. it.isControls = false
  382. it.isShowPlayBtn = true
  383. }
  384. }
  385. it.content = '<div style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 5;-webkit-box-orient: vertical;word-break: break-all;">' + it.content + '</div>'
  386. return it;
  387. })
  388. }
  389. if (data.list && data.list.length >= 10) this.isLoad = true;
  390. if (this.form.page > 1) data.list = this.officeList.concat(data.list);
  391. this.officeList = data.list;
  392. if(data.list && data.list.length == 0) this.isNoData = true;
  393. else this.isNoData = false;
  394. this.isShowPage = true;
  395. });
  396. },
  397. getTeamPage(){
  398. if (!this.isTeamLoad) return false;
  399. this.isTeamLoad = false;
  400. let form = this.teamForm;
  401. if(this.searchText) form.title = this.searchText;
  402. else delete form.title;
  403. req.getRequest(api.user_team_page,form,data=>{
  404. if (data.list && data.list.length >= 10) this.isTeamLoad = true;
  405. if (this.teamForm.page > 1) data.list = this.teamList.concat(data.list);
  406. this.teamList = data.list;
  407. if(data.list && data.list.length == 0) this.isNoData = true;
  408. else this.isNoData = false;
  409. })
  410. },
  411. //提交点赞、取消点赞;收藏、取消收藏
  412. submitFabulous(type, id, index) {
  413. if (!req.isLogins(true)) {
  414. return;
  415. }
  416. var dataP = {};
  417. dataP.type = type; //1,观看 ,2点赞,3评论,4分享,5收藏
  418. dataP.momentsId = id;
  419. req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
  420. if (type == 2) {
  421. //动态点赞
  422. if (this.officeList[index].isPraise == 1) {
  423. //已赞
  424. this.officeList[index].isPraise = 0;
  425. this.officeList[index].count.fabulousCount--;
  426. } else {
  427. this.officeList[index].isPraise = 1;
  428. this.officeList[index].count.fabulousCount++;
  429. }
  430. }
  431. });
  432. },
  433. //提交投票
  434. submitPoll(item, pIndex, pollIndex) {
  435. if(item.qyPoll.isEnd){
  436. this.jumpUrlDetail(item)
  437. return false;
  438. }
  439. var dataP = {};
  440. // dataP.id = item.id;
  441. dataP.pollId = item.qyPoll.id;
  442. var pollObjList = JSON.parse(item.qyPoll.optionJson);
  443. dataP.pollOptionCode = pollObjList[pollIndex].code;
  444. req.postRequest('/api/v3/poll/saveDetails', dataP, data => {
  445. req.msg('投票成功');
  446. //图片完之后要将该投票的对象返回,便于做渲染%
  447. this.officeList[pIndex].qyPoll = data;
  448. });
  449. },
  450. goTop: function(e) {
  451. // 一键回到顶部
  452. if (uni.pageScrollTo) {
  453. uni.pageScrollTo({
  454. scrollTop: 0
  455. });
  456. } else {
  457. uni.showModal({
  458. title: '提示',
  459. content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  460. });
  461. }
  462. },
  463. videoPlay(index){
  464. var that = this;
  465. var curIdx = index;
  466. this.officeList[index].isControls = true
  467. this.officeList[index].isShowPlayBtn = false
  468. // 有播放时先将prev暂停,再播放当前点击的current
  469. if (that.videoCurrent != null) {
  470. var videoContextPrev = uni.createVideoContext('myVideo' + that.videoCurrent)
  471. if (that.videoCurrent != curIdx) {
  472. this.officeList[that.videoCurrent].isControls = false
  473. this.officeList[that.videoCurrent].isShowPlayBtn = true
  474. videoContextPrev.stop()
  475. }
  476. that.videoCurrent = curIdx
  477. var videoContextCurrent = uni.createVideoContext('myVideo' + curIdx)
  478. videoContextCurrent.play()
  479. } else {
  480. // 没有播放时播放视频
  481. that.videoCurrent = curIdx
  482. var videoContext = uni.createVideoContext('myVideo' + curIdx) // 对应的视频id
  483. videoContext.play()
  484. }
  485. },
  486. videoPause(index){
  487. this.officeList[index].isControls = false
  488. this.officeList[index].isShowPlayBtn = true
  489. },
  490. videoEnded(index){
  491. this.officeList[index].isControls = false
  492. this.officeList[index].isShowPlayBtn = true
  493. },
  494. joinTeam(item,index){
  495. if(item.isJoin == 1) {
  496. uni.navigateTo({
  497. url: '/office/team/index?id='+item.id
  498. })
  499. return false;
  500. }
  501. if(item.relationMatch){
  502. uni.navigateTo({
  503. url: '/match/activityDetail/activityDetail?id='+item.relationMatch.id
  504. })
  505. return false;
  506. }
  507. req.postRequest(api.user_team_follow,{userGroupId: item.id},data=>{
  508. req.msg('加入团队成功');
  509. setTimeout(res=>{
  510. this.jumpUrl('/office/team/index?id='+item.id);
  511. },200)
  512. })
  513. }
  514. },
  515. created() {
  516. const systemInfo = uni.getSystemInfoSync();
  517. // px转换到rpx的比例
  518. let pxToRpxScale = 750 / systemInfo.windowWidth;
  519. let systems = {
  520. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  521. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  522. };
  523. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  524. this.systems = systems;
  525. },
  526. onShareAppMessage: function() {
  527. let path = '/pages/interactive/index?isShare=' + true;
  528. if (req.getStorage('userInfo')) {
  529. path += '&userId=' + req.getStorage('userInfo').id;
  530. }
  531. if (req.getStorage('MERCHANT') && req.getStorage('MERCHANT').id != null) {
  532. path += '&merchantId=' + req.getStorage('MERCHANT').id;
  533. if (req.getStorage('smallShop') && req.getStorage('MERCHANT').id != null) {
  534. path += '&shopId=' + req.getStorage('smallShop').id;
  535. }
  536. }
  537. let title = '';
  538. if (this.merchant && this.merchant.title && this.merchant.title != '默认门店') {
  539. title = this.merchant.title;
  540. } else {
  541. title = this.config.CONFIG_PROJECT_TITLE;
  542. }
  543. return {
  544. title: (req.excludeSpecial(req.getStorage('userInfo').nickName) ? req.excludeSpecial(req.getStorage('userInfo').nickName) : '') + '为你推荐' + title,
  545. path: path
  546. };
  547. },
  548. onShareTimeline() {
  549. let path = 'isShare=' + true;
  550. if (req.getStorage('userInfo')) {
  551. path += '&userId=' + req.getStorage('userInfo').id;
  552. }
  553. if (req.getStorage('MERCHANT') && req.getStorage('MERCHANT').id != null) {
  554. path += '&merchantId=' + req.getStorage('MERCHANT').id;
  555. if (req.getStorage('smallShop') && req.getStorage('MERCHANT').id != null) {
  556. path += '&shopId=' + req.getStorage('smallShop').id;
  557. }
  558. }
  559. let title = '';
  560. if (this.merchant && this.merchant.title && this.merchant.title != '默认门店') {
  561. title = this.merchant.title;
  562. } else {
  563. title = this.config.CONFIG_PROJECT_TITLE;
  564. }
  565. return {
  566. title: (req.excludeSpecial(req.getStorage('userInfo').nickName) ? req.excludeSpecial(req.getStorage('userInfo').nickName) : '') + '为你推荐' + title,
  567. query: path
  568. };
  569. }
  570. }
  571. </script>
  572. <style>
  573. @import "./index.css";
  574. </style>