From 2e4d56e2ed95cb0f336522216fedc37167fb446d Mon Sep 17 00:00:00 2001 From: liuwh <964324856@qq.com> Date: Mon, 09 Sep 2024 15:26:15 +0800 Subject: [PATCH] 小程序代码提交 --- gz-wxparty/pages/AIAideDetail/index.js | 93 + gz-wxparty/pages/AIAide/index.js | 116 ++ gz-wxparty/utils/util.js | 762 +++++++------- gz-wxparty/pages/AIAide/index.wxss | 90 + gz-wxparty/pages/AIAide/index.wxml | 50 + gz-wxparty/pages/myRegisterList/index.json | 4 gz-wxparty/pages/AIAideDetail/index.json | 4 gz-wxparty/pages/register/index.wxss | 79 + gz-wxparty/pages/homePage/index.wxml | 27 gz-wxparty/pages/homePage/index.wxss | 22 gz-wxparty/pages/register/index.wxml | 105 + gz-wxparty/pages/DetailPerson/index.js | 79 + gz-wxparty/pages/addPerson/index.wxss | 5 gz-wxparty/pages/DetailPerson/index.json | 4 gz-wxparty/pages/myRegisterList/index.wxss | 2 gz-wxparty/pages/register/index.js | 289 +++++ gz-wxparty/api/api.js | 67 gz-wxparty/components/steps/index.wxml | 2 gz-wxparty/pages/myRegisterDetail/index.js | 86 + gz-wxparty/pages/myRegisterDetail/index.json | 4 gz-wxparty/components/personal-data-dom/index.js | 335 +++--- gz-wxparty/components/personal-data-dom/index.wxml | 2 gz-wxparty/pages/homePage/index.js | 6 gz-wxparty/pages/myRegisterDetail/index.wxml | 82 + gz-wxparty/pages/AIAide/index.json | 4 gz-wxparty/pages/myRegisterDetail/index.wxss | 128 ++ gz-wxparty/app.json | 4 gz-wxparty/pages/DetailPerson/index.wxml | 43 gz-wxparty/pages/DetailPerson/index.wxss | 16 gz-wxparty/pages/myRegisterList/index.wxml | 18 gz-wxparty/pages/AIAideDetail/index.wxml | 17 gz-wxparty/pages/realNameAuthentication/index.js | 376 ++++--- gz-wxparty/pages/AIAideDetail/index.wxss | 25 gz-wxparty/pages/myRegisterList/index.js | 37 34 files changed, 2,113 insertions(+), 870 deletions(-) diff --git a/gz-wxparty/api/api.js b/gz-wxparty/api/api.js index 7ae9632..06113a8 100644 --- a/gz-wxparty/api/api.js +++ b/gz-wxparty/api/api.js @@ -1,37 +1,46 @@ const url = { - // === 测试环境 === - // debug: 'http://47mhcb.natappfree.cc/', - // img: 'https://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/images/', - // assets: 'https://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/js/', + // === 测试环境 === + // debug: 'http://47mhcb.natappfree.cc/', + // img: 'https://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/images/', + // assets: 'https://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/js/', // txt: 'https://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/txt/', - - // === 测试环境 === - // debug: 'https://gz.hugeinfo.com.cn/', - debug: 'http://n3uvrw.natappfree.cc/', - img: 'http://120.79.193.119:9103/wx414ae04ac3f10b4e/images/', - assets: 'http://120.79.193.119:9103/wx414ae04ac3f10b4e/js/', - txt: 'http://120.79.193.119:9103/wx414ae04ac3f10b4e/txt/', - - + + // === 测试环境 === + // debug: 'https://gz.hugeinfo.com.cn/', + debug: 'http://8pxgs3.natappfree.cc/', + img: 'http://120.79.193.119:9103/wx414ae04ac3f10b4e/images/', + assets: 'http://120.79.193.119:9103/wx414ae04ac3f10b4e/js/', + txt: 'http://120.79.193.119:9103/wx414ae04ac3f10b4e/txt/', + + // === 正式环境 === - // web: 'https://zfw-dyh.by.gov.cn/', - // img: 'https://zfw-dyh.by.gov.cn/wechat/images/', - // assets: 'https://zfw-dyh.by.gov.cn/wechat/js/', - // txt: 'https://zfw-dyh.by.gov.cn/wechat/txt/', + web: 'https://zfw-dyh.by.gov.cn/', + img: 'https://zfw-dyh.by.gov.cn/gz/wechat/images/', + assets: 'https://zfw-dyh.by.gov.cn/gz/wechat/js/', + txt: 'https://zfw-dyh.by.gov.cn/gz/wechat/txt/', - // 文件查看url 后面接附件编号 - fileShowUrl: 'dyh-sys/api/v1/fileInfo/show/', - // 文件下载url 后面接附件编号 - fileDownUrl: 'dyh-sys/api/v1/fileInfo/down/', - // 不同服务接口type - mediate: 'dyh-mediate', // dyh-mediate - cust: 'dyh-cust', // dyh-cust - oper: 'dyh-oper', // dyh-oper - sys: 'dyh-sys', // dyh-sys - disp: 'dyh-disp', //dyh-disp + // 文件查看url 后面接附件编号 + fileShowUrl: 'gzdyh-sys/api/v1/fileInfo/show/', + // 文件下载url 后面接附件编号 + fileDownUrl: 'gzdyh-sys/api/v1/fileInfo/down/', + // 不同服务接口type + // mediate: 'dyh-mediate', // dyh-mediate + // cust: 'dyh-cust', // dyh-cust + // oper: 'dyh-oper', // dyh-oper + // sys: 'dyh-sys', // dyh-sys + // disp: 'dyh-disp', //dyh-disp + // utils: 'dyh-utils', //dyh-utils + + // 正式环境 + mediate: 'gzdyh-mediate', // gzdyh-mediate + cust: 'gzdyh-cust', // gzdyh-cust + oper: 'gzdyh-oper', // gzdyh-oper + sys: 'gzdyh-sys', // gzdyh-sys + disp: 'gzdyh-disp', //gzdyh-disp + utils: 'gzdyh-utils', //gzdyh-utils }; module.exports = { - url, -}; + url, +}; \ No newline at end of file diff --git a/gz-wxparty/app.json b/gz-wxparty/app.json index daecd87..08abce1 100644 --- a/gz-wxparty/app.json +++ b/gz-wxparty/app.json @@ -8,8 +8,12 @@ "pages/addAddress/index", "pages/speechToText/index", "pages/addPerson/index", + "pages/DetailPerson/index", + "pages/AIAide/index", + "pages/AIAideDetail/index", "pages/myRegisterList/index", "pages/myRegisterFlow/index", + "pages/myRegisterDetail/index", "pages/autograph/index", "pages/course/index", "pages/orderConfirm/index", diff --git a/gz-wxparty/components/personal-data-dom/index.js b/gz-wxparty/components/personal-data-dom/index.js index 570bc6c..3ff2859 100644 --- a/gz-wxparty/components/personal-data-dom/index.js +++ b/gz-wxparty/components/personal-data-dom/index.js @@ -5,194 +5,161 @@ // 获取信息 function getUserInfoApi() { - return $$.request({ - url: 'paUser/getUserInfo', - type: 'get', - service: 'cust' - }); + return $$.request({ + url: 'paUser/getUserInfo', + type: 'get', + service: 'cust' + }); } Component({ - /** - * 组件的属性列表 - * submitData: object form数据 - * type: string 判断当前使用组件的页面realNameAuthentication为实名认证页面 - * isCheck: boolean 判断是否只读不可修改 - * isImproveData: boolean 判断是否是完善资料,则不显示证件信息 - */ - properties: { - submitData: { - type: Object, - value: {}, - }, - type: { - type: String, - value: '', - }, - isCheck: { - type: Boolean, - value: false, - }, - isImproveData: { - type: Boolean, - value: false, - }, + /** + * 组件的属性列表 + * submitData: object form数据 + * type: string 判断当前使用组件的页面realNameAuthentication为实名认证页面 + * isCheck: boolean 判断是否只读不可修改 + * isImproveData: boolean 判断是否是完善资料,则不显示证件信息 + */ + properties: { + submitData: { + type: Object, + value: {}, }, - - /** - * 组件的初始数据 - */ - select: {}, // 下拉框资源 - location: [], - data: {}, - - pageLifetimes: { - show() { - $$.showLoading(); - this._getSelectOptionData(); - this._getLocationData(); - this._getUserInfo(); - }, + type: { + type: String, + value: '', }, - - /** - * 组件的方法列表 - */ - methods: { - // - _handleChange(e) { - let key = e.currentTarget.dataset.key; - if (key === 'clearidcard') { - this.triggerEvent('handleChange', { - key: 'idcard', - value: '' - }); - } else { - this.triggerEvent('handleChange', { - key, - value: e.detail - }); - } - }, - // 展示弹出层 - _handleShowPopup(e) { - if (this.data.isCheck) { - return false; - } - let type = e.currentTarget.dataset.type; - let title = e.currentTarget.dataset.title; - let selectData = []; - if (type === 'location') { - let selectOption = JSON.parse(JSON.stringify(this.location)); - let indexArr = $$.getLocationIndex(selectOption, this.data.submitData); - selectData = [{ - values: selectOption, - defaultIndex: indexArr[0] - }, - { - values: selectOption[indexArr[0]].children, - defaultIndex: indexArr[1] - }, - { - values: selectOption[indexArr[0]].children[indexArr[1]].children || [], - defaultIndex: indexArr[2] - }, - { - values: selectOption[indexArr[0]].children[indexArr[1]].children[indexArr[2]].children || [], - defaultIndex: indexArr[3] - }, - ]; - selectData.forEach((x) => { - x.values.forEach((y) => { - delete y.children; - }); - }); - } else { - let selectOption = this.select[type]; - selectData = selectOption; - } - this.triggerEvent('handleShowPopup', { - visible: true, - title: title, - type: type, - selectData: selectData, - }); - }, - // 获取手机号码 - _handleGetPhoneNumber(e) { - console.log('eeeee',e); - this.triggerEvent('handleGetPhoneNumber', e.detail.code); - }, - // 获取个人信息 - async _getUserInfo() { - console.log('个人信息') - console.log(app.globalData.access_token, 'app.globalData.access_token1111111') - // const res = await getUserInfoApi(); - // $$.hideLoading(); - // if (res.type) { - // this.triggerEvent('getUserInfo', res.data); - // } - const res = await getUserInfoApi(); - $$.hideLoading(); - if (res.type) { - if(res.data.trueName !== null) - this.triggerEvent('getUserInfo', res.data); - } - if (app.globalData.access_token && res.data.trueName === null) { - let actoken = app.globalData.access_token; - wx.request({ - url: 'https://xcx.pinganbaiyun.cn/p_060_cs_intf/api_001/sv_002_get_paby_login_info', //仅为示例,并非真实的接口地址 - data: { - "access_token": '测试token', - "app_id": "测试", - "secret": "测试" - }, - method: 'post', - success: (res1) => { - $$.hideLoading(); - this.triggerEvent('getUserInfo', { - ...res1.data[0], - trueName: res1.data[0].XM, - idcard: res1.data[0].ZJHM, - mobile: res1.data[0].LXDH - }); - } - }) - } - - - - }, - // 请求下拉框资源 - async _getSelectOptionData() { - const res = await $$.commonRequest({ - url: `${$$.url.assets}selectOption.json`, - type: 'get' - }); - if (res) { - this.select = { - cardType: [], - sex: [], - }; - this.select.cardType = res.data.cardType || []; - this.select.sex = res.data.sex || []; - } - }, - // 获取省市区等地理资源 - async _getLocationData() { - $$.showLoading(); - const res = await $$.commonRequest({ - url: `${$$.url.assets}locationSelect.json`, - type: 'get' - }); - $$.hideLoading(); - if (res) { - let location = []; - $$.province.forEach((x) => { - location.push(res[x][0]); - }); - this.location = location; - } - }, + isCheck: { + type: Boolean, + value: false, }, + isImproveData: { + type: Boolean, + value: false, + }, + }, + + /** + * 组件的初始数据 + */ + select: {}, // 下拉框资源 + location: [], + data: {}, + + pageLifetimes: { + show() { + $$.showLoading(); + this._getSelectOptionData(); + this._getLocationData(); + this._getUserInfo(); + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + // + _handleChange(e) { + let key = e.currentTarget.dataset.key; + if (key === 'clearidcard') { + this.triggerEvent('handleChange', { + key: 'idcard', + value: '' + }); + } else { + this.triggerEvent('handleChange', { + key, + value: e.detail + }); + } + }, + // 展示弹出层 + _handleShowPopup(e) { + if (this.data.isCheck) { + return false; + } + let type = e.currentTarget.dataset.type; + let title = e.currentTarget.dataset.title; + let selectData = []; + if (type === 'location') { + let selectOption = JSON.parse(JSON.stringify(this.location)); + let indexArr = $$.getLocationIndex(selectOption, this.data.submitData); + selectData = [{ + values: selectOption, + defaultIndex: indexArr[0] + }, + { + values: selectOption[indexArr[0]].children, + defaultIndex: indexArr[1] + }, + { + values: selectOption[indexArr[0]].children[indexArr[1]].children || [], + defaultIndex: indexArr[2] + }, + ]; + selectData.forEach((x) => { + x.values.forEach((y) => { + delete y.children; + }); + }); + } else { + let selectOption = this.select[type]; + selectData = selectOption; + } + this.triggerEvent('handleShowPopup', { + visible: true, + title: title, + type: type, + selectData: selectData, + }); + }, + // 获取手机号码 + _handleGetPhoneNumber(e) { + console.log('eeeee', e); + this.triggerEvent('handleGetPhoneNumber', e.detail.code); + }, + // 获取个人信息 + async _getUserInfo() { + console.log('个人信息') + console.log(app.globalData.access_token, 'app.globalData.access_token1111111') + const res = await getUserInfoApi(); + $$.hideLoading(); + if (res.type) { + if (res.data.trueName !== null) + this.triggerEvent('getUserInfo', res.data); + } + }, + // 请求下拉框资源 + async _getSelectOptionData() { + const res = await $$.commonRequest({ + url: `${$$.url.assets}selectOption.json`, + type: 'get' + }); + if (res) { + this.select = { + cardType: [], + sex: [], + }; + this.select.cardType = res.data.cardType || []; + this.select.sex = res.data.sex || []; + } + }, + // 获取省市区等地理资源 + async _getLocationData() { + $$.showLoading(); + const res = await $$.commonRequest({ + url: `${$$.url.assets}locationSelect.json`, + type: 'get' + }); + $$.hideLoading(); + if (res) { + let location = []; + $$.province.forEach((x) => { + location.push(res[x][0]); + }); + this.location = location; + } + }, + }, }); \ No newline at end of file diff --git a/gz-wxparty/components/personal-data-dom/index.wxml b/gz-wxparty/components/personal-data-dom/index.wxml index da3c114..0202a98 100644 --- a/gz-wxparty/components/personal-data-dom/index.wxml +++ b/gz-wxparty/components/personal-data-dom/index.wxml @@ -66,7 +66,7 @@ data-type="location" is-link="{{ !isCheck }}" label="居住地" - placeholder="省/市/区(县)/街道" + placeholder="市/区(县)/街道" readonly value="{{ submitData.prov ? wxs.showLocation(submitData) : '' }}" /> diff --git a/gz-wxparty/components/steps/index.wxml b/gz-wxparty/components/steps/index.wxml index e343597..10806b9 100644 --- a/gz-wxparty/components/steps/index.wxml +++ b/gz-wxparty/components/steps/index.wxml @@ -12,7 +12,7 @@ <van-icon name="{{ imgUrl }}steps-arrow.png" size="14" /> </block> <block wx:else> - <van-icon name="{{ imgUrl }}steps-arrow-active.png" size="14" /> + <van-icon custom-style="font-weight:600" name="arrow" size="14" /> </block> </view> </view> diff --git a/gz-wxparty/pages/AIAide/index.js b/gz-wxparty/pages/AIAide/index.js new file mode 100644 index 0000000..8d8c61f --- /dev/null +++ b/gz-wxparty/pages/AIAide/index.js @@ -0,0 +1,116 @@ +// pages/AIAide/index.js +const $$ = require('../../utils/util'); +const app = getApp(); + +function getawApi(submitData) { + return $$.request({ + url: 'case-law/get-law', + type: 'post', + ai: true, + submitData, + service: 'mediate', + }); +} +// 获取案例 +function getCaseApi(submitData) { + return $$.request({ + url: 'case-law/get-case', + type: 'post', + ai: true, + submitData, + service: 'mediate', + }); +} + +Page({ + /** + * 页面的初始数据 + */ + data: { + imgUrl: $$.url.img, + AIData: [], //法条 + caseData: [], //案例 + }, + + async getaw(data) { + let newData = { + caseDes: data.caseDes, + caseClaim: data.caseClaim, + caseId: data.caseId, + } + $$.showLoading(); + const res = await getawApi(newData); + $$.hideLoading(); + if (res.type) { + let nowData = res.data || [] + this.setData({ + AIData: nowData.map(i => ({ + ...i, + show: false + })) + }) + } + }, + + // 案例 + async getCase(data) { + let newData = { + caseDes: data.caseDes, + caseClaim: data.caseClaim, + caseId: data.caseId, + } + $$.showLoading(); + const res = await getCaseApi(newData); + $$.hideLoading(); + if (res.type) { + this.setData({ + caseData: res.data || [] + }) + } + }, + + // 打开折叠法条 + lawClick(e) { + let item = e.currentTarget.dataset.item; + let index = e.currentTarget.dataset.index; + this.setData({ + AIData: this.data.AIData.map((i, idx) => ({ + ...i, + show: idx === index ? i.show ? false : true : false, + })) + }) + }, + + // 跳转案例详情 + caseClick(e) { + let url = e.currentTarget.dataset.url; + let caseId = e.currentTarget.dataset.caseid; + let caseType = e.currentTarget.dataset.casetype; + + wx.navigateTo({ + url: url + '?caseId=' + caseId + '&type=' + caseType, + }); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log('options', options); + let { + caseDes, + caseClaim, + caseId, + } = options; + this.getaw({ + caseDes, + caseClaim, + caseId, + }) + this.getCase({ + caseDes, + caseClaim, + caseId, + }) + }, +}) \ No newline at end of file diff --git a/gz-wxparty/pages/AIAide/index.json b/gz-wxparty/pages/AIAide/index.json new file mode 100644 index 0000000..f48d0c8 --- /dev/null +++ b/gz-wxparty/pages/AIAide/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "解纷助手", + "usingComponents": {} +} \ No newline at end of file diff --git a/gz-wxparty/pages/AIAide/index.wxml b/gz-wxparty/pages/AIAide/index.wxml new file mode 100644 index 0000000..fb1679f --- /dev/null +++ b/gz-wxparty/pages/AIAide/index.wxml @@ -0,0 +1,50 @@ +<!--pages/AIAide/index.wxml--> + +<wxs module="wxs" src="../../utils/wxs/util.wxs" /> + +<view class="card"> + <view class="card_main"> + <block wx:if="{{caseData.length>0}}"> + <view class="caseList_head"> + <van-icon size="22" name="{{imgUrl}}AIAide_1.png" />为您推荐与申请相似的典型案例({{caseData.length}}) + </view> + <view class="caseList" bindtap="caseClick" data-caseId="{{item.caseId}}" data-caseType="{{item.caseType}}" data-url="../../pages/AIAideDetail/index" wx:for="{{caseData}}" wx:key="index"> + <view class="caseList_flex"> + <text class="ellipsis">{{item.caseName}}</text> + <view class="cell-arrow"> + <van-icon color="#1A6FB8" size="14" name="arrow" /> + </view> + </view> + <view class="caseList_title">相似度:{{'-'}}% | 发生地:广东省 广州市</view> + </view> + </block> + <block wx:if="{{AIData.length>0}}"> + <view class="line"></view> + <view class="caseList_head"> + <van-icon size="22" name="{{imgUrl}}AIAide_2.png" />为您推荐与申请相关的专业法条({{AIData.length}}) + </view> + <view class="caseList" wx:for="{{AIData}}" wx:key="index"> + <view bindtap="lawClick" data-item="{{item}}" data-index="{{index}}" class="caseList_flex"> + <text class="ellipsis">《{{item.lawTitle}}》{{item.lawIndex}}</text> + <view wx:if="{{item.show}}" class="cell-arrow"> + <van-icon color="#1A6FB8" size="14" name="arrow-down" /> + </view> + <view wx:else class="cell-arrow"> + <van-icon color="#1A6FB8" size="14" name="arrow-up" /> + </view> + </view> + <view wx:if="{{item.show}}" class="show-line"> + + </view> + <view wx:if="{{item.show}}" class="show-Law"> + {{item.lawDesc}} + </view> + </view> + <view class="assess"> + <van-icon size="18" name="{{imgUrl}}AIAide_3.png" /> + <van-icon size="18" name="{{imgUrl}}AIAide_4.png" /> + </view> + </block> + <view wx:if="{{caseData.length}}" class="flex_end">以上内容均由人工智能模型生成,其生成内容的准确性和完整性无法保证,不代表我们的态度或观点</view> + </view> +</view> \ No newline at end of file diff --git a/gz-wxparty/pages/AIAide/index.wxss b/gz-wxparty/pages/AIAide/index.wxss new file mode 100644 index 0000000..130560b --- /dev/null +++ b/gz-wxparty/pages/AIAide/index.wxss @@ -0,0 +1,90 @@ +/* pages/AIAide/index.wxss */ + +.card { + padding: 24rpx; + height: 100%; + background-color: #fff; + position: relative; +} + +.card_main { + background-color: #F6F7FB; + border-radius: 8px; +} + +.flex_end { + /* position: fixed; + bottom: 40rpx; */ + color: rgba(23, 26, 29, 0.24); + font-size: 28rpx; + /* padding: 0 52rpx; */ + text-align: center; + padding: 24rpx 0; +} + +.caseList { + border-radius: 4px; + background-color: #fff; + padding: 24rpx; + margin: 0 24rpx 16rpx 24rpx; +} + +.caseList_flex { + display: flex; + justify-content: space-between; + margin-bottom: 8rpx; +} + +.cell-arrow { + width: 16px; + height: 16px; + background: #f6f7fb; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; + padding: 6rpx; +} + +.caseList_title { + color: rgba(23, 26, 29, 0.60); + font-size: 24rpx; + line-height: 40rpx; +} + +.caseList_head { + display: flex; + gap: 8rpx; + padding: 24rpx 24rpx; + margin-top: 24rpx; +} + +.line { + border: 1px dashed #e5e6eb; + margin: 32rpx 24rpx 0; +} + +.assess { + display: flex; + gap: 32rpx; + justify-content: flex-end; + padding: 12rpx 24rpx 32rpx; +} + +.ellipsis { + overflow: hidden; + /* 确保超出容器的文本会被裁剪 */ + white-space: nowrap; + /* 保证文本在一行内显示 */ + text-overflow: ellipsis; + /* 使用省略号表示文本超出 */ +} + +.show-line { + margin: 24rpx 0; + border-top: 1px solid #F0F0F0; +} + +.show-Law { + color: var(--main-color); +} \ No newline at end of file diff --git a/gz-wxparty/pages/AIAideDetail/index.js b/gz-wxparty/pages/AIAideDetail/index.js new file mode 100644 index 0000000..68555a5 --- /dev/null +++ b/gz-wxparty/pages/AIAideDetail/index.js @@ -0,0 +1,93 @@ +// pages/AIAideDetail/index.js +const $$ = require('../../utils/util'); +const app = getApp(); + +function getCaseDetail(submitData) { + return $$.request({ + url: 'case-law/get-case-detail', + type: 'get', + ai: true, + submitData, + service: 'mediate', + }); +} + +Page({ + + /** + * 页面的初始数据 + */ + data: { + data: {} + }, + + async getaw(data) { + $$.showLoading(); + const res = await getCaseDetail(data); + $$.hideLoading(); + if (res.type) { + this.setData({ + data: res.data || {} + }) + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let nowData = { + ...options + } + this.getaw(nowData) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/gz-wxparty/pages/AIAideDetail/index.json b/gz-wxparty/pages/AIAideDetail/index.json new file mode 100644 index 0000000..10a2bec --- /dev/null +++ b/gz-wxparty/pages/AIAideDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "典型案例", + "usingComponents": {} +} \ No newline at end of file diff --git a/gz-wxparty/pages/AIAideDetail/index.wxml b/gz-wxparty/pages/AIAideDetail/index.wxml new file mode 100644 index 0000000..744816f --- /dev/null +++ b/gz-wxparty/pages/AIAideDetail/index.wxml @@ -0,0 +1,17 @@ +<!--pages/AIAideDetail/index.wxml--> +<view class="title">{{data.caseTitle||'-'}}</view> +<view class="line"></view> +<view class="card"> + <view class="subtitle">【案件描述】</view> + <view class="text"> + {{data.caseDesc||'-'}} + </view> + <view class="subtitle">【和解协议】</view> + <view class="text"> + {{data.agreeContent||'-'}} + </view> + <view class="subtitle">【立案依据】</view> + <view class="text"> + {{data.legalBasis||'-'}} + </view> +</view> \ No newline at end of file diff --git a/gz-wxparty/pages/AIAideDetail/index.wxss b/gz-wxparty/pages/AIAideDetail/index.wxss new file mode 100644 index 0000000..8c90eaa --- /dev/null +++ b/gz-wxparty/pages/AIAideDetail/index.wxss @@ -0,0 +1,25 @@ +/* pages/AIAideDetail/index.wxss */ +.card { + padding: 24rpx; +} + +.title { + text-align: center; + padding: 24rpx; + font-size: 34rpx; + line-height: 50rpx; + font-weight: 600; +} + +.line { + border: 1px dashed #e5e6eb; + margin: 0 24rpx 24rpx 24rpx; +} + +.subtitle { + color: var(--main-color); +} + +.text { + padding-bottom: 24rpx; +} \ No newline at end of file diff --git a/gz-wxparty/pages/DetailPerson/index.js b/gz-wxparty/pages/DetailPerson/index.js new file mode 100644 index 0000000..1c26238 --- /dev/null +++ b/gz-wxparty/pages/DetailPerson/index.js @@ -0,0 +1,79 @@ +// pages/DetailPerson/index.js +const $$ = require('../../utils/util'); + +// 详情接口 +function getByIdApi(param) { + return $$.request({ + url: 'casePerson/getById', + type: 'get', + submitData: param || {}, + service: 'mediate' + }) +} + +function getByIdAgentApi(param) { + return $$.request({ + url: 'caseAgent/getById', + type: 'get', + submitData: param || {}, + service: 'mediate' + }) +} +Page({ + + /** + * 页面的初始数据 + */ + data: { + data: {} + }, + + + //获取申请人详情 + async getById(id) { + $$.showLoading(); + const res = await getByIdApi({ + id + }); + $$.hideLoading(); + if (res.type) { + let data = res.data || {}; + this.setData({ + data + }); + } + }, + + + //获取被申请人详情 + async getagenById(id) { + $$.showLoading(); + const res = await getByIdAgentApi({ + id + }); + $$.hideLoading(); + if (res.type) { + let data = res.data || {}; + this.setData({ + data + }); + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + let id = options.id; + let perType = options.perType; + // 15_020008-1申请方 24_00006-1 申请方代理人 15_020008-2被申请方 24_00006-2 被申请方代理人 + if (perType === '15_020008-1' || perType === '15_020008-2') { + this.getById(id) + } + if (perType === '24_00006-1' || perType === '24_00006-2') { + this.getagenById(id) + } + }, + + +}) \ No newline at end of file diff --git a/gz-wxparty/pages/DetailPerson/index.json b/gz-wxparty/pages/DetailPerson/index.json new file mode 100644 index 0000000..95018e3 --- /dev/null +++ b/gz-wxparty/pages/DetailPerson/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "当事人信息", + "usingComponents": {} +} \ No newline at end of file diff --git a/gz-wxparty/pages/DetailPerson/index.wxml b/gz-wxparty/pages/DetailPerson/index.wxml new file mode 100644 index 0000000..d8b9179 --- /dev/null +++ b/gz-wxparty/pages/DetailPerson/index.wxml @@ -0,0 +1,43 @@ +<!--pages/DetailPerson/index.wxml--> +<view class="card"> + <view class="cell3"> + <view class="cell-title-placeholder">人员类型</view> + <view>{{ data.perTypeName || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">姓名</view> + <view>{{ data.trueName || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">联系方式</view> + <view>{{ data.mobile || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">证件类型</view> + <view>{{ data.certiTypeName || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">证件号码</view> + <view>{{ data.certiNo || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">联系地址</view> + <view>{{ data.addr || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">户籍地址</view> + <view>{{ data.placeAddr || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">工作单位</view> + <view>{{ data.workUnit || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">民族</view> + <view>{{ data.nationName || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">性别</view> + <view>{{ data.sexName || '-' }}</view> + </view> +</view> \ No newline at end of file diff --git a/gz-wxparty/pages/DetailPerson/index.wxss b/gz-wxparty/pages/DetailPerson/index.wxss new file mode 100644 index 0000000..661923c --- /dev/null +++ b/gz-wxparty/pages/DetailPerson/index.wxss @@ -0,0 +1,16 @@ +/* pages/DetailPerson/index.wxss */ + +.card { + background-color: #fff; + padding: 24rpx; +} + +.cell3 { + margin-bottom: 16rpx; +} + +.cell-title-placeholder { + font-size: 28rpx; + line-height: 44rpx; + color: rgba(0, 0, 0, 0.5); +} \ No newline at end of file diff --git a/gz-wxparty/pages/addPerson/index.wxss b/gz-wxparty/pages/addPerson/index.wxss index dddfd18..22a8d69 100644 --- a/gz-wxparty/pages/addPerson/index.wxss +++ b/gz-wxparty/pages/addPerson/index.wxss @@ -19,6 +19,11 @@ .cell-item-select {} +.addPerson-main { + display: flex; + flex-direction: column; +} + .cell-idCard { color: var(--main-color); display: flex; diff --git a/gz-wxparty/pages/homePage/index.js b/gz-wxparty/pages/homePage/index.js index 6dabba8..f101002 100644 --- a/gz-wxparty/pages/homePage/index.js +++ b/gz-wxparty/pages/homePage/index.js @@ -379,14 +379,10 @@ } }, }); - let agreement = wx.getStorageSync('agreement'); // 获取弹窗信息提醒 if (app.globalData.token) { - if (!agreement) { - this.getAgreement(); - return; - } + if (!$$.userTest('realName', 'bottom')) { this.setData({ popupMsg: [{ diff --git a/gz-wxparty/pages/homePage/index.wxml b/gz-wxparty/pages/homePage/index.wxml index ffe903b..ad04745 100644 --- a/gz-wxparty/pages/homePage/index.wxml +++ b/gz-wxparty/pages/homePage/index.wxml @@ -22,20 +22,26 @@ <view class="main_title">服务申请</view> <view class="flex"> <view bindtap="handleNavigateTo" data-url="../../pages/register/index" data-type="register" class="flex_1 flex_blue"> - <view class="main_subTitle">反映诉求</view> - <view>轻松来访</view> + <view> + <view class="main_subTitle">反映诉求</view> + <!-- <view>轻松来访</view> --> + </view> + <image class="home-image" src="{{imgUrl}}home_3.png" mode="" /> </view> <view bindtap="handleNavigateTo" data-url="../../pages/myRegisterList/index" data-type="register" class="flex_1 flex_orange"> - <view class="main_subTitle">我的申请</view> - <view>申请进度查询</view> + <view> + <view class="main_subTitle">进度查询</view> + <!-- <view>申请进度查询</view> --> + </view> + <image class="home-image" src="{{imgUrl}}home_4.png" mode="" /> </view> </view> - <view class="flex marginTop_12"> + <!-- <view class="flex marginTop_12"> <view class="flex_1 flex_green"> <view class="main_subTitle">事项咨询</view> <view>解决您身边的问题</view> </view> - </view> + </view> --> </view> <!-- 化解资源 --> <view> @@ -62,8 +68,9 @@ <view> <view class="flex_dt"> <view class="main_title">咨询动态</view> - <view bindtap="handleGetMore" data-type="newMsg" wx:if="{{ newMessageMore }}" class=" flex_dt_more">查看更多 - <image class="flex_dt_more_img" src="./../../img/right.png" /> + <view bindtap="handleGetMore" data-type="newMsg" wx:if="{{ newMessageMore }}" class=" flex_dt_more"> + <text>查看更多</text> + <van-icon name="arrow" size="16" /> </view> </view> <view class="dt_card" bindtap="goSeeMessage" wx:for="{{ newMessage }}" style="margin-top:{{index===0?0:'8px'}}" wx:key="index"> @@ -73,7 +80,9 @@ <time-format format="YYYY-MM-DD" value="{{ item.pushTime }}" /> {{item.playNum}}人阅读 </view> </view> - <view class="dt_card_r"></view> + <view class="dt_card_r"> + <image src="{{item.showUrl}}" mode="" /> + </view> </view> </view> </view> diff --git a/gz-wxparty/pages/homePage/index.wxss b/gz-wxparty/pages/homePage/index.wxss index b692ea1..38d767a 100644 --- a/gz-wxparty/pages/homePage/index.wxss +++ b/gz-wxparty/pages/homePage/index.wxss @@ -49,11 +49,23 @@ } +.home-image { + width: 112rpx; + height: 100rpx; + position: absolute; + right: 10rpx; + bottom: 0; +} + .flex_1 { flex: 1; color: #fff; padding: 12px; border-radius: 4px; + display: flex; + justify-content: space-between; + position: relative; + align-items: center; } .flex_2 { @@ -121,7 +133,13 @@ .dt_card_r { flex: 1; - background: #ef6c24; + width: 184rpx; + height: 136rpx; +} + +.dt_card_r image { + width: 100%; + height: 100%; } .dt_card_title { @@ -129,10 +147,12 @@ } .flex_blue { + height: 80rpx; background: linear-gradient(90deg, #5fa6d4, #3a8ac6 50%, #1a6fb8 100%); } .flex_orange { + height: 80rpx; background: linear-gradient(90deg, #ffa940, #fa8c16 50%, #ef6c24 100%); } diff --git a/gz-wxparty/pages/myRegisterDetail/index.js b/gz-wxparty/pages/myRegisterDetail/index.js new file mode 100644 index 0000000..7e8c800 --- /dev/null +++ b/gz-wxparty/pages/myRegisterDetail/index.js @@ -0,0 +1,86 @@ +// pages/myRegisterDetail/index.js +const $$ = require('../../utils/util'); + +// 详情接口 +function getByIdApi(param) { + return $$.request({ + url: 'caseInfo/getCaseInfo', + type: 'get', + submitData: param || {}, + service: 'mediate' + }) +} + +// 附件查询接口 +function getfilesApi(param) { + return $$.request({ + url: 'fileInfo/listByMainId', + type: 'get', + submitData: param || {}, + service: 'sys' + }) +} + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + imgUrl: $$.url.img, + submitData: {}, + oneList: [], + fileList: [] + }, + + // 获取附件信息 + async getFilesId(id) { + $$.showLoading(); + const res = await getfilesApi({ + mainId: id + }); + $$.hideLoading(); + if (res.type) { + let data = res.data || {}; + this.setData({ + fileList: data + }); + } + }, + + detailPerson(e) { + let item = e.currentTarget.dataset.item; + console.log('item', item); + wx.navigateTo({ + url: '../../pages/DetailPerson/index?id=' + item.id + '&perType=' + item.perType, + }); + }, + + // 获取纠纷案件详情 + async getById(data) { + $$.showLoading(); + const res = await getByIdApi({ + id: data.id + }); + $$.hideLoading(); + if (res.type) { + let data = res.data || {}; + this.setData({ + submitData: data, + oneList: [...data.personList, ...data.agentList] + }); + this.getFilesId(data.id) + + } + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getById(options); + }, + + +}) \ No newline at end of file diff --git a/gz-wxparty/pages/myRegisterDetail/index.json b/gz-wxparty/pages/myRegisterDetail/index.json new file mode 100644 index 0000000..2f4869c --- /dev/null +++ b/gz-wxparty/pages/myRegisterDetail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "事项详情", + "usingComponents": {} +} \ No newline at end of file diff --git a/gz-wxparty/pages/myRegisterDetail/index.wxml b/gz-wxparty/pages/myRegisterDetail/index.wxml new file mode 100644 index 0000000..8879281 --- /dev/null +++ b/gz-wxparty/pages/myRegisterDetail/index.wxml @@ -0,0 +1,82 @@ +<!--pages/myRegisterDetail/index.wxml--> +<view class="three-tag"> + <van-tabs bind:click="threeTagChange" active="{{threeAvtice}}"> + <!-- 人员信息 --> + <van-tab title="人员信息" name="1"> + <view style="padding:24rpx"> + <view wx:for="{{oneList}}" data-item="{{ item }}" data-index="{{ index }}" wx:key="index"> + <view class='one-list' bindtap="detailPerson" data-item="{{ item }}" wx:if="{{item.perType==='15_020008-1'||item.perType==='24_00006-1'}}"> + <view class="one-list-l green">申请方</view> + <view class="one-list-r"> + <view class="one-list-r-t"> + <view class="one-list-text">{{item.trueName}}</view> + <view class="one-list-phone">{{item.mobile}}</view> + <view wx:if="{{item.perType==='24_00006-1'}}" class="one-list-tag">代理人</view> + </view> + <view class="one-list-r-b">{{item.perClassName}} | {{item.certiNo}} </view> + </view> + </view> + <view class='one-list' bindtap="detailPerson" data-item="{{ item }}" wx:else> + <view class="one-list-l orange"><text>被申\n请方</text></view> + <view class="one-list-r"> + <view class="one-list-r-t"> + <view class="one-list-text">{{item.trueName}}</view> + <view class="one-list-phone">{{item.mobile}}</view> + <view wx:if="{{item.perType==='24_00006-2'}}" class="one-list-tag-orange">代理人</view> + </view> + <view class="one-list-r-b">{{item.perClassName}} |{{item.certiNo}}</view> + </view> + </view> + </view> + </view> + </van-tab> + <van-tab title="纠纷信息" name="2"> + <view class="three-tag2"> + <view class="cell3"> + <view class="cell-title-placeholder">纠纷类型</view> + <view>{{ submitData.caseTypeName || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">纠纷发生时间</view> + <view>{{ submitData.occurTime || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">纠纷发生地点</view> + <view>{{ submitData.addr || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">涉及人数(人)</view> + <view>{{ submitData.peopleNum || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">涉及金额(元)</view> + <view>{{ submitData.amount || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">事项概况</view> + <view>{{ submitData.caseDes || '-' }}</view> + </view> + <view class="cell3"> + <view class="cell-title-placeholder">事项申请</view> + <view>{{ submitData.caseClaim || '-' }}</view> + </view> + <!-- todo 人工智能提醒 --> + </view> + + </van-tab> + <van-tab title="事件材料" name="3"> + <view style="height: 16rpx;"> + + </view> + <view style="padding: 24rpx 32rpx 0; background-color: #fff;" wx:for="{{fileList}}" wx:key="index" data-item="{{item}}" data-index="{{index}}"> + <view class="fileList_border"> + <image class="fileList_img" src="{{imgUrl}}image_1.png" mode="" /> + <view class="flex_1"> + <view style="margin-bottom: 10rpx;">{{item.name}}</view> + <view style="display: flex;gap:16rpx"><text class="fileList_title">{{item.size}}{{item.unit}}</text><text data-item="{{item}}" data-index="{{index}}" bindtap="handlePreviewImage" class="public-color">预览</text></view> + </view> + </view> + </view> + </van-tab> + </van-tabs> +</view> \ No newline at end of file diff --git a/gz-wxparty/pages/myRegisterDetail/index.wxss b/gz-wxparty/pages/myRegisterDetail/index.wxss new file mode 100644 index 0000000..070ac66 --- /dev/null +++ b/gz-wxparty/pages/myRegisterDetail/index.wxss @@ -0,0 +1,128 @@ +/* pages/myRegisterDetail/index.wxss */ +@import '../../styles/public_components.wxss'; + +.one-list { + background: #fff; + padding: 24rpx; + display: flex; + position: relative; + gap: 8px; + margin-bottom: 12px; + border-radius: 8px; +} + +.one-list-l { + height: 96rpx; + width: 96rpx; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 28rpx; + text-align: center; +} + +.one-list-r-t { + display: flex; + gap: 8px; + font-size: 28rpx; + line-height: 44rpx; +} + +.one-list-phone { + color: rgba(23, 26, 29, 0.60); +} + +.one-list-tag { + font-size: 24rpx; + line-height: 40rpx; + border-radius: 2px; + background: #e6fffb; + color: #13C2C2; + padding: 0 8rpx; +} + +.one-list-tag-orange { + font-size: 24rpx; + line-height: 40rpx; + border-radius: 2px; + background: #FFF2E6; + color: #EF6C24; + padding: 0 8rpx; +} + +.one-list-r-b { + color: rgba(23, 26, 29, 0.60); + font-size: 24rpx; + line-height: 40rpx; + margin-top: 8rpx; +} + +.three-tag {} + +.three-tag .van-tabs__wrap { + height: 96rpx !important; +} + +.three-tag .van-tabs__nav { + height: 100%; +} + +.three-tag .van-tabs__scroll--line { + height: 100%; +} + +.three-tag .van-tab { + height: 100%; + line-height: 96rpx !important; +} + +.three-tag2 { + background-color: #fff; + margin-top: 16rpx; + padding: 24rpx 32rpx; +} + +.green { + background-color: #13C2C2; +} + +.orange { + background-color: #EF6C24; +} + +.fileList { + background-color: #fff; + padding: 24rpx 32rpx; + display: flex; + gap: 32rpx; + align-items: center; +} + +.fileList_border { + padding-bottom: 24rpx; + display: flex; + gap: 32rpx; + align-items: center; + border-bottom: 1px solid rgba(126, 134, 142, 0.16); +} + +.fileList_img { + width: 84rpx; + height: 96rpx; +} + +.fileList_title { + color: rgba(23, 26, 29, 0.40); + font-size: 28rpx; +} + +.fileList_img_del { + width: 32rpx; + height: 32rpx; +} + +.flex_1 { + flex: 1; +} \ No newline at end of file diff --git a/gz-wxparty/pages/myRegisterList/index.js b/gz-wxparty/pages/myRegisterList/index.js index e4fdbf1..f6d2055 100644 --- a/gz-wxparty/pages/myRegisterList/index.js +++ b/gz-wxparty/pages/myRegisterList/index.js @@ -44,13 +44,7 @@ label: '不予受理', value: '4' }], - dataList: [{ - title: '', - show: true - }, { - title: '', - show: false - }] + dataList: [] }, // 查看 @@ -78,6 +72,7 @@ searchSelect(e) { let idx = e.currentTarget.dataset.index; let item = e.currentTarget.dataset.item; + console.log('item', item); let searchData = { ...this.data.search, processStatus: item.value @@ -88,19 +83,23 @@ ...item, hover: index === idx ? true : false })), - searchValue: item.label + searchValue: item.label, + showModal: false }) }, // 切换tab threeTagChange(e) { - value = e.detail; + let value = e.detail; + console.log(value, ); + let data = { + ...this.data.search, + personType: value.name, + } this.setData({ - search: { - ...this.data.search, - personType: value, - } + search: data }); + this.pageQuery(data) }, // 折叠列表 @@ -122,14 +121,20 @@ }); } if (res.type) { + let list = [] if (params.page === 1) { - this.data.data = res.data.content || []; + list = res.data.content || []; } else { - this.data.data = this.data.data.concat(res.data.content || []); + list = this.data.data.concat(res.data.content || []); } this.setData({ search: params, - data: this.data.data, + dataList: list.map((i, index) => ({ + ...i, + plaintiffNames: i.plaintiffList.length > 0 ? i.plaintiffList.map(i => i.trueName).join('、') : '-', + defendantNames: i.defendantList.length > 0 ? i.defendantList.map(i => i.trueName).join('、') : '-', + show: index === 0 ? true : false + })), total: res.data.totalElements || 0 }); if (type === 'onPullDownRefresh') { diff --git a/gz-wxparty/pages/myRegisterList/index.json b/gz-wxparty/pages/myRegisterList/index.json index fc37723..df0995d 100644 --- a/gz-wxparty/pages/myRegisterList/index.json +++ b/gz-wxparty/pages/myRegisterList/index.json @@ -1,4 +1,6 @@ { "navigationBarTitleText": "进度查询", - "usingComponents": {} + "usingComponents": { + "time-format": "../../components/time-format/index" + } } \ No newline at end of file diff --git a/gz-wxparty/pages/myRegisterList/index.wxml b/gz-wxparty/pages/myRegisterList/index.wxml index 49e12f7..30dc67a 100644 --- a/gz-wxparty/pages/myRegisterList/index.wxml +++ b/gz-wxparty/pages/myRegisterList/index.wxml @@ -7,7 +7,7 @@ </view> <!-- 筛选 --> <view bindtap="searchChange" class="search"> - <view class="search-title">全部</view> + <view class="search-title">{{searchValue}}</view> <van-icon size='9' name="{{imgUrl}}down.png" /> </view> @@ -15,7 +15,7 @@ <view style="{{!item.show&&'border-bottom:none'}}" class="list-top"> <view>2024年7月12日反映诉求</view> <view class="list-top-r"> - <view class="list-top-r-tag">待受理</view> + <view class="list-top-r-tag">{{item.processStatusName||'-'}}</view> <van-icon wx:if="{{item.show}}" size='16' bindtap="changeShow" data-index="{{ index }}" name="{{imgUrl}}myRegisterList_1.png" /> <van-icon wx:else size='16' bindtap="changeShow" data-index="{{ index }}" name="{{imgUrl}}myRegisterList_4.png" /> </view> @@ -23,32 +23,34 @@ <view class="list-content" wx:if="{{item.show}}"> <view class="list-content-flex"> <view class="list-content-title">申请时间</view> - <view class="list-content-value">2024-7-12 12:00</view> + <view class="list-content-value"> + <time-format format="YYYY-MM-DD" value="{{item.createTime}}" /> + </view> </view> <view class="list-content-flex margin-top"> <view class="list-content-title">申请方</view> - <view class="list-content-value">李晓明</view> + <view class="list-content-value">{{item.plaintiffNames}}</view> </view> <view class="list-content-flex margin-top"> <view class="list-content-title">被申请方</view> - <view class="list-content-value">广东好又多贸易有限公司、张菲菲</view> + <view class="list-content-value">{{item.defendantNames}}</view> </view> <view class="list-border"></view> - <view class="list-detail"> + <view class="list-detail" bindtap="GoPage" data-url="{{'../../pages/myRegisterDetail/index?id='+item.id}}"> <view class="list-detail-l"> <van-icon size='16' name="{{imgUrl}}myRegisterList_1.png" /> <view class="list-detail-title">事项详情</view> </view> <view class="list-detail-r">查看</view> </view> - <view class="list-detail"> + <view class="list-detail" bindtap="GoPage" data-url="{{'../../pages/AIAide/index?caseDes='+item.caseDes+'&caseClaim='+item.caseClaim+'&caseId='+item.id}}"> <view class="list-detail-l"> <van-icon size='16' name="{{imgUrl}}myRegisterList_2.png" /> <view class="list-detail-title">解纷助手</view> </view> <view class="list-detail-r">查看</view> </view> - <view bindtap="GoPage" data-url="../../pages/myRegisterFlow/index" class="list-detail"> + <view wx:if="{{item.processStatus !==1}}" bindtap="GoPage" data-url="../../pages/myRegisterFlow/index" class="list-detail"> <view class="list-detail-l"> <van-icon size='16' name="{{imgUrl}}myRegisterList_3.png" /> <view class="list-detail-title">办理流程</view> diff --git a/gz-wxparty/pages/myRegisterList/index.wxss b/gz-wxparty/pages/myRegisterList/index.wxss index 229e5ba..525df12 100644 --- a/gz-wxparty/pages/myRegisterList/index.wxss +++ b/gz-wxparty/pages/myRegisterList/index.wxss @@ -123,6 +123,8 @@ gap: 8rpx; } + + .list-detail-title { font-size: 28rpx; } diff --git a/gz-wxparty/pages/realNameAuthentication/index.js b/gz-wxparty/pages/realNameAuthentication/index.js index 0e1203a..75064e1 100644 --- a/gz-wxparty/pages/realNameAuthentication/index.js +++ b/gz-wxparty/pages/realNameAuthentication/index.js @@ -3,182 +3,226 @@ // 实名认证 function realNameAuthenticationApi(submitData) { - return $$.request({ url: 'paUser/realAuth', type: 'post', submitData, service: 'cust' }); + return $$.request({ + url: 'paUser/realAuth', + type: 'post', + submitData, + service: 'cust' + }); } Page({ - /** - * 页面的初始数据 - */ - backNum: 1, // 如果从完善资料进入则返回两级到个人中心 - data: { - steps: ['完善信息', '刷脸认证'], - submitData: { - trueName: '', - mobile: '', - idcardType: '09_00015-1', - idcardTypeName: '身份证', - idcard: '', - prov: '', - provName: '', - city: '', - cityName: '', - area: '', - areaName: '', - road: '', - roadName: '', - village: '', - villageName: '', - addr: '', - agree: false, - }, - popup: {}, // 下拉弹出框数据 - }, + /** + * 页面的初始数据 + */ + backNum: 1, // 如果从完善资料进入则返回两级到个人中心 + data: { + steps: ['完善信息', '刷脸认证'], + submitData: { + trueName: '', + mobile: '', + idcardType: '09_00015-1', + idcardTypeName: '身份证', + idcard: '', + prov: '', + provName: '', + city: '', + cityName: '', + area: '', + areaName: '', + road: '', + roadName: '', + village: '', + villageName: '', + addr: '', + agree: false, + }, + popup: {}, // 下拉弹出框数据 + }, - // 展示弹出层 - handleShowPopup(e) { - this.setData({ popup: e.detail }); - }, + // 展示弹出层 + handleShowPopup(e) { + this.setData({ + popup: e.detail + }); + }, - // 关闭弹出层 - handleClosePopup() { - this.data.popup.visible = false; - this.setData({ popup: this.data.popup }); - }, + // 关闭弹出层 + handleClosePopup() { + this.data.popup.visible = false; + this.setData({ + popup: this.data.popup + }); + }, - // 下拉框确认选择 - handleConfirmPicker({ detail }) { - let type = this.data.popup.type; - let value = detail.detail.value; - let arr = []; - this.data.popup.visible = false; - if (type === 'location') { - arr = [ - ['prov', 'provName'], - ['city', 'cityName'], - ['area', 'areaName'], - ['road', 'roadName'], - ['village', 'villageName'], - ]; - arr.forEach((x, t) => { - this.data.submitData[x[0]] = value[t]?.value || ''; - this.data.submitData[x[1]] = value[t]?.label || ''; - }); - } else { - if (type === 'cardType') { - arr = ['idcardType', 'idcardTypeName']; - } else if (type === 'sex') { - arr = ['sex', 'sexName']; - } - arr.forEach((x, t) => { - this.data.submitData[x] = value[t === 0 ? 'value' : 'label']; - }); - } - this.setData({ popup: this.data.popup, submitData: this.data.submitData }); - }, + // 下拉框确认选择 + handleConfirmPicker({ + detail + }) { + let type = this.data.popup.type; + let value = detail.detail.value; + let arr = []; + this.data.popup.visible = false; + if (type === 'location') { + arr = [ + ['prov', 'provName'], + ['city', 'cityName'], + ['area', 'areaName'], + ['road', 'roadName'], + ['village', 'villageName'], + ]; + arr.forEach((x, t) => { + this.data.submitData[x[0]] = value[t]?.value || ''; + this.data.submitData[x[1]] = value[t]?.label || ''; + }); + } else { + if (type === 'cardType') { + arr = ['idcardType', 'idcardTypeName']; + } else if (type === 'sex') { + arr = ['sex', 'sexName']; + } + arr.forEach((x, t) => { + this.data.submitData[x] = value[t === 0 ? 'value' : 'label']; + }); + } + this.setData({ + popup: this.data.popup, + submitData: this.data.submitData + }); + }, - // form的change - handleChange(e) { - const { key, value } = e.detail; - this.data.submitData[key] = value; - this.setData({ submitData: this.data.submitData }); - }, + // form的change + handleChange(e) { + const { + key, + value + } = e.detail; + this.data.submitData[key] = value; + this.setData({ + submitData: this.data.submitData + }); + }, - // 修改picker的列时触发 - handleChangeColumns(e) { - if (this.data.popup.type === 'location') { - let selectData = $$.changeLocation(e, this.selectComponent('#personal-data-dom').location, this.data.popup.selectData); - this.setData({ popup: { ...this.data.popup, selectData } }); - } - }, + // 修改picker的列时触发 + handleChangeColumns(e) { + if (this.data.popup.type === 'location') { + let selectData = $$.changeLocation(e, this.selectComponent('#personal-data-dom').location, this.data.popup.selectData); + this.setData({ + popup: { + ...this.data.popup, + selectData + } + }); + } + }, - // 进行刷脸认证 - handleRealName() { - let submitData = this.data.submitData; - let msg = ''; - if (!submitData.trueName) { - msg = '请输入姓名'; - } else if (!submitData.idcard) { - msg = '请输入证件号码'; - } else if (!$$.mobileRegExp(submitData.mobile)) { - msg = '请输入正确的手机号码'; - } else if (!submitData.agree) { - msg = '请勾选确认信息'; - } - if (msg) { - $$.showToast({ title: msg }); - return false; - } - let that = this; - wx.checkIsSupportFacialRecognition({ - success() { - wx.startFacialRecognitionVerify({ - name: that.data.submitData.trueName, - idCardNumber: that.data.submitData.idcard, - success() { - console.log('识别成功'); - that.realNameAuthentication(); - }, - fail() { - $$.showToast({ title: '抱歉!识别失败,请稍后重试' }); - }, - }); - }, - fail(res) { - $$.showToast({ title: '抱歉!请求失败,稍后重试' }); - }, - }); - }, - - // 上传实名认证数据 - async realNameAuthentication() { - $$.showLoading(); - const res = await realNameAuthenticationApi(this.data.submitData); - $$.hideLoading(); - if (res.type) { - wx.getStorage({ - key: 'userInfo', - success(res2) { - res2.data.realStatus = '1'; - wx.setStorage({ key: 'userInfo', data: res2.data }); - }, - }); - $$.showToast({ icon: 'success', title: '实名认证成功' }); - wx.removeStorage({ - key: 'access_token' + // 进行刷脸认证 + handleRealName() { + let submitData = this.data.submitData; + let msg = ''; + if (!submitData.trueName) { + msg = '请输入姓名'; + } else if (!submitData.idcard) { + msg = '请输入证件号码'; + } else if (!$$.mobileRegExp(submitData.mobile)) { + msg = '请输入正确的手机号码'; + } else if (!submitData.agree) { + msg = '请勾选确认信息'; + } + if (msg) { + $$.showToast({ + title: msg + }); + return false; + } + let that = this; + wx.checkIsSupportFacialRecognition({ + success() { + wx.startFacialRecognitionVerify({ + name: that.data.submitData.trueName, + idCardNumber: that.data.submitData.idcard, + success() { + console.log('识别成功'); + that.realNameAuthentication(); + }, + fail() { + $$.showToast({ + title: '抱歉!识别失败,请稍后重试' }); - await $$.sleep(); - wx.navigateBack({ - delta: this.backNum || 1, - }); - } - }, + }, + }); + }, + fail(res) { + $$.showToast({ + title: '抱歉!请求失败,稍后重试' + }); + }, + }); + }, - // 获取个人信息 - async getUserInfo(e) { - let data = e.detail || {}; - let keys = Object.keys(this.data.submitData); - keys.forEach((x) => { - if (data[x]) { - this.data.submitData[x] = data[x]; - } - }); - this.setData({ submitData: this.data.submitData }); - }, + // 上传实名认证数据 + async realNameAuthentication() { + $$.showLoading(); + const res = await realNameAuthenticationApi(this.data.submitData); + $$.hideLoading(); + if (res.type) { + wx.getStorage({ + key: 'userInfo', + success(res2) { + console.log('res2', res2); + let nowData = { + ...res2.data, + realStatus: 1, + } + wx.setStorage({ + key: 'userInfo', + data: nowData + }); + }, + }); + $$.showToast({ + icon: 'success', + title: '实名认证成功' + }); + wx.removeStorage({ + key: 'access_token' + }); + await $$.sleep(); + wx.navigateBack({ + delta: this.backNum || 1, + }); + } + }, - // 获取手机号码 - async handleGetPhoneNumber(e) { - let phone = await this.selectComponent('#common-page').handleGetPhoneNumber(e.detail); - this.data.submitData.mobile = phone; - this.setData({ submitData: this.data.submitData }); - }, + // 获取个人信息 + async getUserInfo(e) { + let data = e.detail || {}; + let keys = Object.keys(this.data.submitData); + keys.forEach((x) => { + if (data[x]) { + this.data.submitData[x] = data[x]; + } + }); + this.setData({ + submitData: this.data.submitData + }); + }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - if (options.backNum) { - this.backNum = 2; - } - }, -}); + // 获取手机号码 + async handleGetPhoneNumber(e) { + let phone = await this.selectComponent('#common-page').handleGetPhoneNumber(e.detail); + this.data.submitData.mobile = phone; + this.setData({ + submitData: this.data.submitData + }); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if (options.backNum) { + this.backNum = 2; + } + }, +}); \ No newline at end of file diff --git a/gz-wxparty/pages/register/index.js b/gz-wxparty/pages/register/index.js index b290991..676c490 100644 --- a/gz-wxparty/pages/register/index.js +++ b/gz-wxparty/pages/register/index.js @@ -12,6 +12,36 @@ }); } +// 附件上传的id +function getByIdApi(param) { + return $$.request({ + url: 'caseUtils/getNewTimeCaseId', + type: 'get', + submitData: param || {}, + service: 'utils' + }); +} + +// 删除附件 +function delfileApi(id) { + return $$.request({ + url: 'fileInfo/deleteFileById?id=' + id, + type: 'get', + service: 'sys', + }); +} + +function getawApi(submitData) { + return $$.request({ + url: 'case-law/get-clain-rise-case', + type: 'post', + ai: true, + submitData, + service: 'mediate', + }); +} + + function caseRegisterSaveApi(submitData) { return $$.request({ url: 'caseInfo/caseRegister', @@ -30,6 +60,7 @@ select: {}, // 下拉框数据 goToMaterialSave: false, // 避免跳转到材料上传页面重复保存草稿 agreementMsg: '', // 服务协议 + ownerId: '', //附件上传id data: { stepText: 5, //用户须知倒计时5秒 timer: null, // 用于存储定时器的引用 @@ -71,9 +102,8 @@ amount: '', caseDes: '', caseClaim: '', - plaintiffList: [], - defendantList: [], }, // 表单数据 + fileList: [], //表单附件 addPersonData: {}, //添加的当事人 materialNum: 0, // 纠纷材料总数量 userInfoVisible: false, // 是否采用个人信息更新申请人信息 @@ -283,15 +313,28 @@ this.setData({ popupVisible: false }); + if (this.data.oneList?.length === 0) { + this.setData({ + addMePlaintiff: true + }) + } }, // 下一步 or 上一步 handleNext(e) { let type = e.currentTarget.dataset.type; if (type === 'next' && this.data.stepsActive === 0) { - this.setData({ - stepsActive: 1 - }); + if (this.data.oneList?.length <= 0) { + $$.showToast({ + title: '请至少添加一名当事人', + duration: 500 + }); + } else { + this.setData({ + stepsActive: 1 + }); + this.getById(); + } return; } if (type === 'back' && this.data.stepsActive === 1) { @@ -301,12 +344,58 @@ return; } if (type === 'next' && this.data.stepsActive === 1) { + let newData = this.data.submitData; + + console.log('this.data.submitData', this.data.submitData); + if (!newData.caseType) { + $$.showToast({ + title: '请选择纠纷类型', + duration: 500 + }); + return; + } + if (!newData.occurTime) { + $$.showToast({ + title: '请选择纠纷发生时间', + duration: 500 + }); + return; + } + if (!newData.addr) { + $$.showToast({ + title: '请选择纠纷发生地', + duration: 500 + }); + return; + } + if (!newData.caseDes) { + $$.showToast({ + title: '请填写事项概况', + duration: 500 + }); + return; + } + if (!newData.caseClaim) { + $$.showToast({ + title: '请填写事项申请', + duration: 500 + }); + return; + } + if (!this.data.fileList?.length <= 0) { + // 附件上传提示 + this.setData({ + showFileTip: true + }) + return; + } + // 提交AI接口 + this.getaw(newData); this.setData({ stepsActive: 2 }); return; } - if (type === 'back' && this.data.stepsActive === 2) { this.setData({ stepsActive: 1 @@ -324,8 +413,35 @@ this.caseRegisterSave({ ...data, personList, - agentList + agentList, + id: this.data.ownerId, }); + } + }, + + async getaw(data) { + let newData = { + caseDes: data.caseDes, + caseClaim: data.caseClaim, + caseId: this.data.ownerId, + } + const res = await getawApi(newData); + if (res.type) { + console.log('res.data', res.data); + this.setData({ + AIData: res.data || {} + }) + } + }, + + async getById() { + $$.showLoading(); + const res = await getByIdApi(); + $$.hideLoading(); + if (res.type) { + this.setData({ + ownerId: res.data || '' + }) } }, @@ -334,7 +450,10 @@ const res = await caseRegisterSaveApi(params); $$.hideLoading(); if (res.type) { - Toast('提交成功'); + // Toast('提交成功'); + this.setData({ + saveStatus: true + }) } }, @@ -343,6 +462,54 @@ let url = e.currentTarget.dataset.url; wx.navigateTo({ url: url, + }); + }, + + // 图片识别 + ocrClick(e) { + let key = e.currentTarget.dataset.key; + let keyNum = e.currentTarget.dataset.keyNum; + let that = this; + wx.chooseMedia({ + count: 1, + mediaType: ['image'], + success(res2) { + const tempFiles = res2.tempFiles[0]; + $$.showLoading(); + wx.uploadFile({ + url: `${$$.baseUrl}${$$.url.sys}/api/wechat/fileInfo/recognitionText`, + filePath: tempFiles.tempFilePath, + name: 'file', + header: { + Authorization: app.globalData.token + }, + complete(res3) { + $$.hideLoading(); + if (res3.errMsg === 'uploadFile:ok') { + let { + code, + data + } = JSON.parse(res3.data); + if (code == -1) { + $$.errorModal({ + content: '识别失败' + }); + return; + } + let wordsResult = data?.ocrResult?.wordsResult.join(''); + let wordsResultNum = data?.ocrResult?.wordsResultNum; + console.log('wordsResult', wordsResult); + that.setData({ + submitData: { + ...that.data.submitData, + [key]: wordsResult + }, + [keyNum]: wordsResultNum + }); + } + }, + }); + }, }); }, @@ -384,21 +551,98 @@ }) }, - // 获取省市区等地理资源 - async getLocationData() { - $$.showLoading(); - const res = await $$.commonRequest({ - url: `${$$.url.assets}locationSelect.json`, - type: 'get' + // 上传文件图片 + async handleUploadFile(e) { + let id = e.currentTarget.dataset.id; + let type = e.currentTarget.dataset.type; + let that = this; + this.filesArr = []; + wx.chooseMedia({ + mediaType: ['image'], + success(res2) { + const tempFiles = res2.tempFiles; + // 多个文件逐一上传 + tempFiles.forEach((x, t) => { + $$.showLoading('上传中...'); + wx.uploadFile({ + url: `${$$.baseUrl}${$$.url.sys}/api/wechat/fileInfo/upload?mainId=${id}&ownerId=${id}&ownerType=${type}`, + filePath: x.tempFilePath, + name: 'file', + header: { + Authorization: app.globalData.token + }, + complete(res) { + $$.hideLoading(); + if (res.errMsg === 'uploadFile:ok') { + const getData = JSON.parse(res.data) + const file = { + ...getData.data[0], + wxurl: x.tempFilePath + }; + that.setData({ + fileList: that.data.fileList.concat(file) + }) + $$.showToast({ + icon: 'success', + title: '上传成功', + duration: 500 + }); + } else { + $$.showToast({ + title: '上传失败', + duration: 500 + }); + } + + }, + }); + }); + }, }); - $$.hideLoading(); - if (res) { - let location = []; - $$.province.forEach((x) => { - location.push(res[x][0]); - }); - this.location = location; - } + }, + + // 预览图片 + handlePreviewImage(e) { + let item = e.currentTarget.dataset.item; + console.log('item', item); + let index = e.currentTarget.dataset.index; + wx.previewImage({ + current: item.wxurl, + urls: [item.wxurl] // 需要预览的图片http链接列表 + }); + }, + + // 删除图片 + async handleDelImage(e) { + let item = e.currentTarget.dataset.item; + let index = e.currentTarget.dataset.index; + let id = e.currentTarget.dataset.id; + let type = e.currentTarget.dataset.type; + $$.showModal({ + title: '删除材料确认', + content: '确定删除材料' + item.name + '吗?', + cancelText: '我再想想', + confirmText: '确定删除', + success: async (res) => { + if (res.confirm) { + $$.showLoading(); + const res = await delfileApi(id); + if (res.type) { + $$.showToast({ + icon: 'success', + title: '删除成功', + duration: 500 + }); + let list = this.data.fileList.filter((i, idx) => idx !== index); + console.log('list', list); + this.setData({ + fileList: list + }) + } + } + }, + }); + }, // 请求下拉框资源 @@ -521,7 +765,6 @@ * 生命周期函数--监听页面加载 */ onLoad: function () { - this.getLocationData(); let agreement = wx.getStorageSync('agreement'); if (!agreement) { this.getAgreement(); diff --git a/gz-wxparty/pages/register/index.wxml b/gz-wxparty/pages/register/index.wxml index 27c5aee..2087f2d 100644 --- a/gz-wxparty/pages/register/index.wxml +++ b/gz-wxparty/pages/register/index.wxml @@ -66,7 +66,7 @@ </block> <!-- 描述纠纷 --> - <block wx:elif="{{stepsActive === 1}}"> + <view class="page-flex" wx:elif="{{stepsActive === 1}}"> <view class="popupMsg-form"> <view bindtap="caseTypeGoPage" data-url="../../pages/caseType/index" class="cell cell-item" data-title="纠纷类型" data-key="certiType" data-type="cardType"> <view class="cell-title"><text><text class="cell-required">*</text> 纠纷类型</text></view> @@ -105,13 +105,13 @@ <view class="cell-item"> <view class="cell-title1">涉及人数(人)</view> <view class="cell-select"> - <van-field bind:change="handleChange" border="{{ false }}" custom-style="padding:0" data-key="peopleNum" input-align="right" placeholder="请填写" value="{{ submitData.peopleNum || '' }}" /> + <van-field type='number' bind:change="handleChange" border="{{ false }}" custom-style="padding:0" data-key="peopleNum" input-align="right" placeholder="请填写" value="{{ submitData.peopleNum || '' }}" /> </view> </view> <view class="cell-item"> <view class="cell-title1">涉及金额(元)</view> <view class="cell-select"> - <van-field bind:change="handleChange" border="{{ false }}" custom-style="padding:0" data-key="amount" input-align="right" placeholder="请填写" value="{{ submitData.amount || '' }}" /> + <van-field type='number' bind:change="handleChange" border="{{ false }}" custom-style="padding:0" data-key="amount" input-align="right" placeholder="请填写" value="{{ submitData.amount || '' }}" /> </view> </view> <view style="height: 16rpx;"></view> @@ -123,7 +123,7 @@ <view class="textarea-foot"> <view class="textarea-limit">{{caseDesNum||0}}/2000字</view> <view class="textarea-ability"> - <view class="textarea-img"> + <view bindtap="ocrClick" data-keyNum="caseDesNum" data-key="caseDes" class=" textarea-img"> <image src="{{imgUrl}}imgOcr.png" mode="" />识别图片 </view> <view style="padding: 0 8rpx;">|</view> @@ -142,7 +142,7 @@ <view class="textarea-foot"> <view class="textarea-limit">{{caseClaimNum||0}}/500字</view> <view class="textarea-ability"> - <view class="textarea-img"> + <view bindtap="ocrClick" data-keyNum="caseClaimNum" data-key="caseClaim" class="textarea-img"> <image src="{{imgUrl}}imgOcr.png" mode="" />识别图片 </view> <view style="padding: 0 8rpx;">|</view> @@ -154,7 +154,7 @@ </block> <view style="height: 16rpx;"></view> <block> - <view style="padding-left: 32rpx;" class="cell-item"> + <view style="padding-left: 32rpx;" bindtap="handleUploadFile" data-id="{{ownerId}}" data-type="22_00014-1" class="cell-item"> <view class="upload-title"> 事件材料 <image src="{{imgUrl}}upload-add.png" mode="" /> @@ -163,25 +163,33 @@ 说明:建议上传人员身份证及纠纷涉及的证件材料,代理人请上传身份证及授权委托书 </view> </view> - </block> - <view class="submitButton" catch:tap=""> - <view style="flex: 1;"> - <view class="two-button"> - <view class="two-button-flex1"> - <van-button bind:click="handleNext" block data-type="back">上一步</van-button> - </view> - <view class="two-button-flex2"> - <van-button bind:click="handleNext" block data-type="next" type="primary">下一步</van-button> - </view> + <view class="fileList" wx:for="{{fileList}}" wx:key="index" data-item="{{item}}" data-index="{{index}}"> + <image class="fileList_img" src="{{imgUrl}}image_1.png" mode="" /> + <view class="flex_1"> + <view style="margin-bottom: 10rpx;">{{item.name}}</view> + <view style="display: flex;gap:16rpx"><text class="fileList_title">{{item.size}}{{item.unit}}</text><text data-item="{{item}}" data-index="{{index}}" bindtap="handlePreviewImage" class="public-color">预览</text></view> </view> - <view class="safeHeight" /> + <image data-id="{{item.id}}" data-type="22_00014-1" data-item="{{item}}" data-index="{{index}}" bindtap="handleDelImage" class="fileList_img_del" src="{{imgUrl}}image_del.png" mode="" /> </view> + </block> + </view> + <view class="submitButton" catch:tap=""> + <view style="flex: 1;"> + <view class="two-button"> + <view class="two-button-flex1"> + <van-button bind:click="handleNext" block data-type="back">上一步</van-button> + </view> + <view class="two-button-flex2"> + <van-button bind:click="handleNext" block data-type="next" type="primary">下一步</van-button> + </view> + </view> + <view class="safeHeight" /> </view> </view> - </block> + </view> <!-- 提交申请 --> - <block wx:elif="{{stepsActive === 2}}"> + <view class="page-flex" wx:elif="{{stepsActive === 2}}"> <view class="popupMsg-form"> <view class="three-tag"> <van-tabs bind:click="threeTagChange" active="{{threeAvtice}}"> @@ -244,43 +252,56 @@ <view class="cell-title-placeholder">事项申请</view> <view>{{ submitData.caseClaim || '-' }}</view> </view> - <!-- todo 人工智能提醒 --> + <!-- 人工智能提醒 --> + <!-- <view class="Ai_tip"> --> + <view class="Ai_tip" wx:if="{{AIData.isClaimRisk===1}}"> + <view class="Ai_tip_title">{{AIData.analysisProcess||''}}</view> + <view class="Ai_tip_line"></view> + <view class="Ai_tip_text">内容依据人工智能技术和相关法律数据提供,仅供参考</view> + </view> </view> </van-tab> - <van-tab title="事件材料" name="3">内容 3</van-tab> + <van-tab title="事件材料" name="3"> + <view style="height: 16rpx;"> + + </view> + <view style="padding: 24rpx 32rpx 0; background-color: #fff;" wx:for="{{fileList}}" wx:key="index" data-item="{{item}}" data-index="{{index}}"> + <view class="fileList_border"> + <image class="fileList_img" src="{{imgUrl}}image_1.png" mode="" /> + <view class="flex_1"> + <view style="margin-bottom: 10rpx;">{{item.name}}</view> + <view style="display: flex;gap:16rpx"><text class="fileList_title">{{item.size}}{{item.unit}}</text><text data-item="{{item}}" data-index="{{index}}" bindtap="handlePreviewImage" class="public-color">预览</text></view> + </view> + </view> + </view> + </van-tab> </van-tabs> </view> - - <view class="submitButton" catch:tap=""> - <view style="flex: 1;"> - <view class="two-button"> - <view class="two-button-flex1"> - <van-button bind:click="handleNext" block data-type="back">上一步</van-button> - </view> - <view class="two-button-flex2"> - <van-button bind:click="handleNext" block data-type="next" type="primary">提交申请</van-button> - </view> + </view> + <view class="submitButton" catch:tap=""> + <view style="flex: 1;"> + <view class="two-button"> + <view class="two-button-flex1"> + <van-button bind:click="handleNext" block data-type="back">上一步</van-button> </view> - <view class="safeHeight" /> + <view class="two-button-flex2"> + <van-button bind:click="handleNext" block data-type="next" type="primary">提交申请</van-button> + </view> </view> + <view class="safeHeight" /> </view> </view> - </block> + </view> </block> <!-- 已提交 --> <block wx:else> <view class="success"> - <van-icon color="#07c160" name="checked" size="106rpx" /> - <view class="success-title">申请已经提交</view> - <view class="success-subTitle">可通过小程序首页<navigator class="success-link" style="display: inline;" url="/pages/myMediate/index">我的调解</navigator>功能跟进调解进度</view> - <view class="success-NewButton"> - <view class="success-RedButton"> - <navigator url="/pages/myMediate/index" style="color: #fff;font-size: 14px;">我的调解</navigator> - </view> - </view> - <view> + <van-icon name="{{imgUrl}}success.png" size="200rpx" /> + <view class="success-title">申请已提交</view> + <view class="success-subTitle">您已成功提交申请,请保持联系方式畅通。您可以通过“穗好办”微信公众号了解处理进度</view> + <view style="margin-top: 40rpx;"> <navigator class="success-link" style="display: inline;" url="/pages/homePage/index">返回首页</navigator> </view> <!-- <view class="success-button"> diff --git a/gz-wxparty/pages/register/index.wxss b/gz-wxparty/pages/register/index.wxss index cbd90dc..3169dd2 100644 --- a/gz-wxparty/pages/register/index.wxss +++ b/gz-wxparty/pages/register/index.wxss @@ -206,9 +206,44 @@ align-items: center; } -.two-addr-img image{ +.two-addr-img image { width: 15px; height: 15px; +} + +.fileList { + background-color: #fff; + padding: 24rpx 32rpx; + display: flex; + gap: 32rpx; + align-items: center; +} + +.fileList_border { + padding-bottom: 24rpx; + display: flex; + gap: 32rpx; + align-items: center; + border-bottom: 1px solid rgba(126, 134, 142, 0.16); +} + +.fileList_img { + width: 84rpx; + height: 96rpx; +} + +.fileList_title { + color: rgba(23, 26, 29, 0.40); + font-size: 28rpx; +} + +.fileList_img_del { + width: 32rpx; + height: 32rpx; +} + +.flex_1 { + flex: 1; } .three-tag { @@ -245,6 +280,33 @@ background-color: #fff; align-items: center; padding-left: 32rpx; +} + +.Ai_tip { + background: #FFECE8; + padding: 8px 12px; + border-radius: 4px; +} + +.Ai_tip_title { + color: #F53F3F; + line-height: 46rpx; +} + +.page-flex { + display: flex; + flex-direction: column; +} + +.Ai_tip_line { + margin: 16rpx 0; + border-bottom: 1px solid rgba(245, 63, 63, 0.60); +} + +.Ai_tip_text { + color: rgba(245, 63, 63, 0.60); + font-size: 24rpx; + line-height: 40rpx; } .textarea-limit { @@ -621,14 +683,13 @@ } .success-title { - font-size: 34rpx; - line-height: 50rpx; - font-weight: 600; + font-size: 32rpx; + line-height: 48rpx; padding: 32rpx 0; } .success-subTitle { - width: 383rpx; + width: 498rpx; color: var(--second-text-color); margin: auto; } @@ -683,7 +744,13 @@ } .success-link { - color: #D1021C; + color: #fff; + width: 116px; + height: 36px; + background: #1a6fb8; + border-radius: 6px; + padding: 6px 26px; + margin-top: 32px; } .success-NewButton { diff --git a/gz-wxparty/utils/util.js b/gz-wxparty/utils/util.js index 492cb22..175157e 100644 --- a/gz-wxparty/utils/util.js +++ b/gz-wxparty/utils/util.js @@ -5,7 +5,7 @@ const url = api.url; // 是否是开发环境 -const isDebug = true; +const isDebug = false; const baseUrl = isDebug ? api.url.debug : api.url.web; @@ -17,479 +17,485 @@ // request const request = ({ - url, - type, - submitData, - service, - v1, - noToken + url, + type, + submitData, + service, + v1, + ai, + noToken }) => { - const app = getApp(); + const app = getApp(); - let token = app.globalData.token; - if (!token && !noToken) { - console.log(typeof app.globalData.access_token, 'app.globalData.access_token1111111111111') - if (!app.globalData.access_token) { - showModal({ + let token = app.globalData.token; + if (!token && !noToken) { + console.log(typeof app.globalData.access_token, 'app.globalData.access_token1111111111111') + if (!app.globalData.access_token) { + showModal({ + title: '提示信息', + content: '抱歉!登录状态已失效,请重新登录', + confirmText: '重新登录', + showCancel: false, + success: (res) => { + if (res.confirm) { + loginOutClearData(); + wx.navigateTo({ + url: '../../pages/login/index', + }); + } + }, + }); + return false; + } + } + + let baseUrl = isDebug ? api.url.debug : api.url.web; + + let visitUrl = `${baseUrl}${api.url[service] || ''}/api/${v1 ? 'v1' :ai ? 'ai' : 'wechat'}/${url}`; + + return new Promise((resolve, reject) => { + wx.request({ + url: visitUrl, + data: submitData, + method: type, + header: { + Authorization: token, + }, + success: (res) => { + if (res.errMsg === 'request:ok') { + const { + statusCode + } = res; + if (statusCode >= 400) { + errorModal({ + content: '抱歉!请求失败,稍后重试' + }); + resolve({ + type: false + }); + return false; + } + const { + code, + data, + msg + } = res.data; + let obj = {}; + if (code === '0' || code === 0) { + obj = { + type: true, + data + }; + } else if (code === 401 || code === '401') { + if (app.globalData.access_token !== 1) { + errorModal({ title: '提示信息', content: '抱歉!登录状态已失效,请重新登录', confirmText: '重新登录', - showCancel: false, - success: (res) => { - if (res.confirm) { - loginOutClearData(); - wx.navigateTo({ - url: '../../pages/login/index', - }); - } + success: () => { + loginOutClearData(); + wx.navigateTo({ + url: '../../pages/login/index' + }); }, + }); + + } + obj = { + type: false + }; + } else { + errorModal({ + content: msg }); - return false; + obj = { + type: false + }; + } + resolve(obj); + } else { + errorModal({ + content: '抱歉!请求失败,稍后重试' + }); + resolve({ + type: false + }); } - } - - let baseUrl = isDebug ? api.url.debug : api.url.web; - - let visitUrl = `${baseUrl}${api.url[service] || ''}/api/${v1 ? 'v1' : 'wechat'}/${url}`; - - return new Promise((resolve, reject) => { - wx.request({ - url: visitUrl, - data: submitData, - method: type, - header: { - Authorization: token, - }, - success: (res) => { - if (res.errMsg === 'request:ok') { - const { - statusCode - } = res; - if (statusCode >= 400) { - errorModal({ - content: '抱歉!请求失败,稍后重试' - }); - resolve({ - type: false - }); - return false; - } - const { - code, - data, - msg - } = res.data; - let obj = {}; - if (code === '0' || code === 0) { - obj = { - type: true, - data - }; - } else if (code === 401 || code === '401') { - if (app.globalData.access_token !== 1) { - errorModal({ - title: '提示信息', - content: '抱歉!登录状态已失效,请重新登录', - confirmText: '重新登录', - success: () => { - loginOutClearData(); - wx.navigateTo({ - url: '../../pages/login/index' - }); - }, - }); - - } - obj = { - type: false - }; - } else { - errorModal({ - content: msg - }); - obj = { - type: false - }; - } - resolve(obj); - } else { - errorModal({ - content: '抱歉!请求失败,稍后重试' - }); - resolve({ - type: false - }); - } - }, - fail: () => { - errorModal({ - content: '抱歉!服务器出现错误,稍后重试' - }); - resolve({ - type: false - }); - }, + }, + fail: () => { + errorModal({ + content: '抱歉!服务器出现错误,稍后重试' }); + resolve({ + type: false + }); + }, }); + }); }; // const commonRequest = ({ - url, - submitData, - type + url, + submitData, + type }) => { - return new Promise((resolve, reject) => { - wx.request({ - url: url, - data: submitData, - method: type, - header: { - 'content-type': 'application/json; charset=utf-8', // 默认值 - }, - scriptCharset: 'utf-8', - success: (res) => { - const { - statusCode, - errMsg, - data - } = res; - if (statusCode >= 400) { - errorModal({ - content: '抱歉!请求错误,稍后重试' - }); - resolve(false); - return false; - } - if (errMsg === 'request:ok') { - resolve(data); - } else { - resolve(false); - } - }, - fail: () => { - resolve(false); - }, - }); + return new Promise((resolve, reject) => { + wx.request({ + url: url, + data: submitData, + method: type, + header: { + 'content-type': 'application/json; charset=utf-8', // 默认值 + }, + scriptCharset: 'utf-8', + success: (res) => { + const { + statusCode, + errMsg, + data + } = res; + if (statusCode >= 400) { + errorModal({ + content: '抱歉!请求错误,稍后重试' + }); + resolve(false); + return false; + } + if (errMsg === 'request:ok') { + resolve(data); + } else { + resolve(false); + } + }, + fail: () => { + resolve(false); + }, }); + }); }; // 消息提示框 const showToast = ({ - title, - icon = 'none', - mask = true, - duration = 2000, - success + title, + icon = 'none', + mask = true, + duration = 2000, + success }) => { - return wx.showToast({ - title: title, - icon: icon, - mask: mask, - duration: duration, - success: (res) => { - success && success(res); - }, - }); + return wx.showToast({ + title: title, + icon: icon, + mask: mask, + duration: duration, + success: (res) => { + success && success(res); + }, + }); +}; + +const ellipsis = ({ + value, + len +}) => { + if (!value) return ''; + + if (value.length > len) { + return value.slice(0, len) + '...'; + } + return value; }; //api错误modal框消息提示 let errorNum = false; //控制报错信息不会重复弹出 const errorModal = ({ - title, - content, - confirmText, - success, - className + title, + content, + confirmText, + success, + className }) => { - if (errorNum) { - return false; - } - errorNum = true; - return wx.showModal({ - title: title || '错误提示', - content: content, - className: className, - showCancel: false, - confirmColor: '#d10202', - confirmText: confirmText || '知道了', - success: (res) => { - if (res.confirm) { - errorNum = false; - success && success(res); - } - }, - }); + if (errorNum) { + return false; + } + errorNum = true; + return wx.showModal({ + title: title || '错误提示', + content: content, + className: className, + showCancel: false, + confirmColor: '#d10202', + confirmText: confirmText || '知道了', + success: (res) => { + if (res.confirm) { + errorNum = false; + success && success(res); + } + }, + }); }; //modal提示操作 const showModal = ({ - title = '温馨提示', - content, - showCancel = true, - cancelText = '取消', - confirmText = '确定', - success + title = '温馨提示', + content, + showCancel = true, + cancelText = '取消', + confirmText = '确定', + success }) => { - return wx.showModal({ - content: content, - showCancel: showCancel, - confirmColor: '#1A6FB8', - title: title, - cancelText: cancelText, - confirmText: confirmText, - success: (res) => { - success && success(res); - }, - }); + return wx.showModal({ + content: content, + showCancel: showCancel, + confirmColor: '#1A6FB8', + title: title, + cancelText: cancelText, + confirmText: confirmText, + success: (res) => { + success && success(res); + }, + }); }; //loading let loadingVisible = 0; const showLoading = (title = '加载中...', mask = true) => { - if (loadingVisible) { - loadingVisible = loadingVisible + 1; - return; - } - loadingVisible = 1; - return wx.showLoading({ - title: title, - mask: mask, - }); + if (loadingVisible) { + loadingVisible = loadingVisible + 1; + return; + } + loadingVisible = 1; + return wx.showLoading({ + title: title, + mask: mask, + }); }; const hideLoading = () => { - loadingVisible = loadingVisible - 1; - if (loadingVisible) return; - return wx.hideLoading(); + loadingVisible = loadingVisible - 1; + if (loadingVisible) return; + return wx.hideLoading(); }; // 时间格式化 const timeFormat = (time, type) => { - let formatType = type ? type : 'YYYY-MM-DD HH:mm'; - return time ? moment(time).format(formatType) : ''; + let formatType = type ? type : 'YYYY-MM-DD HH:mm'; + return time ? moment(time).format(formatType) : ''; }; // 计算消息时间距离当前时间 const getMsgTime = (endTime, startTime = new Date()) => { - let end = moment(endTime), - start = moment(startTime), - minDiff = end.diff(start, 'minute'); - if (minDiff < 60) { - return `${minDiff}分钟`; - } - let hoursDiff = minDiff / 60; - if (hoursDiff < 24) { - return `${hoursDiff}小时`; - } - let dayDiff = hoursDiff / 24; - return `${dayDiff}天`; + let end = moment(endTime), + start = moment(startTime), + minDiff = end.diff(start, 'minute'); + if (minDiff < 60) { + return `${minDiff}分钟`; + } + let hoursDiff = minDiff / 60; + if (hoursDiff < 24) { + return `${hoursDiff}小时`; + } + let dayDiff = hoursDiff / 24; + return `${dayDiff}天`; }; // 退出登录清除数据 const loginOutClearData = () => { - const app = getApp(); - app.globalData.token = ''; - wx.removeStorage({ - key: 'userInfo' - }); + const app = getApp(); + app.globalData.token = ''; + wx.removeStorage({ + key: 'userInfo' + }); }; // 手机号码正则 const mobileRegExp = (value) => { - return /^1(3[0-9]|5[0-3,5-9]|7[1-3,5-8]|8[0-9]|9[0-9])\d{8}$/g.test(value); + return /^1(3[0-9]|5[0-3,5-9]|7[1-3,5-8]|8[0-9]|9[0-9])\d{8}$/g.test(value); }; // 睡眠 const sleep = (timeout = 500) => { - return new Promise((resolve) => setTimeout(resolve, timeout)); + return new Promise((resolve) => setTimeout(resolve, timeout)); }; // 获取唯一的key const getBusinessId = () => { - let four = `${parseInt(Math.random() * 10)}${parseInt(Math.random() * 10)}${parseInt(Math.random() * 10)}${parseInt(Math.random() * 10)}`; - let result = `${moment().format('YYYYMMDDHHmmss')}${four}`; - return result; + let four = `${parseInt(Math.random() * 10)}${parseInt(Math.random() * 10)}${parseInt(Math.random() * 10)}${parseInt(Math.random() * 10)}`; + let result = `${moment().format('YYYYMMDDHHmmss')}${four}`; + return result; }; // 省市区选择 const changeLocation = (e, location, selectData) => { - const { - value, - index - } = e.detail.detail; - let value_id = value[index].value; - let faterArr = location; - for (let i = 0; i < index; i++) { - faterArr = faterArr[selectData[i].defaultIndex].children || []; - } - faterForEach: for (let i = 0; i <= faterArr.length - 1; i++) { - if (faterArr[i].value === value_id) { - selectData[index].defaultIndex = i; - let arr = faterArr[i]; - for (let y = index + 1; y < value.length; y++) { - selectData[y].values = JSON.parse(JSON.stringify(arr.children)) || []; - selectData[y].defaultIndex = 0; - // 当children不存在时赋值 - if (arr.children) { - arr = arr.children[0]; - } - selectData[y].values.forEach((x) => { - delete x.children; - }); - } - break faterForEach; + const { + value, + index + } = e.detail.detail; + let value_id = value[index].value; + let faterArr = location; + for (let i = 0; i < index; i++) { + faterArr = faterArr[selectData[i].defaultIndex].children || []; + } + faterForEach: for (let i = 0; i <= faterArr.length - 1; i++) { + if (faterArr[i].value === value_id) { + selectData[index].defaultIndex = i; + let arr = faterArr[i]; + for (let y = index + 1; y < value.length; y++) { + selectData[y].values = JSON.parse(JSON.stringify(arr.children)) || []; + selectData[y].defaultIndex = 0; + // 当children不存在时赋值 + if (arr.children) { + arr = arr.children[0]; } + selectData[y].values.forEach((x) => { + delete x.children; + }); + } + break faterForEach; } - return selectData; + } + return selectData; }; // 计算默认的省市区下标 const getLocationIndex = (data, currentData) => { - let selectOption = JSON.parse(JSON.stringify(data)); - let submitData = currentData; - let arr = [0, 0, 0, 0]; - if (submitData.prov) { - forEach: for (let i = 0; i < selectOption.length; i++) { - if (selectOption[i].value === submitData.prov) { - arr[0] = i; - break forEach; - } - } + let selectOption = JSON.parse(JSON.stringify(data)); + let submitData = currentData; + let arr = [0, 0, 0]; + if (submitData.city) { + forEach: for (let i = 0; i < selectOption[arr[0]].children.length; i++) { + if (selectOption[arr[0]].children[i].value === submitData.city) { + arr[1] = i; + break forEach; + } } - if (submitData.city) { - forEach: for (let i = 0; i < selectOption[arr[0]].children.length; i++) { - if (selectOption[arr[0]].children[i].value === submitData.city) { - arr[1] = i; - break forEach; - } - } + } + if (submitData.area) { + forEach: for (let i = 0; i < selectOption[arr[0]].children[arr[1]].children.length; i++) { + if (selectOption[arr[0]].children[arr[1]].children[i].value === submitData.area) { + arr[2] = i; + break forEach; + } } - if (submitData.area) { - forEach: for (let i = 0; i < selectOption[arr[0]].children[arr[1]].children.length; i++) { - if (selectOption[arr[0]].children[arr[1]].children[i].value === submitData.area) { - arr[2] = i; - break forEach; - } - } - } - if (submitData.road) { - forEach: for (let i = 0; i < selectOption[arr[0]].children[arr[1]].children[arr[2]].children.length; i++) { - if (selectOption[arr[0]].children[arr[1]].children[arr[2]].children[i].value === submitData.road) { - arr[3] = i; - break forEach; - } - } - } - return arr; + } + // if (submitData.road) { + // forEach: for (let i = 0; i < selectOption[arr[0]].children[arr[1]].children[arr[2]].children.length; i++) { + // if (selectOption[arr[0]].children[arr[1]].children[arr[2]].children[i].value === submitData.road) { + // arr[3] = i; + // break forEach; + // } + // } + // } + return arr; }; // 判断附件打开形式 const openFiles = (type, url, urls) => { - let visible = false; - if (type === '22_00017-3') { - wx.previewImage({ - current: url, - urls: urls, + let visible = false; + if (type === '22_00017-3') { + wx.previewImage({ + current: url, + urls: urls, + }); + visible = true; + } else if (['22_00017-4', '22_00017-5', '22_00017-6', '22_00017-9'].includes(type)) { + showLoading(); + wx.downloadFile({ + url: url, + success: function (res) { + const filePath = res.tempFilePath; + wx.openDocument({ + filePath: filePath, + complete: () => { + hideLoading(); + }, }); - visible = true; - } else if (['22_00017-4', '22_00017-5', '22_00017-6', '22_00017-9'].includes(type)) { - showLoading(); - wx.downloadFile({ - url: url, - success: function (res) { - const filePath = res.tempFilePath; - wx.openDocument({ - filePath: filePath, - complete: () => { - hideLoading(); - }, - }); - }, - }); - visible = true; - } else { - showToast({ - title: '抱歉!您所点击的附件暂不支持查看' - }); - visible = false; - } - return visible; + }, + }); + visible = true; + } else { + showToast({ + title: '抱歉!您所点击的附件暂不支持查看' + }); + visible = false; + } + return visible; }; // 校验登录'login' and 实名'realName' and 'all' const userTest = (type, direction) => { - const app = getApp(); - if (!app.globalData.token && (type === 'login' || type === 'all')) { - showModal({ - content: '抱歉您未登录,是否前往登录?', - success: (res) => { - if (res.confirm) { - wx.navigateTo({ - url: '../../pages/login/index', - }); - } - }, - }); - return false; - } - let realStatus = wx.getStorageSync('userInfo')?.realStatus; - if (realStatus !== 1 && (type === 'realName' || type === 'all')) { - if (direction !== 'bottom') { - showModal({ - content: '检测到您未进行实名认证,该操作需先进行实名认证,是否前往认证?', - success: (res) => { - if (res.confirm) { - wx.navigateTo({ - url: '../../pages/realNameAuthentication/index', - }); - } - }, - }); + const app = getApp(); + if (!app.globalData.token && (type === 'login' || type === 'all')) { + showModal({ + content: '抱歉您未登录,是否前往登录?', + success: (res) => { + if (res.confirm) { + wx.navigateTo({ + url: '../../pages/login/index', + }); } - return false; + }, + }); + return false; + } + let realStatus = wx.getStorageSync('userInfo')?.realStatus; + if (realStatus !== 1 && (type === 'realName' || type === 'all')) { + if (direction !== 'bottom') { + showModal({ + content: '检测到您未进行实名认证,该操作需先进行实名认证,是否前往认证?', + success: (res) => { + if (res.confirm) { + wx.navigateTo({ + url: '../../pages/realNameAuthentication/index', + }); + } + }, + }); } - return true; + return false; + } + return true; }; // 地址栏截取 function getQueryString(href, name) { - let result = href.match(new RegExp('[?&]' + name + '=([^&]+)', 'i')); - if (!result || result.length < 1) { - return null; - } - return decodeURI(result[1]); + let result = href.match(new RegExp('[?&]' + name + '=([^&]+)', 'i')); + if (!result || result.length < 1) { + return null; + } + return decodeURI(result[1]); } // 清除字符串中的空格,用于判断是否为空 function verifyEmpty(value) { - return value?.replace(/\s+/g, ''); + return value?.replace(/\s+/g, ''); } module.exports = { - moment, - url, - request, - commonRequest, - isDebug, - baseUrl, - version, - province, - showToast, - errorModal, - showModal, - showLoading, - hideLoading, - timeFormat, - getMsgTime, - loginOutClearData, - mobileRegExp, - sleep, - getBusinessId, - changeLocation, - getLocationIndex, - openFiles, - userTest, - getQueryString, - verifyEmpty, + moment, + url, + request, + commonRequest, + isDebug, + baseUrl, + version, + province, + showToast, + errorModal, + showModal, + ellipsis, + showLoading, + hideLoading, + timeFormat, + getMsgTime, + loginOutClearData, + mobileRegExp, + sleep, + getBusinessId, + changeLocation, + getLocationIndex, + openFiles, + userTest, + getQueryString, + verifyEmpty, }; \ No newline at end of file -- Gitblit v1.8.0