修改会员管理

version/0412
liudan 11 months ago
parent 14a7395928
commit b4a4457e6f
  1. 8
      api/user/vip.js
  2. 94
      pages/news/user/index.vue
  3. 16
      pages/news/user/vip.vue
  4. 1
      pages/news3/shopDealerOrder.vue
  5. 8
      pages/news3/shopOrder.vue
  6. 2
      pages/user/index.vue

@ -5,7 +5,8 @@ const api = {
brandList: 'goods/brandList',
category: 'category/list',
getImage: 'goods/getCommonConfig',
vipList:'user/list'
vipList:'user/list',
updateVip:'user/updateUser'
}
// 大牌
@ -24,3 +25,8 @@ export const getImage = (data) => {
export const getVipList = (data) => {
return request.get(api.vipList, data)
}
//修改会员信息
export const updateVip = (data) => {
return request.get(api.updateVip, data)
}

@ -1,7 +1,7 @@
<template>
<view class="user">
<view class="order-navbar">
<u-navbar title="会员管理" :border-bottom="false" :background="background"></u-navbar>
<u-navbar :title="title" :border-bottom="false" :background="background"></u-navbar>
</view>
<view class="user-hd">
<view class="avater">
@ -16,16 +16,16 @@
</view>
<view class="user-show">
<view class="a">
<text>余额(</text>¥{{form.expend_money?form.expend_money:0.00}}
<text>余额(</text>¥{{form.balance?form.balance:0.00}}
</view>
<view class="a">
<text>积分(</text>{{form.grade?form.grade:0.00}}
<text>积分(</text>{{form.points?form.points:0.00}}
</view>
</view>
<view class="user-order">
<view class="user-order" @click="goJump()">
<view class="a">关联订单</view>
<view class="b">
<view class="num">99+</view>
<view class="num" v-show="total>0">{{total}}</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
@ -34,18 +34,18 @@
<view class="b">编辑信息</view>
</view>
<view class="user-bd">
<view class="item">
<!-- <view class="item">
<view class="a">登录密码</view>
<view class="b"><view class="select select-on">****</view></view>
</view>
</view> -->
<view class="item">
<view class="a">上级推广人</view>
<view class="b">
<view class="select select-on">张三</view>
<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon>
<view class="select select-on">{{form.inviter?form.inviter.nick_name:''}}</view>
<!-- <u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon> -->
</view>
</view>
<view class="item">
<!-- <view class="item">
<view class="a">用户分组</view>
<view class="b">
<view class="select">请选择用户分组</view>
@ -65,10 +65,13 @@
<view class="b">
指定分销模式下开启或关闭用户的推广权限
</view>
</view>
</view> -->
<view class="items">
<view class="a">推广权限
<u-switch v-model="checked" active-color="#55BD6A" ></u-switch></view>
<u-switch v-model="form.is_allow_promotion"
:activeValue="1" :inactiveValue="0"
active-color="#55BD6A" ></u-switch>
</view>
<view class="b">
指定分销模式下开启或关闭用户的推广权限
</view>
@ -76,11 +79,13 @@
<view class="item">
<view class="a">用户状态</view>
<view class="b">
<u-switch v-model="checked" active-color="#55BD6A" ></u-switch>
<u-switch v-model="form.status"
:activeValue="1" :inactiveValue="0"
active-color="#55BD6A" ></u-switch>
</view>
</view>
</view>
<view class="user-fd">
<view class="user-fd" @click="updateVipHandle">
<view class="b">
确认修改
</view>
@ -89,6 +94,8 @@
</template>
<script>
import * as Vip from '@/api/user/vip'
import * as newFunApi from '@/api/newFun'
// import img from "@/static/news/login-bg.png"
export default {
data() {
@ -107,6 +114,8 @@
gender: "",
grade: null,
grade_id: null,
inviter:null,
is_allow_promotion:null,
is_delete: null,
last_login_time: null,
mobile: "",
@ -115,6 +124,7 @@
platform: "",
points: null,
province: null,
status:null,
store_id: null,
update_time: "",
user_id: null,
@ -128,6 +138,8 @@
// background: 'url('+ img+') center top no-repeat',
backgroundSize: '100% auto',
},
title:'会员管理',
total:0
}
},
@ -139,12 +151,55 @@
}
},
methods: {
goJump(){
if(this.title=='会员管理'){
uni.navigateTo({
url:"/pages/news3/shopOrder?user_id="+this.form.user_id
})
}else{
uni.navigateTo({
url:"/pages/news3/shopDealerOrder?user_id="+this.form.user_id
})
}
},
async updateVipHandle(){
let params={
"user_id":this.form.user_id,
"status":this.form.status?1:0,
"is_allow_promotion":this.form.is_allow_promotion?1:0,
}
let res = await Vip.updateVip(params)
if(res.status==200){
uni.showToast({
title: '修改成功'
});
}
},
},
onLoad(option) {
async onLoad(option) {
console.log(option)
this.form = Object.assign({},this.form,JSON.parse(option.item))
console.log(this.form)
this.form.is_allow_promotion = this.form.is_allow_promotion==1?true:false
this.form.status = this.form.status==1?true:false;
this.title = option.title;
if(this.title=='会员管理'){
let {
status,
message,
data
} = await newFunApi.shopOrderList({
dataType: 'all',
page: 1,
});
if (status == 200) {
this.total = data.list.total
}
}else{
this.total=0
}
}
}
</script>
@ -188,9 +243,10 @@
align-items: center;
text{
display: block;
width: 98rpx;
// width: 98rpx;
border: 1px solid #FFB950;
height: 40rpx;
// height: 40rpx;
padding:0 10rpx;
font-size: 28rpx;
font-weight: 400;
color: #FFB343;

@ -5,7 +5,7 @@
<image src="/static/news/icon-search.png"></image>
<input type="search" placeholder="商品名称/编码" />
</view> -->
<u-search placeholder="输入用户昵称/姓名/手机号" shape="round" :show-action="false" height="60" bg-color="#ffffff" v-model="keyword"></u-search>
<u-search placeholder="输入用户昵称/姓名/手机号" @search="searchhandle" shape="round" :show-action="false" height="60" bg-color="#ffffff" v-model="keyword"></u-search>
</view>
<view class="user-bd">
<view class="li" v-for="i in list" :key="i.user_id" @click="goVipDetails(i)">
@ -22,9 +22,9 @@
<view class="n">
<view>
<text>{{i.mobile}}</text>
<image @click="copyText(i.mobile)" :src="$picUrl+'/static/news/icon-copy.png'" style="margin-top:-4rpx;"></image>
<image @click.stop="copyText(i.mobile)" :src="$picUrl+'/static/news/icon-copy.png'" style="margin-top:-4rpx;"></image>
</view>
<image :src="$picUrl+'/static/news/tel.png'" @click="makeCall(i.mobile)"></image>
<image :src="$picUrl+'/static/news/tel.png'" @click.stop="makeCall(i.mobile)"></image>
</view>
</view>
<!-- <view class="m">
@ -38,7 +38,7 @@
</view> -->
</view>
<view class="b">
<view class="l">余额(<text>¥{{i.points?i.points:0.00}}</text></view>
<view class="l">余额(<text>¥{{i.balance?i.balance:0.00}}</text></view>
<view class="l">积分(<text>{{i.points?i.points:0}}</text></view>
</view>
</view>
@ -79,6 +79,12 @@
};
},
methods: {
searchhandle(){
this.list=[]
this.page = 1;
this.getList()
},
async getList(){
let res = await Vip.getVipList({page:this.page,search:this.keyword,user_type:this.title=='会员管理'?"10,20":'30'})
console.log(res,"===")
@ -141,7 +147,7 @@
goVipDetails(item){
let details = JSON.stringify(item)
uni.navigateTo({
url:"/pages/news/user/index?item="+details
url:"/pages/news/user/index?item="+details+"&title="+this.title
})
}
},

@ -251,6 +251,7 @@ export default {
// console.log(options);
this.classifyShow=options.type;
this.getList();
console.log("会员管理带来的user_id",options.user_id)
},
onPageScroll(e){

@ -83,11 +83,11 @@
下单时间
</view>
<view class="timeContainer">
<view class="selectTime" v-model="startTime" type="select" @click="onTime()">
<view class="selectTime" type="select" @click="onTime()">
{{startTime?startTime:'起始时间'}}
</view>
<text>-</text>
<view class="selectTime" v-model="endTime" type="select" @click="onTime()">
<view class="selectTime" type="select" @click="onTime()">
{{endTime?endTime:'终止时间'}}
</view>
</view>
@ -267,8 +267,8 @@
}
this.getList()
},
onLoad() {
onLoad(option) {
console.log("会员管理带来的user_id",option.user_id)
},
methods: {
reset() {

@ -115,7 +115,7 @@
<view class="sell">
会员分销
</view>
<view class="type" @click="goJump('/pages/news/user/vip')">
<view class="type" @click="goManagementHandle('/pages/news/user/vip','会员管理')">
<view class="typeLeft common">
会员管理<u-icon style="margin-left: 10rpx;" name="arrow-right"></u-icon>
</view>

Loading…
Cancel
Save