py il y a 2 ans
Parent
commit
e09dc53ebb

+ 109 - 64
pages-address/edit-add.vue

@@ -3,33 +3,33 @@
 		<Nav :title="fromData.id?'编辑地址':'新增地址'"></Nav>
 
 		<view class="scroll-view-css box-border-box p-24">
-			
+
 			<view class="box-card box-border-box p-24 mb-20">
 				<EnInput label="收货人" placeholder="请输入收货人姓名" v-model="fromData.consignee"></EnInput>
 				<EnInput label="电话号码" type="number" placeholder="请输入电话号码" v-model="fromData.phone"></EnInput>
 
-				<EnSelect v-if="schoolList.length > 0" label="收货学校" placeholder="请选择收货学校" v-model="fromData.school_id" 
-				:localData="schoolList" :valueType="'1'" ></EnSelect>
-				
-				<EnSelect label="楼栋" placeholder="请选择楼栋" v-if="fromData.school_id" v-model="fromData.dorm_id" 
-				:localData="builList" :valueType="'1'" ></EnSelect>
-				
+				<EnSelect v-if="schoolList.length > 0" label="收货学校" placeholder="请选择收货学校" v-model="fromData.school_id"
+					:localData="schoolList" :valueType="'1'"></EnSelect>
+
+				<EnSelect label="楼栋" placeholder="请选择楼栋" v-if="isDorm" v-model="fromData.dorm_id"
+					:localData="builList" :valueType="'1'"></EnSelect>
+
 				<EnInput label="详细地址" placeholder="请输入详细地址" v-model="fromData.address"></EnInput>
 			</view>
-			
+
 			<view class="box-card box-border-box p-24 flex-justify-space">
 				<view class="">
 					<view class="fs-30 mb-16">设为默认地址</view>
 					<view class="fs-24 fc-9">提醒:下单会优先使用该地址</view>
 				</view>
-				<view class="r-right" @click="fromData.is_default == 1?fromData.is_default=0:fromData.is_default=1" 
-				:class="fromData.is_default == 0?'n-r':'s-r'">
+				<view class="r-right" @click="fromData.is_default == 1?fromData.is_default=0:fromData.is_default=1"
+					:class="fromData.is_default == 0?'n-r':'s-r'">
 					<view class="r-y"></view>
 				</view>
 			</view>
 		</view>
 
-		<view class="box-border-box p-24 bgc-f " >
+		<view class="box-border-box p-24 bgc-f ">
 			<view class="add-box text-align-center fs-34 fc-f mb-20" @click="save()">确定</view>
 			<view v-if="fromData.id" class="add-box-1 text-align-center fs-34 fc-41ABF5" @click="del()">删除</view>
 		</view>
@@ -37,11 +37,17 @@
 </template>
 
 <script>
-	import {getAddressInfo,saveAddress,delAddress,getAddressSchool,getAddressDorm} from '@/api/member.js'
+	import {
+		getAddressInfo,
+		saveAddress,
+		delAddress,
+		getAddressSchool,
+		getAddressDorm
+	} from '@/api/member.js'
 	import tools from "@/service/tools.js";
 	import EnSelect from "@/components/en-from/en-select/en-select";
 	import EnInput from "@/components/en-from/en-input/en-input";
-	
+
 	export default {
 		components: {
 			EnInput,
@@ -64,74 +70,103 @@
 					is_default: 0,
 					consignee: '',
 					phone: '',
-					dorm_id:'',
-					school_id:'',
-					
-					dorm_name:'',
-					school_name:'',
+					dorm_id: '',
+					school_id: '',
+
+					dorm_name: '',
+					school_name: '',
 				},
 
 				schoolList: [],
-				builList:[],
+				builList: [],
 				isAJAX: false,
-				
-				time:'',
+				isDorm: false,
+				time: '',
+				selectId: false
 			}
 		},
 		onLoad(e) {
 			if (e.id) {
+				this.selectId = true
 				this.getInfo(e.id)
 			} else {
 				this.fromData.id = '';
+				this.getAddressSchool();
 			}
-			this.getAddressSchool();
 		},
-		watch:{
-			'fromData.school_id'(val){
+		watch: {
+			'fromData.school_id'(newval,old) {
+				console.log(old, 'old');
+				console.log(newval, 'newval');
+				if(newval != old && !this.selectId) {
+					this.fromData.dorm_id = ''
+				}
 				this.getAddressDorm()
 			},
 		},
 		methods: {
 			getInfo(id) {
-				getAddressInfo({id:id}).then((res)=>{
-					if(res.code === 1){
+				getAddressInfo({
+					id: id
+				}).then((res) => {
+					if (res.code === 1) {
 						this.fromData = res.data;
 						this.fromData.school_id = res.data.school_id + '';
 						this.fromData.dorm_id = res.data.dorm_id + '';
+						this.getAddressSchool();
 					}
 				})
 			},
-			getAddressSchool(){
+			getAddressSchool() {
 				let operate_id = uni.getStorageSync('operate_id');
-				getAddressSchool({operate_id:operate_id}).then((res)=>{
-					if(res.code === 1){
-						this.schoolList = res.data.map(obj =>{
-							const {school_id,school_name} = obj;
-							return {value:school_id + '',text:school_name};
+				getAddressSchool({
+					operate_id: operate_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.schoolList = res.data.map(obj => {
+							const {
+								school_id,
+								school_name
+							} = obj;
+							return {
+								value: school_id + '',
+								text: school_name
+							};
 						});
 					}
 				})
 			},
-			getAddressDorm(){
-				getAddressDorm({school_id:this.fromData.school_id}).then((res)=>{
-					if(res.code === 1){
-						this.builList = res.data.map(obj =>{
-							const {dorm_id,name,type_str} = obj;
-							return {value:dorm_id + '',text:name + '('+ type_str +')'};
+			getAddressDorm() {
+				getAddressDorm({
+					school_id: this.fromData.school_id
+				}).then((res) => {
+					if (res.code === 1) {
+						this.builList = res.data.map(obj => {
+							const {
+								dorm_id,
+								name,
+								type_str
+							} = obj;
+							return {
+								value: dorm_id + '',
+								text: name + '(' + type_str + ')'
+							};
 						});
+						this.isDorm = true
+						this.selectId = false
 					}
 				})
 			},
 			save() {
-				if(this.isAJAX){
+				if (this.isAJAX) {
 					return
 				}
 				this.isAJAX = true;
-				saveAddress(this.fromData).then((res)=>{
-					if(res.code === 1){
+				saveAddress(this.fromData).then((res) => {
+					if (res.code === 1) {
 						tools.success('操作成功');
 						this.isAJAX = false;
-						setTimeout(()=>{
+						setTimeout(() => {
 							uni.navigateBack({
 								delta: 1
 							});
@@ -140,29 +175,31 @@
 								is_default: this.fromData.is_default,
 								id: this.fromData.id
 							}
-							uni.setStorageSync('isConfirmAddressFlag',addressData);
-						},1500)
-					}else{
+							uni.setStorageSync('isConfirmAddressFlag', addressData);
+						}, 1500)
+					} else {
 						tools.error(res.msg);
 						this.isAJAX = false;
 					}
 				})
 			},
-			del(){
-				if(this.isAJAX){
+			del() {
+				if (this.isAJAX) {
 					return
 				}
 				this.isAJAX = true;
-				delAddress({id:this.fromData.id}).then((res)=>{
-					if(res.code === 1){
+				delAddress({
+					id: this.fromData.id
+				}).then((res) => {
+					if (res.code === 1) {
 						tools.success('操作成功');
 						this.isAJAX = false;
-						setTimeout(()=>{
+						setTimeout(() => {
 							uni.reLaunch({
 								url: '/pages-address/address'
 							})
-						},1500)
-					}else{
+						}, 1500)
+					} else {
 						tools.error(res.msg);
 						this.isAJAX = false;
 					}
@@ -181,7 +218,8 @@
 			background-color: #2F80ED;
 			border-radius: 200rpx;
 		}
-		.add-box-1{
+
+		.add-box-1 {
 			width: 100%;
 			height: 88rpx;
 			line-height: 88rpx;
@@ -190,19 +228,22 @@
 			box-sizing: border-box;
 			border: 2rpx solid #41ABF5;
 		}
-		.box-card{
+
+		.box-card {
 			width: 1005;
 			min-height: 152rpx;
 			background: #FFFFFF;
 			border-radius: 20rpx;
 		}
-		.r-right{
+
+		.r-right {
 			margin-top: 24rpx;
 			width: 88rpx;
 			height: 52rpx;
 			border-radius: 200rpx;
 			position: relative;
-			.r-y{
+
+			.r-y {
 				width: 44rpx;
 				height: 44rpx;
 				background: #FFFFFF;
@@ -211,20 +252,24 @@
 				top: 4rpx;
 			}
 		}
-		.s-r{
+
+		.s-r {
 			background-color: #41ABF5;
-			transition:  all 1s; 
-			.r-y{
+			transition: all 1s;
+
+			.r-y {
 				right: 4rpx !important;
-				transition:  all 1s; 
+				transition: all 1s;
 			}
 		}
-		.n-r{
+
+		.n-r {
 			background-color: #ccc;
-			transition:  all 1s; 
-			.r-y{
+			transition: all 1s;
+
+			.r-y {
 				left: 4rpx !important;
-				transition:  all 1s; 
+				transition: all 1s;
 			}
 		}
 	}

+ 5 - 1
pages-my/my-publish.vue

@@ -467,7 +467,10 @@
 				})
 			},
 			scrolltolower() {
-				console.log('触底');
+				if (this.listData.length < this.total) {
+					this.page += 1;
+					this.alumnMyAlumni();
+				}
 			},
 			alumnMyAlumni() {
 				alumnMyAlumni({
@@ -476,6 +479,7 @@
 					if (res.code == 1) {
 						if (res.data.items.length > 0) {
 							this.listData.push(...res.data.items)
+							this.total = res.data.total
 						}
 					}
 				})

+ 1 - 1
pages-order/express-info.vue

@@ -88,7 +88,7 @@
 									{{item.goods_name}}
 								</view>
 								<view class="fs-32 fc-3 fw-600">
-									¥{{(Number(item.goods_money)*Number(item.goods_num)).toFixed(2)}}
+									¥{{(Number(item.price)*Number(item.goods_num)).toFixed(2)}}
 								</view>
 							</view>
 							<!-- 				<view class="mb-2 fs-24 fc-9">

+ 1 - 1
pages-school/add-circle.vue

@@ -8,7 +8,7 @@
 				<textarea v-model="fromData.content" class="textarea-class fs-24" :maxlength='500' placeholder='这一刻说些什么'
 					@input='input'></textarea>
 				<view class="text-align-right fs-28 fc-9">
-					{{inputNum}}/500
+					{{inputNum>=500?'500':inputNum}}/500
 				</view>
 			</view>
 			<view class="bgc-f mb-20">

+ 1 - 1
pages-school/circle-info.vue

@@ -101,7 +101,7 @@
 														{{info.nickname}}
 													</view>
 													<span v-if="info.is_author == 1"
-														class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
+														class='only-box text-align-center flex-shrink0 fs-24 fc-41ABF5 ml-10'>作者</span>
 												</view>
 												<view class="fs-30 fw-400 mb-8" @click.stop="openInput(2,info,index,i)">
 													{{info.content}}

+ 2 - 0
pages-takeout/confirm-mod/select-address.vue

@@ -87,6 +87,8 @@
 				if(item.id != this.id){
 					this.$emit('giveAddress',item);
 					this.closeCoupon();
+				}else {
+					this.closeCoupon();
 				}
 			},
 			openPop(){

+ 0 - 1
service/ajax.js

@@ -38,7 +38,6 @@ export const request = (url, method, data, show = false) => {
 				  url: '/pages/login/index'
 				});
 			},500)
-           
           } else if (res.data.code * 1 === 403) {
 			resolve(res.data)
 			tools.error('请求过快!!')