123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <template>
- <view class="page">
- <headerline issearch="true" :showsearch="showsearch" searchtips="请输入搜索内容" @clicksearch='clicksearch' :shownav="false" :title="navtitle" :menuitem="menuitem" :statusbarheight='statusBarHeight' :islogo="false" @tapmenu="tapmenu" rightmenu="true"></headerline>
-
- <block v-if="!showsearch">
-
- <view class="lines" @tap="href('circle.circle',{})">
- <view >
- <image src="../../static/img/icon-circle.png" class="icon"></image>
-
- </view>
- <view>朋友圈</view>
- <view>
- <uni-icons type="arrowright" class="right"></uni-icons>
- </view>
- </view>
-
- <!-- #ifdef APP-PLUS -->
- <view class="lines" @tap="scan()">
- <view >
- <image src="../../static/img/icon/scan.png" class="icon"></image>
-
- </view>
- <view>扫一扫</view>
- <view>
- <uni-icons type="arrowright" class="right"></uni-icons>
- </view>
- </view>
- <!-- #endif -->
-
-
- <!-- <view class="lines" @tap="href('group.index',{})">
- <view >
- <image src="../../static/img/mygroup.png" class="icon"></image>
- </view>
- <view>群组大厅</view>
- <view>
- <uni-icons type="arrowright" class="right"></uni-icons>
- </view>
- </view> -->
-
- <view class="lines" v-for="(m,index) in flink" :key='index' @tap="openurl(m.url)">
- <view >
- <image :src="photo(m.logo)" class="icon"></image>
- </view>
- <view>{{m.title}}</view>
- <view>
- <uni-icons type="arrowright" class="right"></uni-icons>
- </view>
- </view>
-
- <view class="lines" @tap="href('mine.note1',{})">
- <view >
- <uni-icons class="icon2" type='sound' ></uni-icons>
- </view>
- <view>系统公告</view>
- <view>
- <uni-icons type="arrowright" class="right"></uni-icons>
- </view>
- </view>
-
-
-
- </block>
-
- <yk-authpup ref="authpupCAMERA" type="top" @changeAuth="changeAuth"
- permissionID="CAMERA"></yk-authpup>
- </view>
- </template>
- <script>
- import ykAuthpup from "@/components/yk-authpup/yk-authpup";
- import scode from "../../library/scode.js"
- import api from "../../library/index.js"
- import chat from "../../library/chat.js"
- import http from "../../library/http.js"
- import message from "../../library/message.js"
- import action from "../../library/action.js"
- import headerline from '../../components/header.vue'
- import config from "../../config.js"
- var windowHeight= uni.getSystemInfoSync().windowHeight;
- var statusBarHeight = uni.getSystemInfoSync().statusBarHeight ;
- var contenttop=statusBarHeight+45;
- var conentheight=windowHeight-contenttop;
- var lottHeight= conentheight-30;
- var lottTop= contenttop + 30;
- export default {
- components: {
- headerline,
- ykAuthpup
- },
- data() {
- return {
- statusBarHeight: statusBarHeight+ 'px',
- contenttop:contenttop+'px',
- contentheight:conentheight+'px',
- lottHeight:lottHeight+'px',
- lottTop:lottTop+'px',
- shownav:false,
- navtitle:'发现',
-
- user:uni.getStorageSync('userInfo'),
- showsearch:false,
- friends:uni.getStorageSync(uni.getStorageSync('access_token')+'_frienddata'),
- pinyin:[],
- char_select:false,
- flink:uni.getStorageSync('flink')
- };
- },
- methods:{
- photo(image_url){
- if(image_url.indexOf('http')<=-1) image_url=config.imgUri+image_url;
-
- return this.image_cache(image_url);
- },
-
- openurl(url){
- uni.navigateTo({
- url:'../web/index?url='+url
- })
- } ,
-
- href(path,opts){
-
- if(!opts || opts==undefined || opts == null) opts={};
- this.$jump(path,opts);
-
- },
- open_detail(item){
-
- this.$jump('friend.detail',{id:item.id});
- },
- clicksearch(e){
- this.showsearch=e;
- },
-
- tapmenu(num){
-
- if(this.$action.loginTips('未登录用户,无法完成此操作','/pages/game/index') ==false) return false;
- if(this.$action.check_userlock()==false) return false;
-
- if(num==0){
-
- if(this.user.nickname=='' || this.user.nickname==this.user.name){
- this.$action.profileTips('未设置昵称,不能创建群','/pages/group/create') ;
- return false;
- }
- else
- this.$jump('group.create');
- }
- else if(num==1){
- this.$jump('group.list',{method:0});
- }
- else if(num==2){
- this.$jump('group.list',{method:1});
- }
- else if(num==3){
- this.$jump('mine.note');
- }
- else if(num==4){
- this.scan();
- }
- },
- changeAuth() {
- uni.scanCode({
- success(res) {
- scode.getScode(res)
- },
- fail(e) {
- console.log(JSON.stringify(e));
- console.log('扫码失败')
- }
- });
- },
- scan(){
- if(plus.os.name == 'Android') {
- return this.$refs['authpupCAMERA'].open()
- }else {
- uni.scanCode({
- success(res) {
- scode.getScode(res)
- },
- fail(e) {
- console.log(JSON.stringify(e));
- console.log('扫码失败')
- }
- });
- }
-
- },
- setrightmenu(){
- var action=[
-
- {
- title: '新建群组',
- icon: 'plus'
- },
- {
- title: '创建的群',
- icon: 'personadd'
- },
- {
- title: '加入的群',
- icon: 'person'
- },
-
- // #ifdef APP-PLUS
- {
- title: '通知设置',
- icon: 'gear'
- },
- {
- title: '扫一扫',
- icon: 'scan'
- },
- // #endif
- ]
- this.menuitem=action;
- },
-
- getflink(){
- // #ifdef APP-PLUS
- var showtype=plus.os.name
- // #endif
- // #ifndef APP-PLUS
- var showtype='H5'
- // #endif
- http.setWait(false).get('index.php?act=getlink',{showtype:showtype}).then(res=>{
- this.flink=res.data;
-
- uni.setStorageSync('flink',this.flink)
- })
-
- },
- },
- onShow() {
- uni.hideKeyboard();
- var userid=parseInt(uni.getStorageSync('access_token'));
- if(userid>0) {
- this.getflink();
-
- }else{
-
- uni.setStorageSync('gourl','/pages/contact/index');
-
- this.$jump('login.index');
- }
- },
- onLoad() {
-
- this.setrightmenu();
- uni.$on('toChat',message=>{
- //console.log('index')
- this.$action.toChat(message);
- })
- }
- }
- </script>
- <style lang="scss">
- .page {
- background-color: #fafafa;
- font-size: 14px;
- }
- .lines{
- display: inline-block;
- clear: both;
- margin-top: 10px;
- height: 50px;
- line-height: 50px;
- background-color: #ffffff;
- padding: 0px 10px;
- width: calc(100% - 20px);
-
- }
- .lines > view{
- display: inline-block;
- }
- .lines > view:first-child{
- width: 50px;
- text-align: center;
- }
- .lines .icon{
- height: 28px;
- width: 28px;
- vertical-align: middle;
- border-radius: 5px;
- }
- .lines > view:nth-child(2){
- width: calc(100% - 90px);
- text-align: left;
- font-size: 16px;
- }
- .lines > view:last-child{
- width: 40px;
- text-align: center;
- }
- .lines .right{
- font-size: 20px !important;
- color: #666 !important;
- }
- </style>
|