zhangdan 4 年之前
父節點
當前提交
09023c8a0d
共有 8 個文件被更改,包括 41 次插入23 次删除
  1. 9 9
      pages.json
  2. 6 5
      pages/index/index.vue
  3. 22 9
      pages/index/order.vue
  4. 4 0
      pages/login/login.vue
  5. 二進制
      static/home.png
  6. 二進制
      static/home_pressed.png
  7. 二進制
      static/personal.png
  8. 二進制
      static/personal_pressed.png

+ 9 - 9
pages.json

@@ -87,23 +87,23 @@
 		}
 	},
 	"tabBar": {
-		"color": "#999999.",
-		"selectedColor": "#4F88F7",
+		"color": "#bbbbbb",
+		"selectedColor": "#000000",
 		"backgroundColor": "#ffffff",
 		"fontSize": "14px",
 		"list": [
 		{
 			"pagePath": "pages/index/index",
-			"iconPath": "static/pressed.png",
+			"iconPath": "static/home.png",
 			"selectedIconPath": "static/home_pressed.png",
 			"text": "首页"
 		},
-		 {
-		 	"pagePath": "pages/order/index",
-		 	"iconPath": "static/marketing.png",
-		 	"selectedIconPath": "static/marketing_pressed.png",
-		 	"text": "订单"
-		 },
+		 // {
+		 // 	"pagePath": "pages/order/index",
+		 // 	"iconPath": "static/marketing.png",
+		 // 	"selectedIconPath": "static/marketing_pressed.png",
+		 // 	"text": "订单"
+		 // },
 		{
 			"pagePath": "pages/userCenter/index",
 			"iconPath": "static/personal.png",

+ 6 - 5
pages/index/index.vue

@@ -128,6 +128,7 @@
 			}
 		},
 		onLoad() {
+			this.geRubbishTypeList()
 			this.pageInit()
 		},
 		onUnload() {
@@ -138,6 +139,7 @@
 		onShareTimeline(res) {
 		},
 		onShow() {
+			this.geRubbishTypeList()
 			checkLogin().then(res => {
 				this.hasLogin=res.status==200
 				if(this.hasLogin){
@@ -154,7 +156,6 @@
 				this.orderTime=''
 				this.finishTime=''
 				this.getBanner()
-				this.geRubbishTypeList()
 				this.getOrderStatus()
 				this.checkUpdate()
 			},
@@ -262,7 +263,7 @@
 			},
 			// 扫码下单
 			gotoSaoMa(){
-				// if(this.hasLogin){
+				if(this.hasLogin){
 					wx.scanCode({
 					  success: (res)=> {
 						  uni.navigateTo({
@@ -271,9 +272,9 @@
 					    console.log(res,'----------------res===================')
 					  }
 					})
-				// }else{
-				// 	this.loginModal()
-				// }
+				}else{
+					this.loginModal()
+				}
 			},
 			// 自主下单
 			gotoYueYu(){

+ 22 - 9
pages/index/order.vue

@@ -15,6 +15,7 @@
 				<view class="store-image flex flex_column justify_center align_center">
 					<u-image :src="pageInfo.receiveAddressVO.headerImageList? pageInfo.receiveAddressVO.headerImageList[0]:'/static/index/def_home_shop.png'" width="172" height="172" ></u-image>
 					<text v-if="pageInfo.userId">骑手张三的店铺</text>
+					<text v-else>{{mobile}}</text>
 				</view>
 				<!-- 表单 -->
 				<view class="list-container">
@@ -31,6 +32,7 @@
 						<view class="list-item-left">
 							<text>通信地址</text>
 						</view>
+						<!-- {{form.receiveAddress.receiveAreasName}} -->
 					    <view class="list-item-right flex_1">
 							<u-input class="flex_1" :custom-style="inputClass" v-model="form.receiveAddress.receiveAreasName" @click="selectAddress" :disabled="true" placeholder="请选择通信地址" placeholder-style="color:'#bbb';font-size:18px"/>
 							<u-icon class="back-img" name="arrow-right" color="#9DA8B5"  @click="selectAddress"></u-icon>
@@ -173,12 +175,21 @@
 				if(this.hasLogin){
 					this.pageInit()
 				}else{
-					uni.navigateTo({
-						url:'/pages/login/login'
-					})
+					this.loginModal()
 				}
 			})
 		},
+		computed: {
+			// user() {
+			// 	return this.userData 
+			// },
+			// name(){
+			// 	return this.$store.state.vuex_userInfoData.contactName
+			// },
+			mobile(){
+				return this.$store.state.vuex_userInfoData.contactMobile
+			}
+		},
 		methods:{
 			pageInit() {
 				this.geRubbishTypeList()
@@ -187,16 +198,18 @@
 			},
 			// 返回
 			onClickBack(){
-				uni.navigateBack({
-					
+				uni.switchTab({
+					url:'/pages/index/index'
 				})
 			},
 			// 选择通信地址
 			selectAddress(){
+				console.log(this.form.receiveAddress.receiveAreasName,'==========')
 				wx.chooseLocation({
 					success:(res)=>{
 						if(res){
-							this.getArea(res.address)
+							console.log(res,res.address,'----------------------')
+							// this.getArea(res.address)
 							// this.form.contactAddress=res.address
 							this.form.receiveAddress.lat=res.latitude
 							this.form.receiveAddress.lng=res.longitude
@@ -210,6 +223,7 @@
 			getSaomaInfo(){
 				saomaOrder().then(res=>{
 					if(res.status==200){
+						// this.form=Object.assign(this.form,res.data)
 						this.pageInfo=res.data
 						this.form.mobile=res.data.mobile
 						this.form.receiveAddress.provinceName=res.data.receiveAddressVO?res.data.receiveAddressVO.provinceName:''
@@ -348,8 +362,7 @@
 					})
 					return false
 				}
-				const params=Object.assign(this.form)
-				userInfoSave(params).then(res=>{
+				userInfoSave(this.form).then(res=>{
 					if(res.status==200){
 						// uni.$emit('pageType', {data: 'userInfo' })
 						setTimeout(()=>{
@@ -368,7 +381,7 @@
 				  success: (res)=> {
 				    if (res.confirm) {
 				     uni.navigateTo({
-				         url: '/pages/login/login'
+				         url: '/pages/login/login?pageType=order'
 				     })
 				    } else if (res.cancel) {
 				      console.log('用户点击取消');

+ 4 - 0
pages/login/login.vue

@@ -48,6 +48,10 @@
 			}
 		},
 		onLoad(option) {
+			console.log(option,'==============',option.pageType)
+			if(option && option.pageType=='order'){
+				this.path='/pages/index/order'
+			}
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,

二進制
static/home.png


二進制
static/home_pressed.png


二進制
static/personal.png


二進制
static/personal_pressed.png