Browse Source

奖励明细

tong 4 years ago
parent
commit
287598a9e3
3 changed files with 111 additions and 20 deletions
  1. 39 5
      pages/me/Reward-details/index.vue
  2. 63 14
      pages/me/search/index.vue
  3. 9 1
      pages/msg/index.vue

+ 39 - 5
pages/me/Reward-details/index.vue

@@ -7,7 +7,7 @@
 		<view class="content">
 			<u-tabs style="width: 500rpx;" bg-color="#0095ff" inactive-color="#FFFFFF" active-color="#fff" :list="list"
 			 :is-scroll="false" :current="current" @change="change"></u-tabs>
-			<u-select style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" laber-name="brandName" :list="brandList"></u-select>
+			<u-select style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" label-name="brandName" :list="brandList"></u-select>
 			<u-calendar style=" color: #fff;" @change="changetime" v-model="showDate" :mode="mode"></u-calendar>
 			<view @click="search">
 				<u-search :show-action="true" :animation="true"></u-search>
@@ -88,7 +88,7 @@
 					body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
 					open: false,
 				}],
-				brandList:[],
+				brandList:JSON.parse(JSON.stringify([])),
 				// brandList: [{
 				// 		value: '1',
 				// 		label: '赛轮'
@@ -106,6 +106,7 @@
 				startTime: '',
 				// 结束时间
 				endTime: '',
+				label: ''
 				
 			};
 		},
@@ -197,9 +198,7 @@
 							'userId': '123'	
 						}
 					}).then(res => {
-						console.log(res)
-						this.brandList = res.data.data
-						console.log(this.brandList)
+						this.brandList = JSON.parse(JSON.stringify(res.data.data))		
 					}).catch(err => {
 						console.log(err)
 					})
@@ -214,6 +213,40 @@
 			// 点击获取品牌
 			confirm(e) {
 				console.log(e)
+				console.log(e[0].label)
+				this.label = e[0].label
+				request({
+						url: '/myPage/getPageScanRewordList',
+						method: 'post',
+						data: {
+							'storeId': '1000',
+							'userId': '123',
+							'current': '1',	
+							'size': '10',
+							'searchKey': this.label
+						}
+					}).then(res => {
+						console.log(res)
+						this.datalist = res.data.data
+						// 判断扫码类型
+						for (var i = 0; i < res.data.data.length; i++) {
+							if (res.data.data[i].getWay == 0) {
+								this.getWay = "车主扫码"
+							} else {
+								this.getWay = "门店扫码"
+							}
+						}
+						console.log(res.data.data)
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 1000)
+				
+					})
 				},
 			search() {
 				this.$u.route({
@@ -227,6 +260,7 @@
 				} else if (this.current == 2) {
 					this.showDate = true
 				}
+				this.data()
 			}
 		}
 	}

+ 63 - 14
pages/me/search/index.vue

@@ -1,36 +1,44 @@
 <template>
 	<view>
 		<view class="content">
-			<u-search placeholder="请输入搜索内容" @click="data" v-model="keyword"></u-search>
+			<u-search placeholder="请输入搜索内容" @custom="data" v-model="keyword"></u-search>
 		</view>
 		
 		<view class="content-one" v-for="(item,index) in datalist" :key="index">
 			<view class="content-one-view">
 			</view>
-			<view class="content-one-text">单号:20200609135904795 - 20753</view>
-			<view class="content-one-time">2020-10-28</view>
+			<view class="content-one-text">获得奖励:{{item.money}}元</view>
+			<!-- <view class="content-one-time">2020-10-28</view> -->
 			<view class="content-two">
 				<view>
-					
+					轮胎型号
 				</view>
 				<view>
-					aaaaaaaaaaabbbbbbbbb
+					{{item.tireModel}}
 				</view>
 			</view>
 			<view class="content-two">
 				<view>
-					赛轮
+					扫码胎号
 				</view>
 				<view>
-					aaaaaaaaaaabbbbbbbbb
+					{{item.tyreNum}}
 				</view>
 			</view>
 			<view class="content-two">
 				<view>
-					赛轮
+					奖励类型
 				</view>
 				<view>
-					aaaaaaaaaaabbbbbbbbb
+					{{item.getWay}}
+				</view>
+			</view>
+			<view class="content-two">
+				<view>
+					获得时间
+				</view>
+				<view>
+					{{item.createTime}}
 				</view>
 			</view>
 		</view>
@@ -39,19 +47,58 @@
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
 				datalist: [
-					{},
-					{}
+					
 				],
+				input: '',
 				keyword: ''
 			}
 		},
 		methods: {
-			data() {
-				console.log("@@@")
+			data(e) {
+				console.log(e)
+				this.input = e
+				console.log(this.input)
+				request({
+						url: '/myPage/getPageScanRewordList',
+						method: 'post',
+						data: {
+							'storeId': '1000',
+							'userId': '123',
+							'current': '1',	
+							'size': '10',
+							'searchKey': this.input
+						}
+					}).then(res => {
+						console.log(res)
+						this.datalist = res.data.data
+						// 判断扫码类型
+						for (var i = 0; i < res.data.data.length; i++) {
+							if (res.data.data[i].getWay == 0) {
+								this.getWay = "车主扫码"
+							} else {
+								this.getWay = "门店扫码"
+							}
+						}
+						console.log(res.data.data)
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 1000)
+				
+					})
+				
 			}
 		}
 	}
@@ -94,6 +141,8 @@
 		color: #626262;
 	}
 	.content-two {
+		font-size: 24rpx;
+		color: #6A6A6A;
 		display: flex;
 		justify-content: space-between;
 		width: 600rpx;
@@ -101,7 +150,7 @@
 	}
 	
 	.content-two>view:nth-child(2) {
-		margin-bottom: 30rpx;
+		margin-bottom: 20rpx;
 		
 	}
 </style>

+ 9 - 1
pages/msg/index.vue

@@ -79,6 +79,13 @@
 			};
 		},
 		methods: {
+			inSystem(index) {
+				console.log(index)
+				this.$u.route({
+					url: 'pages/msg/System-message/index',
+					
+				})
+			},
 					click(index, index1) {
 						if(index1 == 1) {
 							this.msgList.splice(index, 1);
@@ -97,7 +104,8 @@
 							if(index != idx) this.msgList[idx].show = false;
 						})
 					}
-				}
+				},
+				
 	};
 </script>