Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product_new

pull/16/head
perry 2023-05-24 20:05:14 +08:00
commit 89b9155679
4 changed files with 85 additions and 164 deletions

View File

@ -375,7 +375,7 @@ export default {
logistics.shippingRegion({ tempId: this.tempId }).then(res => { logistics.shippingRegion({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
// item.title = JSON.parse(item.title) // item.title = JSON.parse(item.title)
item.city_ids = item.title item.city_ids = JSON.parse(item.title)
}) })
this.ruleForm.region = res.data this.ruleForm.region = res.data
}) })
@ -385,10 +385,9 @@ export default {
logistics.shippingFree({ tempId: this.tempId }).then(res => { logistics.shippingFree({ tempId: this.tempId }).then(res => {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
// item.title = JSON.parse(item.title) // item.title = JSON.parse(item.title)
item.city_ids = item.cityId.split(',') item.city_ids = JSON.parse(item.title)
}) })
this.ruleForm.free = res.data this.ruleForm.free = res.data
console.log(this.ruleForm.free )
}) })
}, },
@ -462,9 +461,11 @@ export default {
} }
this.ruleForm.region.forEach((el, index) => { this.ruleForm.region.forEach((el, index) => {
if(el.city_ids.length > 0){ if(el.city_ids.length > 0){
el.cityId = JSON.stringify(el.city_ids) el.title = JSON.stringify(el.city_ids)
el.cityId = el.city_ids.join(",")
}else{ }else{
el.cityId = 'all' el.cityId = 'all'
el.title = 0
} }
}) })
param.shippingTemplatesRegionRespVOList = this.ruleForm.region param.shippingTemplatesRegionRespVOList = this.ruleForm.region
@ -484,9 +485,11 @@ export default {
if (this.ruleForm.appoint) { if (this.ruleForm.appoint) {
this.ruleForm.free.forEach((el, index) => { this.ruleForm.free.forEach((el, index) => {
if(el.city_ids.length > 0){ if(el.city_ids.length > 0){
el.cityId = JSON.stringify(el.city_ids) el.title = JSON.stringify(el.city_ids)
el.cityId = el.city_ids.join(",")
}else{ }else{
el.cityId = 'all' el.cityId = 'all'
el.title = 0
} }
}) })
param.shippingTemplatesFreeRespVOList = this.ruleForm.free param.shippingTemplatesFreeRespVOList = this.ruleForm.free

View File

@ -1,30 +1,16 @@
<template> <template>
<view class="box"> <view class="box">
<view class="box-member"> <view class="list-item" >
<view class="member-left"> <view class="item-title">
<text class="left-title">{{memberDetail.grade}}</text> <view class="item-phone">
<view class="left-info"> <view></view>
<text>{{userInfo.mobile}}</text> <text>充值号码{{memberDetail.userPhone}}</text>
<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> </view>
<view class="member-right"> <view class="item-text">
<image src='../../static/images/vipStar.png'></image> <text>充值档次{{memberDetail.grade}}</text>
<text>会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}</text> </view>
<button @click="handleRenew"></button> </view>
</view>
</view>
<view class="box-equity"> <view class="box-equity">
<view class="equity-text"> <view class="equity-text">
<view > <view >
@ -61,7 +47,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-navbar leftIcon="" title="会员申请"></u-navbar> <u-navbar leftIcon="" title="话费返回情况"></u-navbar>
</view> </view>
</template> </template>
@ -81,15 +67,15 @@
list: [ list: [
{ {
img:'../../static/images/member240.png', img:'../../static/images/member240.png',
name:'360' name:360
}, },
{ {
img:'../../static/images/member400.png', img:'../../static/images/member400.png',
name:'600' name:600
}, },
{ {
img:'../../static/images/member960.png', img:'../../static/images/member960.png',
name:'900' name:900
}, },
], ],
vipData:['普通会员','中级会员','高级会员'], vipData:['普通会员','中级会员','高级会员'],
@ -99,24 +85,8 @@
}; };
}, },
computed: mapGetters(['userInfo']), computed: mapGetters(['userInfo']),
async onLoad() { async onLoad(options) {
const resful = await memberGradeInfo() this.memberDetail = options
if(resful.data.some((item) => !!parseInt(item.isExist))){
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_equity/index'
})
}else{
uni.setTabBarItem({
index: 0,
pagePath: '/pages/member_application/index'
})
uni.switchTab({
url:'/pages/member_application/index'
})
}
const res = await memberHeadInfo()
this.memberDetail = res.data
const equity = await query(this.userInfo.mobile) const equity = await query(this.userInfo.mobile)
this.equityData = equity.data this.equityData = equity.data
}, },
@ -153,7 +123,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
margin-bottom: 30%; padding: 40rpx 20rpx;
margin-top: 10%; margin-top: 10%;
background: #fff; background: #fff;
height: 100vh; height: 100vh;
@ -162,116 +132,52 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-attachment: fixed; background-attachment: fixed;
.u-nav-slot{
::v-deep .u-popup__content{
padding-bottom: 20% !important;
} .list-item{
} margin-bottom: 10%;
padding: 30rpx 16rpx 25rpx 16rpx;
background: #FDF0F1;
.box-member {
padding: 36rpx 40rpx;
border-radius: 20rpx; border-radius: 20rpx;
width: 100%;
// padding: 20rpx 20rpx 30rpx 20rpx;
display: flex; display: flex;
flex-direction: column;
justify-content: space-between; justify-content: space-between;
line-height: 50rpx; .item-title{
.member-left {
display: flex; display: flex;
flex-direction: column;
justify-content: space-between; justify-content: space-between;
width: 69%; .item-phone{
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
.left-title {
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 600;
color: #000000;
}
.left-info {
display: flex; display: flex;
justify-content: space-between; align-items: center;
font-size: 30rpx;
color: #E91D51;
view{
border-radius: 3rpx;
margin-right: 10rpx;
width: 5rpx;
height: 12rpx;
background: #E91D51;
}
} }
.left-button{ button{
display: flex; padding: 6rpx ;
justify-content: space-between; font-size: 26rpx;
margin-top: 10rpx; background: rgb(22,155,213);
image{ color: #fff;
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 { .item-text{
padding: 34rpx 12rpx;
background: #fff;
margin-top: 20rpx;
display: flex; display: flex;
flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: center; font-size: 30rpx;
width: 22%;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-bottom: 10rpx;
}
button {
margin-top: 10rpx;
padding: 7rpx 16rpx;
background: #F22E60;
border-image: linear-gradient(0deg, #A8052E, #FFFFFF) 10 10;
border-radius: 18rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
} }
} }
.box-equity { .box-equity {
// border-radius: 20rpx;
width: 100%; width: 100%;
padding: 0 40rpx; padding: 0 40rpx;
background: url(../../static/images/memberEquity.png); background: url(../../static/images/memberEquity.png);

View File

@ -14,14 +14,14 @@
<image src="../../static/images/shopping-right.png" ></image> <image src="../../static/images/shopping-right.png" ></image>
</view> </view>
<view class="left-others" @click="handleRouter('为他人充值')"> <view class="left-others" @click="handleRouter('为他人充值')">
他人充值 他人充值
<image src="../../static/images/others-right.png" ></image> <image src="../../static/images/others-right.png" ></image>
</view> </view>
</view> </view>
</view> </view>
<view class="member-right"> <view class="member-right">
<image src='../../static/images/vipStar.png'></image> <image src='../../static/images/vipStar.png'></image>
<text>会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}</text> <text>会员等级{{vipData.findIndex((item) => item == parseInt(memberDetail.grade)) +1}}</text>
<button @click="handleRenew"></button> <button @click="handleRenew"></button>
</view> </view>
</view> </view>
@ -47,11 +47,11 @@
</view> </view>
</view> </view>
<view class="money-box money-treat"> <view class="money-box money-treat">
<text>返还金额 () </text> <text>返还金额 () </text>
<text class="money-text">{{list[list.findIndex((i) => item.gear == i.name)].name-item.totalMoney}}</text> <text class="money-text">{{list[list.findIndex((i) => item.gear == i.name)].name-item.totalMoney}}</text>
</view> </view>
<view class="money-box money-term"> <view class="money-box money-term">
<text>返还期额</text> <text>返还期额</text>
<text class="money-text">{{item.frequency}}x12</text> <text class="money-text">{{item.frequency}}x12</text>
</view> </view>
<view class="money-box money-time"> <view class="money-box money-time">
@ -81,15 +81,15 @@
list: [ list: [
{ {
img:'../../static/images/member240.png', img:'../../static/images/member240.png',
name:'360' name:360
}, },
{ {
img:'../../static/images/member400.png', img:'../../static/images/member400.png',
name:'600' name:600
}, },
{ {
img:'../../static/images/member960.png', img:'../../static/images/member960.png',
name:'900' name:900
}, },
], ],
vipData:['普通会员','中级会员','高级会员'], vipData:['普通会员','中级会员','高级会员'],

View File

@ -3,13 +3,13 @@
<view class="box-seach"> <view class="box-seach">
<u-search placeholder="按手机号搜索查询" v-model="keyword" border-color="#F94B78" height="70" margin="0 0 35rpx 0" placeholder-color="#9C9C9C" bg-color="#fff" :show-action="false"></u-search> <u-search placeholder="按手机号搜索查询" v-model="keyword" border-color="#F94B78" height="70" margin="0 0 35rpx 0" placeholder-color="#9C9C9C" bg-color="#fff" :show-action="false"></u-search>
</view> </view>
<view class="list-item" v-for="(item,index) in memberData" :key="index"> <view class="list-item" v-for="(item,index) in memberData" :key="index" @click.stop="handleBack(item)">
<view class="item-title"> <view class="item-title">
<view class="item-phone"> <view class="item-phone">
<view></view> <view></view>
<text>充值号码{{item.userPhone}}</text> <text>充值号码{{item.userPhone}}</text>
</view> </view>
<button v-show="item.bool" @click="handleService(item.orderId)">退</button> <button v-show="item.bool" @click.stop="handleService(item.orderId)">退</button>
</view> </view>
<view class="item-text"> <view class="item-text">
<text>充值档次{{item.grade}}</text> <text>充值档次{{item.grade}}</text>
@ -34,23 +34,13 @@
}; };
}, },
async onLoad() { async onLoad() {
let milliseconds = 2 * 3600 * 1000 // 7200000 await this.getList()
let timestamp = new Date().getTime()
const res = await memberOrderInfo()
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
}, },
watch:{ watch:{
keyword :Debounce (function (){ keyword :Debounce (function (){
this.memberData.sort((a,b) =>{ this.memberData.sort((a,b) =>{
let aIndex = this.keyword.indexOf(a.userPhone) let aIndex = this.keyword.indexOf(a.userPhone)
let bIndex = this.keyword.indexOf(b.userPhone) let bIndex = this.keyword.indexOf(b.userPhone)
console.log(aIndex,bIndex)
if(aIndex > bIndex) return -1 if(aIndex > bIndex) return -1
if(aIndex < bIndex) return 1 if(aIndex < bIndex) return 1
if(a.userPhone == b.userPhone){ if(a.userPhone == b.userPhone){
@ -64,8 +54,30 @@
},1000) },1000)
}, },
methods: { methods: {
handleBack(item){
console.log(item)
uni.navigateTo({
url:`/pages/member_back/index?userPhone=${item.userPhone}&grade=${item.grade}`
})
},
async getList(){
let milliseconds = 2 * 3600 * 1000 // 7200000
let timestamp = new Date().getTime()
const res = await memberOrderInfo()
const arr = res.data.map((item) => {
return {
...item,
bool:item.createTime+milliseconds>timestamp
}
})
this.memberData = arr
},
async handleService(orderId){ async handleService(orderId){
await memberApplyRefund({orderId}) await memberApplyRefund({orderId})
this.$util.Tips({
title: '申请成功'
});
await this.getList()
} }
} }
}; };