find.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="page">
  3. <headerline issearch="true" :showsearch="showsearch" searchtips="请输入搜索内容" @clicksearch='clicksearch' :shownav="false" :title="navtitle" :menuitem="menuitem" :statusbarheight='statusBarHeight' :islogo="false" @tapmenu="tapmenu" rightmenu="true"></headerline>
  4. <block v-if="!showsearch">
  5. <view class="lines" @tap="href('circle.circle',{})">
  6. <view >
  7. <image src="../../static/img/icon-circle.png" class="icon"></image>
  8. </view>
  9. <view>朋友圈</view>
  10. <view>
  11. <uni-icons type="arrowright" class="right"></uni-icons>
  12. </view>
  13. </view>
  14. <!-- #ifdef APP-PLUS -->
  15. <view class="lines" @tap="scan()">
  16. <view >
  17. <image src="../../static/img/icon/scan.png" class="icon"></image>
  18. </view>
  19. <view>扫一扫</view>
  20. <view>
  21. <uni-icons type="arrowright" class="right"></uni-icons>
  22. </view>
  23. </view>
  24. <!-- #endif -->
  25. <!-- <view class="lines" @tap="href('group.index',{})">
  26. <view >
  27. <image src="../../static/img/mygroup.png" class="icon"></image>
  28. </view>
  29. <view>群组大厅</view>
  30. <view>
  31. <uni-icons type="arrowright" class="right"></uni-icons>
  32. </view>
  33. </view> -->
  34. <view class="lines" v-for="(m,index) in flink" :key='index' @tap="openurl(m.url)">
  35. <view >
  36. <image :src="photo(m.logo)" class="icon"></image>
  37. </view>
  38. <view>{{m.title}}</view>
  39. <view>
  40. <uni-icons type="arrowright" class="right"></uni-icons>
  41. </view>
  42. </view>
  43. <view class="lines" @tap="href('mine.note1',{})">
  44. <view >
  45. <uni-icons class="icon2" type='sound' ></uni-icons>
  46. </view>
  47. <view>系统公告</view>
  48. <view>
  49. <uni-icons type="arrowright" class="right"></uni-icons>
  50. </view>
  51. </view>
  52. </block>
  53. </view>
  54. </template>
  55. <script>
  56. import scode from "../../library/scode.js"
  57. import api from "../../library/index.js"
  58. import chat from "../../library/chat.js"
  59. import http from "../../library/http.js"
  60. import message from "../../library/message.js"
  61. import action from "../../library/action.js"
  62. import headerline from '../../components/header.vue'
  63. import config from "../../config.js"
  64. var windowHeight= uni.getSystemInfoSync().windowHeight;
  65. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight ;
  66. var contenttop=statusBarHeight+45;
  67. var conentheight=windowHeight-contenttop;
  68. var lottHeight= conentheight-30;
  69. var lottTop= contenttop + 30;
  70. export default {
  71. components: {
  72. headerline,
  73. },
  74. data() {
  75. return {
  76. statusBarHeight: statusBarHeight+ 'px',
  77. contenttop:contenttop+'px',
  78. contentheight:conentheight+'px',
  79. lottHeight:lottHeight+'px',
  80. lottTop:lottTop+'px',
  81. shownav:false,
  82. navtitle:'发现',
  83. user:uni.getStorageSync('userInfo'),
  84. showsearch:false,
  85. friends:uni.getStorageSync(uni.getStorageSync('access_token')+'_frienddata'),
  86. pinyin:[],
  87. char_select:false,
  88. flink:uni.getStorageSync('flink')
  89. };
  90. },
  91. methods:{
  92. photo(image_url){
  93. if(image_url.indexOf('http')<=-1) image_url=config.imgUri+image_url;
  94. return this.image_cache(image_url);
  95. },
  96. openurl(url){
  97. uni.navigateTo({
  98. url:'../web/index?url='+url
  99. })
  100. } ,
  101. href(path,opts){
  102. if(!opts || opts==undefined || opts == null) opts={};
  103. this.$jump(path,opts);
  104. },
  105. open_detail(item){
  106. this.$jump('friend.detail',{id:item.id});
  107. },
  108. clicksearch(e){
  109. this.showsearch=e;
  110. },
  111. tapmenu(num){
  112. if(this.$action.loginTips('未登录用户,无法完成此操作','/pages/game/index') ==false) return false;
  113. if(this.$action.check_userlock()==false) return false;
  114. if(num==0){
  115. if(this.user.nickname=='' || this.user.nickname==this.user.name){
  116. this.$action.profileTips('未设置昵称,不能创建群','/pages/group/create') ;
  117. return false;
  118. }
  119. else
  120. this.$jump('group.create');
  121. }
  122. else if(num==1){
  123. this.$jump('group.list',{method:0});
  124. }
  125. else if(num==2){
  126. this.$jump('group.list',{method:1});
  127. }
  128. else if(num==3){
  129. this.$jump('mine.note');
  130. }
  131. else if(num==4){
  132. this.scan();
  133. }
  134. },
  135. scan(){
  136. uni.scanCode({
  137. success(res) {
  138. scode.getScode(res)
  139. },
  140. fail(e) {
  141. console.log(JSON.stringify(e));
  142. console.log('扫码失败')
  143. }
  144. });
  145. },
  146. setrightmenu(){
  147. var action=[
  148. {
  149. title: '新建群组',
  150. icon: 'plus'
  151. },
  152. {
  153. title: '创建的群',
  154. icon: 'personadd'
  155. },
  156. {
  157. title: '加入的群',
  158. icon: 'person'
  159. },
  160. // #ifdef APP-PLUS
  161. {
  162. title: '通知设置',
  163. icon: 'gear'
  164. },
  165. {
  166. title: '扫一扫',
  167. icon: 'scan'
  168. },
  169. // #endif
  170. ]
  171. this.menuitem=action;
  172. },
  173. getflink(){
  174. // #ifdef APP-PLUS
  175. var showtype=plus.os.name
  176. // #endif
  177. // #ifndef APP-PLUS
  178. var showtype='H5'
  179. // #endif
  180. http.setWait(false).get('index.php?act=getlink',{showtype:showtype}).then(res=>{
  181. this.flink=res.data;
  182. uni.setStorageSync('flink',this.flink)
  183. })
  184. },
  185. },
  186. onShow() {
  187. uni.hideKeyboard();
  188. var userid=parseInt(uni.getStorageSync('access_token'));
  189. if(userid>0) {
  190. this.getflink();
  191. }else{
  192. uni.setStorageSync('gourl','/pages/contact/index');
  193. this.$jump('login.index');
  194. }
  195. },
  196. onLoad() {
  197. this.setrightmenu();
  198. uni.$on('toChat',message=>{
  199. //console.log('index')
  200. this.$action.toChat(message);
  201. })
  202. }
  203. }
  204. </script>
  205. <style lang="scss">
  206. .page {
  207. background-color: #fafafa;
  208. font-size: 14px;
  209. }
  210. .lines{
  211. display: inline-block;
  212. clear: both;
  213. margin-top: 10px;
  214. height: 50px;
  215. line-height: 50px;
  216. background-color: #ffffff;
  217. padding: 0px 10px;
  218. width: calc(100% - 20px);
  219. }
  220. .lines > view{
  221. display: inline-block;
  222. }
  223. .lines > view:first-child{
  224. width: 50px;
  225. text-align: center;
  226. }
  227. .lines .icon{
  228. height: 28px;
  229. width: 28px;
  230. vertical-align: middle;
  231. border-radius: 5px;
  232. }
  233. .lines > view:nth-child(2){
  234. width: calc(100% - 90px);
  235. text-align: left;
  236. font-size: 16px;
  237. }
  238. .lines > view:last-child{
  239. width: 40px;
  240. text-align: center;
  241. }
  242. .lines .right{
  243. font-size: 20px !important;
  244. color: #666 !important;
  245. }
  246. </style>