Browse Source

问答管理布局

Karsa 2 years ago
parent
commit
b8dffd3485

+ 4 - 12
pages-approve/search/index.vue

@@ -63,6 +63,10 @@
 						navBarTitle = '客户搜索'
 						this.placeholder = '客户名称'
 						break;
+               case 'question':
+               	navBarTitle = '分配提问'
+               	this.placeholder = '提问内容'
+               	break;
 				}
 				uni.setNavigationBarTitle({
 					title: navBarTitle
@@ -164,18 +168,6 @@
 					return
 				}
 				
-				// if (this.type === 'custome') {
-				// 	this.handleCustome()
-				// }
-
-				// if (this.type === 'contract') {
-				// 	this.handleContract()
-				// }
-				
-				// if(this.type==='seal'){
-				// 	this.handleSeal()
-				// }
-				
 				const handleFn = {
 					custome: this.handleCustome,
 					contract: this.handleContract,

+ 171 - 0
pages-question/components/questionItem.vue

@@ -0,0 +1,171 @@
+<template>
+   <view class="question-item">
+      <view class="cont">
+         
+         <!-- 提问item -->
+         <!-- <template v-if="type==='question'"> -->
+            <veiw class="item-title">美元指数很强,之后是怎么看?问题来点字数但我也不知道打点什么就来点废话文学好了,差不多凑到50字就行哩</veiw>
+            <!-- <textarea
+               v-model="message" 
+               placeholder="发布一条友善的评论" 
+               auto-height
+               :show-confirm-bar="false"
+               :cursor-spacing="20"
+               :maxlength="50"
+               class="item-title"
+            /> -->
+            <view class="row">提问人:打到我</view>
+            <view class="row">提问时间:2022.03.23  17:22:22</view>
+            <view class="item-bottom row flex">
+               <view class="flex">
+                  回答者:
+                  <view class="select-wrapper" @click="">
+                     <input type="text" placeholder="请选择研究员" disabled class="ipt">
+                     <van-icon name="play" color="#999" style="transform: rotate(90deg);position: absolute;right: 20rpx;top: 30%;"/>
+                  </view>
+               </view>
+               <view class="status blue-color">待分配</view>
+            </view>
+            
+         <!-- </template> -->
+         
+         <!-- 评论item -->
+    <!--     <template v-else>
+            <veiw class="item-title">美元指数很强,之后是怎么看?问题来点字数但我也不知道打点什么就来点废话文学好了,差不多凑到50字就行哩</veiw>
+            <view class="row">评论人:打到我</view>
+            <view class="row">客户信息:dwqjwijwi</view>
+            <view class="row">评论时间:2022.03.23  17:22:22</view>
+         </template> -->
+      </view>
+      <view class="action-bot flex">
+         <text class="red-color" @click="actionHandle('del')">删除</text>
+         <!-- <text>编辑</text> -->
+         <text class="blue-color" @click="actionHandle('send')">分配</text>
+         <text class="blue-color" @click="actionHandle('hot')">精选</text>
+         
+      </view>
+      
+      
+      <!-- 选择研究员 -->
+      <van-popup :show="isResearcherPicker" position="bottom">
+      	<view class="select-rs-header">
+      		<text class="cancel" @click="cancelResearcher">取消</text>
+      		<text class="ensure" @click="confirmResearcher">确认</text>
+      	</view>
+      	<van-tree-select 
+      		:items="researcherList" 
+      		:main-active-index="rs_picker.firstindex" 
+      		:active-id="rs_picker.id"
+      		@click-nav="clickFirstHandle" 
+      		@click-item="clickItemHandle" 
+      	/>
+      </van-popup>
+   </view>
+</template>
+
+<script>
+   export default {
+      props: {
+         type: String,
+         status: String,
+         item: Object
+      },
+      data() {
+         return {
+            message: '带我去大青蛙多无群多无'
+         };
+      },
+      methods: {
+         
+         /* 操作*/
+         actionHandle(key) {
+            const actionmap = {
+               'del': this.delHandle,
+               'send': this.sendQuestionHandle,
+               'hot': this.setHotHandle
+            }
+            actionmap[key]()
+         },
+         
+         /* 删除 */
+         delHandle() {
+            wx.showModal({
+               title: "",
+               content: "确认删除吗?",
+               confirmColor: "#EE3636",
+               cancelColor: '#333',
+               success: function() {
+                  // const { code } = await delComment({ comment_id });
+                  // if( code !== 200 ) return
+                           
+                  // wx.showToast({title: '删除成功'});
+               }
+            })
+         },
+         
+         /* 分配研究员 */
+         sendQuestionHandle() {
+            
+         },
+         
+         /* 设置精选 */
+         setHotHandle() {
+            
+         }
+      }
+   }
+</script>
+
+<style lang="scss" scoped>
+.blue-color {
+   color: #3385FF;
+}
+.red-color {
+   color: #D63535;
+}
+.flex {
+   display: flex;
+   align-items: center;
+}
+.question-item {
+   background: #fff;
+   padding: 20rpx 0 0;
+   border-radius: 8rpx;
+   font-size: 28rpx;
+   margin-bottom: 20rpx;
+   .cont {
+      padding: 0 20rpx;
+   }
+   .item-title {
+      color: #333;
+      font-size: 32rpx;
+   }
+   .row {
+      margin: 15rpx 0;
+   }
+   .item-bottom {
+      justify-content: space-between;
+      .select-wrapper {
+         width: 250rpx;
+         border: 1px solid #F1F2F6;
+         padding: 0 40rpx 0 20rpx;
+         position: relative;
+         .ipt {
+            height: 80rpx;
+            line-height: 80rpx;
+         }
+      }
+   }
+   .action-bot {
+      border-top: 1px solid #EAEAEA;
+      margin-top: 30rpx;
+      text {
+         padding: 24rpx 0;
+         flex: 1;
+         text-align: center;
+         border-right: 1px solid #EAEAEA;
+         &:last-child { border: none; }
+      }
+   }
+}
+</style>

+ 119 - 0
pages-question/detail/index.vue

@@ -0,0 +1,119 @@
+<template>
+   <view class="question-detail-page">
+      <van-sticky>
+         <view class="" @click="goSearch">
+            <van-search :value="search_txt" shape="round" placeholder="提问内容" disabled />
+  
+         </view>
+         <van-tabs id="tabs" :active="status" title-active-color="#3385FF" color="#3385FF" @change="typeChange">
+         	<van-tab :title="item.label" :name="item.key" v-for="item in tabs" :key="item.key"></van-tab>
+         </van-tabs>
+      </van-sticky>
+      
+      <view class="list-cont">
+         <question-item 
+            v-for="item in list"
+            :key="item"
+            :item="item"
+            :status="status"
+            :type="type"
+         />
+      </view>
+      
+      <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="finished&&list.length===0"/>
+   </view>
+</template>
+
+<script>
+   import questionItem from '../components/questionItem.vue'
+   export default {
+      data() {
+         return {
+            type:'',//页面类型
+            search_txt: '',
+            status: '',
+            tabs: [],
+            list:[1,2,3,4],
+            finished: false
+         };
+      },
+      components: { questionItem },
+      onLoad(options) {
+         this.initState(options)
+      },
+      onShow() {
+         this.$nextTick(()=>{
+         	this.selectComponent('#tabs').resize();// 解决初始渲染 vant tab 底部条
+         })
+      },
+      methods: {
+         /* 改变类型 */
+         typeChange(key) {
+            
+         },
+         
+          /* 搜索 */
+         goSearch() {
+            console.log(1111)
+            uni.navigateTo({
+               url: `/pages-approve/search/index?type=question`
+            })
+         },
+         
+         
+         /* init*/
+         initState({ type }) {
+            const titleMap = {
+               'question': '分配提问',
+               'comment': '评论管理',
+            }
+            const tabMap = {
+               'question': [
+                  {
+                     label: '待分配',
+                     key: 1
+                  },
+                  {
+                     label: '待回答',
+                     key: 2
+                  },
+                  {
+                     label: '已回答',
+                     key: 3
+                  },
+                  
+               ],
+               'comment': [
+                  {
+                     label: '全部',
+                     key: 1
+                  },
+                  {
+                     label: '已精选',
+                     key: 2
+                  },
+                  {
+                     label: '未精选',
+                     key: 3
+                  },
+                  
+               ]
+            }
+            
+            this.type = type;
+            
+            this.tabs = tabMap[type] || tabMap['question'];
+            
+            uni.setNavigationBarTitle({
+            	title: titleMap[type]
+            });
+         }
+      }
+   }
+</script>
+
+<style lang="scss" scoped>
+.list-cont {
+   padding: 40rpx 20rpx;
+}
+</style>

+ 0 - 0
pages-question/search/search.vue


+ 18 - 1
pages.json

@@ -182,7 +182,24 @@
 				}
 			 }
 		 ]
-	 }
+	 },
+    {
+      "root": "pages-question",//问答社区
+      "pages": [
+         {
+            "path": "detail/index",
+            "style": {
+              "navigationBarTitleText": "分配提问"
+            }
+         },
+         {
+            "path": "search/search",
+            "style": {
+              "navigationBarTitleText": "分配提问"
+            }
+         }
+      ]
+    }
   ],
   "globalStyle": {
     "navigationBarTextStyle": "black",

+ 16 - 17
pages/workbench/index.vue

@@ -1,21 +1,5 @@
 <template>
 	<view class="workbench-page">
-		<!-- <view class="section white-wrap" @click="handleGoNext('custome')">
-			<image src="../../static/icon-1.png" mode="aspectFill" class="icon"></image>
-			<view class="label">客户审批</view>
-		</view>
-		<view class="section white-wrap" @click="handleGoNext('contract')">
-			<image src="../../static/icon-2.png" mode="aspectFill" class="icon"></image>
-			<view class="label">合同审批</view>
-		</view>
-		<view class="section white-wrap" @click="handleGoNext('seal')">
-			<image src="../../static/icon-3.png" mode="aspectFill" class="icon"></image>
-			<view class="label">用印审批</view>
-		</view>
-		<view class="section white-wrap" @click="handleGoNext('activity')">
-			<image src="../../static/icon-4.png" mode="aspectFill" class="icon"></image>
-			<view class="label">活动审批</view>
-		</view> -->
 
 		<view class="section white-wrap" v-for="item in tabs" :key="item.label">
 			<view class="tab-title">{{item.label}}</view>
@@ -75,7 +59,22 @@
 								img: require('@/static/icon-6.png')
 							}
 						]
-					}
+					},
+               {
+               	label: '问答社区',
+               	child: [
+               		{
+               			label: '分配提问',
+               			url: '/pages-question/detail/index?type=question',
+               			img: require('@/static/icon-question.png')
+               		},
+               		{
+               			label: '评论管理',
+               			url: '/pages-question/detail/index?type=comment',
+               			img: require('@/static/icon-comment.png')
+               		}
+               	]
+               }
 				]
 			}
 		},

BIN
static/icon-comment.png


BIN
static/icon-question.png