Karsa 2 년 전
부모
커밋
cbea12c1d3
3개의 변경된 파일28개의 추가작업 그리고 17개의 파일을 삭제
  1. 8 1
      pages-question/components/questionItem.vue
  2. 1 1
      pages-question/detail/index.vue
  3. 19 15
      pages/workbench/index.vue

+ 8 - 1
pages-question/components/questionItem.vue

@@ -27,7 +27,7 @@
             <view class="row">所属提问:{{data.QuestionContent}}</view>
             <view class="row">评论人:{{data.UserName}}</view>
             <view class="row">客户信息:{{data.CompanyName}} <text v-if="data.CompanyProductStatus">({{data.CompanyProductStatus}})</text> </view>
-            <view class="row">评论时间:{{data.CreateTime}}</view>
+            <view class="row">评论时间:{{data.CreateTime | formatTime}}</view>
          </template>
       </view>
       <view class="action-bot flex">
@@ -45,12 +45,19 @@
 
 <script>
    import * as $api from '@/api/question/index.js'
+   const moment = require('@/pages-roadshow/utils/_moment.js');
+   moment.locale('zh-cn'); 
    export default {
       props: {
          type: String,
          status: String,
          item: Object
       },
+      filters: {
+         formatTime(val) {
+            return moment(val).format('YYYY-MM-DD HH:mm:ss')
+         }
+      },
       watch: {
          item(newval) {
             this.data = newval;

+ 1 - 1
pages-question/detail/index.vue

@@ -186,7 +186,7 @@
          setHotHandle(id) {
             let index = this.list.findIndex(_ => _.CommunityQuestionCommentId === id);
             if(this.status === -1) {
-               this.list[0].IsHot = this.list[0].IsHot ? 0 : 1
+               this.list[index].IsHot = this.list[index].IsHot ? 0 : 1
             }else {
                this.list.splice(index,1)
             }

+ 19 - 15
pages/workbench/index.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="workbench-page">
 
-		<view class="section white-wrap" v-for="item in tabs" :key="item.label">
-			<view class="tab-title">{{item.label}}</view>
-			<view class="tab-ul">
-				<view class="tab-item" @click="handleGoNext(tab.url)" v-for="tab in item.child" :key="tab.label">
-					<image :src="tab.img" mode="aspectFill" class="icon"/>
-					<view class="label">{{tab.label}}</view>
-				</view>
-			</view>
+		<view class="section white-wrap" v-for="item in my_tabs" :key="item.label">
+         <view class="tab-title">{{item.label}}</view>
+         <view class="tab-ul">
+            <view class="tab-item" @click="handleGoNext(tab.url)" v-for="tab in item.child" :key="tab.label">
+               <image :src="tab.img" mode="aspectFill" class="icon"/>
+               <view class="label">{{tab.label}}</view>
+            </view>
+         </view>
 		</view>
 
 	</view>
@@ -19,6 +19,7 @@
 	export default{
 		data() {
 			return {
+            my_tabs: [],
 				tabs: [
 					{
 						label: '审批',
@@ -38,11 +39,6 @@
 								url: '/pages-approve/seal/list',
 								img: require('@/static/icon-3.png')
 							},
-							// {
-							// 	label: '活动审批',
-							// 	url: '/pages-approve/activity/list',
-							// img: require('@/static/icon-4.png')
-							// },
 						]
 					},
 					{
@@ -78,17 +74,25 @@
 				]
 			}
 		},
+      onLoad() {
+         
+        this.init()
+      },
+      
 		onShareAppMessage() {
 			return shareData
 		},
 		methods: {
 			handleGoNext(url) {
-				
 					uni.navigateTo({
 						url
 					})
 
-			}
+			},
+         init() {
+            const userInfo = this.$store.state.userInfo;
+            this.my_tabs =  !['ficc_admin','admin'].includes(userInfo.RoleTypeCode) ? this.tabs.filter(_ => _.label !== '问答社区') : this.tabs;
+         }
 		},
 	}
 </script>