Ver Fonte

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

caojunjie há 4 anos atrás
pai
commit
1428420b03

+ 13 - 5
pages.json

@@ -319,11 +319,19 @@
 
 		}, {
 			"path": "register_map",
-			"style": {
-				"navigationBarTitleText": "地图"
-			}
-
-		}]
+              "style": {
+				"navigationBarTitleText": "地图",
+				"app-plus": {
+					"titleNView": {
+						"buttons": [{
+							"text": "确认",
+							"fontSize": "16"
+						}]
+					}
+				}
+            }
+                
+        }]
 	}],
 	"preloadRule": {},
 	"globalStyle": {

+ 204 - 43
pages/home/my-stock/my-stock.vue

@@ -1,95 +1,256 @@
 <template>
-	<view >
+	<view class="page">
 		<!-- 我的库存 -->
 		<view class="content-top">
 			<u-navbar :background="background" back-icon-color="#ffffff" is-fixed>
-				<u-search placeholder="请输入轮胎规格" :show-action="false" v-model="keyword" style="margin-right: 26rpx;" @change="handleSearch"></u-search>
+				<u-search placeholder="请输入轮胎规格" v-model="keyword" style="margin-right: 26rpx;" @custom="handleSearch"></u-search>
 			</u-navbar>
-			<u-tabs ref="tabs" :list="list" bg-color="#0094FE" active-color="#ffffff" inactive-color="#ffffff" font-size="30" :current="current" @change="handleFilterBrand"></u-tabs>
+			<u-tabs ref="tabs" name="brandName" :list="brandlLst" bg-color="#0094FE" active-color="#ffffff" inactive-color="#ffffff"
+			 font-size="30" :current="current" @change="handleFilterBrand"></u-tabs>
 		</view>
-		<view class="content-center">
-			<view class="list-row u-flex list-title">
-				<view class="list-left">轮胎规格</view>
-				<view class="list-right">库存</view>
+		<scroll-view scroll-y @scrolltolower="scrollBottom" class="scroll-view-container">
+			<view class="content-center">
+				<view class="list-row u-flex list-title">
+					<view class="list-left">轮胎规格</view>
+					<view class="list-right">库存</view>
+				</view>
+				<template v-if="datalist&&datalist.length">
+					<view class="list-row u-flex u-skeleton" v-for="item in datalist" :key="item.matDescribe">
+						<view class="list-left u-skeleton-rect">{{item.matDescribe}}</view>
+						<view class="list-right u-skeleton-rect">{{item.stock}}</view>
+					</view>
+				</template>
+				<u-empty v-else text="暂无数据" mode="list"></u-empty>
 			</view>
-			<view class="list-row u-flex">
-				<view class="list-left">赛轮 12R22.5 152/149K 18PR S838</view>
-				<view class="list-right">160</view>
-			</view>
-			<view class="list-row u-flex">
-				<view class="list-left">赛轮 12R22.5 152/149K 18PR S838</view>
-				<view class="list-right">160</view>
-			</view>
-		</view>
+			<u-loadmore v-if="datalist&&datalist.length" :status="loadStatus" bgColor="#f2f2f2" :load-text="loadText"></u-loadmore>
+		</scroll-view>
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '@/common/request/request';
+	require("promise.prototype.finally").shim();
 	export default {
 		data() {
 			return {
 				background: {
 					backgroundColor: "#0291FD",
 				},
-				keyword: "",
 				current: 0,
-				list: [{
-					name: "全部"
-				},{
-					name: "黑骑士"
-				},{
-					name: "路极"
-				},{
-					name: "黑盾"
-				},{
-					name: "赛轮"
-				}]
+				// 筛选条件
+				keyword: "", //搜索规格
+				currentBrand: "", //选中的品牌
+				brandlLst: [{
+					brandName: "全部"
+				}],
+				// 分页信息
+				first: 0,
+				pageSize: 10, //每页条数
+				currentPage: 1, //当前页码
+				totalPage: 0, //总页码数
+				loadStatus: "loadmore",
+				loadText: {
+					loadmore: '轻轻上拉',
+					loading: '努力加载中',
+					nomore: '实在没有了'
+				},
+				// 数据信息
+				datalist: []
 			}
 		},
+		onLoad() {
+			uni.showLoading({
+				title: "加载中"
+			});
+			this.handleGetFilterData();
+			this.handleGetData();
+		},
 		methods: {
-			handleSearch: function(v){
+			scrollBottom(v) {
+				console.log(v);
+				if (this.loadStatus == "loadmore") {
+					this.loadStatus = 'loading';
+					uni.showLoading({
+						title: "加载中"
+					});
+					// 模拟数据加载
+					this.first += 1;
+					this.currentPage += 1;
+					this.handleGetData();
+					this.loadStatus = 'loadmore';
+				}
+
+			},
+
+			handleSearch: function(v) {
+				this.first = 0;
+				this.currentPage = 1;
 				console.log(v)
+				this.handleGetData();
 			},
-			handleFilterBrand: function(v2){
-				this.current = v2
+			handleFilterBrand: function(v2) {
+				this.first = 0;
+				this.currentPage = 1;
+				this.current = v2;
+				this.currentBrand = this.brandlLst[this.current].brandCode;
+				this.handleGetData();
 				console.log(arguments);
-				console.log(v2)
-			}
+				console.log(this.brandlLst[this.current].brandCode)
+			},
+			handleGetFilterData: function() {
+				var _this = this;
+				request({
+					url: '/baseReq/getBrandListByStoreId',
+					method: 'Post',
+					data: {
+						storeId: 1000,
+						userId: "1"
+					}
+				}).then(res => {
+					if (res.data.code == 0) {
+						console.log(res)
+						// 获取品牌列表
+						_this.brandlLst = res.data.data;
+						_this.brandlLst.unshift({
+							brandName: "全部",
+							brandCode: "all"
+						});
+					} 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)
+				});
+			},
+			// 获取数据
+			handleGetData() {
+				uni.showLoading({
+					title: "加载中"
+				});
+				var _this = this;
+				request({
+					url: '/homepage/storeGetStock',
+					method: 'post',
+					data: {
+						storeId: "1000",
+						userId: "1",
+						current: _this.currentPage,
+						pageSize: _this.pageSize,
+						brandCode: _this.currentBrand=="all"?"":_this.currentBrand,
+						specKey: _this.keyword
+					}
+				}).then(res => {
+					if (res.data.code == 0) {
+						console.log(res)
+						// 获取数据列表
+						if (_this.first == 0) {
+							_this.datalist = [];
+							_this.datalist = _this.datalist.concat(res.data.data);
+							_this.total = parseInt(res.data.count);
+							_this.totalPage = Math.ceil(_this.total / _this.pageSize);
+							console.log(_this.totalPage)
+						} else {
+							console.log(_this.currentPage);
+							console.log(_this.totalPage)
+							_this.datalist = _this.datalist.concat(res.data.data);
+							console.log(_this.datalist.length)
+						};
+						// 分页
+						if (_this.currentPage < _this.totalPage) {
+							_this.loadStatus = "loadmore"
+						} else {
+							console.log("nomore")
+							_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)
+				});
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.content-top{
+	.page{
+		width: 100%;
+		height: 100%;
+	}
+	.content-top {
 		background-color: #0094FE;
 		padding-bottom: 119rpx;
 	}
-	.content-center{
+
+	.scroll-view-container {
+		margin-top: -106rpx;
+		height: calc(100% - 206rpx);
+	}
+
+	.content-center {
 		width: 712rpx;
-		margin: -106rpx auto 0 auto;
+		margin: 0 auto 0 auto;
 		border-radius: 20rpx;
 		background-color: #FFFFFF;
-		height: 335rpx;
+	
 		padding: 26rpx;
-		.list-row{
+
+		.list-row {
 			justify-content: space-between;
 			border-bottom: 1px solid #E8E8E8;
 			padding: 32rpx 0;
-			.list-right{
+
+			.list-right {
 				color: #149EE2;
 				text-decoration: underline;
 			}
 		}
-		.list-row.list-title{
+
+		.list-row.list-title {
 			padding-top: 0;
 			font-weight: 600;
-			.list-right{
+
+			.list-right {
 				color: #4D4D4D;
 				font-weight: 400;
 				text-decoration: none;
 			}
 		}
-		
+
 	}
-	
 </style>

+ 55 - 23
pages/login/register.vue

@@ -8,7 +8,8 @@
 				</view>
 			</view>
 			<view slot="body">
-				<u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center" :before-upload="storeUpload">
+				<u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center" :action="action" :form-data="licensepicType"
+				 @on-change="getLicensedata">
 					<view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
 						<u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
 					</view>
@@ -16,7 +17,8 @@
 				<view class="u-flex u-row-center" style="color: #787878;margin: 20rpx 0 60rpx 0;">
 					点击上传营业执照
 				</view>
-				<u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center">
+				<u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center" :action="action" :form-data="storepicType"
+				 @on-change="getStoredata">
 					<view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
 						<u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
 					</view>
@@ -30,17 +32,29 @@
 			注:上传完营业执照请确认和营业执照一致。
 		</view>
 		<view style="margin: 30rpx;">
-			<u-button type="primary" :ripple="true" ripple-bg-color="#99d4ff" @click="nextStep">下一步</u-button>
+			<!-- <u-button type="primary" @click="nextStep" v-if="showLicense&&showStore">下一步</u-button> -->
+			<u-button type="primary" @click="nextStep">下一步</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
-	import axios from 'axios'
+	import {
+		request
+	} from '../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
-				action: ""
+				action: "http://b2bcnapi.sailuntire.com/allstell/test/app/sailun/appStoreBasicInfo/storeupload",
+				licensepicType: {
+					"pictype": "license"
+				},
+				storepicType: {
+					"pictype": "store"
+				},
+				showLicense:false,
+				showStore:false,
 			};
 		},
 		methods: {
@@ -48,26 +62,44 @@
 				this.$u.route({
 					url: 'pages/login/register_2',
 				})
-			},
-			storeUpload(index, list) {
-				let file = list[0].file.path
-				console.log(file)
-				let param = new FormData() // 创建form对象
-				param.append('file', file) // 通过append向form对象添加数据
-				param.append('pictype', 'store') // 添加form表单中其他数据
-				let config = {
-					headers: {
-						'Content-Type': 'multipart/form-data'
-					}
+				if(this.licenseDate){
+					uni.$emit('licenseData',this.licenseDate)
 				}
-				axios.post('/appStoreBasicInfo/storeupload', param, config)
-					.then(res => {
-						console.log("上传上去了吗")
-						console.log(res)
-					})
-					.catch(err => {
+				uni.$emit('dataUrl',{licenseUrl:this.licenseUrl,storeUrl:this.storeUrl})
+			},
+			getLicensedata(res, index, lists, name) {
+				if (res.statusCode == 200) {
+					this.$u.toast('上传成功');
+					uni.hideLoading();
+					this.licenseUrl = JSON.parse(res.data).data
+					request({
+						url: '/sailun/appStoreBasicInfo/licenseAnalyse',
+						method: 'post',
+						data: {
+							"fileBox": this.licenseUrl,
+						}
+					}).then(res => {
+						if (res.data.code == 0) {
+							this.$u.toast('识别成功');
+							this.licenseDate = res.data.data.wordsResultQuery
+							this.showLicense=true
+						}
+						if (res.data.code == 500) {
+							this.$refs.uToast.show({
+								title: res.data.msg,
+							})
+						}
+					}).catch(err => {
 						console.log(err)
-					})
+					}).finally(() => {})
+				}
+			},
+			getStoredata(res, index, lists, name) {
+				if (res.statusCode == 200) {
+					this.$u.toast('上传成功');
+					this.storeUrl = JSON.parse(res.data).data
+					this.showStore=true
+				}
 			}
 		},
 	}

+ 148 - 73
pages/login/register_2.vue

@@ -19,7 +19,7 @@
 						<view style="margin-right: 10rpx;">
 							<u-icon name="home" size="36"></u-icon>
 						</view>
-						<u-input v-model="form.company" placeholder="请输入公司名称" />
+						<u-input v-model="form.company" placeholder="请输入公司名称" :disabled="true" />
 					</u-form-item>
 					<u-form-item prop="name">
 						<view style="margin-right: 10rpx;">
@@ -31,13 +31,13 @@
 						<view style="margin-right: 10rpx;">
 							<u-icon name="phone" size="36"></u-icon>
 						</view>
-						<u-input v-model="form.phone" placeholder="请输入联系电话" type="number"/>
+						<u-input v-model="form.phone" placeholder="请输入联系电话" type="number" />
 					</u-form-item>
 					<u-form-item prop="code">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="lock" size="36"></u-icon>
 						</view>
-						<u-input v-model="form.code" placeholder="请输入验证码" type="number"/>
+						<u-input v-model="form.code" placeholder="请输入验证码" type="number" />
 						<view class="" slot="right">
 							<u-button size="mini" type="primary" @click="getCode" shape="circle">{{codeText}}</u-button>
 						</view>
@@ -46,27 +46,28 @@
 						<view style="margin-right: 10rpx;">
 							<u-icon name="map" size="36"></u-icon>
 						</view>
-						<u-input :select-open="pickerShow" v-model="form.region" placeholder="点击选择省市区" @click="pickerShow = true" :disabled="true"></u-input>
+						<u-input :select-open="pickerShow" v-model="form.region" placeholder="点击选择省市区" @click="pickerShow = true"
+						 :disabled="true"></u-input>
 						<view class="" slot="right">
 							<u-icon name="arrow-right" color="#666666" size="36"></u-icon>
 						</view>
 					</u-form-item>
-					<u-form-item>
+					<u-form-item prop="addressInfo">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="map" size="36"></u-icon>
 						</view>
-						<u-input placeholder="点击选择详细地址" :disabled="true" @click="inMap"></u-input>
+						<u-input placeholder="点击选择详细地址" v-model="form.addressInfo" :disabled="true" @click="inMap"></u-input>
 						<view class="" slot="right">
 							<u-icon name="arrow-right" color="#666666" size="36"></u-icon>
 						</view>
 					</u-form-item>
 				</u-form>
 				<u-verification-code ref="uCode" @change="codeChange"></u-verification-code>
-				<u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm"></u-picker>
+				<u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm" :default-region="defaultRegion"></u-picker>
 			</view>
 		</u-card>
 		<view style="margin: 30rpx;">
-			<u-button @click="nextStep" type="primary" :ripple="true" ripple-bg-color="#99d4ff">下一步</u-button>
+			<u-button @click="nextStep" type="primary">下一步</u-button>
 		</view>
 	</view>
 </template>
@@ -81,6 +82,7 @@
 			return {
 				codeText: '',
 				pickerShow: false,
+				defaultRegion: [],
 				form: {
 					store: '',
 					company: '',
@@ -88,97 +90,170 @@
 					phone: "",
 					code: '',
 					region: '',
+					latitude: '',
+					longitude: '',
+					province: "",
+					city: "",
+					district: "",
+					addressInfo: "",
+
 				},
 				rules: {
-					store: [{
-						required: true,
-						message: '请输入门店名称',
-						trigger: 'blur,change'
-					}],
-					company: [{
-						required: true,
-						message: '请输入公司名称',
-						trigger: 'blur,change'
-					}],
-					name: [{
-						required: true,
-						message: '请输入联系人',
-						trigger: 'blur,change'
-					}],
-					phone: [{
-						required: true,
-						message: '请输入联系电话',
-						trigger: 'blur,change'
-					}],
-					code: [{
-						required: true,
-						message: '请输入验证码',
-						trigger: 'blur,change'
-					}],
-					region: [{
-						required: true,
-						message: '请选择地区',
-						trigger: 'change',
-					}],
+					// store: [{
+					// 	required: true,
+					// 	message: '请输入门店名称',
+					// 	trigger: 'blur,change'
+					// }],
+					// company: [{
+					// 	required: true,
+					// 	message: '请输入公司名称',
+					// 	trigger: 'blur,change'
+					// }],
+					// name: [{
+					// 	required: true,
+					// 	message: '请输入联系人',
+					// 	trigger: 'blur,change'
+					// }],
+					// phone: [{
+					// 	required: true,
+					// 	message: '请输入联系电话',
+					// 	trigger: 'blur,change'
+					// }],
+					// code: [{
+					// 	required: true,
+					// 	message: '请输入验证码',
+					// 	trigger: 'blur,change'
+					// }],
+					// region: [{
+					// 	required: true,
+					// 	message: '请选择地区',
+					// 	trigger: 'change',
+					// }],
+					// addressInfo: [{
+					// 	required: true,
+					// 	message: '请选择地区',
+					// 	trigger: 'change',
+					// }],
 				}
 			};
 		},
+		created() {
+			uni.$on('licenseData', (data) => {
+				this.form.store = data.company.words
+				this.form.company = data.company.words
+				this.form.name = data.person.words
+			})
+			uni.$on('addressData', (data) => {
+				console.log(data)
+				this.form.latitude = data.coord.latitude
+				this.form.longitude = data.coord.longitude
+				this.form.addressInfo = data.address
+			})
+			let that = this
+			uni.getLocation({
+				type: 'wgs84',
+				geocode: true,
+				success: function(res) {
+					switch (res.address.province) {
+						case "北京市":
+							{
+								that.city = "直辖市"
+								break;
+							}
+						case "天津市":
+							{
+								that.city = "直辖市"
+								break;
+							}
+						case "上海市":
+							{
+								that.city = "直辖市"
+								break;
+							}
+						case "重庆市":
+							{
+								that.city = "直辖市"
+								break;
+							}
+						default:
+							{
+								that.city = "不是直辖市"
+								break;
+							}
+					}
+					if (that.city == "直辖市") {
+						let RegionData = res.address.province + "," + that.city + "," + res.address.district
+						that.defaultRegion = RegionData.split(",");
+					} else {
+						let RegionData = res.address.province + "," + res.address.city + "," + res.address.district
+						that.defaultRegion = RegionData.split(",");
+					}
+				}
+			});
+		},
 		methods: {
 			nextStep() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
-						console.log('验证通过');
+						uni.$emit("formData", this.form)
 						this.$u.route({
 							url: 'pages/login/register_3',
 						})
+
 					} else {
 						console.log('验证失败');
 					}
-					
+
 				});
 			},
 			codeChange(text) {
 				this.codeText = text;
 			},
 			getCode() {
-				console.log(this.form.phone)
-				request({
-					url: '/sailun/appStoreBasicInfo/sendCode',
-					method: 'post',
-					data: {
-						"phoneNumber": parseInt(this.form.phone),
-					},
-				}).then(res => {
-					console.log(res)
-					if(res.data.code==0){
-						if (this.$refs.uCode.canGetCode) {
-							// 模拟向后端请求验证码
-							uni.showLoading({
-								title: '正在获取验证码',
-							})
-							setTimeout(() => {
-								uni.hideLoading();
-								// 通知验证码组件内部开始倒计时
-								this.$refs.uCode.start();
-							}, 1000);
-						} else {
-							this.$u.toast('倒计时结束后再发送');
+				if (this.form.phone) {
+					request({
+						url: '/sailun/appStoreBasicInfo/sendCode',
+						method: 'post',
+						data: {
+							"phoneNumber": parseInt(this.form.phone),
+						},
+					}).then(res => {
+						console.log(res)
+						if (res.data.code == 0) {
+							if (this.$refs.uCode.canGetCode) {
+								// 模拟向后端请求验证码
+								uni.showLoading({
+									title: '正在获取验证码',
+								})
+								setTimeout(() => {
+									uni.hideLoading();
+									// 通知验证码组件内部开始倒计时
+									this.$refs.uCode.start();
+								}, 1000);
+							} else {
+								this.$u.toast('倒计时结束后再发送');
+							}
 						}
-					}
-					if(res.data.code==500){
-						this.$u.toast(res.data.msg);
-					}
-				}).catch(err => {
-					console.log(err)
-				}).finally(() => {
-					this.loading = false;
-					uni.hideLoading();
-				})
+						if (res.data.code == 500) {
+							this.$u.toast(res.data.msg);
+						}
+					}).catch(err => {
+						console.log(err)
+					}).finally(() => {
+
+					})
+				} else {
+					this.$u.toast('请输入手机号');
+				}
+
 			},
 			regionConfirm(e) {
 				this.form.region = e.province.label + '-' + e.city.label + '-' + e.area.label;
+				this.form.province=e.province.label;
+				this.form.city=e.city.label;
+				this.form.district=e.area.label;
 			},
-			inMap(){
+			inMap() {
 				this.$u.route({
 					url: 'pages/login/register_map'
 				})

+ 129 - 36
pages/login/register_3.vue

@@ -34,7 +34,7 @@
 					<scroll-view scroll-y="true" style="height: 300rpx;">
 						<view class="u-flex u-row-center">
 							<u-checkbox-group :wrap="true" @change="checkboxGroupChange">
-								<u-checkbox v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name" shape="circle">{{item.name}}</u-checkbox>
+								<u-checkbox v-model="item.checked" v-for="(item, index) in brandList" :key="index" :name="item.name" shape="circle">{{item.name}}</u-checkbox>
 							</u-checkbox-group>
 						</view>
 					</scroll-view>
@@ -92,12 +92,17 @@
 			</u-form-item>
 		</u-form>
 		<view style="margin:0 30rpx;">
-			<u-button @click="nextStep" type="primary" @tap="$u.debounce(submit, 2000,immediate = true)" :loading="loading" :ripple="true" ripple-bg-color="#99d4ff">确认注册</u-button>
+			<u-button @click="nextStep" type="primary" @tap="$u.debounce(submit, 2000,immediate = true)" :loading="loading"
+			 :ripple="true" ripple-bg-color="#99d4ff">确认注册</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 		data() {
 			return {
@@ -108,41 +113,85 @@
 					protocol: false
 				},
 				form2: {},
-				list: [{
-						name: '第一个选项',
-						checked: false,
-						disabled: false
-					},
-					{
-						name: '第二个选项',
-						checked: false,
-						disabled: false
-					},
-					{
-						name: '第三个选项',
-						checked: false,
-						disabled: false
-					},
-					{
-						name: '第四个选项',
-						checked: false,
-						disabled: false
-					},
-					{
-						name: '第五个选项',
-						checked: false,
-						disabled: false
-					}
-				]
+				formData: [],
+				dataUrl: [],
+				agentList: [],
+				brandList: [], //品牌
+				nameList:""
 			}
 		},
+		created() {
+			uni.$on('formData', (data) => {
+				this.formData = data
+			})
+			uni.$on('dataUrl', (data) => {
+				this.dataUrl = data
+			})
+			this.getAgentArea()
+		},
 		methods: {
+			getAgentArea() {
+				request({
+					url: '/sailun/appStoreBasicInfo/getAgentArea',
+					method: 'post',
+					data: {
+						// "area": this.formData.district,
+						// "city": this.formData.city,
+						// "province": this.formData.province,
+						"area": "市北区",
+						"city": "青岛市",
+						"province": "山东省",
+						"spart": "10",
+						"vkorg": "8100",
+						"vtweg": "10"
+					},
+				}).then(res => {
+					if (res.data.code == 0) {
+						this.agentList = res.data.Data.data
+						// 从经销商里里面抽取品牌
+						const list = this.agentList.map((item, index) => {
+							return item.brandList;
+						}).join(",").split(',')
+						//去重
+						const list2 = [...new Set(list)]
+						//根据复选框的数据结构重组数组
+						this.brandList = list2.reduce((res, item) => {
+							res.push({
+								name: item,
+								checked: false,
+								disabled: false
+							})
+							return res;
+						}, []);
+					}
+					if (res.data.code == 500) {
+						this.$u.toast(res.data.msg);
+					}
+				}).catch(err => {
+					console.log(err)
+				}).finally(() => {
+
+				})
+			},
 			checkboxGroupChange(e) {
 				this.cooperations = e
 			},
 			getCooperation() {
 				if (this.cooperations != null) {
 					this.form.cooperation = this.cooperations.toString();
+					let coopList = this.form.cooperation.split(",")
+					
+					let a=this.agentList.forEach((item,index, array)=>
+					{
+						for (let i = 0; i < array[index].brandList.length; i++) {
+					         for (let j = 0; j < coopList.length; j++) {
+					            if(coopList[j] == array[index].brandList[i]){						
+									this.nameList+=array[index].name+','
+					             }
+					         }
+					     }	
+					})
+					this.nameList=[...new Set(this.nameList.split(',').filter(item => item))]
 					this.show = false
 				} else {
 					console.log("至少选择一项")
@@ -150,14 +199,58 @@
 
 			},
 			submit() {
-				this.loading = true
-				setTimeout(() => {
-					this.$u.route({
-						url: 'pages/login/index',
-						type:"reLaunch"
-					})
-					this.loading = false
-				}, 2000)
+				let data = {
+					// "addressInfo": this.formData.addressInfo,
+					"brandAgentLvQueryList": [{
+						"agent_id": "string",
+						"brand": "string",
+						"brandCode": "string",
+						"kunnr": "string",
+						"lvCount": "string",
+						"showLv": "string",
+						"spart": "string",
+						"vkorg": "string",
+						"vtweg": "string"
+					}],
+					"city": "string",
+					"contactName": "string",
+					"district": "string",
+					"jd": "string",
+					"licenseUrl": "string",
+					"mobileCode": "string",
+					"province": "string",
+					"storeImageUrl": "string",
+					"storeName": "string",
+					"storePhone": "string",
+					"version": 0,
+					"wd": "string"
+				}
+				console.log(data)
+				request({
+					url: '/sailun/appStoreBasicInfo/storeReg',
+					method: 'post',
+					data: data
+				}).then(res => {
+
+					console.log(res)
+					if (res.data.code == 0) {
+						this.loading = true
+						setTimeout(() => {
+							this.$u.route({
+								url: 'pages/login/index',
+								type: "reLaunch"
+							})
+							this.loading = false
+						}, 2000)
+					}
+					if (res.data.code == 500) {
+						this.$u.toast(res.data.msg);
+					}
+				}).catch(err => {
+					console.log(err)
+				}).finally(() => {
+
+				})
 			},
 		}
 	}

+ 65 - 25
pages/login/register_map.vue

@@ -1,12 +1,12 @@
 <template>
 	<view>
-		<view class="page-body">
-			<view class="page-section page-section-gap">
-				<map style="width: 100%;height: 100vh;" :markers="markers" :longitude="longitude" :latitude="latitude" :circles="circles">
-				</map>
-			</view>
+		<map id="myMap" style="width: 750rpx;height: 80vh;" :markers="markers" :longitude="longitude" :latitude="latitude"
+		 @tap="onTap">
+		</map>
+		<view class="">
+			请双击定位<br>
+			{{addressData.address}}
 		</view>
-
 	</view>
 </template>
 
@@ -14,42 +14,82 @@
 	export default {
 		data() {
 			return {
-				circles: [], //圆
 				markers: [], //标记点
-				latitude: 39.9,
-				longitude: 116.4,
+				latitude: 0,
+				longitude: 0,
+				createMap: "",
+				touch: false,
+				addressData:''
 			};
 		},
-		onLoad() {
-			const _this = this;
-			uni.getSystemInfo({
-				success: (res) => {
-					_this.mapHeight = res.screenHeight - res.statusBarHeight
-					_this.mapHeight = _this.mapHeight
-				}
-			})
+		onNavigationBarButtonTap(e) {
+			if (e.index == 0) {
+				this.inBack()
+			}
 		},
 		created() {
-			var that = this
+			let that = this
 			uni.getLocation({
-				type: 'wgs84',
+				type: 'gcj02',
 				geocode: true,
 				success(res) {
-					console.log(res, "当前位置");
 					that.latitude = res.latitude
 					that.longitude = res.longitude
-					console.log('当前位置的经度:' + res.longitude);
-					console.log('当前位置的纬度:' + res.latitude);
-					//标记点
+					let point = new plus.maps.Point(that.longitude, that.latitude);
+					plus.maps.Map.reverseGeocode(
+						point, {},
+						function(event) {
+							that.addressData= event;
+						},
+						function(e) {}
+					);
 					that.markers = [{
 						id: 1,
 						latitude: res.latitude,
 						longitude: res.longitude,
-						iconPath: '/static/sailun/map-pin.png',
+						iconPath: '/static/sailun/gps-icon.png',
 					}]
 				}
 			});
-		}
+		},
+		onReady() {
+			this.createMap = uni.createMapContext('myMap', this);
+		},
+		methods: {
+			inBack() {
+				uni.$emit("addressData", this.addressData)
+				uni.navigateBack({})
+			},
+			onTap(e) {
+				console.log(e)
+				if (e.type == 'click') {
+					let that = this;
+					this.createMap.getCenterLocation({
+						success(res) {
+							console.log(res)
+							that.latitude = res.latitude
+							that.longitude = res.longitude
+							that.markers = [{
+								id: 1,
+								latitude: that.latitude,
+								longitude: that.longitude,
+								iconPath: '/static/sailun/gps-icon.png',
+							}]
+							let point = new plus.maps.Point(res.longitude, res.latitude);
+							plus.maps.Map.reverseGeocode(
+								point, {},
+								function(event) {
+									that.addressData= event;
+								},
+								function(e) {}
+							);
+						}
+					})
+				}
+			},
+
+		},
+
 	}
 </script>
 

+ 101 - 35
pages/me/agent-stock/agent-stock.vue

@@ -15,11 +15,11 @@
 				<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>
 		<view class="content-one">
 			<template v-if="datalist&&datalist.length">
-				<view class="content-two" v-for="(item,index) in datalist" :key="index">
+				<view class="content-two" v-for="(item,index) in datalist" :key="index" v-cloak>
 					<view>
 						{{ item.brand }}
 					</view>
@@ -31,9 +31,9 @@
 					</view>
 				</view>
 			</template>
-			<view class="nodata" v-else>暂无数据</view>
+			<u-empty v-else text="暂无数据" mode="list"></u-empty>
 		</view>
-		<u-loadmore v-if="datalist&&datalist.length" :status="loadStatus" bgColor="#f2f2f2"></u-loadmore>
+		<u-loadmore v-if="datalist&&datalist.length" :status="loadStatus" bgColor="#f2f2f2" :load-text="loadText"></u-loadmore>
 	</scroll-view>
 </template>
 
@@ -68,25 +68,40 @@
 				// showDate: false,
 				// mode: 'date',
 				// 分页信息
-				pageSize: 10, //每页条数
+				first: 0,
+				pageSize: 20, //每页条数
 				currentPage: 1, //当前页码
 				totalPage: 0, //总页码数
-				loadStatus: "loadmore"
+				loadStatus: "loadmore",
+				loadText: {
+					loadmore: '轻轻上拉',
+					loading: '努力加载中',
+					nomore: '实在没有了'
+				}
 			};
 		},
 		onLoad() {
+			uni.showLoading({
+				title: "加载中"
+			});
+			this.handleGetFilterData();
 			this.handleGetData();
 		},
 		methods: {
 			scrollBottom(v) {
 				console.log(v);
-				this.loadStatus = 'loading';
-				// 模拟数据加载
-				setTimeout(() => {
+				if (this.loadStatus == "loadmore") {
+					this.loadStatus = 'loading';
+					uni.showLoading({
+						title: "加载中"
+					});
+					// 模拟数据加载
+					this.first += 1;
 					this.currentPage += 1;
 					this.handleGetData();
 					this.loadStatus = 'loadmore';
-				}, 1000)
+				}
+
 			},
 			changeTab(index) {
 				this.currentTab = index;
@@ -94,6 +109,7 @@
 					this.currenBrand = "";
 					this.currentPattern = "";
 					this.currentSpec = "";
+					this.first = 0;
 					this.currentPage = 1;
 					this.handleGetData();
 				} else if (this.currentTab == 1) {
@@ -102,29 +118,21 @@
 					this.showpattern = true
 				}
 			},
-			// 获取数据
-			handleGetData() {
-				uni.showLoading({
-					title: "加载中"
-				});
+			// 获取筛选条件
+			handleGetFilterData: function() {
 				var _this = this;
 				request({
-					url: '/app/appAgent/getStoreAgentStock',
-					method: 'post',
+					url: '/app/appAgent/getStoreAgentCondition',
+					method: 'get',
 					data: {
-						storeId: "990289",
-						pageSize: _this.pageSize,
-						page: _this.currentPage,
-						brand: _this.currenBrand,
-						spec: _this.currentSpec,
-						pattern: _this.currentPattern
+
 					}
 				}).then(res => {
 					if (res.data.code == 0) {
 						console.log(res)
 						// 获取品牌列表
 						_this.brandList = [];
-						res.data.data.brandList.forEach(function(val, index) {
+						res.data.data.brands.forEach(function(val, index) {
 							_this.brandList.push({
 								value: index,
 								label: val
@@ -132,20 +140,73 @@
 						});
 						// 获取花纹列表
 						_this.patternList = [];
-						res.data.data.patternList.forEach(function(val, index) {
+						res.data.data.patterns.forEach(function(val, index) {
 							_this.patternList.push({
 								value: index,
 								label: val
 							});
 						});
+					} 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)
+				});
+			},
+			// 获取数据
+			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
+					}
+				}).then(res => {
+					if (res.data.code == 0) {
+						console.log(res)
 						// 获取数据列表
-						_this.datalist = res.data.data.list;
-						_this.total = res.data.data.stock;
-						_this.totalPage = res.data.data.totalPage;
+						if (_this.first == 0) {
+							_this.datalist = [];
+							_this.datalist = _this.datalist.concat(res.data.data.stockInfo);
+							_this.total = parseInt(res.data.data.count);
+							_this.totalPage = Math.ceil(_this.total / _this.pageSize);
+							console.log(_this.totalPage)
+						} else {
+							console.log(_this.currentPage);
+							console.log(_this.totalPage)
+							_this.datalist = _this.datalist.concat(res.data.data.stockInfo);
+							console.log(_this.datalist.length)
+						};
 						// 分页
-						if(_this.currentPage<_this.totalPage){
-							_this.loadStatus = "loadMore"
-						}else{
+						if (_this.currentPage < _this.totalPage) {
+							_this.loadStatus = "loadmore"
+						} else {
+							console.log("nomore")
 							_this.loadStatus = "nomore"
 						}
 					} else {
@@ -175,21 +236,24 @@
 			confirmBrand: function(v) {
 				this.currenBrand = v[0].label;
 				this.currentPage = 1;
+				this.first = 0;
 				this.handleGetData();
 			},
 			// 筛选花纹
 			confirmPattern: function(v) {
 				this.currentPattern = v[0].label;
 				this.currentPage = 1;
+				this.first = 0;
 				this.handleGetData();
 			},
 			searchSpec: function() {
-				if(this.currentSpec){
+				if (this.currentSpec) {
+					this.first = 0;
 					this.currentPage = 1;
 					this.handleGetData();
 				}
 				console.log(this.currentSpec)
-				
+
 			},
 			inputFocus() {
 				console.log(111);
@@ -223,9 +287,10 @@
 </script>
 
 <style lang="scss" scoped>
-	.scroll-view-container{
+	.scroll-view-container {
 		height: 100%;
 	}
+
 	.header {
 		height: 400rpx;
 		width: 100%;
@@ -302,7 +367,8 @@
 	.wrap-flex {
 		display: flex;
 	}
-	.nodata{
+
+	.nodata {
 		padding: 48rpx;
 	}
 </style>

+ 15 - 11
pages/me/index.vue

@@ -221,17 +221,21 @@
 		filters: {
 			numberFormat(value) {
 				let unit = '';
-				var k = 10000,
-					sizes = ['', '万', '亿', '万亿'],
-					i;
-				if (value < k) {
-					value = value;
-				} else {
-					i = Math.floor(Math.log(value) / Math.log(k));
-					value = ((value / Math.pow(k, i))).toFixed(2);
-					unit = sizes[i];
-				}
-				return value + unit;	
+				if(value){
+					var k = 10000,
+						sizes = ['', '万', '亿', '万亿'],
+						i;
+					if (value < k) {
+						value = value;
+					} else {
+						i = Math.floor(Math.log(value) / Math.log(k));
+						value = ((value / Math.pow(k, i))).toFixed(2);
+						unit = sizes[i];
+					}
+					return value + unit;
+				}else{
+					return 0
+				}		
 			}
 		},
 		created() {

+ 1 - 1
pages/me/setting/setting.vue

@@ -49,7 +49,7 @@
 				</template>
 			</view>
 		</u-card>
-		<u-button type="primary" @click="exit" :ripple="true" ripple-bg-color="#99d4ff" style="margin: 20rpx;">安全退出</u-button>
+		<u-button type="primary" @click="exit" style="margin: 20rpx;">安全退出</u-button>
 	</view>
 </template>
 

BIN
static/mp3/rescan.mp3


BIN
static/mp3/scanfailed.mp3


BIN
static/mp3/scansuccess.mp3


BIN
static/mp3/startscan.mp3


BIN
static/pdf/xy.pdf


BIN
static/pdf/zc.pdf


BIN
static/sailun/gps-icon.png


BIN
static/sailun/map-pin.png