| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- <!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>
- <!-- 引入样式文件 -->
- <link rel="stylesheet"
- href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012584633/vant.css" />
- <link rel="stylesheet" href="../css/page-return.css">
- <!-- 必须先引入vue, 后使用vant-ui -->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
- <!-- 引入vant的组件库-->
- <!-- 引入 Vant 的 JS 文件 -->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012748487/vant.min.js"></script>
- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
- <script src="../js/page-return.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: #F7F9FC;
- }
- .page5 {
- width: 100vw;
- box-sizing: border-box;
- padding: 15px;
- padding-bottom: 39px;
- }
- .client_top {
- width: 100%;
- height: 70px;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1;
- background: #FFFFFF;
- }
- .client_top_box {
- padding: 15px 15px 0px;
- }
- .search_icon {
- width: 24px;
- height: 24px;
- }
- .search_input {
- padding: 0;
- }
- .search_input .van-search__content {
- padding: 0;
- border-radius: 19px;
- }
- .search_input .van-cell {
- padding: 0;
- }
- .search_input .van-field__body {
- display: flex;
- align-items: center;
- position: relative;
- }
- .search_input .van-field__body input{
- border: none;
- width: 100%;
- height: 40px;
- background: #FAFAFA;
- padding: 10px 36px 10px 15px;
- border-radius: 19px;
- }
- .search_input .van-field__body input:focus {
- outline: none;
- }
- .search_input .van-field__body .van-field__right-icon{
- position: absolute;
- right: 12px;
- }
- .task_list {
- width: 100%;
- height: calc(100vh - 109px);
- position: absolute;
- top: 70px;
- left: 0;
- z-index: 1;
- background: #F7F9FC;
- overflow: auto;
- padding-bottom: 60px;
- box-sizing: border-box;
- }
- .task_content {
- padding: 15px;
- }
- .task_item {
- width: 100%;
- background: #FFFFFF;
- border-radius: 15px;
- border: 1px solid #FFFFFF;
- box-sizing: border-box;
- margin-bottom: 10px;
- padding: 15px;
- }
- .task_item:last-child {
- margin-bottom: 0;
- }
- .task_item_title {
- display: flex;
- justify-content: space-between;
- font-weight: 500;
- font-size: 16px;
- color: #222222;
- line-height: 20px;
- }
- .task_item_name {
- width: 160px;
- /* 必须设置宽度 */
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .client_tag {
- font-size: 12px;
- line-height: 17px;
- }
- .task_item_time {
- font-size: 12px;
- color: #999999;
- line-height: 17px;
- padding-top: 8px;
- }
- .notask {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding-top: 198px;
- }
- .notask img {
- width: 102px;
- height: 90px;
- }
- .notask_text {
- font-size: 14px;
- color: #CCCCCC;
- line-height: 20px;
- padding-top: 20px;
- }
- .send_foot {
- position: absolute;
- bottom: 39px;
- left: 0;
- width: 100%;
- z-index: 2;
- }
- .send_btn {
- font-weight: 500;
- font-size: 14px;
- color: #FFFFFF;
- line-height: 20px;
- padding: 15px 0;
- border-radius: 20px;
- background: #1677FF;
- margin: 0 35px;
- text-align: center;
- }
- .status1 {
- color: #136DFB;
- }
- .status2 {
- color: #FFA041;
- }
- .status3 {
- color: #FF4141;
- }
- </style>
- <body>
- <div id="box" class="box">
- <div class="page5">
- <div v-if="tableData.length">
- <div class="client_top">
- <div class="client_top_box">
- <van-search class="search_input" placeholder="搜索客户昵称/客户群昵称" v-model="keyword" :clearable="false" left-icon="" @search="initData">
- <!-- 自定义右侧图标 -->
- <template v-slot:right-icon>
- <img class="search_icon" src="../img/qw/search_icon.png" alt="" @click="initData" />
- </template>
- </van-search>
- </div>
- </div>
- <div class="task_list">
- <div class="task_content">
- <div class="task_item" v-for="item in tableData" :key="item.id" @click="handleClientMassDetail(item)">
- <div class="task_item_title">
- <div class="task_item_name">{{item.name}}</div>
- <div v-if="item.isNotify === -2" class="client_tag status3">无符合条件客户</div>
- <div v-else-if="item.isNotify === -1" class="client_tag status3">创建失败</div>
- <div v-else-if="item.isNotify === 0" class="client_tag status2">待通知</div>
- <div v-else-if="item.isNotify === 1" class="client_tag status1">已通知</div>
- <div v-else-if="item.isNotify === 3" class="client_tag status2">创建中</div>
- </div>
- <div class="task_item_time">创建时间:{{item.createdTime}}</div>
- </div>
- </div>
- </div>
- <div class="send_foot">
- <div class="send_btn" @click="handleClientMass">创建客户群发</div>
- </div>
- </div>
- <div class="notask" v-else>
- <img src="../img/qw/no_task.png" alt="">
- <div class="notask_text">暂无数据</div>
- </div>
- </div>
- <!-- 底部返回栏 -->
- <page-return></page-return>
- </div>
- </body>
- <script>
- new Vue({
- el: '#box',
- data() {
- return {
- httpUrl: '',
- bId: null,
- env: '',
- token: null,
- tenancyId: null,
- userId: null,
- memberId: null,
- keyword: '',
- tableData: [],
- }
- },
- created() {
- this.bId = this.getQueryParam('bId')
- this.env = this.getQueryParam('env')
- this.memberId = this.getQueryParam('memberId')
- if (!this.env || this.env === 'prod') {
- this.httpUrl = 'https://wlapi.wefanbot.com'
- } else {
- this.httpUrl = 'http://test.wefanbot.com:18993'
- }
- this.token = localStorage.getItem('tokenValue')
- this.tenancyId = localStorage.getItem('tenancyIdValue')
- this.userId = localStorage.getItem('userId')
- this.initData()
- },
- methods: {
- initData() {
- const headers = new Headers()
- headers.append('token', this.token)
- headers.append('tenancyId', this.tenancyId)
- headers.append('userId', this.userId)
- fetch(this.httpUrl + '/scrm/v1/wxcp-send/m/findListByPage', {
- method: 'post',
- body: JSON.stringify({
- keyword: this.keyword,
- page: 1,
- pageCount: 1000,
- }),
- headers: {
- 'Content-Type': 'application/json',
- 'token': this.token,
- 'tenancyId': this.tenancyId,
- 'userId': this.userId,
- }
- }).then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- this.tableData = data.records || []
- this.tableData.forEach(item => {
- item.createdTime = this.timeFormat(item.createdTime)
- })
- } else {
- vant.Toast.fail(msg)
- }
- })
- },
- onSearch() {
- this.initData()
- },
- handleClientMassDetail(item) {
- window.location.href = `clientMassDetail.html?bId=${this.bId}&env=${this.env}&id=${item.id}`
- },
- handleClientMass() {
- window.location.href = `clientMass.html?bId=${this.bId}&env=${this.env}&memberId=${this.memberId}`
- },
- timeFormat(time, format = 'yyyy-MM-dd hh:mm:ss') {
- if (time === undefined || time === '' || time === null) {
- return '/';
- }
- const date = new Date(time);
- const o = {
- 'M+': date.getMonth() + 1, // 月份
- 'd+': date.getDate(), // 日
- 'h+': date.getHours(), // 小时
- 'm+': date.getMinutes(), // 分钟
- 's+': date.getSeconds(), // 秒
- 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
- 'S': date.getMilliseconds() // 毫秒
- };
- // 处理年份
- if (/(y+)/.test(format)) {
- format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
- }
- // 处理日期和时间部分
- for (let k in o) {
- if (new RegExp('(' + k + ')').test(format)) {
- let value = o[k];
- let padding = RegExp.$1.length === 1 ? '' : '00'; // 根据格式字符串中的长度决定是否补零
- format = format.replace(RegExp.$1, ('' + value).padStart(padding.length + value.toString().length - value.toString().length, '0'));
- }
- }
- // 如果格式只包含时间部分,移除日期部分可能的占位符
- if (!/(M+|d+)/.test(format)) {
- // 移除任何可能存在的日期占位符(如:'yyyy-MM-dd ')
- format = format.replace(/(\s*-\s*){2}/g, ''); // 移除两个'-'之间的任何内容
- format = format.replace(/^\s*yyyy-\s*/, ''); // 移除开头的'yyyy-'
- }
- // 如果格式只包含日期部分,移除时间部分可能的占位符
- if (!/(h+|m+|s+)/.test(format)) {
- // 移除任何可能存在的时间占位符(如:' hh:mm:ss')
- format = format.replace(/(\s*:\s*){2}/g, ''); // 移除两个':'之间的任何内容
- format = format.replace(/\s*hh:\s*$/, ''); // 移除结尾的' hh:'
- }
- return format;
- },
- // 截取url中的数据
- getQueryParam(paramName) {
- // 获取当前URL的查询字符串部分
- const queryString = window.location.search;
- // 创建一个URLSearchParams对象
- const urlParams = new URLSearchParams(queryString);
- // 返回指定参数的值,如果不存在则返回null
- return urlParams.get(paramName);
- },
- }
- })
- </script>
- </html>
|