tong il y a 4 ans
Parent
commit
3a78670660
4 fichiers modifiés avec 164 ajouts et 50 suppressions
  1. 5 2
      manifest.json
  2. 1 0
      pages/home/index.vue
  3. 140 25
      pages/me/Reward-details/index.vue
  4. 18 23
      pages/msg/index.vue

+ 5 - 2
manifest.json

@@ -24,7 +24,9 @@
         "usingComponents" : true,
         "nvueCompiler" : "uni-app",
         "compilerVersion" : 3,
-        "modules" : {},
+        "modules" : {
+            "Maps" : {}
+        },
         "distribute" : {
             "android" : {
                 "permissions" : [
@@ -55,7 +57,8 @@
             },
             "ios" : {},
             "sdkConfigs" : {
-                "ad" : {}
+                "ad" : {},
+                "maps" : {}
             },
             "icons" : {
                 "android" : {

+ 1 - 0
pages/home/index.vue

@@ -74,6 +74,7 @@
 					"showPosition": 0, //门店0
 					}
 				}).then(res => {
+					console.log(res)
 					this.list = res.data.data
 					this.bannersList = this.list.map(t => t.imgPath)
 				}).catch(err => {

+ 140 - 25
pages/me/Reward-details/index.vue

@@ -2,13 +2,13 @@
 	<!-- 奖励明细页面 -->
 	<view class="header">
 		<view class="header-one">
-			库存总量:<text>999</text>
 		</view>
+
 		<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;" v-model="showBrand" :list="brandList"></u-select>
-			<u-calendar style=" color: #fff;" v-model="showDate" :mode="mode"></u-calendar>
+			<u-select style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" laber-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>
 			</view>
@@ -16,38 +16,39 @@
 		<view class="content-one" v-for="(item,index) in datalist" :key="index">
 			<view class="content-one-view">
 			</view>
-			<view class="content-one-text">获得奖励:2元</view>
+			<view class="content-one-text">获得奖励:{{item.money}}元</view>
+
 
 			<view class="content-two">
 				<view class="">
 					轮胎型号
 				</view>
 				<view class="">
-					SAILUN 12R22.5 18PR S838
+					{{item.tireModel}}
 				</view>
 			</view>
 			<view class="content-two">
 				<view class="">
-					轮胎型
+					扫码胎
 				</view>
 				<view class="">
-					SAILUN 12R22.5 18PR S838
+					{{item.tyreNum}}
 				</view>
 			</view>
 			<view class="content-two">
 				<view class="">
-					轮胎型号
+					奖励类型
 				</view>
 				<view class="">
-					SAILUN 12R22.5 18PR S838
+					{{getWay}}
 				</view>
 			</view>
 			<view class="content-two">
 				<view class="">
-					轮胎型号
+					获得时间
 				</view>
 				<view class="">
-					SAILUN 12R22.5 18PR S838
+					{{item.createTime}}
 				</view>
 			</view>
 		</view>
@@ -57,12 +58,15 @@
 </template>
 
 <script>
+	import {
+		request
+	} from '../../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
-				datalist: [{},
-					{}
-				],
+				datalist: [],
+				getWay: '',
 				list: [{
 					name: '全部'
 				}, {
@@ -84,22 +88,133 @@
 					body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
 					open: false,
 				}],
-				brandList: [{
-						value: '1',
-						label: '赛轮'
-					},
-					{
-						value: '2',
-						label: '黑鹰'
-					}
-				],
+				brandList:[],
+				// brandList: [{
+				// 		value: '1',
+				// 		label: '赛轮'
+				// 	},
+				// 	{
+				// 		value: '2',
+				// 		label: '黑鹰'
+				// 	}
+				// ],
 				current: 0,
 				showBrand: false,
 				showDate: false,
-				mode: 'date'
+				mode: 'range',
+				// 开始时间
+				startTime: '',
+				// 结束时间
+				endTime: '',
+				
 			};
 		},
+		created() {
+			this.data()
+			this.getBrandList()
+		},
 		methods: {
+			// 获取奖励明细
+			data() {
+				request({
+						url: '/myPage/getPageScanRewordList',
+						method: 'post',
+						data: {
+							'storeId': '1000',
+							'userId': '123',
+							'current': '1',
+							'size': '10'
+						}
+					}).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)
+
+					})
+			},
+			// 时间选择器获取时间
+			changetime(e) {
+				console.log(e)
+				this.startTime = e.startDate
+				this.endTime = e.endDate
+				request({
+						url: '/myPage/getPageScanRewordList',
+						method: 'post',
+						data: {
+							'storeId': '1000',
+							'userId': '123',
+							'current': '1',	
+							'size': '10',
+							'startTime': this.startTime +' 00:00:00',
+							'endTime': this.endTime +' 00:00:00'
+						}
+					}).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)
+				
+					})
+			},
+			// 获取品牌列表
+			getBrandList() {
+				request({
+						url: '/baseReq/getBrandList',
+						method: 'post',
+						data: {
+							'storeId': '1000',
+							'userId': '123'	
+						}
+					}).then(res => {
+						console.log(res)
+						this.brandList = res.data.data
+						console.log(this.brandList)
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 1000)
+				
+					})
+			},
+			// 点击获取品牌
+			confirm(e) {
+				console.log(e)
+				},
 			search() {
 				this.$u.route({
 					url: 'pages/me/search/index',
@@ -128,7 +243,7 @@
 
 	.header-one {
 		text-align: center;
-		padding-top: 40rpx;
+		padding-top: 10rpx;
 	}
 
 	.header-one>text {

+ 18 - 23
pages/msg/index.vue

@@ -79,30 +79,25 @@
 			};
 		},
 		methods: {
-			click(index, index1) {
-				if (index1 == 1) {
-					this.list.splice(index, 1);
-					this.$u.toast(`删除了第${index}个cell`);
-				} else {
-					this.list[index].show = false;
-					this.$u.toast(`收藏成功`);
+					click(index, index1) {
+						if(index1 == 1) {
+							this.msgList.splice(index, 1);
+							this.$u.toast(`删除了第${index}个cell`);
+						} else {
+							this.msgList[index].show = false;
+							this.$u.toast(`收藏成功`);
+						}
+					},
+					// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
+					open(index) {
+						// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
+						// 原本为'false',再次设置为'false'会无效
+						this.msgList[index].show = true;
+						this.msgList.map((val, idx) => {
+							if(index != idx) this.msgList[idx].show = false;
+						})
+					}
 				}
-			},
-			// 如果打开一个的时候,不需要关闭其他,则无需实现本方法
-			open(index) {
-				// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
-				// 原本为'false',再次设置为'false'会无效
-				this.list[index].show = true;
-				this.list.map((val, idx) => {
-					if (index != idx) this.list[idx].show = false;
-				})
-			},
-			inSystem(){
-				this.$u.route({
-					url: 'pages/msg/System-message/index',
-				})
-			}
-		}
 	};
 </script>