Browse Source

禅道上0816问题的修改

taidong
duanliangtao 1 year ago
parent
commit
11357db235
  1. 33
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  2. 60
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml
  3. 23
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss
  4. 17
      subpages/myTroubleshootDemand/pages/index/index.js
  5. 2
      subpages/myTroubleshootDemand/pages/index/index.wxss

33
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -18,6 +18,7 @@ Page({
*/ */
data: { data: {
optionsId: '', optionsId: '',
isDisabled: false, // 默认不禁用
defaultMeasureNames: { defaultMeasureNames: {
label: 'categoryName', label: 'categoryName',
value: 'categoryCode', value: 'categoryCode',
@ -33,11 +34,12 @@ Page({
happenTime: "", happenTime: "",
content: "", //内容 content: "", //内容
address: "", //地址 address: "", //地址
demandType:'chengguan'
}, },
minDate: '2018-01-01 00:00:00', minDate: '2018-01-01 00:00:00',
tabVal: "0", tabVal: '2',
ruTabVal: "yes", ruTabVal: 'yes',
uploadImageList: [], //图片上传的数组 uploadImageList: [], //图片上传的数组
streetList: [], // 街道 streetList: [], // 街道
imageId: 1, imageId: 1,
@ -86,7 +88,8 @@ Page({
reportTypeVisible: false, reportTypeVisible: false,
categoryIds:'', categoryIds:'',
processData: [] processData: [],
}, },
/** /**
@ -109,7 +112,8 @@ Page({
} }
this.setData({ this.setData({
tabVal: options.type || 0, tabVal: options.type || 0,
optionsId: options.id optionsId: options.id,
isDisabled:true
}) })
return return
} }
@ -187,7 +191,8 @@ Page({
})) : [], })) : [],
uploadRecord: res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0] : null, uploadRecord: res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0] : null,
totalTime: this.format(res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0].duration : 0), totalTime: this.format(res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0].duration : 0),
categoryIds:res.data.parentCategoryId+","+res.data.categoryId categoryIds:res.data.parentCategoryId+","+res.data.categoryId,
ruTabVal:res.data.responsibleUnit
}) })
if (this.data.uploadRecord) { if (this.data.uploadRecord) {
this.downLoadAudio() this.downLoadAudio()
@ -227,7 +232,14 @@ formatTimestamp(timestamp) {
return `${year}-${month}-${day} ${hour}:${minute}:${second}`; return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}, },
update() { update() {
this.submitPersonalInfo() if(this.data.isDisabled){// 由不可编辑变为可编辑
this.setData({
isDisabled: false
})
}else{
this.submitPersonalInfo()
}
}, },
updateMeasure() { updateMeasure() {
this.setData({ this.setData({
@ -1742,13 +1754,10 @@ formatTimestamp(timestamp) {
}, },
previewImage(e) { previewImage(e) {
const currentUrl = e.currentTarget.dataset.url; const currentUrl = e.currentTarget.dataset.url;
const urls = this.data.item.internalFile
.filter(file => file.attachmentType === 'image')
.map(file => file.attachmentUrl);
wx.previewImage({ wx.previewImage({
current: currentUrl, // 当前显示图片的http链接 current: currentUrl, // 当前显示的图片链接
urls: urls // 需要预览的图片http链接列表 urls: [currentUrl] // 只预览当前点击的图片
}); });
}, },
downloadFile: function (event) { downloadFile: function (event) {

60
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml

@ -1,6 +1,6 @@
<view class="complete-info" > <view class="complete-info" >
<block > <block >
<view class="content"> <view class="content {{isDisabled ? 'disabled' : ''}}">
<view class="personal-info"> <view class="personal-info">
<view class="basic-info"> <view class="basic-info">
@ -170,7 +170,7 @@
</view> </view>
<view class="item" wx:if="{{(tabVal === '2' && ruTabVal=== 'yes') || fmData.demandType==='chengguan'}}"> <view class="item" wx:if="{{tabVal === '2' && ruTabVal=== 'yes' && fmData.demandType==='chengguan'}}">
<view class="field"> <view class="field">
<text class="must">*</text> <text class="must">*</text>
<view class="field-text">责任人</view> <view class="field-text">责任人</view>
@ -180,7 +180,7 @@
</view> </view>
</view> </view>
<view class="item" wx:if="{{(tabVal === '2' && ruTabVal=== 'yes') || fmData.demandType==='chengguan'}}"> <view class="item" wx:if="{{tabVal === '2' && ruTabVal=== 'yes' && fmData.demandType==='chengguan'}}">
<view class="field"> <view class="field">
<text class="must">*</text> <text class="must">*</text>
<view class="field-text">责任人电话</view> <view class="field-text">责任人电话</view>
@ -224,7 +224,7 @@
{{ item.publicReply }} {{ item.publicReply }}
</view> </view>
</view> </view>
<view class="card_content"> <view class="card_content" wx:if="{{item.timeLimit && item.timeLimit!='null'}}">
<view class="label1">办结时限:</view> <view class="label1">办结时限:</view>
<view class="value1"> <view class="value1">
{{ item.limitTime }} {{ item.limitTime }}
@ -233,18 +233,13 @@
<view class="card_content" wx:if="{{item.internalFile.length > 0}}"> <view class="card_content" wx:if="{{item.internalFile.length > 0}}">
<view class="label1">附件:</view> <view class="label1">附件:</view>
<view class="value1"> <view class="value1">
<block wx:for="{{item.internalFile}}" wx:key="*this"> <view class="image-row">
<view wx:if="{{item.attachmentType === 'image'}}"> <block wx:for="{{item.internalFile}}" wx:key="*this">
<view class="image-row"> <view wx:if="{{item.attachmentType === 'image'}}">
<image src="{{item.attachmentUrl}}" mode="aspectFill" bindtap="previewImage" data-url="{{item.attachmentUrl}}" /> <image src="{{item.attachmentUrl}}" mode="aspectFill" bindtap="previewImage" data-url="{{item.attachmentUrl}}" />
</view> </view>
</view> </block>
<!-- <view wx:else> </view>
<navigator url="{{item.attachmentUrl}}" open-type="navigateTo" class="download-link">
下载附件
</navigator>
</view> -->
</block>
</view> </view>
</view> </view>
</view> </view>
@ -261,7 +256,7 @@
{{ item.publicReply }} {{ item.publicReply }}
</view> </view>
</view> </view>
<view class="card_content" wx:if="{{item.timeLimit}}"> <view class="card_content" wx:if="{{item.timeLimit && item.timeLimit!='null'}}">
<view class="label1">办结时限:</view> <view class="label1">办结时限:</view>
<view class="value1"> <view class="value1">
{{ item.limitTime }} {{ item.limitTime }}
@ -271,18 +266,18 @@
<view class="card_content" wx:if="{{item.internalFile.length > 0}}"> <view class="card_content" wx:if="{{item.internalFile.length > 0}}">
<view class="label1">附件:</view> <view class="label1">附件:</view>
<view class="value1"> <view class="value1">
<block wx:for="{{item.internalFile}}" wx:key="*this"> <view class="image-row">
<view wx:if="{{item.attachmentType === 'image'}}"> <block wx:for="{{item.internalFile}}" wx:key="*this">
<view class="image-row"> <view wx:if="{{item.attachmentType === 'image'}}">
<image src="{{item.attachmentUrl}}" mode="aspectFill" bindtap="previewImage" data-url="{{item.attachmentUrl}}" /> <image src="{{item.attachmentUrl}}" mode="aspectFill" bindtap="previewImage" data-url="{{item.attachmentUrl}}" />
</view> </view>
</view> <view wx:else>
<view wx:else> <navigator url="{{item.attachmentUrl}}" data-url="{{item.attachmentUrl}}" bindtap="downloadFile" open-type="navigateTo" class="download-link">
<navigator url="{{item.attachmentUrl}}" data-url="{{item.attachmentUrl}}" bindtap="downloadFile" open-type="navigateTo" class="download-link"> 下载附件
下载附件 </navigator>
</navigator> </view>
</view> </block>
</block> </view>
</view> </view>
</view> </view>
</view> </view>
@ -294,15 +289,18 @@
</view> </view>
<view class="submit-button" wx:if="{{!optionsId}}"> <view class="submit-button" wx:if="{{!optionsId}}">
<button disabled="{{ submitDisabled }}" bindtap="submitPersonalInfo" hover-class="hover-submit" >提交</button> <button disabled="{{ submitDisabled }}" bindtap="submitPersonalInfo" hover-class="hover-submit" >提交</button>
</view> </view>
<view class="bto_btn" wx:else>
<button hover-class="btn-hover" bind:tap="update" class="btn_blue" >修改</button>
<button bind:tap="delete" class="btn_yellow">删除</button>
<button bind:tap="process" class="btn_red" wx:if="{{tabVal === '0' || tabVal === '2'}}">处理</button>
</view>
</view> </view>
<view class="bto_btn" wx:if="{{optionsId}}">
<button hover-class="btn-hover" bind:tap="update" class="btn_blue" >{{isDisabled ? '修改' : '提交'}}</button>
<button bind:tap="delete" class="btn_yellow">删除</button>
<button bind:tap="process" class="btn_red" wx:if="{{tabVal === '0' || tabVal === '2'}}">处理</button>
</view>
</block> </block>
</view> </view>
<view class="sheet-bg" wx:if="{{showRecord}}"></view> <view class="sheet-bg" wx:if="{{showRecord}}"></view>

23
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss

@ -18,6 +18,8 @@ page {
.content { .content {
width: 100%; width: 100%;
min-height: calc(100vh - 100rpx); min-height: calc(100vh - 100rpx);
margin-bottom: 50rpx;
/* max-height: calc(100vh - 20rpx); */
} }
.content-list { .content-list {
@ -1023,7 +1025,7 @@ background: rgb(175, 1, 1);
justify-content: space-between; justify-content: space-between;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
position: fixed; position: fixed;
bottom: 50rpx; /* 调整为20rpx,距离底部20rpx */ bottom: 0rpx; /* 调整为20rpx,距离底部20rpx */
left: 0; left: 0;
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
@ -1128,13 +1130,20 @@ background: rgb(175, 1, 1);
.image-row { .image-row {
display: flex; display: flex;
justify-content: space-between; flex-wrap: nowrap; /* 防止换行 */
align-items: center; /* 保证图片垂直居中 */ overflow-x: auto; /* 当图片超出一行时,可以横向滚动 */
align-items: center;
} }
.image-row image { .image-row image {
flex: 1; flex: 0 0 auto; /* 防止图片缩放 */
margin: 0 5px; /* 控制图片之间的间距 */ margin: 0 5px; /* 控制图片之间的间距 */
max-width: 100%; /* 防止图片过大 */ width: 80px; /* 固定宽度,可根据需要调整 */
max-height: 150px; /* 设置图片最大高度 */ height: 80px; /* 固定高度,可根据需要调整 */
object-fit: cover; /* 保持图片比例 */ object-fit: cover; /* 保持图片比例 */
} border: 2px solid #ccc; /* 添加边框,颜色为浅灰色 */
border-radius: 5px; /* 圆角边框,可根据需要调整 */
}
.disabled {
pointer-events: none; /* 禁止点击 */
}

17
subpages/myTroubleshootDemand/pages/index/index.js

@ -43,12 +43,17 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
// this.setData({ this.setData({
// pageNo:1, pageNo:1,
// tableData:[], tableData:[],
// tableData1:[] tableData1:[]
// }) })
// this.getMyWaitTroubleshootDemandList() console.log("页面重新onShow。。。。。。。。")
if(this.data.active==0){
this.getMyWaitTroubleshootDemandList()
}else{
this.getMyTroubleshootDemandList()
}
}, },
/** /**

2
subpages/myTroubleshootDemand/pages/index/index.wxss

@ -70,7 +70,7 @@ page {
height: 180rpx; height: 180rpx;
flex-direction: column; flex-direction: column;
border-radius: 20rpx; border-radius: 20rpx;
padding: 30rpx 30rpx; padding: 20rpx 30rpx;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;

Loading…
Cancel
Save