| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
- <title>微分机器人</title>
- <!--引入 element-ui 的样式,-->
- <link rel="stylesheet"
- href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742018383195/element-ui.css">
- <!-- 必须先引入vue, 后使用element-ui -->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
- <!-- 引入element 的组件库-->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017747738/element-ui.js"></script>
- <!-- <script src="js/vconsole.min.js"></script>
- <script>
- var vConsole = new window.VConsole();
- </script> -->
- </head>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- .box {
- width: 100vw;
- min-height: 100vh;
- box-sizing: border-box;
- background: #ECEDF1;
- }
- .page4 {
- width: 100vw;
- box-sizing: border-box;
- padding: 20px 15px;
- }
- .followup_item {
- width: 100%;
- background: #FFFFFF;
- border-radius: 10px;
- padding: 12px 12px 15px;
- box-sizing: border-box;
- margin-bottom: 20px;
- }
- .brand {
- display: flex;
- align-items: center;
- padding-bottom: 12px;
- border-bottom: 1px dashed #CCCCCC;
- font-weight: 400;
- font-size: 12px;
- color: #999999;
- }
- .brand img{
- width: 20px;
- height: 20px;
- margin-right: 5px;
- }
- .content {
- display: flex;
- align-items: center;
- padding: 25px 0;
- }
- .content img{
- width: 64px;
- height: 64px;
- border-radius: 8px;
- margin-right: 10px;
- }
- .item_msg {
- flex: 1;
- font-weight: 400;
- font-size: 14px;
- color: #666666;
- }
- .item_name {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-weight: 500;
- font-size: 16px;
- color: #222222;
- padding-bottom: 10px;
- }
- .item_step {
- font-weight: 500;
- font-size: 12px;
- color: #CCCCCC;
- }
- .item_btn {
- width: 100%;
- font-weight: bold;
- font-size: 14px;
- color: #FFFFFF;
- padding: 10px 0;
- background: #1677FF;
- border-radius: 10px;
- text-align: center;
- }
- .loading {
- text-align: center;
- margin-top: 10px;
- }
- .loading span {
- display: inline-block;
- width: 20px;
- height: 20px;
- border: 2px solid #409eff;
- border-left: transparent;
- animation: zhuan 0.5s linear infinite;
- border-radius: 50%;
- }
- @keyframes zhuan {
- 0% {
- transform: rotate(0);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
- .no_data {
- text-align: center;
- color: #999999;
- font-size: 14px;
- }
- </style>
- <body>
- <div id="box" class="box">
- <!-- 数据查看 -->
- <div class="page4">
- <div class="followup_list" v-infinite-scroll="getLoad" :infinite-scroll-disabled="disabled" style="overflow:auto">
- <div class="followup_item" v-for="(item, index) in followList" :key="index">
- <div class="brand">
- <img src="./img/wefan.png" alt="">
- <span>微分机器人</span>
- </div>
- <div class="content">
- <img :src="item.clientAvatar" />
- <div class="item_msg">
- <div class="item_name">
- <div>{{item.clientName}}</div>
- <div class="item_step">当前阶段:<span style="color: #1677FF;">{{item.step}}</span></div>
- </div>
- <div>该阶段停留时间超过{{item.day}}天</div>
- </div>
- </div>
- <div class="item_btn" @click="toShow(item)">查看</div>
- </div>
- <p v-if="loading" class="loading">
- <span></span>
- </p>
- <p v-if="noMore" class="no_data">没有更多了</p>
- </div>
- </div>
- </div>
- </body>
- <script>
- new Vue({
- el: '#box',
- data() {
- return {
- httpUrl: '',
- bId: null,
- env: '',
- memberId: null,
- page: 1,
- totalPages: 0,
- followList: [],
- loading: false,
- }
- },
- computed: {
- noMore() {
- //当起始页数大于总页数时停止加载
- return this.page >= this.totalPages - 1
- },
- disabled() {
- return this.loading || this.noMore
- }
- },
- created() {
- this.bId = this.getQueryParam('bId')
- this.env = this.getQueryParam('env')
- if (!this.env || this.env === 'prod') {
- this.httpUrl = 'https://wlapi.wefanbot.com'
- } else {
- this.httpUrl = 'http://test.wefanbot.com:18993'
- }
- if (this.getQueryParam('memberId')) {
- // 已授权
- this.memberId = this.getQueryParam('memberId')
- this.getFollowList()
- } else {
- // 授权
- this.getAuth()
- }
- // this.memberId = "woU17nDAAAnoSca19vZVKiNEKdc9tyYQ"
- // this.getFollowList()
- },
- methods: {
- getAuth() {
- fetch(this.httpUrl + `/p/insuite/p/getRedirectUri?env=${this.env}&bId=${this.bId}`)
- .then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- window.location.replace(data)
- } else {
- this.$message({
- message: msg,
- type: 'warning'
- })
- }
- })
- },
- getFollowList() {
- fetch(this.httpUrl + '/scrm/v1/wxcp-client-pro/p/stepNoticeList', {
- method: 'post',
- body: JSON.stringify({
- bid: this.bId,
- memberId: this.memberId,
- page: this.page,
- pageCount: 10,
- }),
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- this.followList = this.followList.concat(data.records)
- this.totalPages = data.pages
- this.loading = false
- } else {
- this.$message({
- message: msg,
- type: 'warning'
- })
- }
- })
- },
- getLoad() {
- //滑到底部时进行加载
- this.loading = true
- setTimeout(() => {
- this.page += 1
- this.getFollowList()
- }, 2000)
- },
- toShow(item) {
- window.location.href = `userProfile.html?bId=${item.bid}&env=${this.env}&memberId=${this.memberId}&externalUserId=${item.externalUserId}`
- },
- // 截取url中的数据
- getQueryParam(paramName) {
- // 获取当前URL的查询字符串部分
- const queryString = window.location.search;
- // 创建一个URLSearchParams对象
- const urlParams = new URLSearchParams(queryString);
- // 返回指定参数的值,如果不存在则返回null
- return urlParams.get(paramName);
- },
- }
- })
- </script>
- </html>
|