فهرست منبع

基本完成所有接口

huangzhe 3 سال پیش
والد
کامیت
ab0e23ffdc

+ 1 - 1
src/core/request.js

xqd
@@ -45,7 +45,7 @@ const request = async function (args) {
         data: args.data,
         header: header
     });
-
+	console.log('request',error,response)
     if (error) {
         let msg = {
             code: 400,

+ 1 - 1
src/pages.json

xqd
@@ -181,7 +181,7 @@
 				}, {
 					"path": "cusmter/addCustomer",
 					"style": {
-						"navigationBarTitleText": "添加客户",
+						"navigationBarTitleText": "",
 						"enablePullDownRefresh": false
 					}
 

+ 1 - 1
src/pages/case/projectInfo.vue

xqd
@@ -6,7 +6,7 @@
 				:hasHeight="false"></app-nav-bar>
 
 			<!--商品轮播图-->
-			<app-goods-banner :pic-list="compositionList.banner_imgs" range-key="false"
+			<app-goods-banner :pic-list="compositionList.banner_imgs" :range-key="'banner_imgs'"
 				 :goods_id="compositionList.id" :isCart="false"></app-goods-banner>
 			<!-- 套装内商品 -->
 			<view style="background-color: #fff;">

+ 0 - 1
src/pages/index/hxj_index_component.vue

xqd
@@ -19,7 +19,6 @@
 						src="https://t17.9026.com/web/statics/image/index/HUIXIANGJIA.png" mode=""></image>
 				</view>
 			</view>
-
 		</view>
 		<app-scroll-list :list="list"></app-scroll-list>
 		<view class="link">

+ 65 - 29
src/pages/sale/cusmter/addCustomer.vue

xqd xqd xqd xqd xqd
@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<app-layout :haveBackground="false">
 		<view class="tbg">
 			<view class="ti">
 				请完善客户信息
@@ -60,7 +60,7 @@
 		</view>
 		<button type="default" class="complete" @click="submit">完成</button>
 		<view style="height: 200rpx;"></view>
-	</view>
+	</app-layout>
 </template>
 
 <script>
@@ -78,38 +78,68 @@
 					avatar: '',
 					mobile: '',
 					name: '',
-					estates: [{
-						estate_id: '',
-						estate_no: '',
-						room_no: '',
+					estates: [
+					// 	{
+					// 	estate_id: '',
+					// 	estate_no: '',
+					// 	room_no: '',
 						
-						regionId:{},
-						region:'',
-						multiIndex:[],
-						estate_name: '',
-					}]
+					// 	regionId:{},
+					// 	region:'',
+					// 	multiIndex:[],
+					// 	estate_name: '',
+					// },
+					]
 				}
 			};
 		},
 		onLoad(option) {
 			this.form.sale_customer_id=option.id
-			this.$request({
-				url:this.$api.sale.customer_detail,
-				data:{
-					sale_customer_id:option.id
-				},
-				method:'post'
-			}).then(res=>{
-				if(res.code===0){
-					this.info=res.data
-				}
-			})
-			wx.enableAlertBeforeUnload({
-				message:'还未保存',
-				success:()=>{
-					console.log('qqqqqqqqqqqqqq')
-				}
-			})
+			if(option.id!=undefined){
+				uni.setNavigationBarTitle({
+				    title: '编辑客户'
+				});
+				this.$showLoading()
+				this.$request({
+					url:this.$api.sale.customer_detail,
+					data:{
+						sale_customer_id:option.id
+					},
+					method:'post'
+				}).then(res=>{
+					if(res.code===0){
+						this.form.avatar=res.data.avatar
+						this.form.mobile=res.data.mobile
+						this.form.name=res.data.name
+						for (let i = 0; i < res.data.userEstate.length; i++) {
+							let item=res.data.userEstate[i]
+							let estateItem={
+								estate_id: item.estate_id,
+								estate_no: item.estate_no,
+								room_no: item.room_no,
+								
+								regionId:{},
+								region:'',
+								multiIndex:[item.estate.province_id,item.estate.city_id,item.estate.district_id],
+								estate_name: item.estate.name,
+							}
+							this.form.estates.push(estateItem)
+						}
+						this.$hideLoading()
+					}
+				})
+			}else{
+				uni.setNavigationBarTitle({
+				    title: '添加客户'
+				});
+			}
+			
+			// wx.enableAlertBeforeUnload({
+			// 	message:'还未保存',
+			// 	success:()=>{
+			// 		console.log('qqqqqqqqqqqqqq')
+			// 	}
+			// })
 		},
 		onShow() {
 			var pages = getCurrentPages();
@@ -221,6 +251,7 @@
 					}
 				}
 				let data={
+					sale_customer_id:this.form.sale_customer_id,
 					avatar:this.form.avatar,
 					mobile:this.form.mobile,
 					name:this.form.name,
@@ -241,9 +272,14 @@
 				}).then(res=>{
 					if(res.code===0){
 						uni.showToast({
-							title:'添加成功',
+							title:this.form.sale_customer_id?'编辑成功':'添加成功',
 						})
 					}
+				}).catch(rej=>{
+					uni.showToast({
+						title:rej,
+						icon:'none'
+					})
 				})
 			}
 		}

+ 21 - 13
src/pages/sale/cusmter/info.vue

xqd xqd xqd
@@ -1,6 +1,6 @@
 <template>
-	<view class="">
-		<view class="main-between info_card">
+	<app-layout :haveBackground="false">
+		<view class="main-between info_card" v-show="info">
 			<view class="main-left">
 				<image style="width: 91rpx;height: 91rpx;border-radius: 50%;margin-right: 25rpx;" :src="info.avatar" mode=""></image>
 				<view class="main-between-y">
@@ -18,39 +18,41 @@
 			</view>
 			</navigator>
 		</view>
-		<view class="lp_info">
+		<view class="lp_info" v-show="info">
 			<view class="title">楼盘信息</view>
 			<view class="main-between item">
 				<view class="left t-omit">区域信息</view>
-				<view class="right t-omit-two" >{{info.userEstate.estate.address}}</view>
+				<view class="right t-omit-two" >{{userEstate.estate.address}}</view>
 			</view>
 			<view class="main-between item">
 				<view class="left t-omit">楼盘名称</view>
-				<view  class="right t-omit-two">{{info.userEstate.estate.name}}</view>
+				<view  class="right t-omit-two">{{userEstate.estate.name}}</view>
 			</view>
 			<view class="main-between item">
 				<view class="left t-omit">楼盘性质</view>
-				<view  class="right t-omit">{{info.userEstate.estate.property==1?'住宅用房':'非住宅用房'}}</view>
+				<view  class="right t-omit">{{userEstate.estate.property==1?'住宅用房':'非住宅用房'}}</view>
 			</view>
 			<view class="main-between item">
 				<view class="left t-omit">户号</view>
-				<view class="right t-omit-two">{{info.userEstate.estate_no}}{{info.userEstate.room_no}}</view>
+				<view class="right t-omit-two">{{userEstate.estate_no}}{{userEstate.room_no}}</view>
 			</view>
 		</view>
 		<u-popup v-model="show" mode="center" border-radius="14" @close="show = false">
 			<view class="model">
 				<view class="tei">是否确认并认证该用户楼盘信息?</view>
 				<view class="main-between">
+					<navigator :url="`/pages/sale/cusmter/addCustomer?id=${info.id}`" @click="show = false" hover-class="none">
 					<view class=" btn left">认证成功</view>
-					<view class=" btn right">信息有误</view>
+					</navigator>
+					<view class=" btn right" @click="show = false">信息有误</view>
 				</view>
-				<view class="qx">取消认证</view>
+				<view class="qx" @click="show = false">取消认证</view>
 			</view>
 		</u-popup>
 		<!-- <navigator url="" hover-class="navigator-hover"> -->
 			<button class="addPro" v-if="info.is_verify!=1" type="default" @click="show=true">客户楼盘信息认证</button>
 		<!-- </navigator> -->
-	</view>
+	</app-layout>
 </template>
 
 <script>
@@ -61,26 +63,32 @@
 		},
 		data() {
 			return {
+				id:'',
 				show:false,
 				
-				info:''
+				info:'',
+				userEstate:'',
 			};
 		},
-		onLoad(option) {
+		onShow() {
 			this.$showLoading()
 			this.$request({
 				url:this.$api.sale.customer_detail,
 				data:{
-					sale_customer_id:option.id
+					sale_customer_id:this.id
 				},
 				method:'post'
 			}).then(res=>{
 				if(res.code===0){
 					this.info=res.data
+					this.userEstate=res.data.userEstate[res.data.userEstate.length-1]
 				}
 				this.$hideLoading()
 			})
 		},
+		onLoad(option) {
+			this.id=option.id
+		}
 	}
 </script>
 

+ 2 - 0
src/pages/sale/cusmter/list.vue

xqd xqd
@@ -1,4 +1,5 @@
 <template>
+	<app-layout :haveBackground="false">
 	<view class="page">
 		<view class="search main-left cross-center">
 			<image style="margin-right: 15rpx;" src="https://t17.9026.com/web/statics/image/sale/search_icon.png"
@@ -31,6 +32,7 @@
 			<button class="addPro" type="default">添加客户</button>
 		</navigator>
 	</view>
+	</app-layout>
 </template>
 
 <script>