Procházet zdrojové kódy

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

# Conflicts:
#	xiaochengxu/pages/cardHolder/cardHolder.vue
#	xiaochengxu/pages/mySet/mySet.vue
achao před 2 roky
rodič
revize
65773beb36

+ 0 - 3
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardClassifyInfoService.java

@@ -41,9 +41,6 @@ public interface ICardClassifyInfoService{
 	@HttpMethod(description = "置顶",  permissionName = "名片分类管理")
 	public Boolean top(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
 
-	@HttpMethod(description = "置顶默认分类",  permissionName = "名片分类管理")
-	public Boolean topDefault(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
-
 	@HttpMethod(description = "修改",  permissionName = "名片分类管理")
 	public Boolean update(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
 

+ 4 - 19
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardClassifyInfoServiceImpl.java

@@ -98,32 +98,17 @@ public class CardClassifyInfoServiceImpl implements ICardClassifyInfoService {
         CardClassifyInfo cardClassifyInfo1 = cardClassifyInfoMapper.selectById(cardClassifyInfo.getId());
         List<CardClassifyInfo> cardClassifyInfoList = cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
                 .eq("common_id", cardClassifyInfo1.getCommonId())
+                .orderBy("top_marking", false)
                 .eq("delete_flag", 0));
+        Integer sort=0;
         if (!CollectionUtils.isEmpty(cardClassifyInfoList)) {
-            for (CardClassifyInfo aa : cardClassifyInfoList) {
-                aa.setTopMarking(0l);
-                cardClassifyInfoMapper.updateById(aa);
-            }
+            sort=cardClassifyInfoList.get(0).getTopMarking()+1;
         }
-        cardClassifyInfo1.setTopMarking(1l);
+        cardClassifyInfo1.setTopMarking(sort);
         cardClassifyInfo1.setGmtUpdate(new Date());
         return cardClassifyInfoMapper.updateById(cardClassifyInfo1) > 0;
     }
 
-    @Override
-    public Boolean topDefault(CardClassifyInfo cardClassifyInfo) throws ServiceException {
-        List<CardClassifyInfo> cardClassifyInfoList = cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
-                .eq("common_id", cardClassifyInfo.getCommonId())
-                .eq("delete_flag", 0));
-        if (!CollectionUtils.isEmpty(cardClassifyInfoList)) {
-            for (CardClassifyInfo aa : cardClassifyInfoList) {
-                aa.setTopMarking(0l);
-                cardClassifyInfoMapper.updateById(aa);
-            }
-        }
-        return true;
-    }
-
     @Override
     public Boolean update(CardClassifyInfo cardClassifyInfo) throws ServiceException {
         Date now = new Date();

+ 16 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/commonUser/CommonUserServiceImpl.java

@@ -13,10 +13,12 @@ import com.iotechn.unimall.core.notify.SMSResult;
 import com.iotechn.unimall.core.util.GeneratorUtil;
 import com.iotechn.unimall.core.util.SHA1Util;
 import com.iotechn.unimall.data.component.CacheComponent;
+import com.iotechn.unimall.data.domain.CardClassifyInfo;
 import com.iotechn.unimall.data.domain.UserDO;
 import com.iotechn.unimall.data.domain.CommonUserInfo;
 import com.iotechn.unimall.data.dto.UserDTO;
 import com.iotechn.unimall.data.enums.UserLoginType;
+import com.iotechn.unimall.data.mapper.CardClassifyInfoMapper;
 import com.iotechn.unimall.data.mapper.UserMapper;
 import com.iotechn.unimall.data.util.SessionUtil;
 import okhttp3.OkHttpClient;
@@ -53,6 +55,8 @@ public class CommonUserServiceImpl implements CommonUserService {
 
     @Autowired
     private CommonUserInfoMapper commonUserInfoMapper;
+    @Autowired
+    private CardClassifyInfoMapper cardClassifyInfoMapper;
 
 
     @Autowired
@@ -90,6 +94,18 @@ public class CommonUserServiceImpl implements CommonUserService {
                 commonUserInfoMapper.insert(newUserDO);
                 //更新数据库默认值
                 newUserDO = commonUserInfoMapper.selectById(newUserDO.getId());
+                List<CardClassifyInfo> cardClassifyInfoList = cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+                        .eq("common_id", newUserDO.getId())
+                        .eq("delete_flag", 0));
+                //新创建的用户添加默认分类
+                if (CollectionUtils.isEmpty(cardClassifyInfoList)) {
+                    CardClassifyInfo cardClassifyInfo=new CardClassifyInfo();
+                    cardClassifyInfo.setGmtCreate(now);
+                    cardClassifyInfo.setGmtUpdate(now);
+                    cardClassifyInfo.setCommonId(newUserDO.getId());
+                    cardClassifyInfo.setCircleName("默认分类");
+                    cardClassifyInfoMapper.insert(cardClassifyInfo);
+                }
             } else {
                 newUserDO = list.get(0);
             }

+ 3 - 3
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardClassifyInfo.java

@@ -38,10 +38,10 @@ public class CardClassifyInfo extends SuperDO {
     @TableField("circle_name")
     private String circleName;
 
-    /** 置顶标识 */
-    @Excel(name = "置顶标识")
+    /** 排序 */
+    @Excel(name = "排序")
     @TableField("top_marking")
-    private Long topMarking;
+    private Integer topMarking;
 
     /**  */
     @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")

+ 29 - 12
xiaochengxu/pages/cardHolder/cardHolder.vue

@@ -253,27 +253,26 @@
 			</view>
 
 		</view>
-		<u-popup :show="popupshow" mode="bottom">
+		<u-popup :show="popupshow" :closeOnClickOverlay='true' :overlayOpacity='0.4' @close='handleHiddenShare' :round="10" mode="bottom">
 			<view>
-				<view class="share-to">
+				<!-- <view class="share-to">
 					<text>分享到</text>
-				</view>
-				<view class="content">
+				</view> -->
+				<view class="share-content">
 
 					<view class="block" @click="toUrl()">
 						<button class="moment">
-							<text class="iconfont icon-weixin"></text>
-							<!-- <image src="/static/img/moment.png" mode="aspectFill"></image>					 -->
-							<text>扫码分享</text>
+							<image style='width:108rpx;height:108rpx;' src="@/static/imgs/scancode.png" mode="aspectFill"></image>					
+							<view>扫码分享</view>
 						</button>
 					</view>
 					<view class="block">
-						<button class="shareBtn" type="default" data-name="shareBtn" open-type="share"> 分享</button>
+						<button class="shareBtn" type="default" data-name="shareBtn" open-type="share"> 
+						<image style='width:108rpx;height:108rpx;' src="@/static/imgs/shade.png" mode="aspectFill"></image>	
+						<view>分享微信好友</view>
+						</button>
 					</view>
 				</view>
-				<view class="cancel" @click.stop="handleHiddenShare">
-					<text>取消</text>
-				</view>
 			</view>
 		</u-popup>
 		<!-- <image :src="poster" style="width: 750rpx;height: 1334rpx;"></image> -->
@@ -359,7 +358,7 @@
 				return {
 					title: '商通线上商城',
 					path: '/pages/tabBarPro/index/index',
-					imageUrl: imageUrl
+					imageUrl: this.popupshow?imageUrl:''
 				};
 			}
 		},
@@ -377,6 +376,7 @@
 				this.mescroll.resetUpScroll()
 			},
 			handleHiddenShare(){
+				console.log(11111)
 				this.popupshow=false
 			},
 			posterError(err) {
@@ -1234,6 +1234,7 @@
 		transform: translateY(-50%);
 		text-align: center;
 	}
+<<<<<<< HEAD
 	/deep/.u-checkbox-group{
 		position: absolute;
 		    right: 20px;
@@ -1249,4 +1250,20 @@
 		justify-content: space-between;
 		bottom:0
 	}
+=======
+	.share-content{
+		display:flex;
+		padding:20rpx;
+		justify-content: center;
+		button{
+			background:transparent;
+			line-height:1;
+		}
+		button:after{
+			border:none;
+		}
+		font-size:24rpx;
+	}
+	
+>>>>>>> 858f194d9e2502ce26fe6c538c3a79ce555c2ffe
 </style>

+ 402 - 32
xiaochengxu/pages/mySet/mySet.vue

@@ -8,63 +8,91 @@
 				</view>
 			</view>
 			<view class="position">
-				<image src="../../static/imgs/mySet/share.png" mode="widthFix" class="right-img"></image>
-				<image src="../../static/imgs/mySet/ewm.png" mode="widthFix" class="right-img"></image>
+				<image @click='selectCard' src="../../static/imgs/mySet/share.png" mode="widthFix" class="right-img">
+				</image>
+				<image @click='selectCard1' src="../../static/imgs/mySet/ewm.png" mode="widthFix" class="right-img">
+				</image>
 			</view>
 		</view>
 		<view class="content2">
-			<view class="row flex flex-between" v-for="(item,index) in menuList" :key='index' @click="menuClick(item.type)">
+			<view class="row flex flex-between" v-for="(item,index) in menuList" :key='index'
+				@click="menuClick(item.type)">
 				<view class="flex">
 					<image :src="item.src" mode="widthFix" class="nav-img"></image>
-					<button class="left-btn" v-if='item.type=="contactCustomer"' open-type='contact'>{{item.name}}</button>
+					<button class="left-btn" v-if='item.type=="contactCustomer"'
+						open-type='contact'>{{item.name}}</button>
 					<span class="left" v-else>{{item.name}}</span>
 				</view>
-				
-				<span class="right"><image src="../../static/imgs/mySet/yjt.png" mode="widthFix" class="row-right-img"></image></span>
+
+				<span class="right">
+					<image src="../../static/imgs/mySet/yjt.png" mode="widthFix" class="row-right-img"></image>
+				</span>
 			</view>
 		</view>
+		<u-popup :show="isShowCode" @close="isShowCode=false" mode="center" :round='10'>
+			<image :src="selectCode" mode="widthFix"></image>
+		</u-popup>
+		<u-picker keyName="cardBusiness" :confirmType='"share"' :confirmText='"分享"' title="选择名片" @cancel="show=false"
+			closeOnClickOverlay @change="cardChange" :show="show" :columns="cardList"></u-picker>
+		<u-picker keyName="cardBusiness" confirmText='确定' title="选择名片" @cancel="show1=false" closeOnClickOverlay
+			@confirm="cardConfirm" :show="show1" :columns="cardList"></u-picker>
+		<poster :data="canvasData" background-color="#FFF" :width='750' :height='420' @on-success="posterSuccess"
+			ref="poster" @on-error="posterError"></poster>
 	</view>
 </template>
 
 <script>
+	import Poster from '../../components/zhangyuhao-poster/Poster.vue'
 	export default {
+		components: {
+			Poster
+		},
 		data() {
 			return {
 				userInfo: {},
+				cardList: [],
+				canvasData: {},
+				currectData: {},
+				selectCode: '',
+				show: false,
+				clicknum: 0,
+				popupshow: false,
+				show1: false,
+				isShowCode: false,
 				menuList: [{
 						name: "我的名片",
 						type: 'myInfo',
-						src:'../../static/imgs/mySet/card.png'
+						src: '../../static/imgs/mySet/card.png'
 					},
 					{
 						name: "我的主页",
 						type: 'myHome',
-						src:'../../static/imgs/mySet/home.png'
+						src: '../../static/imgs/mySet/home.png'
 					},
 					{
 						name: "名片分类",
 						type: "cardType",
-						src:'../../static/imgs/mySet/type.png'
+						src: '../../static/imgs/mySet/type.png'
 					},
 					{
 						name: "我的证件",
 						type: "myCard",
-						src:'../../static/imgs/mySet/card1.png'
+						src: '../../static/imgs/mySet/card1.png'
 					},
 					{
 						name: "帮助说明",
 						type: "help",
-						src:'../../static/imgs/mySet/help.png'
+						src: '../../static/imgs/mySet/help.png'
 					},
 					{
 						name: "联系客服",
 						type: "contactCustomer",
-						src:'../../static/imgs/mySet/kf.png'
+						src: '../../static/imgs/mySet/kf.png'
 					},
 					{
 						name: "设置",
 						type: 'set',
-						src:'../../static/imgs/mySet/set.png'
+						src: '../../static/imgs/mySet/set.png'
 					},
 				]
 			};
@@ -72,18 +100,354 @@
 		onShow() {
 			this.userInfo = uni.getStorageSync("userInfo")
 			console.log(this.userInfo)
+			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 => {
+				this.cardList = [res.data.items]
+				this.cardChange({
+					value: this.cardList[[0]]
+				})
+			})
+		},
+		onShareAppMessage(res) {
+			this.popupshow = false
+			console.log(res, this.popupshow)
+			let that = this;
+			//生成名片图片
+			let imageUrl = this.poster
+			console.log("imageUrl", imageUrl)
+			if (res.from === 'button') {
+				let path = `/pages/mySet/lookCard?id=${that.currectData.id}`
+				return {
+					title: `${that.currectData.name}分享的名片~`,
+					path: path,
+					imageUrl: imageUrl,
+				};
+			}
+			if (res.from === 'menu') {
+				return {
+					title: '商通线上商城',
+					path: '/pages/tabBarPro/index/index',
+					imageUrl: this.popupshow ? imageUrl : ''
+				};
+			}
+		},
+		// 分享到朋友圈
+		onShareTimeline() {
+			return {
+				title: '商通线上商城',
+				path: '/pages/index/index',
+				imageUrl: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
+			};
 		},
 		methods: {
-			menuClick(typeName) {debugger
-				if(typeName=="contactCustomer") return
-				let _url = '/pages/mySet/' + typeName
-				console.log(_url)
-				uni.navigateTo({
-					url: _url
+			handleHiddenShare() {
+				this.popupshow = false
+			},
+			selectCard() {
+				this.show = true
+			},
+			selectCard1() {
+				this.show1 = true
+			},
+			cardConfirm(e) {
+				console.log(e)
+				this.currectData = e.value[0]
+				this.selectCode = e.value[0].qrCodeMyself
+				this.show1 = false
+				this.isShowCode = true
+			},
+			cardChange(e) {
+
+				this.currectData = e.value[0]
+				uni.showLoading({
+					title: '加载中',
+					mask: true
 				})
+				var data = [{
+						type: 'image',
+						path: this.currectData.currentBackground,
+						use: 'bg',
+						x: -10,
+						y: 0,
+						width: 530,
+						height: 325
+					},
+					{
+						type: 'image',
+						path: this.currectData.headSculpture,
+						shape: 'circle',
+						use: 'head',
+						x: 30,
+						y: 30,
+						width: 100,
+						height: 100
+					},
+					{
+						type: 'text',
+						text: this.currectData.name,
+						use: 'name',
+						x: 150,
+						y: 50,
+						size: 24,
+						color: '#000'
+
+					},
+					{
+						type: 'text',
+						text: this.currectData.post,
+						use: 'post',
+						x: 240,
+						y: 55,
+						size: 18,
+						color: '#666666'
+
+					},
+					{
+						type: 'text',
+						text: this.currectData.companyName,
+						use: 'companyName',
+						x: 150,
+						y: 95,
+						size: 18,
+						color: '#000'
+
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/address1.png',
+						use: 'address-icon',
+						x: 145,
+						y: 130,
+						width: 15,
+						height: 20
+					},
+					{
+						type: 'textarea',
+						text: this.currectData.province + this.currectData.city + this.currectData.area + this
+							.currectData.detailedAddress,
+						lineSpace: 1,
+						width: 320,
+						use: 'address',
+						x: 175,
+						y: 135,
+						size: 14,
+						color: '#000'
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/phone1.png',
+						use: 'phone-icon',
+						x: 145,
+						y: 163,
+						width: 16,
+						height: 16
+					},
+					{
+						type: 'text',
+						text: this.currectData.phone,
+						use: 'phone',
+						x: 175,
+						y: 167,
+						size: 14,
+						color: '#000'
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/remark1.png',
+						use: 'remark-icon',
+						x: 145,
+						y: 197,
+						width: 13,
+						height: 16
+					},
+					{
+						type: 'textarea',
+						text: this.currectData.remark ? this.currectData.remark : '单击添加备注',
+						use: 'remark',
+						lineSpace: 2,
+						width: 200,
+						x: 175,
+						y: 200,
+						size: 13,
+						color: '#000'
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/bg3.png',
+						use: 'bg1',
+						x: 0,
+						y: 243,
+						width: 370,
+						height: 67
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/bg4.png',
+						use: 'bg2',
+						x: 355,
+						y: 243,
+						width: 150,
+						height: 67
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/home.png',
+						use: 'home',
+						x: 65,
+						y: 260,
+						width: 33,
+						height: 33
+					},
+					{
+						type: 'text',
+						text: this.currectData.classifyName ? this.currectData.classifyName : '默',
+						use: 'classify',
+						x: 145,
+						y: 263,
+						size: 34,
+						color: '#fff'
+					},
+					{
+						type: 'image',
+						path: '../../static/imgs/card/share.png',
+						use: 'share',
+						x: 235,
+						y: 263,
+						width: 33,
+						height: 28
+					},
+				]
+				console.log(this.currectData.cuttentTemplate, 111111)
+				for (var i = 0; i < data.length; i++) {
+					switch (this.currectData.cuttentTemplate) {
+						case '2':
+							if (data[i].use === 'name' ||
+								data[i].use === 'companyName' ||
+								data[i].use === 'address-icon' ||
+								data[i].use === 'phone-icon' ||
+								data[i].use === 'remark-icon') {
+								data[i].x = 30
+							}
+							if (data[i].use === 'post') {
+								data[i].x = 100
+							}
+							if (data[i].use === 'address' ||
+								data[i].use === 'phone' ||
+								data[i].use === 'remark') {
+								data[i].x = 60
+							}
+							if (data[i].use == 'head') {
+								data[i].x = 370
+							}
+							break;
+						case '3':
+							if (data[i].use === 'name') {
+								data[i].x = 30
+								data[i].y = 150
+							}
+							if (data[i].use === 'companyName') {
+								data[i].x = 30
+								data[i].y = 180
+							}
+							if (data[i].use === 'post') {
+								data[i].x = 100
+								data[i].y = 153
+							}
+							if (data[i].use === 'address-icon' ||
+								data[i].use === 'phone-icon' ||
+								data[i].use === 'remark-icon') {
+								data[i].x = 170
+							}
+							if (data[i].use === 'address-icon') {
+								data[i].y = 150
+							}
+							if (data[i].use === 'address') {
+								data[i].y = 155;
+								data[i].width = 300
+							}
+							if (data[i].use === 'phone-icon') {
+								data[i].y = 180
+							}
+							if (data[i].use === 'phone') {
+								data[i].y = 183
+							}
+							if (data[i].use === 'remark-icon') {
+								data[i].y = 210
+							}
+							if (data[i].use === 'remark') {
+								data[i].y = 212
+							}
+							if (data[i].use === 'address' ||
+								data[i].use === 'phone' ||
+								data[i].use === 'remark') {
+								data[i].x = 190
+							}
+							break;
+						case '4':
+							if (data[i].use === 'name' ||
+								data[i].use === 'companyName') {
+								data[i].x = 30
+							}
+							if (data[i].use === 'companyName') {
+								data[i].y = 90
+							}
+							if (data[i].use === 'post') {
+								data[i].x = 100
+							}
+							if (data[i].use == 'head') {
+								data[i].x = 25
+								data[i].y = 120
+							}
+							if (data[i].use === 'address-icon' ||
+								data[i].use === 'phone-icon' ||
+								data[i].use === 'remark-icon') {
+								data[i].x = 170
+							}
+							if (data[i].use === 'address') {
+								data[i].width = 300
+							}
+							if (data[i].use === 'address' ||
+								data[i].use === 'phone' ||
+								data[i].use === 'remark') {
+								data[i].x = 190
+							}
+							break;
+						default:
+					}
+				}
+				this.canvasData = {
+					clicknum: this.clicknum++,
+					list: data
+				}
+			},
+			posterError(err) {
+				console.log(err)
+				uni.hideLoading()
+			},
+			posterSuccess(url) {
+				console.log("hahahah", url)
+				// 生成成功,会把临时路径在这里返回
+				this.poster = url;
+				console.log(url)
+				// this.show=false
+				uni.hideLoading()
+			},
+			menuClick(typeName) {
+				if (typeName == "contactCustomer") return
+			let _url = '/pages/mySet/' + typeName
+			uni.navigateTo({
+				url: _url
+			})
 			}
+			
 		}
-
 	}
 </script>
 
@@ -119,35 +483,41 @@
 	.content2 {
 		background: #fff;
 		margin: 20rpx;
-		padding:0 40rpx;
+		padding: 0 40rpx;
 		position: relative;
 		top: -100rpx;
 		border-radius: 20rpx;
-		.nav-img{
+
+		.nav-img {
 			width: 32rpx;
-			margin-right:20rpx ;
+			margin-right: 20rpx;
 		}
-		.row{
+
+		.row {
 			border-bottom: 1px solid #E6E6E6;
 			padding: 35rpx 0;
-			.row-right-img{
+
+			.row-right-img {
 				width: 12rpx;
 			}
 		}
-		.row:last-child{
+
+		.row:last-child {
 			border: none;
 		}
-		.left-btn{
+
+		.left-btn {
 			background: #fff;
 			padding: 0;
 			margin: 0;
 			font-size: 32rpx;
-			    height: 42rpx;
-			    display: flex;
-			    align-items: center;
+			height: 42rpx;
+			display: flex;
+			align-items: center;
 		}
-		.left-btn:after{
-			border: none!important;
+
+		.left-btn:after {
+			border: none !important;
 		}
 	}
 </style>

+ 0 - 1
xiaochengxu/pages/mySet/newCard.vue

@@ -256,7 +256,6 @@
 		},
 		methods: {
 			changeTemplate(index) {
-				console.log(this.imgList[index].dictSort)
 				this.selectIndex = index
 				this.cardInfo.currentBackground = this.imgList[index].dictLabel
 				this.cardInfo.cuttentTemplate = this.imgList[index].dictSort

binární
xiaochengxu/static/imgs/scancode.png


binární
xiaochengxu/static/imgs/shade.png


+ 5 - 0
xiaochengxu/uni_modules/uview-ui/components/u-picker/props.js

@@ -40,6 +40,11 @@ export default {
             type: String,
             default: uni.$u.props.picker.confirmText
         },
+		// 确认按钮的类型
+		confirmType: {
+		    type: String,
+		    default: uni.$u.props.picker.confirmType
+		},
         // 取消按钮的颜色
         cancelColor: {
             type: String,

+ 1 - 0
xiaochengxu/uni_modules/uview-ui/components/u-picker/u-picker.vue

@@ -9,6 +9,7 @@
 				:cancelColor="cancelColor"
 				:confirmColor="confirmColor"
 				:cancelText="cancelText"
+				:confirmType="confirmType"
 				:confirmText="confirmText"
 				:title="title"
 				@cancel="cancel"

+ 6 - 1
xiaochengxu/uni_modules/uview-ui/components/u-toolbar/props.js

@@ -29,6 +29,11 @@ export default {
         title: {
             type: String,
             default: uni.$u.props.toolbar.title
-        }
+        },
+		// 确认按钮的类型
+		confirmType: {
+		    type: String,
+		    default: uni.$u.props.toolbar.confirmType
+		},
     }
 }

+ 14 - 0
xiaochengxu/uni_modules/uview-ui/components/u-toolbar/u-toolbar.vue

@@ -25,12 +25,18 @@
 			hover-class="u-hover-class"
 		>
 			<text
+			v-if='!confirmType'
 				class="u-toolbar__wrapper__confirm"
 				@tap="confirm"
 				:style="{
 				color: confirmColor
 			}"
 			>{{ confirmText }}</text>
+			<button v-if='confirmType=="share"' :style="{
+				color: confirmColor
+			}" class="shareBtn u-toolbar__wrapper__confirm" type="default" data-name="shareBtn" open-type="share">
+				{{ confirmText }}
+			</button>
 		</view>
 	</view>
 </template>
@@ -99,4 +105,12 @@
 			}
 		}
 	}
+	.shareBtn{
+		background:transparent;
+		line-height:1;
+		font-size:30rpx;
+	}
+	.shareBtn:after{
+		border:none;
+	}
 </style>