Browse Source

Merge branch 'test' of http://git.echepei.com/sailun/sailun-tbr-web into test

wangxiaoying 4 years ago
parent
commit
f03050401c
5 changed files with 212 additions and 85 deletions
  1. 5 2
      manifest.json
  2. 43 30
      pages/home/index.vue
  3. 6 5
      pages/login/index.vue
  4. 140 25
      pages/me/Reward-details/index.vue
  5. 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" : {

+ 43 - 30
pages/home/index.vue

@@ -40,6 +40,7 @@
 		<!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
 		<!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
 		<u-skeleton :loading="loading" :animation="true"></u-skeleton>
+		<u-toast ref="ulogin" />
 	</view>
 </template>
 
@@ -56,6 +57,18 @@
 				loading: true, // 是否显示骨架屏组件
 			};
 		},
+		onLoad() {
+			uni.$on('login', (data) => {
+				this.loginStatus=data.msg
+			})
+		},
+		onReady() {
+			if (this.loginStatus=="登录成功") {
+				this.$refs.ulogin.show({
+					title:"登录成功",
+				})
+			}
+		},
 		created() {
 			this.getBanners();
 			this.getTiceList()
@@ -67,24 +80,24 @@
 					title: '加载中...'
 				});
 				request({
-					url: '/homepage/getBanners',
-					method: 'post',
-				data: {
-					"storeId": '1000',
-					"showPosition": 0, //门店0
-					}
-				}).then(res => {
-					this.list = res.data.data
-					this.bannersList = this.list.map(t => t.imgPath)
-				}).catch(err => {
-					console.log(err)
-				})
-				.finally(() => {
-					setTimeout(() => {
-						uni.hideLoading();
-						this.loading = false;
-					}, 1000)
-				})
+						url: '/homepage/getBanners',
+						method: 'post',
+						data: {
+							"storeId": '1000',
+							"showPosition": 0, //门店0
+						}
+					}).then(res => {
+						this.list = res.data.data
+						this.bannersList = this.list.map(t => t.imgPath)
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
 			},
 			//消息文字跑马灯
 			getTiceList() {
@@ -98,18 +111,18 @@
 							"storeId": "1000",
 							"contentType": "1" //门店1
 						}
-				}).then(res => {
-					this.list = res.data.data
-					this.noticebarList = this.list.map(t => t.msgContent)
-				}).catch(err => {
-					console.log(err)
-				})
-				.finally(() => {
-					setTimeout(() => {
-						uni.hideLoading();
-						this.loading = false;
-					}, 1000)
-				})
+					}).then(res => {
+						this.list = res.data.data
+						this.noticebarList = this.list.map(t => t.msgContent)
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						setTimeout(() => {
+							uni.hideLoading();
+							this.loading = false;
+						}, 300)
+					})
 			},
 			scancodeIn() {
 				this.$u.route({

+ 6 - 5
pages/login/index.vue

@@ -42,7 +42,6 @@
 				<u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30">赛轮店管家</u-divider>
 			</view>
 		</view>
-		<u-toast ref="uToast" />
 	</view>
 </template>
 
@@ -65,8 +64,9 @@
 					setTimeout(() => {
 						this.$u.route({
 							url: 'pages/home/index',
-							type: 'switchTab'
+							type: 'switchTab',
 						})
+						uni.$emit('login',{msg:'登录成功'})
 						this.loading = false
 					}, 2000)
 				}
@@ -100,10 +100,11 @@
 
 <style lang="scss" scoped>
 	.status_bar {
-	    height: var(--status-bar-height);
-	    width: 100%;
-		  background-color:#0095FF;
+		height: var(--status-bar-height);
+		width: 100%;
+		background-color: #0095FF;
 	}
+
 	.content {
 		position: relative;
 		top: -350rpx;

+ 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>