lhl 4 years ago
parent
commit
f22987a634
4 changed files with 55 additions and 19 deletions
  1. 7 9
      pages/donate/donateDetail.vue
  2. 46 8
      pages/donate/idonate.vue
  3. 1 1
      pages/donate/progress.vue
  4. 1 1
      pages/donate/progresst.vue

+ 7 - 9
pages/donate/donateDetail.vue

@@ -59,12 +59,10 @@
 						<view class="">
 							{{ item.project_donation_id | type(typeList) }}:
 							<text>{{ item.project_donation_num }}</text>
-							顶
 						</view>
 						<view class="">
 							最低需求捐赠数:
 							<text>{{ item.project_donation_num }}</text>
-							顶
 						</view>
 						<!-- <view class="">
 							物资捐赠要求:
@@ -109,7 +107,7 @@
 						<view class="item-top">
 							<image src="../../static/img/002.png" mode=""></image>
 							<view class="item-name-time">
-								<view class="item-name">石首市捐赠</view>
+								<view class="item-name">荆州捐赠</view>
 								<view class="item-time">{{ item.time | time }}</view>
 							</view>
 						</view>
@@ -124,7 +122,7 @@
 						<view class="item-top">
 							<image src="../../static/img/002.png" mode=""></image>
 							<view class="item-name-time">
-								<view class="item-name">石首市捐赠</view>
+								<view class="item-name">荆州捐赠</view>
 								<view class="item-time">{{ item.time | time }}</view>
 							</view>
 						</view>
@@ -139,7 +137,7 @@
 						<view class="item-top">
 							<image src="../../static/img/002.png" mode=""></image>
 							<view class="item-name-time">
-								<view class="item-name">石首市捐赠</view>
+								<view class="item-name">荆州捐赠</view>
 								<view class="item-time">{{ item.time | time }}</view>
 							</view>
 						</view>
@@ -154,7 +152,7 @@
 		<view class="jg" style="height: 99rpx;"></view>
 		<view class="btn-wrapper flex">
 			<view class="btn1 btn" @click="navTo('/pages/donate/progress?id=' + proInfo.id)">实时进展</view>
-			<view class="btn2 btn" @click="proInfo.status === 1 ? want() : cant()">我要捐</view>
+			<view class="btn2 btn" @click="proInfo.status === 1 ? want() : cant()">我要捐</view>
 		</view>
 		<uni-popup ref="popup" type="center">
 			<view class="type-box">
@@ -254,7 +252,7 @@ export default {
 				let arr = val.map(item => {
 					for (let i = 0; i < typeList.length; i++) {
 						if (item.project_donation_id == typeList[i].id) {
-							str = str + typeList[i].name + ' ' + item.project_donation_num + ' ' + ' ';
+							str = str + typeList[i].name + ' ' + item.project_donation_num + ' ' + ' ';
 						}
 					}
 				});
@@ -357,7 +355,7 @@ export default {
 			});
 			console.log(wzList, '**************************************');
 
-			this.navTo('/pages/donate/idonate?type=' + this.jxType + '&id=' + this.proInfo.id + '&wzlist=' + JSON.stringify(wzList));
+			this.navTo('/pages/donate/idonate?type=' + this.jxType + '&id=' + this.proInfo.id + '&wzlist=' + JSON.stringify(wzList) + '&project_area=' + this.proInfoproject_area);
 		},
 		//获取物资分类列表
 		getDonationInfo() {
@@ -425,7 +423,7 @@ export default {
 				item.forEach(item => {
 					for (let i = 0; i < this.typeList.length; i++) {
 						if (item.project_donation_id === this.typeList[i].project_donation_id) {
-							str = str + this.typeList[i].project_donation_name + item.project_donation_num + '';
+							str = str + this.typeList[i].project_donation_name + item.project_donation_num + '';
 						}
 					}
 				});

+ 46 - 8
pages/donate/idonate.vue

@@ -61,7 +61,7 @@
 					<view class="log " :class="{'select': log }">{{ log || '请选择物流方式' }}</view>
 				</picker>
 			</view>
-			<view class="item" v-if="jxdz_show">
+			<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>
@@ -174,11 +174,19 @@
 
 <script>
 	import { upload } from '@/api/ask.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: 225,
+				project_area: 0,
 				areas: [{
 					id: 0,
 					name: '市本级'
@@ -225,7 +233,7 @@
 				true_wzList: [],//最终捐赠的物资列表
 				hadadd: [],//已添加分类
 				project_id: 0,//项目ID
-				jxdz_show: false,
+				showArea: false,
 			}
 		},
 		filters:{
@@ -247,17 +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.jxdz_show = true
 			}
 			
 			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])
 		},
@@ -377,7 +415,7 @@
 					obj.$api.msg('请选择物流方式');
 					return;
 				}
-				if(obj.jxdz_show == true) {
+				if(	obj.showArea == true) {
 					if(obj.area == '') {
 						obj.$api.msg('请选择捐赠地址');
 						return;
@@ -683,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;

+ 1 - 1
pages/donate/progress.vue

@@ -165,7 +165,7 @@ export default {
 			let arr = val.map(item => {
 				for(let i = 0; i< typeList.length ;i++){
 					if(item.project_donation_id == typeList[i].id){
-						str = str + typeList[i].name + ' '+item.project_donation_num +' '+' '
+						str = str + typeList[i].name + ' '+item.project_donation_num +' '+' '
 					}
 				}
 			})

+ 1 - 1
pages/donate/progresst.vue

@@ -151,7 +151,7 @@ export default {
 				let arr = val.map(item => {
 					for (let i = 0; i < typeList.length; i++) {
 						if (item.project_donation_id == typeList[i].id) {
-							str = str + typeList[i].name + item.project_donation_num  + '、';
+							str = str + typeList[i].name + item.project_donation_num  + '、';
 						}
 					}
 				});