lipengcheng 1 month ago
parent
commit
9bf889dcc3
  1. 2
      pages.json
  2. 8
      pages/api.js
  3. 39
      pages/tabBar/sdPage/dfReport.vue
  4. 48
      pages/tabBar/sdPage/sfReport.vue
  5. 6
      pages/tabBar/work/index.vue
  6. 91
      pages/tabBar/xjPage/xj.vue
  7. 4
      pagesA/checkout/detail/detail.vue
  8. BIN
      static/img/camera-icon.png
  9. 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  10. 24289
      unpackage/dist/dev/mp-weixin/common/vendor.js
  11. 1
      utils/config.js
  12. 40
      utils/request.js

2
pages.json

@ -46,7 +46,7 @@
{ {
"path": "pages/tabBar/xjPage/xj", "path": "pages/tabBar/xjPage/xj",
"style": { "style": {
"navigationBarTitleText": "巡检", "navigationBarTitleText": "巡检上报",
"disableScroll": true "disableScroll": true
} }
}, },

8
pages/api.js

@ -0,0 +1,8 @@
import request from "../utils/request.js";
export function getList(params) {
return request({
url: "/api/v1/user/list",
method: "get",
params,
});
}

39
pages/tabBar/sdPage/dfReport.vue

@ -13,7 +13,7 @@
<view class="info-card"> <view class="info-card">
<view class="meter-row"> <view class="meter-row">
<view class="meter-label"> <view class="meter-label">
<view style="color: #f93838;margin-right: 4rpx;">*</view> <view style="color: #f93838;margin-right: 4rpx;font-size: 24rpx;">*</view>
<text>乐业社区</text> <text>乐业社区</text>
</view> </view>
<view class="picker-label"> <view class="picker-label">
@ -25,7 +25,7 @@
</view> </view>
<view class="meter-row"> <view class="meter-row">
<view class="meter-label"> <view class="meter-label">
<view style="color: #f93838;margin-right: 4rpx;">*</view> <view style="color: #f93838;margin-right: 4rpx;font-size: 24rpx;">*</view>
<text>房屋</text> <text>房屋</text>
</view> </view>
<view class="picker-label"> <view class="picker-label">
@ -39,7 +39,6 @@
<view class="section-card"> <view class="section-card">
<view class="meter-row"> <view class="meter-row">
<text class="meter-label">水表号</text> <text class="meter-label">水表号</text>
<!-- <text>20072620</text> -->
<u-input v-model="form.waterMeter" type="digit" placeholder="请输入水表号" border="none" /> <u-input v-model="form.waterMeter" type="digit" placeholder="请输入水表号" border="none" />
</view> </view>
<view class="meter-row"> <view class="meter-row">
@ -66,7 +65,9 @@
@delete="onDelete" @delete="onDelete"
> >
<view class="custom-upload-btn"> <view class="custom-upload-btn">
<u-icon name="plus" size="40"></u-icon> <view class="icon-box">
<image class="camera-icon" src="/static/img/camera-icon.png" mode="aspectFill"></image>
</view>
<view class="upload-tips">点击上传</view> <view class="upload-tips">点击上传</view>
</view> </view>
</u-upload> </u-upload>
@ -75,7 +76,7 @@
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submit-btn-wrap"> <view class="submit-btn-wrap">
<u-button type="primary" shape="circle" @click="onSubmit">提交</u-button> <u-button class="u-button--primary " type="primary" shape="circle" @click="onSubmit">提交</u-button>
</view> </view>
</view> </view>
</template> </template>
@ -104,10 +105,6 @@ export default {
} else if(type == '房屋'){ } else if(type == '房屋'){
this.form.pickerValue2 = this.items[e.detail.value] this.form.pickerValue2 = this.items[e.detail.value]
} }
},
onDeviceChange(idx, val) {
this.deviceList[idx].status = val
}, },
afterRead(event) { afterRead(event) {
let files = Array.isArray(event) ? event : [event] let files = Array.isArray(event) ? event : [event]
@ -158,16 +155,19 @@ export default {
z-index: 1; z-index: 1;
font-size: 44rpx; font-size: 44rpx;
color:#101010; color:#101010;
font-weight: bold;
} }
.bg-text view:nth-child(2){ .bg-text view:nth-child(2){
font-size: 28rpx; font-size: 28rpx;
color:#666666; color:#666666;
margin-top: 10rpx;
font-weight: 400;
} }
.info-card { .info-card {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
margin: -80rpx 24rpx 16rpx 24rpx; margin: -100rpx 24rpx 16rpx 24rpx;
padding: 24rpx 24rpx 12rpx 24rpx; padding: 24rpx 24rpx 12rpx 24rpx;
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04); box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
position: relative; position: relative;
@ -237,6 +237,7 @@ display: flex;
.arrow-r{ .arrow-r{
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-left: 8rpx;
} }
.u-input .u-input__content uni-input { .u-input .u-input__content uni-input {
text-align: right !important; text-align: right !important;
@ -260,6 +261,19 @@ display: flex;
justify-content: center; justify-content: center;
margin: 20rpx 16rpx 0 0; margin: 20rpx 16rpx 0 0;
} }
.icon-box{
width: 60rpx;
height: 60rpx;
background: #ceeced;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.camera-icon{
width: 36rpx;
height: 36rpx;
}
.upload-tips { .upload-tips {
color: #bbb; color: #bbb;
font-size: 24rpx; font-size: 24rpx;
@ -288,13 +302,14 @@ display: flex;
background: linear-gradient(90deg, #0DC6C6 0%, #13C2C2 100%) !important; background: linear-gradient(90deg, #0DC6C6 0%, #13C2C2 100%) !important;
font-size: 36rpx; font-size: 36rpx;
border-radius: 48rpx !important; border-radius: 48rpx !important;
width: 80vw; border: none;
width: 80%;
height: 88rpx; height: 88rpx;
} }
</style> </style>
<style> <style>
.dfReport .u-input{ .dfReport .u-input__content__field-wrapper__field{
text-align: right !important; text-align: right !important;
} }
</style> </style>

48
pages/tabBar/sdPage/sfReport.vue

@ -13,7 +13,7 @@
<view class="info-card"> <view class="info-card">
<view class="meter-row"> <view class="meter-row">
<view class="meter-label"> <view class="meter-label">
<view style="color: #f93838;margin-right: 4rpx;">*</view> <view style="color: #f93838;margin-right: 4rpx;font-size: 24rpx;">*</view>
<text>乐业社区</text> <text>乐业社区</text>
</view> </view>
<view class="picker-label"> <view class="picker-label">
@ -25,7 +25,7 @@
</view> </view>
<view class="meter-row"> <view class="meter-row">
<view class="meter-label"> <view class="meter-label">
<view style="color: #f93838;margin-right: 4rpx;">*</view> <view style="color: #f93838;margin-right: 4rpx;font-size: 24rpx;">*</view>
<text>房屋</text> <text>房屋</text>
</view> </view>
<view class="picker-label"> <view class="picker-label">
@ -66,7 +66,9 @@
@delete="onDelete" @delete="onDelete"
> >
<view class="custom-upload-btn"> <view class="custom-upload-btn">
<u-icon name="plus" size="40"></u-icon> <view class="icon-box">
<image class="camera-icon" src="/static/img/camera-icon.png" mode="aspectFill"></image>
</view>
<view class="upload-tips">点击上传</view> <view class="upload-tips">点击上传</view>
</view> </view>
</u-upload> </u-upload>
@ -74,8 +76,9 @@
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submit-btn-wrap"> <view class="u-button--primary" @click="onSubmit">提交
<u-button type="primary" shape="circle" @click="onSubmit">提交</u-button>
<!-- <u-button class="u-button--primary" type="primary" shape="circle" @click="onSubmit">提交</u-button> -->
</view> </view>
</view> </view>
</template> </template>
@ -104,10 +107,6 @@ export default {
} else if(type == '房屋'){ } else if(type == '房屋'){
this.form.pickerValue2 = this.items[e.detail.value] this.form.pickerValue2 = this.items[e.detail.value]
} }
},
onDeviceChange(idx, val) {
this.deviceList[idx].status = val
}, },
afterRead(event) { afterRead(event) {
let files = Array.isArray(event) ? event : [event] let files = Array.isArray(event) ? event : [event]
@ -158,16 +157,19 @@ export default {
z-index: 1; z-index: 1;
font-size: 44rpx; font-size: 44rpx;
color:#101010; color:#101010;
font-weight: bold;
} }
.bg-text view:nth-child(2){ .bg-text view:nth-child(2){
font-size: 28rpx; font-size: 28rpx;
color:#666666; color:#666666;
margin-top: 10rpx;
font-weight: 400;
} }
.info-card { .info-card {
background: #fff; background: #fff;
border-radius: 20rpx; border-radius: 20rpx;
margin: -80rpx 24rpx 16rpx 24rpx; margin: -100rpx 24rpx 16rpx 24rpx;
padding: 24rpx 24rpx 12rpx 24rpx; padding: 24rpx 24rpx 12rpx 24rpx;
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04); box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
position: relative; position: relative;
@ -237,6 +239,7 @@ display: flex;
.arrow-r{ .arrow-r{
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-left: 8rpx;
} }
.u-input .u-input__content uni-input { .u-input .u-input__content uni-input {
text-align: right !important; text-align: right !important;
@ -260,6 +263,19 @@ display: flex;
justify-content: center; justify-content: center;
margin: 20rpx 16rpx 0 0; margin: 20rpx 16rpx 0 0;
} }
.icon-box{
width: 60rpx;
height: 60rpx;
background: #ceeced;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.camera-icon{
width: 36rpx;
height: 36rpx;
}
.upload-tips { .upload-tips {
color: #bbb; color: #bbb;
font-size: 24rpx; font-size: 24rpx;
@ -280,21 +296,29 @@ display: flex;
.submit-btn-wrap { .submit-btn-wrap {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
margin: 40rpx 0 0 0; margin: 40rpx 0 0 0;
} }
.u-button--primary { .u-button--primary {
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(90deg, #0DC6C6 0%, #13C2C2 100%) !important; background: linear-gradient(90deg, #0DC6C6 0%, #13C2C2 100%) !important;
font-size: 36rpx; font-size: 36rpx;
border-radius: 48rpx !important; border-radius: 48rpx !important;
width: 80vw; border: none;
margin: auto;
margin-top: 40rpx;
width: 80%;
height: 88rpx; height: 88rpx;
color: rgba(255, 255, 255, 1);
} }
</style> </style>
<style> <style>
.sfReport .u-input{ .sfReport .u-input__content__field-wrapper__field{
text-align: right !important; text-align: right !important;
} }
</style> </style>

6
pages/tabBar/work/index.vue

@ -67,8 +67,8 @@ export default {
{ image: '/static/img/强制清退.png', text: '强制清退' }, { image: '/static/img/强制清退.png', text: '强制清退' },
], ],
xjList: [ xjList: [
{ image: '/static/img/巡查.png', text: '巡检' }, { image: '/static/img/巡查.png', text: '巡检上报' },
{ image: '/static/img/记录.png', text: '记录' }, { image: '/static/img/记录.png', text: '巡检记录' },
], ],
sdList: [ sdList: [
{ image: '/static/img/水费.png', text: '水费上报' }, { image: '/static/img/水费.png', text: '水费上报' },
@ -118,7 +118,7 @@ export default {
} }
}, },
handelXjClick (item) { handelXjClick (item) {
if (item.text === '巡检') { if (item.text === '巡检上报') {
// //
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabBar/xjPage/xj' url: '/pages/tabBar/xjPage/xj'

91
pages/tabBar/xjPage/xj.vue

@ -5,9 +5,9 @@
<view class="xjTitle">填写信息</view> <view class="xjTitle">填写信息</view>
<view class="xjTips">请您填写相关问题</view> <view class="xjTips">请您填写相关问题</view>
<view class="conItem"> <view class="conItem">
<u--form labelPosition="left" :model="userInfo" ref="uForm"> <u-form labelPosition="left" :rules="rules" :model="userInfo" ref="uForm">
<u-form-item labelAlign="right" labelWidth="100px" label="乐业社区" prop="userInfo.sex" borderBottom <u-form-item labelAlign="right" labelWidth="100px" label="乐业社区" prop="sex" borderBottom
@click="lysqShow = true; hideKeyboard()" ref="item1"> @click="lysqShow = true; hideKeyboard()" ref="item1">
<u--input v-model="userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择" border="none"></u--input> <u--input v-model="userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
@ -26,9 +26,31 @@
<u-form-item labelAlign="right" labelWidth="100px" label="问题描述" prop="userInfo.sex" borderBottom ref="item1"> <u-form-item labelAlign="right" labelWidth="100px" label="问题描述" prop="userInfo.sex" borderBottom ref="item1">
<u--textarea v-model="userInfo.sex" placeholder="请输入内容" count maxlength="500"></u--textarea> <u--textarea v-model="userInfo.sex" placeholder="请输入内容" count maxlength="500"></u--textarea>
</u-form-item> </u-form-item>
<u-form-item labelAlign="right" labelWidth="120px" label="上传图片/视频" prop="userInfo.sex" borderBottom ref="item1">
<u-upload
v-model="fileList"
:max-count="10"
:multiple="true"
:preview-full-image="true"
:deletable="true"
:show-upload-list="true"
:file-list="fileList"
accept="image"
@after-read="afterRead"
@delete="onDelete"
>
<view class="custom-upload-btn">
<view class="icon-box">
<image class="camera-icon" src="/static/img/camera-icon.png" mode="aspectFill"></image>
</view>
<view class="upload-tips">点击上传</view>
</view>
</u-upload>
</u-form-item>
</u--form> </u-form>
</view> </view>
<view class="conItem" style="margin-top: 40rpx;"> <view class="conItem" style="margin-top: 40rpx;">
@ -73,14 +95,27 @@ export default {
name: '', name: '',
phone: '', phone: '',
}, },
rules:{
sex:[
{ required: true, message: '请输入', trigger: 'blur' }
]
},
radio: '', radio: '',
switchVal: false, switchVal: false,
fileList: [],
} }
}, },
onLoad () { onLoad () {
this.handleLogin() this.handleLogin()
}, },
methods: { methods: {
afterRead(event) {
let files = Array.isArray(event) ? event : [event]
this.fileList = this.fileList.concat(files)
},
onDelete(event) {
this.fileList.splice(event.index, 1)
},
async handleLogin () { async handleLogin () {
try { try {
const res = await listHouseWithCount({ const res = await listHouseWithCount({
@ -95,7 +130,12 @@ export default {
} }
}, },
handleBtn () { handleBtn () {
this.$refs['uForm'].validate((valid) => {
if (valid) {
console.log(this.userInfo);
}
})
}, },
sexSelect (e) { sexSelect (e) {
this.model1.userInfo.sex = e.name this.model1.userInfo.sex = e.name
@ -162,4 +202,47 @@ export default {
margin: auto; margin: auto;
margin-top: 40rpx; margin-top: 40rpx;
} }
.custom-upload-btn {
width: 160rpx;
height: 160rpx;
background: #fafafa;
border: 2rpx solid #f0f0f0;
border-radius: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 20rpx 16rpx 0 0;
}
.icon-box{
width: 60rpx;
height: 60rpx;
background: #ceeced;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.camera-icon{
width: 36rpx;
height: 36rpx;
}
.upload-tips {
color: #bbb;
font-size: 24rpx;
margin-top: 8rpx;
}
.u-upload__wrap {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-top: 20rpx;
}
.u-upload__preview {
border-radius: 16rpx;
overflow: hidden;
margin-right: 16rpx;
margin-bottom: 16rpx;
}
</style> </style>

4
pagesA/checkout/detail/detail.vue

@ -134,10 +134,10 @@ export default {
this.deviceList[idx].status = val; this.deviceList[idx].status = val;
}, },
afterRead(event) { afterRead(event) {
let files = Array.isArray(event) ? event : [event]; let files = Array.isArray(event.file) ? event.file : [event.file];
this.fileList = this.fileList.concat(files); this.fileList = this.fileList.concat(files);
}, },
onDelete(event) { deletePic(event) {
this.fileList.splice(event.index, 1); this.fileList.splice(event.index, 1);
}, },
onSubmit() { onSubmit() {

BIN
static/img/camera-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map

File diff suppressed because one or more lines are too long

24289
unpackage/dist/dev/mp-weixin/common/vendor.js

File diff suppressed because one or more lines are too long

1
utils/config.js

@ -0,0 +1 @@
export const baseUrl = "";

40
utils/request.js

@ -0,0 +1,40 @@
// utils/request.js
const BASE_URL = 'https://your-api-url.com'; // 替换为你的后端地址
export default function request(options = {}) {
// 获取token(假设存储在本地storage)
const token = uni.getStorageSync('token') || '';
return new Promise((resolve, reject) => {
uni.request({
url: BASE_URL + options.url,
method: options.method || "GET",
data:
options.method === "GET" ? options.data : JSON.stringify(options.data),
header: {
"Content-Type": options.contentType || "application/json",
Authorization: token ? `Bearer ${token}` : "",
...options.header,
},
success: (res) => {
// 这里可根据后端返回结构统一处理
if (res.statusCode === 200) {
resolve(res.data);
} else if (res.statusCode === 401) {
uni.showToast({ title: "登录失效,请重新登录", icon: "none" });
uni.redirectTo({
url: "/pages/login/login",
});
reject(res);
} else {
uni.showToast({ title: res.data.msg || "请求失败", icon: "none" });
reject(res);
}
},
fail: (err) => {
uni.showToast({ title: "网络异常", icon: "none" });
reject(err);
},
});
});
}
Loading…
Cancel
Save