提交法律援助和财税援助,调整我的页面
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
import { askAid } from "../../../service/system";
|
||||
import dayjs from "../../../utils/dayjs";
|
||||
import { alertInfo, alertSuccess, isValidPhoneNumber, loadingFunc } from "../../../utils/index";
|
||||
import request from '../../../utils/request'
|
||||
const { OK } = request
|
||||
|
||||
// pages/aid/consult/index.js
|
||||
Page({
|
||||
|
||||
@@ -12,10 +18,54 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { type } = options;
|
||||
this.setData({ type });
|
||||
const { id, type } = options;
|
||||
this.setData({ type: Number(type), id });
|
||||
},
|
||||
onChange(e) {
|
||||
const data = e.detail;
|
||||
const { name } = e.currentTarget.dataset
|
||||
const { form } = this.data;
|
||||
form[name] = data;
|
||||
this.setData({
|
||||
form,
|
||||
})
|
||||
},
|
||||
back() {
|
||||
wx.navigateBack()
|
||||
},
|
||||
async submit() {
|
||||
const { form } = this.data;
|
||||
const { name, phone, detail } = form;
|
||||
if (!name) {
|
||||
alertInfo("请输入名字")
|
||||
return;
|
||||
}
|
||||
if (!phone) {
|
||||
alertInfo("请输入手机号")
|
||||
return;
|
||||
}
|
||||
if (phone && !isValidPhoneNumber(phone)) {
|
||||
alertInfo("手机号格式不正确")
|
||||
return
|
||||
}
|
||||
if (!detail) {
|
||||
alertInfo("请输入详情")
|
||||
return
|
||||
}
|
||||
const that = this;
|
||||
loadingFunc(async () => {
|
||||
const { type, id } = that.data;
|
||||
const { code, message } = await askAid({ ...form, type, createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), connectId: id })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
alertSuccess("创建成功")
|
||||
setTimeout(() => {
|
||||
wx.navigateBack();
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@@ -12,7 +12,7 @@
|
||||
required
|
||||
/>
|
||||
<van-field
|
||||
value="{{form.name}}"
|
||||
value="{{form.phone}}"
|
||||
label="手机号"
|
||||
bind:change="onChange"
|
||||
data-name="phone"
|
||||
@@ -25,7 +25,6 @@
|
||||
label="邮箱"
|
||||
bind:change="onChange"
|
||||
data-name="email"
|
||||
required
|
||||
placeholder="请输入邮箱"
|
||||
title-width="140rpx"
|
||||
/>
|
||||
@@ -33,7 +32,7 @@
|
||||
value="{{form.detail}}"
|
||||
label="咨询内容"
|
||||
bind:change="onChange"
|
||||
data-name="email"
|
||||
data-name="detail"
|
||||
required
|
||||
type="textarea"
|
||||
autosize="{{true}}"
|
||||
@@ -45,7 +44,7 @@
|
||||
</view>
|
||||
</van-cell-group>
|
||||
|
||||
<view class="submit" wx:if="{{editType === 'edit'}}">
|
||||
<van-button block class="cancelEdit" bind:click="cancelEdit">取消编辑</van-button>
|
||||
<view class="submit">
|
||||
<van-button block class="cancelEdit" bind:click="back">返回</van-button>
|
||||
<van-button type="info" block class="save" bind:click="submit">保存</van-button>
|
||||
</view>
|
@@ -1,8 +1,17 @@
|
||||
/* pages/aid/consult/index.wxss */
|
||||
|
||||
.submit {
|
||||
margin: 32rpx;
|
||||
margin-bottom: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
margin: 40rpx;
|
||||
margin-bottom: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.cancelEdit, .save {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.cancelEdit {
|
||||
margin-right: 40rpx;
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
import { getAidDetail } from "../../../service/system";
|
||||
import { alertInfo } from "../../../utils/index";
|
||||
import { alertInfo, loadingFunc } from "../../../utils/index";
|
||||
import request from "../../../utils/request"
|
||||
const { OK } = request;
|
||||
// pages/aid/detail/index.js
|
||||
@@ -21,7 +21,9 @@ Page({
|
||||
const that = this;
|
||||
const { type, id } = options;
|
||||
this.setData({ type, id }, () => {
|
||||
that.init();
|
||||
loadingFunc(async () => {
|
||||
that.init();
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
@@ -36,6 +38,12 @@ Page({
|
||||
detail: data
|
||||
})
|
||||
},
|
||||
connect() {
|
||||
const { type, id } = this.data;
|
||||
wx.navigateTo({
|
||||
url: `/pages/aid/consult/index?type=${type}&id=${id}`,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@@ -3,7 +3,8 @@
|
||||
"aid": "/components/aid/index",
|
||||
"navigator": "/components/navigator/index",
|
||||
"mp-html": "/components/mp-html/index",
|
||||
"van-field": "@vant/weapp/field/index"
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
@@ -39,4 +39,7 @@
|
||||
<view style="margin-top: 20rpx; margin-left: 30rpx;">
|
||||
<mp-html content="{{detail.detail}}" />
|
||||
</view>
|
||||
</van-cell-group>
|
||||
</van-cell-group>
|
||||
<view style="margin-top: 40rpx;margin-left: 30rpx;margin-bottom: 30rpx;">
|
||||
<van-button type="info" block class="save" bind:click="connect">去联系</van-button>
|
||||
</view>
|
@@ -13,6 +13,7 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
user: {},
|
||||
tenement: {},
|
||||
visible: false,
|
||||
},
|
||||
|
||||
@@ -62,6 +63,8 @@ Page({
|
||||
}
|
||||
this.init()
|
||||
this.getUnReadNumber()
|
||||
const tenement = wx.getStorageSync('tenement')
|
||||
this.setData({ tenement })
|
||||
},
|
||||
async init() {
|
||||
const tenement = wx.getStorageSync('tenement')
|
||||
@@ -131,5 +134,15 @@ Page({
|
||||
wx.navigateTo({
|
||||
url: '/pages/aid/finance/index',
|
||||
})
|
||||
},
|
||||
jumpToLaw() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/aid/law/index',
|
||||
})
|
||||
},
|
||||
jumpToEncyclopedia() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/encyclopedia/index',
|
||||
})
|
||||
}
|
||||
})
|
@@ -7,6 +7,7 @@
|
||||
"dot": "/components/dot/index",
|
||||
"navigator": "/components/navigator/index",
|
||||
"van-grid": "@vant/weapp/grid/index",
|
||||
"avatar": "/components/avatar/index",
|
||||
"van-grid-item": "@vant/weapp/grid-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "我的",
|
||||
|
@@ -1,25 +1,39 @@
|
||||
<!--pages/my/index.wxml-->
|
||||
|
||||
<navigator title="我的" />
|
||||
<van-grid column-num="3">
|
||||
<van-grid-item icon="friends-o" text="财税援助" bind:click="jumpToFinance" />
|
||||
<van-grid-item icon="envelop-o" text="法律援助" />
|
||||
<van-grid-item icon="notes-o" text="电力百科" />
|
||||
</van-grid>
|
||||
<van-cell title="联系客服" value="" is-link bind:tap="connect" />
|
||||
<van-cell wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
|
||||
<van-cell wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
|
||||
<view slot="title">
|
||||
<view class="cellWrapper">
|
||||
<view class="text"> 成员管理 </view>
|
||||
<dot wx:if="{{dot > 0}}" number="{{dot}}" />
|
||||
|
||||
<view class="pageWrapper">
|
||||
<view class="userInfo">
|
||||
<avatar text="{{ user.nickName }}" />
|
||||
<view class="info">
|
||||
<view class="nickName"> {{ user.nickName }} </view>
|
||||
<view class="tenement"> {{ tenement.name }} </view>
|
||||
<view class="integration"> 积分: - </view>
|
||||
</view>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" />
|
||||
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
|
||||
<van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" />
|
||||
<van-cell title="工作台" wx:if="{{user.workStatus}}" value="" is-link bind:tap="jumpToWorkBench" />
|
||||
<van-cell title="退出登录" value="" is-link bind:tap="logout" />
|
||||
<view style="margin-bottom: 20rpx;">
|
||||
<van-grid column-num="3">
|
||||
<van-grid-item icon="friends-o" text="财税援助" bind:click="jumpToFinance" />
|
||||
<van-grid-item icon="envelop-o" text="法律援助" bind:click="jumpToLaw" />
|
||||
<van-grid-item icon="notes-o" text="电力百科" bind:click="jumpToEncyclopedia" />
|
||||
</van-grid>
|
||||
</view>
|
||||
<van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" />
|
||||
<van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
|
||||
<van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
|
||||
<view slot="title">
|
||||
<view class="cellWrapper">
|
||||
<view class="text"> 成员管理 </view>
|
||||
<dot wx:if="{{dot > 0}}" number="{{dot}}" />
|
||||
</view>
|
||||
</view>
|
||||
</van-cell>
|
||||
<van-cell title="发票抬头" icon="discount-o" value="" is-link bind:tap="jumpToUpdateInvoice" icon="search">
|
||||
</van-cell>
|
||||
<van-cell title="绑定企业" icon="exchange" value="" is-link bind:tap="bindTenement" />
|
||||
<van-cell title="常见问题" icon="question-o" value="" is-link bind:tap="jumpToQuestions" />
|
||||
<van-cell title="工作台" icon="records-o" wx:if="{{user.workStatus}}" value="" is-link bind:tap="jumpToWorkBench" />
|
||||
<van-cell title="退出登录" icon="revoke" value="" is-link bind:tap="logout" />
|
||||
|
||||
<van-dialog id="van-dialog" />
|
||||
<van-dialog id="van-dialog" />
|
||||
</view>
|
@@ -4,3 +4,38 @@
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pageWrapper {
|
||||
padding: 24rpx;
|
||||
|
||||
background: linear-gradient(to bottom, var(--middle-green), #fff );
|
||||
}
|
||||
|
||||
.userInfo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 24rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.userInfo .info {
|
||||
margin-left: 30rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.userInfo .info .nickName {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.userInfo .info .tenement {
|
||||
font-size: 28rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.integration {
|
||||
font-size: 28rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user