Просмотр исходного кода

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

qukaidi 4 лет назад
Родитель
Сommit
d11930f4ea

+ 4 - 3
common/p-scan/scan.vue

@@ -36,6 +36,10 @@
 
 			});
 			this.barcode.onmarked = this.onmarked;
+			
+			// this.barcode.start({vibrate: false}); //振动
+			this.barcode.start({sound: "none"}); //提示音
+			
 			currentWebview.append(this.barcode);
 			const res = uni.getSystemInfoSync();
 			if (res.platform == 'android') { //安卓机
@@ -46,9 +50,6 @@
 
 			});
 			// #endif
-			uni.$on("aaa",(data)=>{
-				this.aaa=data
-			})
 		},
 		onUnload() {
 			clearTimeout(this.t);

+ 1 - 1
pages.json

@@ -186,7 +186,7 @@
 				"path": "suppliers",
 				"style": {
 					"navigationBarTitleText": "我的供应商",
-					"navigationBarBackgroundColor": "#1692F7"
+					"navigationBarBackgroundColor": "#058BF9"
 				}
 			},
 			//优惠卷

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

@@ -72,7 +72,16 @@
 			}
 		},
 		created() {
-
+			const innerAudioContext = uni.createInnerAudioContext();
+			innerAudioContext.autoplay = true;
+			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
+			innerAudioContext.onPlay(() => {
+			  console.log('开始播放');
+			});
+			innerAudioContext.onError((res) => {
+			  console.log(res.errMsg);
+			  console.log(res.errCode);
+			});
 		},
 		methods: {
 			//手动录入调用
@@ -86,6 +95,7 @@
 							tyreNum: this.number_a
 						}
 					}).then(res => {
+						console.log(res.data.code)
 						for (let i = 0; i < this.lisi.length; i++) {
 							if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
 								this.$refs.repeat.show({
@@ -103,7 +113,15 @@
 								return
 							}
 						}
-
+						if (res.data.code == 500){
+							this.$refs.repeat.show({
+								title: res.data.msg,
+								type: 'default',
+								position: 'bottom'
+							})
+							return
+						}
+						
 						this.$refs.repeat.show({
 							title: '录入成功',
 							type: 'success',
@@ -128,7 +146,7 @@
 						console.log(this.lisi)
 					}).catch(err => {
 						this.$refs.repeat.show({
-							title: "请重新录入",
+							title: "网络连接失败",
 							type: 'default',
 							position: 'bottom'
 						})
@@ -160,12 +178,41 @@
 									type: 'default',
 									position: 'bottom'
 								})
+								const innerAudioContext = uni.createInnerAudioContext();
+								innerAudioContext.autoplay = true;
+								innerAudioContext.src = '../../../static/mp3/rescan.mp3';
+								innerAudioContext.onPlay(() => {
+								  console.log('开始播放');
+								});
+								innerAudioContext.onError((res) => {
+								  console.log(res.errMsg);
+								  console.log(res.errCode);
+								});
 								return
 							}
 						}
+						if (res.data.code == 500){
+							this.$refs.repeat.show({
+								title: res.data.msg,
+								type: 'default',
+								position: 'bottom'
+							})
+							const innerAudioContext = uni.createInnerAudioContext();
+							innerAudioContext.autoplay = true;
+							innerAudioContext.src = '../../../static/mp3/scanfailed.mp3';
+							innerAudioContext.onPlay(() => {
+							  console.log('开始播放');
+							});
+							innerAudioContext.onError((res) => {
+							  console.log(res.errMsg);
+							  console.log(res.errCode);
+							});
+							return
+						}
 						this.number_s = ""
 						console.log("我成功啦")
 						console.log(res)
+						
 						this.lisi.push({
 							specs: res.data.data[0].specs,
 							flagRegular: res.data.data[0].isRegular,
@@ -180,6 +227,16 @@
 							plyRating: res.data.data[0].plyRating,
 							scanWay: '1'
 						})
+						const innerAudioContext = uni.createInnerAudioContext();
+						innerAudioContext.autoplay = true;
+						innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
+						innerAudioContext.onPlay(() => {
+						  console.log('开始播放');
+						});
+						innerAudioContext.onError((res) => {
+						  console.log(res.errMsg);
+						  console.log(res.errCode);
+						});
 						this.$refs.repeat.show({
 							title: '扫码成功',
 							type: 'success',
@@ -213,7 +270,7 @@
 			scancodein() {
 				if (this.lisi == '') {
 					this.$refs.repeat.show({
-						title: '请扫码后再点击!',
+						title: '请扫码或录入后再点击!',
 						type: 'default',
 						position: 'bottom'
 					})

+ 57 - 2
pages/home/scancode/scancodeout.vue

@@ -72,7 +72,16 @@
 			}
 		},
 		created() {
-			
+			const innerAudioContext = uni.createInnerAudioContext();
+			innerAudioContext.autoplay = true;
+			innerAudioContext.src = '../../../static/mp3/startscan.mp3';
+			innerAudioContext.onPlay(() => {
+			  console.log('开始播放');
+			});
+			innerAudioContext.onError((res) => {
+			  console.log(res.errMsg);
+			  console.log(res.errCode);
+			});
 		},
 		methods: {
 			//手动录入调用
@@ -102,6 +111,14 @@
 							type: 'success',
 							position: 'bottom'
 						})
+						if (res.data.code == 500){
+							this.$refs.repeat.show({
+								title: res.data.msg,
+								type: 'default',
+								position: 'bottom'
+							})
+							return
+						}
 						this.number_a = ""
 						console.log("我成功啦")
 						this.lisi.push({
@@ -152,9 +169,37 @@
 									type: 'default',
 									position: 'bottom'
 								})
+								const innerAudioContext = uni.createInnerAudioContext();
+								innerAudioContext.autoplay = true;
+								innerAudioContext.src = '../../../static/mp3/rescan.mp3';
+								innerAudioContext.onPlay(() => {
+								  console.log('开始播放');
+								});
+								innerAudioContext.onError((res) => {
+								  console.log(res.errMsg);
+								  console.log(res.errCode);
+								});
 								return
 							}
 						}
+						if (res.data.code == 500){
+							this.$refs.repeat.show({
+								title: res.data.msg,
+								type: 'default',
+								position: 'bottom'
+							})
+							const innerAudioContext = uni.createInnerAudioContext();
+							innerAudioContext.autoplay = true;
+							innerAudioContext.src = '../../../static/mp3/scanfailed.mp3';
+							innerAudioContext.onPlay(() => {
+							  console.log('开始播放');
+							});
+							innerAudioContext.onError((res) => {
+							  console.log(res.errMsg);
+							  console.log(res.errCode);
+							});
+							return
+						}
 						this.number_s = ""
 						console.log("我成功啦")
 						console.log(res)
@@ -172,6 +217,16 @@
 							plyRating: res.data.data[0].plyRating,
 							scanWay: '1'
 						})
+						const innerAudioContext = uni.createInnerAudioContext();
+						innerAudioContext.autoplay = true;
+						innerAudioContext.src = '../../../static/mp3/scansuccess.mp3';
+						innerAudioContext.onPlay(() => {
+						  console.log('开始播放');
+						});
+						innerAudioContext.onError((res) => {
+						  console.log(res.errMsg);
+						  console.log(res.errCode);
+						});
 						this.$refs.repeat.show({
 							title: '扫码成功',
 							type: 'success',
@@ -205,7 +260,7 @@
 			scancodein() {
 				if (this.lisi == '') {
 					this.$refs.repeat.show({
-						title: '请扫码后再点击!',
+						title: '请扫码或录入后再点击!',
 						type: 'default',
 						position: 'bottom'
 					})

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

@@ -43,7 +43,8 @@
 								</view>
 								<view>
 									<view>参加活动</view>
-									<view>{{item3.satisfyActivity}}</view>
+									<view v-if="item3.satisfyActivity == 1">参加</view>
+									<view v-else>不参加</view>
 								</view>
 								<view>
 									<view>创建时间</view>

+ 38 - 27
pages/me/suppliers.vue

@@ -2,44 +2,34 @@
 	<!-- 经销商基本信息 -->
 	<view class="whole">
 		<view class="head">
-			<view class="behind">
+			<view class="behind"></view>
+			<view class="below">
 				<view class="content">
 					<view class="content_s">
 						<view class="title">
 							<view></view>
-							<h3>经销商基本信息</h3>
+							<h3>测试经销商的经营品牌</h3>
 						</view>
-						<view class="information">
-							<u-field style="margin-top: 5rpx;" v-model="mobile" label-width="10" icon="chat-fill" placeholder="暂无数据" disabled="disabled"></u-field>
-							<u-field style="margin-top: 5rpx;" v-model="code" label-width="10" icon="chat-fill" placeholder="暂无数据" disabled="disabled"></u-field>
-							<u-field style="margin-top: 5rpx;" v-model="code_s" label-width="10" icon="chat-fill" placeholder="暂无数据" disabled="disabled"></u-field>
+						<view class="information_E">
+							<image src="../../static/sailun/anyu.png" mode=""></image>
+							<image src="../../static/sailun/heiqishi.png" mode=""></image>
+							<image src="../../static/sailun/anyu.png" mode=""></image>
+							<image src="../../static/sailun/heiqishi.png" mode=""></image>
+							<image src="../../static/sailun/anyu.png" mode=""></image>
+							<image src="../../static/sailun/heiqishi.png" mode=""></image>
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		<view class="below">
-			<view class="content">
-				<view class="content_s">
-					<view class="title">
-						<view></view>
-						<h3>经销商基本信息</h3>
-					</view>
-					<view class="information_E">
-						<image src="../../static/sailun/anyu.png" mode=""></image>
-						<image src="../../static/sailun/heiqishi.png" mode=""></image>
-						<image src="../../static/sailun/anyu.png" mode=""></image>
-						<image src="../../static/sailun/heiqishi.png" mode=""></image>
-						<image src="../../static/sailun/anyu.png" mode=""></image>
-						<image src="../../static/sailun/heiqishi.png" mode=""></image>
-					</view>
-				</view>
-			</view>
-		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../common/request/request'
+	require("promise.prototype.finally").shim()
 	export default {
 			data() {
 				return {
@@ -47,15 +37,36 @@
 					code: '张三',
 					code_s: '13412336446'
 				}
+			},
+			created(){
+				this.supplier()
+			},
+			methods: {
+				supplier(){
+					request({
+						url: '/baseReq/getBrandList',
+						method: 'Post',
+						data: {
+							storeId: '3000',
+							userId: '123'
+						}
+					}).then(res => {
+						console.log(res)
+					}).catch(err => {
+						console.log(err)
+					}).finally(() => {
+						// Loading.close()
+					})
+				}
 			}
+			
 		}
 </script>
 
 <style lang="scss" scoped>
 	.behind {
 		width: 750rpx;
-		// height: 462rpx;
-		height: auto;
+		height: 462rpx;
 		background: url(../../static/sailun/behind.png) no-repeat;
 		background-size: 100% 100%;
 		background-repeat: no-repeat;
@@ -63,7 +74,7 @@
 		padding-top: 100px;
 	}
 	.below{
-		margin-top: 30rpx;
+		margin-top: -270rpx;
 	}
 	.content {
 		width: 667rpx;