zhangdan 4 years ago
parent
commit
890f82b22a

+ 8 - 2
pages.json

@@ -77,9 +77,15 @@
 			}
 		},
 		{
-			"path": "pages/order/finish",		
+			"path": "pages/store/storeList",		
 			"style": {
-				"navigationBarTitleText": "服务完成"
+				"navigationBarTitleText": "店铺管理"
+			}
+		},
+		{
+			"path": "pages/store/addStore",		
+			"style": {
+				"navigationBarTitleText": "新增店铺"
 			}
 		}
     ],

+ 14 - 0
pages/login/login.vue

@@ -15,6 +15,11 @@
 					</u-button>
 				</view>
 			</view>
+			<!-- 客服电话 -->
+			<view class="phone flex justify_center align_center">
+				<u-icon name="phone" color="#191919" font-size="32"></u-icon>
+				<text>客服电话:4008826012</text>
+			</view>
 			<view class="nologin">
 				<u-button shape="circle" size="mini" plain lass="login-btn" @click="cansel" type="info">
 					暂不登录
@@ -169,6 +174,7 @@
 		height: 100vh;
 		padding:0 120upx;
 		margin: 0 auto;
+		background-color: #fff;
 		.logo-cont{
 			display: flex;
 			flex-direction: column;
@@ -194,6 +200,14 @@
 			text-align: center;
 			margin: 100upx 0 50upx 0;
 		}
+		.phone{
+			font-weight: 400;
+			margin-top:40upx;
+			text{
+				display: inline-block;
+				margin-left:10upx ;
+			}
+		}
 		.authUserYs{
 			text-align: center;
 			position: absolute;

+ 7 - 7
pages/order/historyOrder.vue

@@ -5,13 +5,6 @@
 		</view>
 		<scroll-view scroll-y class="list" @scrolltolower="onreachBottom">
 			<view class="list-item" v-for="item in list" :key="item.id" @click="intoDetail(item)">
-				<view class="cont title flex align_center justify_between">
-					<text>{{item.createDate}}</text>
-					<view class="flex align_center">
-						<text>查看详情</text>
-						<u-icon class="arrow-right" name="arrow-right" color="#999999" size="32"></u-icon>
-					</view>
-				</view>
 				<view class="cont">
 					<view class="cont-top flex align_center justify_between">
 						<text>{{item.contactName||'--'}}</text>
@@ -25,6 +18,13 @@
 						<text>{{item.payTypeDictValue||'--'}}</text>
 					</view>
 				</view>
+				<view class="cont title flex align_center justify_between">
+					<text>{{item.createDate}}</text>
+					<view class="flex align_center">
+						<text>查看详情</text>
+						<u-icon class="arrow-right" name="arrow-right" color="#999999" size="32"></u-icon>
+					</view>
+				</view>
 			</view>
 			<view class="nodata" v-if="list.length==0 && status!='loading'">
 				<u-empty src="/static/def_result.png" :text="noDataText" icon-size="260" ></u-empty>

+ 262 - 0
pages/store/addStore.vue

@@ -0,0 +1,262 @@
+<template>
+	<view class="content-add">
+		<view class="add-body">
+			<view class="form-data">
+				<view class="flex flex_column data-item">
+					<text>名称</text>
+					<view class="list-item-right flex_1 flex justify_between">
+						<u-input class="flex_1" :custom-style="inputClass" v-model="form.contactName" placeholder="请输入店铺名称" placeholder-style="color:'#bbb';font-size:18px"/>
+					</view>
+				</view>
+				<view class="flex flex_column data-item last">
+					<view class="flex align_center">
+						<view style="color:#666E75">电话</view>
+						<u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 10rpx 10rpx;"></u-image>
+					</view>
+					
+					<view class="list-item-right flex_1 flex justify_between">
+						<u-input class="flex_1" :custom-style="inputClass" v-model="form.contactPhone" placeholder="请输入联系电话" placeholder-style="color:'#bbb';font-size:18px"/>
+					</view>
+				</view>
+			</view>
+			<view class="form-data">
+				<view class="flex flex_column data-item">
+					<text>地址</text>
+					<view class="list-item-right flex_1 flex justify_between">
+						<u-input class="flex_1" :custom-style="inputClass" v-model="form.contactAddress" @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>
+					</view>
+				</view>
+				<view class="flex flex_column data-item last">
+					<text>详细地址</text>
+					<view class="list-item-right flex_1 flex justify_between">
+						<u-input class="flex_1" :custom-style="inputClass" v-model="form.detailAddress" placeholder="请输入详细地址" placeholder-style="color:'#bbb';font-size:18px"/>
+					</view>
+				</view>
+			</view>
+			<view class="form-data">
+				<view class="headerImgTitle"> 门头照片 <text style="color: #bbbbbb;">(仅可上传1张,10MB以内)</text></view> 
+				<view class="info-main">
+					<view class="camera-btn" v-if="photograph.length<1">
+						<view @click="goPhotograph" class="photograph-camera">
+							<u-icon name="camera" color="#bfbfbf" size="60" ></u-icon>
+						</view>
+					</view>
+					<view v-show="photograph.length" v-for="(item,index) in photograph" :key="index" class="photograph-con">
+						<u-icon  name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph(index)"></u-icon>
+						<u-image width="100%" height="100%" :src="item" @click="previewPictures(item)"></u-image>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="footer" @click="submit">
+			<view class="submit-btn flex justify_center align_center">保存</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {saveImgToAliOss} from '@/libs/tools.js'
+	export default{
+		data(){
+			return{
+				photograph: [],
+				imageHeader:'', //  图片路径
+				form:{
+					contactName:'', // 名称
+					contactPhone:'', // 手机号码
+					contactAddress:"", // 通信地址
+					detailAddress:'' // 详细地址
+				},
+				itemId:'',// 店铺id
+				pageInfo:{}, // 页面数据
+			}
+		},
+		onLoad(option) {
+			if(option.id){
+				console.log(option,option.id)
+				uni.setNavigationBarTitle({
+				    title: '修改店铺'
+				});
+				this.itemId=option.id
+				this.getDetailInfo()
+			}
+		},
+		methods:{
+			// 获取详情信息
+			getDetailInfo(){
+				getDetailInfo({id:this.itemId}).then(res=>{
+					if(res.status==200){
+						this.pageInfo=res.data
+					}else{
+						uni.showToast({
+							title: res.message,
+							icon:'none',
+						})
+					}
+				})
+			},
+			// 选择通信地址
+			selectAddress(){
+				wx.chooseLocation({
+					success:(res)=>{
+						if(res){
+							this.getArea(res.address)
+							console.log(res,'------------------地址信息',this.getArea(res.address))
+							this.form.contactAddress=res.address
+							this.form.lat=res.latitude
+							this.form.lng=res.longitude
+							
+						}
+					}
+				})
+			},
+			// 拍照或从相册选图片
+			goPhotograph() {
+				uni.chooseImage({
+				    count: 1, //默认9
+				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+				    sourceType: ['album','camera'], //从相册选择
+				    success: (res) =>{
+						if(res.tempFiles[0].size>10485760){
+							uni.showToast({
+								title: '图片过大无法上传!',
+								icon: 'none'
+							})
+							return
+						}
+						uni.showLoading({
+							title:'正在保存图片...',
+							mask: true
+						})
+						saveImgToAliOss(res.tempFilePaths[0],(ret)=>{
+							this.photograph.push(ret.data)
+							uni.hideLoading()
+						})
+				    }
+				});
+			},
+			//  预览图片
+			previewPictures(item) {
+				const photograph = [item];
+				uni.previewImage({
+					urls: photograph,
+				});
+			},
+			//  删除图片
+			cancelPhotograph(index) {
+				setTimeout(() => {
+					this.photograph.splice(index)
+				}, 500);
+			},
+			// 保存
+			submit(){
+				const testVal=/^1[34578]\d{9}$/
+				if (!testVal.test(this.form.contactPhone)) {
+					uni.showToast({
+						title: '请输入正确的联系电话',
+						icon: 'none'
+					})
+					return false
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.content-add{
+		width: 100%;
+		height: 100vh;
+		background-color: #f5f5f5;
+		display: flex;
+		flex-direction: column;
+		.add-body{
+			width: 100%;
+			padding: 20upx 30upx;
+			flex: 1;
+			overflow-y: scroll;
+			.form-data{
+				width: 100%;
+				background-color: #fff;
+				border-radius: 24upx;
+				margin-bottom: 20upx;
+				.data-item{
+					margin: 0 32upx;
+					padding: 36upx 0;
+					border-bottom: 1px solid #e5e5e5;
+				}
+				.data-item>text:first-child{
+					color:#666E75;
+				}
+				.last{
+					border-bottom:none;
+				}
+				.headerImgTitle{
+					padding-top:36upx;
+					margin: 0 32upx;
+					color:#666E75;
+				}
+				.info-main {
+					margin:0  32upx;
+					padding: 10upx 0 36upx;
+					border-radius: 12upx;
+					background-color: #fff;
+					display: flex;
+					.location-icon {
+						padding-left: 10upx;
+						vertical-align: sub;
+					}
+					.photograph-camera {
+						border: 2upx dashed #bfbfbf;
+						border-radius: 12upx;
+						width: 140upx;
+						height: 140upx;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
+					.camera-btn{
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+						color: #999999;
+						font-size: 24upx;
+					}
+					.photograph-con {
+						margin: 0 20upx;
+						width: 140upx;
+						height: 140upx;
+						text-align: center;
+						position: relative;
+						.photograph-icon {
+							display: inline-block;
+							padding-top: 48upx;
+						}
+						.close-circle-icon {
+							background-color: #fff;
+							border-radius: 50%;
+							position: absolute;
+							right: -23upx;
+							top: -23upx;
+							z-index: 9;
+						}
+					}
+				}
+			}
+		}
+		.footer{
+			width: 100%;
+			padding: 14upx 32upx 32upx;
+			background-color: #fff;
+			color: #fff;
+			font-weight: 500;
+			.submit-btn{
+				height: 84upx;
+				background: #1995FF;
+				opacity: 1;
+				border-radius: 16upx;
+			}
+		}
+	}
+</style>

+ 181 - 0
pages/store/storeList.vue

@@ -0,0 +1,181 @@
+<template>
+	<view class="content-store">
+		<view class="input-search">
+			<u-search placeholder="请输入店铺名称/电话号码" class="search" :show-action="false" input-align="center" v-model="searchVal" @input="getRow()"></u-search>
+		</view>
+		<scroll-view scroll-y class="list" @scrolltolower="onreachBottom">
+			<view class="list-item flex align_center" v-for="item in list" :key="item.id" @click="addStore(item.id)">
+				<u-image src="/static/home_shop.png" width="160" height="160"></u-image>
+				<view class="item-right flex_1 flex justify_between align_center"> 
+					<view class="right-item">
+						<view sty>百果园</view>
+						<view>18292887584</view>
+						<view>西安市未央区华帝金座</view>
+					</view>
+					<u-icon name="arrow-right" color="#9DA8B5" font-size="30"></u-icon>
+				</view>
+			</view>
+			<view class="nodata" v-if="list.length==0 && status!='loading'">
+				<u-empty src="/static/def_result.png" :text="noDataText" icon-size="260" ></u-empty>
+			</view>
+			<view v-if="index==current" style="padding: 20upx;">
+				<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
+			</view>
+		</scroll-view>
+		<view class="footer" @click="addStore()">
+			<view class="add-btn flex justify_center align_center">新增店铺</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { historyOrderQuery } from '@/api/order.js'
+	export default {
+		data() {
+			return {
+				list: [], // 列表数据
+				pageNo: 1,  //  当前页码
+				pageSize: 10,  //  每页条数
+				total: 0,  //  数据总条数
+				noDataText: '暂无数据',  //  列表请求状态提示语
+				status: 'loadmore',  //  加载中状态
+			}
+		},
+		onLoad() {
+			this.pageInit()
+			// 开启分享
+			uni.showShareMenu({
+				withShareTicket: true,
+				menus: ['shareAppMessage', 'shareTimeline']
+			})
+		},
+		methods: {
+			pageInit() {
+				this.pageNo = 1
+				this.pageSize = 10
+				this.total = 0
+				this.list = []
+				this.getRow(1)
+			},
+			// 打电话
+			callPhone(phone) {
+				uni.makePhoneCall({
+				    phoneNumber: phone
+				});
+			},
+			// 进入详情
+			intoDetail(item) {
+				uni.navigateTo({
+					url: '/pages/order/hisOrderDetail?orderNo='+item.orderReserveNo
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				this.action = 'onreachBottom'
+				if (this.list.length < this.total) {
+					this.pageNo += 1
+					this.getRow()
+				} else {
+					if(this.list.length) {
+						uni.showToast({
+							title: '已经到底了',
+							icon: 'none'
+						});
+					}
+					this.status = "nomore"
+				}
+			},
+			// 查询列表
+			getRow(pageNo) {
+				this.status = "loadmore"
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				let params = {
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+				}
+				this.noDataText = '暂无数据'
+				this.status = "loading"
+				historyOrderQuery(params).then(res => {
+					if (res.status == 200) {
+						if (this.pageNo > 1) {
+							this.list = this.list.concat(res.data.list || [])
+						} else {
+							this.list = res.data.list || []
+						}
+						this.total = res.data.count || 0
+					} else {
+						this.list = []
+						this.total = 0
+						this.noDataText = res.message
+					}
+					this.status = "loadmore"
+				})
+			},
+			// 新增店铺
+			addStore(id){
+				const storeId=id ? id : ''
+				uni.navigateTo({
+					url:`/pages/store/addStore?id={storeId}`
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.content-store{
+		width: 100%;
+		height: 100vh;
+		background: #F5F5F5;
+		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
+		.input-search{
+			width: 100%;
+			height: 86upx;
+			background-color: #fff;
+			border-bottom: 1px solid #e5e5e5;
+			// position: fixed;
+			// top:0;
+			// left:0;
+			padding:14upx 32upx ;
+			.search{
+				width: 100%;
+				border-radius: 18px;
+			}
+		}
+		.list{
+			flex: 1;
+			.list-item{
+				padding: 32upx;
+				background-color: #fff;
+				.item-right{
+					margin-left:16upx;
+					border-bottom: 1px solid #e5e5e5;
+					.right-item{
+						height: 160upx;
+						view{
+							height: 33%;
+						}
+					}
+				}
+			}
+		}
+		.footer{
+			width: 100%;
+			padding: 14upx 32upx 32upx;
+			background-color: #fff;
+			color: #fff;
+			font-weight: 500;
+			.add-btn{
+				height: 84upx;
+				background: #1995FF;
+				opacity: 1;
+				border-radius: 16upx;
+			}
+		}
+	}
+	
+</style>

+ 29 - 42
pages/userCenter/index.vue

@@ -17,31 +17,37 @@
 		</view>
 		<!-- 列表 -->
 		<view class="list-container">
+			<navigator v-if="hasLogin" url="/pages/store/storeList" class="list-item flex align_center justify_between">
+				<view class="flex align_center">
+					<u-image src="/static/home/personal_store.png" width="48" height="48"></u-image>
+					<text>店铺管理</text>
+				</view>
+				<u-icon name="arrow-right" color="#9DA8B5" size="32"></u-icon>
+			</navigator>
 			<navigator v-if="hasLogin" url="/pages/order/historyOrder" class="list-item flex align_center justify_between">
 				<view class="flex align_center">
-					<u-icon class="icon" name="icon_order" custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
+					<u-image src="/static/home/personal_historyOrder.png" width="48" height="48"></u-image>
 					<text>历史订单</text>
 				</view>
 				<u-icon name="arrow-right" color="#9DA8B5" size="32"></u-icon>
 			</navigator>
 			<navigator v-if="hasLogin" url="/pages/recoveryTotal/index" class="list-item flex align_center justify_between">
 				<view class="flex align_center">
-					<!-- <view class="t-icon icon t-icon-icon_statistics"></view> -->
-					<u-icon class="icon" name="icon_statistics" custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
+					<u-image src="/static/home/personal_total.png" width="48" height="48"></u-image>
 					<text>回收统计</text>
 				</view>
 				<u-icon name="arrow-right" color="#9DA8B5" size="32"></u-icon>
 			</navigator>
 			<navigator v-if="hasLogin" url="/pages/userCenter/changePwd" class="list-item flex align_center justify_between">
 				<view class="flex align_center">
-					<u-icon class="icon" name="icon_modify" custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
+					<u-image src="/static/home/personal_passward.png" width="48" height="48"></u-image>
 					<text>修改密码</text>
 				</view>
 				<u-icon name="arrow-right" color="#9DA8B5" size="32"></u-icon>
 			</navigator>
 			<view @click="checkUpdate" class="list-item flex align_center justify_between">
 				<view class="flex align_center">
-					<u-icon class="icon" name="personal_icon_version" custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
+					<u-image src="/static/home/personal_version.png" width="48" height="48"></u-image>
 					<text>版本检查</text>
 				</view>
 				<view>
@@ -51,12 +57,17 @@
 			</view>
 			<view v-if="hasLogin" @click="quitSys" class="list-item flex align_center justify_between">
 				<view class="flex align_center">
-					<u-icon class="icon" name="icon_out" custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
+					<u-image src="/static/home/personal_loginout.png" width="48" height="48"></u-image>
 					<text>退出登录</text>
 				</view>
 				<u-icon name="arrow-right" color="#9DA8B5" size="32"></u-icon>
 			</view>
 		</view>
+		<!-- 客服电话 -->
+		<view class="phone flex justify_center align_center">
+			<u-icon name="phone" color="#191919" font-size="32" @click="callPhone"></u-icon>
+			<text @click="callPhone">客服电话:4008826012</text>
+		</view>
 	</view>
 </template>
 
@@ -188,6 +199,12 @@
 				uni.navigateTo({
 					url: '/pages/login/login'
 				})
+			},
+			//联系客服
+			callPhone(){
+				uni.makePhoneCall({
+				    phoneNumber: "4008826012"
+				});
 			}
 		}
 	}
@@ -226,6 +243,7 @@
 		}
 		.list-container{
 			width: 100%;
+			
 			.icon{
 				width: 48rpx;
 				height: 48rpx;
@@ -235,6 +253,8 @@
 				padding: 32rpx 36rpx;
 				background-color: #fff;
 				text{
+					display: inline-block;
+					margin-left: 28upx;
 					font-size: 34rpx;
 					color: #191919;
 				}
@@ -243,42 +263,9 @@
 				margin-bottom: 20rpx;
 			}
 		}
-		.my-ledou{
-			background: #FFFFFF;
-			border-radius: 15upx;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-			padding: 20upx;
-			margin: 20upx;
-			box-shadow: 0upx 3upx 6upx #eee;
-			.user-jifen{
-				display: flex;
-				align-items: center;
-				text{
-					font-size: 40upx;
-					font-weight: bold;
-					color: red;
-				}
-				>view{
-					&:first-child{
-						display: flex;
-						align-items: center;
-					}
-				}
-			}
-		}
-		.user-list{
-			border-radius: 15upx;
-			margin: 20upx;
-			overflow: hidden;
-			box-shadow: 0upx 3upx 6upx #eee;
-			.quit{
-				margin-top: 20upx;
-			}
-		}
-		.user-btn{
-			padding: 85rpx 200rpx;
+		.phone{
+			text-align: center;
+			margin-top: 20%;
 		}
 	}
 </style>

BIN
static/billing_icon.png


BIN
static/home/personal_historyOrder.png


BIN
static/home/personal_loginout.png


BIN
static/home/personal_passward.png


BIN
static/home/personal_store.png


BIN
static/home/personal_total.png


BIN
static/home/personal_version.png


BIN
static/home_shop.png


BIN
static/logo.png