uniapp 会员权益

pull/2/head
Jruome 2023-05-24 16:59:54 +08:00
parent 9ccba3d554
commit b18ed2551c
14 changed files with 380 additions and 106 deletions

View File

@ -143,6 +143,15 @@ export function shippingRegion(data) {
})
}
// 物流运费模板指定不配送
export function shippingNodelivery(data) {
return request({
url: 'admin/express/shipping/no_delivery/list',
method: 'get',
params: { ...data }
})
}
// 物流运费模板新增
export function shippingSave(data) {
return request({

View File

@ -168,6 +168,7 @@
import * as logistics from '@/api/cremb/logistics'
import { Loading } from 'element-ui'
import {Debounce} from '@/utils/validate'
import {shippingNodelivery} from "@/api/cremb/logistics";
const defaultRole = {
name: '',
type: 1,
@ -357,6 +358,10 @@ export default {
if (info.appoint) {
this.shippingFree()
}
//
if(info.noDelivery){
this.shippingNodelivery()
}
}).catch(res => {
// console.integralLog(res)
this.$message.error(res.message)
@ -379,10 +384,24 @@ export default {
shippingFree() {
logistics.shippingFree({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => {
item.title = JSON.parse(item.title)
item.city_ids = item.title
// item.title = JSON.parse(item.title)
item.city_ids = item.cityId.split(',')
})
this.ruleForm.free = res.data
console.log(this.ruleForm.free )
})
},
//
shippingNodelivery() {
logistics.shippingNodelivery({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => {
// item.title = JSON.parse(item.title)
item.city_ids = item.cityId.split(',')
})
this.ruleForm.noDelivery = res.data
console.log(this.ruleForm.noDelivery )
})
},
removeChild(list){
@ -443,9 +462,7 @@ export default {
}
this.ruleForm.region.forEach((el, index) => {
if(el.city_ids.length > 0){
el.cityId = el.city_ids.map(item => {
return item[2]
}).join(',')
el.cityId = JSON.stringify(el.city_ids)
}else{
el.cityId = 'all'
}
@ -467,9 +484,7 @@ export default {
if (this.ruleForm.appoint) {
this.ruleForm.free.forEach((el, index) => {
if(el.city_ids.length > 0){
el.cityId = el.city_ids.map(item => {
return item[2]
}).join(',')
el.cityId = JSON.stringify(el.city_ids)
}else{
el.cityId = 'all'
}

View File

@ -15,6 +15,20 @@ export function memberOrderInfo(){
return request.get('api/order/member/memberOrderInfo', {})
}
/**
* 查询权益档位信息
*/
export function query(phone){
return request.get(`shop/refund-fee-record/query?phone=${phone}`, {})
}
/**
* 查询档位返费信息
*/
export function memberQuery(reportId){
return request.get(`shop/refund-fee-record/query-item?reportId=${reportId}`, {})
}
/**
* 根据手机号查询档次信息
*/

View File

@ -10,6 +10,18 @@
// }
}
},
{
"path": "pages/member_loding/index",
"style": {
"navigationBarTitleText": "会员"
}
},
{
"path": "pages/member_detail/index",
"style": {
"navigationBarTitleText": "权益明细"
}
},
{
"path": "pages/member_equity/index",
"style": {
@ -577,27 +589,28 @@
// {
// "pagePath": "pages/index/index",
// "iconPath": "static/images/tabbar/nav_icon_shop.png",
// "selectedIconPath": "static/images/1-002.png",
// "selectedIconPath": "static/images/tabbar/nav_icon_shop_active.png",
// "text": "商城"
// },
// {
// "pagePath": "pages/goods_cate/goods_cate",
// "iconPath": "static/images/tabbar/nav_icon_sort.png",
// "selectedIconPath": "static/images/2-002.png",
// "text": "分类"
// },
{
"pagePath": "pages/member_application/index",
"iconPath": "static/images/2-001.png",
"iconPath": "static/images/tabbar/nav_icon_member.png",
"selectedIconPath": "static/images/tabbar/nav_icon_member_active.png",
"text": "会员申请"
},
{
"pagePath": "pages/member_equity/index",
"iconPath": "static/images/2-001.png",
"iconPath": "static/images/tabbar/nav_icon_member.png",
"selectedIconPath": "static/images/tabbar/nav_icon_member_active.png",
"text": "会员申请",
"visible":false
},
{
"pagePath": "pages/goods_cate/goods_cate",
"iconPath": "static/images/tabbar/nav_icon_sort.png",
"selectedIconPath": "static/images/tabbar/nav_icon_sort_active.png",
"text": "分类"
},
// {
// "pagePath": "pages/order_addcart/order_addcart",

View File

@ -105,7 +105,7 @@
</block>
</view> -->
<!-- 优品推荐 -->
<view class="superior borRadius14" if='good_list.length' id="past2">
<!-- <view class="superior borRadius14" if='good_list.length' id="past2">
<view class="title acea-row row-center-wrapper">
<image src="../../static/images/xzuo.png"></image>
<view class="titleTxt">优品推荐</view>
@ -133,10 +133,10 @@
</view>
</view>
</swiper-item>
<!-- <view class="swiper-pagination" slot="pagination"></view> -->
<view class="swiper-pagination" slot="pagination"></view>
</swiper>
</view>
</view>
</view> -->
</view>
</view>
<view class='product-intro' id="past3">
@ -167,11 +167,11 @@
</view>
<!-- #endif -->
<block v-if="type === 'normal'">
<view @click="setCollect" class='item'>
<!-- <view @click="setCollect" class='item'>
<view class='iconfont icon-shoucang1' v-if="userCollect"></view>
<view class='iconfont icon-shoucang' v-else></view>
<view>收藏</view>
</view>
</view> -->
<navigator open-type='switchTab' class="animated item" :class="animated==true?'bounceIn':''"
url='/pages/order_addcart/order_addcart' hover-class="none">
<view class='iconfont icon-gouwuche1'>
@ -954,9 +954,9 @@
} else {
obj.type = "";
}
getCoupons(obj).then(res => {
that.$set(that.coupon, 'list', res.data);
});
// getCoupons(obj).then(res => {
// that.$set(that.coupon, 'list', res.data);
// });
},
tabCouponType(type) {
this.$set(this.coupon, 'type', type);

View File

@ -27,6 +27,7 @@
<image src='../../static/images/memberTitle.png'></image>
</view>
<view class="privilege-list">
<view class="privilege-item" v-for="(item,index) in 4" :key="index">
<image src='../../static/images/vip1.png'></image>
<text class="privilege-text">
@ -37,13 +38,10 @@
</view>
<paymentMember :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :payInfo="payInfo">
</paymentMember>
<button class="box-submit" @click="goPay"></button>
<u-navbar leftIcon="" title="会员申请">
<view class="u-nav-slot" slot="right">
<u-icon name="more-dot-fill" size="50" @click="show = true"></u-icon>
<u-action-sheet @select="handleSelect" :actions="list" :title="title" :show="show" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="show=false" :safeAreaInsetBottom="true"></u-action-sheet>
</view>
</u-navbar>
<view style="display: flex; justify-content: space-between; margin-top: 4%;">
<button class="box-submit" @click="goPay"></button>
<button class="box-others" @click="handleOther"></button>
</view>
</view>
</template>
@ -60,18 +58,16 @@
},
data() {
return {
title:'管理',
list: [
{
name:'购买记录',
fontSize:'28'
},
{
name:'为他人充值',
fontSize:'28'
},
],
show: false,
// list: [
// {
// name:'',
// fontSize:'28'
// },
// {
// name:'',
// fontSize:'28'
// },
// ],
memberData: [],
payInfo: {
userPhone: '',
@ -96,16 +92,17 @@
form: {
phone: ''
},
show:true,
ref:null
};
},
async onLoad() {
uni.showLoading({
title: '加载中',
mask: true
});
try{
uni.showLoading({
title: '加载中',
mask: true
});
const res = await memberGradeInfo()
if(res.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
@ -120,9 +117,6 @@
index: 0,
pagePath: '/pages/member_application/index'
})
uni.switchTab({
url:'/pages/member_application/index'
})
}
this.memberData = res.data
} finally{
@ -130,7 +124,11 @@
}
},
methods: {
handleOther(){
uni.navigateTo({
url:'/pages/member_others/index'
})
},
handleSelect(value){
switch (value.name){
case "购买记录":
@ -225,15 +223,14 @@
<style lang="scss" scoped>
.box {
margin-top: 10%;
position: relative;
padding: 207rpx 40rpx 30rpx 40rpx;
padding: 207rpx 40rpx 0 40rpx;
min-height: 100vh;
background: url(../../static/images/bg.png);
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
overflow: hidden;
.u-nav-slot{
::v-deep .u-popup__content{
padding-bottom: 20% !important;
@ -253,7 +250,6 @@
.box-member {
box-shadow: 0px 0px 15px -5px #000;
width: 100%;
border-radius: 20px;
box-sizing: border-box;
border: 1px solid transparent;
background-image: linear-gradient(#FFD55D, #FD752F),
@ -290,7 +286,7 @@
}
.member-list {
margin: 83rpx 30rpx 30rpx 30rpx;
margin: 53rpx 30rpx 20rpx 30rpx;
position: relative;
.member-item {
@ -302,11 +298,11 @@
border-radius: 20rpx;
.member-image {
width: 104rpx;
height: 104rpx;
width: 100rpx;
height: 100rpx;
border-radius: 35rpx;
background: linear-gradient(#FFEBB2, #FDCB3B);
padding: 20rpx;
padding: 16rpx;
image {
width: 100%;
@ -413,7 +409,7 @@
box-shadow: 0px 0px 15px -5px #000;
border-radius: 36rpx;
width: 100%;
margin-top: 12%;
margin-top: 9%;
border-radius: 20px;
box-sizing: border-box;
border: 1px solid transparent;
@ -454,7 +450,7 @@
}
.privilege-list {
margin: 84rpx 10rpx 40rpx 10rpx;
margin: 54rpx 10rpx 10rpx 10rpx;
display: flex;
justify-content: space-between;
@ -464,7 +460,7 @@
align-items: center;
justify-content: space-between;
background: #fff;
padding: 16rpx 16rpx;
padding: 6rpx 16rpx;
border-radius: 20rpx;
margin: 0 10rpx;
@ -486,9 +482,9 @@
}
}
.box-submit {
background: linear-gradient(#FFC82B, #FD7A32);
margin-top: 127rpx;
.box-others {
width: 46%;
background: linear-gradient(#ff6672, #d60338);
display: flex;
justify-content: center;
align-items: center;
@ -497,5 +493,18 @@
color: #fff;
font-size: 32rpx;
}
.box-submit {
width: 46%;
background: linear-gradient(#FFC82B, #FD7A32);
display: flex;
justify-content: center;
align-items: center;
height: 87rpx;
border-radius: 44rpx;
color: #fff;
font-size: 32rpx;
}
}
</style>

View File

@ -0,0 +1,111 @@
<template>
<view class="box">
<view class="list-item" v-for="(item,index) in memberData" :key="index">
<view class="item-title">
<view class="item-phone">
<view></view>
<text>{{item.tradeTime}}</text>
</view>
<view style="margin-right: 20rpx;">{{item.businessName}}</view>
</view>
<view class="item-text">
<text>{{list[list.findIndex((i) => item.gear == i.name)].value}} </text>
<text>交易金额{{item.money}}</text>
</view>
</view>
<u-navbar autoBack title="权益明细"></u-navbar>
</view>
</template>
<script>
import {
memberQuery
} from '@/api/member.js';
import { Debounce } from '@/utils/validate.js'
export default {
name: "member_record",
data() {
return {
list: [
{
value:'240',
img:'../../static/images/member240.png',
name:'360'
},
{
value:'400',
img:'../../static/images/member400.png',
name:'600'
},
{
value:'960',
img:'../../static/images/member960.png',
name:'900'
},
],
memberData:[]
};
},
async onLoad(options) {
const res = await memberQuery(options.reportId)
this.memberData = res.data
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.box {
padding: 20% 40rpx;
.box-seach{
padding: 10% 40rpx;
width: 100%;
position: fixed;
top: 3%;
left: 0;
}
.list-item{
margin-bottom: 26rpx;
padding: 30rpx 16rpx 25rpx 16rpx;
background: #FDF0F1;
border-radius: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
.item-title{
display: flex;
justify-content: space-between;
.item-phone{
display: flex;
align-items: center;
font-size: 30rpx;
color: #E91D51;
view{
border-radius: 3rpx;
margin-right: 10rpx;
width: 5rpx;
height: 12rpx;
background: #E91D51;
}
}
button{
padding: 6rpx ;
font-size: 26rpx;
background: rgb(22,155,213);
color: #fff;
}
}
.item-text{
padding: 34rpx 12rpx;
background: #fff;
margin-top: 20rpx;
display: flex;
justify-content: space-between;
font-size: 30rpx;
}
}
}
</style>

View File

@ -8,8 +8,18 @@
<text>会员积分{{memberDetail.integral}}</text>
</view>
<text>再升1级即可获得XX等6项权益</text>
<view class="left-button">
<view class="left-shopping" @click="handleRouter('购买记录')">
<text>购买记录</text>
<image src="../../static/images/shopping-right.png" ></image>
</view>
<view class="left-others" @click="handleRouter('为他人充值')">
为他人充值
<image src="../../static/images/others-right.png" ></image>
</view>
</view>
</view>
<view class="member-right">
<view class="member-right">
<image src='../../static/images/vipStar.png'></image>
<text>会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}</text>
<button @click="handleRenew"></button>
@ -23,47 +33,43 @@
</view>
<text class="equity-look">查看权益></text>
</view>
<view class="equity-item" v-for="(item,index) in 3" :key="index">
<view class="equity-item" v-for="(item,index) in equityData" :key="index">
<view class="equity-grade">
<image src='../../static/images/member240.png'></image>
<text>办理日期2021.12.30</text>
<image :src='list[list.findIndex((i) => item.gear == i.name)].img'></image>
<text>办理日期{{item.startTime}}</text>
</view>
<view class="equity-money">
<view class="money-box money-completed">
<text>已返回金额</text>
<view>
<text class="money-text">80</text>
<text class="money-detailed">查看明细></text>
<text class="money-text">{{item.totalMoney}}</text>
<text class="money-detailed" @click="handleDetailed(item.reportId)">></text>
</view>
</view>
<view class="money-box money-treat">
<text>已返回金额</text>
<text class="money-text">80</text>
<text>带返还金额 () </text>
<text class="money-text">{{list[list.findIndex((i) => item.gear == i.name)].name-item.totalMoney}}</text>
</view>
<view class="money-box money-term">
<text>已返回金额</text>
<text class="money-text">80</text>
<text>带返还期额</text>
<text class="money-text">{{item.frequency}}x12</text>
</view>
<view class="money-box money-time">
<text>已返回金额</text>
<text class="money-text">80</text>
</view>
</view>
</view>
</view>
<u-navbar leftIcon="" title="会员申请">
<view class="u-nav-slot" slot="right">
<u-icon name="more-dot-fill" size="50" @click="show = true"></u-icon>
<u-action-sheet @select="handleSelect" :actions="list" :title="title" :show="show" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="show=false" :safeAreaInsetBottom="true"></u-action-sheet>
</view>
</u-navbar>
</view>
<text>返费结束时间</text>
<text class="money-text">{{item.endTime}}</text>
</view>
</view>
</view>
</view>
<u-navbar leftIcon="" title="会员申请"></u-navbar>
</view>
</template>
<script>
import {
memberHeadInfo,
memberGradeInfo
memberGradeInfo,
query
} from '@/api/member.js';
import {
mapGetters
@ -72,20 +78,24 @@
name: "member_application",
data() {
return {
title:'管理',
list: [
{
name:'购买记录',
fontSize:'28'
img:'../../static/images/member240.png',
name:'360'
},
{
name:'为他人充值',
fontSize:'28'
img:'../../static/images/member400.png',
name:'600'
},
{
img:'../../static/images/member960.png',
name:'900'
},
],
vipData:['普通会员','中级会员','高级会员'],
show: false,
memberDetail:{}
memberDetail:{},
equityData:[]
};
},
computed: mapGetters(['userInfo']),
@ -96,9 +106,6 @@
index: 0,
pagePath: '/pages/member_equity/index'
})
uni.switchTab({
url:'/pages/member_equity/index'
})
}else{
uni.setTabBarItem({
index: 0,
@ -108,18 +115,25 @@
url:'/pages/member_application/index'
})
}
const res = await memberHeadInfo()
this.memberDetail = res.data
// this.userInfo.mobile
const equity = await query(13668261228)
this.equityData = equity.data
},
methods: {
handleDetailed(reportId){
uni.navigateTo({
url:`/pages/member_detail/index?reportId=${reportId}`,
})
},
handleRenew(){
uni.navigateTo({
url:'/pages/member_renew/index'
})
},
handleSelect(value){
switch (value.name){
handleRouter(value){
switch (value){
case "购买记录":
uni.navigateTo({
url:'/pages/member_record/index'
@ -164,7 +178,7 @@
// padding: 20rpx 20rpx 30rpx 20rpx;
display: flex;
justify-content: space-between;
line-height: 50rpx;
.member-left {
display: flex;
flex-direction: column;
@ -186,6 +200,43 @@
display: flex;
justify-content: space-between;
}
.left-button{
display: flex;
justify-content: space-between;
margin-top: 10rpx;
image{
width: 24rpx;
height: 24rpx;
margin-left: 13rpx;
}
.left-shopping{
display: flex;
align-items: center;
justify-content: center;
width: 204rpx;
height: 61rpx;
background: #F8EFF0;
border: 1px solid #F783B0;
border-radius: 30rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
.left-others{
background-image: url("../../static/images/others-button.png");
background-size: 204rpx 61rpx;
display: flex;
align-items: center;
justify-content: center;
width: 204rpx;
height: 61rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
}
}
.member-right {

View File

@ -0,0 +1,52 @@
<template>
</template>
<script>
import {
memberGradeInfo
} from '@/api/member.js';
export default {
name: "member_loding",
data() {
return {
};
},
async onLoad() {
try{
uni.showLoading({
title: '加载中'
});
const res = await memberGradeInfo()
if(res.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_equity/index'
})
uni.switchTab({
url:'/pages/member_equity/index'
})
}else{
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_application/index'
})
uni.switchTab({
url:'/pages/member_application/index'
})
}
} finally{
uni.hideLoading();
}
},
methods: {
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -508,7 +508,7 @@
.box-submit {
background: linear-gradient(#FFC82B, #FD7A32);
margin-top: 127rpx;
margin-top: 9%;
display: flex;
justify-content: center;
align-items: center;

View File

@ -461,7 +461,7 @@ import store from '@/store/index';
.box-submit {
background: linear-gradient(#FFC82B, #FD7A32);
margin-top: 127rpx;
margin-top: 9%;
display: flex;
justify-content: center;
align-items: center;

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB