Commit 1755fb4b authored by 秦威威's avatar 秦威威

接口对接

parent 78e0aa1c
...@@ -81,6 +81,9 @@ ...@@ -81,6 +81,9 @@
.v-center { .v-center {
align-items:center; align-items:center;
} }
.text-left {
text-align:left;
}
.vh-center { .vh-center {
justify-content: center; justify-content: center;
align-items:center; align-items:center;
......
...@@ -38,7 +38,7 @@ import checkUpdateApp from "@/utils/updateapp.js" ...@@ -38,7 +38,7 @@ import checkUpdateApp from "@/utils/updateapp.js"
/** /**
* 上传图片 * 上传图片
* @author 万世科技 * @author 小威
* @param {String} imgurl 图片地址 * @param {String} imgurl 图片地址
*/ */
function uploadImg(imgurl) { function uploadImg(imgurl) {
...@@ -46,17 +46,15 @@ function uploadImg(imgurl) { ...@@ -46,17 +46,15 @@ function uploadImg(imgurl) {
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
try { try {
uni.uploadFile({ uni.uploadFile({
url: config.domain + '/api/common/upload', url: config.domain + '/api/oss/upload',
header: { header: {
token "Authorization": token
}, },
filePath: imgurl, filePath: imgurl,
name: 'file', name: 'file',
success: res => { success: res => {
// console.log(res)
const data = JSON.parse(res.data) const data = JSON.parse(res.data)
// console.log(data) if (data.code === 200) {
if (data.code === 1) {
resolve(data.data) resolve(data.data)
} else { } else {
reject(data) reject(data)
...@@ -64,7 +62,6 @@ function uploadImg(imgurl) { ...@@ -64,7 +62,6 @@ function uploadImg(imgurl) {
}, },
fail: err => { fail: err => {
reject(err) reject(err)
// console.log(err)
} }
}) })
} catch (err) { } catch (err) {
...@@ -77,7 +74,7 @@ function uploadImg(imgurl) { ...@@ -77,7 +74,7 @@ function uploadImg(imgurl) {
/** /**
* 打开高德地图APP * 打开高德地图APP
* @author 万世科技 * @author 小威
* @param {String} current_latitude 当前纬度 * @param {String} current_latitude 当前纬度
* @param {String} current_longitude 当前经度 * @param {String} current_longitude 当前经度
* @param {String} current_address 当前所在地名称 * @param {String} current_address 当前所在地名称
...@@ -138,7 +135,7 @@ function openGaoDeMap(current_latitude, current_longitude, current_address, shop ...@@ -138,7 +135,7 @@ function openGaoDeMap(current_latitude, current_longitude, current_address, shop
/** /**
* 打开百度地图APP * 打开百度地图APP
* @author 万世科技 * @author 小威
* @param {String} current_latitude 当前纬度 * @param {String} current_latitude 当前纬度
* @param {String} current_longitude 当前经度 * @param {String} current_longitude 当前经度
* @param {String} current_address 当前所在地名称 * @param {String} current_address 当前所在地名称
...@@ -389,7 +386,7 @@ const isVideo = (url) => { ...@@ -389,7 +386,7 @@ const isVideo = (url) => {
/** /**
* 检测是否是邮箱 * 检测是否是邮箱
* @author 万世科技 * @author 小威
* @param {String} email 邮箱号 * @param {String} email 邮箱号
*/ */
function testEmail(email) { function testEmail(email) {
...@@ -399,7 +396,7 @@ function testEmail(email) { ...@@ -399,7 +396,7 @@ function testEmail(email) {
/** /**
* 检测是否是手机号 * 检测是否是手机号
* @author 万世科技 * @author 小威
* @param {String} mobile 手机号 * @param {String} mobile 手机号
*/ */
function testMobile(mobile) { function testMobile(mobile) {
...@@ -409,7 +406,7 @@ function testMobile(mobile) { ...@@ -409,7 +406,7 @@ function testMobile(mobile) {
/** /**
* 检测是否是Url * 检测是否是Url
* @author 万世科技 * @author 小威
* @param {String} url url地址 * @param {String} url url地址
*/ */
function testUrl(url) { function testUrl(url) {
...@@ -530,8 +527,13 @@ function toast(text) { ...@@ -530,8 +527,13 @@ function toast(text) {
uni.$u.toast(text) uni.$u.toast(text)
} }
function isNull(text) {
return text == null || text == '' ? true : false
}
function isNullStr(text) {
return text == null || text == '' ? '' : text
}
/** /**
* 微信小程序支付或APP微信支付或APP支付宝支付 * 微信小程序支付或APP微信支付或APP支付宝支付
* @param {Object} orderInfo 支付信息对象 * @param {Object} orderInfo 支付信息对象
...@@ -623,6 +625,12 @@ function wxBrowserPay(params) { ...@@ -623,6 +625,12 @@ function wxBrowserPay(params) {
); );
} }
function splitList(data) {
if (data == null) {
return []
}
return data.split(',')
}
const wskj_function = { const wskj_function = {
...@@ -661,7 +669,10 @@ const wskj_function = { ...@@ -661,7 +669,10 @@ const wskj_function = {
toast, toast,
pay, pay,
onSaveImageAlbum, onSaveImageAlbum,
wxBrowserPay wxBrowserPay,
isNullStr,
isNull,
splitList,
} }
......
...@@ -43,18 +43,15 @@ ...@@ -43,18 +43,15 @@
images: { images: {
immediate: true, immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
// console.log(newVal)
// console.log(this.fileList)
this.fileList = [] this.fileList = []
if (newVal) { if (newVal) {
const urlList = newVal.split(",") const urlList = newVal.split(",")
console.log(urlList)
urlList.forEach(item => { urlList.forEach(item => {
// 防止直接传递全路径
let url = this.removeUrl(item, this.$config.domain)
this.fileList.push({ this.fileList.push({
status: 'success', status: 'success',
message: '', message: '',
fullurl: this.$config.domain + url, fullurl: url,
url: url url: url
}) })
}) })
...@@ -66,15 +63,12 @@ ...@@ -66,15 +63,12 @@
// 删除图片 // 删除图片
deletePic(event, type) { deletePic(event, type) {
this.fileList.splice(event.index, 1) this.fileList.splice(event.index, 1)
this.uploadParseData() this.uploadParseData()
}, },
// 新增图片 // 新增图片
async afterRead(event, type) { async afterRead(event, type) {
// console.log(event)
let lists = [].concat(event.file) let lists = [].concat(event.file)
let fileListLen = this.fileList.length let fileListLen = this.fileList.length
lists.map((item) => { lists.map((item) => {
this.fileList.push({ this.fileList.push({
...item, ...item,
...@@ -84,13 +78,13 @@ ...@@ -84,13 +78,13 @@
}) })
for (let i = 0; i < lists.length; i++) { for (let i = 0; i < lists.length; i++) {
const result = await this.$wskj.uploadImg(lists[i].url) const result = await this.$wskj.uploadImg(lists[i].url)
// console.log(result) console.log(result)
let item = this[[type]][fileListLen] let item = this[[type]][fileListLen]
this.fileList.splice(fileListLen, 1, Object.assign(item, { this.fileList.splice(fileListLen, 1, Object.assign(item, {
status: 'success', status: 'success',
message: '', message: '',
url: result.url, url: result.url,
fullurl: result.fullurl fullurl: result.url
})) }))
fileListLen++ fileListLen++
} }
...@@ -98,6 +92,8 @@ ...@@ -98,6 +92,8 @@
}, },
uploadParseData() { uploadParseData() {
const images = this.fileList.map(item => item[this.type]).join(",") const images = this.fileList.map(item => item[this.type]).join(",")
console.log(this.fileList)
console.log(images)
this.$emit('upload', images) this.$emit('upload', images)
}, },
removeUrl(str, urlToRemove) { removeUrl(str, urlToRemove) {
......
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
"navigationBarTitleText": "协议" "navigationBarTitleText": "协议"
} }
}, },
{
"path": "pages/my/feedback",
"style": {
"navigationBarTitleText": "协议"
}
},
{ {
"path": "pages/wy-home", "path": "pages/wy-home",
"style": { "style": {
......
...@@ -33,47 +33,60 @@ ...@@ -33,47 +33,60 @@
return { return {
agreement: false, agreement: false,
code: '', code: '',
userId: ''
}; };
}, },
onLoad(options) { onLoad(options) {
this.userId = options.userId || ''
const token = uni.getStorageSync('token') const token = uni.getStorageSync('token')
if (!token) { if (token) {
this.$wskj.switchTab('/pages/wy-home'); this.$wskj.switchTab('/pages/wy-home');
} }
},
onShow() {
}, },
methods: { methods: {
onGetphonenumber(e) { onGetphonenumber(e) {
// 获取微信授权code
const than = this
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (loginRes) => { success: (loginRes) => {
this.code = loginRes.code than.code = loginRes.code
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
console.log("微信授权信息", loginRes) console.log("微信授权信息", loginRes)
console.log("微信用户信息", infoRes);
console.log("手机号授权信息", e) console.log("手机号授权信息", e)
if (e.detail.iv && e.detail.encryptedData) { if (e.detail.iv && e.detail.encryptedData) {
const params = { const params = {
url: '/api/login/mobile', url: '/api/login/mobile',
loadingTip: '登录中...', loadingTip: '登录中...',
data: { data: {
payCode: this.code, payCode: than.code,
loginCode: e.detail.code, loginCode: e.detail.code,
encryptedData: infoRes.encryptedData,
iv: infoRes.iv,
} }
} }
this.$request(params).then(res => { than.$request(params).then(res => {
console.log(res) console.log(res)
if (res.code === 200) { if (res.code === 200) {
uni.setStorageSync('token', res.data.token) uni.setStorageSync('token', res.data.token)
this.$wskj.switchTab('/pages/wy-home'); than.$wskj.switchTab('/pages/wy-home');
} else { } else {
this.$u.toast(res.msg || '登录失败') than.$u.toast(res.msg || '登录失败')
} }
}) })
} else { } else {
this.$u.toast('手机号授权失败') than.$u.toast('手机号授权失败')
} }
} }
}); });
}
});
}, },
youkeLogin() { youkeLogin() {
......
...@@ -4,20 +4,15 @@ ...@@ -4,20 +4,15 @@
<view class="reason"> <view class="reason">
<view class="title">文字描述(必填)</view> <view class="title">文字描述(必填)</view>
<view class="mt-30"> <view class="mt-30">
<u--textarea v-model="reason" height="260rpx" maxlength="150" placeholder="请输入(最低10个字)" count></u--textarea> <u--textarea v-model="reason" height="260rpx" maxlength="150" placeholder="请输入(最低10个字)"
count></u--textarea>
</view> </view>
</view> </view>
<view class="mt-30"> <view class="mt-30">
<text>相关图片(必填,最多9张)</text> <text>相关图片(必填,最多9张)</text>
<view class="control"> <view class="control">
<upload-image <upload-image v-model="images" maxCount="3" width="100" height="100" type="fullurl"></upload-image>
v-model="images"
maxCount="3"
width="100"
height="100"
type="fullurl"
></upload-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -41,10 +36,10 @@ ...@@ -41,10 +36,10 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
reason:'', reason: '',
submitShow: false, submitShow: false,
images: '', images: '',
}; };
...@@ -53,23 +48,23 @@ export default { ...@@ -53,23 +48,23 @@ export default {
this.images = '/assets/img/qrcode.png' this.images = '/assets/img/qrcode.png'
}, },
methods: { methods: {
onSubmit(){ onSubmit() {
// console.log(this.images) // console.log(this.images)
// this.images = '' // this.images = ''
// console.log(this.images) // console.log(this.images)
if(!this.reason){ if (!this.reason) {
return this.$u.toast('请输入内容') return this.$u.toast('请输入内容')
} }
if(!this.images){ if (!this.images) {
return this.$u.toast('请至少上传一张照片') return this.$u.toast('请至少上传一张照片')
} }
if(this.reason.length < 10){ if (this.reason.length < 10) {
return this.$u.toast('文字描述最低10个字') return this.$u.toast('文字描述最低10个字')
} }
this.submitShow = true this.submitShow = true
}, },
// 提交 // 提交
onConfirmSubmit(){ onConfirmSubmit() {
const params = { const params = {
url: '/api/user/yijian', url: '/api/user/yijian',
loadingTip: '', loadingTip: '',
...@@ -82,7 +77,7 @@ export default { ...@@ -82,7 +77,7 @@ export default {
this.$request(params).then(res => { this.$request(params).then(res => {
// console.log(res) // console.log(res)
this.submitShow = false this.submitShow = false
if(res.code === 1) { if (res.code === 1) {
this.$u.toast(res.msg || '提交成功') this.$u.toast(res.msg || '提交成功')
this.reason = '' this.reason = ''
...@@ -96,29 +91,27 @@ export default { ...@@ -96,29 +91,27 @@ export default {
}) })
} }
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.container { .container {
padding: 30rpx; padding: 30rpx;
} }
.wapper {
} .wapper {}
.reason { .reason {}
} .reason>.title {}
.reason > .title {
} .reason>textarea {
.reason > textarea {
margin-top: 20rpx; margin-top: 20rpx;
padding: 15rpx; padding: 15rpx;
width: 100% !important; width: 100% !important;
border: 1px solid #ccc !important; border: 1px solid #ccc !important;
} }
.control { .control {
margin-top: 20rpx; margin-top: 20rpx;
} }
......
...@@ -44,6 +44,35 @@ ...@@ -44,6 +44,35 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-popup :show="showHh" mode="center" @close="closeHh" @open="openHh" round="20">
<view class="flex-column mlr-50" style="width:600rpx;">
<text class="fs-32 fw-600 mtb-20">楼栋号/单元号/户号</text>
<scroll-view scroll-y class="h-400">
<view v-for="(item, index) in listHh" :key="index" @click="onSelectHh(index)">
<view class="fs-24 pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text :style="selectHhIndex==index?'color: #1FCA7C;':'color: #000000;'">{{item.room}}</text>
</view>
</view>
</scroll-view>
<view class="mt-40" @click="onSubmitHh()">
<text class="plr-80 ptb-12 br-12" style="background:#1FCA7C;color: #fff;">完成</text>
</view>
</view>
</u-popup>
<!-- <view class="v-top-popup">
<u-popup :show="show" @close="close" @open="open" mode="top" :style="{ top: 100 + 'px' }">
<view class="flex-column">
<text class="fs-24 mtb-20 text-left ml-30">当前小区:{{address}}</text>
<scroll-view scroll-y>
<view v-for="(item, index) in listXq" :key="index" @click="onSelect(index)">
<view class="fs-24 pad-30 text-left" style="border-bottom: 1rpx solid #E9E9E9;">
<text>{{item.communityName}}</text>
</view>
</view>
</scroll-view>
</view>
</u-popup>
</view> -->
</view> </view>
</template> </template>
...@@ -51,10 +80,17 @@ ...@@ -51,10 +80,17 @@
export default { export default {
data() { data() {
return { return {
//选择小区用到的字段
address: '请选择', address: '请选择',
show: false, show: false,
selectIndex: 0, selectIndex: -1,
listXq: [], listXq: [],
communityId: '', //小区ID
//选择小区户号用到的字段
showHh: false,
selectHhIndex: -1,
listHh: [],
proprietorId: '', //户号id
list1: [ list1: [
"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2023%2F0826%2F07b46817j00rzyq1h000kd000hs00alp.jpg&thumbnail=660x2147483647&quality=80&type=jpg",
...@@ -95,7 +131,11 @@ ...@@ -95,7 +131,11 @@
}; };
}, },
onShow() { onShow() {
this.listAll() this.userInfo()
this.getXqList()
//获取小区信息
const addressItem = uni.getStorageSync("addressItem")
this.address = addressItem.communityName
}, },
methods: { methods: {
open() { open() {
...@@ -103,7 +143,6 @@ ...@@ -103,7 +143,6 @@
}, },
close() { close() {
this.show = false this.show = false
// console.log('close');
}, },
onSelect(index) { onSelect(index) {
this.selectIndex = index this.selectIndex = index
...@@ -111,11 +150,14 @@ ...@@ -111,11 +150,14 @@
onSubmit() { onSubmit() {
this.show = false this.show = false
this.address = this.listXq[this.selectIndex].communityName this.address = this.listXq[this.selectIndex].communityName
this.communityId = this.listXq[this.selectIndex].communityId
uni.setStorageSync('addressItem', this.listXq[this.selectIndex])
this.getHhList()
}, },
listAll() { //获取小区数据
getXqList() {
const params = { const params = {
url: '/api/community/listAll', url: '/api/community/listAll',
loadingTip: '',
method: 'GET', method: 'GET',
data: {} data: {}
} }
...@@ -124,6 +166,57 @@ ...@@ -124,6 +166,57 @@
this.listXq = res.data this.listXq = res.data
}) })
}, },
openHh() {
this.showHh = true
},
closeHh() {
this.showHh = false
},
onSelectHh(index) {
this.selectHhIndex = index
},
onSubmitHh() {
this.showHh = false
this.proprietorId = this.listHh[this.selectHhIndex].proprietorId
this.upHh()
},
//获取户号数据
getHhList() {
const params = {
url: '/api/community/room/listAllByCommunityId/' + this.communityId,
method: 'GET',
data: {}
}
this.$request(params).then(res => {
console.log(res.data)
this.listHh = res.data
//打开户号选择的弹框
this.openHh()
})
},
upHh() {
const params = {
url: '/api/community/cut/' + this.communityId + "/" + this.proprietorId,
data: {}
}
this.$request(params).then(res => {
this.$wskj.toast("设置成功")
})
},
userInfo() {
const params = {
url: '/api/login/userInfo',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
uni.setStorageSync('userInfo', res.data)
})
},
onClick(index) { onClick(index) {
if (index == 0) { if (index == 0) {
this.$wskj.to("/pagesMain/pages/fkdj") this.$wskj.to("/pagesMain/pages/fkdj")
...@@ -143,6 +236,7 @@ ...@@ -143,6 +236,7 @@
} }
if (index == 4) { if (index == 4) {
this.$wskj.toast("敬请期待") this.$wskj.toast("敬请期待")
this.$wskj.to("/pages/my/feedback")
return return
} }
if (index == 5) { if (index == 5) {
...@@ -179,4 +273,9 @@ ...@@ -179,4 +273,9 @@
border-bottom: 1rpx solid #f5f5f5; border-bottom: 1rpx solid #f5f5f5;
border-right: 1rpx solid #f5f5f5; border-right: 1rpx solid #f5f5f5;
} }
.v-top-popup /deep/ .u-popup__content {
border-radius: 0 0 24rpx 24rpx;
margin-top: 20%;
}
</style> </style>
\ No newline at end of file
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
<view style="background: linear-gradient( 180deg, #1FCA7C 0%, #F2F2F2 100%);"> <view style="background: linear-gradient( 180deg, #1FCA7C 0%, #F2F2F2 100%);">
<view class="h-300 flex flex-row-between mt-200"> <view class="h-300 flex flex-row-between mt-200">
<view class="flex ml-25 mt-70 v-center h-95"> <view class="flex ml-25 mt-70 v-center h-95">
<image class="w-95 h-95 br-50" src="/static/icon_logo.png"></image> <image class="w-95 h-95 br-50" :src="userInfo.avatar"></image>
<view class="flex-column ml-10" style="color: #FFFFFF;text-align: left;" @click="onClick(3)"> <view class="flex-column ml-10" style="color: #FFFFFF;text-align: left;" @click="onClick(3)">
<text class="fs-32 fw-700">旅行的小七仔</text> <text class="fs-32 fw-700">{{userInfo.nickName}}</text>
<text class="fs-24 mt-10">177****1234</text> <text class="fs-24 mt-10">{{userInfo.mobile}}</text>
</view> </view>
</view> </view>
<image class="w-344 h-266" src="/static/icon_my_bg.png"></image> <image class="w-344 h-266" src="/static/icon_my_bg.png"></image>
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
<view class="flex-column br-12 pad-25" style="background: #F3FEF9;"> <view class="flex-column br-12 pad-25" style="background: #F3FEF9;">
<view class="flex"> <view class="flex">
<image class="h-42 w-42" src="/static/icon_my_fw.png"></image> <image class="h-42 w-42" src="/static/icon_my_fw.png"></image>
<text class="fs-28">利达国宾中心</text> <text class="fs-28">{{userInfo.communityName}}</text>
</view> </view>
<text class="fs-24 h-54 lh-54 mt-30" <text class="fs-24 h-54 lh-54 mt-30"
style="background: linear-gradient( 90deg, #CAF6E2 0%, #FFFFFF 100%);"> style="background: linear-gradient( 90deg, #CAF6E2 0%, #FFFFFF 100%);">
1栋2单元205室 {{userInfo.room}}
</text> </text>
</view> </view>
</view> </view>
...@@ -58,14 +58,26 @@ ...@@ -58,14 +58,26 @@
export default { export default {
data() { data() {
return { return {
userInfo: {},
}; };
}, },
onLoad(options) { onShow() {
this.getUserInfo()
}, },
methods: { methods: {
getUserInfo() {
const params = {
url: '/api/login/userInfo',
loadingTip: '',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
this.userInfo = res.data
uni.setStorageSync('userInfo', res.data)
})
},
onClick(index) { onClick(index) {
if (index == 3) { if (index == 3) {
this.$wskj.to("/pagesMine/pages/zlbj") this.$wskj.to("/pagesMine/pages/zlbj")
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
data() { data() {
return { return {
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -31,11 +30,11 @@ ...@@ -31,11 +30,11 @@
}, },
onClick(index) { onClick(index) {
if (index == 0) { if (index == 0) {
this.$wskj.to("/pagesMain/pages/bxbs_submit?type=0") this.$wskj.to("/pagesMain/pages/bxbs_submit?type=1")
return return
} }
if (index == 1) { if (index == 1) {
this.$wskj.to("/pagesMain/pages/bxbs_submit?type=1") this.$wskj.to("/pagesMain/pages/bxbs_submit?type=2")
return return
} }
if (index == 2) { if (index == 2) {
...@@ -43,7 +42,7 @@ ...@@ -43,7 +42,7 @@
return return
} }
if (index == 3) { if (index == 3) {
this.$wskj.to("/pagesMain/pages/fwgz") this.$wskj.to("/pagesMain/pages/fwgz?type=1")
return return
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
:style="{ color: index==0?'#FF682D':index==1?'#EEA616':index==2?'#1FCA7C':'#23BBEE'}" :style="{ color: index==0?'#FF682D':index==1?'#EEA616':index==2?'#1FCA7C':'#23BBEE'}"
v-for="(item, index) in 4" :key="index"> v-for="(item, index) in 4" :key="index">
<text class="mt-20 fs-36">25</text> <text class="mt-20 fs-36">25</text>
<text class="mb-20 fs-24">待处理</text> <text class="mb-20 fs-24">{{index==0?'待处理':index==1?'待支付':index==2?'已完成':index==3?'已取消':''}}</text>
<view v-if="index==tabIndex" <view v-if="index==tabIndex"
style="background: #27CC81;height: 10rpx;width: 100%;border-radius: 12rpx;"> style="background: #27CC81;height: 10rpx;width: 100%;border-radius: 12rpx;">
</view> </view>
...@@ -22,25 +22,29 @@ ...@@ -22,25 +22,29 @@
</view> </view>
<view class="overflow-y"> <view class="overflow-y">
<scroll-view scroll-y style="height: 100%;"> <scroll-view scroll-y style="height: 100%;">
<view v-for="(item, index) in 8" :key="index" @click="onClick(index)"> <view v-for="(item, index) in list" :key="index" @click="onCz('详情',index)">
<view class="flex-column br-12 mt-30 mlr-24 pad-20" <view class="flex-column br-12 mt-30 mlr-24 pad-20"
style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);background: white;"> style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);background: white;">
<view class="flex vh-center mt-20"> <view class="flex vh-center mt-20">
<image class="h-25 w-25 mr-15" style="background: #1FCA7C;"> </image> <image class="h-40 w-40 mr-15" src="/static/icon_gd.png"> </image>
<text class="fs-32 fw-700" style="flex: 1;">居家报修</text> <text class="fs-32 fw-700" style="flex: 1;">居家报修</text>
<text>待处理</text> <text>{{item.state==1?'待处理':item.state==2?'待支付':item.state==3?'已完成':item.state==4?'已取消':''}}</text>
</view> </view>
<text class="fs-28 br-6 pad-20 mtb-20" style="background: #EBF5F0;">待处理</text> <text class="fs-28 br-6 pad-20 mtb-20"
style="background: #EBF5F0;">{{item.repairsDescription}}</text>
<scroll-view scroll-x="true" scroll-with-animation="true"> <scroll-view scroll-x="true" scroll-with-animation="true">
<view class="flex"> <view class="flex">
<view class="w-140 h-140 mr-15" v-for="(itemImg, index2) in 10" :key="index2"> <view class="w-140 h-140 mr-15"
<image class="w-140 h-140" style="background: #1FCA7C;"></image> v-for="(itemImg, index2) in $wskj.splitList(item.repairsImg)" :key="index2">
<image class="w-140 h-140" :src="itemImg"></image>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="flex vh-center h-60 mt-20 fs-24"> <view class="flex vh-center h-60 mt-20 fs-24">
<text style="flex: 1;color: #000;">2025-03-10 10:01:45</text> <text style="flex: 1;color: #000;">{{item.repairsTime}}</text>
<text style="color: #EEA616;">去支付</text> <text @tap.stop="onCz('关闭报修',index)" v-if="item.state==1"
style="color: #23BBEE;">关闭报修</text>
<text @tap.stop="onCz('去支付',index)" v-if="item.state==2" style="color: #EEA616;">去支付</text>
<text style="color: #27CC81;margin-left: 30rpx;">报修详情</text> <text style="color: #27CC81;margin-left: 30rpx;">报修详情</text>
</view> </view>
</view> </view>
...@@ -57,14 +61,51 @@ ...@@ -57,14 +61,51 @@
return { return {
type: 0, type: 0,
tabIndex: 0, tabIndex: 0,
list: [],
}; };
}, },
onLoad(e) { onLoad(e) {
this.type = e.type this.type = e.type
this.getList()
}, },
methods: { methods: {
onClick(index) { onClick(index) {
this.tabIndex = index;
this.getList()
},
onCz(e, index) {
if (e == "详情") {
this.$wskj.to("/pagesMain/pages/bxxq") this.$wskj.to("/pagesMain/pages/bxxq")
return
}
if (e == "关闭报修") {
this.gb(this.list[index].repairsId);
return
}
if (e == "去支付") {
return
}
},
getList() {
const params = {
url: '/api/repairs/userListAll?state=' + (this.tabIndex + 1),
method: 'GET',
}
this.$request(params).then(res => {
this.list = res.data
})
},
gb(id) {
const params = {
url: '/api/repairs/cancel/' + id,
method: 'PUT',
}
this.$request(params).then(res => {
this.getList()
})
} }
}, },
}; };
......
...@@ -7,25 +7,25 @@ ...@@ -7,25 +7,25 @@
</view> </view>
<view class="mar-20"> <view class="mar-20">
<view class="flex-column-center"> <view class="flex-column-center">
<image class="w-20 h-20" style="background-color: #1FCA7C;"></image> <image class="w-30 h-30" src="/static/icon_home_dw.png"></image>
<text>利达国宾中心</text> <text>{{userinfo.communityName}}</text>
</view> </view>
<view class="flex-column-center fs-32 fw-700 mt-30"> <view class="flex-column-center fs-32 fw-700 mt-30 ml-10">
<image class="w-10 h-40 mr-15" style="background-color: #1FCA7C;"></image> <image class="w-10 h-40 mr-15" style="background-color: #1FCA7C;"></image>
<text>业主信息</text> <text>业主信息</text>
</view> </view>
<view class="flex-column br-12 fs-28 mt-30" style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);"> <view class="flex-column br-12 fs-28 mt-30" style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);">
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text style="color: #999999;">业主姓名</text> <text style="color: #999999;">业主姓名</text>
<text>张三</text> <text>{{$wskj.isNullStr(userinfo.name)}}</text>
</view> </view>
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text style="color: #999999;">业主房间号</text> <text style="color: #999999;">业主房间号</text>
<text>张三</text> <text>{{$wskj.isNullStr(userinfo.room)}}</text>
</view> </view>
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text style="color: #999999;">业主手机号</text> <text style="color: #999999;">业主手机号</text>
<text>张三</text> <text>{{userinfo.mobile}}</text>
</view> </view>
</view> </view>
<view class="flex-column-center fs-32 fw-700 mt-30"> <view class="flex-column-center fs-32 fw-700 mt-30">
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
<u--textarea v-model="reason" height="260rpx" maxlength="100" placeholder="填写下详细报修内容,有助于工作人员快速帮您解决问题" <u--textarea v-model="reason" height="260rpx" maxlength="100" placeholder="填写下详细报修内容,有助于工作人员快速帮您解决问题"
count border="border"></u--textarea> count border="border"></u--textarea>
<view class="mt-30"> <view class="mt-30">
<upload-image v-model="images" maxCount="3" width="70" height="70" type="fullurl"></upload-image> <upload-image @upload="upload" v-model="imgurl" maxCount="3" width="70" height="70"
type="fullurl"></upload-image>
</view> </view>
</view> </view>
...@@ -45,16 +46,6 @@ ...@@ -45,16 +46,6 @@
<view @click="onSubmit" class="fullscreen-btn"> <view @click="onSubmit" class="fullscreen-btn">
<text>提交</text> <text>提交</text>
</view> </view>
<!-- 提交 -->
<wskj-modal :show="submitShow" :showCancelButton="true" confirmText="确定" confirmColor="#EB7318"
@close="submitShow = false" @confirm="onConfirmSubmit" @cancel="submitShow = false">
<view class="pt-40 pb-40">
<view>
<text class="fs-28">确认提交?</text>
</view>
</view>
</wskj-modal>
</view> </view>
</template> </template>
...@@ -65,58 +56,48 @@ ...@@ -65,58 +56,48 @@
title: '居家报修', title: '居家报修',
type: 0, type: 0,
reason: '', reason: '',
submitShow: false,
images: '', images: '',
userinfo: '',
}; };
}, },
onLoad(e) { onLoad(e) {
this.type = e.type this.type = e.type
if (e.type == 0) { if (e.type == 1) {
this.title = "居家报修" this.title = "居家报修"
} else { } else {
this.title = "公区报事" this.title = "公区报事"
} }
this.userinfo = uni.getStorageSync("userInfo")
}, },
methods: { methods: {
onSubmit() { upload(e) {
this.$wskj.to("/pagesMain/pages/tjsq?type=" + this.type) this.images = e
// if (!this.reason) {
// return this.$u.toast('请输入内容')
// }
// if (!this.images) {
// return this.$u.toast('请至少上传一张照片')
// }
// if (this.reason.length < 10) {
// return this.$u.toast('文字描述最低10个字')
// }
// this.submitShow = true
}, },
// 提交 onSubmit() {
onConfirmSubmit() { console.log(this.images)
// const params = { if (!this.reason) {
// url: '/api/user/yijian', this.$wskj.toast('请输入报修信息');
// loadingTip: '', return
// data: { }
// content: this.reason, if (!this.images) {
// images: this.images this.$wskj.toast('请上传图片');
// } return
// } }
// // console.log(params); const params = {
// this.$request(params).then(res => { url: '/api/repairs/add',
// // console.log(res) loadingTip: '加载中...',
// this.submitShow = false data: {
// if (res.code === 1) { repairsDescription: this.reason,
// this.$u.toast(res.msg || '提交成功') repairsImg: this.images,
type: this.type
// this.reason = '' }
// this.images = '' }
// } else { this.$request(params).then(res => {
// this.$u.toast(res.msg || '提交失败') this.$wskj.toast('提交成功')
// } setTimeout(() => {
// }).catch(err => { this.$wskj.goBack(1)
// this.submitShow = false }, 600)
// this.$u.toast(err.msg || '提交失败') })
// })
} }
}, },
}; };
......
...@@ -5,21 +5,22 @@ ...@@ -5,21 +5,22 @@
:title-style="{color: '#FFF'}"> :title-style="{color: '#FFF'}">
</u-navbar> </u-navbar>
<view class=" mlr-25 mt-30 "> <view class=" mlr-25 mt-30 ">
<input style="height: 72rpx; text-align: center;border:1rpx solid #F2F2F2; border-radius:36rpx ;" <input
placeholder="搜索" placeholder-style="color:#fff" /> style="height: 72rpx; text-align: center;border:1rpx solid #F2F2F2; border-radius:36rpx;color: #fff;"
placeholder="搜索" placeholder-style="color:#fff" @input="search" />
</view> </view>
</view> </view>
<view class="overflow-y mlr-25" <view class="overflow-y mlr-25"
style="background: white;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;margin-top: -250rpx;"> style="background: white;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;margin-top: -250rpx;">
<scroll-view scroll-y style="height: 100%;"> <scroll-view scroll-y style="height: 100%;">
<view class="mar-20"> <view class="mar-20">
<view v-for="(item, index) in 40" :key="index"> <view v-for="(item, index) in filteredList(searchKey)" :key="index">
<view class="flex" style="border:1rpx solid #20CA7D;"> <view class="flex" style="border:1rpx solid #20CA7D;">
<view class="flex vh-center ptb-20 fs-24" style="flex: 1;border-right:1rpx solid #1FCA7C;"> <view class="flex vh-center ptb-20 fs-24" style="flex: 1;border-right:1rpx solid #1FCA7C;">
天气预报 {{item.name}}
</view> </view>
<view class="flex vh-center fs-28" style="flex: 1;border-right:1rpx solid #1FCA7C;"> <view class="flex vh-center fs-28" style="flex: 1;border-right:1rpx solid #1FCA7C;">
12121 {{item.phone}}
</view> </view>
<view class="flex vh-center" style="flex: 1;" @click="onZd(index)"> <view class="flex vh-center" style="flex: 1;" @click="onZd(index)">
<view class="flex-column vh-center" style="flex: 1;"> <view class="flex-column vh-center" style="flex: 1;">
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
<image v-else class="w-30 h-30" src="/pagesMain/static/icon_cydh_zd.png"></image> <image v-else class="w-30 h-30" src="/pagesMain/static/icon_cydh_zd.png"></image>
<text style="color: #999999;font-size: 18rpx;">{{index==0?"取消置顶":"置顶"}}</text> <text style="color: #999999;font-size: 18rpx;">{{index==0?"取消置顶":"置顶"}}</text>
</view> </view>
<view class="flex-column vh-center ml-30" style="flex: 1;" @click="onBd('10086')"> <view class="flex-column vh-center ml-30" style="flex: 1;" @click="onBd(item.phone)">
<image class="w-30 h-30" src="/pagesMain/static/icon_cydh_dh.png"></image> <image class="w-30 h-30" src="/pagesMain/static/icon_cydh_dh.png"></image>
<text style="color: #999999;font-size: 18rpx;">一键拨打</text> <text style="color: #999999;font-size: 18rpx;">一键拨打</text>
</view> </view>
...@@ -49,11 +50,15 @@ ...@@ -49,11 +50,15 @@
export default { export default {
data() { data() {
return { return {
list: [],
searchKey: '',
}; };
}, },
onLoad(e) { onLoad(e) {
},
onShow() {
this.listAll()
}, },
methods: { methods: {
onZd(index) { onZd(index) {
...@@ -64,6 +69,28 @@ ...@@ -64,6 +69,28 @@
} }
}, },
search(event) {
this.searchKey = event.detail.value
console.log(this.filteredList(this.searchKey))
},
filteredList(e) {
return e == '' ? this.list : this.list.filter(item => {
// 筛选条件:名称包含关键词(忽略大小写)
return item.name.includes(e)
})
},
listAll() {
const params = {
url: '/api/commonPhone/listAll',
loadingTip: '',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
console.log(res.data)
this.list = res.data
})
},
onBd(phone) { onBd(phone) {
this.$wskj.onCall(phone) this.$wskj.onCall(phone)
} }
......
...@@ -9,53 +9,59 @@ ...@@ -9,53 +9,59 @@
<view class="mar-20 fs-32 fw-600" style="text-align: left;">访客登记</view> <view class="mar-20 fs-32 fw-600" style="text-align: left;">访客登记</view>
<view class="list-container"> <view class="list-container">
<view class="list-item"> <view class="list-item">
<view class="flex" style="flex: 1;text-align: left;"> <view class="flex w-220" style="text-align: left;">
<text class="t">*</text> <text class="t">*</text>
<text class="name">访客姓名</text> <text class="name">访客姓名</text>
</view> </view>
<view style="flex: 2;"> <view style="flex: 1;">
<input class="" style="text-align: left;" placeholder="请输入姓名" <input class="" style="text-align: left;" placeholder="请输入姓名" placeholder-style="color:#999999"
placeholder-style="color:#999999" /> v-model="data.guestName" />
</view> </view>
</view> </view>
<view class="list-item" @click="show=true"> <view class="list-item" @click="open">
<view class="flex" style="flex: 1;text-align: left;"> <view class="flex w-220" style="text-align: left;">
<text class="t">*</text> <text class="t">*</text>
<text class="name">到访小区</text> <text class="name">到访小区</text>
</view> </view>
<view class="flex-column-center" style="flex: 2;"> <view class="flex-column-center" style="flex: 1;">
<text style="flex: 1;text-align: left;">请选择小区</text> <text style="flex: 1;text-align: left;"
v-model="data.communityId">{{address==''?'请选择小区':address}}</text>
<image class="h-20 w-20" src="@/static/icon_r.png"></image> <image class="h-20 w-20" src="@/static/icon_r.png"></image>
</view> </view>
</view> </view>
<view class="list-item"> <view class="list-item">
<view class="flex" style="flex: 1;text-align: left;"> <view class="flex w-220" style="text-align: left;">
<text class="t">*</text> <text class="t">*</text>
<text class="name">到访房间号</text> <text class="name">到访房间号</text>
</view> </view>
<view style="flex: 2;"> <view style="flex: 1;">
<input class="" style="text-align: left;" placeholder="请输入房间号" <input class="" style="text-align: left;" placeholder="请输入房间号" placeholder-style="color:#999999"
placeholder-style="color:#999999" /> v-model="data.guestRoom" />
</view> </view>
</view> </view>
<view class="list-item" @click="showDate = true"> <view class="list-item">
<view class="flex" style="flex: 1;text-align: left;"> <view class="flex w-220" style="text-align: left;">
<text class="t">*</text> <text class="t">*</text>
<text class="name">到访时间</text> <text class="name">手机号</text>
</view> </view>
<view class="flex-column-center" style="flex: 2;"> <view style="flex: 1;">
<text style="flex: 1;text-align: left;">{{startTimeValue==""?"请选择到访时间":startTimeValue}}</text> <input class="" style="text-align: left;" placeholder="请输入手机号" placeholder-style="color:#999999"
<image class="h-20 w-20" src="@/static/icon_r.png"></image> v-model="data.guestPhone" />
</view> </view>
</view> </view>
<view class="list-item"> <view class="list-item">
<view class="flex" style="flex: 1;text-align: left;"> <view class="flex w-220" style="text-align: left;">
<text class="t">*</text> <text class="t">*</text>
<text class="name">手机号</text> <text class="name">验证码</text>
</view> </view>
<view style="flex: 2;"> <view style="flex: 1;">
<input class="" style="text-align: left;" placeholder="请输入手机号" <input class="" style="text-align: left;" placeholder="请输入验证码" placeholder-style="color:#999999"
placeholder-style="color:#999999" /> v-model="data.phoneCode" />
</view>
<view>
<u-toast ref="uToast"></u-toast>
<u-code seconds="60" ref="uCode" @change="codeChange"></u-code>
<u-button @tap="getCode">{{tips}}</u-button>
</view> </view>
</view> </view>
<view class="list-item"> <view class="list-item">
...@@ -64,35 +70,32 @@ ...@@ -64,35 +70,32 @@
<text class="name">车牌号</text> <text class="name">车牌号</text>
</view> </view>
<view style="flex: 2;"> <view style="flex: 2;">
<input class="" style="text-align: left;" placeholder="请输入车牌号" <input class="" style="text-align: left;" placeholder="请输入车牌号" placeholder-style="color:#999999"
placeholder-style="color:#999999" /> v-model="data.plateNumber" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="mt-65"> <view class="mt-65">
<text class="plr-100 ptb-25 br-12 fs-30" style="background:#1FCA7C;color: #fff;">提交</text> <text class="plr-100 ptb-25 br-12 fs-30" style="background:#1FCA7C;color: #fff;" @click="onAdd">提交</text>
</view> </view>
<u-popup :show="show" mode="center" @close="close" @open="open" round="20"> <u-popup :show="show" mode="center" @close="close" @open="open" round="20">
<view class="flex-column mlr-50" style="width:600rpx;"> <view class="flex-column mlr-50" style="width:600rpx;">
<text class="fs-32 fw-600 mtb-20">选择小区</text> <text class="fs-32 fw-600 mtb-20">选择小区</text>
<scroll-view scroll-y class="h-400"> <scroll-view scroll-y class="h-400">
<view v-for="(item, index) in 8" :key="index"> <view v-for="(item, index) in listXq" :key="index" @click="onSelect(index)">
<view class="fs-24 pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="fs-24 pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text>西城小区</text> <text
:style="selectIndex==index?'color: #1FCA7C;':'color: #000000;'">{{item.communityName}}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="mt-40"> <view class="mt-40" @click="onSubmit()">
<text class="plr-80 ptb-12 br-12" style="background:#1FCA7C;color: #fff;">下一步</text> <text class="plr-80 ptb-12 br-12" style="background:#1FCA7C;color: #fff;">下一步</text>
</view> </view>
</view> </view>
</u-popup> </u-popup>
<u-datetime-picker ref="datetimePicker" :show="showDate" v-model="startTime" mode="date" :formatter="formatter"
:closeOnClickOverlay="true" @confirm="onConfirmStartTime" @cancel="onCloseStartTime"
@close="onCloseStartTime"></u-datetime-picker>
</view> </view>
</template> </template>
...@@ -100,10 +103,19 @@ ...@@ -100,10 +103,19 @@
export default { export default {
data() { data() {
return { return {
showDate: false, tips: '',
startTimeValue: "",
startTime: new Date().getTime(),
show: false, show: false,
selectIndex: -1,
address: '',
data: {
guestName: "", //访客姓名
guestPhone: "", //访客手机
communityId: 0, //小区ID
guestRoom: "", //访客房间号
plateNumber: "", //车牌号
phoneCode: "" //手机验证码
},
listXq: [],
list1: [ list1: [
"https://zhongqian.xnszz.com/1-images/home/20250213002.png", "https://zhongqian.xnszz.com/1-images/home/20250213002.png",
], ],
...@@ -131,43 +143,94 @@ ...@@ -131,43 +143,94 @@
}; };
}, },
onLoad(options) { onLoad(options) {
this.listAll()
},
onReady() {
// 微信小程序需要用此写法
this.$refs.datetimePicker.setFormatter(this.formatter)
}, },
methods: { methods: {
open() { //选择小区
// console.log('open'); listAll() {
const params = {
url: '/api/community/listAll',
loadingTip: '',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
console.log(res.data)
this.listXq = res.data
})
}, },
close() { onSelect(index) {
this.selectIndex = index
},
onSubmit() {
this.show = false this.show = false
// console.log('close'); this.data.communityId = this.listXq[this.selectIndex].communityId;
this.address = this.listXq[this.selectIndex].communityName;
uni.setStorageSync('addressItem', this.listXq[this.selectIndex]);
}, },
formatter(type, value) { //获取验证码
if (type === 'year') { codeChange(text) {
return `${value}年` this.tips = text;
},
getCode() {
if (!this.data.guestPhone) {
this.$wskj.toast('请输入手机号');
return
} }
if (type === 'month') { if (this.$refs.uCode.canGetCode) {
return `${value}月` const params = {
url: '/api/login/sendSmsCode',
loadingTip: '',
method: 'GET',
data: {
mobile: this.data.guestPhone
} }
if (type === 'day') {
return `${value}日`
} }
return value this.$request(params).then(res => {
}, this.$refs.uCode.start();
onOpenStartTime() { })
this.showDate = true
} else {
this.$wskj.toast('倒计时结束后再发送');
}
}, },
onCloseStartTime() { //新增访客
this.showDate = false onAdd() {
if (!this.data.guestName) {
this.$wskj.toast('请输入姓名');
return
}
if (!this.data.communityId) {
this.$wskj.toast('请选择小区');
return
}
if (!this.data.guestRoom) {
this.$wskj.toast('请输入房间号');
return
}
if (!this.data.guestPhone) {
this.$wskj.toast('请输入手机号');
return
}
if (!this.data.phoneCode) {
this.$wskj.toast('请输入验证码');
return
}
const params = {
url: '/api/guest/add',
loadingTip: '加载中...',
data: this.data
}
this.$request(params).then(res => {
})
}, },
onConfirmStartTime(e) { open() {
this.onCloseStartTime() this.show = true
this.startTimeValue = this.$wskj.timeFormat(e.value, 'yyyy-mm-dd')
this.$emit('onConfirmStartTime', this.startTimeValue)
}, },
close() {
this.show = false
}
} }
}; };
</script> </script>
......
<template> <template>
<view class='center'> <view class='center'>
<view style="background: linear-gradient( 180deg, #1FCA7C 0%, #F2F2F2 100%);"> <view style="background: linear-gradient( 180deg, #1FCA7C 0%, #F2F2F2 100%);">
<u-navbar :autoBack="true" title="报修详情" placeholder="true" bgColor="transparent" leftIconColor="#FFF" <u-navbar :autoBack="true" title="服务规则说明" placeholder="true" bgColor="transparent" leftIconColor="#FFF"
:title-style="{color: '#FFF'}"> :title-style="{color: '#FFF'}">
</u-navbar> </u-navbar>
<view class="h-300 flex flex-row-between v-center ml-60 mr-35"> <view class="h-300 flex flex-row-between v-center ml-60 mr-35">
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
<scroll-view scroll-y style="height: 100%;"> <scroll-view scroll-y style="height: 100%;">
<view class="mar-20"> <view class="mar-20">
<u-parse :content="content"></u-parse> <u-parse :content="content"></u-parse>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
...@@ -40,48 +37,19 @@ ...@@ -40,48 +37,19 @@
}; };
}, },
onLoad(e) { onLoad(e) {
this.content = decodeURIComponent("<p>露从今夜白,月是故乡明</p>") this.onGz(1)
}, },
methods: { methods: {
onSubmit() { onGz(type) {
this.$wskj.to("/pagesMain/pages/tjsq?type=" + this.type) const params = {
// if (!this.reason) { url: '/api/rule/' + type,
// return this.$u.toast('请输入内容') loadingTip: '',
// } method: 'GET',
// if (!this.images) { data: {}
// return this.$u.toast('请至少上传一张照片') }
// } this.$request(params).then(res => {
// if (this.reason.length < 10) { this.content = decodeURIComponent(res.data.ruleContent)
// return this.$u.toast('文字描述最低10个字') })
// }
// this.submitShow = true
},
// 提交
onConfirmSubmit() {
// const params = {
// url: '/api/user/yijian',
// loadingTip: '',
// data: {
// content: this.reason,
// images: this.images
// }
// }
// // console.log(params);
// this.$request(params).then(res => {
// // console.log(res)
// this.submitShow = false
// if (res.code === 1) {
// this.$u.toast(res.msg || '提交成功')
// this.reason = ''
// this.images = ''
// } else {
// this.$u.toast(res.msg || '提交失败')
// }
// }).catch(err => {
// this.submitShow = false
// this.$u.toast(err.msg || '提交失败')
// })
} }
}, },
}; };
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
return return
} }
if (index == 3) { if (index == 3) {
this.$wskj.to("/pagesMain/pages/fwgz") this.$wskj.to("/pagesMain/pages/fwgz?type=2")
return return
} }
} }
......
...@@ -6,23 +6,19 @@ ...@@ -6,23 +6,19 @@
<text class="fs-32 fw-700 pad-30" style="text-align: left;">家庭成员</text> <text class="fs-32 fw-700 pad-30" style="text-align: left;">家庭成员</text>
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text>姓名</text> <text>姓名</text>
<input style="text-align: right;" placeholder="请输入姓名" /> <input style="text-align: right;" placeholder="请输入姓名" v-model="data.name" />
</view> </view>
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;" @click="open"> <!-- <view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;" @click="open">
<text>性别</text> <text>性别</text>
<view class="flex v-center"> <view class="flex v-center">
<text>{{sex==''?"请选择":sex}}</text> <text>{{sex==''?"请选择":sex}}</text>
<image class="w-25 h-30 ml-10" src="/static/icon_r.png"></image> <image class="w-25 h-30 ml-10" src="/static/icon_r.png"></image>
</view> </view>
</view> </view> -->
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text>关系</text>
<input style="text-align: right;" placeholder="请输入和业主的关系" />
</view>
<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;"> <view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
<text>手机号</text> <text>手机号</text>
<input style="text-align: right;" :disabled="disabled" type="tel" maxlength="11" <input style="text-align: right;" :disabled="disabled" type="tel" maxlength="11"
placeholder="请输入手机号" /> placeholder="请输入手机号" v-model="data.phone" />
</view> </view>
</view> </view>
...@@ -30,12 +26,15 @@ ...@@ -30,12 +26,15 @@
@confirm="confirm"></u-picker> @confirm="confirm"></u-picker>
</scroll-view> </scroll-view>
</view> </view>
<view class="h-140 pt-20"> <view class="pt-20">
<!-- <view class="fullscreen-btn"> <view v-if="type==0" class="fullscreen-btn mb-30" @click="onClick('确认添加')">
确认添加 确认添加
</view> --> </view>
<view class="fullscreen-btn" style="background: #FF6363;"> <view v-if="type==1" class="fullscreen-btn mb-30" @click="onClick('确认修改')">
删除 确认修改
</view>
<view v-if="type==1" class="fullscreen-btn mb-30" style="background: #FF6363;" @click="onClick('确认删除')">
确认删除
</view> </view>
</view> </view>
...@@ -52,11 +51,29 @@ ...@@ -52,11 +51,29 @@
columns: [ columns: [
['', ''] ['', '']
], ],
type: 0,
userInfo: '',
data: {
id: "",
proprietorId: 0,
name: "",
phone: "",
}
}; };
}, },
onLoad(options) { onLoad(options) {
this.type = options.type
if (this.type == 1) {
this.disabled = true
}
if (!this.$wskj.isNull(options.data)) {
const json = JSON.parse(decodeURIComponent(options.data))
console.log(json)
this.data.id = json.id
this.data.name = json.name
this.data.phone = json.phone
}
this.getUserInfo()
}, },
methods: { methods: {
open() { open() {
...@@ -69,7 +86,83 @@ ...@@ -69,7 +86,83 @@
this.show = false this.show = false
this.sex = e.value[0] this.sex = e.value[0]
console.log("LMG", e.value[0]) console.log("LMG", e.value[0])
},
onClick(e) {
if (e == "确认添加") {
this.add()
return
}
if (e == "确认修改") {
this.up()
return
}
if (e == "确认删除") {
this.delete()
return
} }
},
getUserInfo() {
const params = {
url: '/api/login/userInfo',
loadingTip: '',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
this.data.proprietorId = res.data.proprietorId
})
},
add() {
if (this.$wskj.isNull(this.data.name)) {
this.$wskj.toast('请输入姓名')
return
}
if (this.$wskj.isNull(this.data.phone)) {
this.$wskj.toast('请输入手机号')
return
}
const params = {
url: '/api/familyMember/add',
data: this.data
}
this.$request(params).then(res => {
this.$u.toast(res.msg || '添加成功')
setTimeout(() => {
this.$wskj.goBack(1)
}, 600)
})
},
up() {
if (this.$wskj.isNull(this.data.name)) {
this.$wskj.toast('请输入姓名')
return
}
const params = {
url: '/api/familyMember/update',
data: {
id: this.data.id,
name: this.data.name
}
}
this.$request(params).then(res => {
this.$u.toast(res.msg || '修改成功')
setTimeout(() => {
this.$wskj.goBack(1)
}, 600)
})
},
delete() {
const params = {
url: '/api/familyMember/delete/' + this.data.id,
}
this.$request(params).then(res => {
this.$u.toast(res.msg || '删除成功')
setTimeout(() => {
this.$wskj.goBack(1)
}, 600)
})
},
} }
}; };
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
<view class="flex-column br-12 pad-25" style="background: #F3FEF9;"> <view class="flex-column br-12 pad-25" style="background: #F3FEF9;">
<view class="flex v-center"> <view class="flex v-center">
<image class="h-42 w-42" src="/static/icon_my_fw.png"></image> <image class="h-42 w-42" src="/static/icon_my_fw.png"></image>
<text class="fs-28">利达国宾中心</text> <text class="fs-28">{{userInfo.communityName}}</text>
<image class="h-25 w-25 mt-5" src="/static/icon_r.png"></image> <image class="h-25 w-25 mt-5" src="/static/icon_r.png"></image>
</view> </view>
<text class="fs-24 h-54 lh-54 mt-30" <text class="fs-24 h-54 lh-54 mt-30"
style="background: linear-gradient( 90deg, #CAF6E2 0%, #FFFFFF 100%);"> style="background: linear-gradient( 90deg, #CAF6E2 0%, #FFFFFF 100%);">
1栋2单元205室 {{userInfo.room}}
</text> </text>
</view> </view>
</view> </view>
...@@ -23,19 +23,11 @@ ...@@ -23,19 +23,11 @@
<view class="overflow-y"> <view class="overflow-y">
<scroll-view scroll-y style="height: 100%;"> <scroll-view scroll-y style="height: 100%;">
<view @click="onClickSelecte(index)" v-for="(item, index) in 10" :key="index"> <view @click="onClickSelecte(index)" v-for="(item, index) in list" :key="index">
<view class="flex-column br-12 fs-28 pad-30 mb-20" style="background: #FFFFFF;"> <view class="flex-column br-12 fs-28 pad-30 mb-20" style="background: #FFFFFF;">
<view class="flex vh-center"> <view class="flex-between-center">
<image class="w-95 h-95 br-50" src="/static/icon_logo.png"></image> <text class="fs-30">{{item.name}}</text>
<view class="flex-column ml-20" style="text-align: left;flex: 1;"> <text class="fs-28">{{item.phone}}</text>
<text class="fs-30">家庭成员1</text>
<view class="flex">
<text class="fs-22 mt-10 plr-20 ptb-5 br-4"
style="border: 1px solid #1FCA7C;color: #1FCA7C;">长辈1</text>
</view>
</view>
<text class="fs-28">17787878787</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -54,13 +46,39 @@ ...@@ -54,13 +46,39 @@
export default { export default {
data() { data() {
return { return {
selecteIndex: 0 userInfo: '',
list: [],
}; };
}, },
onLoad(options) { onLoad(options) {
},
onShow() {
this.getUserInfo()
}, },
methods: { methods: {
getList() {
const params = {
url: '/api/familyMember/listAllByUserId',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
console.log(res.data)
this.list = res.data
})
},
getUserInfo() {
const params = {
url: '/api/login/userInfo',
method: 'GET',
data: {}
}
this.$request(params).then(res => {
this.userInfo = res.data
this.getList()
})
},
open() { open() {
}, },
...@@ -69,13 +87,13 @@ ...@@ -69,13 +87,13 @@
}, },
onClick(index) { onClick(index) {
if (index == 0) { if (index == 0) {
this.$wskj.to("/pagesMine/pages/jtcy") this.$wskj.to("/pagesMine/pages/jtcy?type=0")
return return
} }
}, },
onClickSelecte(index) { onClickSelecte(index) {
this.selecteIndex = index this.selecteIndex = index
this.$wskj.to("/pagesMine/pages/jtcy") this.$wskj.to("/pagesMine/pages/jtcy?type=1&data=" + encodeURIComponent(JSON.stringify(this.list[index])))
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment