achao 2 anni fa
parent
commit
2037599351

+ 27 - 1
xiaochengxu/pages/circle/changeCard.vue

@@ -51,8 +51,34 @@
 	export default {
 		data() {
 			return {
-				
+				userInfo:{},
+				status:1
 			};
+		},
+		onLoad() {
+			this.userInfo = uni.getStorageSync("userInfo")
+			this.getList()
+		},
+		methods:{
+			getList(){
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'list', {
+					receiveId:this.userInfo.id,
+					status:this.status
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					uni.hideLoading()
+					this.cardList = res.data.items
+				})
+			},
 		}
 	}
 </script>

+ 6 - 1
xiaochengxu/pages/circle/circle.vue

@@ -11,7 +11,7 @@
 				</view>
 			</view>
 			<view class="right flex relative">
-				<uni-icons type="personadd-filled" size="30"></uni-icons>
+				<uni-icons type="personadd-filled" size="30" @click="toChangeCard"></uni-icons>
 				<u-badge :isDot="true" type="error" class="point"></u-badge>
 			</view>
 		</view>
@@ -78,6 +78,11 @@
 			});
 		},
 		methods: {
+			toChangeCard(){
+				uni.navigateTo({
+					url: "/pages/circle/changeCard"
+				})
+			},
 			toCreateCircle() {
 				uni.navigateTo({
 					url: "/pages/circle/createCirclce"

+ 57 - 24
xiaochengxu/pages/circle/detail.vue

@@ -36,36 +36,29 @@
 			</view>
 		</view>
 		<mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
-			<view class="content3 flex">
+			<view class="content3 flex" v-for="(item,index) in changeCardList" :key="index">
 				<view class="left">
 					<view class="top flex-row-center">
 						<image src="../../static/uni.png" mode="widthFix" class="img"></image>
 					</view>
 					<view class="bottom flex flex-evenly">
-						<uni-icons type="home" size="20"></uni-icons>
-						<uni-icons type="redo" size="20" @click="changeCard"></uni-icons>
+						<uni-icons type="home" size="20" v-if="item.lookPage==1"></uni-icons>
+						<uni-icons type="redo" size="20" @click="changeCard(item)"
+							v-if="item.notDisplay!=1"></uni-icons>
 					</view>
 				</view>
 				<view class="right">
 					<view class="row1 flex">
-						<text>张三</text>
+						<text>{{item.name}}</text>
 						<text class="line"></text>
-						<text>总经理</text>
+						<text>{{item.post}}</text>
 					</view>
 					<view class="row2">
-						北京xxx有限公司
-					</view>
-					<view class="row3" @click="toMap">
-						<uni-icons type="redo" size="20"></uni-icons>
-						<text>北京市朝阳区幸福大街8号</text>
-					</view>
-					<view class="row3">
-						<uni-icons type="redo" size="20"></uni-icons>
-						<text>13333333333</text>
+						{{item.companyName}}
 					</view>
 					<view class="row3">
 						<uni-icons type="redo" size="20"></uni-icons>
-						<text>我是备注</text>
+						<text>{{item.scopeOfBusiness}}</text>
 					</view>
 				</view>
 			</view>
@@ -74,6 +67,9 @@
 		<u-toast ref="uToast"></u-toast>
 		<u-modal :show="show" :content='content' @confirm="$u.debounce(joinCircle, 500)" showCancelButton
 			@cancel="show=false" @close="show=false" closeOnClickOverlay></u-modal>
+		<u-modal :show="isShowChangeCard" content='确定交换名片?' @confirm="$u.debounce(confirmChangeSubmit, 500)"
+			showCancelButton @cancel="isShowChangeCard=false" @close="isShowChangeCard=false"
+			closeOnClickOverlay></u-modal>
 	</view>
 </template>
 
@@ -83,6 +79,7 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				isShowChangeCard: false,
 				dataObj: {
 					circleName: '',
 					cardNum: '',
@@ -98,7 +95,10 @@
 				id: '',
 				changeCardList: [],
 				cardStatus: '',
-				isMyCard: false
+				isMyCard: false,
+				swapNameCards: false,
+				selectMycard: {},
+				selectRowCard: {}
 			};
 		},
 		onShow() {
@@ -114,6 +114,36 @@
 			this.id = options.val
 		},
 		methods: {
+			confirmChangeSubmit() {
+				debugger
+				this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'add', {
+					cardExchangeInfo: JSON.stringify({
+						sendId: this.userInfo.id,
+						receiveId: this.selectRowCard.receiveId,
+						sendCardId: this.selectMycard.id,
+						receiveCardId: this.selectRowCard.id,
+						circleName: this.dataObj.circleName
+					}),
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.isShowChangeCard = false
+					this.$refs.uToast.show({
+						type: 'success',
+						message: "操作成功!"
+					})
+					setTimeout(()=>{
+						this.mescroll.resetUpScroll()
+					},500)
+					this.mescroll.resetUpScroll()
+
+				})
+			},
 			changeMyCard() {
 				this.$request.baseRequest('admin.unimall.circleCardInfo', 'update', {
 					circleCardInfo: JSON.stringify({
@@ -169,12 +199,14 @@
 				this.cardId = e.value[0].id
 				if (this.isMyCard) {
 					this.changeMyCard()
-				} else {
+				} else if (this.swapNameCards) {
+					this.selectMycard = e.value[0]
+					this.isShowCard = false
+					this.isShowChangeCard = true
 
+				} else {
 					this.joinCircle()
 				}
-
-
 			},
 			joinCircle() {
 				this.$request.baseRequest('admin.unimall.circleCardInfo', 'add', {
@@ -255,7 +287,7 @@
 				}).then(res => {
 					this.cardList = [res.data.items]
 				})
-				
+
 				await this.$request.baseRequest('admin.unimall.circleManagementInfo', 'get', {
 					commonId: this.userInfo.id,
 					id: this.id
@@ -273,10 +305,11 @@
 				})
 				this.getCardList(page)
 			},
-			changeCard() {
-				uni.navigateTo({
-					url: "/pages/circle/changeCard"
-				})
+			changeCard(val) {
+				this.selectRowCard = val
+				this.swapNameCards = true
+				this.isShowCard = true
+
 			},
 		}
 	}