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

Merge branch 'master' of http://git.zthymaoyi.com/wangchao/businessCard

高敬炎 2 лет назад
Родитель
Сommit
15bbf2778a

+ 9 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardExchangeInfoServiceImpl.java

@@ -20,6 +20,7 @@ import com.iotechn.unimall.data.util.ExcelUtil;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.iotechn.unimall.core.exception.ServiceException;
@@ -84,6 +85,14 @@ public class CardExchangeInfoServiceImpl implements ICardExchangeInfoService {
         wrapper.eq("delete_flag", 0);
         Integer count = cardExchangeInfoMapper.getCardExchangeCount(status,(page - 1) * limit, limit, receiveId);
         List<CardExchangeInfo> list = cardExchangeInfoMapper.getCardExchangeInfoPage(status,(page - 1) * limit, limit, receiveId);
+        if (!CollectionUtils.isEmpty(list)){
+            for (CardExchangeInfo cardExchangeInfo:list){
+                CardManagementInfo cardManagementInfo = cardManagementInfoMapper.selectById(cardExchangeInfo.getSendCardId());
+                if (cardManagementInfo != null) {
+                    cardExchangeInfo.setCardManagementInfo(cardManagementInfo);
+                }
+            }
+        }
         return new Page<CardExchangeInfo>(list, page, limit, count);
     }
 

+ 1 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleManagementInfoServiceImpl.java

@@ -53,7 +53,7 @@ public class CircleManagementInfoServiceImpl implements ICircleManagementInfoSer
     public Page<CircleManagementInfo> list(Long commonId, String circleName, String circleLabel, Long status, Date gmtCreate, Date gmtUpdate, Long deleteFlag, Integer page, Integer limit) throws ServiceException {
         Wrapper<CircleManagementInfo> wrapper = new EntityWrapper<CircleManagementInfo>();
         if (!StringUtils.isEmpty(circleName)) {
-            wrapper.eq("circle_name", circleName);
+            wrapper.like("circle_name", circleName);
         }
         if (!StringUtils.isEmpty(circleLabel)) {
             wrapper.eq("circle_label", circleLabel);

+ 2 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardExchangeInfo.java

@@ -77,6 +77,8 @@ public class CardExchangeInfo extends SuperDO {
      */
     @TableField(exist = false)
     private String updateFlag;
+    @TableField(exist = false)
+    private CardManagementInfo cardManagementInfo;
 
     @Override
     public String toString() {

+ 225 - 0
xiaochengxu/README.md

@@ -0,0 +1,225 @@
+## 上传图片
+
+  ```
+  <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
+import uploadImage from '@/components/ossutil/uploadFile.js';
+// 删除图片
+			deletePic(event) {
+				this[`fileList${event.name}`].splice(event.index, 1)
+			},
+			// 新增图片
+			async afterRead(event) {
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url)
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+				}
+			},
+			uploadFilePromise(res) {
+				return new Promise((resolve, reject) => {
+					uploadImage(res, 'cardImages/',
+						result => {
+							that.cardInfo.headSculpture = result
+							resolve(res)
+						}
+					)
+				})
+			}
+  ```
+
+## 上拉加载、下拉刷新
+
+```
+<mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback"></mescroll-body>
+import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+export default {
+		mixins: [MescrollMixin],
+}
+
+data(){
+	return {
+		canReset:false
+	}
+}
+methods:{
+	mescrollInit(mescroll) {
+		this.mescroll = mescroll;
+	},
+	downCallback() {
+		this.mescroll.resetUpScroll()
+	},
+	upCallback(page) {
+		uni.showLoading({
+			title: '数据加载中'
+		})
+		this.$request.baseRequest('admin.unimall.circleManagementInfo', 'list', {
+			commonId: this.userInfo.id,
+			pageNum: page.num,
+			pageSize: page.size,
+		}, failres => {
+			console.log('res+++++', failres.errmsg)
+			this.$refs.uToast.show({
+				type: 'error',
+				message: failres.errmsg,
+			})
+			uni.hideLoading()
+		}).then(res => {
+			uni.hideLoading()
+			let curPageData = res.data.items;
+			let totalPage = res.data.total;
+			let curPageLen = curPageData.length;
+			this.mescroll.endByPage(curPageLen, totalPage);
+			console.log(res.data)
+			if (page.num == 1) this.circleList = []; //如果是第一页需手动置空列表
+			this.circleList = this.circleList.concat(curPageData); //追加新数据
+	},
+}
+
+onShow(){
+	this.$nextTick(function() {
+		this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
+		this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题  
+		this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
+	});
+}
+
+重置列表数据 this.mescroll.resetUpScroll()
+```
+
+## 工具类
+
+```
+1、时间戳格式化
+parseTime(gmtCreate)
+2、地址拆分省市区详细地址
+let _address = this.$helper.formatLocation("辽宁省营口市鲅鱼圈区日月大道8号")
+
+```
+
+## U-view 常用
+
+```
+1、toast提示
+<u-toast ref="uToast"></u-toast>
+this.$refs.uToast.show({
+	type: 'error/success',
+	message: "message",
+	complete() {
+	params.url && uni.navigateTo({
+		url: params.url
+	})
+}
+})
+
+2、Modal 模态框
+<template>
+	<view >
+		<u-modal :show="show" :title="title" :content='content' closeOnClickOverlay @confirm="confirm" @cancel="show==false" @close="show==false"></u-modal>
+		<u-button @click="show = true">打开</u-button>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			show:false,
+			title:'标题',
+			content:'uView的目标是成为uni-app生态最优秀的UI框架'
+		};
+	}
+};
+</script>
+
+```
+
+## 同步请求
+
+```
+async upCallback(page) {
+	await this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
+		commonId: this.userInfo.id
+	}, failres => {
+		console.log('res+++++', failres.errmsg)
+		this.$refs.uToast.show({
+			type: 'error',
+			message: failres.errmsg,
+		})
+	}).then(res => {
+		this.cardList = [res.data.items]
+	})
+
+	await this.$request.baseRequest('admin.unimall.circleManagementInfo', 'get', {
+		commonId: this.userInfo.id,
+		id: this.id
+	}, failres => {
+		console.log('res+++++', failres.errmsg)
+		this.$refs.uToast.show({
+			type: 'error',
+			message: failres.errmsg,
+		})
+		uni.hideLoading()
+	}).then(res => {
+		console.log(res.data)
+		this.dataObj = res.data
+
+	})
+	this.getCardList(page)
+},
+```
+
+## 公共样式
+```
+static/styles/index.scss
+
+.flex{
+	display: flex;
+	align-items: center;
+}
+.flex-row-center{
+	display: flex;
+	justify-content: center;
+}
+.flex-all-center{
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+.flex-between{
+	display: flex;
+	justify-content: space-between;
+}
+.flex-evenly{
+	display: flex;
+	justify-content: space-evenly;
+}
+
+.relative{
+	position: relative;
+}
+.absolute{
+	position: absolute;
+}
+
+
+```
+
+## 阻止冒泡
+```
+@click.native.stop="delSearchVal"
+```

+ 1 - 1
xiaochengxu/config/index.js

@@ -1,6 +1,6 @@
 const dev = {
 	// baseUrlNew: 'http://192.168.110.72:8182',
-	baseUrlNew: 'http://192.168.110.138:8182',
+	baseUrlNew: 'http://192.168.110.82:8182',
 	// baseUrlNew: 'https://shiyaopinche.cspc.cn:10443',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false

+ 3 - 1
xiaochengxu/main.js

@@ -8,11 +8,13 @@ import request from '@/util/request.js'
 import helper from '@/common/helper.js'
 import WXBizDataCrypt from '@/util/WXBizDataCrypt.js'
 import uView from '@/uni_modules/uview-ui'
+import store from './store'
 Vue.use(uView)
+import {parseTime} from '@/util/util'
 Vue.prototype.$request = request
 Vue.prototype.$helper = helper
-import store from './store'
 Vue.prototype.$store = store
+Vue.prototype.parseTime = parseTime
 App.mpType = 'app'
 
 const app = new Vue({

+ 64 - 35
xiaochengxu/pages/circle/changeCard.vue

@@ -5,45 +5,51 @@
 			<span>黑名单</span>
 		</view>
 		<view class="content2 ">
-			<view class="flex">
-				<view class="left">
-					<view class="top flex-row-center">
-						<image src="../../static/uni.png" mode="widthFix" class="img"></image>
+			<view class="row" v-for="(item,index) in cardList" :key="index">
+				<view class="flex">
+					<view class="left">
+						<view class="top flex-row-center">
+							<image :src="item.cardManagementInfo.headSculpture" mode="widthFix" class="img"></image>
+						</view>
 					</view>
-				</view>
-				<view class="right">
-					<view class="row1 flex">
-						<text>张三</text>
-						<text class="line"></text>
-						<text>总经理</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>
-					</view>
-					<view class="row3">
-						<uni-icons type="redo" size="20"></uni-icons>
-						<text>我是备注</text>
+					<view class="right">
+						<view class="row1 flex">
+							<text>{{item.cardManagementInfo.name}}</text>
+							<text class="line"></text>
+							<text>{{item.cardManagementInfo.post}}</text>
+						</view>
+						<view class="row2">
+							{{item.cardManagementInfo.companyName}}
+						</view>
+						<view class="row3" @click="toMap">
+							<uni-icons type="redo" size="20"></uni-icons>
+							<text>{{item.cardManagementInfo.detailedAddress}}</text>
+						</view>
+						<view class="row3">
+							<uni-icons type="redo" size="20"></uni-icons>
+							<text>{{item.cardManagementInfo.phone}}</text>
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="">
-				<span> 拉黑</span>
-				<span>拒绝</span>
-				<span>接受</span>
-			</view>
-			<view class="flex flex-between">
-				<span>来至 圈子名</span>
-				<span> 2024-01-01</span>
+				<view class="" v-if="item.status==0">
+					<span @click='cardExchangeInfoEdit(1,item)'> 拉黑</span>
+					<span @click='cardExchangeInfoEdit(2,item)'>拒绝</span>
+					<span @click='cardExchangeInfoEdit(3,item)'>接受</span>
+					<span @click='cardExchangeInfoEdit(4,item)'>移除</span>
+				</view>
+				<view class="" v-else>
+					<span v-if="item.status==1">已接受</span>
+					<span v-if="item.status==3">已拒绝</span>
+					<span v-if="item.status==5">已过期</span>
+					<span v-if="item.status==7">已拉黑</span>
+				</view>
+				<view class="flex flex-between">
+					<span>来至 {{item.circleName}}</span>
+					<span> {{parseTime(item.gmtCreate)}}</span>
+				</view>
 			</view>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -52,7 +58,8 @@
 		data() {
 			return {
 				userInfo:{},
-				status:1
+				status:1,
+				cardList:[],
 			};
 		},
 		onLoad() {
@@ -79,6 +86,28 @@
 					this.cardList = res.data.items
 				})
 			},
+			cardExchangeInfoEdit(type,val){
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'update', {
+					cardExchangeInfo:JSON.stringify(val),
+					updateFlag:type
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					uni.hideLoading()
+					this.$refs.uToast.show({
+						type: 'success',
+						message: "操作成功!",
+					})
+				})
+			}
 		}
 	}
 </script>

+ 20 - 8
xiaochengxu/pages/circle/circle.vue

@@ -1,10 +1,11 @@
 <template>
 	<view class="content">
 		<view class="content1 flex">
-			<view class="search flex flex-between" @click="search">
-				<view class="left flex">
+			<view class="search flex flex-between">
+				<view class="left flex" @click="search">
 					<uni-icons type="search" size="24"></uni-icons>
-					<text class="search-val"> {{searchVal?searchVal:'搜索名片'}}</text>
+					<text class="search-val"> {{searchVal?searchVal:'搜索圈子'}}</text>
+					<uni-icons type="closeempty" size="24" @click.native.stop="delSearchVal"></uni-icons>
 				</view>
 				<view class="right">
 					<uni-icons type="mic" size="24" @click.stop="micOpen"></uni-icons>
@@ -68,8 +69,11 @@
 				canReset:false,
 			};
 		},
+		onLoad(options) {
+			this.searchVal = options.val
+		},
 		onShow() {
-			this.searchVal = uni.getStorageSync("cirlce_search_val") ? uni.getStorageSync("cirlce_search_val") : ''
+			// this.searchVal = uni.getStorageSync("cirlce_search_val") ? uni.getStorageSync("cirlce_search_val") : ''
 			this.userInfo = uni.getStorageSync("userInfo")
 			this.$nextTick(function() {
 				this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
@@ -78,6 +82,10 @@
 			});
 		},
 		methods: {
+			delSearchVal(){
+				this.searchVal = ""
+				this.mescroll.resetUpScroll() 
+			},
 			toChangeCard(){
 				uni.navigateTo({
 					url: "/pages/circle/changeCard"
@@ -105,11 +113,15 @@
 				uni.showLoading({
 					title: '数据加载中'
 				})
-				this.$request.baseRequest('admin.unimall.circleManagementInfo', 'list', {
+				let _data = {
 					commonId: this.userInfo.id,
-					pageNum: page.num,
-					pageSize: page.size,
-				}, failres => {
+					page: page.num,
+					limit: page.size,
+				}
+				if(this.searchVal){
+					_data.circleName = this.searchVal
+				}
+				this.$request.baseRequest('admin.unimall.circleManagementInfo', 'list', _data, failres => {
 					console.log('res+++++', failres.errmsg)
 					this.$refs.uToast.show({
 						type: 'error',

+ 2 - 3
xiaochengxu/pages/circle/detail.vue

@@ -115,7 +115,6 @@
 		},
 		methods: {
 			confirmChangeSubmit() {
-				debugger
 				this.$request.baseRequest('admin.unimall.cardExchangeInfo', 'add', {
 					cardExchangeInfo: JSON.stringify({
 						sendId: this.userInfo.id,
@@ -252,8 +251,8 @@
 					commonId: this.userInfo.id,
 					id: this.dataObj.id,
 					status: this.cardStatus,
-					pageNum: page.num,
-					pageSize: page.size,
+					page: page.num,
+					limit: page.size,
 				}, failres => {
 					console.log('res+++++', failres.errmsg)
 					this.$refs.uToast.show({

+ 9 - 5
xiaochengxu/pages/circle/search.vue

@@ -20,14 +20,18 @@
 			};
 		},
 		methods: {
-			onClickDelAll() {
+			onClickDelAll(val) {
+				console.log(val)
 			},
 			onSearchName(e) {
-				uni.setStorageSync('cirlce_search_val', e);
-				uni.switchTab({
-					url:"/pages/circle/circle"
-					
+				// uni.setStorageSync('cirlce_search_val', e);
+				uni.redirectTo({
+					url:`/pages/circle/circle?val=${e}`
 				})
+				// uni.switchTab({
+				// 	url:"/pages/circle/circle?val="+e
+					
+				// })
 			}
 		}
 	}

+ 0 - 97
xiaochengxu/pages/index/index.vue

@@ -1,97 +0,0 @@
-<template>
-	<view class="container">
-
-		<view class="intro">本项目已包含uni ui组件,无需import和注册,可直接使用。在代码区键入字母u,即可通过代码助手列出所有可用组件。光标置于组件名称处按F1,即可查看组件文档。</view>
-		<text class="intro">详见:</text>
-		<uni-link :href="href" :text="href"></uni-link>
-		<!-- <mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
-			<view class="content3" v-for="(item,index) in infoList">
-
-			</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";
-	import {
-		mapState,
-		mapMutations
-	} from 'vuex';
-	export default {
-		mixins: [MescrollMixin], // 使用mixin
-		computed: {
-			...mapState(['hasLogin'])
-		},
-		data() {
-			return {
-				href: 'https://uniapp.dcloud.io/component/README?id=uniui',
-				canReset: false,
-				userInfo: {},
-				infoList: []
-			}
-		},
-		onShow() {
-			// this.$refs.uToast.show({
-			// 	type: 'success',
-			// 	message: '提交成功!',
-			// })
-			// this.$nextTick(function() {
-			// 	this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
-			// 	this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题  
-			// 	this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
-			// });
-			// if (this.hasLogin || uni.getStorageSync("userInfo").username) {
-			// 	this.userInfo = uni.getStorageSync("userInfo")
-			// 	this.isLogin = true
-			// } else {
-			// 	uni.navigateTo({
-			// 		url: "/pages/login/login"
-			// 	})
-			// }
-		},
-		methods: {
-			upCallback(page) {
-				uni.showLoading({
-					title: '数据加载中'
-				})
-				this.$request.baseRequest('pincheCarSharingApp', 'list', {
-					remark2: this.route,
-					carpoolingType: this.type,
-					companyId: 1,
-					pageNum: page.num,
-					pageSize: page.size,
-				}, failres => {
-					console.log('res+++++', failres.errmsg)
-					this.$refs.uToast.show({
-						type: 'error',
-						message: failres.errmsg,
-					})
-					uni.hideLoading()
-				}).then(res => {
-					// if (res.errno == 200) {
-					uni.hideLoading()
-					console.log(11)
-					let curPageData = res.data.items;
-					let totalPage = res.data.total;
-					let curPageLen = curPageData.length;
-					this.mescroll.endByPage(curPageLen, totalPage);
-					console.log(res.data)
-					// this.makeData(res.data)
-					if (page.num == 1) this.infoList = []; //如果是第一页需手动置空列表
-					this.infoList = this.infoList.concat(curPageData); //追加新数据
-					// }
-				})
-			},
-		}
-	}
-</script>
-
-<style>
-	.container {
-		padding: 20px;
-		font-size: 14px;
-		line-height: 24px;
-	}
-</style>

+ 6 - 3
xiaochengxu/uni_modules/d-search-log/components/d-search-log/d-search-log.vue

@@ -3,10 +3,12 @@
 		
 		<view class="dSLComVueTop">
 			<view class="dSLComVueTopLeft">
-				<image src="/static/icon_img/search.png" class="dSLComVueTopLeftImg" style="width: 30rpx;height: 30rpx;flex: none;"></image>
+				<u-icon name="search" size="30"></u-icon>
+				<!-- <image src="/static/icon_img/search.png" class="dSLComVueTopLeftImg" style="width: 30rpx;height: 30rpx;flex: none;"></image> -->
 				<input  class="dSLComVueTopLeftInput" v-model="search_input" type="text" :placeholder="placeholder" @blur="onClickInput" />
 				<view class="dSLComVueTopLeftDel" v-if="search_input" @click="onClickDel">
-					<image src="/static/icon_img/del.png" class="dSLComVueTopLeftDelImg" style="width: 35rpx;height: 35rpx;flex: none;" ></image>
+					<u-icon name="close" size="20"></u-icon>
+					<!-- <image src="/static/icon_img/del.png" class="dSLComVueTopLeftDelImg" style="width: 35rpx;height: 35rpx;flex: none;" ></image> -->
 				</view>
 			</view>
 			<view class="dSLComVueTopRight">
@@ -18,7 +20,8 @@
 			<view class="dSLComVueTitle" >
 				<text>搜索历史</text>
 				<view style="width: 100rpx;height: 60rpx;display: flex;align-items: center;" @click="onClickDelAll">
-					<image src="./static/icon_img/del2.png" style="width: 40rpx;height: 40rpx;margin-right: 35rpx;"></image>
+					<u-icon name="trash-fill" size="30"></u-icon>
+					<!-- <image src="./static/icon_img/del2.png" style="width: 40rpx;height: 40rpx;margin-right: 35rpx;"></image> -->
 				</view>
 			</view>