find.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. <yk-authpup ref="authpupCAMERA" type="top" @changeAuth="changeAuth"
  54. permissionID="CAMERA"></yk-authpup>
  55. </view>
  56. </template>
  57. <script>
  58. import ykAuthpup from "@/components/yk-authpup/yk-authpup";
  59. import scode from "../../library/scode.js"
  60. import api from "../../library/index.js"
  61. import chat from "../../library/chat.js"
  62. import http from "../../library/http.js"
  63. import message from "../../library/message.js"
  64. import action from "../../library/action.js"
  65. import headerline from '../../components/header.vue'
  66. import config from "../../config.js"
  67. var windowHeight= uni.getSystemInfoSync().windowHeight;
  68. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight ;
  69. var contenttop=statusBarHeight+45;
  70. var conentheight=windowHeight-contenttop;
  71. var lottHeight= conentheight-30;
  72. var lottTop= contenttop + 30;
  73. export default {
  74. components: {
  75. headerline,
  76. ykAuthpup
  77. },
  78. data() {
  79. return {
  80. statusBarHeight: statusBarHeight+ 'px',
  81. contenttop:contenttop+'px',
  82. contentheight:conentheight+'px',
  83. lottHeight:lottHeight+'px',
  84. lottTop:lottTop+'px',
  85. shownav:false,
  86. navtitle:'发现',
  87. user:uni.getStorageSync('userInfo'),
  88. showsearch:false,
  89. friends:uni.getStorageSync(uni.getStorageSync('access_token')+'_frienddata'),
  90. pinyin:[],
  91. char_select:false,
  92. flink:uni.getStorageSync('flink')
  93. };
  94. },
  95. methods:{
  96. photo(image_url){
  97. if(image_url.indexOf('http')<=-1) image_url=config.imgUri+image_url;
  98. return this.image_cache(image_url);
  99. },
  100. openurl(url){
  101. uni.navigateTo({
  102. url:'../web/index?url='+url
  103. })
  104. } ,
  105. href(path,opts){
  106. if(!opts || opts==undefined || opts == null) opts={};
  107. this.$jump(path,opts);
  108. },
  109. open_detail(item){
  110. this.$jump('friend.detail',{id:item.id});
  111. },
  112. clicksearch(e){
  113. this.showsearch=e;
  114. },
  115. tapmenu(num){
  116. if(this.$action.loginTips('未登录用户,无法完成此操作','/pages/game/index') ==false) return false;
  117. if(this.$action.check_userlock()==false) return false;
  118. if(num==0){
  119. if(this.user.nickname=='' || this.user.nickname==this.user.name){
  120. this.$action.profileTips('未设置昵称,不能创建群','/pages/group/create') ;
  121. return false;
  122. }
  123. else
  124. this.$jump('group.create');
  125. }
  126. else if(num==1){
  127. this.$jump('group.list',{method:0});
  128. }
  129. else if(num==2){
  130. this.$jump('group.list',{method:1});
  131. }
  132. else if(num==3){
  133. this.$jump('mine.note');
  134. }
  135. else if(num==4){
  136. this.scan();
  137. }
  138. },
  139. changeAuth() {
  140. uni.scanCode({
  141. success(res) {
  142. scode.getScode(res)
  143. },
  144. fail(e) {
  145. console.log(JSON.stringify(e));
  146. console.log('扫码失败')
  147. }
  148. });
  149. },
  150. scan(){
  151. if(plus.os.name == 'Android') {
  152. return this.$refs['authpupCAMERA'].open()
  153. }else {
  154. uni.scanCode({
  155. success(res) {
  156. scode.getScode(res)
  157. },
  158. fail(e) {
  159. console.log(JSON.stringify(e));
  160. console.log('扫码失败')
  161. }
  162. });
  163. }
  164. },
  165. setrightmenu(){
  166. var action=[
  167. {
  168. title: '新建群组',
  169. icon: 'plus'
  170. },
  171. {
  172. title: '创建的群',
  173. icon: 'personadd'
  174. },
  175. {
  176. title: '加入的群',
  177. icon: 'person'
  178. },
  179. // #ifdef APP-PLUS
  180. {
  181. title: '通知设置',
  182. icon: 'gear'
  183. },
  184. {
  185. title: '扫一扫',
  186. icon: 'scan'
  187. },
  188. // #endif
  189. ]
  190. this.menuitem=action;
  191. },
  192. getflink(){
  193. // #ifdef APP-PLUS
  194. var showtype=plus.os.name
  195. // #endif
  196. // #ifndef APP-PLUS
  197. var showtype='H5'
  198. // #endif
  199. http.setWait(false).get('index.php?act=getlink',{showtype:showtype}).then(res=>{
  200. this.flink=res.data;
  201. uni.setStorageSync('flink',this.flink)
  202. })
  203. },
  204. },
  205. onShow() {
  206. uni.hideKeyboard();
  207. var userid=parseInt(uni.getStorageSync('access_token'));
  208. if(userid>0) {
  209. this.getflink();
  210. }else{
  211. uni.setStorageSync('gourl','/pages/contact/index');
  212. this.$jump('login.index');
  213. }
  214. },
  215. onLoad() {
  216. this.setrightmenu();
  217. uni.$on('toChat',message=>{
  218. //console.log('index')
  219. this.$action.toChat(message);
  220. })
  221. }
  222. }
  223. </script>
  224. <style lang="scss">
  225. .page {
  226. background-color: #fafafa;
  227. font-size: 14px;
  228. }
  229. .lines{
  230. display: inline-block;
  231. clear: both;
  232. margin-top: 10px;
  233. height: 50px;
  234. line-height: 50px;
  235. background-color: #ffffff;
  236. padding: 0px 10px;
  237. width: calc(100% - 20px);
  238. }
  239. .lines > view{
  240. display: inline-block;
  241. }
  242. .lines > view:first-child{
  243. width: 50px;
  244. text-align: center;
  245. }
  246. .lines .icon{
  247. height: 28px;
  248. width: 28px;
  249. vertical-align: middle;
  250. border-radius: 5px;
  251. }
  252. .lines > view:nth-child(2){
  253. width: calc(100% - 90px);
  254. text-align: left;
  255. font-size: 16px;
  256. }
  257. .lines > view:last-child{
  258. width: 40px;
  259. text-align: center;
  260. }
  261. .lines .right{
  262. font-size: 20px !important;
  263. color: #666 !important;
  264. }
  265. </style>