wenxin0805 1 anno fa
parent
commit
73bd4f2e8d

+ 2 - 2
babel.config.js

@@ -3,7 +3,7 @@ module.exports = {
     ['import', {
       libraryName: 'vant',
       libraryDirectory: 'es',
-      style: true,
+      style: true
     }, 'vant']
-  ]
+  ],
 }

+ 2 - 9
jsconfig.json

@@ -5,15 +5,8 @@
     "baseUrl": "./",
     "moduleResolution": "node",
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
-    "lib": [
-      "esnext",
-      "dom",
-      "dom.iterable",
-      "scripthost"
-    ]
+    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
   }
 }

+ 2 - 1
public/index.html

@@ -10,7 +10,8 @@
     <%= htmlWebpackPlugin.options.title %>
   </title>
 </head>
-
+<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script>
+<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script>
 <body>
   <noscript>
     <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.

+ 2 - 1
serves/axios.js

@@ -2,7 +2,8 @@ import axios from "axios";
 // import { gettoken } from "../services/token";
 // axios.defaults.withCredentials=true;
 const instance = axios.create({
-  baseURL: 'http://192.168.2.164:8899', //请求的基础地址
+  // baseURL: 'http://192.168.2.164:8899', //请求的基础地址
+  baseURL: 'https://scrm.zzliaoyuan.com/backend', //请求的基础地址
   timeout: 5000, //请求超时的时间
 });
 //发一个get请求

+ 37 - 4
serves/prove.js

@@ -1,5 +1,4 @@
-import { get, } from './axios'
-
+import { get,post } from './axios'
 //轮播图和文章分类
 export const indexswiperInfo = (data) => get('/api/content/home/', data)
 //查看文章列表
@@ -8,6 +7,40 @@ export const indexcategoryInfo = (data) => get('/api/content/csutomer_article/?c
 // export const textdetailInfo = (id, data) => get('/api/content/csutomer_article/' + id + '/?' + data)
 export const textdetailInfo = (id, userid, type, unionid) => get(`/api/content/csutomer_article/${id}/?userid=${userid}&type=${type}&unionid=${unionid}`)
 //点赞接口
-export const clkgoodInfo = (id, userid) => get(`/api/content/csutomer_article/${id}/like/?userid=${userid}`)
+// export const clkgoodInfo = (id, userid) => get(`/api/content/csutomer_article/${id}/like/?userid=${userid}`)
 //转发列表
-export const forwardInfo = (userid, category) => get(`/api/content/share/?userid=${userid}&category=${category}`)
+export const forwardInfo = (userid, category) => get(`/api/content/share/?userid=${userid}&category=${category}`)
+//取user_id
+export const  getUser_Id=(code)=>get(`/api/customer/chat_side/userid/?query_code=${code}`)
+//动态
+export const  getTrends=(user_id)=>get(`/api/customer/chat_side/action/?external_userid=wmWY7dCwAAJbsYIgpmdD991EvM2NbAcA&user_id=${user_id}`)
+//订单
+export const  getOrder=(user_id)=>get(`/api/customer/chat_side/order/?external_userid=wmWY7dCwAAJbsYIgpmdD991EvM2NbAcA&user_id=${user_id}`)
+//获取参数
+export const  getparameter=()=>get('/api/customer/chat_side/params/')
+//获取上半页数据
+export const getUpperhalfpage=(user_id)=>get(`/api/customer/chat_side/base/?external_userid=wmWY7dCwAAJbsYIgpmdD991EvM2NbAcA&user_id=${user_id}`)
+//获取详情数据
+export const getDetails=(user_id)=>get(`/api/customer/chat_side/detail/?external_userid=wmWY7dCwAAJbsYIgpmdD991EvM2NbAcA&user_id=${user_id}`)
+//H获取首页轮播图 图片地址
+export const getSwiperUrl=()=>get(`/api/content/agent/ration/`)
+//H文章分类
+export const articleCategory=()=>get(`/api/content/agent/category/`)
+//H获取成员信息
+export const getMember=(userid)=>get(`/api/content/agent/user/?userid=${userid}`)
+//H文章每个分类列表
+export const getArticleCategoryList=(category,limit,page)=>get(`/api/content/agent_article/?category=${category}&limit=${limit}&page=${page}`)
+//H查看文章详情 id=文章id
+export const getArticleCategoryDetail=(id,userid)=>get(`/api/content/agent_article/${id}/?userid=${userid}`)
+//H新点赞接口
+export const clkgoodInfo = (id, userid) => get(`api/content/agent_article/${id}/?userid=${userid}`)
+//H 获取我的转发 分类列表
+export const getUserForwardList=(userid,category,limit,page)=>get(`/api/content/share/?userid=${userid}&category=${category}&limit=${limit}&page=${page}`)
+//H 分享详情 id分享id
+export const shareDetails=(id)=>get(`/api/content/share/${id}/`)
+//H 第二次通过code获取 userid
+export const getSecondaryUserId=(code)=>get(`/api/content/agent/userid/?code=${code}`)
+//H分享
+export const getShareParmas=(id,userid)=>get(`/api/content/agent_article/${id}/share_args/?userid=${userid}`)
+//post转发成功调用添加转发记录
+export  const postShareinfo=(data)=>post('/api/content/share/',data)

+ 17 - 6
src/App.vue

@@ -1,24 +1,31 @@
 <template>
   <div id="app">
     <router-view class="main" />
-    <Tabbar v-show="isshowNav" route v-model="active">
-      <TabbarItem :to="{ name: 'index' }" icon="home-o">首页</TabbarItem>
-
-      <TabbarItem :to="{ name: 'myindex' }" icon="friends-o">我的</TabbarItem>
-
+    <Tabbar v-show='isshowNav'
+            route
+            v-model="active">
+      <TabbarItem :to="{ name: 'index' }"
+                  icon="home-o">首页</TabbarItem>
+      <TabbarItem :to="{ name: 'myindex' }"
+                  icon="friends-o">我的</TabbarItem>
     </Tabbar>
   </div>
 </template>
 <script>
+// import  {wxShareAppMessage} from "../common/common.js"
 import { Tabbar, TabbarItem } from 'vant';
 export default {
   data () {
     return {
       active: 0,
     }
+  },
+  mounted () {
+
   },
   computed: {
     isshowNav () {
+      console.log('观察tarbar', this.$route.meta.hideNav)
       return this.$route.meta.hideNav
     }
   },
@@ -27,8 +34,12 @@ export default {
   },
 
   methods: {
-
   },
+  // watch: {
+  // toShare(shareData){
+  //     wxShareAppMessage(shareData)
+  //  }
+  // }
 }
 </script>
 <style lang="scss">

BIN
src/assets/avatar.png


BIN
src/assets/jiantou.png


+ 0 - 1
src/main.js

@@ -9,7 +9,6 @@ import './assets/icon/iconfont.css'
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 import '@/assets/iconfont/iconfont.css';
-
 Vue.config.productionTip = false
 Vue.use(ElementUI);
 new Vue({

+ 13 - 1
src/router/index.js

@@ -41,6 +41,18 @@ const routes = [
     name: 'myforward',
     component: () => import('../views/userindex/my/MyForward.vue')
   },
+  //跳转空页面获取code
+  {
+    path: '/GetMyId',
+    name: 'GetMyId',
+    component: () => import('../views/Fuzeren/GetMyId.vue')
+  },
+  //GetUserIndex 页面获取code
+  {
+    path: '/GetUserIndex',
+    name: 'GetUserIndex',
+    component: () => import('../views/userindex/indexpage/GetUserIndexMyid.vue')
+  },
   // 我的转发详情
   {
     path: '/myforwarddetail',
@@ -49,7 +61,7 @@ const routes = [
   },
 ]
 const router = new VueRouter({
-  mode: 'history',
+  mode: 'hash',
   base: process.env.BASE_URL,
   routes
 })

+ 23 - 0
src/util/sessionStorage.js

@@ -0,0 +1,23 @@
+export default{
+    get(key){
+        let item=sessionStorage.getItem(key)
+        return item
+    },
+    set(key,value){
+        sessionStorage.setItem(key,value)
+    },
+    remove(key){
+        sessionStorage.removeItem(key)
+    },
+    //存本地
+    getLocalstorage(key){
+        let item=localStorage.getItem(key)
+       return item
+    },
+    setLocalstorage(key,value){
+        localStorage.setItem(key,value)
+    },
+    removeLocalstorage(key){
+        localStorage.removeItem(key)
+    }
+}

File diff suppressed because it is too large
+ 623 - 335
src/views/Fuzeren/FuzerenView.vue


+ 55 - 0
src/views/Fuzeren/GetMyId.vue

@@ -0,0 +1,55 @@
+<template>
+    <div></div>
+</template>
+<script>
+import { query } from 'quill';
+import { get } from '../../../serves/axios';
+
+export default{
+    data(){
+        return{
+          corpid:''
+        }
+    },
+    created(){
+      this.getCorpId() 
+    },
+    mounted(){
+      this.setCode()
+    },
+    methods:{
+      //获取corpid
+      getCorpId(){
+        get('/api/customer/chat_side/corpid/').then(res=>{
+          if(res.code==2000){
+            this.corpid=res.data.corpid
+          }
+        })
+      },
+      //截取链接中的code
+      getQuery(){
+        let { search } =window.location;
+        if(!search){
+          return {};
+        }
+        search=search.slice('&')
+        // eslint-disable-next-line no-import-assign
+        query=query.map(item=>item.split('='))
+        return Object.fromEntries(query)
+      },
+      //设置code
+      setCode(){
+        let query =this.getQuery()
+        if(!query.code){
+        return window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.corpid}&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base&state=STATE&agentid=AGENTID#wechat_redirect'
+        }else{
+          this.$router.push({name:'fuzeren',query:{code:query.code}})
+        }
+      }
+    },
+    components:{
+
+    },
+}
+</script>
+<style lang="scss"></style>

+ 273 - 28
src/views/userindex/indexpage/ArticleIndex.vue

@@ -1,45 +1,97 @@
 <template>
   <div class="indexbox">
+    <p class="imgStyle">
+      <img src="../../../assets/jiantou.png"
+           style="width: 6vw;height: 6vw;"
+           alt=""
+           @click="GoUp">
+    </p>
     <h1>{{ textdetaildata.title }}</h1>
     <div class="publisher">
-      <img style="width: 10vw;height: 10vw;border-radius: 50%;" :src="textdetaildata.cover" alt="">
+      <img style="width: 10vw;height: 10vw;border-radius: 50%;"
+           :src=avatar
+           alt=""
+           v-show="avatar?true:false">
       <p>{{ textdetaildata.creator_name }}</p>
       <span>{{ textdetaildata.create_datetime }}</span>
     </div>
-    <div v-html="textdetaildata.content" class="container">
+    <div v-html="textdetaildata.content"
+         class="container">
     </div>
     <div class="like">
       <span>阅读量:{{ textdetaildata.read_count }}</span>
 
-      <span :class="isgood ? 'note' : 'pith'" id="clickgood" @click="clkgood">{{ isgood ? '已点赞' : '点赞' }}</span>
+      <span :class="isgood ? 'note' : 'pith'"
+            id="clickgood"
+            @click="clkgood">{{ isgood ? '已点赞' : '点赞' }}</span>
     </div>
-    <div class="contacts">
+    <div class="contacts"
+         v-show="myId?true:false">
       <div>
-        <h3>{{ textdetaildata.creator_name }}</h3>
-        <div style="padding-bottom: 2vh;">河南建工集团||董事长</div>
-        <div style="margin-bottom: 3vw;"><span class="iconfont icon-weixin" @click="showPopup"></span><span
-            class="iconfont icon-dianhua"></span></div>
+        <h3>{{ menuberinfo }}</h3>
+        <!-- <div style="padding-bottom: 2vh;">河南建工集团||董事长</div> -->
+        <div style="margin-bottom: 3vw;"><span class="iconfont icon-weixin"
+                @click="showPopup"></span><span class="iconfont icon-dianhua"
+                @click="callPhone"></span></div>
       </div>
-      <popup v-model="show" closeable position="bottom" :style="{ height: '30%' }" />
+      <popup v-model="show"
+             closeable
+             position="bottom"
+             :style="{ height: '30%', background: '#f7f7f7', }">
+        <div class="qrcode">
+          <img :src=qrcode
+               alt="">
+        </div>
+      </popup>
       <div>
-        <img style="width: 15vw;height: 15vw;border-radius: 50%;" :src="textdetaildata.cover" alt="">
+        <img style="width: 15vw;height: 15vw;border-radius: 50%;"
+             :src=avatar
+             alt="">
       </div>
     </div>
   </div>
 </template>
 <script>
-import { textdetailInfo, clkgoodInfo } from "../../../../serves/prove";
+import { getArticleCategoryDetail, clkgoodInfo, getMember, getShareParmas, getparameter,postShareinfo } from "../../../../serves/prove";
 import { Toast, Popup } from "vant";
+import storage from '../../../util/sessionStorage.js'
+ 
 export default {
   data () {
     return {
       textdetaildata: {},
       isgood: '',
       show: false,
+      menuberinfo: '',
+      avatar: '',
+      qrcode: '',
+      phone: '',
+      myId: '',
+      shareData: {
+        title: '',
+        desc: '',
+        link: '',
+        imgUrl: ''
+      }
+    }
+  },
+  created () {
+    if (!this.myId) {
+      this.myId = storage.getLocalstorage('user_id')
     }
   },
   mounted () {
-    this.textdetailapi()
+    if (this.myId != null && this.myId !== '' && this.myId !== 'undefined') {
+      this.getMemberapi(this.myId)
+    }
+    if (this.$route.query.id) {
+      this.textdetailapi(this.$route.query.id, this.myId)
+      //获取分享的参数  执行config
+      this.getUserIdparameter()
+    } else {
+      this.textdetailapi()
+    }
+    console.log('------------------', this.$route.query.id)
   },
   components: { Popup },
   methods: {
@@ -52,7 +104,6 @@ export default {
       if (this.isgood) {
         Toast.fail('不能取消点赞');
       } else {
-
         clkgoodInfo(this.$route.query.id, 'WeiQiJia')
         this.isgood = true
         Toast.success('点赞成功');
@@ -60,16 +111,162 @@ export default {
       }
 
     },
-    //文章详情借口
-    async textdetailapi () {
-      const res = await textdetailInfo(this.$route.query.id, 'WeiQiJia', 'employee', '')
-      this.textdetaildata = res.data
-      this.textdetaildata.flag = false
-      if (!res.data.flag) this.clkgood()
-      console.log(res.data);
+    //文章详情接口
+    async textdetailapi (id, userId) {
+      const res = await getArticleCategoryDetail(id, userId)
+      if (res.code == 2000) {
+        this.textdetaildata = res.data
+        this.isgood = res.data.like
+        // this.textdetaildata.flag = false
+        // if (!res.data.flag) this.clkgood()
+        console.log(res.data);
+      }
+
       // this.isgood = res.data.like
+    },
+    GoUp () {
+      this.$router.go(-1)
+    },
+    //分享到对话框
+    shareDialogue () {
+      var wx = window.wx
+      wx.invoke(
+        "shareAppMessage", {
+        title: '', // 分享标题
+        desc: '', // 分享描述
+        link: '', // 分享链接
+        imgUrl: '', // 分享封面
+        enableIdTrans: 0, // 是否开启id转译,不填默认为0
+      }, function (res) {
+        if (res.err_msg == "shareAppMessage:ok") {
+          //正确处理
+        } else {
+          //错误处理
+        }
+      }
+      );
+    },
+    //获取个人信息  //WeiQiJia
+    async getMemberapi (user_id) {
+      const res = await getMember(user_id)
+      if (res.code == 2000) {
+        this.menuberinfo = res.data.name
+        this.avatar = res.data.avatar
+        this.phone = res.data.tel
+        this.qrcode = res.data.qrcode
+      }
+      console.log(res)
+    },
+    //打电话
+    callPhone () {
+      window.location.href = this.phone
+    },
+    //获取分享参数 在wx.ready执行分享的事件分享到朋友/朋友圈等
+    async getShareParmasinfo (id,myId) {
+      const res = await getShareParmas(id,myId)
+      console.log(res)
+      this.shareData.title = res.data.title
+      this.shareData.desc = res.data.desc
+      this.shareData.link = res.data.link
+      this.shareData.imgUrl = res.data.image
+      window.wx.onMenuShareAppMessage({
+        title: res.data.title, // 分享标题
+        desc: res.data.desc, // 分享描述
+        link: res.data.link, // 分享链接;在微信上分享时,该链接的域名必须与企业某个应用的可信域名一致
+        imgUrl: res.data.image, // 分享图标
+        enableIdTrans: 0, // 是否开启id转译,不填默认为0
+        success: function () {
+          this.postShareinfo({article:this.$route.query.id,userid:this.myId})
+          // 用户确认分享后执行的回调函数
+        },
+        error: function (res) {
+          if (res.errMsg.indexOf('no permission') > 0) {
+            console.log('未agentConfig')
+          }
+        },
+        cancel: function () {
+          // 用户取消分享后执行的回调函数
+        }
+      });
+      window.wx.onMenuShareTimeline({
+        title: res.data.title, // 分享标题
+        desc: res.data.desc, // 分享描述
+        link: res.data.link, // 分享链接;在微信上分享时,该链接的域名必须与企业某个应用的可信域名一致
+        imgUrl: res.data.image, // 分享图标
+        enableIdTrans: 0, // 是否开启id转译,不填默认为0
+        success: function () {
+          this.postShareinfo({article:this.$route.query.id,userid:this.myId})
+          // 用户确认分享后执行的回调函数
+        },
+        error: function (res) {
+          if (res.errMsg.indexOf('no permission') > 0) {
+            alert('未agentConfig')
+          }
+        },
+        cancel: function () {
+          // 用户取消分享后执行的回调函数
+        }
+      });
+
+    },
+    //config
+    async getUserIdparameter () {
+      const res = await getparameter()
+      window.wx.config({
+        beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
+        debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+        appId: res.data.appId, // 必填,企业微信的corpID
+        timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+        nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+        signature: res.data.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
+        jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareWechat"], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+      });
+      window.wx.ready(() => {
+        this.getShareParmasinfo(this.$route.query.id,this.myId)
+      })
+      window.wx.agentConfig({
+        corpid: res.data.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
+        agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
+        timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+        nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+        signature: res.data.agent_signature,// 必填,签名,见附录-JS-SDK使用权限签名算法
+        jsApiList: ['shareWechatMessage'], //必填,传入需要使用的接口名称
+        success: function (res) {
+          console.log('agentConfig=>成功')
+          console.log('获取agentConfig的res', res)
+          getShareParmas(this.$route.query.id,this.myId).then(res => {
+            window.wx.invoke('shareWechatMessage', {
+              title: res.data.title, // 分享标题
+              desc: res.data.desc, // 分享描述
+              link: res.data.link, // 分享链接
+              imgUrl: res.data.imgUrl, // 分享封面
+              enableIdTrans: 1, // 是否开启id转译,不填默认为0
+            }, function (res) {
+              if (res.err_msg == "shareWechatMessage:ok") {
+                this.postShareinfo({article:this.$route.query.id,userid:this.myId})
+                //正确处理
+              } else {
+                //错误处理
+              }
+            });
+
+          })
+
+        },
+        fail: function (res) {
+          console.log('agentConfig=>失败')
+          if (res.errMsg.indexOf('function not exist') > -1) {
+            console.log('版本过低请升级')
+          }
+        }
+      })
+    },
+    //转发成功调用添加转发记录
+    async postShareinfo(data){
+      const res= await postShareinfo(data)
+      console.log('转发成功调用添加转发记录',res)
     }
-  }
+  },
 }
 </script>
 <style lang="scss" scoped>
@@ -79,6 +276,10 @@ export default {
   margin: 0 auto;
   padding-top: 2rem;
   box-sizing: border-box;
+  .imgStyle {
+    width: 90vw;
+    height: 5vh;
+  }
 
   h1 {
     font-size: 1.8rem;
@@ -97,7 +298,6 @@ export default {
       flex: 1;
       padding-left: 2vw;
     }
-
   }
 
   .contacts {
@@ -109,18 +309,67 @@ export default {
     border-radius: 3vw;
     display: flex;
     justify-content: space-between;
+    .qrcode {
+      width: 100vw;
+      height: 30vh;
+      // background-color: aqua;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      img {
+        width: 50vw;
+        height: 45vw;
+        margin-top: 6vw;
+      }
+    }
+    .popupStyle {
+      width: 90vw;
+      height: 10vh;
+      margin: 0 auto;
+      margin-top: 8vw;
+      // background-color: aqua;
+
+      // ul {
+      //   display: flex;
+      //   li {
+      //     width: 20vw;
+      //     height: 20vw;
+      //     // background-color: aqua;
+      //     padding-left: 3vw;
+      //     div {
+      //       width: 15vw;
+      //       height: 15vw;
+      //       background-color: #ffff;
+      //       box-sizing: border-box;
+      //       border-radius: 4vw;
+      //       display: flex;
+      //       justify-content: center;
+      //       align-items: center;
+      //       img{
+      //         width: 10vw;
+      //         height: 10vw;
+      //       }
+      //     }
+      //     p {
+      //       font-size: 1.2rem;
+      //       color: #7c7c7c;
+      //       margin-top: 2vw;
+      //     }
+      //   }
+      // }
+    }
 
     div:nth-child(1) {
       display: flex;
       justify-content: space-between;
       flex-direction: column;
-      font-size: .6rem;
+      font-size: 0.6rem;
 
       .iconfont {
         font-size: 2rem;
         margin: 0 10vw 0 0;
         border-radius: 50%;
-        padding: .2rem;
+        padding: 0.2rem;
         color: white;
       }
 
@@ -152,17 +401,13 @@ export default {
       text-align: center;
       line-height: 6vw;
       border-radius: 6vw;
-
-
     }
   }
-
 }
 </style>
 <style>
 .container img {
   width: 100%;
-
 }
 
 .van-icon {

+ 54 - 0
src/views/userindex/indexpage/GetUserIndexMyid.vue

@@ -0,0 +1,54 @@
+<template>
+  <div></div>
+</template>
+<script>
+import { get } from '../../../../serves/axios';
+import { query } from 'quill';
+export default {
+  data () {
+    return {
+      corpid: ''
+    }
+  },
+  created () {
+    this.getCorpId()
+  },
+  mounted () {
+    this.setCode()
+  },
+  methods: {
+    //获取corpid
+    getCorpId () {
+      get('/api/customer/chat_side/corpid/').then(res => {
+        if (res.code == 2000) {
+          this.corpid = res.data.corpid
+        }
+      })
+    },
+    //截取链接中的code
+    getQuery () {
+      let { search } = window.location;
+      if (!search) {
+        return {};
+      }
+      search = search.slice('&')
+      // eslint-disable-next-line no-import-assign
+      query = query.map(item => item.split('='))
+      return Object.fromEntries(query)
+    },
+    //设置code
+    setCode () {
+      let query = this.getQuery()
+      if (!query.code) {
+        return window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.corpid}&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base&state=STATE&agentid=AGENTID#wechat_redirect'
+      } else {
+        this.$router.push({ name: 'index', query: { code: query.code } })
+      }
+    }
+  },
+  components: {
+
+  },
+}
+</script>
+<style lang="scss"></style>

+ 95 - 35
src/views/userindex/indexpage/UserIndex.vue

@@ -1,17 +1,34 @@
 <template>
   <div class="indexbox">
     <div class="banner">
-      <swipe class="my-swipe" :autoplay="2000" indicator-color="white">
-        <swipe-item v-for="(item, index) in swiperimg" :key="index"><img :src="item" alt=""></swipe-item>
+      <swipe class="my-swipe"
+             :autoplay="2000"
+             indicator-color="white">
+        <swipe-item v-for="(item, index) in swiperimg"
+                    :key="index"><img :src="item"
+               alt=""></swipe-item>
 
       </swipe>
     </div>
     <div class="title">
-      <tabs @click="onClick" v-model="active" swipeable animated color="blue">
-        <tab v-for="item in category" :title="item.name" :key="item.id">
-          <list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
-            <div @click="wenzhangdetail(item.id)" class="card" v-for="item in articledata" :key="item.id">
-              <img :src="item.cover" alt="">
+      <tabs @click="onClick"
+            v-model="active"
+            swipeable
+            animated
+            color="blue">
+        <tab v-for="item in category"
+             :title="item.name"
+             :key="item.id">
+          <list v-model="loading"
+                :finished="finished"
+                finished-text="没有更多了"
+                @load="onLoad(item.id)">
+            <div @click="wenzhangdetail(item.id)"
+                 class="card"
+                 v-for="item in articledata"
+                 :key="item.id">
+              <img :src="item.cover_url"
+                   alt="">
               <div class="cardtit">
                 <h4>{{ item.title }}</h4>
                 <p>{{ item.intro }}</p>
@@ -26,75 +43,120 @@
       </tabs>
     </div>
     <div>
-
     </div>
   </div>
 </template>
 <script>
 import { Swipe, SwipeItem, Tab, Tabs, List, Toast } from 'vant';
-import { indexswiperInfo, indexcategoryInfo } from "../../../../serves/prove";
+import sessionStorage from "../../../util/sessionStorage.js"
+import { getSwiperUrl, articleCategory, getArticleCategoryList,getUser_Id } from "../../../../serves/prove"; //indexswiperInfo, 有用=》getUser_Id
 export default {
   data () {
     return {
       active: 0,
-      swiperimg: ['https://img2.baidu.com/it/u=3711151361,2067397039&fm=253&fmt=auto&app=120&f=JPEG?w=801&h=500', 'https://img2.baidu.com/it/u=730703936,3583247154&fm=253&fmt=auto&app=120&f=JPEG?w=518&h=323'],//轮播图
+      swiperimg: [],//轮播图
       category: [],//文章分类
       articledata: [],//文章内容
       loading: false,
       finished: false,
+      page: 1,
+      limit: 10,
+      id: '',
+      myId:''
     }
   },
   components: {
     Swipe, SwipeItem, Tab, Tabs, List,
   },
+  created () {
+    //获取自己的userId
+    if (!this.$route.query.code) {
+      let user_id = sessionStorage.getLocalstorage('user_id')
+      if (user_id && user_id != undefined && user_id != '') {
+        this.myId = user_id
+      } else {
+        this.$router.push({ name: 'GetUserIndex'})
+      }
+    } else {
+      getUser_Id().then(res => {
+        if (res.code == 2000) {
+      this.myId=res.data.user_id
+          sessionStorage.setLocalstorage('user_id', res.data.user_id)
+        }
+      })
+    }
+  },
   mounted () {
     this.indexswiperapi()
-    this.indexcategoryapi()
+    this.indexcategoryapi(this.id, this.limit, this.page)
+    this.getSwiperUrlapi()
   },
   methods: {
     //轮播图和文章分类数据接口
     async indexswiperapi () {
-      const res = await indexswiperInfo()
+      const res = await articleCategory()
       if (res.code === 2000) {
-        // indexswiperInfo().then(res => {
-        //   console.log(res);
-        this.category = res.data.category
-        // this.swiperimg = res.data.urls
-        // console.log(this.category);
-        // console.log(this.swiperimg);
-        // })
+        this.category = res.data
         sessionStorage.setItem('category', JSON.stringify(this.category))
       } else {
         Toast('获取数据失败')
       }
     },
+    //轮播图url
+    async getSwiperUrlapi () {
+      const res = await getSwiperUrl()
+      if (res.code == 2000) {
+        this.swiperimg = res.data
+      }
+    },
     //文章列表数据
-    async indexcategoryapi (id) {
+    async indexcategoryapi (id, limit, page) {
+      console.log(limit, page)
       if (id) {
-        const res = await indexcategoryInfo(id)
+        const res = await getArticleCategoryList(id, limit, page)
         console.log(res);
         this.articledata = res.data.data
-
+        if (this.articledata.length < res.data.data.length) {
+          this.loading = false
+        } else {
+          this.finished = true
+        }
       } else {
-        const res = await indexcategoryInfo('')
+        const res = await getArticleCategoryList('', limit, page)
         console.log(res.data);
         this.articledata = res.data.data
-
+        if (this.articledata.length < res.data.data.length) {
+          this.loading = false
+        } else {
+          this.finished = true
+        }
       }
-
     },
     onClick (name, title) {
-      // console.log(name, title);
+      this.page = 1
       const targetid = this.category.find(obj => obj.name === title)
       console.log(targetid.id);
-      this.indexcategoryapi(targetid.id)
-    },
-    onLoad () {
+      this.indexcategoryapi(targetid.id, this.limit, this.page)
+
+
     },
     wenzhangdetail (id) {
       this.$router.push({ name: 'textpage', query: { id } }
       )
+    },
+    //触底刷新
+    async onLoad (id) {
+      this.loading = true;
+      this.page++
+      const res = await getArticleCategoryList(id, this.limit, this.page)
+      if (res.code == 2000) {
+        this.articledata = [...this.articledata, ...res.data.data]
+        if (res.data.data.length < 1) {
+          this.finished = true
+        }
+      }
     }
+
   }
 }
 </script>
@@ -135,7 +197,6 @@ export default {
       width: 100%;
       height: 15rem;
     }
-
     // .my-swipe {
     //   .swipe-item {
     //     color: #fff;
@@ -150,13 +211,12 @@ export default {
   .title {
     padding-top: 2rem;
 
-
-
     .card {
       margin-top: 2vh;
       width: 100%;
       height: 15vh;
       display: flex;
+      margin-bottom: 5vw;
       justify-content: space-between;
 
       .cardtit {
@@ -167,11 +227,11 @@ export default {
 
         h4 {
           color: black;
-          font-size: .6rem;
+          font-size: 0.6rem;
         }
 
         p:nth-child(2) {
-          font-size: .5rem;
+          font-size: 0.5rem;
           color: gray;
           display: -webkit-box;
           -webkit-line-clamp: 2;
@@ -182,7 +242,7 @@ export default {
         }
 
         p:nth-child(3) {
-          font-size: .5rem;
+          font-size: 0.5rem;
           display: flex;
           justify-content: space-between;
         }

+ 84 - 29
src/views/userindex/my/MyForward.vue

@@ -1,73 +1,126 @@
 <template>
   <div class="indexbox">
+    <p class="imgStyle">
+      <img src="../../../assets/jiantou.png"
+           style="width: 6vw;height: 6vw;"
+           alt=""
+           @click="GoUp">
+    </p>
     <div>
-      <tabs @click="onClick" v-model="active" swipeable animated color="blue">
-        <tab v-for="item in category" :key="item.id" :title="item.name">
-          <div v-for="item in forwarddata" :key="item.id" class="card">
-            <div class="titile">
-              <h2 @click="gomyforwarddetail">{{ item.title }}</h2>
-              <p>{{ item.count }}人阅读</p>
+      <tabs @click="onClick"
+            v-model="active"
+            swipeable
+            animated
+            color="blue">
+        <tab v-for="item in category"
+             :key="item.id"
+             :title="item.name">
+          <list v-model="loading"
+                :finished="finished"
+                finished-text="没有更多了"
+                @load="onLoad(item.id)">
+            <div v-for="item in forwarddata"
+                 :key="item.id"
+                 class="card">
+              <div class="titile">
+                <h2 @click="gomyforwarddetail(item.article,item.id,item.count,item.title,item.acover)">{{ item.title }}</h2>
+                <p>{{ item.count }}人阅读</p>
+              </div>
+              <img :src="item.cover"
+                   alt="">
+            </div>
+            <div class="nameres">
             </div>
-            <img :src="item.cover" alt="">
-          </div>
-          <div class="nameres">
 
-          </div>
+          </list>
         </tab>
       </tabs>
     </div>
   </div>
 </template>
 <script>
-import { Tab, Tabs } from 'vant';
-import { forwardInfo } from "../../../../serves/prove";
+import { Tab, Tabs, List } from 'vant';
+import { getUserForwardList } from "../../../../serves/prove";
+import storage from "../../../util/sessionStorage"
+// import { query } from 'quill';
 export default {
   data () {
     return {
       active: 0,
       category: [],
-      forwarddata: []
+      forwarddata: [],
+      loading: false,
+      finished: false,
+      limit: 10,
+      page: 1,
+      myId: '',
+      data: ''
     }
   },
+  components: {
+    Tab, Tabs, List
+  },
   created () {
+    if (!this.myId) {
+      this.myId = storage.getLocalstorage('user_id')
+    }
     //获取本地category数据
     const data = sessionStorage.getItem('category')
     this.category = JSON.parse(data)
     console.log(data);
   },
   mounted () {
-    this.forwardapi()
+    if (this.myId != null && this.myId !== '' && this.myId !== 'undefined') {
+      this.forwardapi(this.myId, '', this.limit, this.page)
+    }
+
   },
   methods: {
     //点击分类
     onClick (name, title) {
+      this.page = 1
       console.log(name, title);
       console.log(this.category);
       const targetid = this.category.find(obj => obj.name === title)
       console.log(targetid);
-      this.forwardapi(targetid.id)
+      this.forwardapi(this.myId, targetid.id, this.limit, this.page)  //需要传入user_id
+    },
+    //触底刷新
+    async onLoad (id) {
+      this.loading = true;
+      this.page++
+      const res = await getUserForwardList(this.myId, id, this.limt, this.page)
+      if (res.code == 2000) {
+        this.forwarddata = [...this.forwarddata, ...res.data.data]
+        if (res.data.data.length < 1) {
+          this.finished = true
+        }
+      }
     },
     //获取转发列表数据
-    async forwardapi (id) {
-      if (id) {
-        const res = await forwardInfo('WeiQiJia', id)
+    async forwardapi (user_id, id, limit, page) {
+      if (id != null && id !== undefined) {
+        const res = await getUserForwardList(user_id, id, limit, page)
         console.log(res);
         this.forwarddata = res.data.data
-      } else {
-        const res = await forwardInfo('WeiQiJia', '')
         this.forwarddata = res.data.data
+        if (this.forwarddata.length < res.data.data.length) {
+          this.loading = false
+        } else {
+          this.finished = true
+        }
       }
-
     },
     //点击标题跳转转发详情
-    gomyforwarddetail () {
-      this.$router.push('myforwarddetail')
+    gomyforwarddetail (id,Tid,count,title,acover) {
+      this.$router.push({name:'myforwarddetail',query:{id:id,Tid:Tid,count:count,title:title,acover:acover}})
+    },
+    //返回上级
+    GoUp () {
+      this.$router.go(-1)
     }
 
   },
-  components: {
-    Tab, Tabs
-  }
 }
 </script>
 <style>
@@ -92,7 +145,10 @@ export default {
   box-sizing: border-box;
   display: flex;
   flex-direction: column;
-
+  .imgStyle {
+    width: 90vw;
+    height: 5vh;
+  }
   hr {
     margin-top: 20px;
     border-color: rgb(255, 255, 255, 0.5);
@@ -119,13 +175,12 @@ export default {
       flex-direction: column;
 
       p {
-        font-size: .6rem;
+        font-size: 0.6rem;
       }
 
       h2 {
         font-size: 1.2rem;
       }
-
     }
   }
 

+ 45 - 14
src/views/userindex/my/MyForwarddetail.vue

@@ -1,36 +1,64 @@
 <template>
   <div class="indexbox">
+    <p class="imgStyle">
+      <img src="../../../assets/jiantou.png"
+           style="width: 6vw;height: 6vw;"
+           alt=""
+           @click="GoUp">
+    </p>
     <div>
-
       <div class="card">
         <div class="titile">
-          <h2 @click="gowenzhang">我是标题</h2>
-          <p>50人阅读</p>
+          <h2 @click="gowenzhang">{{ titile }}</h2>
+          <p> {{ count }} 人阅读</p>
         </div>
-        <img src="https://img2.baidu.com/it/u=693798837,2434993543&fm=253&fmt=auto&app=120&f=JPEG?w=890&h=500" alt="">
+        <img :src=acover
+             alt="">
       </div>
       <div class="nameres">
-        <div>
-          <img src="https://img2.baidu.com/it/u=693798837,2434993543&fm=253&fmt=auto&app=120&f=JPEG?w=890&h=500" alt="">
-          <p>高启强</p>
-          <p>2023-6-14&nbsp;23:23:23</p>
+        <div v-for="(item,index) in brows" :key="index">
+          <img :src=item.avatar
+               alt="">
+          <p>{{ item.name }}</p>
+          <p>{{ item.create_time }}</p>
         </div>
       </div>
-
     </div>
   </div>
 </template>
 <script>
-
+import { shareDetails } from "../../../../serves/prove"
 export default {
   data () {
     return {
       active: 0,
+      brows:'',
+      titile:'',
+      acover:'',
+      count:'',
+      Tid:''
     }
   },
+  mounted () {
+    this.titile=this.$route.query.title
+    this.count=this.$route.query.count
+    this.acover=this.$route.query.acover 
+    this.Tid=this.$route.query.Tid
+    console.log(this.titile,this.count,this.acover)
+    this.getshareDetails(this.$route.query.Tid)
+  },
   methods: {
     gowenzhang () {
-      this.$router.push('textpage')
+      this.$router.push({name:'textpage',query:{id:this.$route.query.id}})
+    },
+    async getshareDetails (id) {
+      const res = await shareDetails(id)
+      this.brows=res.data.brows
+      console.log(res)
+    },
+    //返回上级
+    GoUp () {
+      this.$router.go(-1)
     }
   }
 
@@ -58,7 +86,10 @@ export default {
   box-sizing: border-box;
   display: flex;
   flex-direction: column;
-
+  .imgStyle {
+    width: 90vw;
+    height: 5vh;
+  }
   hr {
     margin-top: 20px;
     border-color: rgb(255, 255, 255, 0.5);
@@ -85,13 +116,12 @@ export default {
       flex-direction: column;
 
       p {
-        font-size: .6rem;
+        font-size: 0.6rem;
       }
 
       h2 {
         font-size: 1.2rem;
       }
-
     }
   }
 
@@ -101,6 +131,7 @@ export default {
       display: flex;
       justify-content: space-between;
       align-items: center;
+      // background-color: aqua;
 
       p:nth-child(2) {
         flex: 1;

+ 81 - 15
src/views/userindex/my/MyIndex.vue

@@ -2,41 +2,94 @@
   <div class="myindex">
     <div class="contacts">
       <div>
-        <p>高启强</p>
-        <div>河南建工集团||董事长</div>
-        <div><span @click="gowexin" class="iconfont icon-weixin"></span><span class="iconfont icon-dianhua"></span></div>
+        <p>{{ menuberinfo?menuberinfo:'未授权'}}</p>
+        <div></div>
+        <div v-show="myId?true:false"><span @click="gowexin"
+                class="iconfont icon-weixin"></span><span class="iconfont icon-dianhua" @click="callPhone"></span></div>
       </div>
       <div>
         <img class="touxiang"
-          src="https://img2.baidu.com/it/u=693798837,2434993543&fm=253&fmt=auto&app=120&f=JPEG?w=890&h=500" alt="">
+             :src=avatar
+             alt="">
       </div>
     </div>
-    <div class="zhuanfabox">
+    <div class="zhuanfabox" v-show="myId?true:false">
       <hr>
       <p @click="goforward">我的转发
-        <icon class="tubiao" name="arrow" size="1rem" color="gray" />
+        <icon class="tubiao"
+              name="arrow"
+              size="1rem"
+              color="gray" />
       </p>
       <hr>
     </div>
+    <popup v-model="show"
+           position="bottom"
+           :style="{ height: '30%' }">
+      <div class="qrcode">
+        <img :src=qrcode
+             alt="">
+      </div>
+
+    </popup>
 
   </div>
 </template>
 <script>
-import { Icon } from 'vant'
+import { Icon, Popup } from 'vant'
+import storage from '../../../util/sessionStorage'
+import { getMember } from '../../../../serves/prove'
 export default {
   data () {
-    return {}
+    return {
+      myId: '',
+      menuberinfo: '',
+      avatar: '',
+      qrcode: '',
+      phone:'',
+      show: false
+    }
+  },
+  created () {
+    if(!this.myId){
+      this.myId = storage.getLocalstorage('user_id')
+    }
+    
+  },
+  mounted () {
+    if (this.myId != null && this.myId !== '' && this.myId !== 'undefined') {
+      this.getMemberapi(this.myId)
+    } 
   },
   methods: {
+    //获取个人信息  //WeiQiJia
+    async getMemberapi (user_id) {
+      const res = await getMember(user_id)
+      if (res.code == 2000) {
+        this.menuberinfo = res.data.name
+        this.avatar = res.data.avatar
+        this.phone = res.data.tel
+        this.qrcode = res.data.qrcode
+      }
+      console.log(res)
+    },
     goforward () {
       this.$router.push('myforward')
     },
+    //点击微信
     gowexin () {
+      this.show = true;
       console.log(111111);
+    },
+    //打电话
+    callPhone(){
+      window.location.href=this.phone
+      
     }
+
   },
   components: {
-    Icon
+    Icon, Popup
   }
 }
 </script>
@@ -69,7 +122,10 @@ export default {
       display: flex;
       justify-content: space-around;
       flex-direction: column;
-      font-size: .6rem;
+      font-size: 0.6rem;
+      p {
+        font-size: 2rem;
+      }
 
       div:nth-child(3) {
         // display: flex;
@@ -80,7 +136,7 @@ export default {
           font-size: 2rem;
           margin: 0 10vw 0 0;
           border-radius: 50%;
-          padding: .2rem;
+          padding: 0.2rem;
           color: white;
         }
 
@@ -94,17 +150,15 @@ export default {
       }
 
       p {
-        font-weight: 600;
+        font-weight: 400;
       }
-
-
     }
   }
 
   .zhuanfabox {
     p {
       margin: 2vh 0 2vh 0;
-      font-size: .6rem;
+      font-size: 0.6rem;
     }
 
     .tubiao {
@@ -115,5 +169,17 @@ export default {
       border-color: rgba(255, 255, 255, 0.5);
     }
   }
+  .qrcode {
+    width: 100vw;
+    height: 30vh;
+    // background-color: aqua;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    img {
+      width: 50vw;
+      height: 45vw;
+    }
+  }
 }
 </style>

+ 2 - 1
vue.config.js

@@ -1,4 +1,5 @@
 const { defineConfig } = require('@vue/cli-service')
 module.exports = defineConfig({
-  transpileDependencies: true
+  transpileDependencies: true,
+  publicPath: "./"
 })

Some files were not shown because too many files changed in this diff