123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <template>
- <view class="categoryOne">
- <view class="body" v-if="dataInfo.list.length">
- <view class="body_item" v-for="data in dataInfo.list" :key="data.id">
- <view @click="toCategoryTwo(data)">
- <view class="title">{{data.title}}</view>
- <view class="content">
- <view v-html="data.content"></view>
- </view>
- <view class="sign">
- <view>引入次数:{{data.introduceCount || 0}}</view>
- <view>{{data.createtime}}</view>
- </view>
- </view>
- <view class="btn-style">
- <button @click.stop="importData(data)" type="default" class="primaryButton btn">引入</button>
- </view>
- </view>
- <view class="back-style" @click="goBack">
- <text class="newicon newicon-fanhui1"></text>
- </view>
- </view>
- <view class="zanwu" v-else>
- <text class="newicon newicon-zanwu"></text>
- </view>
- <view v-if="dataInfo.list.length==0" class="btn-view">
- <button @click="goBack" type="default" class="primaryButton btn">返回</button>
- </view>
- </view>
- </template>
- <script setup>
- import { ref, reactive} from 'vue'
- import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
- import { api_getSolution } from "@/http/api.js"
- import { useSetTitle } from '@/share/useSetTitle.js'
- import { useGoBack } from '@/share/useGoBack.js'
- import { useHandlerStore } from '@/stores/handler'
-
- useSetTitle();
-
- const handlerStore = useHandlerStore();
-
- const { goBack } = useGoBack();
-
-
-
-
-
- const introduceCount = ref(0)
-
-
-
-
-
- const dataInfo = reactive({
- list: [],
- idx: 0,
- hasMore: true,
- incidentId: undefined,
- })
-
-
- function toCategoryTwo(data){
- uni.navigateTo({
- url: `/pages/repositoryDetails/repositoryDetails?incidentId=${dataInfo.incidentId}
- &solutionnumber=${data.solutionnumber}`
- })
- }
-
-
- function importData(data){
- let url = null
- let type = handlerStore.handler.data.operateType
- let storeInfo = handlerStore.handler.data
- storeInfo.introduceCount = introduceCount.value
- storeInfo.handleDescription = data.content
- storeInfo.solutionId = data.id
- storeInfo.type = 'rep'
- storeInfo.isSummaryNext = 1
- handlerStore.setHandlerData(storeInfo,'assign', 'assign')
- if(type=='malfunction'){
- url = '/pages/handler/handler'
- }else if(type=='reissue'){
- url = '/pages/assign/assign'
- }
- uni.navigateTo({
- url: url
- })
- }
-
-
- function getList(idx){
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
-
- dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
- if(dataInfo.idx === 0){
- dataInfo.list = [];
- }
- console.log(777,handlerStore.handler.data)
- let postData = {
- idx: dataInfo.idx,
- sum: 9999,
- solution: {
- category:{
- id:handlerStore.handler.data.category.id,
- },
- status:{id:72},
- }
- }
-
- api_getSolution(postData).then(res => {
- uni.hideLoading();
-
- if(res.status == 200){
- let list = res.list || [];
- introduceCount.value = res.totalNum
- dataInfo.list = list
-
-
-
-
-
-
- }else{
- uni.showToast({
- icon: 'none',
- title: res.msg || '请求数据失败!'
- });
- }
- })
- }
-
- onLoad((option) => {
- dataInfo.incidentId = option.incidentId;
- getList(0);
- })
-
- onPullDownRefresh(() => {
-
- })
-
- onReachBottom(() => {
-
-
-
-
- })
- </script>
- <style lang="scss" scoped>
- .categoryOne{
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .head{
- height: 88rpx;
- display: flex;
- align-items: center;
- padding: 0 24rpx;
- position: fixed;
- z-index: 99;
- width: 100%;
- box-sizing: border-box;
- background: #fff;
- font-size: 26rpx;
- color: $uni-primary;
- }
- .body{
- font-size: 30rpx;
- .body_item{
- border-bottom: 8rpx solid #DEDEDE;
- .title{
- font-weight: 600;
- padding: 24rpx;
- border-bottom: 1rpx solid #DEDEDE;
- }
- .content{
- color: #6A6A6A;
- font-size: 24rpx;
- padding: 24rpx;
- border-bottom: 1rpx solid #DEDEDE;
- view{
- display: -webkit-box;
- overflow: hidden;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- text-overflow: ellipsis;
- white-space: initial;
- }
- }
- .sign{
- display: flex;
- justify-content: space-between;
- padding: 24rpx 24rpx 0 24rpx;
- font-size: 26rpx;
- }
- .btn-style{
- padding: 24rpx;
- }
- }
- }
- .zanwu{
- margin-bottom: 140rpx;
- margin-top: 88rpx;
- display: flex;
- justify-content: center;
- .newicon-zanwu{
- font-size: 256rpx;
- color: #D6D6D6;
- margin-top: 140rpx;
- }
- }
- .foot_common_btns{
- position: fixed;
- left: 0;
- bottom: 0;
- background-color: #fff;
- }
- .btn-view{
- position: fixed;
- bottom: 40rpx;
- width: 93.5%;
- padding: 24rpx 0 0 24rpx;
- }
- .back-style{
- background: #D6D6D6;
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- position: fixed;
- right: 30rpx;
- bottom: 30rpx;
- text{
- font-size: 50rpx;
- color: #fff;
- }
- }
- }
- </style>
|