优化代码

This commit is contained in:
java110 2021-11-05 12:36:11 +08:00
parent 7aea651719
commit 94a89baac1
7 changed files with 65 additions and 41 deletions

View File

@ -15,11 +15,11 @@ const baseUrl = '/';
// 腾讯地图Key, h5使用
const QQMapKey = '';
const commonBaseUrl= 'http://demo.homecommunity.cn';
const commonBaseUrl= 'http://c.dgkaywin.com';
// #ifndef H5
//服务器域名 小程序 或者 app 时 后端地址
const baseUrl = 'http://demo.homecommunity.cn/';
const baseUrl = 'http://c.dgkaywin.com/';
// #endif

View File

@ -45,6 +45,7 @@ export function login(userName, passwd) {
let data = res.data;
let _tmpUserInfo = data.userInfo;
_tmpUserInfo['password'] = passwd;
_tmpUserInfo['username'] = userName;
let _userInfo = desEncrypt(JSON.stringify(_tmpUserInfo));
uni.setStorageSync(java110Config.USER_INFO, _userInfo);
uni.setStorageSync(java110Config.TOKEN, data.token);

View File

@ -85,13 +85,14 @@
"changeOrigin" : true, //
"secure" : true // https
},
"/callComponent" : {
"target" : "http://property.homecommunity.cn", //http://192.168.1.16:8012
"changeOrigin" : true, //
"secure" : true // https
}
"/callComponent" : {
"target" : "http://property.homecommunity.cn", //http://192.168.1.16:8012
"changeOrigin" : true, //
"secure" : true // https
}
}
},
"domain" : "http://property.homecommunity.cn"
"domain" : "http://property.homecommunity.cn",
"title" : "KK智慧云"
}
}

View File

@ -3,7 +3,7 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "HC掌上物业"
"navigationBarTitleText": "KK智慧云"
}
}
,{

View File

@ -2,7 +2,7 @@
<view class="content">
<view class="margin-bottom-xs">
<uni-notice-bar :showIcon="true" :scrollable="true" :single="true" :speed="30"
text="HC掌上物业欢迎您"></uni-notice-bar>
text="KK智慧云物业欢迎您"></uni-notice-bar>
</view>
<scroll-view @scrolltolower="lower" class="scroll-restaurants-list" scroll-y="true" style="height:100%">
<swiper class="categoryList padding-top-xs bg-white" indicator-dots="true"

View File

@ -40,8 +40,8 @@
data() {
return {
logoUrl: '',
username: 'wuxw',
password: 'admin'
username: '',
password: ''
}
},
onLoad() {

View File

@ -66,6 +66,28 @@
<view class="cu-form-group margin-top">
<textarea v-model="context" placeholder="请输入报修内容"></textarea>
</view>
<view class="block__title">相关图片</view>
<view class="cu-bar bg-white ">
<view class="action">
图片上传
</view>
<view class="action">
{{imgList.length}}/4
</view>
</view>
<view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(img,index) in imgList" :key='index' bindtap="ViewImage" :data-url="imgList[index]">
<image :src='imgList[index]' mode='aspectFill'></image>
<view class="cu-tag bg-red" @tap="deleteImage(index)" :data-index="index">
<text class="cuIcon-close"></text>
</view>
</view>
<view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
<text class="cuIcon-cameraadd"></text>
</view>
</view>
</view>
<view class="button_up_blank"></view>
@ -278,7 +300,7 @@
"appointmentTime": this.bindDate + " " + this.bindTime + ":00",
"tel": this.bindTel,
"roomId": this.roomId,
// "photos": [],
"photos": [],
"context": this.context,
"communityId": this.communityId,
"bindDate": this.bindDate,
@ -301,12 +323,12 @@
obj.repairObjName = this.floorNum + this.unitNum + this.roomNum;
}
// let _photos = this.photos;
// _photos.forEach(function(_item) {
// obj.photos.push({
// "photo": _item
// });
// });
let _photos = this.photos;
_photos.forEach(function(_item) {
obj.photos.push({
"photo": _item
});
});
let msg = "";
if (obj.repairType == "") {
@ -416,29 +438,29 @@
url: '/pages/selectRoom/selectRoom?floorId=' + this.floorId + "&unitId=" + this.unitId
});
},
// deleteImage: function(e) {
// console.log(e);
// let imageArr = this.$data.imgList;
// imageArr.splice(e, 1);
// this.photos.splice(e, 1);
// },
// ChooseImage: function(e) {
// let that = this;
// wx.chooseImage({
// count: 4, //9
// sizeType: ['compressed'], //
// sourceType: ['album'], //
// success: (res) => {
// console.log(res);
// that.$data.imgList.push(res.tempFilePaths[0]);
// var tempFilePaths = res.tempFilePaths[0]
deleteImage: function(e) {
console.log(e);
let imageArr = this.$data.imgList;
imageArr.splice(e, 1);
this.photos.splice(e, 1);
},
ChooseImage: function(e) {
let that = this;
wx.chooseImage({
count: 4, //9
sizeType: ['compressed'], //
sourceType: ['album'], //
success: (res) => {
console.log(res);
that.$data.imgList.push(res.tempFilePaths[0]);
var tempFilePaths = res.tempFilePaths[0]
// TanslateImage.translate(tempFilePaths, (url) => {
// that.photos.push(url);
// })
// }
// });
// },
TanslateImage.translate(tempFilePaths, (url) => {
that.photos.push(url);
})
}
});
},
repairScopeChange: function(e) {
this.repairScopeIndex = e.target.value //
let selected = this.repairScopes[this.repairScopeIndex] //