Pārlūkot izejas kodu

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

tong 4 gadi atpakaļ
vecāks
revīzija
5afc3f30a6

+ 27 - 0
components/luo-version-upgrade/README.md

@@ -0,0 +1,27 @@
+# android/ios应用升级检测
+
+#### android更新/ios检测提示/不支持热更新
+
+#### 使用方式
+引用组件
+import versionUpgrade from "@/components/luo-version-upgrade/luo-version-upgrade.vue";
+export default {
+		components: {
+			versionUpgrade
+		},
+}
+
+使用组件
+<!-- 更新检测 -->
+<!-- #ifdef APP-PLUS -->
+	<luo-version-upgrade version="1.0.1" url="http://static.tomatotc.com/__UNI__A71730C_0404173232.apk"></luo-version-upgrade> 
+<!-- #endif -->
+
+
+#### 属性说明
+属性名			类型		默认值	说明
+version			String	1.0.0	版本号
+url				String	空		下载地址 .apk结尾地址
+versionType		String	android	类型android/ios
+describe		String	升级描述	升级描述--有新版本出现~为了给您带来更好的体验,我们建议您现在进行升级!
+is_force		Boolean	false	是否强制更新 true/false

BIN
components/luo-version-upgrade/icon/upgrade.png


+ 356 - 0
components/luo-version-upgrade/luo-version-upgrade.vue

@@ -0,0 +1,356 @@
+<template>
+	<view class="versionUpgrade" v-if="show">
+		<view class="versionUpgradeView">
+			<view class="versionUpgradeViewV1">
+				<image class="img" src="./icon/upgrade.png" mode="aspectFill"></image>
+				<text class="v-text">发现新版本啦!</text>
+			</view>
+			<view class="versionUpgradeViewV2">
+				<text class="content-text">{{describe}}</text>
+				<view class="versionUpgradeViewIs_force0" v-if="is_force==false&&start==false">
+					<text class="text butClose" @click="close">下次在说</text>
+					<text class="text download" @click="downUpdate()">立即更新</text>
+				</view>
+				<view class="versionUpgradeViewIs_force0" v-if="is_force==true&&start==false">
+					<text class="downloadIs_force1" @click="downUpdate()">立即更新</text>
+				</view>
+				<view class="versionUpgradeViewStartTrue" v-if="start!=false">
+					<text class="title">下载进度</text>
+					<progress :percent="start" activeColor="#0094FE" :show-info="true" stroke-width="6"></progress>
+				</view>
+				<view class="versionUpgradeViewStartTrue" v-if="start!=false">
+					<text class="btn-text downloadStartTrue" v-if="start>=100" @click="install()">立即安装</text>
+					<text class="btn-text downloadStartFalse" v-else>立即安装</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	export default {
+		name: 'luo-version-upgrade',
+		props: {
+			version: {
+				type: String,
+				default () {
+					return '1.0.0';
+				}
+			},
+			versionType: {
+				type: String,
+				default () {
+					return 'android';
+				}
+			},
+			url: {
+				type: String,
+				default () {
+					return '';
+				}
+			},
+			describe: {
+				type: String,
+				default () {
+					return `
+					1. 修复badge组件的size参数无效问题
+					2. 新增Modal模态框组件
+					3. 新增压窗屏组件,可以在APP上以弹窗的形式遮盖导航栏和底部tabbar
+					4. 修复键盘组件在微信小程序上遮罩无效的问题`
+				}
+			},
+			is_force: {
+				type: Boolean,
+				default () {
+					return false;
+				}
+			}
+			
+		},
+		data() {
+			return {
+				show: false,
+				start: false,
+			};
+
+		},
+		watch: {
+			'version': {
+				handler(newVal) {
+					if (newVal != '1.0.0') {
+						this.getVerison();
+					}
+				},
+				deep: true,
+				immediate: true,
+			}
+		},
+		computed: {
+			versionTypes() {
+				return this.getPlatform(); //版本获取
+			}
+		},
+		methods: {
+			/* 版本比较是否需要更新 */
+			getVerison: function() {
+				if (this.version == '1.0.0' || this.url == '') {
+					return;
+				}
+				//ios端判断
+				if (this.versionType == 'ios' || this.versionTypes == 'ios') {
+					uni.showModal({
+						title:"更新提醒",
+						content:"无法进行在线升级,请到AppStore进行升级..",
+						showCancel:false,
+						confirmText:"立即更新",
+						success: function (res) {
+						        if (res.confirm) {
+						            console.log('用户点击确定');
+						        } else if (res.cancel) {
+						            console.log('用户点击取消');
+						        }
+						    }
+					})
+					
+					// plus.nativeUI.alert('无法进行在线升级,请到AppStore进行升级..', '提示');
+					return;
+				}
+				if (this.versionType == 'android' && this.versionTypes == 'android') {
+					this.update();
+				}
+			},
+			// 升级检测
+			update: function() {
+				let self = this;
+				/* 5+环境锁定屏幕方向 */
+				plus.screen.lockOrientation('portrait-primary'); //锁定
+				//客户端信息
+				plus.runtime.getProperty(plus.runtime.appid, function(res) {
+					let isupdate = self.isUpdate(res.version, self.version);
+					if (isupdate) {
+						self.versionShow();
+						return;
+					}
+				})
+			},
+
+			//  * 比较版本大小,如果新版本nv大于旧版本ov则返回true,否则返回false
+			//  * @param {String} ov
+			//  * @param {String} nv
+			//  * @return {Boolean}
+
+			isUpdate: function(ov, nv) {
+				if (!ov || !nv || ov == "" || nv == "") {
+					return false;
+				}
+				var b = false,
+					ova = ov.replace("V", "").replace("v", "").replace(" ", '').split(".", 4),
+					nva = nv.replace("V", "").replace("v", "").replace(" ", '').split(".", 4);
+				for (var i = 0; i < ova.length && i < nva.length; i++) {
+					var so = ova[i],
+						no = parseInt(so),
+						sn = nva[i],
+						nn = parseInt(sn);
+					if (nn > no || sn.length > so.length) {
+						return true;
+					} else if (nn < no) {
+						return false;
+					}
+				}
+				if (nva.length > ova.length && 0 == nv.indexOf(ov)) {
+					return true;
+				} else {
+					return false;
+				}
+			},
+			/* 获取版本类别 android/ios */
+			getPlatform: function() {
+				return uni.getSystemInfoSync().platform.toLowerCase();
+			},
+			/* 开启升级 */
+			versionShow: function() {
+				this.show = true;
+				uni.hideTabBar();
+			},
+			/* 取消升级 */
+			close: function() {
+				this.show = false;
+				uni.showTabBar();
+			},
+			downUpdate: function() {
+				//平台判断
+				if (this.versionTypes == 'ios') {
+					plus.nativeUI.alert('无法进行在线升级,请到AppStore进行升级..', '提示');
+					this.close();
+					return;
+				}
+				//检测是否下载过更新
+				let self = this;
+				self.installPath = uni.getStorageSync('update_path');
+				plus.io.resolveLocalFileSystemURL(
+					self.installPath,
+					function(entry) {
+						self.install();
+						return;
+					},
+					function(err) {
+						const dtask = plus.downloader.createDownload(self.url, {
+							filename: '_downloads/'
+						});
+						dtask.addEventListener("statechanged", onStateChanged, false);
+						dtask.start();
+					}
+				);
+				//下载状态
+				function onStateChanged(download, status) {
+					let totalSize = download.totalSize;
+					let useSize = download.downloadedSize;
+					if(totalSize){
+						self.start = (useSize / totalSize * 100).toFixed(0);
+					}
+					// 下载完成 
+					if (download.state == 4 && status == 200) {
+						self.installPath = download.filename;
+						uni.setStorageSync('update_path', self.installPath);
+						//需要用户点击立即安装才能安装去掉注释掉self.install();
+						self.install();
+					}
+				}
+			},
+			//安装提示
+			install: function() {
+				this.close();
+				plus.nativeUI.showWaiting('安装中,请稍后...');
+				plus.runtime.install(this.installPath, {}, (res) => {
+					plus.nativeUI.closeWaiting();
+					plus.runtime.restart();
+					uni.removeStorageSync("update_path");
+				}, (err) => {
+					plus.nativeUI.closeWaiting();
+					plus.nativeUI.alert('error ' + err.code, '', '提示');
+				});
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	.versionUpgrade {
+		width: 100%;
+		height: 100%;
+		position: fixed;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		z-index: 999999;
+		background: rgba(0, 0, 0, 0.3);
+
+		.versionUpgradeView {
+			z-index: 9999999;
+			margin: 500rpx 60rpx 0 60rpx;
+			min-height: 200rpx;
+			max-height: 800rpx;
+			background: #FFFFFF;
+			border-radius: 30rpx;
+			display: flex;
+			flex-direction: column !important;
+			//padding: 30rpx;
+			overflow: hidden;
+
+			.versionUpgradeViewV1 {
+				display: flex;
+				flex-direction: row !important;
+				justify-content: center;
+				align-items: center;
+				background: #0094FE;
+				padding: 10rpx 0;
+				color: #FFFFFF;
+
+				.img {
+					width: 60rpx;
+					height: 60rpx;
+				}
+
+				.v-text {
+					font-size: 16px;
+					margin-left: 10rpx;
+				}
+			}
+
+			.versionUpgradeViewV2 {
+				display: flex;
+				flex-direction: column !important;
+				padding: 30upx;
+
+				.content-text {
+					font-size: 14px;
+					color: #626262;
+				}
+
+				.versionUpgradeViewIs_force0 {
+					display: flex;
+					flex-direction: row !important;
+					justify-content: space-between;
+					padding: 30rpx 0 0 0;
+
+					.text {
+						padding: 10rpx 70rpx;
+						border-radius: 30rpx;
+						font-size: 16px;
+						color: #FFFFFF;
+					}
+
+					.butClose {
+						background: #e2e2e2;
+					}
+
+					.download {
+						background: #0094FE;
+					}
+
+					.downloadIs_force1 {
+						width: 100%;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						padding: 10rpx 0;
+						border-radius: 30rpx;
+						font-size: 16px;
+						color: #FFFFFF;
+						background: #0094FE;
+					}
+				}
+
+				.versionUpgradeViewStartTrue {
+					display: flex;
+					flex-direction: column !important;
+					padding: 30rpx 0 0 0;
+
+					.title {
+						font-size: 14px;
+						color: #626262;
+						padding: 10rpx 0;
+					}
+
+					.btn-text {
+						width: 100%;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						padding: 10rpx 0;
+						border-radius: 30rpx;
+						font-size: 16px;
+						color: #FFFFFF;
+					}
+
+					.downloadStartTrue {
+						background: #0094FE;
+					}
+
+					.downloadStartFalse {
+						background: #e2e2e2;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 7 - 9
components/mi-map/mi-map.vue

@@ -8,13 +8,13 @@
 				<image class="left" :src="myPositionIcon" mode="" @tap="toMyLocation"></image>
 				<view class="right">
 					<text class="title">我的位置</text>
-					<text class="text">{{myAddress}}</text>
+					<text class="text">{{myAddress.addressInfo}}</text>
 				</view>
 			</view>
 
 			<view class="start-place">
 				<view class="place">
-					<text class="text">{{addressObj.address}}</text>
+					<text class="text">{{addressObj.address.addressInfo}}</text>
 				</view>
 				<view class="tip">{{descText}}</view>
 			</view>
@@ -109,7 +109,6 @@
 				this.longitude = res.longitude;
 				this.latitude = res.latitude;
 				this.myAddress = await this.getAddressName(res);
-
 				this.addressObj = Object.assign({}, this.addressObj, {
 					longitude: res.longitude,
 					latitude: res.latitude,
@@ -160,7 +159,7 @@
 						poi_options: "page_size=1;page_index=1",
 						output: 'jsonp',
 						success: (e) => {
-							res(e.result.formatted_addresses.recommend);
+							res({addressInfo:e.result.formatted_addresses.recommend,province:e.result.address_component.province,city:e.result.address_component.city,district:e.result.address_component.district,});
 						},
 						fail: err => {
 							res(err);
@@ -271,14 +270,12 @@
 			.start-place {
 				width: 700rpx;
 				height: 100rpx;
-				margin: 0 auto;
-				margin: 0 auto;
 				box-shadow: 0rpx 3rpx 20rpx rgba(0, 0, 0, 0.2);
 				background: #fff;
 				border-radius: 10rpx;
 				margin-top: 20rpx;
 				.place {
-					margin-left: 10rpx;
+					margin-left: 20rpx;
 					.title {
 						font-size: 24rpx;
 						font-weight: bold;
@@ -287,7 +284,7 @@
 
 					.text {
 						margin-top: 20rpx;
-						font-size: 20rpx;
+						font-size: 24rpx;
 						color: #3384FF;
 						font-weight: bold;
 						width: 700rpx;
@@ -300,7 +297,8 @@
 				}
 
 				.tip {
-					font-size: 0.57rem;
+					margin-left: 20rpx;
+					font-size:20rpx;
 					color: #666;
 				}
 			}

+ 14 - 4
pages/home/Scan-code-in/index.vue

@@ -80,6 +80,7 @@
 		request
 	} from '../../../common/request/request'
 	require("promise.prototype.finally").shim()
+	import {mapMutations} from 'vuex'
 	export default {
 		data() {
 			return {
@@ -114,6 +115,7 @@
 			this.getDatalist()
 		},
 		methods: {
+			
 			confirm() {
 				this.$u.route({
 					type:'redirectTo',
@@ -133,11 +135,19 @@
 						}
 					}).then(res => {
 						console.log(res)
-						this.dalist = res.data.data
-						for (let i = 0; i < this.dalist.length; i++) {
-							this.total += parseInt(this.dalist[i].rewardMoney)
+						if(res.data.code == 0){
+							this.dalist = res.data.data
+							for (let i = 0; i < this.dalist.length; i++) {
+								this.total += parseInt(this.dalist[i].rewardMoney)
+							}
+							this.inStore()
+							return this.total
+						}else{
+							uni.showToast({
+								icon: 'none',
+								title: '出错啦~'
+							})
 						}
-						return this.total
 
 					}).catch(err => {
 						console.log(err)

+ 54 - 33
pages/home/index.vue

@@ -43,10 +43,12 @@
 		<!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
 		<u-skeleton :loading="loading" :animation="true"></u-skeleton>
 		<u-toast ref="ulogin" />
+		<luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force"></luo-version-upgrade>
 	</view>
 </template>
 
 <script>
+	import versionUpgrade from "../../components/luo-version-upgrade/luo-version-upgrade.vue";
 	import {
 		mapState,
 		mapMutations
@@ -57,6 +59,7 @@
 	require("promise.prototype.finally").shim()
 	import axios from 'axios'
 	export default {
+		components: { versionUpgrade },
 		data() {
 			return {
 				bannersList: [],
@@ -64,8 +67,11 @@
 				loading: true, // 是否显示骨架屏组件
 				list: [
 					'../../static/sailun/swiper1.png'
-				]
-			};
+				],
+				show_s: false,
+				url: '',
+				is_force:false,
+			}
 		},
 		onLoad() {
 			console.log("@@@")
@@ -79,6 +85,7 @@
 					title: "登录成功",
 				})
 			}
+			this.onLaunch_s()
 		},
 		created() {
 			if (this.hasLogin) {
@@ -98,46 +105,60 @@
 						uni.hideLoading();
 					})
 			}
+			this.onLaunch_s()
 		},
 		computed: {
 			...mapState(['hasLogin'])
 		},
 		methods: {
 			//升级调用的接口
-			// onLaunch_s() {
-			// 	request({
-			// 			url: '/baseReq/apkUpgrade',
-			// 			method: 'get',
-			// 			params: {
-			// 				osType: 0
-			// 			}
-			// 		}).then(res => {
-			// 			console.log(res)
-			// 			console.log(res.data.forceVersion) //最低版本
-			// 			console.log(res.data.msg) //更新文案
-			// 			console.log(res.data.url) //下载最新版地址
-			// 			console.log(res.data.version) //最新版本
-
-			// 			plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
-			// 				console.log(wgtinfo);
-			// 				console.log(wgtinfo.version); //版本号
+			onLaunch_s() {
+				request({
+						url: '/baseReq/apkUpgrade',
+						method: 'get',
+						params: {
+							osType: 0
+						}
+					}).then(res => {
+						console.log(res.data.code)
+						console.log(res.data.forceVersion) //最低版本
+						console.log(res.data.msg) //更新文案
+						console.log(res.data.url) //下载最新版地址
+						console.log(res.data.version) //最新版本
 
-			// 				if (wgtinfo.version != res.data.forceVersion || wgtinfo.version != res.data.version) {
-			// 					console.log("需要更新")
-			// 					this.show_d = true;
-			// 				} else {
-			// 					console.log("已是最新版本")
-			// 				}
+						plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
+							console.log(wgtinfo);
+							console.log(wgtinfo.version); //版本号
+							if(wgtinfo.version == res.data.version){
+								this.show_s = false
+								// uni.showToast({
+								// 	icon: 'none',
+								// 	title: '已是最新版本',
+								// 	position: "bottom"
+								// })
+								console.log("已是最新版本")
+							}else if (wgtinfo.version != res.data.forceVersion) {
+								console.log("必须强制更新")
+								this.show_s = true
+								console.log(res.data.url)
+								this.url = res.data.url
+								this.is_force = true
+							}else if(wgtinfo.version == res.data.forceVersion){
+								console.log("达到最低版本")
+								this.is_force = false
+								this.show_s = true
+								this.url = res.data.url
+							}
 
-			// 			})
+						})
 
-			// 		}).catch(err => {
-			// 			console.log(err)
-			// 		})
-			// 		.finally(() => {
-			// 			// Loading.close()
-			// 		})
-			// },
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						// Loading.close()
+					})
+			},
 			//轮播图
 			getBanners() {
 				return request({

+ 4 - 1
pages/home/scancode/index.vue

@@ -53,7 +53,7 @@
 				<u-button @click="container" style="float: right;border: none;" :hair-line="false" :plain="false">确定</u-button>
 			</view>
 			<view class="content_s">
-				<scroll-view scroll-y="true" style="height: 300rpx;font-size: 40rpx;margin-bottom: 40rpx;margin-top: 100rpx;">
+				<scroll-view scroll-y="true" style="height: 200rpx;">
 					{{regular}}
 				</scroll-view>
 			</view>
@@ -187,6 +187,7 @@
 				})
 				console.log(this.res.data.data[0].specs)
 				this.show_s = false
+				console.log(this.show_s)
 				this.number_a = ''
 				console.log("我成功啦.")
 				this.lisi.push({
@@ -297,6 +298,8 @@
 					})
 			},
 			container_s() {
+				this.show_d = false
+				console.log(this.show_s)
 				console.log("什么????")
 				this.number_s = ''
 				console.log("我成功啦")

+ 93 - 31
pages/login/register_2.vue

@@ -39,10 +39,10 @@
 						</view>
 						<u-input v-model="form.code" placeholder="请输入验证码" type="number" />
 						<view class="" slot="right">
-							<u-button size="mini" type="primary" @click="getCode" shape="circle" :loading="codeLoading" >{{codeText}}</u-button>
+							<u-button size="mini" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
 						</view>
 					</u-form-item>
-					<u-form-item prop="region">
+<!-- 					<u-form-item prop="region">
 						<view style="margin-right: 10rpx;">
 							<u-icon name="map" size="36"></u-icon>
 						</view>
@@ -51,6 +51,15 @@
 						<view class="" slot="right">
 							<u-icon name="arrow-right" color="#666666" size="36"></u-icon>
 						</view>
+					</u-form-item> -->
+					<u-form-item prop="region">
+						<view style="margin-right: 10rpx;">
+							<u-icon name="map" size="36"></u-icon>
+						</view>
+						<u-input placeholder="点击选择省市区" v-model="form.region" :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-item prop="addressInfo">
 						<view style="margin-right: 10rpx;">
@@ -104,7 +113,18 @@
 						required: true,
 						message: '请输入门店名称',
 						trigger: 'blur,change'
-					}],
+					},
+					{
+						// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
+						validator: (rule, value, callback) => {
+							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+							return this.$u.test.chinese(value);
+						},
+						message: '门店名称必须为中文',
+						// 触发器可以同时用blur和change,二者之间用英文逗号隔开
+						trigger: ['change','blur'],
+					},
+					],
 					company: [{
 						required: true,
 						message: '请输入公司名称',
@@ -114,16 +134,51 @@
 						required: true,
 						message: '请输入联系人',
 						trigger: 'blur,change'
+					},{
+						min: 3,
+						max: 5,
+						message: '姓名长度在3到5个字符',
+						trigger: ['change','blur'],
+					},
+					{
+						// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
+						validator: (rule, value, callback) => {
+							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+							return this.$u.test.chinese(value);
+						},
+						message: '姓名必须为中文',
+						// 触发器可以同时用blur和change,二者之间用英文逗号隔开
+						trigger: ['change','blur'],
 					}],
 					phone: [{
 						required: true,
 						message: '请输入联系电话',
 						trigger: 'blur,change'
+					},
+					{
+						validator: (rule, value, callback) => {
+							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+							return this.$u.test.mobile(value);
+						},
+						message: '手机号码不正确',
+						// 触发器可以同时用blur和change,二者之间用英文逗号隔开
+						trigger: ['change','blur'],
 					}],
 					code: [{
 						required: true,
 						message: '请输入验证码',
 						trigger: 'blur,change'
+					},
+					{
+						min: 6,
+						max: 6,
+						message: '验证码为6位数',
+						trigger: 'change',
+					},
+					{
+						type: 'number',
+						message: '验证码只能为数字',
+						trigger: ['change','blur'],
 					}],
 					region: [{
 						required: true,
@@ -137,65 +192,72 @@
 					}],
 				},
 				dataUrl: "",
-				codeLoading:false,
-				modelshow:false,
-				modelcontent:"如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照"
+				codeLoading: false,
+				modelshow: false,
+				modelcontent: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照"
 			};
 		},
 		created() {
 			uni.$on('licenseData', (data) => {
-				this.form.store = data.company.words
+				if(data.company.words!="无"){
+					this.form.store = data.company.words
+				}
 				this.form.company = data.company.words
-				this.form.name = data.person.words
+				if(data.company.words!="无"){
+					this.form.name = data.person.words
+				}
+				
 			})
 			uni.$on('addressData', (data) => {
 				this.form.latitude = data.latitude
 				this.form.longitude = data.longitude
-				this.form.addressInfo = data.address
+				this.address=data.address
+				this.form.region=this.address.province+"-"+this.address.city+"-"+this.address.district
+				this.form.addressInfo =this.address.addressInfo
 			})
 			uni.$on('dataUrl', (data) => {
 				this.dataUrl = data
 			})
 			uni.getSystemInfo({
-			    success:res=>{
-					this.SystemInfo=res
+				success: res => {
+					this.SystemInfo = res
 					console.log(res)
-			    }
+				}
 			});
-			if(this.SystemInfo.platform=='ios'){
+			if (this.SystemInfo.platform == 'ios') {
 				this.judgeIosPermission('location')
 				uni.showModal({
 					title: "温馨提示",
 					content: "如果店名和联系人与营业执照不一致,请重新上传清晰度更高的营业执照?",
 					confirmText: "确认",
-					showCancel:false
+					showCancel: false
 				})
-			}else{
+			} else {
 				this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
-				this.modelshow=true
+				this.modelshow = true
 			}
-			
+
 		},
 		methods: {
 			judgeIosPermission(permisionID) {
 				let result = permision.judgeIosPermission(permisionID)
-				if(!result){
+				if (!result) {
 					this.getLocation()
-				}else{
+				} else {
 					this.getLocation()
 				}
 			},
 			async requestAndroidPermission(permisionID) {
-			    let result = await permision.requestAndroidPermission(permisionID)
+				let result = await permision.requestAndroidPermission(permisionID)
 				if (result == 1) {
-				    this.getLocation()
+					this.getLocation()
 				} else if (result == 0) {
-				    this.getLocation()
+					this.getLocation()
 				} else {
-				    this.getLocation()
+					this.getLocation()
 				}
 			},
-			getLocation(){
+			getLocation() {
 				let that = this
 				uni.getLocation({
 					type: 'wgs84',
@@ -260,13 +322,13 @@
 			},
 			getCode() {
 				if (this.form.phone) {
-					this.codeLoading=true
+					this.codeLoading = true
 					request({
 						url: '/sailun/appStoreBasicInfo/sendCode',
 						method: 'post',
 						data: {
 							"phoneNumber": parseInt(this.form.phone),
-							"opreaType":"0"
+							"opreaType": "0"
 						},
 					}).then(res => {
 						console.log(res)
@@ -283,7 +345,7 @@
 					}).catch(err => {
 						console.log(err)
 					}).finally(() => {
-						this.codeLoading=false
+						this.codeLoading = false
 						// 通知验证码组件内部开始倒计时
 					})
 				} else {
@@ -292,10 +354,10 @@
 
 			},
 			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;
+				// 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() {
 				this.$u.route({

+ 21 - 41
pages/login/register_3.vue

@@ -44,7 +44,7 @@
 					</scroll-view>
 				</view>
 			</u-popup>
-			<u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
+			<u-card v-if="querybrandList.length" :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
 				<view slot="head">
 					<view class="u-flex">
 						<view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
@@ -78,9 +78,9 @@
 						<view style="margin-right: 10rpx;">
 							<u-icon name="order" size="36"></u-icon>
 						</view>
-						<u-radio-group v-model="item.taskNum" :disabled="item.disabledGroup" @change="changeRadiogroup">
-							<u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.task">
-								{{i.task}}
+						<u-radio-group v-model="item.taskNum" :disabled="item.disabledGroup" @change="changeRadiogroup(item)">
+							<u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.signLv">
+								{{i.signLv}}
 							</u-radio>
 						</u-radio-group>
 					</u-form-item>
@@ -165,7 +165,7 @@
 					if (res.data.code == 0) {
 						this.agentList = res.data.Data.data
 						this.agentList = this.agentList.reduce((res, item, index, array) => {
-							for (let i = 0; i < array[index].regionBrandList.length; i++) {
+							for (let i = 0; i < array[index].regionBrandList.length; ++i) {
 								res.push({
 									brand: array[index].regionBrandList[i],
 									brandCode: array[index].regionBrandList[i],
@@ -178,12 +178,10 @@
 							}
 							return res;
 						}, []);
-						this.brandList=this.agentList.reduce((res, item, index, array) => {
+						this.brandList=[...new Set(this.agentList.reduce((res, item, index, array) => {
 							res.push(item.brand)
 							return res;
-						}, []);
-						this.brandList=[...new Set(this.brandList)]
-						this.brandList=this.brandList.reduce((res, item, index, array) => {
+						}, []))].reduce((res, item, index, array) => {
 							res.push({brand:item})
 							return res;
 						}, []);
@@ -207,7 +205,6 @@
 					if (res.data.code == 0) {
 					this.querybrandList=res.data.data
 					this.querybrandList = this.querybrandList.filter(item => this.cooperations.indexOf(item.brandCode) > -1)
-					console.log(this.querybrandList)
 					}
 					if (res.data.code == 500) {
 						this.$u.toast(res.data.msg);
@@ -225,13 +222,14 @@
 					data: {},
 				}).then(res => {
 					if (res.data.code == 0) {
-						this.taskList = res.data.data
-						this.tasknameList = this.taskList.reduce((res, item) => {
-							res.push({
-								task: item.signLv,
-							})
-							return res;
-						}, []);
+						this.tasknameList = res.data.data
+						this.tasknameList.push({
+							brand: null,
+							brandCode: null,
+							mainId:null,
+							numTask:null,
+							signLv: "无"
+						})
 					}
 					if (res.data.code == 500) {
 						this.$u.toast(res.data.msg);
@@ -245,30 +243,12 @@
 			checkboxGroupChange(e) {
 				this.cooperations = e
 			},
-			changeRadiogroup(){
-				console.log(this.checkedAgentlist)
-			// 	let repeat=[]
-			// 	this.checkedAgentlist.reduce((res, item, index, array) => {
-			// 		return repeat.push({brand:item.brand,taskNum:item.taskNum})
-			// 	}, []);
-			
-			// let arrD = [];
-			// const map = new Map();
-			// repeat.forEach(v => {  if (map.get(v.brand) && arrD.every(vD => vD.brand != v.brand)) {
-			//     arrD.push(v);
-			// } else {
-			//     map.set(v.brand, v);
-			// }
-			// });
-			// var zdys = (repeat|| []).findIndex((profile) => profile.brand === arrD[0].brand);
-			 
-			// console.log(zdys);
-			// repeat.forEach((item,index,array)=>{
-			// 	if(!array[index].taskNum){
-					
-			// 	}
-			// })
-			
+			changeRadiogroup(item){
+				if(item.taskNum=="无"){
+					this.checkedAgentlist.filter(e=>(e.brand===item.brand&&e.agent_id!=item.agent_id)).forEach(e=>e.disabledGroup=false)
+				}else{
+					this.checkedAgentlist.filter(e=>(e.brand===item.brand&&e.agent_id!=item.agent_id)).forEach(e=>e.disabledGroup=true)
+				}
 			},
 			getCooperation() {
 				if (this.cooperations != null) {

+ 3 - 1
pages/me/Delivery-details/index.vue

@@ -76,7 +76,7 @@
 				<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
 			</view>
 			<u-action-sheet :list="list_a" @click="click" v-model="show" :mask-close-able="false" @close="close"></u-action-sheet>
-			<u-calendar v-model="show_d" toolTip="请选择日期范围" :closeable="false" :mode="mode" @change="time" :mask-close-able="false"></u-calendar>
+			<u-calendar v-model="show_d" toolTip="请选择日期范围" :mode="mode" @change="time" :mask-close-able="false"></u-calendar>
 		</view>
 	</view>
 </template>
@@ -232,6 +232,8 @@
 				}
 			},
 			time_s() {
+				this.itemList = []
+				this.judge = true
 				this.bottoma = false
 				this.bottomb = false
 				this.bottomc = true

+ 2 - 1
pages/me/Warehousing-details/index.vue

@@ -76,7 +76,7 @@
 				<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
 			</view>
 			<u-action-sheet :list="list_a" @click="click" v-model="show" :mask-close-able="false" @close="close"></u-action-sheet>
-			<u-calendar v-model="show_d" toolTip="请选择日期范围" :closeable="false" :mode="mode" @change="time" :mask-close-able="false"></u-calendar>
+			<u-calendar v-model="show_d" toolTip="请选择日期范围"  :mode="mode" @change="time" :mask-close-able="false"></u-calendar>
 		</view>
 	</view>
 </template>
@@ -184,6 +184,7 @@
 			},
 			whole() {
 				this.itemList = []
+				this.judge = true
 				this.bottoma = true
 				this.bottomb = false
 				this.bottomc = false

+ 11 - 0
pages/me/index.vue

@@ -206,6 +206,7 @@
 </template>
 
 <script>
+	import {mapState,mapMutations} from 'vuex'
 	import {
 		request
 	} from '../../common/request/request'
@@ -238,10 +239,19 @@
 				}
 			}
 		},
+		computed: {
+			...mapState(['undataStore'])
+		},
 		created() {
 			this.getMyinfo()
 		},
+		onShow() {
+			if(this.undataStore){
+				this.getMyinfo()
+			}
+		},
 		methods: {
+			...mapMutations(["outStore"]),
 			getMyinfo() {
 				request({
 					url: '/myapp/selectStore',
@@ -255,6 +265,7 @@
 					console.log(err)
 				}).finally(() => {
 					this.loading = false;
+					this.outStore();
 					uni.hideLoading();
 				})
 			},

+ 59 - 33
pages/me/setting/setting.vue

@@ -49,6 +49,7 @@
 			</view>
 		</u-card>
 		<u-button type="primary" @click="exit" style="margin: 20rpx">安全退出</u-button>
+		<luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force"></luo-version-upgrade>
 	</view>
 </template>
 
@@ -64,16 +65,20 @@
 		data() {
 			return {
 				userInfo: {},
-				edition_s: ''
+				edition_s: '',
+				show_s: false,
+				url: '',
+				is_force:false,
 			};
 		},
 		created() {
+			this.getMyinfo();
 			plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
 				console.log(wgtinfo);
 				console.log(wgtinfo.version); //版本号
 				this.edition_s = wgtinfo.version
 			})
-			this.getMyinfo();
+			
 		},
 		methods: {
 			...mapMutations(["logout"]),
@@ -85,38 +90,59 @@
 				});
 			},
 			edition() {
-				request({
-						url: '/baseReq/apkUpgrade',
-						method: 'get',
-						params: {
-							osType: 0
-						}
-					}).then(res => {
-						console.log(res)
-						console.log(res.data.forceVersion) //最低版本
-						console.log(res.data.msg) //更新文案
-						console.log(res.data.url) //下载最新版地址
-						console.log(res.data.version) //最新版本
-							if (this.edition_s == res.data.forceVersion) {
-								console.log("已满足最低版本")
-							} else if (this.edition_s == res.data.version) {
-								console.log("已满足最高版本")
-								uni.showToast({
-									icon: 'none',
-									title: '已经是最新版本了!',
-									position: "bottom"
-								})
-								this.closeModal();
-							} else {
-								console.log("全部不满足")
+				//升级调用的接口
+				if(this.show_s == true){
+					this.show_s = false
+				}
+				console.log(this.show_s)
+					request({
+							url: '/baseReq/apkUpgrade',
+							method: 'get',
+							params: {
+								osType: 0
 							}
-
-					}).catch(err => {
-						console.log(err)
-					})
-					.finally(() => {
-						// Loading.close()
-					})
+						}).then(res => {
+							console.log(res)
+							console.log(res.data.forceVersion) //最低版本
+							console.log(res.data.msg) //更新文案
+							console.log(res.data.url) //下载最新版地址
+							console.log(res.data.version) //最新版本
+					
+							plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
+								console.log(wgtinfo);
+								console.log(wgtinfo.version); //版本号
+								if (wgtinfo.version == res.data.version) {
+									this.show_s = false
+									uni.showToast({
+										icon: 'none',
+										title: '已经是最新版本了',
+										position: "bottom"
+									})
+									this.closeModal();
+									console.log("已经是最新版本了")
+								} else if (wgtinfo.version != res.data.forceVersion) {
+									console.log("必须强制更新")
+									this.show_s = true
+									console.log(res.data.url)
+									this.url = res.data.url
+									this.is_force = true
+								} else if (wgtinfo.version == res.data.forceVersion) {
+									console.log("达到最低版本")
+									this.is_force = false
+									this.show_s = true
+									console.log(this.show_s)
+									this.url = res.data.url
+								}
+					
+							})
+					
+						}).catch(err => {
+							console.log(err)
+						})
+						.finally(() => {
+							// Loading.close()
+						})
+			
 			},
 			getMyinfo() {
 				request({

+ 56 - 49
pages/me/suppliers.vue

@@ -5,16 +5,16 @@
 			<view class="behind"></view>
 			<view class="below">
 				<view class="nothing" v-if="judge==true">
-					<u-empty mode="page" text="出错了!请联系管理员"></u-empty>
+					<u-empty mode="page" text="暂无数据"></u-empty>
 				</view>
 				<view class="content" v-for="(item, index) in supplier_s" :key="index">
 					<view class="content_s">
 						<view class="title">
 							<view></view>
-							<h3>{{item.agentName}}的经营品牌</h3>
+							<h3>{{item.agentName}}</h3>
 						</view>
 						<view class="information_E">
-							<image v-for="(item2, index) in item.brandList" :key="index" :src="item2" mode=""></image>
+							<u-image width="250rpx" v-for="(item2, index) in item.brandList" :key="index" :src="item2" mode="widthFix"></u-image>
 						</view>
 					</view>
 				</view>
@@ -29,45 +29,45 @@
 	} from '../../common/request/request'
 	require("promise.prototype.finally").shim()
 	export default {
-			data() {
-				return {
-					judge: true,
-					supplier_s: []		//经销商信息
-				}
-			},
-			created(){
-				this.supplier()
-			},
-			methods: {
-				supplier(){
-					request({
-						url: '/myapp/storeSelectAgent',
-						method: 'Post',
-						data: {
-							storeId:this.$store.state.storeInfo.storeId,
-							userId:this.$store.state.storeInfo.userId
-						}
-					}).then(res => {
-						console.log(res.data.data)
-						console.log(res)
-						this.supplier_s = res.data.data
-						console.log(this.supplier_s)
-						if(this.supplier_s.length != 0){
-							this.judge = false
-						}
-						console.log(res.data.data[1].brandList[1])
-					}).catch(err => {
-						console.log(err)
-						if(this.supplier_s.length != 0){
-							this.judge = false
-						}
-					}).finally(() => {
-						// Loading.close()
-					})
-				}
+		data() {
+			return {
+				judge: true,
+				supplier_s: [] //经销商信息
+			}
+		},
+		created() {
+			this.supplier()
+		},
+		methods: {
+			supplier() {
+				request({
+					url: '/myapp/storeSelectAgent',
+					method: 'Post',
+					data: {
+						storeId: this.$store.state.storeInfo.storeId,
+						userId: this.$store.state.storeInfo.userId
+					}
+				}).then(res => {
+					console.log(res.data.data)
+					console.log(res)
+					this.supplier_s = res.data.data
+					console.log(this.supplier_s)
+					if (this.supplier_s.length != 0) {
+						this.judge = false
+					}
+					console.log(res.data.data[1].brandList[1])
+				}).catch(err => {
+					console.log(err)
+					if (this.supplier_s.length != 0) {
+						this.judge = false
+					}
+				}).finally(() => {
+					// Loading.close()
+				})
 			}
-			
 		}
+
+	}
 </script>
 
 <style lang="scss" scoped>
@@ -77,12 +77,14 @@
 		background: url(../../static/sailun/behind.png) no-repeat;
 		background-size: 100% 100%;
 		background-repeat: no-repeat;
-		margin-top:-150rpx;
+		margin-top: -150rpx;
 		padding-top: 100px;
 	}
-	.below{
+
+	.below {
 		margin-top: -270rpx;
 	}
+
 	.nothing {
 		width: 96%;
 		height: 800rpx;
@@ -92,6 +94,7 @@
 		border-radius: 20rpx;
 		box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
 	}
+
 	.content {
 		width: 667rpx;
 		height: auto;
@@ -109,19 +112,23 @@
 			height: auto;
 			margin: 0 auto;
 			margin-top: 10rpx;
-			.information{
+
+			.information {
 				margin-top: 10rpx;
 			}
-			.information_E{
-				image{
-					width: 48%;
-					height: 100rpx;
-					margin-top: 20rpx;
-				}
+
+			.information_E {
+				display: flex;
+				width: 100%;
+				flex-flow: wrap;
+				justify-content: space-around;
+				align-items: center;
 			}
+
 			.title {
 				border-bottom: 1rpx solid #EBEBEB;
 				padding-bottom: 15rpx;
+
 				view {
 					width: 6px;
 					height: 20px;

+ 8 - 2
store/index.js

@@ -66,8 +66,8 @@ const store = new Vuex.Store({
 		showToastDuration : 4000,
 		showServerErrorMsg: '连接服务器异常!',
 		hasLogin:false,//用户是否登录
-		storeInfo:{}//存放用户账号数据
-		
+		storeInfo:{},//存放用户账号数据
+		undataStore:false	
 	},
 	mutations: {
 		$uStore(state, payload) {
@@ -111,6 +111,12 @@ const store = new Vuex.Store({
 			uni.removeStorage({
 				key:"token"
 			})
+		},
+		inStore(state){
+			state.undataStore=true;
+		},
+		outStore(state){
+			state.undataStore=false;
 		}
 	}
 })