Browse Source

Merge branch 'developerX' into developerA

xiebaomin 2 năm trước cách đây
mục cha
commit
e36078c8d4

+ 112 - 18
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>
@@ -48,6 +48,7 @@
                         <view class="cm-video-list">
                             <video
                                 class="cm-video"
+                                ref="myVideo"
                                 :id="'myVideo' + index"
                                 :src="item.fileUrl"
                                 :style="videoStyle['myVideo' + index]"
@@ -55,6 +56,7 @@
                                 show-fullscreen-btn
                                 show-mute-btn
                                 play-btn-position="center"
+                                @timeupdate="onPlayVideo($event)"
                                 @play="handlePlayer('myVideo' + index)"
                                 v-if="item.fileUrl"
                                 @loadedmetadata="loadedmetadata"
@@ -165,6 +167,8 @@ export default {
             videoStyle: {},
             timer: null,
             tipStatus: true, // 状态
+            userInfo: {}, // 用户信息
+            num: 0,
         }
     },
     computed: {
@@ -192,13 +196,14 @@ export default {
                     clearTimeout(this.timer)
                 }, 10000)
             }
-            console.log(val)
             this.$emit('tipStatus', this.TipStatus)
         }
     },
     created() {
         this.userId = uni.getStorageSync('userInfo').userId || -1
         this.getDetail()
+        this.userInfo = uni.getStorageSync('userInfo')
+        console.log(uni.getStorageSync('userInfo'))
     },
     methods: {
         // 获取商品资料详情
@@ -211,6 +216,18 @@ export default {
                 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)
             })
         },
         //采美豆抵扣
@@ -257,10 +274,11 @@ export default {
         },
         // 视频播放
         handlePlayer(id) {
-            if (this.checkPermission()) {
-                this.handleStop(id)
-                return
-            }
+            // if (this.checkPermission()) {
+            //     this.handleStop(id)
+            //     return
+            // }
+            console.log('视频播放id', id)
             // 如果点击同一个播放器,就
             if (this.prevVideoId === id) return
             // this.handleFullScreen(id) // 点击播放时全屏
@@ -269,6 +287,22 @@ export default {
             // 保存当前播放器id
             this.prevVideoId = id
         },
+        // 监听video时长
+        onPlayVideo(e) {
+            console.log(e)
+            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 >= 10 && (3 < inPlay)) {
+                    this.handleStop(e.target.id)
+                    this.checkPermission()
+                }
+                if (allTime < 10) {
+                    this.handleStop(e.target.id)
+                    this.checkPermission()
+                }
+            }
+        },
         // 开始播放
         handelPlay(id) {
             if (!id) return
@@ -295,17 +329,75 @@ export default {
         },
         // 预览图片
         previewImage(index, previewImageList) {
-            if (this.checkPermission()) return
-            const that = this
-            uni.previewImage({
-                current: index,
-                indicator: 'number',
-                urls: previewImageList,
-                loop: true,
-                success() {
-                    that.$emit('previewImage', true)
+            // if (this.permission === 1) {
+            //     if(previewImageList.length >= 5) {
+            //         if (index < 3) {
+            //             uni.previewImage({
+            //                 current: index,
+            //                 indicator: 'number',
+            //                 urls: previewImageList,
+            //                 loop: true,
+            //                 success() {
+            //                     that.$emit('previewImage', true)
+            //                 }
+            //             })
+            //         }else {
+            //             this.checkPermission()
+            //         }
+            //     } else {
+            //         this.checkPermission()
+            //     }
+            // }else if (this.permission === 2) {
+            if (this.permission === 2 || this.permission === 4 || this.permission === 1) {
+                if(previewImageList.length >= 5) {
+                    if(index < 2) {
+                        uni.previewImage({
+                            current: index,
+                            indicator: 'number',
+                            urls: previewImageList,
+                            loop: true,
+                            success() {
+                                that.$emit('previewImage', true)
+                            }
+                        })
+                    } else {
+                        if (this.checkPermission()) return
+                    }
+                }else {
+                    if (this.checkPermission()) return
                 }
-            })
+            }
+            // } else if (this.permission === 3) {
+            //     if(previewImageList.length >= 5) {
+            //         if (index < 3) {
+            //             uni.previewImage({
+            //                 current: index,
+            //                 indicator: 'number',
+            //                 urls: previewImageList,
+            //                 loop: true,
+            //                 success() {
+            //                     that.$emit('previewImage', true)
+            //                 }
+            //             })
+            //         } else {
+            //             if (this.checkPermission()) return
+            //         }
+            //     } else {
+            //         if (this.checkPermission()) return
+            //     }
+            else {
+               if (this.checkPermission()) return
+               const that = this
+               uni.previewImage({
+                   current: index,
+                   indicator: 'number',
+                   urls: previewImageList,
+                   loop: true,
+                   success() {
+                       that.$emit('previewImage', true)
+                   }
+               })
+            }
         },
         //用户权限校验拦截
         checkPermission() {
@@ -328,7 +420,7 @@ export default {
             }
         },
         //图片列表处理
-        imageFormat(list) {
+        imageFormat(list, index) {
             const imageList = []
             if (list.length > 2) {
                 list.forEach((item, index) => {
@@ -377,7 +469,7 @@ export default {
         },
         // 文件预览
         previewFile(file) {
-            if (this.checkPermission()) return
+            // if (this.checkPermission()) return
             // 获取文件后缀
             // const index = file.fileName.lastIndexOf('.')
             // const suffix = file.fileName.substring(index)
@@ -414,11 +506,13 @@ export default {
                 success(res) {
                     const filePath = res.tempFilePath
                     console.log(filePath) 
+                    console.log(file, res, '文件数据')
                     // 打开文件
                     uni.openDocument({
                         filePath: filePath,
                         fileType: suffix,
                         success(res) {
+                            console.log(res)
                             uni.showToast({
                                 icon:'success',
                                 title:'打开成功',

+ 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]
         },