fix:增加风险池、系统调整
This commit is contained in:
parent
720cd6e8c3
commit
d8961f19a8
4
app.js
4
app.js
|
|
@ -51,8 +51,8 @@ App({
|
||||||
versionCode: 'V1',
|
versionCode: 'V1',
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
// headerUrl: "http://42.193.40.239:8017/" //线上
|
// headerUrl: "http://42.193.40.239:8017/" //线上
|
||||||
// headerUrl: "http://192.168.110.10:8017/" //线下
|
headerUrl: "http://192.168.110.186:8017/" //线下
|
||||||
headerUrl: "https://city.sczysoft.com/df/"
|
// headerUrl: "https://city.sczysoft.com/df/"
|
||||||
},
|
},
|
||||||
// https://city.sczysoft.com/df/doc.html //接口
|
// https://city.sczysoft.com/df/doc.html //接口
|
||||||
// https://city.sczysoft.com/dffile //查看拼接
|
// https://city.sczysoft.com/dffile //查看拼接
|
||||||
|
|
|
||||||
9
app.json
9
app.json
|
|
@ -33,7 +33,9 @@
|
||||||
"pages/emergency/s-b/escalation/index",
|
"pages/emergency/s-b/escalation/index",
|
||||||
"pages/agreement/index",
|
"pages/agreement/index",
|
||||||
"pages/emergency/t-x-l/index/index",
|
"pages/emergency/t-x-l/index/index",
|
||||||
"pages/statistic/j-b-x-x/detail/index"
|
"pages/statistic/j-b-x-x/detail/index",
|
||||||
|
"pages/risk-pool/index",
|
||||||
|
"pages/risk-pool/add-pool/index"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"backgroundTextStyle": "light",
|
"backgroundTextStyle": "light",
|
||||||
|
|
@ -48,7 +50,10 @@
|
||||||
"title-bar": "/components/title-bar/index",
|
"title-bar": "/components/title-bar/index",
|
||||||
"tree-node": "components/tree-node/index"
|
"tree-node": "components/tree-node/index"
|
||||||
},
|
},
|
||||||
"requiredPrivateInfos": ["getLocation","chooseLocation"],
|
"requiredPrivateInfos": [
|
||||||
|
"getLocation",
|
||||||
|
"chooseLocation"
|
||||||
|
],
|
||||||
"permission": {
|
"permission": {
|
||||||
"scope.userLocation": {
|
"scope.userLocation": {
|
||||||
"desc": "你的位置信息将用于记录检查佐证"
|
"desc": "你的位置信息将用于记录检查佐证"
|
||||||
|
|
|
||||||
BIN
images/home/icon_w_5.png
Normal file
BIN
images/home/icon_w_5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -104,6 +104,11 @@ Page({
|
||||||
name: "有事找党员",
|
name: "有事找党员",
|
||||||
href: "/pages/party-member/index/index"
|
href: "/pages/party-member/index/index"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: "icon_w_5",
|
||||||
|
name: "风险池",
|
||||||
|
href: "/pages/risk-pool/index"
|
||||||
|
},
|
||||||
],
|
],
|
||||||
// 应急指挥
|
// 应急指挥
|
||||||
tab3: [{
|
tab3: [{
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
<view class="v-div" catchtap="toSkip" data-url="/pages/account/info/index">
|
<view class="v-div" catchtap="toSkip" data-url="/pages/account/info/index">
|
||||||
<text class="name">{{userInfo.chinaName}}</text>
|
<text class="name">{{userInfo.chinaName}}</text>
|
||||||
<text class="point">{{userInfo.postName}}</text>
|
<text class="point">{{userInfo.postName}}</text>
|
||||||
|
<text class="title-text point">道孚县“智慧鲜水”数字化平台</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 消息 -->
|
<!-- 消息 -->
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,10 @@
|
||||||
width: 90%;
|
width: 90%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
.title-text {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
.top {
|
.top {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 380rpx;
|
height: 380rpx;
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ Page({
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
// username: 'admin',
|
username: 'admin',
|
||||||
// password: 'Daofu123456',
|
password: 'Daofu123456',
|
||||||
username: '',
|
// username: '',
|
||||||
password: '',
|
// password: '',
|
||||||
showLogin: true,
|
showLogin: true,
|
||||||
newname:'',
|
newname:'',
|
||||||
newphone:'',
|
newphone:'',
|
||||||
|
|
|
||||||
310
pages/risk-pool/add-pool/index.js
Normal file
310
pages/risk-pool/add-pool/index.js
Normal file
|
|
@ -0,0 +1,310 @@
|
||||||
|
// 上报动态
|
||||||
|
import Utils from "../../../utils/util"
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
topBarH: app.globalData.CustomBar,
|
||||||
|
baseUrl: app.FILE_SERVER_URL,
|
||||||
|
|
||||||
|
dateFilter: Utils.formatTime(new Date(), '-'),
|
||||||
|
showTypePop: false,
|
||||||
|
showAdvicePop: false,
|
||||||
|
TypeData: [],
|
||||||
|
postData: {},
|
||||||
|
files: [],
|
||||||
|
userInfo:{},
|
||||||
|
targetId:'',
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示/关闭弹窗
|
||||||
|
*/
|
||||||
|
popModal: function (params) {
|
||||||
|
const type = params.currentTarget.dataset.type;
|
||||||
|
this.data[type] = !this.data[type];
|
||||||
|
this.setData(this.data)
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
typeChange: function (params) {
|
||||||
|
const index = params.currentTarget.dataset.index;
|
||||||
|
this.data.postData.typeId = params.currentTarget.dataset.item.typeId;
|
||||||
|
this.data.postData.type = index + 1;
|
||||||
|
this.data.showTypePop = false;
|
||||||
|
this.setData(this.data);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输入框赋值
|
||||||
|
*/
|
||||||
|
inputContent: function (e) {
|
||||||
|
const name = e.currentTarget.dataset.name;
|
||||||
|
this.data.postData[name] = e.detail.value;
|
||||||
|
this.setData(this.data);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布
|
||||||
|
*/
|
||||||
|
push: function () {
|
||||||
|
if (!this.data.postData.title) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请输入标题',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.data.postData.startTime) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请选择开始时间',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.data.postData.endTime) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请选择结束时间',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.data.postData.detail) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请输入动态内容',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.data.postData.typeId) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '请选择类型',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
...this.data.postData,
|
||||||
|
dynamicsId:this.data.uuid,
|
||||||
|
userId:this.data.userInfo.userId,
|
||||||
|
targetId:this.data.targetId
|
||||||
|
};
|
||||||
|
app.axios("POST", "app", `/work/wkDynamicsAdd`,data).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '发布成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.navigateBack()
|
||||||
|
}, 1500);
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择文件
|
||||||
|
*/
|
||||||
|
chooseFile: function () {
|
||||||
|
wx.chooseImage({
|
||||||
|
count: 1,
|
||||||
|
type: 'all',
|
||||||
|
success: (res) => {
|
||||||
|
const tempFilePaths = res.tempFiles;
|
||||||
|
const path = tempFilePaths[0].path;
|
||||||
|
this.postImg(path)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传图片
|
||||||
|
*/
|
||||||
|
postImg(filePath) {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '文件上传中...',
|
||||||
|
})
|
||||||
|
app.uploadFile(this.data.uuid, app.FileType.resumptionAcs, filePath).then(res => {
|
||||||
|
wx.hideLoading();
|
||||||
|
this.getFiles();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图片
|
||||||
|
*/
|
||||||
|
getFiles: function () {
|
||||||
|
app.axios("GET", "common", "/upload/getFile", {
|
||||||
|
otcid: this.data.postData.emerEventId || this.data.uuid,
|
||||||
|
otctype: app.FileType.resumptionAcs
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
this.data.files = res.data;
|
||||||
|
this.setData(this.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图片
|
||||||
|
* @param {*} params
|
||||||
|
*/
|
||||||
|
deleteFile: function (e) {
|
||||||
|
var id = e.currentTarget.dataset.id;
|
||||||
|
wx.showModal({
|
||||||
|
title: '删除提示',
|
||||||
|
content: '是否要删除该附件?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
app.axios("GET", 'common', "/upload/delFile", {
|
||||||
|
documentId: id,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
this.getFiles();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
filePre: function (params) {
|
||||||
|
const url = params.currentTarget.dataset.url;
|
||||||
|
const imgs = [];
|
||||||
|
this.data.files.forEach(item => {
|
||||||
|
imgs.push(this.data.baseUrl + item.filepath)
|
||||||
|
})
|
||||||
|
wx.previewImage({
|
||||||
|
urls: imgs,
|
||||||
|
current: this.data.baseUrl + url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
bindDateChange: function (params) {
|
||||||
|
this.data.postData.startTime = params.detail.value;
|
||||||
|
this.setData(this.data)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
bindendTimeChange: function (params) {
|
||||||
|
this.data.postData.endTime = params.detail.value;
|
||||||
|
this.setData(this.data)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 查询所有类型
|
||||||
|
*/
|
||||||
|
getEmerEventType: function () {
|
||||||
|
app.axios("GET", "app", "/work/wkTypes",{classify:2}).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
this.data.TypeData = res.data;
|
||||||
|
this.setData(this.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看应急上报事件详情
|
||||||
|
*/
|
||||||
|
getEmerEventDetail: function (id) {
|
||||||
|
app.axios("GET", "app", `/emerEvent/emerEventDetail/${id}`).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
this.data.postData = res.data;
|
||||||
|
this.data.postData.emerTypeName;
|
||||||
|
for (let index = 0; index < this.data.TypeData.length; index++) {
|
||||||
|
if (this.data.TypeData[index].emerTypeName == res.data.emerTypeName) {
|
||||||
|
this.data.postData.type = index+1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.setData(this.data);
|
||||||
|
this.getFiles();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.data.uuid = Utils.uuid();
|
||||||
|
this.data.userInfo = app.globalData.userInfo;
|
||||||
|
this.data.targetId = options.id
|
||||||
|
this.setData(this.data);
|
||||||
|
this.getEmerEventType();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
6
pages/risk-pool/add-pool/index.json
Normal file
6
pages/risk-pool/add-pool/index.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"tree": "/components/tree/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
77
pages/risk-pool/add-pool/index.wxml
Normal file
77
pages/risk-pool/add-pool/index.wxml
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
<!--pages/msg/push/index.wxml-->
|
||||||
|
<title-bar title="工作动态"></title-bar>
|
||||||
|
<scroll-view scroll-y refresher-enabled style="height: calc(100vh - {{topBarH}}px);">
|
||||||
|
<view class="item">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<view class="h-div v-center header">
|
||||||
|
<text class="single"></text>
|
||||||
|
<text class="title">动态标题</text>
|
||||||
|
</view>
|
||||||
|
<input bindinput="inputContent" data-name="title" class="put v-div h-center" placeholder="请输入标题" value="{{postData.title}}"></input>
|
||||||
|
<!-- 时间 -->
|
||||||
|
<view class="h-div v-center header">
|
||||||
|
<text class="single"></text>
|
||||||
|
<text class="title">开始时间</text>
|
||||||
|
</view>
|
||||||
|
<picker mode="date" value="{{postData.startTime}}" bindchange="bindDateChange">
|
||||||
|
<input disabled class="put v-div h-center" placeholder="请选择" value="{{postData.startTime}}"></input>
|
||||||
|
</picker>
|
||||||
|
<view class="h-div v-center header">
|
||||||
|
<text class="single"></text>
|
||||||
|
<text class="title">结束时间</text>
|
||||||
|
</view>
|
||||||
|
<picker mode="date" value="{{postData.endTime}}" bindchange="bindendTimeChange">
|
||||||
|
<input disabled class="put v-div h-center" placeholder="请选择" value="{{postData.endTime}}"></input>
|
||||||
|
</picker>
|
||||||
|
<!-- 类型 -->
|
||||||
|
<view class="h-div v-center header">
|
||||||
|
<text class="single"></text>
|
||||||
|
<text class="title">类型</text>
|
||||||
|
</view>
|
||||||
|
<input catchtap="popModal" data-type="showTypePop" disabled class="put v-div h-center" placeholder="请选择" value="{{TypeData[postData.type-1].typeName}}"></input>
|
||||||
|
|
||||||
|
<!-- 内容 -->
|
||||||
|
<view class="h-div v-center header">
|
||||||
|
<text class="single"></text>
|
||||||
|
<text class="title">动态内容</text>
|
||||||
|
</view>
|
||||||
|
<textarea bindinput="inputContent" data-name="detail" value="{{postData.detail}}" style="color: #333333;" class="put v-div" placeholder="请输入工作内容"></textarea>
|
||||||
|
<!-- 附件 -->
|
||||||
|
<view class="h-div v-center header">
|
||||||
|
<text class="single"></text>
|
||||||
|
<text class="title flex">工作附件</text>
|
||||||
|
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
||||||
|
</view>
|
||||||
|
<view class="grid">
|
||||||
|
<view class="img" wx:for="{{files}}" style="position: relative;">
|
||||||
|
<text wx:if="{{!postData.emerEventId}}" catchtap="deleteFile" data-id="{{item.sysdocumentid}}" class="cuIcon-delete del" style="color:red;"></text>
|
||||||
|
<image class="img" src="{{baseUrl+item.filepath}}" catchtap="filePre" data-url="{{item.filepath}}" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="space"></view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="option" wx:if="{{!postData.emerEventId}}">
|
||||||
|
<view catchtap="push" class="btn">上报</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 选择类型 -->
|
||||||
|
<view class="cu-modal {{showTypePop?'show':''}}">
|
||||||
|
<view class="cu-dialog pop" catchtap>
|
||||||
|
<view class="cu-bar justify-end pop-header">
|
||||||
|
<view class="content">选择动态类型</view>
|
||||||
|
<view class="action" catchtap="popModal" data-type="showTypePop">
|
||||||
|
<text class="cuIcon-close text-red"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<radio-group class="block" style="max-height: 50vh;overflow-y: scroll;">
|
||||||
|
<view class="cu-list menu text-left">
|
||||||
|
<view class="cu-item" wx:for="{{TypeData}}" wx:key>
|
||||||
|
<label catchtap="typeChange" data-item="{{item}}" data-index="{{index}}" class="flex justify-between align-center flex-sub">
|
||||||
|
<view class="flex-sub">{{item.typeName}}</view>
|
||||||
|
</label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
123
pages/risk-pool/add-pool/index.wxss
Normal file
123
pages/risk-pool/add-pool/index.wxss
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
/* pages/msg/push/index.wxss */
|
||||||
|
scroll-view {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter {
|
||||||
|
margin: 0 10rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter picker {
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin: 32rpx 20rpx 20rpx 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .header {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .header .single {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
background: #4882EE;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .header .title {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .put {
|
||||||
|
width: 100%;
|
||||||
|
background: #F5F7FC;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
min-height: 72rpx;
|
||||||
|
padding: 15rpx;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
display: grid;
|
||||||
|
grid-gap: 20rpx 20rpx;
|
||||||
|
grid-template-columns: calc((100vw - 140rpx)/3) auto auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid .img {
|
||||||
|
width: calc((100vw - 140rpx)/3);
|
||||||
|
height: calc((100vw - 140rpx)/3);
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid .del {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option {
|
||||||
|
position: fixed;
|
||||||
|
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
|
||||||
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding: 16rpx 32rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option .btn {
|
||||||
|
padding: 14rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #409CFF;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option .btn:active {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.space {
|
||||||
|
height: calc(constant(safe-area-inset-bottom) + 150rpx);
|
||||||
|
height: calc(env(safe-area-inset-bottom) + 150rpx);
|
||||||
|
}
|
||||||
|
.picker1{
|
||||||
|
width: 100%;
|
||||||
|
background: #F5F7FC;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
min-height: 72rpx;
|
||||||
|
padding: 15rpx;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
156
pages/risk-pool/index.js
Normal file
156
pages/risk-pool/index.js
Normal file
|
|
@ -0,0 +1,156 @@
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
topBarH: app.globalData.CustomBar,
|
||||||
|
list: [],
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
userInfo:{},
|
||||||
|
condition:'',
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 上拉刷新
|
||||||
|
*/
|
||||||
|
refresh: function () {
|
||||||
|
this.data.page = 1;
|
||||||
|
this.data.list = [];
|
||||||
|
this.setData(this.data);
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉加载
|
||||||
|
*/
|
||||||
|
dropDown: function (params) {
|
||||||
|
this.data.page = this.data.page+1;
|
||||||
|
this.setData(this.data);
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 输入内容
|
||||||
|
*/
|
||||||
|
inputContent: function (e) {
|
||||||
|
const name = e.currentTarget.dataset.name;
|
||||||
|
this.data[name] = e.detail.value;
|
||||||
|
this.refresh();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 上报困难诉求
|
||||||
|
*/
|
||||||
|
push: function (params) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/risk-pool/add-pool/index`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addpush: function (params) {
|
||||||
|
let poolId = params.currentTarget.dataset.item.poolId
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/risk-pool/add-pool/index?id=${poolId}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工困难诉求列表
|
||||||
|
*/
|
||||||
|
getList: function () {
|
||||||
|
let params = {
|
||||||
|
limit:this.data.pageSize,
|
||||||
|
page:this.data.page,
|
||||||
|
endTime:this.data.endTime,
|
||||||
|
startTime:this.data.startTime,
|
||||||
|
userId:this.data.userInfo.userId,
|
||||||
|
condition:this.data.condition
|
||||||
|
};
|
||||||
|
app.axios("GET", "app", `/risk/riskPoolPage`, params).then(res => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
this.data.freshIng = false;
|
||||||
|
this.data.list = [...this.data.list,...res.data.list];
|
||||||
|
this.setData(this.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 查看详情
|
||||||
|
*/
|
||||||
|
// toDetail: function (params) {
|
||||||
|
// wx.navigateTo({
|
||||||
|
// url: `/pages/emergency/s-b/escalation/index?emerEventId=${params.currentTarget.dataset.item.emerEventId}`,
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.data.freshIng = true;
|
||||||
|
this.data.userInfo = app.globalData.userInfo;
|
||||||
|
this.setData(this.data);
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom(data) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
4
pages/risk-pool/index.json
Normal file
4
pages/risk-pool/index.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
31
pages/risk-pool/index.wxml
Normal file
31
pages/risk-pool/index.wxml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<!--pages/emergency/s-b/index1/index.wxml-->
|
||||||
|
<title-bar title="风险池"></title-bar>
|
||||||
|
<scroll-view scroll-y style="height: calc(100vh - {{topBarH}}px);" refresher-enabled bindrefresherrefresh="refresh" bindscrolltolower="dropDown" refresher-triggered="{{freshIng}}">
|
||||||
|
<view class="content">
|
||||||
|
<view class="cu-bar search">
|
||||||
|
<view class="search-form round">
|
||||||
|
<text class="cuIcon-search"></text>
|
||||||
|
<input bindinput="inputContent" data-name="condition" type="text" placeholder="请输入关键字" confirm-type="search"></input>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<view catchtap="toDetail" data-item="{{item}}" class="item h-div" wx:for="{{list}}">
|
||||||
|
<view class="content">
|
||||||
|
<view class="title">名称:{{item.name}}</view>
|
||||||
|
<view class="time">类型:{{item.typeName}}</view>
|
||||||
|
<view class="time">地址:{{item.address}}</view>
|
||||||
|
<view class="time">风险状态:
|
||||||
|
<text wx:if="{{item.poolState === 1}}">正常</text>
|
||||||
|
<text wx:else style="color: red;">超时未检查</text>
|
||||||
|
</view>
|
||||||
|
<view class="time">检查时间:{{item.checkTime}}</view>
|
||||||
|
<view class="time">下次检查时间:{{item.nextTime}}</view>
|
||||||
|
</view>
|
||||||
|
<view catchtap="addpush" data-item="{{item}}" class="addbtn">新增动态>></view>
|
||||||
|
</view>
|
||||||
|
<view class="space"></view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<!-- <view class="option">
|
||||||
|
<view catchtap="push" class="btn">新增动态</view>
|
||||||
|
</view> -->
|
||||||
191
pages/risk-pool/index.wxss
Normal file
191
pages/risk-pool/index.wxss
Normal file
|
|
@ -0,0 +1,191 @@
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content .filter {
|
||||||
|
margin: 0 10rpx;
|
||||||
|
width: calc(100vw - 20rpx);
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content .filter picker {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content .item {
|
||||||
|
background-color: #ffffff;
|
||||||
|
box-shadow: 0px 0px 6px 1px #DDECF3;
|
||||||
|
margin: 16rpx 16rpx 0 16rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content .item .val::before {
|
||||||
|
display: inline-block;
|
||||||
|
content: '';
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content .item .val {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.item .content {
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
padding: 32rpx 20rpx 20rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .content .time::before {
|
||||||
|
display: inline-block;
|
||||||
|
content: '';
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .content .title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .content .des {
|
||||||
|
margin: 10rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .content .time {
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .content .title::before {
|
||||||
|
display: inline-block;
|
||||||
|
content: '';
|
||||||
|
width: 10rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
background-color: var(--blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .content .des {
|
||||||
|
font-size: 30rpx;
|
||||||
|
display: -webkit-box;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .val {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #222222;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .add {
|
||||||
|
color: var(--blue);
|
||||||
|
margin-left: 15rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .add .add-tv {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .line {
|
||||||
|
margin: 10rpx 0;
|
||||||
|
border-bottom: 1rpx dashed #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .record {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: var(--blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item .more {
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 1rpx;
|
||||||
|
height: 80%;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cu-item {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option {
|
||||||
|
position: fixed;
|
||||||
|
bottom: calc(constant(safe-area-inset-bottom) + 30rpx);
|
||||||
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding: 16rpx 32rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option .btn {
|
||||||
|
padding: 14rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #409CFF;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option .btn:active {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
.addbtn {
|
||||||
|
position: fixed;
|
||||||
|
right: 17rpx;
|
||||||
|
background: #409CFF;
|
||||||
|
padding: 4rpx 20rpx;
|
||||||
|
border-radius: 0 12rpx 0 12rpx;
|
||||||
|
font-size: 16rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
.search {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cu-bar .search-form {
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 0rpx 12rpx 2rpx #DDECF3;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
|
@ -126,6 +126,20 @@ Page({
|
||||||
this.postImg(path)
|
this.postImg(path)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
chooseVideo: function () {
|
||||||
|
let that = this
|
||||||
|
wx.chooseVideo({
|
||||||
|
count: 1,
|
||||||
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
||||||
|
maxDuration: 60, // 拍摄视频最长拍摄时间,单位秒。需大于等于3s
|
||||||
|
camera: 'back', // 默认拉起后置摄像头,front为前置摄像头
|
||||||
|
success (res) {
|
||||||
|
// tempFilePath可以作为video标签的src属性显示视频
|
||||||
|
const tempFilePath = res.tempFilePath
|
||||||
|
that.postImg(tempFilePath)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 上传图片
|
* 上传图片
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
</view>
|
</view>
|
||||||
<textarea bindinput="inputContent" data-name="content" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入困难诉求"></textarea>
|
<textarea bindinput="inputContent" data-name="content" value="{{postData.content}}" style="color: #333333;" class="put v-div" placeholder="请输入困难诉求"></textarea>
|
||||||
|
|
||||||
<view class="h-div v-center header">
|
<view class="h-div v-center header" wx:if="{{postData.difficultyState == 1}}">
|
||||||
<text class="single"></text>
|
<text class="single"></text>
|
||||||
<text class="title">状态</text>
|
<text class="title">状态</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content" wx:if="{{postData.difficultyState == 1}}">
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
<button class="rectified {{postData.dangerState==2?'checkedButton':''}}" data-htstate="{{2}}" bindtap="changeHtstate" style="padding: 0;">已取消</button>
|
<button class="rectified {{postData.dangerState==2?'checkedButton':''}}" data-htstate="{{2}}" bindtap="changeHtstate" style="padding: 0;">已取消</button>
|
||||||
<button class="not_rectified {{postData.dangerState==3?'checkedButton':''}}" data-htstate="{{3}}" bindtap="changeHtstate" style="padding: 0;">已处理</button>
|
<button class="not_rectified {{postData.dangerState==3?'checkedButton':''}}" data-htstate="{{3}}" bindtap="changeHtstate" style="padding: 0;">已处理</button>
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
<text class="single"></text>
|
<text class="single"></text>
|
||||||
<text class="title flex">附件</text>
|
<text class="title flex">附件</text>
|
||||||
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
||||||
|
<text catchtap="chooseVideo" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;margin-left: 20rpx;">添加视频</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid">
|
<view class="grid">
|
||||||
<view class="img" wx:for="{{files}}" style="position: relative;">
|
<view class="img" wx:for="{{files}}" style="position: relative;">
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,10 @@ if (this.data.curTab == 2) {
|
||||||
*/
|
*/
|
||||||
toMsgDetail: function (params) {
|
toMsgDetail: function (params) {
|
||||||
const item = params.currentTarget.dataset.item;
|
const item = params.currentTarget.dataset.item;
|
||||||
|
let id = item.learnContentId?item.learnContentId:item.publicContentId
|
||||||
|
let type = item.learnContentId?'partyMember':'publicContent'
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/the-masses/web/index?id=${item.publicContentId}`,
|
url: `/pages/the-masses/web/index?id=${id}&type=${type}`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,19 +16,16 @@ Page({
|
||||||
* 查看公开内容详情
|
* 查看公开内容详情
|
||||||
*/
|
*/
|
||||||
getDetail: function (id,type) {
|
getDetail: function (id,type) {
|
||||||
console.log(id,type,'id,type==>');
|
let userId = app.globalData.userInfo.userId
|
||||||
if (type == "partyMember") {
|
if (type == "partyMember") {
|
||||||
app.axios("GET", "app", `/partyLearnContent/partyLearnDetail/${id}`, {}, false).then(res => {
|
this.data.url = `${app.globalData.headerUrl}app/partyLearnContent/partyLearnDetail/${userId}/${id}`
|
||||||
if (res.code == 1) {
|
this.setData(this.data)
|
||||||
console.log(res,'res===>');
|
}
|
||||||
this.data.content = res.data.content;
|
else if (type == "publicContent") {
|
||||||
this.setData(this.data)
|
this.data.url = `${app.globalData.headerUrl}app/publicContent/publicContent/${id}`
|
||||||
wx.setNavigationBarTitle({
|
this.setData(this.data)
|
||||||
title: res.data.title,
|
}
|
||||||
})
|
else if (type == "open") {
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (type == "open") {
|
|
||||||
app.axios("GET", "app", `/publicContent/publicContentDetail/${id}`, {}, false).then(res => {
|
app.axios("GET", "app", `/publicContent/publicContentDetail/${id}`, {}, false).then(res => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
console.log(res,'res===>');
|
console.log(res,'res===>');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,2 @@
|
||||||
<!--pages/web/index.wxml-->
|
<!--pages/web/index.wxml-->
|
||||||
<web-view wx:if="{{url}}" src="{{url}}" />
|
<web-view src="{{url}}" />
|
||||||
<scroll-view wx:else class="sc">
|
|
||||||
<rich-text nodes="{{content}}" />
|
|
||||||
</scroll-view>
|
|
||||||
|
|
@ -78,6 +78,37 @@ Page({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
chooseMessageFile() {
|
||||||
|
wx.chooseMessageFile({
|
||||||
|
count: 1, // 默认9,这里设置为1表示只选择一个文件
|
||||||
|
type: 'file', // 指定文件类型,这里设置为 'file' 表示可以选择所有类型的文件
|
||||||
|
success: (res) => {
|
||||||
|
// 用户成功选择文件后执行的回调
|
||||||
|
if (res.tempFiles.length > 0) {
|
||||||
|
// 获取用户选择的文件信息
|
||||||
|
const file = res.tempFiles[0];
|
||||||
|
const filePath = file.path; // 文件的本地路径
|
||||||
|
// 在这里可以对文件进行进一步的处理,例如上传到服务器等
|
||||||
|
this.postImg(filePath)
|
||||||
|
} else {
|
||||||
|
// 用户没有选择文件
|
||||||
|
wx.showToast({
|
||||||
|
title: '未选择文件',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
// 选择文件失败的回调
|
||||||
|
wx.showToast({
|
||||||
|
title: '选择文件失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工作类型
|
* 获取工作类型
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@
|
||||||
<text class="single"></text>
|
<text class="single"></text>
|
||||||
<text class="title flex">附件</text>
|
<text class="title flex">附件</text>
|
||||||
<text wx:if="{{!readonly}}" catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
<text wx:if="{{!readonly}}" catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
||||||
|
|
||||||
|
<text wx:if="{{!readonly}}" catchtap="chooseMessageFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;margin-left: 20rpx;">文件上传</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid">
|
<view class="grid">
|
||||||
<view class="img" wx:for="{{files}}" style="position: relative;">
|
<view class="img" wx:for="{{files}}" style="position: relative;">
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,37 @@ Page({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
chooseMessageFile() {
|
||||||
|
wx.chooseMessageFile({
|
||||||
|
count: 1, // 默认9,这里设置为1表示只选择一个文件
|
||||||
|
type: 'file', // 指定文件类型,这里设置为 'file' 表示可以选择所有类型的文件
|
||||||
|
success: (res) => {
|
||||||
|
// 用户成功选择文件后执行的回调
|
||||||
|
if (res.tempFiles.length > 0) {
|
||||||
|
// 获取用户选择的文件信息
|
||||||
|
const file = res.tempFiles[0];
|
||||||
|
const filePath = file.path; // 文件的本地路径
|
||||||
|
// 在这里可以对文件进行进一步的处理,例如上传到服务器等
|
||||||
|
this.postImg(filePath)
|
||||||
|
} else {
|
||||||
|
// 用户没有选择文件
|
||||||
|
wx.showToast({
|
||||||
|
title: '未选择文件',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
// 选择文件失败的回调
|
||||||
|
wx.showToast({
|
||||||
|
title: '选择文件失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工作类型
|
* 获取工作类型
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
<text class="single"></text>
|
<text class="single"></text>
|
||||||
<text class="title flex">附件</text>
|
<text class="title flex">附件</text>
|
||||||
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
<text catchtap="chooseFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;">添加图片</text>
|
||||||
|
<text catchtap="chooseMessageFile" class="title cuIcon-roundadd" style="font-weight: normal;color: #5DA6F4;margin-left: 20rpx;">文件上传</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid">
|
<view class="grid">
|
||||||
<view class="img" wx:for="{{files}}" style="position: relative;">
|
<view class="img" wx:for="{{files}}" style="position: relative;">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user