|
@@ -9,32 +9,20 @@
|
|
|
<text class="imp">*</text>捐款意向
|
|
<text class="imp">*</text>捐款意向
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-right">
|
|
<view class="box-right">
|
|
|
- <picker @change="PickerDire" :range="chooseDire" class="box-right" range-key="name">
|
|
|
|
|
|
|
+ <picker :value="index" @change="PickerDire" :range="chooseDire" class="box-right" @click="addType">
|
|
|
<text>{{ intention || '请选择捐款意向'}}</text>
|
|
<text>{{ intention || '请选择捐款意向'}}</text>
|
|
|
</picker>
|
|
</picker>
|
|
|
- <!-- <cascade class="box-right" @change="onCityClick" :allAddress="chooseList" v-if="chooseList.length > 0">{{intention||'请选择捐款意向'}}</cascade> -->
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="box-item" v-if="intention && (intention.indexOf('非定向') == -1)">
|
|
|
|
|
- <view class="box-left">
|
|
|
|
|
- <text class="imp">*</text>捐款项目
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="box-right">
|
|
|
|
|
- <picker @change="changeTlist" :range="chooseTlist" class="box-right" range-key="name">
|
|
|
|
|
- <text>{{ tIntention || '请选择捐款项目'}}</text>
|
|
|
|
|
- </picker>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-item">
|
|
<view class="box-item">
|
|
|
<view class="box-left">
|
|
<view class="box-left">
|
|
|
<text class="imp">*</text>捐款方式
|
|
<text class="imp">*</text>捐款方式
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="box-right">
|
|
|
|
|
- <!-- <input type="text" placeholder="请选择捐款方式" /> -->
|
|
|
|
|
- <picker @change="PickerType" :value="index" :range="chooseType" class="box-right">
|
|
|
|
|
|
|
+ <picker @change="PickerType" :value="index" :range="chooseType" class="box-right">
|
|
|
|
|
+ <view class="box-right">
|
|
|
<text>{{ way || '请选择捐款方式'}}</text>
|
|
<text>{{ way || '请选择捐款方式'}}</text>
|
|
|
- </picker>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </picker>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- <view class="box-item">
|
|
<!-- <view class="box-item">
|
|
|
<view class="box-left">
|
|
<view class="box-left">
|
|
@@ -47,20 +35,15 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view> -->
|
|
</view> -->
|
|
|
<view class="box-item1" @click="tochooseMoney">
|
|
<view class="box-item1" @click="tochooseMoney">
|
|
|
- <!-- <view class="box-item1" @click="tochooseMoney"> -->
|
|
|
|
|
<view class="box-main">
|
|
<view class="box-main">
|
|
|
<view class="box-left">
|
|
<view class="box-left">
|
|
|
<text class="imp">*</text>捐款金额
|
|
<text class="imp">*</text>捐款金额
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="box-right">
|
|
|
|
|
- <input type="text" placeholder="请选择金额" v-model="money" disabled />
|
|
|
|
|
- <!-- <picker @change="PickerMoney" :value="index" :range="chooseMoney" class="box-right">
|
|
|
|
|
- <text>{{ money || '请选择捐款金额'}}</text>
|
|
|
|
|
- </picker> -->
|
|
|
|
|
|
|
+ <view class="box-right" style="text-align: right;">
|
|
|
|
|
+ <!-- <input type="text" placeholder="请选择金额" v-model="money" disabled /> -->
|
|
|
|
|
+ {{money|| '请选择金额'}}
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
<view class="box-bottom">
|
|
<view class="box-bottom">
|
|
|
个人满500,单位满2000可打印纸质证书
|
|
个人满500,单位满2000可打印纸质证书
|
|
|
</view>
|
|
</view>
|
|
@@ -70,7 +53,7 @@
|
|
|
<!-- <view class="infoOptional">
|
|
<!-- <view class="infoOptional">
|
|
|
信息(选填)
|
|
信息(选填)
|
|
|
</view> -->
|
|
</view> -->
|
|
|
- <view class="box">
|
|
|
|
|
|
|
+ <view class="box" v-if="public">
|
|
|
<view class="box-item">
|
|
<view class="box-item">
|
|
|
<view class="box-left">
|
|
<view class="box-left">
|
|
|
<view v-if="!is_show">
|
|
<view v-if="!is_show">
|
|
@@ -86,10 +69,10 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-item">
|
|
<view class="box-item">
|
|
|
<view class="box-left">
|
|
<view class="box-left">
|
|
|
- <text class="imp">*</text>联系方式
|
|
|
|
|
|
|
+ <text class="imp">*</text>手机号
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-right">
|
|
<view class="box-right">
|
|
|
- <input type="text" placeholder="请填写联系方式" v-model="mobile" />
|
|
|
|
|
|
|
+ <input type="text" placeholder="请填写手机号" v-model="mobile" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -213,18 +196,15 @@
|
|
|
import {
|
|
import {
|
|
|
userinfo
|
|
userinfo
|
|
|
} from '@/api/user.js';
|
|
} from '@/api/user.js';
|
|
|
- import cascade from '@/components/cascade.vue'
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
uniPopup,
|
|
uniPopup,
|
|
|
- cascade
|
|
|
|
|
// uniLoadMore
|
|
// uniLoadMore
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
index: 0,
|
|
index: 0,
|
|
|
intention: '', // 捐款意向
|
|
intention: '', // 捐款意向
|
|
|
- tIntention: '',//二层捐款意向
|
|
|
|
|
category_id: '', // 捐款意向ID
|
|
category_id: '', // 捐款意向ID
|
|
|
way: '', // 捐款方式
|
|
way: '', // 捐款方式
|
|
|
way_id: '', // 捐款方式id
|
|
way_id: '', // 捐款方式id
|
|
@@ -238,19 +218,19 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 1,
|
|
id: 1,
|
|
|
- money: 200
|
|
|
|
|
|
|
+ money: 100
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 2,
|
|
id: 2,
|
|
|
- money: 100
|
|
|
|
|
|
|
+ money: 10
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 3,
|
|
id: 3,
|
|
|
- money: 50
|
|
|
|
|
|
|
+ money: 5
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
id: 4,
|
|
id: 4,
|
|
|
- money: 20
|
|
|
|
|
|
|
+ money: 1
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
is_public: '0', // 是否实名公开
|
|
is_public: '0', // 是否实名公开
|
|
@@ -262,9 +242,8 @@
|
|
|
isshowMoney: false, // 其他金额是否展示
|
|
isshowMoney: false, // 其他金额是否展示
|
|
|
address: '', // 联系地址
|
|
address: '', // 联系地址
|
|
|
// chooseDire: ['请选择捐款意向','红十字人道事业(非定向捐赠)','疫情防控','其他','红十字博爱送万家','AED救护及科普','青少年生命安全教育基地建设项目','关注重度失能老人项目','青少年白血病救护项目','地芯行动-关爱地中海贫血儿童','会费缴纳'],
|
|
// chooseDire: ['请选择捐款意向','红十字人道事业(非定向捐赠)','疫情防控','其他','红十字博爱送万家','AED救护及科普','青少年生命安全教育基地建设项目','关注重度失能老人项目','青少年白血病救护项目','地芯行动-关爱地中海贫血儿童','会费缴纳'],
|
|
|
- chooseDire: [], //捐款意向处理列表
|
|
|
|
|
- chooseList: [],//捐款意向原初列表
|
|
|
|
|
- chooseTlist: [],//二次选择列表
|
|
|
|
|
|
|
+ chooseDire: [],
|
|
|
|
|
+ chooseList: [], //捐款意向真实列表
|
|
|
chooseType: ['个人', '单位'],
|
|
chooseType: ['个人', '单位'],
|
|
|
chooseMoney: ['5元', '10元', '50元', '其他金额'],
|
|
chooseMoney: ['5元', '10元', '50元', '其他金额'],
|
|
|
payLoding: false, //判断是否支付中
|
|
payLoding: false, //判断是否支付中
|
|
@@ -286,7 +265,6 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
-
|
|
|
|
|
if (!this.hasLogin) {
|
|
if (!this.hasLogin) {
|
|
|
// 登录拦截
|
|
// 登录拦截
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -307,7 +285,7 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- this.addType()
|
|
|
|
|
|
|
+ // this.loadData();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -315,83 +293,23 @@
|
|
|
...mapState(['weichatObj']),
|
|
...mapState(['weichatObj']),
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- onCityClick({data}) {
|
|
|
|
|
- console.log(data)
|
|
|
|
|
- let obj = this
|
|
|
|
|
- obj.intention = data[1]
|
|
|
|
|
- obj.chooseDire.forEach(item => {
|
|
|
|
|
- if(item.name == obj.intention) {
|
|
|
|
|
- obj.category_id = item.id
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- console.log(obj.category_id,'obj.category_id+++++++++++++')
|
|
|
|
|
- // this.intention = this.chooseDire[e.target.value];
|
|
|
|
|
- // this.category_id = this.chooseList[e.target.value].id;
|
|
|
|
|
- },
|
|
|
|
|
// 点击捐赠意向
|
|
// 点击捐赠意向
|
|
|
addType(e) {
|
|
addType(e) {
|
|
|
- let obj = this
|
|
|
|
|
- chosintention({}).then(({
|
|
|
|
|
|
|
+ chosintention({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ limit: 100
|
|
|
|
|
+ }).then(({
|
|
|
data
|
|
data
|
|
|
}) => {
|
|
}) => {
|
|
|
- // 版本一
|
|
|
|
|
- // this.chooseDire = data
|
|
|
|
|
- // let arr = data.filter(item => {
|
|
|
|
|
- // return item.pid == 0
|
|
|
|
|
- // })
|
|
|
|
|
- // console.log(arr[1].id,arr[0].id,'arr+++++++++')
|
|
|
|
|
- // let arr2 = data.filter(item => {
|
|
|
|
|
- // return item.pid != 0
|
|
|
|
|
- // })
|
|
|
|
|
- // console.log(arr2,'ddddddddddddddddd')
|
|
|
|
|
- // arr = arr.map(item => {
|
|
|
|
|
- // item.child = []
|
|
|
|
|
- // console.log(arr2,'arr2++++')
|
|
|
|
|
- // arr2.forEach(itemt => {
|
|
|
|
|
- // if(item.id == itemt.pid) {
|
|
|
|
|
- // console.log('zhaodaole')
|
|
|
|
|
- // item.child.push(itemt)
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
- // return item
|
|
|
|
|
- // })
|
|
|
|
|
- // this.chooseList = arr
|
|
|
|
|
-
|
|
|
|
|
- // 版本二
|
|
|
|
|
- console.log(data,'data++++')
|
|
|
|
|
- obj.chooseList = data
|
|
|
|
|
- obj.chooseDire = data.filter(item => {
|
|
|
|
|
- return item.pid == 0
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- console.log(obj.chooseDire,'obj.chooseDire')
|
|
|
|
|
|
|
+ this.chooseDire = data.map(item => item.name)
|
|
|
|
|
+ this.chooseList = data
|
|
|
}).catch()
|
|
}).catch()
|
|
|
},
|
|
},
|
|
|
// 选择捐赠意向
|
|
// 选择捐赠意向
|
|
|
PickerDire: function(e) {
|
|
PickerDire: function(e) {
|
|
|
console.log(334, e)
|
|
console.log(334, e)
|
|
|
- let chooseType = this.chooseDire[e.detail.value]
|
|
|
|
|
- this.intention = chooseType.name
|
|
|
|
|
- if(chooseType.name.indexOf('非定向') != -1) {
|
|
|
|
|
-
|
|
|
|
|
- this.category_id = this.chooseDire[e.detail.value].id
|
|
|
|
|
- this.tIntention = ''
|
|
|
|
|
- console.log(this.category_id,'dddd')
|
|
|
|
|
- }else {
|
|
|
|
|
- this.chooseTlist = this.chooseList.filter(item => {
|
|
|
|
|
- return item.pid == this.chooseDire[e.detail.value].id
|
|
|
|
|
- })
|
|
|
|
|
- console.log(this.chooseTlist,'this.chooseTlist++++')
|
|
|
|
|
- }
|
|
|
|
|
- // console.log()
|
|
|
|
|
- // this.intention = this.chooseDire[e.target.value];
|
|
|
|
|
- // this.category_id = this.chooseList[e.target.value].id;
|
|
|
|
|
- },
|
|
|
|
|
- // 选择二层捐款意向
|
|
|
|
|
- changeTlist(e) {
|
|
|
|
|
- console.log(e)
|
|
|
|
|
- this.tIntention = this.chooseTlist[e.detail.value].name
|
|
|
|
|
- this.category_id = this.chooseTlist[e.detail.value].id
|
|
|
|
|
|
|
+ this.intention = this.chooseDire[e.target.value];
|
|
|
|
|
+ this.category_id = this.chooseList[e.target.value].id;
|
|
|
},
|
|
},
|
|
|
// 选择捐款方式
|
|
// 选择捐款方式
|
|
|
PickerType: function(e) {
|
|
PickerType: function(e) {
|
|
@@ -456,11 +374,10 @@
|
|
|
// 是否实名公开
|
|
// 是否实名公开
|
|
|
switch1Change(e) {
|
|
switch1Change(e) {
|
|
|
this.public = e.detail.value
|
|
this.public = e.detail.value
|
|
|
- console.log(e.detail.value,'e.detail.value')
|
|
|
|
|
if (e.detail.value) {
|
|
if (e.detail.value) {
|
|
|
- this.is_public = '1'
|
|
|
|
|
- } else {
|
|
|
|
|
this.is_public = '0'
|
|
this.is_public = '0'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.is_public = '1'
|
|
|
}
|
|
}
|
|
|
console.log(this.is_public)
|
|
console.log(this.is_public)
|
|
|
},
|
|
},
|
|
@@ -468,9 +385,9 @@
|
|
|
switch2Change(e) {
|
|
switch2Change(e) {
|
|
|
this.is_receipts = e.detail.value
|
|
this.is_receipts = e.detail.value
|
|
|
if (e.detail.value) {
|
|
if (e.detail.value) {
|
|
|
- this.is_receipts = '1'
|
|
|
|
|
- } else {
|
|
|
|
|
this.is_receipts = '0'
|
|
this.is_receipts = '0'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.is_receipts = '1'
|
|
|
}
|
|
}
|
|
|
console.log('is_receipts', this.is_receipts)
|
|
console.log('is_receipts', this.is_receipts)
|
|
|
},
|
|
},
|
|
@@ -485,23 +402,26 @@
|
|
|
this.$api.msg('请输入捐款金额!');
|
|
this.$api.msg('请输入捐款金额!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.is_show) {
|
|
|
|
|
- if (!obj.donate_er) {
|
|
|
|
|
- this.$api.msg('请填写您的单位');
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (obj.public) {
|
|
|
|
|
+ if (this.is_show) {
|
|
|
|
|
+ if (!obj.donate_er) {
|
|
|
|
|
+ this.$api.msg('请填写您的姓名');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!obj.donate_er) {
|
|
|
|
|
+ this.$api.msg('请填写您的单位');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- if (!obj.donate_er) {
|
|
|
|
|
- this.$api.msg('请填写您的姓名');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
|
|
|
|
|
+ if (!reg.test(obj.mobile)) {
|
|
|
|
|
+ obj.$api.msg('请填写正确的手机号码');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
|
|
|
|
|
- if (!reg.test(obj.mobile)) {
|
|
|
|
|
- obj.$api.msg('请填写正确的联系方式');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
if (this.is_receipts == '0') {
|
|
if (this.is_receipts == '0') {
|
|
|
// obj.address = '用户未填写联系地址'
|
|
// obj.address = '用户未填写联系地址'
|
|
|
if (!obj.address) {
|
|
if (!obj.address) {
|
|
@@ -513,7 +433,7 @@
|
|
|
if (!obj.address) {
|
|
if (!obj.address) {
|
|
|
obj.address = '用户未填写联系地址'
|
|
obj.address = '用户未填写联系地址'
|
|
|
}
|
|
}
|
|
|
- if(!obj.isHelp) {
|
|
|
|
|
|
|
+ if (!obj.isHelp) {
|
|
|
if (!obj.intention) {
|
|
if (!obj.intention) {
|
|
|
this.$api.msg('请选择捐款意向');
|
|
this.$api.msg('请选择捐款意向');
|
|
|
return;
|
|
return;
|
|
@@ -526,8 +446,8 @@
|
|
|
// contact: obj, //单位联系人(企业有效)
|
|
// contact: obj, //单位联系人(企业有效)
|
|
|
tel: obj.mobile, //手机号
|
|
tel: obj.mobile, //手机号
|
|
|
address: obj.address, //联系地址
|
|
address: obj.address, //联系地址
|
|
|
- is_open: obj.is_public, //是否实名公开
|
|
|
|
|
- is_ticket: obj.is_receipts, //是否开发票
|
|
|
|
|
|
|
+ is_open: obj.public?1:0, //是否实名公开
|
|
|
|
|
+ is_ticket: obj.is_receipts == 0 ? 1: 0, //是否开发票
|
|
|
pay_type: 0, //支付方式0微信1支付宝
|
|
pay_type: 0, //支付方式0微信1支付宝
|
|
|
type: obj.way_id,
|
|
type: obj.way_id,
|
|
|
}
|
|
}
|
|
@@ -700,7 +620,7 @@
|
|
|
right: 0;
|
|
right: 0;
|
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
|
height: 100rpx;
|
|
height: 100rpx;
|
|
|
- background: #FA7E67;
|
|
|
|
|
|
|
+ background: #E63931;
|
|
|
color: #FFFFFF;
|
|
color: #FFFFFF;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
@@ -868,4 +788,4 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|