Parcourir la source

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

qukaidi il y a 5 ans
Parent
commit
b5212c0a7f

+ 12 - 1
common/request/request.js

@@ -16,8 +16,19 @@
 import axios from 'axios'
 
 export function request(config) {
+	let baseURL;
+	// uEnvDev;开发者模式,点击运行
+	if (process.env.NODE_ENV === 'development') {
+	    // TODO
+		baseURL = "http://b2bcnapi.sailuntire.com/allstell/test/app"
+	}
+	// uEnvProd;生产模式,点击发行
+	if (process.env.NODE_ENV === 'production') {
+	    // TODO
+		baseURL = "http://b2bcnapi.sailuntire.com/allstell/test/app";
+	};
     let newVar = axios.create({
-        baseURL: "http://b2bcnapi.sailuntire.com/allstell/test/app",
+        baseURL: baseURL,
         timeout: 10000
     });
     return newVar(config);

+ 2 - 1
pages/home/integral-mall/integral_mall.vue

@@ -70,7 +70,8 @@
 		data() {
 			return {
 				buttonCustomStyle: {
-					border: "none"
+					border: "none",
+					background: "transparent"
 				},
 				brandValue: "",
 				brandOptions: [{

+ 21 - 5
pages/home/monthly-policy/monthly-policy.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<!-- 月度政策 -->
-		
+		<view class="aa" ref="monthlyPolicy" v-html="contentDetail"></view>
 	</view>
 </template>
 
@@ -13,7 +13,7 @@
 	export default {
 		data() {
 			return {
-				
+				contentDetail: null
 			}
 		},
 		onLoad() {
@@ -21,6 +21,10 @@
 		},
 		methods: {
 			handleGetData: function(){
+				uni.showLoading({
+					title: "加载中"
+				});
+				var _this = this;
 				request({
 					url: '/homepage/getArticleOne',
 					method: 'post',
@@ -28,14 +32,26 @@
 						"displayType": "1" //门店1
 					}
 				}).then(res => {
-					console.log(res)
+					if(res.data.code==0){
+						_this.contentDetail = res.data.data.contentDetail;
+					}else{
+						uni.showToast({
+							title: res.data.msg,
+							icon: "none",
+							duration: _this.$store.state.showToastDuration
+						});
+					};
 				}).catch(err => {
-					
+					uni.showToast({
+						title:  _this.$store.state.showServerErrorMsg,
+						icon: "none",
+						duration: _this.$store.state.showToastDuration
+					});
 				}).finally(() => {
 					setTimeout(() => {
 						uni.hideLoading();
 						this.loading = false;
-					}, 1000)
+					}, 1000);
 				})
 			}
 		}

+ 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()
 			}
 		}
 	}

+ 219 - 124
pages/me/agent-stock/agent-stock.vue

@@ -1,147 +1,231 @@
 <template>
 	<!-- 经销商库存页面 -->
-	<view class="header">
-		<view class="header-one">
-			库存是否充足:<text>充足</text>
-		</view>
+	<scroll-view scroll-y @scrolltolower="scrollBottom" class="scroll-view-container">
+		<view class="header">
+			<view class="header-one">
+				库存是否充足:<text>{{total | filterTotal}}</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-select style=" color: #fff;" v-model="showmateriel" :list="materielList"></u-select>
+				<u-button :custom-style="buttonCustomStyle" :hair-line="false" hover-class="none" @click="changeTab(0)">全部</u-button>
+				<u-button :custom-style="buttonCustomStyle" :hair-line="false" hover-class="none" @click="changeTab(1)">品牌</u-button>
+				<u-button :custom-style="buttonCustomStyle" :hair-line="false" hover-class="none" @click="changeTab(2)">花纹</u-button>
+				<u-select style=" color: #fff;" v-model="showBrand" :list="brandList" @confirm="confirmBrand"></u-select>
+				<u-select style=" color: #fff;" v-model="showpattern" :list="patternList" @confirm="confirmPattern"></u-select>
 				<!-- <u-calendar style=" color: #fff;" v-model="showDate" :mode="mode"></u-calendar> -->
-				<u-search :show-action="true" :animation="true"></u-search>
+				<u-search :show-action="true" v-model="currentSpec" :animation="true" @custom="searchSpec" @search="searchSpec"
+				 :style="inputCustomStyle" @focus="inputFocus" @blur="inputBlur" placeholder="请输入规格"></u-search>
 			</view>
-			<view class="content-one">
+			
+		</view>
+		<view class="content-one">
+			<template v-if="datalist&&datalist.length">
 				<view class="content-two" v-for="(item,index) in datalist" :key="index">
 					<view>
-						{{ item.name }}
+						{{ item.brand }}
 					</view>
 					<view>
-						{{ item.number}}
+						{{ item.maktx}}
 					</view>
 					<view>
-						{{ item.state }}
+						{{ item.stock | filterTotal }}
 					</view>
 				</view>
-			</view>
-			
-			
-	</view>
+			</template>
+			<view class="nodata" v-else>暂无数据</view>
+		</view>
+		<u-loadmore v-if="datalist&&datalist.length" :status="loadStatus" bgColor="#f2f2f2"></u-loadmore>
+	</scroll-view>
 </template>
 
 <script>
+	import {
+		request
+	} from '@/common/request/request';
+	require("promise.prototype.finally").shim();
 	export default {
-			data() {
-				return {
-					datalist: [
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '紧张'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-						{
-							name: '赛轮',
-							number: '12R22.5 152/149K 18PR S838 LBGSL 0L',
-							state: '充足'
-						},
-					],
-					list: [{
-						name: '全部'
-					}, {
-						name: '品牌'
-					}, {
-						name: '物料',
-					}],
-					itemList: [{
-										head: "赛轮 12R22.5 18PR S838",
-										body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
-										open: true,
-										disabled: true
-									},{
-										head: "赛轮 12R22.5 18PR S838",
-										body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
-										open: false,
-									},{
-										head: "赛轮 12R22.5 18PR S838",
-										body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
-										open: false,
-									}],
-					brandList: [{
-							value: '1',
-							label: '赛轮'
-						},
-						{
-							value: '2',
-							label: '黑鹰'
-						}
-					],
-					materielList: [{
-							value: '1',
-							label: '物料1'
-						},
-						{
-							value: '2',
-							label: '物料2'
-						}
-					],
-					current: 0,
-					showBrand: false,
-					showmateriel: false,
-					showDate: false,
-					mode: 'date'
-				};
+		data() {
+			return {
+				buttonCustomStyle: {
+					border: "none",
+					background: "#0094FE",
+					color: "#ffffff"
+				},
+				total: 0, //总库存数
+				datalist: null,
+				// 品牌信息
+				brandList: null,
+				currenBrand: "", // 选中品牌
+				showBrand: false,
+				// 花纹信息
+				patternList: null,
+				currentPattern: "", // 选中花纹
+				showpattern: false,
+				// 规格信息
+				currentSpec: "",
+				inputCustomStyle: {},
+				// 选中tab
+				currentTab: 0,
+				// showDate: false,
+				// mode: 'date',
+				// 分页信息
+				pageSize: 10, //每页条数
+				currentPage: 1, //当前页码
+				totalPage: 0, //总页码数
+				loadStatus: "loadmore"
+			};
+		},
+		onLoad() {
+			this.handleGetData();
+		},
+		methods: {
+			scrollBottom(v) {
+				console.log(v);
+				this.loadStatus = 'loading';
+				// 模拟数据加载
+				setTimeout(() => {
+					this.currentPage += 1;
+					this.handleGetData();
+					this.loadStatus = 'loadmore';
+				}, 1000)
 			},
-			methods: {
-				change(index) {	
-					this.current = index;
-					if(this.current==1){
-						this.showBrand=true
-					}else if(this.current==2){
-						this.showmateriel=true
+			changeTab(index) {
+				this.currentTab = index;
+				if (this.currentTab == 0) {
+					this.currenBrand = "";
+					this.currentPattern = "";
+					this.currentSpec = "";
+					this.currentPage = 1;
+					this.handleGetData();
+				} else if (this.currentTab == 1) {
+					this.showBrand = true
+				} else if (this.currentTab == 2) {
+					this.showpattern = true
+				}
+			},
+			// 获取数据
+			handleGetData() {
+				uni.showLoading({
+					title: "加载中"
+				});
+				var _this = this;
+				request({
+					url: '/app/appAgent/getStoreAgentStock',
+					method: 'post',
+					data: {
+						storeId: "990289",
+						pageSize: _this.pageSize,
+						page: _this.currentPage,
+						brand: _this.currenBrand,
+						spec: _this.currentSpec,
+						pattern: _this.currentPattern
 					}
-				},
-				handleGetData(){
-					
+				}).then(res => {
+					if (res.data.code == 0) {
+						console.log(res)
+						// 获取品牌列表
+						_this.brandList = [];
+						res.data.data.brandList.forEach(function(val, index) {
+							_this.brandList.push({
+								value: index,
+								label: val
+							});
+						});
+						// 获取花纹列表
+						_this.patternList = [];
+						res.data.data.patternList.forEach(function(val, index) {
+							_this.patternList.push({
+								value: index,
+								label: val
+							});
+						});
+						// 获取数据列表
+						_this.datalist = res.data.data.list;
+						_this.total = res.data.data.stock;
+						_this.totalPage = res.data.data.totalPage;
+						// 分页
+						if(_this.currentPage<_this.totalPage){
+							_this.loadStatus = "loadMore"
+						}else{
+							_this.loadStatus = "nomore"
+						}
+					} else {
+						console.log(res)
+						uni.showToast({
+							title: res.data.msg,
+							icon: "none",
+							duration: _this.$store.state.showToastDuration
+						});
+					}
+				}).catch(err => {
+					console.log(err)
+					uni.showToast({
+						title: _this.$store.state.showServerErrorMsg,
+						icon: "none",
+						duration: _this.$store.state.showToastDuration
+					});
+					this.currentPage -= 1;
+				}).finally(() => {
+					setTimeout(() => {
+						uni.hideLoading();
+						this.loading = false;
+					}, 1000)
+				});
+			},
+			// 筛选品牌
+			confirmBrand: function(v) {
+				this.currenBrand = v[0].label;
+				this.currentPage = 1;
+				this.handleGetData();
+			},
+			// 筛选花纹
+			confirmPattern: function(v) {
+				this.currentPattern = v[0].label;
+				this.currentPage = 1;
+				this.handleGetData();
+			},
+			searchSpec: function() {
+				if(this.currentSpec){
+					this.currentPage = 1;
+					this.handleGetData();
 				}
+				console.log(this.currentSpec)
+				
+			},
+			inputFocus() {
+				console.log(111);
+				this.inputCustomStyle = {
+					position: "absolute",
+					zIndex: "100",
+					width: "98%",
+					margin: "6rpx 1%"
+				};
+			},
+			inputBlur() {
+				var _this = this;
+				setTimeout(function() {
+					_this.inputCustomStyle = {};
+				}, 30)
+
 			}
+		},
+		filters: {
+			filterTotal: function(val) {
+				var valText;
+				if (val >= 10) {
+					valText = "充足"
+				} else {
+					valText = "紧张"
+				};
+				return valText;
+			}
+		}
 	}
 </script>
 
 <style lang="scss" scoped>
+	.scroll-view-container{
+		height: 100%;
+	}
 	.header {
 		height: 400rpx;
 		width: 100%;
@@ -158,12 +242,14 @@
 	.header-one>text {
 		font-size: 52rpx;
 	}
+
 	.content {
 		display: flex;
 		justify-content: space-between;
 		width: 700rpx;
 		margin-top: 80rpx;
 	}
+
 	.content-one {
 		width: 690rpx;
 		// height: 305rpx;
@@ -172,9 +258,10 @@
 		font-size: 24rpx;
 		box-shadow: 0px 0px 24px 0px rgba(101, 176, 249, 0.41);
 		border-radius: 20px;
-		margin: 0 auto;
-		margin-top: 50rpx;
+		margin: -100rpx auto 20rpx auto;
+		min-height: calc(100% - 400rpx);
 	}
+
 	.content-one-view {
 		width: 6rpx;
 		height: 30rpx;
@@ -183,6 +270,7 @@
 		top: 20rpx;
 		left: 30rpx;
 	}
+
 	.content-one-text {
 		position: relative;
 		top: -8rpx;
@@ -191,6 +279,7 @@
 		font-weight: bold;
 		color: #000;
 	}
+
 	.content-one-time {
 		position: relative;
 		top: -40rpx;
@@ -198,10 +287,10 @@
 		font-size: 13rpx;
 		color: #626262;
 	}
-	
+
 	.content-two {
 		display: flex;
-        justify-content: space-between;
+		justify-content: space-between;
 		font-size: 24rpx;
 		color: #6A6A6A;
 		margin-left: 30rpx;
@@ -209,5 +298,11 @@
 		padding-top: 25rpx;
 		padding-bottom: 25rpx;
 	}
-	
+
+	.wrap-flex {
+		display: flex;
+	}
+	.nodata{
+		padding: 48rpx;
+	}
 </style>

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

+ 5 - 1
store/index.js

@@ -60,7 +60,11 @@ const store = new Vuex.Store({
 				customIcon: false,
 				pagePath: '/pages/me/index'
 			},
-		]
+		],
+	
+		//显示提示消息相关配置
+		showToastDuration : 4000,
+		showServerErrorMsg: '连接服务器异常!',
 	},
 	mutations: {
 		$uStore(state, payload) {