添加:商户中心 - 客户管理

This commit is contained in:
wuhui_zzw 2023-11-10 12:03:27 +08:00
parent 4edc1e0fee
commit e849f617a9
11 changed files with 533 additions and 21 deletions

View File

@ -688,3 +688,18 @@ export function hasServiceApi(id) {
export function getBankInfo() {
return request.get(`user/extract/history_bank`)
}
// 客户管理 - 获取客户列表
export function getCustomList(merId, data) {
return request.get("custom/list/"+merId, data);
}
// 客户管理 - 修改客户积分
export function customIntegralChange(merId, data) {
return request.post("custom/integral_change/"+merId, data);
}

View File

@ -185,6 +185,7 @@
});
})
.catch(res => {
console.log('Routine.getUserProfile catch',res);
uni.hideLoading();
});
},
@ -241,7 +242,8 @@
if (wx.getPrivacySetting) {
wx.getPrivacySetting({
success: res => {
console.log(res.needAuthorization)
console.log("wx.getPrivacySetting success");
console.log(res)
if (res.needAuthorization) {
//
this.canGetPrivacySetting = true
@ -252,7 +254,9 @@
this.onAgree()
}
},
fail: () => {},
fail: (err) => {
console.log('wx.getPrivacySetting Fail',err);
},
complete: () => {}
})
}else{

View File

@ -1,6 +1,6 @@
{
"name" : "CRMEB",
"appid" : "__UNI__99FC347",
"name" : "万马奔腾",
"appid" : "__UNI__FADD765",
"description" : "",
"versionName" : "1.0.4",
"versionCode" : 127,
@ -158,7 +158,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wx10df35b8f8f07887",
"appid" : "wx7aac64d4d4419260",
"setting" : {
"urlCheck" : false,
"minified" : true,

View File

@ -677,15 +677,24 @@
"navigationBarTextStyle": "#FFFFFF"
// #endif
}
}
},
// #ifdef H5
,{
{
"path": "scan/index",
"style": {
"navigationBarTitleText": "手机扫码上传"
}
}
},
// #endif
{
"path": "custom/index",
"style": {
"navigationBarTitleText": "客户管理"
}
}
]
},
{
@ -895,7 +904,7 @@
// "plugins": {
// "live-player-plugin": {
// "version": "1.3.2",
// "provider": "wx10df35b8f8f07887"
// "provider": "wx7aac64d4d4419260"
// }
// }
},

View File

@ -3,7 +3,7 @@
<view class='flash-sale'>
<view class='list'>
<view v-for="(item,index) in broadcastList" :key='index' >
<navigator hover-class="none" :url="((item.live_status == 103 && item.replay_status) || item.live_status === 101 || item.live_status === 102) ? 'plugin-private://wx10df35b8f8f07887/pages/live-player-plugin?room_id=' + item.room_id : ''">
<navigator hover-class="none" :url="((item.live_status == 103 && item.replay_status) || item.live_status === 101 || item.live_status === 102) ? 'plugin-private://wx7aac64d4d4419260/pages/live-player-plugin?room_id=' + item.room_id : ''">
<view class='item acea-row row-between-wrapper'>
<view class="live-image">
<img class="image" :src="item.share_img">

View File

@ -72,6 +72,13 @@
icon: 'iconfont icon-shangjiaguanli'
});
}
if(this.service.is_user){
list.push({
title: '用户管理',
url: '/pages/admin/custom/index?mer_id=' + merId,
icon: 'iconfont icon-kehu-xuanzhong'
});
}
return list;
}
},
@ -168,11 +175,12 @@
}
.business-content {
width: 100%;
padding: 0 18rpx;
padding: 0 calc((100% - (345rpx * 2)) / 3);
margin-top: 151rpx;
display: flex;
justify-content: space-around;
display: inline-flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
.listBox {
width: 345rpx;
height: 270rpx;

View File

@ -0,0 +1,476 @@
<template>
<view class="custom-content">
<!--顶部搜索框-->
<view class="search-content">
<view class="search-box">
<text class="iconfont icon-sousuo" @click="searchCustom()"></text>
<input class="search-input" type='number' placeholder='请输入会员昵称' v-model="search.nickname" @input="searchCustom()" />
</view>
</view>
<!-- 客户列表 -->
<view class="custom-list">
<view class="list-item" v-for="(item,index) in list" :key="index">
<view class="left-avatar">
<image v-if="item.avatar.length > 10" :src="item.avatar" mode="widthFix"/>
</view>
<view class="center-info">
<view class="info-top">
<view class="nickname">{{ item.nickname }}</view>
<view class="custom-id">{{ item.uid }}</view>
</view>
<view class="info-bottom">积分{{ item.merchant_integral }}</view>
</view>
<view class="right-btn">
<view class="give-btn" @click="showIntegralChangePopup(item)">赠送积分</view>
</view>
</view>
</view>
<!-- 积分变更弹框 -->
<uni-popup ref="integralChangePopup">
<view class="integral-change">
<view class="integral-change-content">
<view class="title">赠送积分</view>
<view class="form-content">
<view class="form-content-box">
<view class="box-title">变更数量</view>
<view class="box-value">
<input type='number' placeholder='输入变更数量' v-model="integral_change.number"/>
</view>
</view>
<view class="form-content-box">
<view class="box-title">变更凭证</view>
<view class="box-value">
<!--图片内容-->
<view class="image-img image-size-set" v-if="integral_change.voucher_image" @click="uploadImage">
<image class="image-img-image" :src="integral_change.voucher_image" mode="widthFix"></image>
<view class="change-image-btn">替换图片</view>
</view>
<!--上传图片按钮-->
<view class="upload-btn-box image-size-set" v-else @click="uploadImage">
<image class="upload-btn-icon" src="@/static/images/custom/creamer.png" mode="widthFix"></image>
上传凭证
</view>
</view>
</view>
</view>
<view class="submit-button">
<view class="submit-btn" @click="submitIntegralChange">提交</view>
</view>
</view>
</view>
</uni-popup>
<!-- 图片上传 -->
<avatar @upload="doUpload" quality="1" ref="avatar" selWidth="250upx" selHeight="250upx"></avatar>
</view>
</template>
<script>
import avatar from "@/components/yq-avatar/yq-avatar.vue";
import { HTTP_REQUEST_URL } from '@/config/app';
import { getCustomList,customIntegralChange } from "@/api/user.js";
export default {
name: 'custom',
components: {
avatar
},
data() {
return {
mer_id: 0,
list: [],
search:{
page: 1,
limit: 20,
nickname: '',
},
//
integral_change:{
uid: 0,
pm: 1,// 0 = 1 =
number: '',//
voucher_image: '',//
},
imgName: ""
}
},
computed: { },
onLoad: function(options) {
this.mer_id = options.mer_id || 0;
if(this.mer_id <= 0){
uni.showModal({
title: '提示',
content: '非法访问,参数不明确!',
success: function success(res) {
uni.navigateBack();
}
});
}
//
this.getCustom();
},
methods: {
//
getCustom(isRefresh = false) {
let _this = this;
//
if(isRefresh) {
_this.search.page = 1;
_this.list = [];
}
//
getCustomList(_this.mer_id, _this.search).then(res => {
let list = res.data.list || {};
if(Object.values(list).length > 0){
//
_this.list = _this.list.concat(list);
_this.search.page++;
}
}).catch(err => {
console.log("错误 catch",err);
})
},
//
searchCustom(){
this.$nextTick(()=>{
this.getCustom(true);
});
},
// -
showIntegralChangePopup(item){
let _this = this;
_this.integral_change = _this.$options.data().integral_change;
_this.integral_change.uid = item.uid;
_this.$refs.integralChangePopup.open('center');
},
// -
uploadImage() {
let avatar = this.$refs.avatar;
avatar.fChooseImg(1,{selWidth: '350upx', selHeight: '350upx', inner: true});
},
// -
doUpload(rsp) {
let _this = this
uni.uploadFile({
url: HTTP_REQUEST_URL + '/api/upload/image/field',
filePath: rsp.path,
name: 'field',
formData: {
'filename': rsp.path,
'name': _this.imgName
},
header: {
// #ifdef MP
"Content-Type": "multipart/form-data",
// #endif
// [TOKENNAME]: 'Bearer ' + store.state.app.token
},
success: (uploadFileRes) => {
let imgData = JSON.parse(uploadFileRes.data)
// console.log(imgData.data);
_this.integral_change.voucher_image = imgData.data.path || '';
}
});
},
//
submitIntegralChange(){
let _this = this;
//
let integralChangeInfo = Object.assign({},_this.integral_change);
let number = isNaN(parseFloat(integralChangeInfo.number)) ? 0 : parseFloat(integralChangeInfo.number);
if(number <= 0) {
uni.showModal({
title: '提示',
content: '请输入正确的变更数量!',
});
return false;
}
if(integralChangeInfo.voucher_image.length <= 0){
uni.showModal({
title: '提示',
content: '请上传凭证!',
});
return false;
}
//
customIntegralChange(_this.mer_id, integralChangeInfo).then(res => {
//
_this.$refs.integralChangePopup.close();
//
_this.getCustom(true);
//
uni.showModal({
title: '提示',
content: res.message,
});
}).catch(err => {
console.log("错误 catch",err);
})
},
//
loadingModel(){
uni.showLoading({
title: '加载中...',
mask: true
});
}
},
onReachBottom() {
this.getCustom()
}
}
</script>
<style scoped lang="scss">
.custom-content{
//
.search-content{
width: 100vw;
background: url("@/static/images/custom/custom_top_bg.jpg") no-repeat;
padding: 20rpx 30rpx;
.search-box{
width: 100%;
height: 70rpx;
padding: 10rpx 15rpx;
background: #FFFFFF;
border-radius: 10rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
font-size: 28rpx;
.icon-sousuo{
width: calc(70rpx - 15rpx);
padding-right: 15rpx;
height: calc(70rpx - (10rpx * 2));
line-height: calc(70rpx - (10rpx * 2));
text-align: center;
}
.search-input{
width: calc(100% - 70rpx + 15rpx);
height: calc(70rpx - (10rpx * 2));
}
}
}
//
.custom-list{
width: 100vw;
background: #FFFFFF;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: center;
.list-item:not(:last-child){
border-bottom: 2rpx solid #f6f6f6;
}
.list-item{
--item-height-value-: 100rpx;
width: 100vw;
padding: 20rpx 30rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.left-avatar{
width: 100rpx;
height: var(--item-height-value-);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
image{
width: 80rpx !important;
height: 80rpx !important;
border-radius: 50% !important;
}
}
.center-info{
width: calc(100% - 100rpx - 150rpx);
height: var(--item-height-value-);
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: flex-start;
justify-content: center;
padding-left: 10rpx;
.info-top{
width: 100%;
height: calc(100rpx - 40rpx);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
.nickname{
font-size: 28rpx;
}
.custom-id{
background: #ffeed5;
padding: 0rpx 8rpx;
border-radius: 50rpx;
font-size: 23rpx;
color: #f8cc88;
width: max-content;
height: 30rpx;
line-height: 30rpx;
margin-left: 10rpx;
}
}
.info-bottom{
width: 100%;
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
color: #9e9e9e;
}
}
.right-btn{
width: 150rpx;
height: var(--item-height-value-);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
.give-btn{
background: #ea9a1f;
padding: 6rpx 15rpx;
border-radius: 50rpx;
font-size: 26rpx;
color: #FFFFFF;
width: max-content;
}
}
}
}
//
.integral-change{
width: 100vw;
display: inline-flex;
flex-direction: row;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
.integral-change-content{
width: calc(100vw - (20rpx * 2) - (30rpx * 2));
background: #FFFFFF;
border-radius: 20rpx;
padding: 20rpx;
.title{
width: 100%;
text-align: center;
font-size: 30rpx;
font-weight: 600;
height: 60rpx;
line-height: 45rpx;
margin-bottom: 35rpx;
}
.form-content{
width: 100%;
display: inline-flex;
flex-direction: column;
justify-content: center;
flex-wrap: nowrap;
align-items: flex-start;
.form-content-box:not(:last-child){
margin-bottom: 20rpx;
}
.form-content-box{
--box-width-: 180rpx;
width: 100%;
display: inline-flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: nowrap;
align-items: center;
line-height: 60rpx;
.box-title{
width: var(--box-width-);
text-align: right;
font-size: 28rpx;
}
.box-value{
width: calc(100% - var(--box-width-));
.image-size-set{
width: 210rpx;
height: 210rpx;
border: 2rpx solid #dddddd;
border-radius: 8rpx;
display: inline-flex;
flex-direction: row;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
image{
max-width: 100% !important;
max-height: 100% !important;
}
}
.upload-btn-box{
font-size: 24rpx;
color: #999999;
display: inline-flex;
flex-direction: column!important;
justify-content: center;
flex-wrap: nowrap;
align-items: center;
.upload-btn-icon{
width: 45rpx !important;
}
}
}
}
.image-img{
position: relative;
border: unset!important;
.change-image-btn{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
font-size: 24rpx!important;
height: 40rpx;
line-height: 40rpx;
background: rgba(0,0,0,.5);
color: #FFFFFF;
}
}
}
.submit-button{
width: 100%;
margin-top: 60rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
.submit-btn{
color: #fff;
background-color: #437ffd;
border-color: #437ffd;
padding: 10rpx 25rpx;
font-size: 24rpx;
border-radius: 6rpx;
}
}
}
}
}
</style>

View File

@ -14,7 +14,7 @@
<view class="live-wrapper mores">
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex">
<view class="item" v-for="(item, index) in liveList" :key="index">
<navigator hover-class="none" :url="'plugin-private://wx10df35b8f8f07887/pages/live-player-plugin?room_id=' + item.room_id">
<navigator hover-class="none" :url="'plugin-private://wx7aac64d4d4419260/pages/live-player-plugin?room_id=' + item.room_id">
<view
class="live-top"
:style="'background:' + (item.live_status == 101 ? playBg : item.live_status != 101 && item.live_status != 102 ? endBg : notBg) + ';'"
@ -46,7 +46,7 @@
</block>
<block v-if="listStyle == 1">
<view class="live-wrapper-a">
<navigator class="live-item-a" v-for="(item,index) in liveList" :key="index" :url="'plugin-private://wx10df35b8f8f07887/pages/live-player-plugin?room_id=' + item.room_id" hover-class="none">
<navigator class="live-item-a" v-for="(item,index) in liveList" :key="index" :url="'plugin-private://wx7aac64d4d4419260/pages/live-player-plugin?room_id=' + item.room_id" hover-class="none">
<view class="img-box">
<view class="label bgblue" v-if="item.live_status == 102">
<view class="txt">预告</view>
@ -98,7 +98,7 @@
</block>
<block v-if="listStyle == 2">
<view class="live-wrapper-b">
<navigator class="live-item-b" v-for="(item,index) in liveList" :key="index" :url="'plugin-private://wx10df35b8f8f07887/pages/live-player-plugin?room_id=' + item.room_id" hover-class="none" :style="[{'box-shadow':`0px 1px 20px ${boxShadow}`}]">
<navigator class="live-item-b" v-for="(item,index) in liveList" :key="index" :url="'plugin-private://wx7aac64d4d4419260/pages/live-player-plugin?room_id=' + item.room_id" hover-class="none" :style="[{'box-shadow':`0px 1px 20px ${boxShadow}`}]">
<view class="img-box">
<view class="label bgblue" v-if="item.live_status == 102">
<view class="txt">预告</view>
@ -195,7 +195,7 @@
res.data.list.forEach(val => {
val.link =
(val.live_status == 103 && val.replay_status) || val.live_status === 101 || val.live_status === 102
? 'plugin-private://wx10df35b8f8f07887/pages/live-player-plugin?room_id=' + val.room_id
? 'plugin-private://wx7aac64d4d4419260/pages/live-player-plugin?room_id=' + val.room_id
: '';
});
that.$set(that,'liveList',res.data.list)

View File

@ -45,7 +45,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.14.3",
"appid": "wx10df35b8f8f07887",
"appid": "wx7aac64d4d4419260",
"projectname": "crmeb_merchant_h5",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB