Browse Source

新增权限控制优化

xiebaomin 2 years ago
parent
commit
74b56f6cf9

+ 20 - 11
pages/goods/components/cm-product-doc.vue

@@ -18,7 +18,7 @@
                                     :src="image.url"
                                     @click="previewImage(i, item.imageList)"
                                     mode="aspectFill"
-                                    v-for="(image, i) in imageFormat(item.imageList)"
+                                    v-for="(image, i) in imageFormat(item.imageList, index)"
                                     :key="i"
                                     :style="image.style"
                                 ></image>
@@ -168,10 +168,7 @@ export default {
             timer: null,
             tipStatus: true, // 状态
             userInfo: {}, // 用户信息
-            videoPermission: { // 视频播放权限
-                allTime: 10, // 分
-                onplay: 3 * 100 * 60 // 分钟
-            }
+            num: 0,
         }
     },
     computed: {
@@ -215,11 +212,22 @@ export default {
                 userId: this.userId,
                 archiveId: this.archiveId
             }).then(res => {
-                console.log(res, '数据是')
                 this.imageArchiveList = res.data.imageArchiveList
                 this.videoArchiveList = res.data.videoArchiveList
                 this.fileArchiveList = res.data.fileArchiveList
                 this.permission = res.data.permission
+                this.imageArchiveList.forEach((item, index) => {
+                    if (item.imageNum !== item.imageList.length) {
+                        this.num = item.imageNum - item.imageList.length
+                        for (let i = 0; i < this.num; i++) {
+                            item.imageList.push(this.defaultImage)
+                        }
+                    }
+                })
+                this.videoArchiveList.forEach(item => {
+                    item.fileUrl = decodeURIComponent(item.fileUrl)
+                })
+                // console.log(res.data.videoArchiveList)
             })
         },
         //采美豆抵扣
@@ -282,13 +290,14 @@ export default {
         // 监听video时长
         onPlayVideo(e) {
             console.log(e)
-            const allTime = Math.floor(e.detail.duration) / 100 / 60 // 获取分钟
+            const allTime = parseInt(((e.detail.duration)% 3600) / 60) // 获取分钟
+            const inPlay = parseInt(((e.detail.duration)% 3600) / 60)
             if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
-                if(allTime >= this.videoPermission.allTime && this.videoPermission.onplay > e.detail.currentTime) {
+                if(allTime >= 10 && (3 < inPlay)) {
                     this.handleStop(e.target.id)
                     this.checkPermission()
                 }
-                if (allTime < this.videoPermission.allTime) {
+                if (allTime < 10) {
                     this.handleStop(e.target.id)
                     this.checkPermission()
                 }
@@ -341,7 +350,7 @@ export default {
             // }else if (this.permission === 2) {
             if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
                 if(previewImageList.length >= 5) {
-                    if(index < 3) {
+                    if(index < 2) {
                         uni.previewImage({
                             current: index,
                             indicator: 'number',
@@ -411,7 +420,7 @@ export default {
             }
         },
         //图片列表处理
-        imageFormat(list) {
+        imageFormat(list, index) {
             const imageList = []
             if (list.length > 2) {
                 list.forEach((item, index) => {

+ 21 - 2
pages/notice/shop/components/notice-cell.vue

@@ -3,7 +3,7 @@
 	<view>
 		<!-- 供应商账户通知 -->
 		<template v-if="cellType === 1">
-			<view class="tui-notice-cell clearfix">
+			<view class="tui-notice-cell clearfix" v-if="cell.shopMessType < 6">
 				<view class="tui-cell-top">
 					<view class="cell-title"> {{ cell.shopMessType | noticeUsersFilters }} </view>
 					<view class="cell-time"> {{ cell.time }} </view>
@@ -18,6 +18,23 @@
 					<view class="tui-cell-content"> {{ noticeUsersText(cell) }} </view>
 				</template>
 			</view>
+            <view class="" v-if="cell.shopMessType >= 6">
+                <view class="tui-notice-cell clearfix">
+                	<view class="tui-cell-top">
+                		<view class="cell-title"> {{ cell.content }} </view>
+                		<view class="cell-time"> {{ cell.time }} </view>
+                	</view>
+                	<template v-if="cell.shopMessType === 3 || cell.shopMessType === 4 || cell.shopMessType === 6">
+                		<view class="tui-cell-content">
+                			<view class="cell-image"> <img :src="cell.mainImage" alt="" /> </view>
+                			<view class="cell-content"> {{ noticeUsersText(cell) }} </view>
+                		</view>
+                	</template>
+                	<template v-else>
+                		<view class="tui-cell-content"> {{ noticeUsersText(cell) }} </view>
+                	</template>
+                </view>
+            </view>
 		</template>
 		<!-- 供应商服务通知 -->
 		<template v-if="cellType === 2">
@@ -49,7 +66,9 @@ export default {
 	data() {
 		return {}
 	},
-	created() {},
+	created() {
+        console.log(this.cellType, this.cell, 1111)
+    },
 	methods: {}
 }
 </script>

+ 5 - 1
pages/notice/shop/mixins/notice.mixins.js

@@ -104,7 +104,11 @@ const noticeMixins = {
                 2: `恭喜您(微信昵称:${cell.content})成功成为【${cell.shopName}】的运营人员。`,
                 3: '该商品上架审核未通过,暂时不能上架采美商城。请登录采美网站修改商品资料重新提交。',
                 4: '该商品新品展示审核未通过,未能展示在采美商城新品橱窗。',
-                5: `该商品的资质证书将于${cell.content}后失效,请及时登录采美网站上传新证书。` 
+                5: `该商品的资质证书将于${cell.content}后失效,请及时登录采美网站上传新证书。` ,
+                6: `恭喜您发布的采美百科词条“${cell.content}”审核已通过。`,
+                7: `很遗憾!您发布的采美百科词条“${cell.content}”审核未通过,原因是“${cell.reasonContent}”,可前往电脑端“我的词条”进行修改后,重新提交审核。`,
+                8: `恭喜您发布的采美文章“${cell.content}”审核已通过。`,
+                9: `很遗憾!您发布的采美文章“${cell.content}”审核未通过,原因是“${cell.reasonContent}”,可前往电脑端“文章管理”进行修改后,重新提交审核。`
             }
             return map[cell.shopMessType]
         },