Browse Source

Merge branch 'yb11.2'

jwyu 2 years ago
parent
commit
5ea8d24662
5 changed files with 63 additions and 8 deletions
  1. 2 0
      App.vue
  2. 5 4
      pages-todomessages/list/list.vue
  3. 33 3
      pages-video/comment/list.vue
  4. 1 1
      pages/workbench/index.vue
  5. 22 0
      utils/common.js

+ 2 - 0
App.vue

@@ -1,4 +1,5 @@
 <script>
+	import {hasUpdate} from '@/utils/common.js'
 	export default {
 		onLaunch: function() {
 			console.log('App Launch')
@@ -8,6 +9,7 @@
 		},
 		onShow: function() {
 			console.log('App Show')
+			hasUpdate()
 		},
 		onHide: function() {
 			console.log('App Hide')

+ 5 - 4
pages-todomessages/list/list.vue

@@ -28,10 +28,11 @@
 						<view class="info">评论时间:{{item.ApprovalInfo.ApplyTime|formatTime}}</view>
 						<image src="@/static/icon-look.png" mode="aspectFill" class="new-status" v-if="item.ApprovalStatus === 1"></image>
                      </template>
-					 <template v-if="item.SourceType===7">
+					 <template v-if="[7,8].includes(item.SourceType)">
 						<view class="title">{{item.ApprovalInfo.Title}}</view>
+						<view class="info">视频分类:{{item.ApprovalInfo.MessageSource}}</view>
 						<view class="info">视频标题:{{item.ApprovalInfo.Content}}</view>
-						<view class="info">所属标签:{{item.ApprovalInfo.Extra}}</view>
+						<view class="info">所属{{item.SourceType==7?'标签':'品种'}}:{{item.ApprovalInfo.Extra}}</view>
 						<view class="info">评论人:{{item.ApprovalInfo.ApplyName}}</view>
 						<view class="info">客户信息:{{item.ApprovalInfo.CompanyName}}</view>
 						<view class="info">评论时间:{{item.ApprovalInfo.ApplyTime|formatTime}}</view>
@@ -122,8 +123,8 @@
 				}
 
 				// 如果是questionComment 则如果是视频则跳转到视频
-				if(this.typeName=='questionComment'&&e.SourceType===7){
-					uni.navigateTo({url:`/pages-video/comment/list?id=${e.CompanyApprovalId}`})
+				if(this.typeName=='questionComment'&&[7,8].includes(e.SourceType)){
+					uni.navigateTo({url:`/pages-video/comment/list?id=${e.CompanyApprovalId}&source=${e.SourceType===7?2:3}`})
 					return
 				}
 				

+ 33 - 3
pages-video/comment/list.vue

@@ -4,13 +4,18 @@
             <view @click="goSearch">
                 <van-search :value="key_word" shape="round" placeholder="评论内容" disabled />
             </view>
+            <view class="tabs-box">
+                <text :class="source===3?'active':''" @click="handleTypeChange(3)">线上路演</text>
+                <text :class="source===2?'active':''" @click="handleTypeChange(2)">视频社区</text>
+            </view>
         </van-sticky>
         <view class="list-wrap">
             <view class="question-item" v-for="(item,index) in list" :key="item.CommunityQuestionCommentId">
                 <view class="cont">
                     <veiw class="item-title">{{item.Content}}</veiw>
+                    <view class="row">视频分类:{{source===3?'线上路演':'视频社区'}}</view>
                     <view class="row">视频标题:{{item.QuestionContent}}</view>
-                    <view class="row">所属标签:{{item.TagName}}</view>
+                    <view class="row">所属{{source===3?'品种':'标签'}}:{{item.TagName}}</view>
                     <view class="row">评论人:{{item.UserName}}</view>
                     <view class="row">客户信息:{{item.CompanyName}} <text v-if="item.CompanyProductStatus">({{item.CompanyProductStatus}})</text> </view>
                     <view class="row">评论时间:{{item.CreateTime | formatTime}}</view>
@@ -34,11 +39,13 @@ export default {
             page:1,
             pageSize:20,
             list:[],
-            finished:false
+            finished:false,
+            source:3
         }
     },
     onLoad(options){
         this.id=options.id||0
+        this.source=Number(options.source)||3
         this.getList()
 
         // 搜索返回 
@@ -57,6 +64,7 @@ export default {
       	this.page=1
       	this.finished=false
       	this.list=[]
+        this.key_word = ''
       	this.getList()
       	setTimeout(()=>{
       		uni.stopPullDownRefresh()
@@ -73,7 +81,7 @@ export default {
                 Keyword:this.key_word,
                 CurrentIndex:this.page,
                 PageSize:this.pageSize,
-                Source:2,
+                Source:this.source,
                 HotStatus:-1,
                 CommunityQuestionCommentId:Number(this.id)
             })
@@ -109,6 +117,15 @@ export default {
                url: `/pages-approve/search/index?type=videoComment`,
             })
         },
+
+        handleTypeChange(e){
+            this.source=e 
+            // this.key_word = '';
+            this.page = 1;
+            this.list=[]
+            this.finished=false
+            this.getList()
+        }
     },
 }
 </script>
@@ -166,4 +183,17 @@ export default {
       }
    }
 }
+
+.tabs-box{
+    background-color: #fff;
+    padding: 10px 12px 0 12px;
+    text{
+        display: inline-block;
+        margin-right: 60rpx;
+        padding-bottom: 13rpx;
+        &.active{
+            border-bottom: 2px solid #3385FF;
+        }
+    }
+}
 </style>

+ 1 - 1
pages/workbench/index.vue

@@ -72,7 +72,7 @@
 						]
 					},
 					{
-						label: '视频社区',
+						label: '视频',
 						child: [
 							{
 								label: '评论管理',

+ 22 - 0
utils/common.js

@@ -0,0 +1,22 @@
+/**
+ * 校验是否有小程序新版本
+ */
+export const hasUpdate = () => {
+    const updateManager = uni.getUpdateManager();
+    updateManager.onCheckForUpdate(function (res) {
+      // 请求完新版本信息的回调
+      console.log("是否有新版本", res.hasUpdate);
+    });
+    updateManager.onUpdateReady(function (res) {
+      uni.showModal({
+        title: "更新提示",
+        content: "新版本已经准备好,是否重启应用?",
+        success(res) {
+          if (res.confirm) {
+            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+            updateManager.applyUpdate();
+          }
+        },
+      });
+    });
+};