|
|
@@ -58,7 +58,13 @@
|
|
|
<view class="item">
|
|
|
<view class="item-tit">物流方式<text>*</text></view>
|
|
|
<picker @change="bindLogChange" :range="logs" range-key="name">
|
|
|
- <view class="log select" :class="{'action': log }">{{ log || '请选择物流方式' }}</view>
|
|
|
+ <view class="log " :class="{'select': log }">{{ log || '请选择物流方式' }}</view>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ <view class="item" v-if="showArea">
|
|
|
+ <view class="item-tit">捐赠地址<text>*</text></view>
|
|
|
+ <picker @change="bindAreaChange" :range="areas" range-key="name">
|
|
|
+ <view class="log " :class="{'select': area }">{{ area || '请选择捐赠地址' }}</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
<view class="item no-border-b">
|
|
|
@@ -168,10 +174,24 @@
|
|
|
|
|
|
<script>
|
|
|
import { upload } from '@/api/ask.js';
|
|
|
- import { getProjectInfo, createProject, getLogistics, getDonationInfo, createUser } from '../../api/money.js';
|
|
|
+ import {
|
|
|
+ saveUrl,
|
|
|
+ interceptor
|
|
|
+ } from '@/utils/loginUtils.js';
|
|
|
+ import {
|
|
|
+ mapState,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex';
|
|
|
+ import { getProjectInfo, createProject, getLogistics, getDonationInfo, createUser,getAllArea } from '../../api/money.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ project_area: 0,
|
|
|
+ areas: [{
|
|
|
+ id: 0,
|
|
|
+ name: '市本级'
|
|
|
+ }],
|
|
|
+ area: '',
|
|
|
items: [
|
|
|
{
|
|
|
value: '个人',
|
|
|
@@ -213,6 +233,7 @@
|
|
|
true_wzList: [],//最终捐赠的物资列表
|
|
|
hadadd: [],//已添加分类
|
|
|
project_id: 0,//项目ID
|
|
|
+ showArea: false,
|
|
|
}
|
|
|
},
|
|
|
filters:{
|
|
|
@@ -234,15 +255,47 @@
|
|
|
if(ops.id) {
|
|
|
this.project_id = ops.id*1
|
|
|
}
|
|
|
+ if(ops.project_area) {
|
|
|
+ this.project_area = ops.project_area
|
|
|
+ }
|
|
|
if(ops.wzlist) {
|
|
|
this.wzs = JSON.parse(ops.wzlist)
|
|
|
-
|
|
|
+
|
|
|
}else {
|
|
|
+ this.showArea = true
|
|
|
this.getDonationInfo()
|
|
|
+ this.getAllArea()
|
|
|
}
|
|
|
|
|
|
this.getLogistics()
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ if (!this.hasLogin) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '登录',
|
|
|
+ content: '您未登录,是否马上登陆?',
|
|
|
+ success: e => {
|
|
|
+ if (e.confirm) {
|
|
|
+ saveUrl()
|
|
|
+ interceptor();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: e => {
|
|
|
+ console.log(e);
|
|
|
+ uni.showModal({
|
|
|
+ title: 'cuowu',
|
|
|
+ content: JSON.stringify(e),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // this.loadData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState('user', ['userInfo', 'baseURL', 'hasLogin']),
|
|
|
+ ...mapState(['weichatObj']),
|
|
|
+ },
|
|
|
mounted() {
|
|
|
// this.$set(this,'wzList',[this.wz1,this.wz2])
|
|
|
},
|
|
|
@@ -288,6 +341,11 @@
|
|
|
// this.wz = this.logs[e.detail.value].name
|
|
|
|
|
|
},
|
|
|
+ // 选择捐赠地址
|
|
|
+ bindAreaChange(e) {
|
|
|
+ this.project_area = this.areas[e.detail.value].id
|
|
|
+ this.area = this.areas[e.detail.value].name
|
|
|
+ },
|
|
|
openChange(e) {
|
|
|
if(e.detail.value !== '1') {
|
|
|
this.Isopen = false
|
|
|
@@ -357,6 +415,13 @@
|
|
|
obj.$api.msg('请选择物流方式');
|
|
|
return;
|
|
|
}
|
|
|
+ if( obj.showArea == true) {
|
|
|
+ if(obj.area == '') {
|
|
|
+ obj.$api.msg('请选择捐赠地址');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
try{
|
|
|
obj.wzList.forEach( item => {
|
|
|
if(!item.project_donation_id){
|
|
|
@@ -391,6 +456,7 @@
|
|
|
mask: true
|
|
|
})
|
|
|
createUser({
|
|
|
+ project_area: obj.project_area,
|
|
|
name: obj.type === 0? obj.name: obj.unit,
|
|
|
phone: obj.phone,
|
|
|
tel: obj.tel,
|
|
|
@@ -405,6 +471,7 @@
|
|
|
console.log(info.name,'8888888888888')
|
|
|
|
|
|
createProject({
|
|
|
+ project_area: obj.project_area,
|
|
|
name: obj.type === 0? obj.name: obj.unit,
|
|
|
project_id: obj.project_id,
|
|
|
project_user_id: +info.id,
|
|
|
@@ -446,7 +513,16 @@
|
|
|
},
|
|
|
dele() {
|
|
|
this.$delete(this.wzList,this.wzList.length-1)
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 获取捐赠地址列表
|
|
|
+ getAllArea() {
|
|
|
+ getAllArea().then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ console.log(data, '6666666666');
|
|
|
+ this.areas = this.areas.concat(data);
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -474,8 +550,8 @@
|
|
|
line-height: 75rpx;
|
|
|
padding-bottom: 54rpx;
|
|
|
// padding-top: 54rpx;
|
|
|
- position: fixed;
|
|
|
- bottom: 0;
|
|
|
+ // position: fixed;
|
|
|
+ // bottom: 0;
|
|
|
background-color: #fff;
|
|
|
z-index: 9;
|
|
|
.next {
|
|
|
@@ -634,6 +710,9 @@
|
|
|
padding-top: 39rpx;
|
|
|
line-height: 1;
|
|
|
width: 200rpx;
|
|
|
+ text {
|
|
|
+ color: #F3392C;
|
|
|
+ }
|
|
|
}
|
|
|
.choose-box {
|
|
|
padding-top: 24rpx;
|
|
|
@@ -642,16 +721,16 @@
|
|
|
margin-bottom: 15rpx;
|
|
|
position: relative;
|
|
|
.wz {
|
|
|
+ padding: 0 15rpx;
|
|
|
padding-left: 58rpx;
|
|
|
width: 297rpx;
|
|
|
- height: 66rpx;
|
|
|
+
|
|
|
background: #F3F3F3;
|
|
|
border-radius: 5rpx;
|
|
|
font-size: 28rpx;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
color: #222222;
|
|
|
- line-height: 66rpx;
|
|
|
&::after {
|
|
|
content: '';
|
|
|
width: 0;
|