zhangdan 4 年之前
父節點
當前提交
e91f76d461
共有 6 個文件被更改,包括 99 次插入72 次删除
  1. 2 2
      App.vue
  2. 25 29
      pages/index/index.vue
  3. 52 27
      pages/index/order.vue
  4. 1 1
      pages/login/login.vue
  5. 12 6
      pages/order/orderDetails.vue
  6. 7 7
      pages/userCenter/index.vue

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	// const uat_domain = 'https://cust.test.sxzxyj.net' // 预发布
-	const uat_domain = 'http://192.168.16.213:8308' // 本地
+	const uat_domain = 'https://cust.test.sxzxyj.net' // 预发布
+	// const uat_domain = 'http://192.168.16.213:8308' // 本地
 	const pro_domain = 'https://cust.sxzxyj.net' // 生产
 	const uat_URL = uat_domain+'/gc-cust/' // 预发布
 	const pro_URL = pro_domain+'/gc-cust/'  // 生产

+ 25 - 29
pages/index/index.vue

@@ -44,12 +44,6 @@
 							</view>
 						</swiper-item>
 					</swiper>
-					<!-- <view class="flex rubbish">
-						<view v-for="item in rubbishPaperList" class="rubbishType-item">
-							<u-image :src="item.image" width="92" height="92"></u-image>
-							<span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
-						</view>
-					</view> -->
 				</view>
 				<!-- 塑料类 -->
 				<view class="statistics-box" v-if="rubbishSLList.length">
@@ -189,13 +183,12 @@
 						const c= res.data.find(item=>item.code=='CLOTHES')
 						const d= res.data.find(item=>item.code=='METAL')
 						/* 纸张类 */
-						
 						if (a.rubbishTypeVOList.length > 4) {
+							this.indicatorDots=true
 							let num=Math.ceil(a.rubbishTypeVOList.length/4)
-							console.log(num,'===========list项')
 							let arr = []
 							for (var i = 0; i < num; i++) {
-								arr[i]=a.rubbishTypeVOList.splice(i*4,(a.rubbishTypeVOList.length-4*(i+1))>4?4:a.rubbishTypeVOList.length-4*(i+1))
+								arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
 								console.log(arr,'===========arr')
 							}
 							this.rubbishPaperList= arr
@@ -204,26 +197,29 @@
 						}
 						console.log(this.rubbishPaperList, '--------aaaaaa')
 						// this.rubbishPaperList=a.rubbishTypeVOList
-						// this.rubbishPaperList.map(item=>{
-						// 	if(item.code=='YELLOW_PAPER'){
-						// 		item.image='/static/index/icon_aper_yellow.png'
-						// 	}
-						// 	if(item.code=='COLOUR_PAPER'){
-						// 		item.image='/static/index/icon_aper_flower.png'
-						// 	}
-						// 	if(item.code=='BOOK_PAPER'){
-						// 		item.image='/static/index/icon_book.png'
-						// 	}
-						// 	if(item.code=='MAGAZINE'){
-						// 		item.image='/static/index/icon_magazine.png'
-						// 	}
-						// 	if(item.code=='OTHER_PAPER'){
-						// 		item.image='/static/index/icon_aper_miscellaneous.png'
-						// 	}
-						// 	if(item.code=='NEWS_PAPER'){
-						// 		item.image='/static/index/icon_newspaper.png'
-						// 	}
-						// })
+						this.rubbishPaperList.map(item=>{
+							item.map(item=>{
+								if(item.code=='YELLOW_PAPER'){
+									item.image='/static/index/icon_aper_yellow.png'
+								}
+								if(item.code=='COLOUR_PAPER'){
+									item.image='/static/index/icon_aper_flower.png'
+								}
+								if(item.code=='BOOK_PAPER'){
+									item.image='/static/index/icon_book.png'
+								}
+								if(item.code=='MAGAZINE'){
+									item.image='/static/index/icon_magazine.png'
+								}
+								if(item.code=='OTHER_PAPER'){
+									item.image='/static/index/icon_aper_miscellaneous.png'
+								}
+								if(item.code=='NEWS_PAPER'){
+									item.image='/static/index/icon_newspaper.png'
+								}
+							})
+							
+						})
 						// 塑料类
 						this.rubbishSLList=b.rubbishTypeVOList
 						this.rubbishSLList.map(item=>{

+ 52 - 27
pages/index/order.vue

@@ -14,8 +14,8 @@
 			<view class="content-body">
 				<view class="store-image flex flex_column justify_center align_center">
 					<u-image :src="pageInfo.reverseReceiveAddress && pageInfo.reverseReceiveAddress.headerImageList? pageInfo.reverseReceiveAddress.headerImageList[0]:'/static/index/def_home_shop.png'" width="172" height="172" ></u-image>
-					<text v-if="isHasRider.haveBindRider && pageInfo.name">{{pageInfo.name}}</text>
-					<text v-else>{{mobile}}</text>
+					<text v-if="pageInfo.name">{{pageInfo.name}}</text>
+					<text v-else>{{mobile?mobile:pageInfo.mobile}}</text>
 				</view>
 				
 				<!-- 表单 -->
@@ -64,12 +64,16 @@
 							<view class="rubbishType-type">
 								{{rubbishPaperName ? rubbishPaperName :''}}
 							</view>
-							<view class="flex rubbish">
-								<view v-for="item in rubbishPaperList" class="rubbishType-item">
-									<u-image :src="item.image" width="92" height="92"></u-image>
-									<span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
-								</view>
-							</view>
+							<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
+								<swiper-item v-for="(item,index) in rubbishPaperList" :key="index">
+									<view class="flex rubbish">
+										<view v-for="key in item" class="rubbishType-item">
+											<u-image :src="key.image" width="92" height="92"></u-image>
+											<span>{{key.name ? key.name :''}}</span><span>{{key.customerPrice ? (key.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
+										</view>
+									</view>
+								</swiper-item>
+							</swiper>
 						</view>
 						<!-- 塑料类 -->
 						<view class="statistics-box" v-if="rubbishSLList.length">
@@ -182,6 +186,10 @@
 				orderCreateTime:'',
 				orderId:'',
 				imageHeader:'', // 门头照
+				indicatorDots: true,
+				autoplay: false,
+				interval: 2000,
+				duration: 500
 			}
 		},
 		onLoad() {
@@ -306,7 +314,7 @@
 					}
 				})
 			},
-			// 扫码下单
+			// 扫码下单 自主下单
 			getSaomaInfo(){
 				saomaOrder().then(res=>{
 					if(res.status==200){
@@ -375,25 +383,42 @@
 						const d= res.data.find(item=>item.code=='METAL')
 						/* 纸张类 */
 						this.rubbishPaperList=a.rubbishTypeVOList
-						this.rubbishPaperList.map(item=>{
-							if(item.code=='YELLOW_PAPER'){
-								item.image='/static/index/icon_aper_yellow.png'
-							}
-							if(item.code=='COLOUR_PAPER'){
-								item.image='/static/index/icon_aper_flower.png'
-							}
-							if(item.code=='BOOK_PAPER'){
-								item.image='/static/index/icon_book.png'
-							}
-							if(item.code=='MAGAZINE'){
-								item.image='/static/index/icon_magazine.png'
-							}
-							if(item.code=='OTHER_PAPER'){
-								item.image='/static/index/icon_aper_miscellaneous.png'
-							}
-							if(item.code=='NEWS_PAPER'){
-								item.image='/static/index/icon_newspaper.png'
+						if (a.rubbishTypeVOList.length > 4) {
+							this.indicatorDots=true
+							let num=Math.ceil(a.rubbishTypeVOList.length/4)
+							let arr = []
+							for (var i = 0; i < num; i++) {
+								arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
+								console.log(arr,'===========arr')
 							}
+							this.rubbishPaperList= arr
+						} else {
+							this.rubbishPaperList = a.rubbishTypeVOList.length?[a.rubbishTypeVOList]:[]
+						}
+						console.log(this.rubbishPaperList, '--------aaaaaa')
+						// this.rubbishPaperList=a.rubbishTypeVOList
+						this.rubbishPaperList.map(item=>{
+							item.map(item=>{
+								if(item.code=='YELLOW_PAPER'){
+									item.image='/static/index/icon_aper_yellow.png'
+								}
+								if(item.code=='COLOUR_PAPER'){
+									item.image='/static/index/icon_aper_flower.png'
+								}
+								if(item.code=='BOOK_PAPER'){
+									item.image='/static/index/icon_book.png'
+								}
+								if(item.code=='MAGAZINE'){
+									item.image='/static/index/icon_magazine.png'
+								}
+								if(item.code=='OTHER_PAPER'){
+									item.image='/static/index/icon_aper_miscellaneous.png'
+								}
+								if(item.code=='NEWS_PAPER'){
+									item.image='/static/index/icon_newspaper.png'
+								}
+							})
+							
 						})
 						// 塑料类
 						this.rubbishSLList=b.rubbishTypeVOList

+ 1 - 1
pages/login/login.vue

@@ -104,7 +104,7 @@
 							if (res.status == '200') {
 								getApp().globalData.token = res.data
 								_this.$u.vuex('vuex_token',res.data)
-								console.log(getApp().globalData.token,'---------getApp().globalData.token','------登录token')
+								console.log(getApp().globalData.token,'---------getApp().globalData.token','------登录token',res.data)
 								uni.$emit("getUserInfo")
 								if (_this.path === '/pages/index/index' || _this.lanuch) {
 									uni.reLaunch({

+ 12 - 6
pages/order/orderDetails.vue

@@ -13,19 +13,19 @@
 			<view class="item-info">
 				<view class="flex justify_between item">
 					<text>店铺名称</text>
-					<text>{{pageInfo.customerName||'--'}}</text>
+					<text>{{pageInfo.customerName|| '--'}}</text>
 				</view>
 				<view class="flex justify_between item">
 					<text>订单编号</text>
 					<text>{{pageInfo.orderReserveNo|| '--'}}</text>
 				</view>
-				<view class="flex justify_between item">
+				<view class="flex justify_between item" @click="callPhone(pageInfo.mobile,0)">
 					<text>服务骑手</text>
-					<text>{{pageInfo.name||'--'}}</text>
+					<text>{{pageInfo.name?pageInfo.name+' - ':''}}{{ pageInfo.mobile}}</text>
 				</view>
 			</view>
 			<view class="item-info">
-				<view class="flex justify_between item">
+				<view class="flex justify_between item" @click="callPhone(pageInfo.contactMobile,1)">
 					<text>下单用户</text>
 					<text>{{pageInfo.contactMobile||'--'}}</text>
 				</view>
@@ -56,7 +56,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="content-footer" @itemChange="chooseReason">
+		<view class="content-footer" @itemChange="chooseReason" v-if="pageInfo.orderStatus=='CONFIRM'">
 			<v-select :showSelete="false" :showBtn="true" code="CANCEL_REASON" @itemChange="chooseReason"></v-select>
 		</view>
 		<!-- 取消订单弹窗 -->
@@ -141,6 +141,13 @@
 					}
 				})
 			},
+			// 拨打电话
+			callPhone(customerPhoneNum,type){
+				console.log(type,'==============')
+				uni.makePhoneCall({
+				    phoneNumber: customerPhoneNum
+				});
+			},
 			// 取消订单
 			chooseReason(e){
 				console.log(e,'-------取消订单')
@@ -150,7 +157,6 @@
 							title: res.message,
 							icon: 'none'
 						})
-						this.getOrderNum()
 						setTimeout(()=>{
 							uni.switchTab({
 								url:'/pages/index/index'

+ 7 - 7
pages/userCenter/index.vue

@@ -7,9 +7,9 @@
 			</view>
 			<view class="user-info">
 				<view>
-					<view v-if="hasLogin" class="user-info-item">{{name ? name :''}}</view>
-					<open-data type="userNickName" class="user-info-item" v-if="!name && hasLogin"></open-data>
-					<view v-if="hasLogin" class="user-info-item">{{mobile? mobile:''}}</view>
+					<view v-if="hasLogin" class="user-info-item">{{userData.name ? userData.name :''}}</view>
+					<open-data type="userNickName" class="user-info-item" v-if="!userData.name && hasLogin"></open-data>
+					<view v-if="hasLogin" class="user-info-item">{{userData.mobile? userData.mobile:''}}</view>
 					<u-button v-else="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
 				</view>
 				<view>
@@ -56,7 +56,7 @@
 				// name:'',
 				// mobile:
 				userData: {},
-				price:'500元',  // 交易金额
+				price:'',  // 交易金额
 				version: '1.0.0' // 小程序版本
 			};
 		},
@@ -74,9 +74,9 @@
 			})
 		},
 		computed: {
-			user() {
-				return this.userData 
-			},
+			// user() {
+			// 	return this.userData 
+			// },
 			name(){
 				return this.$store.state.vuex_userInfoData.contactName
 			},