Pārlūkot izejas kodu

Merge branch 'develop' of http://git.chelingzhu.com/chelingzhu-web/zxyj-mini-html into develop

lilei 4 gadi atpakaļ
vecāks
revīzija
2d5bbe9678

+ 7 - 1
api/order.js

@@ -7,7 +7,13 @@ export const getStoreItems = params => {
     method: 'get',
   })
 };
-
+// 查看用户是否设置过支付密码
+export const existPayPwd = params => {
+  return axios.request({
+    url: `customer/existPayPwd`,
+    method: 'get',
+  })
+};
 // 下单 保存订单
 export const saveOrder = params => {
   return axios.request({

+ 9 - 0
pages.json

@@ -182,6 +182,15 @@
 		        "enablePullDownRefresh": false
 		    }
 		    
+		},
+		{
+		    "path" : "pages/checkOut/checkFinish",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "核销完成",
+		        "enablePullDownRefresh": false
+		    }
+		    
 		}
     ],
 	"globalStyle": {

+ 75 - 0
pages/checkOut/checkFinish.vue

@@ -0,0 +1,75 @@
+<template>
+	<view class="page-cont">
+		<view class="icon-cont">
+			<u-icon class="icon" name="checkmark" color="#62c500" size="80"></u-icon>
+			<view>支付成功</view>
+			<view>150 乐豆</view>
+		</view>
+		<view class="back-btn">
+			<u-button @click="toHome">返回首页</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			orderId: '' //订单id
+		}
+	},
+	onLoad(option) {
+		console.log(option,'option')
+		this.orderId = option.id
+	},
+	methods: {
+		// 查看订单详情
+		toOrderDetail() {
+			uni.navigateTo({
+			    url: '/pages/order/orderDetail?id=' + this.orderId
+			})
+		},
+		// 返回首页
+		toHome() {
+			uni.reLaunch({
+			    url: '/pages/index/index'
+			})
+		}
+	}
+}
+</script>
+
+<style lang="less">
+	page{
+		height: 100%;
+	}
+	.page-cont{
+		width: 100%;
+		height: 100%;
+		background-color: #fff;
+		padding: 0 40upx;
+		.icon-cont{
+			width: 100%;
+			height: 400upx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+			>view{
+				font-size: 30upx;
+				margin-top: 40upx;
+			}
+		}
+		.icon{
+			width: 120upx;
+			height: 120upx;
+			background-color: #d1d1d1;
+			display: flex;
+			justify-content: center;
+			border-radius: 50%;
+		}
+		.back-btn{
+			margin-top: 40upx;
+		}
+	}
+</style>

+ 69 - 53
pages/index/index.vue

@@ -24,30 +24,36 @@
 		</view>
 		<!-- 网点 -->
 		<view class="storeList">
-			 <u-section title="附近的网点" :right="false" line-color="#01c9b2"></u-section>
+			 <u-section title="附近的回收机" :right="false" line-color="#01c9b2" class="store-section"></u-section>
 			 <view class="stores-box">
-				<view class="stores-item" v-for="item in stationDataList" @click="viewStore(item)">
-					<view class="s-name">
-						<view>{{ item.name }}</view>
-					</view>
-					<view class="s-address">
-						<view>
-							<text>{{ item.provinceName }}{{ item.cityName }}{{ item.districtName }}{{ item.address }}</text>
-						</view>
-						<view>
-							<u-icon name="map-fill" color="#01c9b2" size="30"></u-icon>
-							{{ item.distanct.distance ? (item.distanct.distance/1000).toFixed(1) : 0 }}KM
-						</view>
-					</view>
-					<view class="s-time">
-						<view>
-							营业时间:
-							<text v-for="(tItem, tInd) in item.deliveryTimeRuleItemList" :key="tInd">
-								{{ tItem.openTime }} - {{ tItem.closeTime }}{{ tInd == item.deliveryTimeRuleItemList.length - 1 ? '' : ',' }}
-							</text>
-						</view>
-					</view>
-				</view>
+			 	<view class="stores-item" v-for="item in stationDataList" @click="viewStore(item)">
+			 		<view class="item-con">
+			 			<image src="/static/md-icon.png" class="item-icon"></image>
+			 			<view class="s-name item-main">{{ item.name }}</view>
+			 		</view>
+			 		<view class="item-con">
+			 			<image src="/static/dz-icon.png" class="item-icon"></image>
+			 			<view class="s-address item-main">
+			 				<view>{{ item.provinceName }}{{ item.cityName }}{{ item.districtName }}{{ item.address }}</view>
+			 				<view>
+			 					<u-icon name="map-fill" color="#01c9b2" size="30"></u-icon>
+			 					{{ item.distanct.distance ? (item.distanct.distance / 1000).toFixed(1) : 0 }}KM
+			 					<u-icon name="arrow-right" color="#999" size="20"></u-icon>
+			 				</view>
+			 			</view>
+			 		</view>
+			 		<view class="item-con">
+			 			<image src="/static/time-icon.png" class="item-icon"></image>
+			 			<view class="s-time item-main">
+			 				<view>
+			 					营业时间:
+			 					<text v-for="(tItem, tInd) in item.deliveryTimeRuleItemList" :key="tInd">
+			 						{{ tItem.openTime }} - {{ tItem.closeTime }}{{ tInd == item.deliveryTimeRuleItemList.length - 1 ? '' : ',' }}
+			 					</text>
+			 				</view>
+			 			</view>
+			 		</view>
+			 	</view>
 			 </view>
 		</view>
 	</view>
@@ -237,51 +243,61 @@
 
 <style lang="scss" scoped>
 	.content {
-		background: url(../../static/topBg.png) no-repeat top center;
-		background-size: 100%;
+		// background: url(../../static/topBg.png) no-repeat top center;
+		// background-size: 100%;
 		width: 100%;
-		.nav{
+		.nav {
 			margin: 20upx 0;
 			border-radius: 15upx;
 			box-shadow: 0upx 3upx 6upx #eee;
 			overflow: hidden;
-			.grid-text{
+			.grid-text {
 				padding-top: 10upx;
 			}
 		}
-		.storeList{
+		.storeList {
 			padding: 25upx 20upx 20upx;
-			background: #FFFFFF;
-			border-radius: 15upx;
-			box-shadow: 0upx 3upx 6upx #eee;
-			.stores-box{
+			.store-section {
+				margin-bottom: 20rpx;
+			}
+			.stores-box {
 				padding-top: 5upx;
-				.stores-item{
-					border-bottom: 1px solid #F8F8F8;
-					padding: 20upx 10upx;
-					&:last-child{
+				.stores-item {
+					background: #ffffff;
+					border-radius: 15upx;
+					box-shadow: 0upx 3upx 6upx #eee;
+					border-bottom: 1px solid #f8f8f8;
+					padding: 10upx 20upx;
+					margin-bottom: 20rpx;
+					&:last-child {
 						border: 0;
 					}
-					> view{
-						padding: 10upx 0;
+					.item-con {
 						display: flex;
-						align-items: center;
-					}
-					.s-address,.s-time{
-						justify-content: space-between;
-						color: #666;
-						font-size: 24rpx;
-					}
-					.s-address{
-						> view{
-							&:last-child{
-								font-size: 24rpx;
-								width: 30%;
-								display: flex;
-								align-items: center;
-								justify-content: flex-end;
+						&:last-child {
+							.item-main {
+								border: none;
 							}
 						}
+						.item-icon {
+							width: 34rpx;
+							height: 34rpx;
+							margin-right: 10rpx;
+							flex-shrink: 0;
+							padding: 18rpx 0;
+						}
+						.item-main {
+							font-size: 24rpx;
+							color: #666;
+							padding: 18rpx 0;
+							border-bottom: 1rpx solid #f2f2f2;
+							flex-grow: 1;
+						}
+						.s-address {
+							display: flex;
+							align-items: center;
+							justify-content: space-between;
+						}
 					}
 				}
 			}

+ 22 - 31
pages/order/order.vue

@@ -37,19 +37,22 @@
 								</view>
 							</view>
 							<view class="check-row">
-								<view v-if="item.orderState=='WAIT_PAY'"  class="text-right">
-									<text style="margin-right: 30upx;">支付剩余{{filterTime(item.orderTime)}}</text>
-									<u-button class="btn-cont" @click="toPay(item)"  shape="circle" type="error" size="medium">去支付</u-button>
+								<view v-if="item.orderState=='WAIT_PAY'"  class="text-right left-time">
+										<text style="margin-right: 20upx;">
+											支付剩余
+										</text>
+										<u-count-down @end="getRow" style="margin-right: 20upx;" separator ="zh" :timestamp="filterTime(item.orderTime)" :show-days="false" :show-hours="false"></u-count-down>
+									<u-button :custom-style="btnStyle" @click="toPay(item)"  shape="circle" type="error" size="medium">去支付</u-button>
 								</view>
 								<view v-if="item.orderState=='WAIT_SEND'" class="text-right">
-									<u-button class="btn-cont" @click="showTip" shape="circle" size="medium">提醒发货</u-button>
+									<u-button :custom-style="btnStyle" @click="showTip" shape="circle" size="medium">提醒发货</u-button>
 								</view>
 								<view v-if="item.orderState=='SEND_ALL'" class="text-right">
-									<u-button @click="showLog(item)" class="btn-cont" style="margin-right: 20upx;" shape="circle" size="medium">查看物流</u-button>
-									<u-button class="btn-cont" shape="circle" type="primary" size="medium">确认收货</u-button>
+									<u-button @click="showLog(item)" :custom-style="btnStyle" style="margin-right: 20upx;" shape="circle" size="medium">查看物流</u-button>
+									<u-button :custom-style="btnStyle" shape="circle" type="primary" size="medium">确认收货</u-button>
 								</view>
 								<view v-if="item.orderState=='FINISH'" class="text-right">
-									<u-button @click="showLog(item)" class="btn-cont" shape="circle" size="medium">查看物流</u-button>
+									<u-button @click="showLog(item)" :custom-style="btnStyle" shape="circle" size="medium">查看物流</u-button>
 								</view>
 							</view>
 						</view>
@@ -108,6 +111,10 @@
 		components: {},
 		data() {
 			return {
+				btnStyle:{
+					width: '180rpx',
+					fontSize: '30rpx',
+				},
 				status: 'loadmore',
 				noDataText: '暂无数据',
 				tabList: [{
@@ -148,6 +155,7 @@
 				},
 				total: 0,
 				totalPrice: 0, // 支付合计
+				password: '', // 支付密码
 				action: 'swiperChange', // 操作类型,上划分页,或左右滑动
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
@@ -155,15 +163,16 @@
 			}
 		},
 		onShow() {
-			this.pageInit()
 		},
 		onLoad() {
 			// 监听设置密码是否成功
 			uni.$once('setPswSuccess', this.setPsw)
+			// 监听详情支付成功事件
+			uni.$on('refresh', this.handleRefresh)
+			this.pageInit()
 		},
 		onUnload() {
-			uni.$off('refreshBL', this.refresh)
-			uni.$off('refreshBl-handle', this.handleRefresh)
+			uni.$off('refresh', this.handleRefresh)
 		},
 		methods: {
 			pageInit() {
@@ -265,29 +274,12 @@
 			},
 			// 支付剩余时间
 			filterTime (time) {
+				console.log(time,'tttttt')
 				let nowT = new Date().valueOf() // 现在时间戳
 				let orderT = new Date(time).valueOf() // 下单时间戳
 				let tt = (1800 * 1000) - (nowT - orderT)   // 距离30分钟支付 相差时间戳  
-				
-				setInterval(()=>{
-					if(tt>0) {
-						tt = tt -1000
-					} else {
-						clearInterval()
-						// this.getRow()
-					}
-				},1000)
-				//计算相差分钟数
-				var leave1 = tt % (3600 * 1000); //计算小时数后剩余的毫秒数
-				var minutes = Math.floor(tt / (60 * 1000));
-				//计算相差秒数
-				var leave3 = leave1 % (60 * 1000); //计算分钟数后剩余的毫秒数
-				var seconds = Math.round(leave3 / 1000);
-				
-				console.log(minutes + "天 " + seconds + "小时 ")
-				
-				// console.log(new Date(time).valueOf(),dt.valueOf(),'ttttttt')
-				return  minutes + "分 " + seconds + "秒"
+				console.log(tt,'tttttt')
+				return  tt
 			},
 			
 			// 跳转到设置支付密码页
@@ -480,7 +472,6 @@
 						justify-content: space-between;
 					}
 				}
-
 				.btn-cont {
 					width: 180upx;
 					font-size: 30upx;

+ 23 - 8
pages/order/orderDetail.vue

@@ -62,7 +62,7 @@
 			</u-cell-group>
 		</view>
 		<view v-if="orderInfo.orderState=='WAIT_PAY'" class="footer">
-			<u-button @click="cancleOrder" type="error">去支付</u-button>
+			<u-button @click="toPay" type="error">去支付</u-button>
 		</view>
 		<!-- 提示用户设置支付密码 -->
 		<u-modal v-model="showSetPswModal" 
@@ -101,7 +101,8 @@
 <script>
 	import {
 		orderDetail,
-		cancleOrder
+		cancleOrder,
+		existPayPwd
 	} from '@/api/order.js'
 	import {
 		getLookUpDatas
@@ -111,6 +112,7 @@
 			return {
 				orderInfo: {},
 				totalPrice: 0, // 支付合计
+				password: '', // 支付密码
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
 				showLeavePsw: false, // 打开确定放弃弹窗
@@ -175,16 +177,29 @@
 				this.showInputPsw = true
 			},
 			// 支付
-			toPay(item) {
-				// this.totalPrice = item.payGold
-				// this.showSetPswModal = true
-				// return
-				signPay({id:item.id}).then(res=>{
+			toPay() {
+				existPayPwd().then(res=>{
+					console.log(res,'rrrrrr')
+					if(res.status == 200) {
+						if(res.data) {
+							// this.totalPrice = item.payGold
+							// this.showSetPswModal = true
+						}
+					} else {
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+					}
+				})
+				
+				signPay({id:this.orderInfo.id}).then(res=>{
 					this.btnLoading = false
 					if(res.status == 200) {
+						uni.$emit('refresh')
 						// 跳转到支付完成界面
 						uni.navigateTo({
-							url:"/pages/toOrder/payFinish?id=" + this.orderId
+							url:"/pages/toOrder/payFinish?id=" + this.orderInfo.id
 						})
 					} else{
 						uni.showToast({

+ 39 - 8
pages/store/store.vue

@@ -8,7 +8,7 @@
 		show-compass 
 		show-location 
 		:markers="markers"
-		style="width: 100%; height:30%;">
+		style="width: 100%; height:400rpx;">
 		</map>
 		<!-- 网点信息及设备 -->
 		<view class="details" v-if="stationData">
@@ -28,15 +28,23 @@
 					<view class="details-dev-title">设备编号:<text>{{ item.srcDeviceCode }}</text></view>
 					<view class="details-dev-cons">
 						<view class="dev-item" v-for="boxItem in item.deviceTypeBoxList">
-							<view>
+							<view class="item-pic-con">
+								<!-- <image class="full-" src="/static/full-bg.png"></image> -->
+								<text class="full-sign">
+									已满
+								</text>
 								<u-image height="80" width="80" :src="`/static/${boxItem.rubbishType}.png`"></u-image>
 							</view>
-							<view>
+							<view class="dev-main">
 								<view>
 									{{ boxItem.rubbishTypeDictValue }}
 									<u-tag v-if="boxItem.flag==1" text="已满" size="mini" mode="dark" type="info" />
 								</view>
-								<text>{{ getRule(boxItem.rubbishType).rubbishWeight }}g/{{ getRule(boxItem.rubbishType).goleNum }}乐豆</text>
+								<view class="rule-con">
+									{{ getRule(boxItem.rubbishType).rubbishWeight }}g/
+									<text class="goleNum">{{ getRule(boxItem.rubbishType).goleNum }}</text>
+									<image src="/static/ledou.png" class="ld-pic"></image>
+								</view>
 							</view>
 						</view>
 					</view>
@@ -176,10 +184,6 @@
 						> view{
 							padding: 15upx 10upx;
 							&:last-child{
-								text{
-									color: #666;
-									font-size: 24upx;
-								}
 								view{
 									display: flex;
 									align-items: center;
@@ -189,6 +193,33 @@
 								}
 							}
 						}
+						.item-pic-con{
+							.full-sign{
+								font-size: 24rpx;
+								padding: 4rpx 10rpx 14rpx;
+								color: #fff;
+								background: url('/static/full-bg.png') no-repeat;
+								background-size: 100% 100%;
+								transform: scale(1.5);
+							}
+						}
+						.dev-main{
+							.rule-con{
+								color: #666;
+								font-size: 24upx;
+								.goleNum{
+									color: #eb0000;
+									font-size: 26rpx;
+									font-weight: bold;
+									margin-left: 4rpx;
+								}
+								.ld-pic{
+									width: 30rpx;
+									height: 30rpx;
+									margin-left: 6rpx;
+								}
+							}
+						}
 					}
 				}
 			}

+ 1 - 1
pages/toOrder/editAddress.vue

@@ -12,7 +12,7 @@
 				<u-picker v-model="show" @confirm="chooseArea" mode="region"></u-picker>
 			</u-form-item>
 			<u-form-item label="详细地址" required prop="receiveAddress">
-				<u-input placeholder="请输入收货详细地址" :maxlength="100" v-model="form.receiveAddress" />
+				<u-input placeholder="请输入收货详细地址(最多500个字符)" :maxlength="500" v-model="form.receiveAddress" />
 			</u-form-item>
 		</u-form>
 		<view class="buttons">

+ 15 - 3
pages/toOrder/index.vue

@@ -92,7 +92,7 @@
 </template>
 
 <script>
-	import { saveOrder, signPay} from '@/api/order.js'
+	import { saveOrder, signPay, existPayPwd} from '@/api/order.js'
 	import {
 		findAddressBycustomerNo
 	} from '@/api/receiveAddress.js'
@@ -114,6 +114,7 @@
 				},
 				btnLoading: false,  // 提交按钮加载圈
 				orderId: '', // 订单id
+				password: '', // 支付密码
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
 				showLeavePsw: false, // 打开确定放弃弹窗
@@ -183,6 +184,13 @@
 			},
 			// 支付  保存订单
 			toSave(){
+				existPayPwd().then(res=>{
+					console.log(res,'rrrrrr')
+					if(res.status == 200) {
+						
+					}
+				})
+				return
 				// this.showSetPswModal = true
 				// return
 				let orderGoodsList = []
@@ -193,8 +201,12 @@
 					}
 				})
 				this.btnLoading = true
-				let params = Object.assign(this.userInfo,{orderGoodsList:orderGoodsList})
-				console.log(orderGoodsList,params,'orderGoodsList')
+				let params = {
+					receiveAddress: this.userInfo.receiveAddress,
+					receiverName: this.userInfo.receiverName,
+					receiverPhone: this.userInfo.receiverPhone,
+					orderGoodsList: orderGoodsList
+				}
 				saveOrder(params).then(res=>{
 					console.log(res,'rrrrrrr')
 					if(res.status==200) {

+ 2 - 0
pages/userCenter/index.vue

@@ -28,6 +28,8 @@
 			<u-cell-group>
 				<u-cell-item icon="order" icon-size="38" :icon-style="{color:'#ff5500'}" index="1" @click="toPage" title="我的订单"></u-cell-item>
 				<u-cell-item icon="gift" icon-size="40" :icon-style="{color:'#00aaff'}" index="0" @click="toPage" title="投递记录"></u-cell-item>
+				<u-cell-item icon="question-circle" icon-size="40" :icon-style="{color:'#19be6b'}" index="0" @click="toPage" title="常见问题"></u-cell-item>
+				<u-cell-item icon="phone" icon-size="40" :icon-style="{color:'#f00'}" index="0" @click="toPage" title="联系客服"></u-cell-item>
 				<u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="2" @click="toPage" title="服务协议"></u-cell-item>
 				<!-- <u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#55aa00'}" index="3" @click="toPage" title="关于我们"></u-cell-item> -->
 			</u-cell-group>

BIN
static/CLOTHES.png


BIN
static/HARM.png


BIN
static/METAL.png


BIN
static/PAPER.png


BIN
static/dz-icon.png


BIN
static/full-bg.png


BIN
static/hexiao.png


BIN
static/liucheng.png


BIN
static/md-icon.png


BIN
static/shouyi.png


BIN
static/tabbar/home-active.png


BIN
static/tabbar/home.png


BIN
static/tabbar/shop-active.png


BIN
static/tabbar/shop.png


BIN
static/tabbar/user-active.png


BIN
static/tabbar/user.png


BIN
static/time-icon.png


BIN
static/zhinan.png