Browse Source

fix:修复数据问题

master
xiaohei 1 year ago
parent
commit
b10309ace0
17 changed files with 149 additions and 173 deletions
  1. +26
    -0
      index.html
  2. +0
    -9
      src/config/constant.js
  3. BIN
      src/images/camera.png
  4. +1
    -1
      src/main.ts
  5. +8
    -15
      src/packages/enterprise/pages/create-enterprise/create-enterprise.vue
  6. +12
    -16
      src/packages/enterprise/pages/details/details.vue
  7. +29
    -42
      src/packages/enterprise/pages/issue-appeal/issue-appeal.vue
  8. +6
    -8
      src/packages/enterprise/pages/my-appeal/my-appeal.vue
  9. +12
    -13
      src/packages/enterprise/pages/relation-enterprise/relation-enterprise.vue
  10. +1
    -2
      src/packages/my/pages/integral/integral.vue
  11. +1
    -1
      src/packages/people/pages/guide/guide.vue
  12. +12
    -22
      src/packages/people/pages/masses-create/masses-create.vue
  13. +19
    -26
      src/packages/people/pages/mediate-create/mediate-create.vue
  14. +16
    -15
      src/packages/people/pages/second/second.vue
  15. +1
    -0
      src/pages/enterprise/enterprise.vue
  16. +3
    -2
      src/pages/life/life.vue
  17. +2
    -1
      src/utils/upload.js

+ 26
- 0
index.html View File

@@ -12,9 +12,35 @@
<title></title>
<!--preload-links-->
<!--app-context-->
<script src="https://webapi.amap.com/maps?v=1.4.15&key=a24126d522c5dedb7791207742b6360b"></script>
<script type="text/javascript">
//初始化地图时,若center属性缺省,地图默认定位到用户所在城市的中心
var map = new AMap.Map('container', {
resizeEnable: true
});
AMap.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位,默认:5s
buttonPosition:'RB', //定位按钮的停靠位置
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
zoomToAccuracy: true, //定位成功后是否自动调整地图视野到定位点

});
map.addControl(geolocation);
geolocation.getCurrentPosition(function(status,result){
console.log(status,result);
if(status=='complete'){
console.log("result",result);
window.localStorage.setItem('userLocation',result.position.lng+','+result.position.lat)
}
});
});
</script>
</head>
<body>
<div id="app"><!--app-html--></div>
<div id="container"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

+ 0
- 9
src/config/constant.js View File

@@ -18,15 +18,6 @@ function getLocationInfo() {
// console.log('纬度:' + res.latitude);
// console.log('经度:' + res.longitude);
// });
uni.request({
url: 'https://www.cz88.net/api/cz88/ip/base?ip=',
success: (res) => {
console.log(res.data.data.locations);
let latitudObj = res.data.data.locations[0]
// this.text = 'request success';
uni.setStorageSync('userLocation', latitudObj.latitude + ',' + latitudObj.longitude)
}
})
// const myAmapFun = new amap.AMapWX({
// key: env.aMapKey
// });


BIN
src/images/camera.png View File

Before After
Width: 436  |  Height: 436  |  Size: 14KB

+ 1
- 1
src/main.ts View File

@@ -31,7 +31,7 @@ import {
TimePicker,
DatePicker,
Form,
CheckboxGroup
CheckboxGroup,
} from 'vant';

import share from '@/utils/share.js'


+ 8
- 15
src/packages/enterprise/pages/create-enterprise/create-enterprise.vue View File

@@ -1,8 +1,8 @@
<template>
<view style="height: 100%">
<view>
<custom-nav-bar position="fixed" color="black" left-text="新增关联企业" left-arrow />

<scroll-view :scroll-y="true" :style="'height: ' + (windowHeight - 80 - 36 - 20) + 'px;'">
<scroll-view :scroll-y="true" :style="'height: 470px;'">
<view class="create-enterprise">
<view class="border">
<view class="create-enterprise-title">
@@ -63,9 +63,7 @@
},
async onLoad() {
const res = uni.getSystemInfoSync();
this.setData({
windowHeight: res.windowHeight
});
this.windowHeight = res.windowHeight
},
async onShow() {},
methods: {
@@ -84,24 +82,19 @@
const {
name
} = event.currentTarget.dataset;
this.form[name] = value;
this.setData({
...this.form,
[name]: this[name]
});
this.form = {...this.form},
this[name]= this[name]
const {
enterpriseName,
identificationNumber,
legalName
} = this.form;
if (enterpriseName !== '' && identificationNumber !== '' && legalName !== '') {
this.setData({
isForm: true
});
this.isForm = true
} else {
this.setData({
isForm: false
});
this.isForm = false
}
},



+ 12
- 16
src/packages/enterprise/pages/details/details.vue View File

@@ -1,5 +1,5 @@
<template>
<view style="height: 100%">
<view>
<custom-nav-bar position="fixed" color="black" left-text="诉求详情" left-arrow border />

<view class="myAppeal">
@@ -15,7 +15,7 @@
:style="'background-color: ' + type.cssClass + ';'">{{ type.label }}</view>
</block>
<view>
<text class="myAppeal-conent-block">{{ toods.getDateTime(List.createTime, 2) }}</text>
<text class="myAppeal-conent-block">{{ getDateTime(List.createTime, 2) }}</text>
<block v-for="(state, index) in statusList" :key="index">
<text v-if="List.appealProcessStatus + '' === state.value"
class="myAppeal-conent-bg myAppeal-conent-block" :style="'background-color: ' + state.cssClass + ';'">
@@ -52,7 +52,7 @@
</view>
<view class="myAppeal-bg-conent">
<rich-text :nodes="List.appealReply || ''" />
<view class="myAppeal-conent-block mt-16">{{ toods.getDateTime(List.replyTime, 2) }}</view>
<view class="myAppeal-conent-block mt-16">{{ getDateTime(List.replyTime, 2) }}</view>
</view>
</view>
</block>
@@ -66,6 +66,7 @@
import * as enterprise from '@/api/enterprise';
import * as publicApi from '@/api/publicApi';
import * as peopleApi from '@/api/peopleApi';
import utils from '@/utils/util.map'
export default {
data() {
return {
@@ -80,7 +81,7 @@
status: 'appeal_process_status',
typeList: [],
statusList: [],
List: null,
List: {},

state: {
value: '',
@@ -91,14 +92,15 @@
},
async onLoad(option) {
// TODO: key:是区分企业-我的诉求详情和民生-我的调解详情 key默认为 1:企业
this.setData({
option
});
this.option = option
await this.getAppealApi();
await this.getTypeList();
await this.getStateList();
},
methods: {
getDateTime(time){
return utils.getDateTime(time)
},
// 返回我的诉求
onClickLeft() {
uni.navigateTo({
@@ -112,9 +114,7 @@
dictType: this.type
});
if (res.data) {
this.setData({
typeList: res.data.list
});
this.typeList = res.data.list
}
},

@@ -124,9 +124,7 @@
dictType: this.status
});
if (res.data) {
this.setData({
statusList: res.data.list
});
this.statusList = res.data.list
}
},

@@ -147,9 +145,7 @@
id: this.option.id
});
if (res.data) {
this.setData({
List: res.data
});
this.List = res.data
}
}
}


+ 29
- 42
src/packages/enterprise/pages/issue-appeal/issue-appeal.vue View File

@@ -1,5 +1,5 @@
<template>
<view style="height: 100%">
<view>
<custom-nav-bar position="fixed" color="black" left-text="发布诉求" left-arrow />

<view class="line"></view>
@@ -58,9 +58,9 @@
<textarea class="textarea card-content" :value="form.appealContent" @input="headleInput"
data-name="appealContent" maxlength="200" placeholder="请输入诉求内容,文字不超过200字"></textarea>
<view class="mt-16">
<van-uploader :file-list="fileList" :deletable="true" @after-read="afterRead" max-count="9"
<van-uploader :file-list="fileList" :deletable="true" :after-read="afterRead" max-count="9"
@delete="imageDelete">
<van-icon name="/packages/enterprise/image/camera.png" size="80px" />
<van-icon name="/src/images/camera.png" size="80px" />
</van-uploader>
<view class="mt-16 card-block">附件不超过9个,每个大小不超过1M</view>
</view>
@@ -161,15 +161,11 @@
},
async onShow() {
const userInfoCount = uni.getStorageSync('userInfoCount');
this.setData({
userInfoCount
});
this.userInfoCount =userInfoCount
this.getEnterpriseList();
this.getAppelaTypeList();
const userInfoData = uni.getStorageSync('userInfoData');
this.setData({
userId: userInfoData.userId
});
this.userId = userInfoData.userId
},
methods: {
// 获取企业列表
@@ -178,9 +174,7 @@
userId: this.userId
});
if (res.data) {
this.setData({
enterpriseList: res.data.list
});
this.enterpriseList = res.data.list
}
},

@@ -190,9 +184,7 @@
dictType: 'appeal_type'
});
if (res.data) {
this.setData({
appealTypeList: res.data.list
});
this.appealTypeList = res.data.list
}
},

@@ -222,12 +214,14 @@
index
} = e.target.dataset;
const Listname = e.target.dataset.list;
console.log(e)
const List = this[Listname];
name = `form.${name}`;
this.setData({
[index]: e.detail.value,
[name]: Listname === 'enterpriseList' ? List[e.detail.value].id : List[e.detail.value].value
});
console.log(Listname)
this.form.appealType =List[e.detail.value].value

this[index] = e.detail.value
this[name] = Listname === 'enterpriseList' ? List[e.detail.value].id : List[e.detail.value].value
},

// 清楚对应的image图片
@@ -237,19 +231,18 @@
} = event.detail;
const Image = this.fileList;
Image.splice(index, 1);
this.setData({
fileList: Image
});
this.fileList = Image
},

// 上传图片
async afterRead(event) {
console.log(event)
const {
file
} = event.detail;
// const res = await app.globalData.upload({
// file
// });
} = event;
const res = await getApp().globalData.upload({
file
});
if (res.code !== 0) {
uni.showToast({
title: '上传图片失败',
@@ -268,10 +261,8 @@
url
});
appealEnclosure.push(url);
this.setData({
fileList,
appealEnclosure
});
this.fileList = fileList,
this.appealEnclosure = appealEnclosure
},

// 输入框重新赋值
@@ -283,35 +274,31 @@
name
} = event.currentTarget.dataset;
this.form[name] = value;
this.setData({
...this.form,
[name]: this[name]
});
this.form = {
...this.form
}
this[name] = this[name]
console.log(this.form);
},

// 选择地址
headleAdress() {
this.setData({
form: {
this.form =
{
...this.form,
// appealCurrentLocation: app.globalData.config.locationInfo.name
}
});
},

// 获得企业详情
async getEnterprise(id) {
const res = await enterprise.getEnterpriseApi(id);
if (res.data) {
this.setData({
...this,
appealDetails: res.data,
form: {
this.appealDetails= res.data
this.form = {
...this.form,
enterpriseId: res.data.id
}
});
}
},



+ 6
- 8
src/packages/enterprise/pages/my-appeal/my-appeal.vue View File

@@ -18,7 +18,7 @@
:style="'background-color: ' + type.cssClass + ';'">{{ type.label }}</view>
</block>
<view>
<text class="myAppeal-conent-block">{{ toods.getDateTime(item.createTime, 2) }}</text>
<text class="myAppeal-conent-block">{{ getDateTime(item.createTime, 2) }}</text>
<block v-for="(state, index1) in statusList" :key="index1">
<text v-if="item.appealProcessStatus + '' === state.value"
class="myAppeal-conent-bg myAppeal-conent-block" :style="'background-color: ' + state.cssClass + ';'">
@@ -50,7 +50,7 @@
<image src="/static/images/ic-success.png" mode="aspectFill"></image>
<text>{{ item.nickName }}</text>
</view>
<view class="myAppeal-conent-block">{{ toods.getDateTime(item.replyTime, 2) }}</view>
<view class="myAppeal-conent-block">{{ getDateTime(item.replyTime, 2) }}</view>
</view>
<view class="myAppeal-bg-conent">
<rich-text :nodes="item.appealReply"></rich-text>
@@ -62,15 +62,10 @@
</scroll-view>
</view>
</template>
<!-- <script module="toods" lang="wxs" src="@/wxs/util.wxs"></script> -->
<script>
// const app = getApp();
// const {
// enterprise,
// publicApi
// } = app.globalData.api;
import * as publicApi from '@/api/publicApi';
import * as enterprise from '@/api/enterprise';
import utils from '@/utils/util.map';
export default {
data() {
return {
@@ -112,6 +107,9 @@
await this.getStateList();
},
methods: {
getDateTime(time){
return utils.getDateTime(time)
},
// 详情页跳转
details(event) {
const {


+ 12
- 13
src/packages/enterprise/pages/relation-enterprise/relation-enterprise.vue View File

@@ -1,5 +1,5 @@
<template>
<view style="height: 100%">
<view>
<custom-nav-bar position="fixed" color="black" left-text="关联企业" left-arrow />

<view class="enterprise" v-if="List.length !== 0">
@@ -16,11 +16,14 @@
</view>
</view>

<view slot="right" :data-item="item" :data-index="index" @tap="swipeCell" class="enterprise-right">
<view class="enterprise-circle">
<van-icon name="delete-o" size="28px" color="#fff" />
<template #right>
<view :data-item="item" :data-index="index" @tap="swipeCell" class="enterprise-right">
<view class="enterprise-circle">
<van-icon name="delete-o" size="28px" color="#fff" />
</view>
</view>
</view>
</template>

</van-swipe-cell>
</view>

@@ -48,7 +51,7 @@
components: {},
data() {
return {
List: null
List: []
};
},
async onLoad() {
@@ -85,9 +88,7 @@
List
} = this;
List.splice(index, 1);
this.setData({
List: List
});
this.List = List
},

// 跳转-添加企业
@@ -102,12 +103,10 @@
const res = await enterprise.getEnterpriseListApi({
pageNo: 1,
pageSize: 15,
userId: uni.getStorageSync('userInfoData').userId
userId: uni.getStorageSync('userInfoData').id
});
if (res.data) {
this.setData({
List: res.data.list
});
this.List = res.data.list
}
},



+ 1
- 2
src/packages/my/pages/integral/integral.vue View File

@@ -93,9 +93,8 @@
} = event.currentTarget.dataset;
this.currentTab = item.id
this.permas.pageNo = 1;
this.dataList = []
this.permas = this.permas
this.dataList = item.id
this.dataList = []

if (item.id === 1) {
this.getIntegral();


+ 1
- 1
src/packages/people/pages/guide/guide.vue View File

@@ -17,7 +17,7 @@
<image class="guide-img" :src="item.photo"></image>

<text class="guide-name">{{ item.name }}</text>
<van-rate readonly icon="/src/images/void-icon2.png" :size="14" void-icon="/src/images/rate-icon.png" v-model="item.star" />
<van-rate readonly icon="//images/void-icon2.png" :size="14" void-icon="@/images/rate-icon.png" v-model="item.star" />
</view>
</view>
<view class="rural-list flex"


+ 12
- 22
src/packages/people/pages/masses-create/masses-create.vue View File

@@ -51,7 +51,7 @@
<textarea class="textarea-class" maxlength="500" @input="headleInput" data-name="content" placeholder="请输入内容"
auto-height :value="form.content"></textarea>
<view class="form-image">
<van-uploader @after-read="afterRead" :file-list="fileList" :deletable="true" max-count="9"
<van-uploader :after-read="afterRead" :file-list="fileList" :deletable="true" max-count="9"
@delete="imageDelete">
<image class="camera" src="/static/images/icon9.png"></image>
</van-uploader>
@@ -112,20 +112,14 @@
<van-dialog :show="isDialog" closeOnClickOverlay @confirm="isDialog = false"
message="群众点单是针对发展党员的程序流程基本要求、党的理论方针、支部周期性工作动态、党员志愿者帮扶及对上级支部的意见建议进行点单。不涉及以上点单类型的建议您拨打政务服务热线0354-7221890" />

<van-field
v-model="FiledVisible"
is-link
readonly
label="所在村/社区"
placeholder="请选择所在地区"
@click="isVisible = true"
/>

<van-popup v-model:show="isVisible" round position="bottom">
<van-cascader
v-model="currentValue"
title="请选择所在地区"
:options="optionData"
:field-names="defaultFieldNames"
@finish="onCloseVisible"
@close="onCloseVisible"
@change="onChangeVisible"
/>
@@ -137,7 +131,8 @@
</template>

<script>
// const app = getApp();
const app = getApp().globalData
console.log(app)
// const {
// publicApi,
// peopleApi
@@ -253,10 +248,8 @@
async afterRead(event) {
const {
file
} = event.detail;
// const res = await app.globalData.upload({
// file
// });
} = event;
const res = await getApp().globalData.upload({file});
if (res.code !== 0) {
uni.showToast({
title: '上传图片失败',
@@ -344,9 +337,9 @@
icon: 'none'
});

// wx.redirectTo({
// url: '/packages/people/pages/masses/masses',
// });
wx.redirectTo({
url: '/packages/people/pages/masses/masses',
});
// 返回上一页
uni.navigateBack();
},
@@ -396,11 +389,8 @@
},

onChangeVisible(e) {
const {
options = [], value = []
} = e.detail;
this.currentTile = options[options.length - 1].name
this.currentValue = value[value.length - 1]
this.currentTile = e.selectedOptions[e.tabIndex].name
this.currentValue =e.value
}
}
};


+ 19
- 26
src/packages/people/pages/mediate-create/mediate-create.vue View File

@@ -87,14 +87,14 @@
</view>
</view>
<view class="form-treaty">
<van-checkbox label-disabled :value="checked" shape="square" use-icon-slot @change="onCheckbox">
<image class="ic-check" slot="icon"
:src="checked ? '/static/images/ic-radio.png' : '/static/images/ic-radio1.png'" />
<van-checkbox label-disabled checked-color="red" v-model="checked" shape="square" use-icon-slot @change="onCheckbox">
<!-- <image class="ic-check"
:src="checked ? '/static/images/ic-radio1.png' : '/static/images/ic-radio.png'" /> -->
<view class="checbox-text flex">
本人承诺以上信息真实有效
<!-- <text>我已阅读《</text>
<navigator class="jump-to">申请调解</navigator>
<navigator class="jump-to">申请党员帮办</navigator>
<text>》,承诺材料真实性</text> -->
本人承诺以上信息真实有效
</view>
</van-checkbox>
</view>
@@ -104,20 +104,13 @@
</view>
</view>

<van-field
v-model="FiledVisible"
is-link
readonly
label="所在村/社区"
placeholder="请选择所在地区"
@click="isVisible = true"
/>
<van-popup v-model:show="isVisible" round position="bottom">
<van-cascader
v-model="currentValue"
title="请选择所在地区"
:options="optionData"
:field-names="defaultFieldNames"
@finish="onCloseVisible"
@close="onCloseVisible"
@change="onChangeVisible"
/>
@@ -187,7 +180,7 @@
// 级联选择默认显示字段
// 级连选择器数据 end
defaultFieldNames: {
label: 'name',
text: 'name',
value: 'id',
children: 'children'
},
@@ -202,7 +195,6 @@
* 生命周期函数--监听页面加载
*/
async onLoad(option) {
console.log(option);
this.option = option
this.getTypeList();
this.deptTreeApi();
@@ -257,11 +249,8 @@
},

onChangeVisible(e) {
const {
options = [], value = []
} = e.detail;
this.currentTile = options[options.length - 1].name
this.currentValue = value[value.length - 1]
this.currentTile = e.selectedOptions[e.tabIndex].name
this.currentValue =e.value
},

// 下拉选择事件
@@ -270,19 +259,23 @@
name
} = e.currentTarget.dataset;
let value = e.detail.value;
let type = 'form.' + name;
let type = this.form.name;
let typename = ''
if (name === 'caseType') {
let typename = this.pickerList[0].typeList[value].value;
typename = this.pickerList[0].typeList[value].value;
console.log(typename)
} else {
let typename = this.pickerList[1].typeList[value].id;
typename = this.pickerList[1].typeList[value].id;
}
this.caseType = value
this.form.caseType = value
this[name] = value
this[type] = typename
},

// 勾选协议
onCheckbox(event) {
this.checked = event.detail
this.checked = event
},

// 上传图片
@@ -317,7 +310,7 @@
dictType: 'people_cases_type'
});
if (res.data) {
this['pickerList[0].typeList'] = res.data.list
this.pickerList[0].typeList = res.data.list
}
},

@@ -327,7 +320,7 @@
name: this.name
});
if (res.data) {
this['pickerList[0].typeList'] = res.data.list
this.pickerList[0].typeList = res.data.list
}
},



+ 16
- 15
src/packages/people/pages/second/second.vue View File

@@ -55,7 +55,7 @@
<view class="section-item-left flex1 flex flex-between flex-col">
<view class="consult-content-title text-line-1">{{ item.title }}</view>
<view class="consult-content-block">
<text>{{ getDateTime(item.createTime) }}</text>
<text>{{ getDateTime(item.createTime)}}</text>
<text class="ml-30">{{ item.publisher }}</text>
</view>
</view>
@@ -73,7 +73,7 @@
<view class="section-item-left flex1 flex flex-between flex-col">
<view class="consult-content-title text-line-3">{{ item.name || item.title }}</view>
<view class="consult-content-block">
{{ item.createTime }}
{{ getDateTime(item.createTime) }}
</view>
</view>

@@ -170,9 +170,10 @@
updateQuery(url, name) {
return utils.updateQuery(url, name);
},
getDateTime(tiem){
console.log(time)
return utils.getDateTime(tiem)
getDateTime(time){
if(typeof item !== undefined) {
return utils.getDateTime(time)
}
},
/**
* 接口
@@ -212,20 +213,20 @@
},

async hospitalPageApi() {
const locationInfo = uni.getStorageSync('userLocation');
if (!Object.keys(locationInfo).length) {
return uni.showToast({
title: '未允许定位,当前页面功能无法完全体验',
icon: 'none',
duration: 1500
});
}
// const locationInfo = uni.getStorageSync('userLocation');
// if (!Object.keys(locationInfo).length) {
// return uni.showToast({
// title: '未允许定位,当前页面功能无法完全体验',
// icon: 'none',
// duration: 1500
// });
// }
const param = {
pageNo: 1,
pageSize: 10,
nearFlag: this.nearFlag,
posX: locationInfo.split[0],
posY: locationInfo.split[1]
// posX: locationInfo.split[0],
// posY: locationInfo.split[1]
};
if (this.searchValue) {
param.name = this.searchValue;


+ 1
- 0
src/pages/enterprise/enterprise.vue View File

@@ -99,6 +99,7 @@
</view>
<van-empty v-if="dataList.length === 0" description="暂无数据" />
</view>
<view style="height:150rpx"></view>
</view>
</template>
<script>


+ 3
- 2
src/pages/life/life.vue View File

@@ -6,7 +6,7 @@
:indicator-active-color="indicatorActiveColor">
<block v-for="(item, index) in imageList" :key="index">
<swiper-item>
<navigator v-if="item.clickUrl" class="line-navigator" :url="updateQuery(itemName.clickUrl,itemName)" hover-class="none"></navigator>
<navigator v-if="item.clickUrl" class="line-navigator" :url="updateQuery(item.clickUrl,itemName)" hover-class="none"></navigator>
<image class="custom-swiper-img" :src="item.pic"></image>
</swiper-item>
</block>
@@ -64,7 +64,7 @@
</view>
<view class="life-conent-rate flex flex-v-center flex-between">
<view>
<text>距离</text>
<!-- <text>距离</text> -->
<!-- <text class="rate-loca-active">{{ util.setMorKm(item.distance) }}</text> -->
</view>
</view>
@@ -82,6 +82,7 @@
</van-tabs> -->
</view>
</view>
<view style="height:150rpx"></view>
</view>
</template>
<script>


+ 2
- 1
src/utils/upload.js View File

@@ -1,9 +1,10 @@
export default async function (params) {
const app = getApp()
const app = getApp().globalData

uni.showLoading({
mask: true
})

const url = `${app.env.baseUrl}/admin-api/infra/file/upload`
const token = uni.getStorageSync('token')
const {


Loading…
Cancel
Save