Browse Source

商品详情 医疗器械查看权限控制。

zhengjinyi 3 years ago
parent
commit
9ff7549df2

+ 19 - 1
components/cm-module/cart-components/index.vue

@@ -64,7 +64,8 @@
 										</view>
 										<view class="pros-img" @click.stop="navToListPage(pros.productId)"
 											><image :src="pros.image ? pros.image : ''" alt=""
-										/></view>
+										/><view class="pros-type" v-if="pros.productType == 2">医疗器械</view>
+										</view>
 										<view class="pros-product">
 											<view class="producttitle" @click.stop="navToListPage(pros.productId)">{{
 												pros.name
@@ -205,6 +206,7 @@
 									<text class="img-tip">失效</text>
 									<view class="pros-img">
 										<image :src="failure.image ? failure.image : ''" alt="" />
+										<view class="pros-type" v-if="failure.productType == 2">医疗器械</view>
 									</view>
 									<view class="pros-product">
 										<view class="producttitle">{{ failure.name }}</view>
@@ -1796,11 +1798,27 @@ page {
 			border-radius: 10rpx;
 			margin: 0 20rpx;
 			border: 1px solid #f3f3f3;
+			position: relative;
 			image {
 				width: 100%;
 				height: 100%;
 				border-radius: 10rpx;
 			}
+			.pros-type{
+				width: 64rpx;
+				height: 64rpx;
+				text-align: justify;
+				box-sizing: border-box;
+				padding: 10rpx;
+				border-radius: 0 0 8rpx 8rpx;
+				background-color: #33CCBF;
+				font-size: $font-size-22;
+				color: #FFFFFF;
+				line-height: 25rpx;
+				position: absolute;
+				top: 0;
+				right: 10rpx;
+			}
 		}
 	}
 	.goods-pros-b {

+ 8 - 7
components/cm-module/homeIndex/notice.vue

@@ -43,7 +43,7 @@
 				this.$api.navigateTo(`/pages/service/news-detailes?id=${item.id}`)
 			},
 			newsList(){// 公告列表
-				this.$api.navigateTo(`/pages/service/news-list`)
+				this.$api.navigateTo('/pages/service/news-list')
 			},
 			swiperChange(e) {//轮播图切换
 				const index = e.detail.current
@@ -59,10 +59,10 @@
 <style lang="scss">
 	.tui-rolling-view{
 		width: 100%;
-		height: 96rpx;
+		height: 88rpx;
 		background-color: #F7F7F7;
 		box-sizing: border-box;
-		padding: 32rpx 24rpx 0 24rpx;
+		padding: 24rpx 24rpx 0 24rpx;
 	}
 	.tui-rolling-news {
 		width: 100%;
@@ -74,15 +74,16 @@
 		justify-content: center;
 		flex-wrap: nowrap;
 		line-height: 56rpx;
-		background: $btn-confirm;
+		background: url('https://static.caimei365.com/app/img/bg/icon-newsbg@2x.png') no-repeat;
+		background-size: cover;
 		.tui-roll-label{
 			font-weight: bold;
 			font-size: $font-size-26;
-			color: #FFFFFF;
+			color: #E15616;
 		}
 		.tui-roll-more{
 			font-size: $font-size-24;
-			color: #FFFFFF;
+			color: #666666;
 			.icon-xiayibu{
 				font-size: $font-size-22;
 			}
@@ -106,7 +107,7 @@
 		overflow: hidden;
 		text-overflow: ellipsis;
 		font-size: $font-size-24;
-		color: #FFFFFF;
+		color: #666666;
 		.icon-xiaochengxu{
 			font-size: $font-size-24;
 			margin-right: 10rpx;

+ 1 - 1
components/cm-module/listTemplate/immediatelyList.vue

@@ -53,7 +53,7 @@
 					>
 						<view class="list-details-image">
 							<image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
-							<view class="list-details-type">医疗器械</view>
+							<view class="list-details-type" v-if="pros.productType == 2">医疗器械</view>
 						</view>
 						<view class="list-details-info">
 							<text class="list-details-title">{{ isInterceptHtmlFn(pros.name) }}</text>

+ 1 - 1
components/cm-module/listTemplate/productList.vue

@@ -20,7 +20,7 @@
 				>
 					<view class="list-details-image">
 						<image mode="widthFix" :src="item.image" class="list-img" alt="list-img"></image>
-						<view class="list-details-type">医疗器械</view>
+						<view class="list-details-type" v-if="item.productType == 2">医疗器械</view>
 					</view>
 					<view class="list-details-info">
 						<text class="list-details-title">{{ item.name }}</text>

+ 1 - 1
components/cm-module/pageTemplate/templateType.vue

@@ -1,7 +1,7 @@
 <template name="cm-acttags">
 	<!-- 楼层价格显示公共组件 -->
 	<view>
-		<view class="floor-item-type">医疗器械</view>
+		<view class="floor-item-type" v-if="goods.productType == 2">医疗器械</view>
 	</view>
 </template>
 

+ 1 - 1
pages/goods/goods-active.vue

@@ -22,7 +22,7 @@
 					>
 						<view class="floor-item-image">
 							<image mode="widthFix" :src="item.image" class="list-img tui-skeleton-fillet"  alt="list-img"></image>
-							<view class="list-details-type">医疗器械</view>
+							<view class="list-details-type" v-if="item.productType == 2">医疗器械</view>
 						</view>
 						<view class="floor-item-content">
 							<view class="title"

+ 1 - 1
pages/goods/goods-classify.vue

@@ -88,7 +88,7 @@
 					>
 						<view class="list-details-image">
 							<image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
-							<view class="list-details-type">医疗器械</view>
+							<view class="list-details-type" v-if="pros.productType == 2">医疗器械</view>
 						</view>
 						<view class="list-details-info">
 							<text class="list-details-title">

+ 1 - 1
pages/goods/goods-supporting.vue

@@ -25,7 +25,7 @@
 							</view>
 							<view class="tui-goods-image" @click.stop="navToDetailPage(pros.productId)">
 								<image :src="pros.image" class="tui-goods-img" />
-								<view class="tui-goods-type">医疗器械</view>
+								<view class="tui-goods-type" v-if="pros.productType == 2">医疗器械</view>
 							</view>
 							<view class="tui-goods-info">
 								<text class="list-details-title" @click.stop="navToDetailPage(pros.productId)">{{

+ 102 - 10
pages/goods/product.vue

@@ -94,7 +94,7 @@
 											<!-- <view class="cm-product-cover" v-if="product.appletsActType === 1"
 												>云上美博会</view
 											> -->
-											<view class="cm-product-type">医疗器械</view>
+											<view class="cm-product-type" v-if="product.productType == 2">医疗器械</view>
 											<view class="cm-product-cover" v-if="product.appletsActType === 1"></view>
 										</view>
                                        
@@ -597,6 +597,19 @@
 			:maskClosable="false"
 		>
 		</tui-modal>
+		<!-- 限制医疗器械商品查看限制 -->
+		<tui-modal
+			:show="modal1"
+			@click="handleClick1"
+			@cancel="hideMobel1"
+			:content="contentModalText1"
+			:button="modalButton1"
+			color="#333"
+			:size="32"
+			shape="circle"
+			:maskClosable="false"
+		>
+		</tui-modal>
 	</view>
 </template>
 
@@ -718,7 +731,9 @@ export default {
 			supportingList: [],
 			supportingNum: 0 ,// 组合商品总数
 			contentModalText: '', //操作文字提示语句
+			contentModalText1: '', //操作文字提示语句
 			modal: false,
+			modal1: false,
 			modalButton: [
 				{
 					text: '取消',
@@ -734,6 +749,21 @@ export default {
 					plain: false
 				}
 			],
+			modalButton1: [
+				{
+					text: '取消',
+					type: 'gray',
+					plain: true //是否空心
+				},
+				{
+					text: '去升级',
+					customStyle: {
+						color: '#fff',
+						bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
+					},
+					plain: false
+				}
+			],
 			isShowCaimeiShop:false
 		}
 	},
@@ -781,9 +811,6 @@ export default {
 		if (option.page == 2) {
 			this.backPage = option.page
 		}
-		if (this.isShareType == 'share') {
-			wxLogin.wxLoginAuthorize()
-		}
 		this.getWinHeight()
 	},
 	onReady() {
@@ -801,8 +828,7 @@ export default {
 		console.log('是iPhoneX', this.isIphoneX)
 	},
 	methods: {
-		async initGetStotage() {
-			// 初始化
+		async initGetStotage() {// 初始化
 			const userInfo = await this.$api.getStorage()
 			this.userId = this.couponParam.userId = userInfo.userId ? userInfo.userId : 0
 			this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
@@ -815,7 +841,7 @@ export default {
 				this.isShowButton = false
 			}
 			if (isPreviewImg) {
-				isPreviewImg = false
+				isPreviewImg = false 
 				return
 			} else {
 				this.initData()
@@ -833,7 +859,7 @@ export default {
 					this.shop = response.data.shop
 					this.shopId = response.data.shopId
 					this.product = response.data
-					if(this.shopId == 10235){
+					if(this.shopId == 10255){
 						this.isShowCaimeiShop = true
 					}
 					if (this.product.userLike && this.product.userLike == 1) {
@@ -914,6 +940,10 @@ export default {
 					// setTimeout(() => {
 					//     this.getSectionProps()
 					// }, 2000)
+					if(this.product.productType === 2 && (this.userIdentity != 1 || this.userIdentity != 3)){
+						this.handleShowProductType()
+						return
+					}
 					if ((this.hasLogin && this.userIdentity == 2) || this.userIdentity == 4) {
 						this.ProductCartNumber()
 					}
@@ -928,6 +958,68 @@ export default {
 					this.$util.msg(error.msg, 2000)
 				})
 		},
+		handleShowProductType(){// 根据用户弹窗提示
+			this.modal1 = true
+			if(!this.hasLogin){//游客
+				this.contentModalText1 = '该商品仅限医美类机构查看,请注册医美机构后继续查看。有采美账号的,请直接登录。'
+				this.modalButton1 = [
+					{ text: '关闭', type: 'gray',plain: true },
+					{ text: '去注册/登录',
+					  customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'},
+					  plain: false
+					}
+				]
+			}else{
+				if(this.userIdentity === 4 ){// 普通机构
+					this.contentModalText1 = '该商品仅限医美类机构查看,请升级为医美机构后继续查看。'
+					this.modalButton1 = [
+						{ text: '关闭', type: 'gray',plain: true },
+						{ text: '去升级',
+						  customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'},
+						  plain: false
+						}
+					]
+				}else if( this.userIdentity === 2 ){//会员机构
+					if(this.firstClubType != 1){
+						this.contentModalText1 = '该商品仅限医美类机构查看,您暂无权限。您可去机构资料页面查看机构类型。'
+						this.modalButton1 = [
+							{ text: '关闭', type: 'gray',plain: true },
+							{ text: '去查看资料',
+							  customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'},
+							  plain: false
+							}
+						]
+					}
+				}
+			}
+		},
+		hideMobel1(){
+			this.modal1 = false
+			this.$api.navigateBack(1)
+		},
+		handleClick1(e){// 医美器械弹窗跳转
+			if (e.index == 1) {
+				if(!this.hasLogin){//游客跳转登录页
+					this.$api.navigateTo('/pages/login/login')
+				}else{
+					if(this.userIdentity === 4 ){// 个人机构跳转升级页面
+						this.$api.navigateTo('/pages/login/apply')
+					}else if( this.userIdentity === 2 ){//会员机构
+						if(this.firstClubType != 1){// 会员非医美机构跳转资料页
+							this.$api.navigateTo('/pages/login/information')
+						}
+					}	
+				}
+				this.modal1 = false
+			}else{ 
+				this.modal1 = false
+				if (this.isShareType == 'share') {
+					this.$api.switchTabTo('/pages/tabBar/home/index')
+				}else{
+					this.$api.navigateBack(1)
+				}
+			}
+		},
 		adaptRichTextImg(product) {
 			// 商品详情
 			let defaulHtml = '<div style="text-align: center;color:#333333;">暂无内容</div>'
@@ -1551,13 +1643,13 @@ export default {
 		}
 	},
 	onShow() {
+		wxLogin.wxLoginAuthorize()
 		// 是否开启图片预览 true 不刷新调用接口 false刷新调用接口
 		if (!this.isPreviewImage) {
 			this.initGetStotage()
 		}
 		this.isPreviewImage = false
-	},
-	created() {}
+	}
 }
 </script>
 

+ 1 - 1
pages/search/search.vue

@@ -176,7 +176,7 @@
 				>
 					<view class="list-details-image">
 						<image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
-						<view class="list-details-type">医疗器械</view>
+						<view class="list-details-type" v-if="pros.productType == 2">医疗器械</view>
 					</view>
 					<view class="list-details-info">
 						<view class="list-details-title">

+ 1 - 1
pages/user/collection/collection.vue

@@ -35,7 +35,7 @@
 							<view class="tui-goods-image" @click.stop="navToDetailPage(pros.productId)"
 								>
 								<image :src="pros.image" class="tui-goods-img" />
-								<view class="tui-goods-type">医疗器械</view>
+								<view class="tui-goods-type" v-if="pros.productType == 2">医疗器械</view>
 							</view>
 							<view
 								class="tui-goods-info"

+ 16 - 0
pages/user/coupon/coupon-product.vue

@@ -20,6 +20,7 @@
 					@click.stop="navToDetailPage(pros.productId)"
 				>
 					<image class="item-img tui-skeleton-fillet" :src="pros.image" mode="aspectFill"></image>
+					<view class="floor-item-type" v-if="pros.productType == 2">医疗器械</view>
 					<view class="floor-item-content">
 						<view class="title tui-skeleton-rect">
 							<text class="mclap-tag" v-if="pros.beautyActFlag == '1'">美博会</text>
@@ -294,6 +295,21 @@ page {
 			display: block;
 			margin-bottom: 8rpx;
 		}
+		.floor-item-type{
+			width: 64rpx;
+			height: 64rpx;
+			text-align: justify;
+			box-sizing: border-box;
+			padding: 10rpx;
+			border-radius: 0 0 8rpx 8rpx;
+			background-color: #33CCBF;
+			font-size: $font-size-22;
+			color: #FFFFFF;
+			line-height: 25rpx;
+			position: absolute;
+			top: 0;
+			right: 16rpx;
+		}
 		.floor-item-content {
 			width: 100%;
 			padding: 0 20rpx;