This commit is contained in:
zmj 2024-04-29 23:05:49 +08:00
parent 0aed25b996
commit 448733a1c8
3 changed files with 135 additions and 118 deletions

33
App.vue
View File

@ -1,6 +1,6 @@
<script> <script>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -16,7 +16,9 @@
checkLogin checkLogin
} from "./libs/login"; } from "./libs/login";
import { import {
getUserInfo getUserInfo
} from '@/api/user.js'; } from '@/api/user.js';
import { import {
parseToken parseToken
@ -89,6 +91,16 @@
// //
console.log('消息成功' + JSON.stringify(option)); console.log('消息成功' + JSON.stringify(option));
}); });
uni.onHostEventReceive((event, data) => {
if (event == 'tocustomlist') {
uni.switchTab({
url: '/pages/chat/customer_list/index'
});
}
});
// #endif // #endif
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
@ -120,6 +132,10 @@
if (option?.referrerInfo?.extraData?.uniMP) { if (option?.referrerInfo?.extraData?.uniMP) {
uni.setStorageSync('uniMP', option.referrerInfo?.extraData?.uniMP); uni.setStorageSync('uniMP', option.referrerInfo?.extraData?.uniMP);
// this.$store.commit("LOGIN", {
// 'token': option.referrerInfo?.extraData?.token,
// 'time': 604800
// });
parseToken({ parseToken({
token: option.referrerInfo?.extraData?.token token: option.referrerInfo?.extraData?.token
}).then((res) => { }).then((res) => {
@ -133,6 +149,7 @@
'token': option.referrerInfo?.extraData?.token, 'token': option.referrerInfo?.extraData?.token,
'time': 604800 'time': 604800
}); });
console.log('TOKEN解析错误:', err);
this.$isResolve() this.$isResolve()
}) })
} else { } else {
@ -405,8 +422,7 @@
//console.log('App Hide') //console.log('App Hide')
}, },
watch: { watch: {
// https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/40390202404250914319725.mp4 // H5
// H5?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast
$route(n) { $route(n) {
if (this.$store.state.app.token) { if (this.$store.state.app.token) {
// //
@ -428,21 +444,10 @@
@import 'static/css/style.scss'; @import 'static/css/style.scss';
//
* {
scrollbar-color: #e5e5e500 #f7f7f9 !important;
}
view { view {
box-sizing: border-box; box-sizing: border-box;
} }
.c_active {
&:active {
opacity: .8;
}
}
.custom_style { .custom_style {
color: #fff; color: #fff;
display: flex; display: flex;

View File

@ -12,7 +12,8 @@
<view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 4">[商品]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 4">[商品]</view>
<view class="con line1" v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view> <view class="con line1"
v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view>
</view> </view>
<view class="right-box"> <view class="right-box">
<view class="time">{{item.last && item.last.create_time.split(' ')[1] || ''}}</view> <view class="time">{{item.last && item.last.create_time.split(' ')[1] || ''}}</view>
@ -23,15 +24,18 @@
<block v-if="type == 1 && list.length>0" v-for="(item,index) in list" :key="index"> <block v-if="type == 1 && list.length>0" v-for="(item,index) in list" :key="index">
<div class="item acea-row" @click="goPage(item)"> <div class="item acea-row" @click="goPage(item)">
<view class="logo"> <view class="logo">
<image :src="(item.user && item.user.avatar) ? item.user.avatar : '/static/images/f.png'" mode=""></image> <image :src="(item.user && item.user.avatar) ? item.user.avatar : '/static/images/f.png'"
mode=""></image>
</view> </view>
<view class="info"> <view class="info">
<view class="name">{{item.user && item.user.nickname}}</view> <view class="name">{{item.user && item.user.nickname}}</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 1">{{item.last.msn}}</view> <view class="con line1" v-if="item.last && item.last.msn_type == 1">{{item.last.msn}}</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view>
<view class="con line1" v-if="item.last && (item.last.msn_type == 4 || item.last.msn_type == 7)">[商品]</view> <view class="con line1"
<view class="con line1" v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view> v-if="item.last && (item.last.msn_type == 4 || item.last.msn_type == 7)">[商品]</view>
<view class="con line1"
v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view>
</view> </view>
<view class="right-box"> <view class="right-box">
<view class="time">{{item.last && item.last.create_time.split(' ')[1]}}</view> <view class="time">{{item.last && item.last.create_time.split(' ')[1]}}</view>
@ -65,10 +69,12 @@
import { import {
getUserInfo getUserInfo
} from '@/api/user.js'; } from '@/api/user.js';
import { mapGetters } from "vuex"; import {
mapGetters
} from "vuex";
export default { export default {
name: "CustomerList", name: "CustomerList",
components:{ components: {
emptyPage, emptyPage,
authorize authorize
}, },
@ -77,10 +83,10 @@
list: [], list: [],
productId: 0, productId: 0,
orderId: "", orderId: "",
type: 0 ,// 0 1 type: 0, // 0 1
timer: null, timer: null,
page:1, page: 1,
limit:9999, limit: 9999,
mer_id: '', mer_id: '',
loading: false, loading: false,
clear: false, clear: false,
@ -88,28 +94,28 @@
isShowAuth: false, // isShowAuth: false, //
}; };
}, },
computed: mapGetters(['isLogin','viewColor']), computed: mapGetters(['isLogin', 'viewColor']),
onLoad(optios) { onLoad(optios) {
this.type = optios.type||1; this.type = optios.type || 1;
this.getindex()
}, },
onShow(option) { onShow(option) {
if(this.isLogin){ if (this.isLogin) {
this.liveUpdate(); this.liveUpdate();
} else { } else {
this.isAuto = true; this.isAuto = true;
this.isShowAuth = true this.isShowAuth = true
} }
this.getindex()
}, },
onHide(){ onHide() {
if(this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
this.clear = true; this.clear = true;
}, },
onUnload() { onUnload() {
if(this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
@ -117,29 +123,29 @@
}, },
methods: { methods: {
// //
getindex(){ getindex() {
getUserInfo().then(res => { getUserInfo().then(res => {
if (res.data.mer_info.length == 0) { if (res.data.mer_info.length == 0) {
return uni.showModal({ return uni.showModal({
title: '暂未开通商户', title: '暂未开通商户',
complete(res) { complete(res) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.sendHostEvent('closeApp', (ret) => { uni.sendHostEvent('closeApp', (ret) => {
// //
console.log('关闭应用' + JSON.stringify(ret)); console.log('关闭应用' + JSON.stringify(ret));
}); });
// #endif // #endif
} }
}) })
} }
this.mer_id = res.data.service.mer_id; this.mer_id = res.data.service.mer_id;
if(this.isLogin){ if (this.isLogin) {
this.getList(this.mer_id) this.getList(this.mer_id)
} else { } else {
this.isAuto = true; this.isAuto = true;
this.isShowAuth = true this.isShowAuth = true
} }
// this.getList(this.mer_id) // this.getList(this.mer_id)
// this.getList(res.data.service.mer_id, true); // this.getList(res.data.service.mer_id, true);
}); });
}, },
@ -154,20 +160,20 @@
}, },
getList(mer_id) { getList(mer_id) {
this.loading = true; this.loading = true;
if(this.type == 0){ if (this.type == 0) {
serviceList({ serviceList({
page:this.page, page: this.page,
limit:this.limit limit: this.limit
}).then(res => { }).then(res => {
this.list = res.data.list; this.list = res.data.list;
if(res.status == 400){ if (res.status == 400) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
return this.$util.Tips({ return this.$util.Tips({
title: res.message title: res.message
}) })
} }
}).finally(v=>{ }).finally(v => {
this.loading = false; this.loading = false;
return this.$util.Tips({ return this.$util.Tips({
title: v title: v
@ -177,20 +183,20 @@
title: err title: err
}) })
}); });
}else{ } else {
serviceUserList(mer_id,{ serviceUserList(mer_id, {
page:this.page, page: this.page,
limit:this.limit limit: this.limit
}).then(res =>{ }).then(res => {
this.list = res.data.list; this.list = res.data.list;
if(res.status == 400){ if (res.status == 400) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
return this.$util.Tips({ return this.$util.Tips({
title: res.message title: res.message
}) })
} }
}).finally(v=>{ }).finally(v => {
this.loading = false; this.loading = false;
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
@ -207,29 +213,29 @@
} }
}, },
// //
liveUpdate(){ liveUpdate() {
let that = this; let that = this;
this.clear = false; this.clear = false;
if(that.timer) { if (that.timer) {
clearInterval(that.timer); clearInterval(that.timer);
that.timer = null; that.timer = null;
} }
that.timer = setInterval(function(){ that.timer = setInterval(function() {
if(that.clear){ if (that.clear) {
clearInterval(that.timer); clearInterval(that.timer);
return ; return;
} }
// //
(!that.loading) && that.getList(that.mer_id); (!that.loading) && that.getList(that.mer_id);
},5000); }, 5000);
}, },
goPage(item) { goPage(item) {
item.num = 0; item.num = 0;
if(this.type == 0){ if (this.type == 0) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/chat/customer_list/chat?mer_id=${item.mer_id}` url: `/pages/chat/customer_list/chat?mer_id=${item.mer_id}`
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/chat/customer_list/chat?userId=${item.user.uid}&mer_id=${item.mer_id}` url: `/pages/chat/customer_list/chat?userId=${item.user.uid}&mer_id=${item.mer_id}`
}) })
@ -248,7 +254,8 @@
transform: rotate(180deg); transform: rotate(180deg);
font-size: 36rpx; font-size: 36rpx;
} }
.popupn{
.popupn {
position: fixed; position: fixed;
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -258,65 +265,78 @@
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
z-index: 100; z-index: 100;
.title{
.title {
max-width: 560rpx; max-width: 560rpx;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
} }
.iconfont{
.iconfont {
display: inline-block; display: inline-block;
position: relative; position: relative;
top: 4rpx; top: 4rpx;
right: 0; right: 0;
} }
.mer_logo{
.mer_logo {
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
position: relative; position: relative;
top: 6rpx; top: 6rpx;
right: 10px; right: 10px;
} }
.mer_name{
.mer_name {
display: inline-block; display: inline-block;
max-width: 650rpx; max-width: 650rpx;
} }
.invoice-content{
.invoice-content {
background-color: #ffffff; background-color: #ffffff;
} }
} }
.list_count{
.list_count {
margin-top: 104rpx; margin-top: 104rpx;
} }
.item { .item {
align-items: center; align-items: center;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
.logo image{
.logo image {
width: 88rpx; width: 88rpx;
height: 88rpx; height: 88rpx;
border-radius: 50%; border-radius: 50%;
} }
.info{
.info {
width: 334rpx; width: 334rpx;
margin-left: 20rpx; margin-left: 20rpx;
.con{
.con {
margin-top: 10rpx; margin-top: 10rpx;
color: #999999; color: #999999;
font-size: 24rpx; font-size: 24rpx;
} }
} }
.right-box{
.right-box {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
font-size: 20rpx; font-size: 20rpx;
color: #BBBBBB; color: #BBBBBB;
.time{
.time {
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.num{
.num {
min-width: 6px; min-width: 6px;
background-color: var(--view-theme); background-color: var(--view-theme);
border-radius: 15px; border-radius: 15px;

View File

@ -17,10 +17,8 @@
</u-form-item> </u-form-item>
<view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;"> <view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;">
<view class="" style="display: flex;flex-wrap: wrap;"> <view class="" style="display: flex;flex-wrap: wrap;">
<view v-for="(item,index) in formData.imageList" <view v-for="(item,index) in formData.imageList"
style="margin-right: 20rpx;margin-bottom: 20rpx;"> style="margin-right: 20rpx;margin-bottom: 20rpx;">
<view class="video_list" v-if='vidioTypeList.includes(getSuffix(item))'> <view class="video_list" v-if='vidioTypeList.includes(getSuffix(item))'>
<view class="video_list_item photo" style="position: relative;"> <view class="video_list_item photo" style="position: relative;">
<view class="jiao"> <view class="jiao">
@ -46,8 +44,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" style="position: relative;" v-else> <view class="" style="position: relative;" v-else>
<view class="jiao" @click="formData.imageList.splice(index,1)"> <view class="jiao" @click="formData.imageList.splice(index,1)">
<image src="@/static/images/gban.png" mode="widthFix"></image> <image src="@/static/images/gban.png" mode="widthFix"></image>
@ -57,10 +53,7 @@
</view> </view>
</view> </view>
<view class='uploadimg' @click="show=true,isDetail=false"> <view class='uploadimg' @click="show=true,isDetail=false">
<!-- <view class='uploadimg'> -->
<u-icon name="plus" color="#777777"></u-icon> <u-icon name="plus" color="#777777"></u-icon>
<view class="" style="color: #777777;font-size: 20rpx;"> <view class="" style="color: #777777;font-size: 20rpx;">
上传图片/视频 上传图片/视频
@ -823,7 +816,6 @@
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx 0; padding: 20rpx 0;
/* margin-left: 20rpx; */
overflow: hidden; overflow: hidden;
} }