Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pages/shop-info/shop-info.vue
hmp 4 vuotta sitten
vanhempi
commit
5e21a88769

+ 2 - 0
assets/http/api.js

@@ -41,6 +41,8 @@ const shop={
 const memberCenter={
 	list:p => http.get('cyzh-ldt/app/shop/getMembersByShopId',{params:p}),
 	create:(p)=> http.post('cyzh-ldt/app/shop/createMemberCenter',p),
+	update:(p)=> http.post('cyzh-ldt/app/shop/updateMemberCenter',p),
+	billList:(p)=> http.get('cyzh-ldt/app/shop/getMemberBillRecord',{params:p})
 }
 
 

+ 9 - 1
pages.json

@@ -92,7 +92,15 @@
             }
             
         }
-       
+		,{
+		    "path" : "pages/member/detail",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "会员详情",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
         ,{
             "path" : "pages/login/forget",
             "style" :                                                                                    

+ 10 - 4
pages/bill/bill.vue

@@ -49,9 +49,9 @@
 					<text>积分来源</text>
 				</view>
 				<view class="area2 area-padding">
-					<text>积分数量</text>
+					<text>折扣</text>
 				</view>
-				<view class="area3 area-padding">
+				<view class="area3 area-padding u-text-right u-p-r-20">
 					<text>价值</text>
 				</view>
 			</view>
@@ -92,9 +92,14 @@
 								</view>
 							</view>
 						</view>
-						<view class="area3 text-area u-flex-1">
+						<view class="area2 text-area" style="width: 15%;">
+							<view class="item-padding">
+								<text>{{item.subsidy==1?'无折扣':$digital.floatMul(item.subsidy , 10) +'折'}}</text>
+							</view>
+						</view>
+						<view class="area3 text-area u-p-r-20" style="width: 30%;">
 							<view class="item-padding"
-								style="text-align: right;flex:1;font-size: 34rpx;color: #F39248;margin-right: 20rpx;">
+								style="flex:1;text-align: right;font-size: 34rpx;color: #F39248;">
 								+¥{{item.realPayAmount}}</view>
 						</view>
 					</block>
@@ -144,6 +149,7 @@
 			}
 		},
 		onLoad() {
+			this.defaultTime=this.$dateTime.format(new Date(),'YYYY-mm')
 			this.shopDetail()
 		},
 		onReady() {

+ 7 - 7
pages/bill/billDetail.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<block v-if="current==0">
+		<block v-if="current==1">
 			<view class="top">
 				<image :src="billDetail.channelLogo?billDetail.channelLogo:'/static/icon/avatar.png'" mode="aspectFit"></image>
 				<text class="title">{{billDetail.channelName}}</text>
@@ -43,10 +43,10 @@
 				</view>
 			</view>
 		</block>
-		<block v-if="current==1">
+		<block v-if="current==0">
 			<view class="top">
 				<image style="border-radius: 50%;" :src="billDetail.userAvator?billDetail.userAvator:'/static/icon/avatar.png'" mode="aspectFit"></image>
-				<text class="title">{{billDetail.userName}}</text>
+				<text class="title">{{billDetail.userName?billDetail.userName:'微信用户'}}</text>
 				<view class="data">
 					<view class="mainColor" style="padding: 0;">
 						+{{billDetail.realPayAmount}}
@@ -62,17 +62,17 @@
 					<text>积分成本</text>
 					<view class="u-flex">
 						<image style="width: 26rpx;height: 26rpx;" src="@/static/icon/points-value.png" mode="aspectFit"></image>
-						<text class="mainColor margin-left-10">{{billDetail.point}}</text>
-						<text class="strong" style="margin-left: 50rpx;">¥ {{billDetail.pointValue}}</text>
+						<text class="mainColor margin-left-10">{{billDetail.point?billDetail.point:0}}</text>
+						<text class="strong" style="margin-left: 50rpx;">¥ {{billDetail.pointValue?billDetail.pointValue:0}}</text>
 					</view>
 				</view>
 				<view class="item">
 					<text>联营折扣</text>
-					<text style="color: #000;">{{billDetail.subsidy}}%</text>
+					<text style="color: #000;">{{billDetail.subsidy==1?'无折扣':$digital.floatMul(billDetail.subsidy , 10) +'折'}}</text>
 				</view>
 				<view class="item">
 					<text>通兑应收</text>
-					<text class="strong">¥{{billDetail.tongduiAccount}}</text>
+					<text class="strong">¥{{billDetail.tongduiAccount?billDetail.tongduiAccount:0}}</text>
 				</view>
 				<view class="item">
 					<text>交易状态</text>

+ 3 - 3
pages/index/index.vue

@@ -221,7 +221,7 @@
 				this.labelIds = item.labelIds
 				this.labelNames = item.labelNames
 				this.mallId=item.mallId
-				this.cacheSelectedShop()
+				this.cacheSelectedShop(item)
 				//获取统计数据
 				this.getStatistic()
 			},
@@ -237,7 +237,7 @@
 					labelIds:this.labelIds,
 					labelNames:this.labelNames
 				}
-				this.$cache.put("selectedShop",selectedShop)
+				this.$cache.put("selectedShop",Object.assign(item,selectedShop))
 				this.$u.vuex('vuex_shopId',this.shopId)
 				this.$u.vuex('vuex_mallId',this.mallId)
 			},
@@ -251,7 +251,7 @@
 				})
 				this.labelIds = item.labelIds
 				this.labelNames = item.labelNames
-				this.cacheSelectedShop()
+				this.cacheSelectedShop(item)
 				//获取统计数据
 				this.getStatistic()
 			},

+ 224 - 0
pages/member/detail.vue

@@ -0,0 +1,224 @@
+<template>
+	<view>
+		<view class="headCard">
+			<image class="avatar" :src="detail.avatar" mode="aspectFit" ></image>
+			<view class="itemCard">
+				<text>会员名称</text>
+				<text>{{detail.nickName}}</text>
+			</view>
+			<view class="itemCard">
+				<text>手机号码</text>
+				<text>{{detail.phone}}</text>
+			</view>
+			<view class="itemCard">
+				<text>会员名称</text>
+				<text>{{detail.gender==1?'男':'女'}}</text>
+			</view>
+		</view>
+		<view class="cell">
+			<text class="cell-item" style="font-weight: bold;font-size: 28rpx;">消费记录</text>
+			<text class="cell-item" style="color: #D18C42;font-size: 22rpx;">消费总额¥{{detail.payTotal}}</text>
+		</view>
+		<view class="card">
+			<view class="u-flex">
+				<view class="area1 area-padding " style="padding-left: 40rpx;">
+					<text>交易日期</text>
+				</view>
+				<view class="area2 area-padding">
+					<image style="width: 35rpx;height: 35rpx;margin-right: 10rpx;margin-bottom: -10rpx;"
+						src="@/static/icon/points-value.png"></image>
+					<text>获赠积分</text>
+				</view>
+				<view class="area3 area-padding u-text-right u-p-r-20">
+					<text>消费金额</text>
+				</view>
+			</view>
+			<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
+				:down="downOption" :up="upOption">
+				<view class="item" v-for="(item,index) in list" :key="index">
+					<view class="area1">
+						<view class="item-padding">
+							<text>{{item.updateTime}}</text>
+						</view>
+					</view>
+					<view class="area2 text-area" style="width: 15%;">
+						<view class="item-padding">
+							<text style="font-size: 32rpx;margin-left: 10rpx;color: #F39248;">{{item.point}}</text>
+						</view>
+					</view>
+					<view class="area3 text-area u-p-r-20" style="width: 30%;">
+						<view class="item-padding" style="flex:1;text-align: right;font-size: 34rpx;">¥{{item.payAmount}}</view>
+					</view>
+				</view>
+			</mescroll-body>
+				
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
+	export default{
+		mixins: [MescrollMixin],
+		data(){
+			return{
+				detail:null,
+				downOption: {
+					auto: false,
+					height:'',
+				},
+				list:[]
+			}
+		},
+		onReady() {
+			this.getElInfo()
+		},
+		onLoad(option) {
+			if(option.detail){
+				this.detail = JSON.parse(option.detail)
+			}
+		},
+		methods:{
+			async getElInfo() {
+				let rectInfo = await this.$u.getRect('.card');
+				this.height=this.$u.sys().windowHeight - rectInfo.top + 'px'
+			},
+			upCallback(mescroll) {
+				if (!this.vuex_shopId) {
+					return
+				}
+				let params = {
+					id: this.detail.id,
+					shopId: this.vuex_shopId,
+					current: mescroll.num,
+					size: mescroll.size,
+				}
+				try {
+					this.$api.memberCenter.billList(params).then(res => {
+						console.log(res)
+						let data = res.data.records
+						let total = res.data.total
+						mescroll.endBySize(data.length, total);
+						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
+						this.list = this.list.concat(data); //追加新数据
+					})
+			
+				} catch (e) {
+					this.mescroll.endErr()
+				}
+			},
+			downCallback() {
+				setTimeout(() => {
+					this.mescroll.resetUpScroll();
+				}, 200)
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.headCard {
+		margin-top: 100rpx;
+		padding: 70rpx 30rpx 30rpx;
+		background-color: #FFFFFF;
+		position: relative;
+		.avatar{
+			position: absolute;
+			margin: 0 auto;
+			transform: translateY(-50%);
+			width: 120rpx;
+			height: 120rpx;
+			border-radius: 50%;
+			left: 0;
+			right: 0;
+			top: 0;
+		}
+		.itemCard{
+			padding: 20rpx 0;
+			font-size: 28rpx;
+			color: #888888;
+			margin: 0 20rpx;
+			display: flex;
+			justify-content: space-between;
+		}
+	}
+	.cell{
+		display: flex;
+		justify-content: space-between;
+		align-items: flex-end;
+		height: 60rpx;
+		padding: 30rpx 30rpx;
+		box-sizing: content-box;
+	}
+	.card {
+		background-color: #FFFFFF;
+	
+		.area-padding {
+			padding: 40rpx 0 20rpx;
+		}
+	
+		.text-area {
+			display: flex;
+			justify-content: flex-start;
+			align-items: center;
+		}
+	
+		.area1 {
+			padding-left: 30rpx;
+			width: 55%;
+	
+			view:first-child {
+				display: flex;
+	
+				image {
+					width: 80rpx;
+					height: 80rpx
+				}
+	
+				view {
+					padding-left: 15rpx;
+					padding-bottom: 5rpx;
+					display: flex;
+					flex-direction: column;
+	
+					text:first-child {
+						font-size: 32rpx;
+						padding-bottom: 10rpx;
+						color: #000;
+					}
+	
+					text:last-child {
+						font-size: 22rpx;
+						color: #888888;
+					}
+				}
+			}
+		}
+	
+		.area2 {
+			width: 25%;
+		}
+	
+		.area3 {
+			width: 20%;
+		}
+	
+		.item-padding {
+			padding: 20rpx 0;
+		}
+	
+		.item {
+			padding: 5rpx;
+			display: flex;
+			border-bottom: 1rpx solid #DDDDDD;
+		}
+	
+		.item:last-child {
+			border: none;
+		}
+	
+	
+	
+	}
+</style>

+ 91 - 14
pages/member/member.vue

@@ -12,14 +12,21 @@
 
 		<block v-else>
 			<view class="top-menu">
-				<view class="">
-					<text>{{detail.memberCount}}</text>
-					<text>会员数量</text>
+				<view class="leftFixed">{{selectedShop.point}}积分等于{{selectedShop.pointValue}}元</view>
+				<view class="u-flex u-row-between">
+					<view class="item">
+						<text>{{detail.memberCount}}</text>
+						<text>会员数量</text>
+					</view>
+					
+					<view class="item">
+						<text>{{detail.totalPointValue}}</text>
+						<text>积分总价值</text>
+					</view>
 				</view>
-
-				<view class="">
-					<text>{{detail.totalPointValue}}</text>
-					<text>积分总价值</text>
+				<view class="u-m-t-50 u-flex u-col-center u-row-center">
+					<text class="u-font-24 u-m-r-20">规则:消费1元赠送{{selectedShop.consumeOnePoint}}积分</text>
+					<u-button size="mini" shape="circle" @click="showPopup=true">更改规则</u-button>
 				</view>
 			</view>
 			<view class="padding-20 text-bold text-xl">
@@ -41,7 +48,7 @@
 
 				<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
 					:down="downOption" :up="upOption">
-					<view class="item" v-for="(item,index) in dataList" :key="index">
+					<view class="item" v-for="(item,index) in dataList" :key="index" @click="$jump('/pages/member/detail?detail='+JSON.stringify(item))">
 						<view class="area1 flex text-bold">
 							<image class="img-avatar"
 								:src="item.avatar">
@@ -63,6 +70,26 @@
 				</mescroll-body>
 			</view>
 		</block>
+		<u-popup v-model="showPopup" mode="center" border-radius="20">
+			<view class="u-popup-content">
+				<text>更改积分规则</text>
+				<u-form>
+					<u-form-item label-width="180"  label="消费1元赠送">
+						<u-input 
+						v-model="consumeOnePoint" 
+						border="true" 
+						border-color="#eaeaea"  
+						type="number" 
+						:clearable="false" 
+						placeholder="请输入积分数"
+						/>
+						<view slot="right" style="color: #D18C42;">积分</view>
+					</u-form-item>
+				</u-form>
+				<u-button size="medium" shape="circle" :custom-style="customStyle1" @click="update">确定</u-button>
+				<u-button size="medium" shape="circle" :custom-style="customStyle2" @click="showPopup=false">取消</u-button>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -85,6 +112,18 @@
 					use: true,
 					auto: false // 不自动加载
 				},
+				showPopup:false,
+				consumeOnePoint:'',
+				customStyle1:{
+					backgroundColor:'#D18C42',
+					color:'#fff',
+					marginBottom:'20rpx',
+					width:'400rpx'
+				},
+				customStyle2:{
+					width:'400rpx'
+				},
+				selectedShop:null
 			}
 		},
 		watch:{
@@ -96,11 +135,23 @@
 		},
 		onReady() {
 			this.getElInfo()
+			this.selectedShop = this.$cache.get("selectedShop")
 		},
 		onLoad() {
 			this.fetchShopDetail()
 		},
 		methods: {
+			update(){
+				let params = {
+					id: this.vuex_shopId,
+					consumeOnePoint:this.consumeOnePoint
+				}
+				this.$api.memberCenter.update(params).then(res => {
+					this.selectedShop.consumeOnePoint = this.consumeOnePoint
+					this.$cache.put("selectedShop",this.selectedShop)
+					this.showPopup = false
+				})
+			},
 			async getElInfo() {
 				let rectInfo = await this.$u.getRect('.tableTitle');
 				this.height=this.$u.sys().windowHeight - rectInfo.top + 'px'
@@ -168,15 +219,30 @@
 		border-radius: 20rpx;
 		margin: 30rpx 20rpx;
 		padding: 50rpx;
-		display: flex;
-		justify-content: space-around;
 		background-image: linear-gradient(to right, #272A46, #30355D);
-
-		view {
+		color: #fff;
+		position: relative;
+		.leftFixed{
+			padding:0 10rpx;
+			font-size: 22rpx;
+			height: 40rpx;
+			line-height: 40rpx;
+			background-color: $color;
+			color: #fff;
+			position: absolute;
+			top: 20rpx;
+			left: 0;
+			border-top-right-radius: 25px;
+			border-bottom-right-radius: 25px;
+		}
+		.item {
 			display: flex;
 			flex-direction: column;
 			text-align: center;
-
+			align-items: center;
+			justify-content: center;
+			flex:1;
+			margin-top: 30rpx;
 			text:first-child {
 				margin-bottom: 10rpx;
 				color: #FFFFFF;
@@ -190,7 +256,18 @@
 			}
 		}
 	}
-
+	
+	.u-popup-content{
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 30rpx;
+		u-form{
+			margin: 60rpx 0;
+			width: 500rpx;
+		}
+	}
+	
 	.card {
 		width: 100%;
 		background-color: #FFFFFF;

+ 1 - 1
pages/shop-info/shop-info.vue

@@ -90,7 +90,7 @@
 				</view>
 				<view class="border">
 					<u-form-item label="具体地址" prop="adderess">
-						<u-input :border="false" placeholder="详细写到门店编号" v-model="form.adderess" ></u-input>
+						<u-input :border="false" placeholder="详细写到门店编号" v-model="form.adderess" ></u-input>
 						<view slot="right">
 							<u-button @click="chooseAddress" size="mini">获取地址</u-button>
 						</view>