浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

wangchao 3 年之前
父节点
当前提交
2abeac978e

+ 64 - 0
App.vue

@@ -7,6 +7,8 @@
 		mapMutations
 	} from 'vuex';
 	import appUpdate from 'common/appUpdate.js'
+	import app_push from './components/APPPush/app_push.js'
+	
 	export default {
 		methods: {
 			...mapMutations(['login'])
@@ -30,6 +32,68 @@
 				console.log("info.clientid",info.clientid)
 			   }, err => {
 			});
+			// 监听在线消息事件  
+			plus.push.addEventListener( "receive", function( msg ) {  
+				let params = {
+					inApp: true, // app内横幅提醒
+					voice: true,    // 声音提醒
+					vibration: true,    // 振动提醒
+					messageType: '',
+					messageTitle: msg.title,
+					messageContent: msg.content,
+					messageImage: 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/logo.png'
+				}
+				console.log("params",params)
+				new app_push({
+					...params
+				}).show();
+				var userInfo = uni.getStorageSync("userInfo")
+				var that = this
+				this.$api.doRequest('get', '/salePlanInfo/getTips', {phone:userInfo.phone}).then(res => {
+					if (res.data.data) {
+						let name = 'myTip';
+						let value = res.data.data.myTip;
+						that.$store.commit('$uStore', {
+							name,
+							value
+						});
+						if(value != 0){
+							uni.setTabBarBadge({
+								index:3,
+								text:value+""
+							})
+						}
+						name = 'taskTip';
+						value = res.data.data.taskTip;
+						that.$store.commit('$uStore', {
+							name,
+							value
+						});
+						name = 'contractTip';
+						value = res.data.data.contractTip;
+						that.$store.commit('$uStore', {
+							name,
+							value
+						});
+					}
+				})
+			//其它逻辑  
+			}, false );
+			//监听系统通知栏消息点击事件  
+			plus.push.addEventListener('click', function(msg){  
+			    //处理点击消息的业务逻辑代码  
+				if(msg.content&&msg.content.contains("任务")){
+					uni.navigateTo({
+						url: '/pages/task/my_task'
+					})
+				}
+				else if(msg.content&&(msg.content.contains("合同")||msg.content.contains("交易"))){
+					uni.navigateTo({
+						url: '/pageB/contract/contract'
+					})
+				}
+				
+			}, false);  
 			// #endif
 			this.$socket.initWebIM(this.$ws, true, true)
 			let userInfo = uni.getStorageSync('userInfo') || '';

+ 347 - 0
components/APPPush/app_push.js

@@ -0,0 +1,347 @@
+export class appPush{
+	constructor(option = {}) {
+		console.log("appPush",option)
+		// app内横幅提醒
+		this.inApp = option.inApp;
+		// 声音提醒
+		this.voice = option.voice;
+		// 振动提醒
+		this.vibration = option.vibration;
+		// 消息分类
+		this.messageType = option.messageType || '';
+		// 通知标题
+		this.messageTitle = option.messageTitle || '';
+		// 时间
+		this.messageTime = option.messageTime || '现在';
+		// 通知文案
+		this.messageContent = option.messageContent || '';
+		// 缩略图
+		this.messageImage = option.messageImage || '';	
+		
+		
+	    this.screenWidth = plus.screen.resolutionWidth;
+	    this.screenHeight = plus.screen.resolutionHeight;
+	    // 比例
+	    this.propotation = this.screenWidth / 750
+	    //弹窗容器宽度
+	    this.popupViewWidth = this.propotation * 710;
+	    // 弹窗容器高度
+	    this.popupViewHeight = this.propotation * 192;
+	    // 弹窗容器的Padding
+	    this.viewContentPadding = this.propotation * 30;
+		// 弹框容器的宽度
+		this.viewContentWidth = parseInt(this.popupViewWidth - (this.viewContentPadding * 2))
+		// 弹框到顶部的距离
+		this.system = uni.getSystemInfoSync()
+		// 过度时间
+		this.duration = 200
+		// 关闭时间
+		this.closeTime = 5000
+		
+		console.log(this.inApp, this.voice, this.vibration)
+		
+		this.top = (this.propotation * 20) + this.system.statusBarHeight;
+		this.initTop = -this.system.statusBarHeight
+		
+		this.body = null;
+		this.bodyBg = null;
+		this.timer = null;
+		
+		this.flag = false
+		this.cur = {
+			x: 0,
+			y: 0,
+			pageX: 0,
+			pageY: 0
+		}
+		
+	}
+	
+	// 生成弹框主体
+	createView() {
+		console.log((this.propotation * 20) + this.system.statusBarHeight+ '--------------')
+		let view = new plus.nativeObj.View('popupView', {
+			// tag: 'rect',
+			top: (this.propotation * 20) + this.system.statusBarHeight,
+			left: this.propotation * 20,
+			height: this.popupViewHeight,
+			width: this.popupViewWidth
+		})
+		// 绘制白色背景
+		view.drawRect({
+			color:"#fff",
+			radius:"10px"
+		})
+		let viewContentList = [
+			{
+				src: '/static/push/message-icon.png',
+				id: 'icon',
+				tag: 'img',
+				position: {
+					top: this.viewContentPadding + "px",
+					left: this.viewContentPadding + "px",
+					width: (this.propotation * 24) + 'px',
+					height: (this.propotation * 24) + 'px',
+				}
+			},
+			{
+				tag: 'font',
+				id: 'pop-title',
+				text: this.messageType,
+				textStyles: {
+					size: (this.propotation * 24) + 'px',
+					align: "left",
+					color: "#4F555B"
+				},
+				position: {
+					top: this.viewContentPadding + "px",
+					left: (this.propotation * 64) + 'px',
+					height: (this.propotation * 24) + 'px',
+					width: this.viewContentWidth + "px",
+				}
+			},
+			{
+				tag: 'font',
+				id: 'time',
+				text: this.messageTime,
+				textStyles: {
+					size: (this.propotation * 24) + 'px',
+					align: "right",
+					color: "#4F555B"
+				},
+				position: {
+					top: this.viewContentPadding + "px",
+					left: this.viewContentPadding + "px",
+					height: (this.propotation * 24) + 'px',
+					width: this.viewContentWidth + "px",
+				}
+			},
+			{
+				tag: 'font',
+				id: 'push-title',
+				text: this.messageTitle,
+				textStyles: {
+					size: (this.propotation * 30) + 'px',
+					align: "left",
+					color: "#202123",
+					overflow: "ellipsis"
+				},
+				position: {
+					top: (this.propotation * 82) + 'px',
+					left: (this.propotation * 30) + 'px',
+					height: (this.propotation * 30) + 'px',
+					width: (this.propotation * 505) + 'px',
+				}
+			},
+			{
+				tag: 'font',
+				id: 'push-content',
+				text: this.messageContent,
+				textStyles: {
+					size: (this.propotation * 24) + 'px',
+					align: "left",
+					color: "#4F555B",
+					overflow: "ellipsis"
+				},
+				position: {
+					top: (this.propotation * 130) + 'px',
+					left: (this.propotation * 30) + 'px',
+					height: (this.propotation * 24) + 'px',
+					width: (this.propotation * 505) + 'px',
+				}
+			},
+			{
+				src: this.messageImage,
+				id: 'image',
+				tag: 'img',
+				position: {
+					top: (this.propotation * 68) + 'px',
+					// right: "0px",
+					left: (this.propotation * 586) + 'px',
+					width: (this.propotation * 100) + 'px',
+					height: (this.propotation * 100) + 'px',
+				}
+			},
+			{
+				src: '/static/push/img-bg.png',
+				id: 'img-bg',
+				tag: 'img',
+				position: {
+					top: (this.propotation * 68) + 'px',
+					// right: "0px",
+					left: (this.propotation * 586) + 'px',
+					width: (this.propotation * 100) + 'px',
+					height: (this.propotation * 100) + 'px',
+				}
+			},
+		]
+		view.draw(viewContentList)
+		// view.addEventListener("click",(e)=>{
+		// 	console.log('---------------------')
+		// });
+		view.addEventListener("touchstart", (event) => {
+			// console.log(event)
+			this.flag = true;  
+			var touch;  
+			if (event.touches) {  
+				touch = event.touches[0];  
+			} else {  
+				touch = event;  
+			}  
+			this.cur.x = touch.clientX;  
+			this.cur.y = touch.clientY;
+			this.cur.pageX = touch.pageX;
+			this.cur.pageY = touch.pageY;  
+		})
+		view.addEventListener("touchmove", (event) => {
+			// console.log(e)
+			var touch;  
+			if (event.touches) {  
+				touch = event.touches[0];  
+			} else {  
+				touch = event;
+			}  
+			let moveX = touch.pageX - this.cur.x;   
+			let moveY = touch.pageY - this.cur.y;   
+			let x = moveX;  
+			let y = moveY;
+			// console.log(x, y)
+			// console.log(this.cur, touch)
+			if (x < 0) {  
+				// x = 0;  
+			} else if (x > (this.popupViewWidth - this.popupViewWidth)) {  
+				// x = this.screenWidth - 40;  
+			}  
+			if (y < 0) {  
+				// y = 0;  
+			} else if (y >= ((this.propotation * 20) + this.system.statusBarHeight)) {  
+				y = ((this.propotation * 20) + this.system.statusBarHeight);  
+			}  
+			this.body.setStyle({  
+				top: y + 'px',  
+				left: x + 'px'  
+			});
+		})
+		/**
+		 * 这里有一个bug暂时无法解决,当用户快速往左滑时,滑动区域超出屏幕会监听不到touchend事件😂,很难被发现我就不解决了
+		 */
+		view.addEventListener("touchend", (event) => {
+			// console.log(this.cur, event)
+			var touch;
+			if (event.touches) {  
+				touch = event.touches[0];  
+			} else {  
+				touch = event;  
+			}
+			let differX = Math.abs(this.cur.pageX) - Math.abs(touch.pageX)
+			let differY = Math.abs(this.cur.pageY) - Math.abs(touch.pageY)
+			this.flag = false
+			// console.log(differX, differY)
+			if(Math.abs(differX) > 5 || Math.abs(differY) > 5) {	// 上下移动或左右移动超过5px则关闭弹窗
+				this.hide()
+			} else {	// 否则当作单击事件
+				console.log('-------------------')
+				this.hide()
+			}
+		})
+		this.body = view;
+		
+	// 	let bodyBg = new plus.nativeObj.View('bodyBg',{
+	// 		top: (this.propotation * 20) + this.system.statusBarHeight,
+	// 		left: this.propotation * 20,
+	// 		height: this.popupViewHeight,
+	// 		width: this.popupViewWidth,
+	// 		backgroundColor:'rgba(0, 0, 0, 1)',
+	// 	});
+	// 	bodyBg.draw([
+	// 	  {tag:'font',id:'confirm',text:'关闭关闭',textStyles:{color:'red',size:'16px'}},
+	// 	]);
+	
+	// 	bodyBg.addEventListener("click",(e)=>{
+	// 		console.log('---------------------')
+	// 	});
+	// 	this.bodyBg = bodyBg
+	}
+	// 显示/关闭弹框动画
+	modelAnimationOpenOrClose(type) {
+		var options = {type:type,duration:this.duration};
+		plus.nativeObj.View.startAnimation(options,this.body, () => {
+			// 关闭原生动画
+			plus.nativeObj.View.clearAnimation();
+		});
+	}
+	bgAnimationOpenOrClose(type) {
+		var options = {type:type,duration:this.duration};
+		plus.nativeObj.View.startAnimation(options,this.bodyBg, () => {
+			// 关闭原生动画
+			plus.nativeObj.View.clearAnimation();
+		});
+	}
+	// closeAnimation() {
+	// 	// push弹框距离最顶部的距离
+	// 	let top = (this.propotation * 20) + this.system.statusBarHeight
+	// 	// 完全隐藏时的顶部距离
+	// 	let hideTop = -this.system.statusBarHeight
+	// 	this.timer = setInterval(() => {
+	// 		this.top = this.top - 2
+	// 		if(this.top < hideTop * 2) {
+	// 			clearInterval(this.timer)
+	// 			this.timer = null
+	// 		}
+	// 		this.body.setStyle({
+	// 			top:this.top
+	// 		})
+	// 	}, 1)
+	// }
+	// 显示弹框
+	show() {
+		this.tips()
+		if(this.inApp) {
+			this.createView()
+			// this.modelAnimationOpenOrClose('slide-in-right')
+			this.body.show()
+			// this.bodyBg.show()
+			setTimeout(() => {
+				if(this.body) {
+					this.hide()
+				}
+			}, this.closeTime)
+		}
+	}
+	// 关闭弹框
+	hide() {
+		this.modelAnimationOpenOrClose('slide-out-right')
+		this.body.hide()
+		setTimeout(() => {
+			plus.nativeObj.View.clearAnimation();
+			this.body = null
+		}, this.duration)
+		// this.bgAnimationOpenOrClose('slide-out-right')
+		// this.bodyBg.hide()
+	}
+	// 调用系统提示音和振动
+	tips() {
+		if(this.voice) {
+			let system = uni.getSystemInfoSync().platform
+			if(system == 'ios') {
+				let player = plus.audio.createPlayer( "/static/audio/ios.mp3" );
+				player.play()
+			} else {
+				let main = plus.android.runtimeMainActivity();
+				let RingtoneManager = plus.android.importClass("android.media.RingtoneManager");
+				let uri = RingtoneManager.getActualDefaultRingtoneUri(main, RingtoneManager.TYPE_NOTIFICATION);
+				console.log(uri)
+				let MediaPlayer = plus.android.importClass("android.media.MediaPlayer");  
+				let player = MediaPlayer.create(main, uri);  
+				player.setLooping(false);  
+				player.prepare();  
+				player.start();
+			}
+		}
+		if(this.vibration) {
+			plus.device.vibrate()
+		}
+	}
+}
+
+export default appPush

+ 14 - 0
components/APPPush/index.js

@@ -0,0 +1,14 @@
+import app_push from './app_push.js'
+
+const appPush = {
+	install: function(Vue) {
+		Vue.prototype.$appPush = function(op = {}) {
+			console.log("进入appPush")
+			new app_push({
+				...op
+			}).show();
+		}
+	}
+}
+
+export default appPush

+ 1 - 2
config/index.js

@@ -1,8 +1,7 @@
 const dev = {
-	// baseUrlNew: 'http://192.168.1.122:9100/',
 	baseUrl: 'https://www.zthymaoyi.com',
 	baseUrlNew: 'http://192.168.1.120:8090/',
-	  // baseUrlNew: 'http://api.eliangeyun.com/',
+	// baseUrlNew: 'http://api.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 2 - 1
main.js

@@ -14,7 +14,8 @@ import tarBar from './components/tarbar.vue'
 Vue.component('tar-bar', tarBar)
 import tran from './pages/tran/tran.vue'
 Vue.component('tran',tran)
-
+import appPush from './components/APPPush/index.js'
+Vue.use(appPush)
 import my from './pages/user/user.vue'
 Vue.component('my',my)
 // main.js

+ 149 - 124
pageA/product/Identity_switching.vue

@@ -1,35 +1,46 @@
 <template>
-	
+
 	<view class="center">
 		<view v-for="(item , index) in lists" :Key="index">
-			<view class="forList">
+			<view class="forList" @click="definition(item)">
 				<view class="flex">
 					<view class="company" v-if="item.customerType == '企业'">{{item.customerType}}</view>
 					<view class="company1" v-if="item.customerType == '个人'">{{item.customerType}}</view>
 					<view class="guess-item" @click="navToDetailPage(item)">
-				</view>
-				
+					</view>
+
 					<view class="infos">
-	
-						<view class="info1">{{item.customerName}}
-							<view class='but but1' v-if="item.authenticationStatus == '已认证'">{{item.authenticationStatus}}</view>
-							<view class='but but2' v-if="item.authenticationStatus == '审核中'">{{item.authenticationStatus}}</view>
-							<view class='but but3' v-if="item.authenticationStatus == '未通过'">{{item.authenticationStatus}}</view>
-							<view class='but but4' v-if="item.authenticationStatus == '已覆盖'">{{item.authenticationStatus}}</view>
+
+						<view class="info1">
+							<view v-if="item.customerType == '企业'">{{item.compName}}</view>
+							<view v-if="item.customerType == '个人'">{{item.customerName}}</view>
+							<view class='but but1' v-if="item.authenticationStatus == '已认证'">
+								{{item.authenticationStatus}}
+							</view>
+							<view class='but but2' v-if="item.authenticationStatus == '审核中'">
+								{{item.authenticationStatus}}
+							</view>
+							<view class='but but3' v-if="item.authenticationStatus == '未通过'">
+								{{item.authenticationStatus}}
+							</view>
+							<view class='but but4' v-if="item.authenticationStatus == '已覆盖'">
+								{{item.authenticationStatus}}
+							</view>
 						</view>
-						<view class="info2">{{item.customerPhone}}</view>	
+						<view class="info2">{{item.customerPhone}}</view>
 					</view>
-	
+
 				</view>
-					<hr style="margin: 10px 0px;">
+				<hr style="margin: 10px 0px;">
 				<label>
-					<checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
+					<checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked"
+						@click.stop="checkBox($event,item)"></checkbox>
 					<text>设置默认</text>
 				</label>
 			</view>
 		</view>
 	</view>
-	
+
 	</view>
 	</view>
 </template>
@@ -42,7 +53,7 @@
 		name: "buy",
 		data() {
 			return {
-				lists:[],
+				lists: [],
 				PageCur: "buy",
 				buyInfo: [],
 				pages: 1, //页数
@@ -53,28 +64,28 @@
 				scrollTop: 0,
 				TabCur: 0,
 				current: 1,
-				checked:false,
-				goodsName:'',
-				receivePrivate:'',
-				receiveCity:'',
-				receiveArea:'',
-				minimumVolume:'',
-				basis:'',
-				buyer:'',
-				unitPrice:'',
-				receiveWarehouse:'',
-				procurementPlanType:'',
-				procurementPlan:'',
+				checked: false,
+				goodsName: '',
+				receivePrivate: '',
+				receiveCity: '',
+				receiveArea: '',
+				minimumVolume: '',
+				basis: '',
+				buyer: '',
+				unitPrice: '',
+				receiveWarehouse: '',
+				procurementPlanType: '',
+				procurementPlan: '',
 				identityAuthenticationInfo: {
 					pageSize: 10,
 					currentPage: 1,
 					commonId: "",
-					
-					
+
+
 				},
 			};
 		},
-		onShow(){
+		onShow() {
 			this.getList()
 		},
 		onLoad(options) {
@@ -88,40 +99,47 @@
 			this.unitPrice = options.unitPrice
 			this.receiveWarehouse = options.receiveWarehouse
 			this.procurementPlanType = options.procurementPlanType
-			this.procurementPlan=options.procurementPlanNo
+			this.procurementPlan = options.procurementPlanNo
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		methods: {
+			definition(item){
+				if (item.customerType == "企业") {
+					this.$store.commit('configfreightChoice', item.compName)
+				} else if (item.customerType == "个人") {
+					this.$store.commit('configfreightChoice', item.customerName)
+				}
+				uni.navigateBack(1)
+			},
 			getList() {
 				this.identityAuthenticationInfo.commonId = this.userInfo.id
 				this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
 						pageSize: 10,
 						currentPage: 1,
 						commonId: this.userInfo.id,
-						flag:1
+						flag: 1
 					}, 'application/json;charset=UTF-8').then(res => {
-						if(res.data.code==200){
-							for(var i=0;i<res.data.data.records.length;i++){
-								if(res.data.data.records[i].defaultFlag!=1){
-									res.data.data.records[i].checked=false
-								}else{
-									res.data.data.records[i].checked=true
+						if (res.data.code == 200) {
+							for (var i = 0; i < res.data.data.records.length; i++) {
+								if (res.data.data.records[i].defaultFlag != 1) {
+									res.data.data.records[i].checked = false
+								} else {
+									res.data.data.records[i].checked = true
 								}
 							}
 							this.lists = res.data.data.records
 						}
 					})
 					.catch(res => {
-						if(res.errmsg){
+						if (res.errmsg) {
 							uni.showToast({
 								title: res.errmsg,
 								icon: 'none',
 								duration: 2000
 							})
-						}
-						else{
+						} else {
 							uni.showToast({
 								title: "系统异常,请联系管理员",
 								icon: 'none',
@@ -130,35 +148,34 @@
 						}
 					});
 			},
-			checkBox(e,item){
-				for(var i=0;i<this.lists.length;i++){
-					this.lists[i].checked=true
+			checkBox(e, item) {
+				for (var i = 0; i < this.lists.length; i++) {
+					this.lists[i].checked = true
 				}
-				item.checked=true
+				item.checked = true
 				this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
-						id:item.id,
-						defaultFlag:1,
+						id: item.id,
+						defaultFlag: 1,
 						commonId: this.userInfo.id
 					}).then(res => {
-						if(res.data.code==200){
+						if (res.data.code == 200) {
 							// this.lists = res.data.data.records
-							
+
 							uni.navigateBack({
-							 
-							  delta: 1
-							 
-})
+
+								delta: 1
+
+							})
 						}
 					})
 					.catch(res => {
-						if(res.errmsg){
+						if (res.errmsg) {
 							uni.showToast({
 								title: res.errmsg,
 								icon: 'none',
 								duration: 2000
 							})
-						}
-						else{
+						} else {
 							uni.showToast({
 								title: "系统异常,请联系管理员",
 								icon: 'none',
@@ -180,17 +197,17 @@
 			// },
 			navToDetailPage(item) {
 				// if (index == 1) {
-					uni.navigateTo({
-						url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}&goodsName=${this.goodsName}
+				uni.navigateTo({
+					url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}&goodsName=${this.goodsName}
 						&receivePrivate=${this.receivePrivate}&receiveCity=${this.receiveCity}&receiveArea=${this.receiveArea}&minimumVolume=${this.minimumVolume}&buyer=${this.buyer}&basisPrice=${this.basis}&unitPrice=${this.unitPrice}
 						&receiveWarehouse=${this.receiveWarehouse}&procurementPlanType=${this.procurementPlanType}&procurementPlanNo=${this.procurementPlan}`
-					})
-					},
-				// } else {
-				// 	uni.navigateTo({
-				// 		url: `/pageD/identity/driverIdentityLook`
-				// 	})
-				
+				})
+			},
+			// } else {
+			// 	uni.navigateTo({
+			// 		url: `/pageD/identity/driverIdentityLook`
+			// 	})
+
 
 			// }
 		}
@@ -220,68 +237,76 @@
 		line-height: 35px;
 		color: #22C572;
 		font-size: 12px;
-		
+
 	}
-	.company1{
-			width: 35px;
-			height: 35px;
-			background-color: #FEECE6;
-			font-size: 16px;
-			margin-top: 10px;
-			border-radius: 5px;
-			text-align: center;
-			line-height: 35px;
-			color:#FE6430;
-			font-size: 12px;
-		}
-	
-		.infos {
-			/* margin: 10px 20px; */
-			width: 100%;
-			display: inline-table;
-		}
-	
-		.info {
-			line-height: 20px;
-		}
-	
-		.but {
-			margin-right: 30px;
-			float: right;
-			font-size: 14px;
-			
-			background-color: #FFFFFF;
-		}
-		.but1{
-			color: #22C572 ;
-		}
-		.but2{
-			color:#FE6430;
-		}
-		.but3{
-			color:#FB1E1E;
-		}
-		.but4{
-			color:#AFB3BF;
-		}
-		.forList{
-			background-color: #FFFFFF;
-			padding: 10px 10px;
-			border-radius: 10px;
-			margin-top: 10px;
-		}
+
+	.company1 {
+		width: 35px;
+		height: 35px;
+		background-color: #FEECE6;
+		font-size: 16px;
+		margin-top: 10px;
+		border-radius: 5px;
+		text-align: center;
+		line-height: 35px;
+		color: #FE6430;
+		font-size: 12px;
+	}
+
+	.infos {
+		/* margin: 10px 20px; */
+		width: 100%;
+		display: inline-table;
+	}
+
+	.info {
+		line-height: 20px;
+	}
+
+	.but {
+		margin-right: 30px;
+		float: right;
+		font-size: 14px;
+
+		background-color: #FFFFFF;
+	}
+
+	.but1 {
+		color: #22C572;
+	}
+
+	.but2 {
+		color: #FE6430;
+	}
+
+	.but3 {
+		color: #FB1E1E;
+	}
+
+	.but4 {
+		color: #AFB3BF;
+	}
+
+	.forList {
+		background-color: #FFFFFF;
+		padding: 10px 10px;
+		border-radius: 10px;
+		margin-top: 10px;
+	}
+
 	/* 	.guess-item{
 			font-size: 18px;
 			margin-left: 20px;
 			font-weight: 700;
 		} */
-		.info1{
-			font-size: 18px;
-			margin-left: 20px;
-			font-weight: 700;
-		}
-		.info2{
-			margin-left: 20px;
-			color: #AFB3BF;
-		}
+	.info1 {
+		font-size: 18px;
+		margin-left: 20px;
+		font-weight: 700;
+	}
+
+	.info2 {
+		margin-left: 20px;
+		color: #AFB3BF;
+	}
 </style>

+ 30 - 19
pageA/product/business_buy.vue

@@ -216,7 +216,8 @@
 				unloadingFee: 0,
 				packingMoney: 0,
 				packing: '散装',
-				packingFee: 0
+				packingFee: 0,
+				// choice : false,
 			};
 		},
 		onLoad(options) {
@@ -240,25 +241,34 @@
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
+			
 		},
 		onShow() {
-			this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
-				commonId: this.userInfo.id
-			}).then(res => {
-				if (res.data.code == 200) {
-					this.goods = res.data.data
-					if (this.goods.customerTypeFlag == 1) {
-						this.purchaseOrder.invoiceFee = -20
-						this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
-							.purchaseOrder.invoiceFee)
-					} else {
-						this.purchaseOrder.invoiceFee = 0
-						this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
-							.purchaseOrder.invoiceFee)
-					}
+			if( this.$store.state.choice != "" ){
+				if(this.goods.customerTypeFlag==1){
+					this.goods.customerName = this.$store.state.choice
+				}else if(this.goods.customerTypeFlag==2){
+					this.goods.compName = this.$store.state.choice
 				}
-				uni.hideLoading()
-			})
+			}else{
+				this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
+					commonId: this.userInfo.id
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.goods = res.data.data
+						if (this.goods.customerTypeFlag == 1) {
+							this.purchaseOrder.invoiceFee = -20
+							this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
+								.purchaseOrder.invoiceFee)
+						} else {
+							this.purchaseOrder.invoiceFee = 0
+							this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
+								.purchaseOrder.invoiceFee)
+						}
+					}
+					uni.hideLoading()
+				})
+			}	
 		},
 		methods: {
 			liang() {
@@ -343,7 +353,9 @@
 												icon: 'none',
 												duration: 2000,
 												success() {
-													uni.navigateBack(1)
+													setTimeout(()=>{
+														uni.navigateBack(1)
+													},2000)
 												}
 											})
 										} else {
@@ -388,7 +400,6 @@
 				})
 			},
 			someprice(e) {
-
 				if (this.purchaseOrder.pointPrice && this.purchaseOrder.invoiceFee && this.packingFee) {
 					this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) + Number(this.purchaseOrder
 						.pointPrice) + Number(this.purchaseOrder.invoiceFee) + Number(-this.packingFee)

+ 12 - 1
pageA/product/business_sale.vue

@@ -235,6 +235,13 @@
 				...mapState(['hasLogin','userInfo']),
 			},
 			onShow() {
+				if( this.$store.state.choice != "" ){
+					if(this.goods.customerTypeFlag==1){
+						this.goods.customerName = this.$store.state.choice
+					}else if(this.goods.customerTypeFlag==2){
+						this.goods.compName = this.$store.state.choice
+					}
+				}else{
 				this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
 					if(res.data.code==200){
 						this.goods=res.data.data
@@ -248,6 +255,7 @@
 					}
 					uni.hideLoading()
 				})
+				}
 			},
 			methods: {
 				liang(){
@@ -328,7 +336,10 @@
 													icon: 'none',
 													duration: 2000,
 													success() {
-														uni.navigateBack(1)
+														setTimeout(()=>{
+														uni.navigateBack(1)	
+														},2000)
+														
 													}
 												})
 											}

+ 20 - 4
pageD/myRelease/sellGrain.vue

@@ -268,6 +268,13 @@
 			}
 		},
 		onShow() {
+			if( this.$store.state.choice != "" ){
+				if(this.goods.customerTypeFlag==1){
+					this.goods.customerName = this.$store.state.choice
+				}else if(this.goods.customerTypeFlag==2){
+					this.goods.compName = this.$store.state.choice
+				}
+			}else{
 			var that = this
 			this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
 				commonId: this.userInfo.id
@@ -282,6 +289,7 @@
 				}
 				uni.hideLoading()
 			})
+			}
 		},
 		methods: {
 			yearchange() {
@@ -621,11 +629,19 @@
 							that.$api.doRequest('post', '/salePlanInfo/api/insertSalePlanInfo', that
 									.insertSalePlanInfo).then(res => {
 									if (res.data.code == 200) {
-										that.$api.msg('发布成功')
-										that.deptList = {}
-										uni.navigateTo({
-											url: `/pages/release/release`
+										uni.showToast({
+											title:'发布成功',
+											icon: 'none',
+											duration: 2000,
+											success() {
+												setTimeout(()=>{
+													uni.navigateTo({
+														url: `/pages/release/release`
+													})
+												},2000)
+											}
 										})
+										that.deptList = {}
 									} else {
 										uni.showToast({
 											title: res.data.message,

+ 99 - 86
pageD/warehousings/ex_warehouse.vue

@@ -219,7 +219,7 @@
 					pcFlag: 0,
 					contractNo: {},
 					carNo: {},
-					warehouseName:{},
+					warehouseName: {},
 				},
 				WarehouseInOutInfo1: {
 					contractNo: {},
@@ -235,7 +235,7 @@
 				maxSize: 5 * 1024 * 1024, //限制文件大小 5M
 				btnLoading: false, //防止重复点击
 				imgUrls: [],
-				binNumber:[],
+				binNumber: [],
 				warehouse: [],
 				warehouseIndex: -1,
 				warehouse1: [],
@@ -249,7 +249,7 @@
 				},
 				show: false,
 				license1: "",
-				ids:"",
+				ids: "",
 
 			}
 		},
@@ -267,23 +267,6 @@
 				}
 				return year + '-' + month + "-" + date1
 			},
-			// time:{
-			// 	var date = new Date()
-			// 	var year = date.getFullYear()
-			// 	var month = date.getMonth()
-			// 	var date1 = date.getDate()
-			// 	set() {
-			// 			if (month + 1 < 10) {
-			// 				month = "0" + (month + 1)
-			// 			}
-			// 			if (date1 + 1 < 10) {
-			// 				date1 = "0" + date1
-			// 			}
-			// 		},
-			// 		get() {
-			// 			return year + '-' + month + "-" + date1
-			// 		},
-			// },
 			startDate() {
 				return new Date(new Date(new Date().toLocaleDateString()).getTime() - (1 * 60 * 60 * 1000))
 			},
@@ -303,9 +286,12 @@
 			this.WarehouseInOutInfo.warehouseName = option.warehouseName
 			this.getList(this.WarehouseInOutInfo.id)
 		},
-		onShow() {	
-			this.$api.doRequest('get', '/warehouseInOutInfo/selectCompId', {contractNo:this.WarehouseInOutInfo.contractNo,warehouseType:1,}).then(res => {
-				 if(res.data.code==200){
+		onShow() {
+			this.$api.doRequest('get', '/warehouseInOutInfo/selectCompId', {
+				contractNo: this.WarehouseInOutInfo.contractNo,
+				warehouseType: 1,
+			}).then(res => {
+				if (res.data.code == 200) {
 					this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
 						compId: res.data.data,
 						warehouseType: 1,
@@ -313,66 +299,88 @@
 						if (res.data.code == 200) {
 							var arr = []
 							for (var i = 0; i < res.data.data.length; i++) {
-								if (res.data.data[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
+								if (res.data.data[i].warehouseName == this.WarehouseInOutInfo
+									.warehouseName) {
 									this.warehouseIndex = i
 									this.ids = res.data.data[i].id
 								}
 								arr.push(res.data.data[i].warehouseName)
 							}
 							this.warehouselist = res.data.data
+
 							this.warehouse = arr
+							for (var i = 0; i < this.warehouselist.length; i++) {
+								if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
+									var id = this.warehouselist[i].id
+									this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+										id: id,
+									}).then(res => {
+										var arr = []
+										for (var i = 0; i < res.data.data.warehousePositionInfoList
+											.length; i++) {
+											if (res.data.data.warehousePositionInfoList[i]
+												.binNumber == this.WarehouseInOutInfo.binNumber) {
+												this.warehouseIndex1 = i
+											}
+											arr.push(res.data.data.warehousePositionInfoList[i]
+												.binNumber)
+										}
+										this.warehouse1 = arr
+										this.warehouselist11 = res.data.data
+									})
+								}
+							}
 						}
 					})
-				 }
-			})	
+				}
+			})
 		},
-		
+
 		methods: {
 			getList(id1) {
 				var that = this
 				this.$api.doRequest('get', '/warehouseInOutInfo/getInfo', {
 						id: id1
 					}).then(res => {
-						if(res.data.code == 200){
+						if (res.data.code == 200) {
 							this.WarehouseInOutInfo = res.data.data
-							if (this.WarehouseInOutInfo.warehouseInOutDetail != null ) {
-									this.list = this.WarehouseInOutInfo.warehouseInOutDetail
-								}
-								if(this.WarehouseInOutInfo.inOutTypeKey != null){
-										this.ruIndex = this.WarehouseInOutInfo.inOutTypeKey
-								}
-							    if(this.WarehouseInOutInfo.warehouseNameKey != null){
-									this.warehouseIndex = this.WarehouseInOutInfo.warehouseNameKey
-								}
-								this.warehouseIndex1 = this.WarehouseInOutInfo.binNumberKey
-								
-								if(this.WarehouseInOutInfo.gradeKey != null){
-									this.pinIndex = this.WarehouseInOutInfo.gradeKey
-								}
-								var positionid
-								for (var i = 0; i < this.warehouselist.length; i++) {
-									if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
-										this.warehouseIndex = i
-										positionid = this.warehouselist[i].id
-									}
+							if (this.WarehouseInOutInfo.warehouseInOutDetail != null) {
+								this.list = this.WarehouseInOutInfo.warehouseInOutDetail
+							}
+							if (this.WarehouseInOutInfo.inOutTypeKey != null) {
+								this.ruIndex = this.WarehouseInOutInfo.inOutTypeKey
+							}
+							if (this.WarehouseInOutInfo.warehouseNameKey != null) {
+								this.warehouseIndex = this.WarehouseInOutInfo.warehouseNameKey
+							}
+							this.warehouseIndex1 = this.WarehouseInOutInfo.binNumberKey
+
+							if (this.WarehouseInOutInfo.gradeKey != null) {
+								this.pinIndex = this.WarehouseInOutInfo.gradeKey
+							}
+							var positionid
+							for (var i = 0; i < this.warehouselist.length; i++) {
+								if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
+									this.warehouseIndex = i
+									positionid = this.warehouselist[i].id
 								}
+							}
 							this.warehouseChange3(positionid)
-								for (var i = 0; i < this.warehouse1.length; i++) {
-									if (this.warehouse1[i] == this.WarehouseInOutInfo.binNumber) {
-										this.warehouseIndex1 = i
-									}
+							for (var i = 0; i < this.warehouse1.length; i++) {
+								if (this.warehouse1[i] == this.WarehouseInOutInfo.binNumber) {
+									this.warehouseIndex1 = i
 								}
+							}
 						}
 					})
 					.catch(res => {
-						if(res.errmsg){
+						if (res.errmsg) {
 							uni.showToast({
 								title: res.errmsg,
 								icon: 'none',
 								duration: 2000
 							})
-						}
-						else{
+						} else {
 							uni.showToast({
 								title: "系统异常,请联系管理员",
 								icon: 'none',
@@ -381,27 +389,27 @@
 						}
 					});
 			},
-	 async warehouseChange3(id){
-			var that = this
-			this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
-				id: id,
-			}).then(res => {
-				if(res.data.code == 200 ){
-					that.binNumber=res.data.data.warehousePositionInfoList
-					var arr = []
-					for (var i = 0; i < res.data.data.warehousePositionInfoList.length; i++) {
-						arr.push(res.data.data.warehousePositionInfoList[i].binNumber)
-					}
-					that.warehouse1 = arr
-					for(var i = 0 ; i < that.warehouse1.length ; i++){
-						if(that.warehouse1[i] == that.WarehouseInOutInfo.binNumber){
-							that.warehouseIndex1 = i
+			async warehouseChange3(id) {
+				var that = this
+				this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
+					id: id,
+				}).then(res => {
+					if (res.data.code == 200) {
+						that.binNumber = res.data.data.warehousePositionInfoList
+						var arr = []
+						for (var i = 0; i < res.data.data.warehousePositionInfoList.length; i++) {
+							arr.push(res.data.data.warehousePositionInfoList[i].binNumber)
+						}
+						that.warehouse1 = arr
+						for (var i = 0; i < that.warehouse1.length; i++) {
+							if (that.warehouse1[i] == that.WarehouseInOutInfo.binNumber) {
+								that.warehouseIndex1 = i
+							}
 						}
 					}
-				}			
-			})
-			return 	that.warehouse1
-		},
+				})
+				return that.warehouse1
+			},
 			warehouseChange(e) {
 				var id = ''
 				this.warehouseIndex = e.detail.value
@@ -414,7 +422,7 @@
 				this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
 					id: id,
 				}).then(res => {
-					this.binNumber=res.data.data
+					this.binNumber = res.data.data
 					var arr = []
 					for (var i = 0; i < res.data.data.warehousePositionInfoList.length; i++) {
 						// console.log(res.data.data.warehousePositionInfoList[i])
@@ -429,8 +437,8 @@
 				this.WarehouseInOutInfo.binNumberKey = this.warehouseIndex1
 				this.WarehouseInOutInfo.binNumber = this.warehouse1[this.warehouseIndex1]
 				for (var i = 0; i < this.binNumber.length; i++) {
-					if(this.binNumber[i].binNumber==this.warehouse1[this.warehouseIndex1]){
-						this.WarehouseInOutInfo.baseId=this.binNumber[i].baseId
+					if (this.binNumber[i].binNumber == this.warehouse1[this.warehouseIndex1]) {
+						this.WarehouseInOutInfo.baseId = this.binNumber[i].baseId
 					}
 				}
 			},
@@ -503,12 +511,13 @@
 						return
 					}
 				}
-				if(this.list.bulkDensity&&this.list.bulkDensity<500||this.list.bulkDensity&&this.list.bulkDensity>1000){
+				if (this.list.bulkDensity && this.list.bulkDensity < 500 || this.list.bulkDensity && this.list
+					.bulkDensity > 1000) {
 					this.$api.msg('容重输入错误')
 					return
 				}
-				if(this.list.bulkDensity&&this.list.bulkDensity.indexOf('.')!=-1){
-					if(this.list.bulkDensity.split('.')[1].length>2){
+				if (this.list.bulkDensity && this.list.bulkDensity.indexOf('.') != -1) {
+					if (this.list.bulkDensity.split('.')[1].length > 2) {
 						this.$api.msg('容重输入错误')
 						return
 					}
@@ -564,6 +573,9 @@
 				if (this.imgUrls.length > 0) {
 					this.WarehouseInOutInfo.addressUrl = this.imgUrls[0]
 				}
+				console.log(this.WarehouseInOutInfo)
+				return
+				
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
 					if (res.data.code == 200) {
 						uni.showToast({
@@ -659,12 +671,13 @@
 						return
 					}
 				}
-				if(this.list.bulkDensity&&this.list.bulkDensity<500||this.list.bulkDensity&&this.list.bulkDensity>1000){
+				if (this.list.bulkDensity && this.list.bulkDensity < 500 || this.list.bulkDensity && this.list
+					.bulkDensity > 1000) {
 					this.$api.msg('容重输入错误')
 					return
 				}
-				if(this.list.bulkDensity&&this.list.bulkDensity.indexOf('.')!=-1){
-					if(this.list.bulkDensity.split('.')[1].length>2){
+				if (this.list.bulkDensity && this.list.bulkDensity.indexOf('.') != -1) {
+					if (this.list.bulkDensity.split('.')[1].length > 2) {
 						this.$api.msg('容重输入错误')
 						return
 					}
@@ -718,8 +731,8 @@
 				this.WarehouseInOutInfo.warehouseInOutDetail = this.list
 				this.WarehouseInOutInfo.statusFlag = 3
 				this.WarehouseInOutInfo.pcFlag = 0
-				for(let i = 0 ;i < this.warehouselist.length ; i++){
-					if(this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName){
+				for (let i = 0; i < this.warehouselist.length; i++) {
+					if (this.warehouselist[i].warehouseName == this.WarehouseInOutInfo.warehouseName) {
 						this.WarehouseInOutInfo.baseId = this.warehouselist[i].id
 					}
 				}
@@ -727,7 +740,7 @@
 				uni.showLoading({
 					title: "正在提交"
 				})
-
+			
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
 					if (res.data.code == 200) {
 						uni.showToast({

+ 1 - 1
pageD/warehousings/warehousings.vue

@@ -297,7 +297,7 @@ import upload from '@/components/upload.vue';
 										})
 								 	}
 								 }
-						 		 this.warehouse=arr
+						 		 // this.warehouse=arr
 						 	 }
 						 })
 					 }

+ 2 - 1
pages/attestation/indexTwo.vue

@@ -111,7 +111,7 @@
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
-		onshow() {
+		onShow() {
 			this.getList()
 		},
 		onPullDownRefresh() {
@@ -186,6 +186,7 @@
 				})
 			},
 			getList() {
+				console.log(this.userInfo)
 				this.identityAuthenticationInfo.commonId = this.userInfo.id
 				this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
 						pageSize: 10,

+ 20 - 15
store/index.js

@@ -21,20 +21,20 @@ const saveLifeData = function(key, value) {
 		let tmp = uni.getStorageSync('lifeData');
 		// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
 		tmp = tmp ? tmp : {};
-		if(key == 'contractTip' && tmp[key] < value){
-			uni.vibrateLong({
-			    success: function () {
-			        console.log('震动成功');
-			    }
-			});
-		}
-		if(key == 'taskTip' && tmp[key] < value){
-			uni.vibrateLong({
-			    success: function () {
-			        console.log('震动成功');
-			    }
-			});
-		}
+		// if(key == 'contractTip' && tmp[key] < value){
+		// 	uni.vibrateLong({
+		// 	    success: function () {
+		// 	        console.log('震动成功');
+		// 	    }
+		// 	});
+		// }
+		// if(key == 'taskTip' && tmp[key] < value){
+		// 	uni.vibrateLong({
+		// 	    success: function () {
+		// 	        console.log('震动成功');
+		// 	    }
+		// 	});
+		// }
 		tmp[key] = value;
 		// 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
 		uni.setStorageSync('lifeData', tmp);
@@ -86,7 +86,8 @@ const store = new Vuex.Store({
 		],
 		clientId: lifeData.clientId?lifeData.clientId: "",
 		// 确定收货
-		isConfigfreightTransport:false
+		isConfigfreightTransport:false,
+		choice:""
 	},
 	mutations: {
 		$uStore(state, payload) {
@@ -121,8 +122,12 @@ const store = new Vuex.Store({
 		},
 		configfreightTransport(state,flag){
 			state.isConfigfreightTransport = flag
+		},
+		configfreightChoice(state,val){
+			state.choice = val
 		}
 		
+		
 	},
 	actions: {