|
|
@@ -32,7 +32,8 @@
|
|
|
内容
|
|
|
</view>
|
|
|
<view class="textarea">
|
|
|
- <u--textarea v-model="value1" placeholder="请输入内容" count :maxlength="200" :autoHeight="true"></u--textarea>
|
|
|
+ <u--textarea v-model="value1" placeholder="请输入内容" count :maxlength="200" :autoHeight="true">
|
|
|
+ </u--textarea>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="imgbox_tishi" v-if="value1==''&&texttf">
|
|
|
@@ -40,8 +41,8 @@
|
|
|
</view>
|
|
|
<u-button type="primary" text="提交" @click="submit" style="margin-top: 30rpx;"></u-button>
|
|
|
</view>
|
|
|
- <kps-image-cutter @ok="onok" @cancel="oncancle" :url="kpsurlL" :fixed="false" :blob="false" :maxWidth="500"
|
|
|
- :maxHeight="500"></kps-image-cutter>
|
|
|
+ <kps-image-cutter @ok="onok" @cancel="oncancle" :url="kpsurlL" :fixed="false" :blob="false" :maxWidth="500"
|
|
|
+ :maxHeight="500"></kps-image-cutter>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -64,23 +65,23 @@
|
|
|
},
|
|
|
urllist: [],
|
|
|
value1: "",
|
|
|
- kpsurlL:"",
|
|
|
- imgtf:false,
|
|
|
- texttf:false
|
|
|
+ kpsurlL: "",
|
|
|
+ imgtf: false,
|
|
|
+ texttf: false
|
|
|
}
|
|
|
},
|
|
|
- components:{
|
|
|
+ components: {
|
|
|
kpsImageCutter
|
|
|
},
|
|
|
watch: {
|
|
|
- urllist(newName, oldName) {
|
|
|
- console.log(this.urllist)
|
|
|
- if(this.urllist!=0){
|
|
|
+ urllist(newName, oldName) {
|
|
|
+ console.log(this.urllist)
|
|
|
+ if (this.urllist != 0) {
|
|
|
this.imgtf = false
|
|
|
}
|
|
|
- },
|
|
|
- value1(){
|
|
|
- if(this.value1!=''){
|
|
|
+ },
|
|
|
+ value1() {
|
|
|
+ if (this.value1 != '') {
|
|
|
this.texttf = false
|
|
|
}
|
|
|
},
|
|
|
@@ -113,38 +114,43 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- oncancle(){
|
|
|
+ oncancle() {
|
|
|
this.kpsurlL = ""
|
|
|
},
|
|
|
- onok(ev){
|
|
|
+ onok(ev) {
|
|
|
uni.uploadFile({
|
|
|
- url: this.baseUrl+'/api/api_gateway?method=monitor_manage.cbd_manage.add_img', //仅为示例,非真实的接口地址
|
|
|
+ url: this.baseUrl +
|
|
|
+ '/api/api_gateway?method=monitor_manage.cbd_manage.add_img', //仅为示例,非真实的接口地址
|
|
|
filePath: ev.path,
|
|
|
- name: 'img_file',
|
|
|
- success: (uploadFileRes) => {
|
|
|
+ name: 'img_file',
|
|
|
+ success: (uploadFileRes) => {
|
|
|
console.log(JSON.parse(uploadFileRes.data).data.src)
|
|
|
this.urllist.push(JSON.parse(uploadFileRes.data).data.src)
|
|
|
this.kpsurlL = ""
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
- submit(){
|
|
|
+ submit() {
|
|
|
this.$refs.form1.validate().then(res => {
|
|
|
// this.alterpass()
|
|
|
- if(this.urllist.length==0){
|
|
|
+ if (this.urllist.length == 0) {
|
|
|
this.imgtf = true
|
|
|
- }else if(this.value1==''){
|
|
|
+ } else if (this.value1 == '') {
|
|
|
this.texttf = true
|
|
|
- }else{
|
|
|
- var objlist = this.$store.state.addobj
|
|
|
+ } else {
|
|
|
+ var objlist = JSON.parse(JSON.stringify(this.$store.state.addobj))
|
|
|
var obj = {
|
|
|
- name:this.weatherdatas.temp,
|
|
|
- imglist:this.urllist,
|
|
|
- text:this.value1
|
|
|
+ name: this.weatherdatas.temp,
|
|
|
+ imglist: this.urllist,
|
|
|
+ text: this.value1
|
|
|
}
|
|
|
// var arr = []
|
|
|
+ console.log(objlist)
|
|
|
objlist.push(obj)
|
|
|
this.$store.state.addobj = objlist
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
// uni.setStorage({
|
|
|
// key:"addobj",
|
|
|
// data:JSON.stringify(obj),
|
|
|
@@ -159,25 +165,27 @@
|
|
|
uni.$u.toast('校验失败')
|
|
|
})
|
|
|
},
|
|
|
- deleimg(index){
|
|
|
- this.urllist.splice(index,1)
|
|
|
+ deleimg(index) {
|
|
|
+ this.urllist.splice(index, 1)
|
|
|
}
|
|
|
},
|
|
|
- onLoad(){
|
|
|
+ onLoad() {
|
|
|
console.log(this.baseUrl)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
- page{
|
|
|
+ page {
|
|
|
background-color: #f7f7f7;
|
|
|
}
|
|
|
+
|
|
|
.context_box {
|
|
|
width: 90%;
|
|
|
margin: 0 auto;
|
|
|
padding-bottom: 40rpx;
|
|
|
+
|
|
|
/deep/.u-form-item__body {
|
|
|
border-bottom: 1px solid #F6F6F6;
|
|
|
margin-bottom: 20rpx;
|
|
|
@@ -216,6 +224,7 @@
|
|
|
margin-right: 30rpx;
|
|
|
margin-bottom: 30rpx;
|
|
|
position: relative;
|
|
|
+
|
|
|
.icon {
|
|
|
position: absolute;
|
|
|
top: -20rpx;
|
|
|
@@ -228,6 +237,7 @@
|
|
|
justify-content: space-around;
|
|
|
background-color: red;
|
|
|
}
|
|
|
+
|
|
|
.img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
@@ -235,16 +245,19 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .imgbox_tishi{
|
|
|
+
|
|
|
+ .imgbox_tishi {
|
|
|
padding-left: 160rpx;
|
|
|
font-size: 24rpx;
|
|
|
color: red;
|
|
|
}
|
|
|
+
|
|
|
.describe_box {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
margin-top: 30rpx;
|
|
|
margin-bottom: 30rpx;
|
|
|
+
|
|
|
.title {
|
|
|
font-size: 30rpx;
|
|
|
width: 160rpx;
|