高敬炎 2 gadi atpakaļ
vecāks
revīzija
b1779c8936

+ 6 - 0
xiaochengxu/App.vue

@@ -24,4 +24,10 @@
 	page {
 		background-color: #f5f5f5;
 	}
+	.justify-space-between{
+		justify-content: space-between;
+	}
+	.align-item-center{
+		align-items: center;
+	}
 </style>

+ 37 - 14
xiaochengxu/pages/cardHolder/cardHolder.vue

@@ -4,7 +4,7 @@
 		<u-navbar title="电子名片" placeholder>
 			<view class="u-nav-slot relative" slot="left">
 				<u-icon name="bell" size="26" @click="toNotice"></u-icon>
-				<u-badge :isDot="true" type="error" class="point"></u-badge>
+				<u-badge :isDot="unread>0?true:false" type="error" class="point"></u-badge>
 			</view>
 		</u-navbar>
 		<view class="content1 flex-row-center">
@@ -72,7 +72,7 @@
 				<view class="row2">
 					{{item.companyName}}
 				</view>
-				<view class="row3" @click="toMap">
+				<view class="row3" @click="toMap(item)">
 					<uni-icons type="redo" size="20"></uni-icons>
 					<text>{{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}</text>
 				</view>
@@ -160,6 +160,8 @@
 				checkedList:[],
 				delShow:false,
 				qrcodeShow:false,
+				unread:0,
+				noticeList:[],
 			};
 		},
 		onShow() {
@@ -338,6 +340,7 @@
 				this.isShowType = false
 			},
 			init(){
+				this.getList()
 				this.$request.baseRequest('admin.unimall.cardClassifyInfo', 'list',{
 					page:1,
 					limit:9999,
@@ -354,6 +357,24 @@
 					console.log(this.typeColumns)
 				})
 			},
+			getList(){
+					this.$request.baseRequest('admin.unimall.cardNewsInfo', 'list',{
+						receiveId:uni.getStorageSync("userInfo").id,
+					}, failres => {
+						console.log('res+++++', failres.errmsg)
+						this.$refs.uToast.show({
+							type: 'error',
+							message: failres.errmsg,
+						})
+					}).then(res => {
+						this.noticeList=res.data.items
+						if(this.noticeList.length>0){
+							var data=this.noticeList.filter((item)=>{return item.newsFlag==0})
+							this.unread=data?data.length:0
+						}
+						console.log(this.unread)
+					})
+			},
 			upCallback(page){
 				var that = this
 				uni.showLoading({
@@ -534,20 +555,22 @@
 			},
 			scan() {
 				// console.log(1)
-				uni.navigateTo({
-					url: "/pages/cardHolder/scancode"
-				})
-				// uni.scanCode({
-				// 	success: function(res) {
-				// 		console.log('条码类型:' + res.scanType);
-				// 		console.log('条码内容:' + res.result);
-						
-				// 	}
-				// });
+				// uni.navigateTo({
+				// 	url: "/pages/cardHolder/scancode"
+				// })
+				uni.scanCode({
+					success: function(res) {
+						console.log('条码类型:' + res.scanType);
+						console.log('条码内容:' + res.result);
+						uni.navigateTo({
+							url: "/pages/cardHolder/scanCodeAddCard?id="+res.result
+						})
+					}
+				});
 			},
-			toMap() {
+			toMap(item) {
 				uni.navigateTo({
-					url: "/pages/cardHolder/map"
+					url: "/pages/cardHolder/map?location="+item.location
 				})
 			},
 		}

+ 5 - 0
xiaochengxu/pages/cardHolder/map.vue

@@ -27,6 +27,11 @@
 				}]
 			}
 		},
+		onLoad(options) {
+			var location=options.location.split(',')
+			this.latitude=location[0]
+			this.longitude=location[1]
+		},
 		methods: {
 	
 		}

+ 64 - 2
xiaochengxu/pages/cardHolder/notice.vue

@@ -1,16 +1,78 @@
 <template>
 	<view>
-		通知消息
+		<!-- <mescroll-body  :up="upOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback"> -->
+			
+			<view v-for='item in noticeList'>
+				<view class="">
+					<view>{{item.newsTitle}}</view>
+					<view>{{parseTime(item.gmtCreate)}}</view>
+				</view>
+				<view>{{item.newsContent}}</view>
+			</view>
+		<!-- </mescroll-body> -->
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	export default {
+		mixins: [MescrollMixin],
 		data() {
 			return {
-				
+				noticeList:[],
+				unreadList:[]
 			};
+		},
+		onShow() {
+			this.getList()
+		},
+		methods:{
+			getList(){
+				var that = this
+				uni.showLoading({
+						title: '数据加载中'
+					})
+				this.$request.baseRequest('admin.unimall.cardNewsInfo', 'list',{
+					receiveId:uni.getStorageSync("userInfo").id,
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					console.log(res)
+					let curPageLen = res.data.items.length;
+					let totalPage = res.data.total;
+					this.noticeList=res.data.items
+					if(this.noticeList.length>0){
+						var data=this.noticeList.filter((item)=>{return item.newsFlag==0})
+						this.unreadList=data
+						if(this.unreadList.length>0){
+							for(var i=0;i<this.unreadList.length;i++){
+								this.unreadList[i].newsFlag=1
+								this.$request.baseRequest('admin.unimall.cardNewsInfo', 'update',{
+									cardNewsInfo:JSON.stringify(this.unreadList[i]),
+								}, failres => {
+									console.log('res+++++', failres.errmsg)
+									this.$refs.uToast.show({
+										type: 'error',
+										message: failres.errmsg,
+									})
+									uni.hideLoading()
+								}).then(res => {})
+							}
+							
+						}
+					}
+					
+					uni.hideLoading()
+				})
+			},
 		}
+		
 	}
 </script>
 

+ 131 - 27
xiaochengxu/pages/cardHolder/scancode.vue

@@ -4,9 +4,24 @@
 		 
 		 <!-- 扫描框 -->
 		 <view class="scanBox" >
-		     <camera :class="status==0?'scancode':'camera'" :mode="status==0?'scanCode':'normal'" @scancode="scancode" :flash='flashBtn'>
-		         <image v-if='status==0' class="coverImg" :src="iconScanBgGif"></image>
-		     </camera>
+			 <view class="scan-view">
+				<view class="scan-border">
+					<camera :class="status==0?'scan-camera':'camera'" @error="error" :mode="status==0?'scanCode':'normal'" @scancode="scancode" :flash='flashBtn'>
+					 <cover-view v-if='status==0'
+							   class="scan-animation"
+							   :animation="animation"
+							 ></cover-view>
+						   <!--  <cover-view class="scan-pict"
+							   ><cover-image
+								 class="pic"
+								 src="../../static/images/selectpic.png"
+							   ></cover-image>
+							 </cover-view> -->
+
+					</camera>
+				</view>
+			</view>
+		     
 			  
 		     <view class="scanTip">{{status==1?'请':'请扫描二维码'}}</view>
 		     <!-- 关闭扫码页面 -->
@@ -19,8 +34,6 @@
 				 </view>
 				
 			 </view>
-		     
-
 		 </view>
 	</view>
 </template>
@@ -28,22 +41,28 @@
 <script>
 // import { iconScanBgGif,scancodeOpen,scancodeClose } from "../../../utils/imgUrl/index";
 // const permisson = require("../../../utils/tools/permisson"); // 权限校验封装
+import uploadImage from '@/components/ossutil/uploadFile.js';
 const userCameraName = "scope.camera"; // 摄像头权限
 const userCameraZhName = "手机摄像头"; // 摄像头权限对应的中文名称
+let animation = uni.createAnimation({});
 export default {
   data() {
     return {
-		iconScanBgGif:'/static/imgs/code.gif',
+		// iconScanBgGif:'/static/imgs/code1.gif',
 		// iconScanBgGif,scancodeOpen,scancodeClose,
 		canScan: false, // 是否显示自定义扫码界面
         flashBtn: 'off', // off关闭   on  打开手电筒
         scanResult: '', // 扫描结果
 		isShow:false,
-		status:0,
+		status:uni.getStorageSync('scancodeStatus')?uni.getStorageSync('scancodeStatus'):0,
 		flag:false,
-		src:''
+		src:'',
+		animation,
     };
   },
+  onShow() {
+  	this.donghua()
+  },
   mounted() {
 	  var that = this
   	    //需要获得现在的授权信息
@@ -76,7 +95,7 @@ export default {
   													icon: 'none',
   													success: function(){
   													// 刷新
-  														uni.navigateTo({
+  														uni.redirectTo({
   															url: '/pages/cardHolder/scancode',
   														});
   													}
@@ -96,15 +115,61 @@ export default {
   		})
   	},
 	methods: {
+		donghua() {
+		    let that = this;
+		    let scode = true;
+		    setInterval(
+		        function () {
+		          if (scode) {
+		            animation.translateY(240).step({
+		              duration: 1500,
+		            });
+		            scode = !scode;
+		          } else {
+		            animation.translateY(-10).step({
+		              duration: 1500,
+		            });
+		            scode = !scode;
+		          }
+		          that.animation = animation.export();
+		        }.bind(this),
+		        1500
+		    );
+		},
 		takePhoto() {
+			console.log(1111111)
+			uni.showLoading({
+				title: '数据加载中',
+				mask:true
+			})
 	        const ctx = uni.createCameraContext();
+			console.log(ctx)
 	        ctx.takePhoto({
 	            quality: 'high',
+				fail: (req) => {
+					console.log(req,22222)
+					uni.hideLoading()
+	            },
 	            success: (res) => {
 	                this.src = res.tempImagePath
-	            }
+					console.log(res.tempImagePath,33333333)
+					this.uploadFilePromise(res.tempImagePath)
+	            },
+				
 	        });
 		},
+		uploadFilePromise(url) {
+			console.log(url)
+			uploadImage(url, 'cardImages/',
+				result => {
+					console.log(result, 22222)
+					
+				}
+			)
+		},
+		error(e) {
+		    console.log(e.detail);
+		},
        // 显示扫码界面(扫一扫)
        scanShowClick(){
 		   console.log('扫码',111111)
@@ -130,6 +195,10 @@ export default {
        // 隐藏扫码界面
        scanClick(status){
           this.status=status
+		  uni.setStorageSync('scancodeStatus', this.status);
+		  uni.redirectTo({
+		  	url: '/pages/cardHolder/scancode',
+		  });
        },
        // 扫一扫返回数据
        scancode(e) {
@@ -178,12 +247,7 @@ export default {
     background-color: #000000;
 }
 
-.scancode {
-    position: relative;
-    width: 70vw;
-    height: 70vw;
-    margin: 20vh auto 0;
-}
+
 .camera {
     position: relative;
     width: 100vw;
@@ -205,17 +269,7 @@ export default {
     color: #fff;
 }
 
-/* 开关手电筒 */
-.scancodePic{
-    background: transparent !important;
-    width: 100rpx;
-    height: 100rpx;
-    padding: 0 !important;
-}
-.scancodePic>image{
-    width: 100%;
-    height: 100%;
-}
+
 /* 关闭按钮 */
 .scan,.scan-left{
     padding: 20rpx 30rpx;
@@ -236,4 +290,54 @@ export default {
 .center-btn{
 	background:#fff;
 }
+
+// .scan-border {
+//   width: 100%;
+//   height: 100%;
+//   /* border: 6rpx solid #08FDFE; */
+//   display: flex;
+//   flex-direction: column;
+//   align-items: center;
+ 
+
+  .scan-camera {
+      position: relative;
+      width: 70vw;
+      height: 70vw;
+      margin: 20vh auto 0;
+	  border-radius: 6rpx;
+  }
+// }
+ 
+.scan-animation {
+  position: absolute;
+  top: 10%;
+  left:5%;
+  width: 480rpx;
+  height: 8rpx;
+  background-color: #0091ff;
+  border-radius: 50%;
+}
+.btns {
+  margin: 10rpx;
+  width: 100%;
+  background-color: #0091ff;
+}
+.scan-pict {
+  position: absolute;
+  right: 1%;
+  bottom: 1%;
+  width: 70rpx;
+  height: 70rpx;
+  z-index: 20;
+  border-radius: 50%;
+  background-color: #c0c0c0;
+  opacity: 0.8;
+  .pic {
+    z-index: 999;
+    width: 50rpx;
+    height: 50rpx;
+    margin: 10rpx;
+  }
+}
 </style>

+ 0 - 1
xiaochengxu/pages/cardHolder/search.vue

@@ -23,7 +23,6 @@
 			onClickDelAll() {
 			},
 			onSearchName(e) {
-				
 				uni.setStorageSync('search_val', e);
 				uni.switchTab({
 					url:"/pages/cardHolder/cardHolder"

+ 56 - 8
xiaochengxu/pages/circle/createCirclce.vue

@@ -7,21 +7,33 @@
 			<u--input placeholder="请输入圈子名称" border="none" v-model="formData.circleName" @change="change"
 				:customStyle="custom"></u--input>
 		</view>
+		<view class="flex justify-space-between select-card">
+			<view class="title">
+				选择名片
+			</view>
+			<view style="font-size:12px;" class='flex align-item-center' @click="cardShow">
+			{{formData.cardBusiness?formData.cardBusiness:'无名片'}}
+			<u-icon v-if='!formData.cardBusiness' name="arrow-right" size="12"></u-icon>
+			</view>
+		</view>
 		<view class="row1">
 			
 			<view class="flex flex-between" style="margin-top: 20rpx;">
 				<view class="title">圈子标签</view>
 				<uni-icons type="plus-filled" @click="add(item)" size="40" color="#112253"></uni-icons>
 			</view>
+			
 			<view class="">
 				<view v-for="(item,index) in labelList":key="index">
-					<view class="flex">
-						<u-input placeholder="请输入圈子标签,2-4个字" border="none" v-model="item.labelName" @change="change"
+					<view>
+						<view class="flex">
+							<u-input placeholder="请输入圈子标签,2-4个字" border="none" v-model="item.labelName" @change="change"
 							:customStyle="custom">
 							<template slot="suffix">
 								<image src="../../static/imgs/mySet/del.png" mode="widthFix" style="width: 40rpx;" @click="subtract(index)"></image>
 							</template>
 							</u-input>
+						</view>
 						<!-- <uni-icons type="minus-filled" @click="subtract(index)" size="40"></uni-icons> -->
 					</view>
 				</view>
@@ -30,6 +42,8 @@
 		<view class="">
 			<button type="default" @click="submit" class="submit">提交</button>
 		</view>
+		<u-picker keyName="cardBusiness" title="选择名片" @close="show=false"
+			@cancel="show=false" closeOnClickOverlay @confirm="cardConfirm" :show="show" :columns="cardList"></u-picker>
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -46,19 +60,22 @@
 					"padding":"20rpx"
 				},
 				value: '',
+				show:false,
+				cardList:[],
+				
 				labelList: [{
-						labelName: ''
+						labelName: '',
 					},
 					{
-						labelName: ''
+						labelName: '',
 					}
 				],
 				formData: {
 					circleName: '',
 					circleLabel: [],
-					commonId: ''
-
-				}
+					commonId: '',
+				},
+				currectData:{}
 			};
 		},
 		onLoad() {
@@ -66,7 +83,34 @@
 			this.userInfo = uni.getStorageSync("userInfo")
 			this.formData.commonId = this.userInfo.id
 		},
+		onShow() {
+			uni.showLoading({
+				title: '数据加载中'
+			})
+			this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
+				commonId: uni.getStorageSync("userInfo").id
+			}, failres => {
+				this.$refs.uToast.show({
+					type: 'error',
+					message: failres.errmsg,
+				})
+				uni.hideLoading()
+			}).then(res => {
+				uni.hideLoading()
+				this.cardList = [res.data.items]
+			})
+		},
 		methods: {
+			cardConfirm(e){
+				console.log(e)
+				this.formData.cardBusiness=e.value[0].cardBusiness
+				this.formData.cardId=e.value[0].id
+				this.show=false
+				console.log(this.labelList)
+			},
+			cardShow(){
+				this.show=true
+			},
 			change(e) {
 				console.log('change', e);
 			},
@@ -125,7 +169,7 @@
 					return
 				}
 				this.labelList.push({
-					labelName: ''
+					labelName: '',
 				})
 			},
 			subtract(index) {
@@ -159,4 +203,8 @@
 		color: #fff;
 		width: calc(100% - 40rpx);
 	}
+	.select-card{
+		background:#fff;padding:20rpx 0;
+		margin:10rpx 0;
+	}
 </style>