ZZ 1 bulan lalu
induk
melakukan
f94cd48321

+ 21 - 3
mer_uniapp/App.vue

@@ -54,7 +54,7 @@
 			store.dispatch('GetGlobalConfig');
 			//校验token是否有效,true为有效,false为无效
 			store.dispatch("GetTokenIsExist");
-			
+
 			// 主题变色
 			getTheme().then(res => {
 				that.globalData.theme = `theme${Number(res.data.value)}`
@@ -64,7 +64,7 @@
 				window.document.documentElement.setAttribute('data-theme', that.globalData.theme);
 				// #endif
 			})
-			
+
 			// 获取页面高度
 			uni.getSystemInfo({
 				success: function(res) {
@@ -320,5 +320,23 @@
 		background: transparent;
 	}
 
+	checkbox.mycheck .wx-checkbox-input,
+	checkbox.mycheck .uni-checkbox-input {
+		width: 30rpx !important;
+		height: 30rpx !important;
+		background-color: #fff !important;
+		border-radius: 4rpx !important;
+		border: 2rpx solid #D6D7DC !important;
+	}
+
+	// 选中后的 对勾样式
+	checkbox.mycheck .uni-checkbox-input-checked::before,
+	checkbox.mycheck .wx-checkbox-input-checked::before {
+		// width: 25rpx !important; // 选中后对勾大小,不要超过背景的尺寸
+		// height: 25rpx !important; // 选中后对勾大小,不要超过背景的尺寸 
+		font-size: 36rpx !important; // 对勾大小 30rpx 
+		color: #047CFF !important;
+	}
+
 	/*#endif*/
-</style>
+</style>

+ 10 - 2
mer_uniapp/pages.json

@@ -422,8 +422,16 @@
 							// #endif
 						}
 					}
-				}
-			]
+				},
+				{
+                    "path" : "user_rider/index",
+					"style": {
+						"navigationBarTitleText": "成为骑手",
+						"navigationStyle": "custom",
+						"enablePullDownRefresh": false
+					}
+                }
+            ]
 		},
 		{
 			"root": "pages/merchant",

+ 1 - 0
mer_uniapp/pages/goods_cate/index.vue

@@ -244,6 +244,7 @@
 				that.pidIndex = 0;
 				getCategoryList().then(res => {
 					that.productList = res.data;
+					console.log(this.productList)
 					that.$nextTick(function(){
 						that.infoScroll();
 					})

+ 13 - 39
mer_uniapp/pages/merchant/home/index.vue

@@ -5,7 +5,7 @@
 		<!-- 导航栏 -->
 		<view :style="{ height: `${navigationBarHeight}rpx`,lineHeight: `${navigationBarHeight}rpx`}" class="order-nav">
 			<view class="back-button" @tap="handBack()"></view>
-			<text>吉阿婆麻辣烫</text>
+			<text>{{merchanInfo.name}}</text>
 		</view>
 		<view class="main">
 			<view class="nav">
@@ -53,7 +53,7 @@
 			</scroll-view>
 			<!-- goods list begin -->
 			<scroll-view class="goods" scroll-with-animation scroll-y :scroll-top="cateScrollTop" @scroll="handleGoodsScroll"
-			 @scrolltolower="handleFoot" :scroll-into-view="menuScrollIntoView">
+			 :scroll-into-view="menuScrollIntoView">
 				<view class="wrapper">
 					<view class="list">
 						<!-- category begin -->
@@ -63,7 +63,7 @@
 							<view class="items">
 								<!-- 商品 begin -->
 								<!-- <view v-if="!item.goodsList">无商品</view> -->
-								<view class="good" v-for="(good, key) in item.goodsList" :key="key">
+								<view class="good" v-for="(good, key) in item.childList" :key="key">
 									<image :src="good.image" class="image" @tap="console.log('点击图片')"></image>
 									<view class="right">
 										<text class="name">{{ good.name }}</text>
@@ -175,17 +175,14 @@
 			});
 			// 获取商品列表
 			getCategoryCacheTree(this.merId).then(res => {
-				this.goods = res.data.map(item => {
-					return {
-						id: item.id,
-						name: item.name
-					}
-				})
-				this.goods.unshift({
-					id: 9999,
-					name: '推荐'
-				})
+				console.log(res.data)
+				this.goods = res.data
+				// this.goods.unshift({
+				// 	id: 9999,
+				// 	name: '推荐'
+				// })
 				this.currentCateId = this.goods[0].id
+				// this.menuScrollIntoView = `cate-${9999}`
 			})
 			// this.getIndexConfig();
 			// #ifdef MP-WEIXIN
@@ -228,24 +225,6 @@
 				return parseFloat((this.store.min_price - this.getCartGoodsPrice).toFixed(2))
 			}
 		},
-		watch: {
-			currentCateId(newId, oldId) {
-				console.log(11111111111111111111)
-				// 获取商品
-				if (this.goods.length > 0) {
-					getMerchantProList(newId, this.merId, 1, 999).then(res => {
-						this.goods = this.goods.map(item => {
-							if (item.id === newId) {
-								item.goodsList = res.data.list
-							}
-							return {
-								...item
-							}
-						})
-					})
-				}
-			}
-		},
 		methods: {
 			handBack() {
 				uni.navigateBack({
@@ -257,11 +236,6 @@
 				if (!this.sizeCalcState) {
 					this.calcSize()
 				}
-				this.goods.forEach(item => {
-					if (item.id !== this.currentCateId) {
-						this.currentCateId = item.id    		// 点击左列获取前列表全部数据
-					}
-				})
 
 				this.$nextTick(() => this.cateScrollTop = this.goods.find(item => item.id == id).top)
 			},
@@ -301,9 +275,9 @@
 						size: true
 					}, data => {
 						// if (data.goodsList) {
-							item.top = h
-							h += data.height
-							item.bottom = h
+						item.top = h
+						h += data.height
+						item.bottom = h
 						// }
 					}).exec()
 				})

+ 59 - 13
mer_uniapp/pages/user/index.vue

@@ -5,7 +5,7 @@
 
 		<!-- 导航栏 -->
 		<view :style="{ height: `${navigationBarHeight}px`,lineHeight: `${navigationBarHeight}px`}" class="order-nav">
-			北京大学校园送
+			个人中心
 		</view>
 
 		<view style="background-color: #FF6702;height: 60rpx;"></view>
@@ -13,17 +13,23 @@
 		<view class="card">
 			<view class="card-left">
 				<view class="name" v-if="!isLogin" @tap="openAuto">
-					<img class="avatar" src="/static/img/ic-buy.png" alt="默认头像">
+					<image class="avatar tui-skeleton-rect" :src='userInfo.avatar' v-if="userInfo.avatar" @click="goEdit()"></image>
+					<image v-else class="avatar tui-skeleton-rect" :src="urlDomain+'crmebimage/presets/morenT.png'" mode="" @click="goEdit()">
+					</image>
 					<view class="username">请点击登录</view>
 				</view>
 
 				<template v-else>
-					<img class="avatar" src="/static/img/ic-buy.png" alt="用户头像">
-					<view class="username">老番茄333 <image src="/static/img/ic-code.png" class="code"></image>
+					<image class="avatar tui-skeleton-rect" :src='userInfo.avatar' v-if="userInfo.avatar" @click="goEdit()"></image>
+					<image v-else class="avatar tui-skeleton-rect" :src="urlDomain+'crmebimage/presets/morenT.png'" mode="" @click="goEdit()">
+					</image>
+					<view class="username">
+						{{userInfo.nickname}}
+						<!-- <image src="/static/img/ic-code.png" class="code"></image> -->
 					</view>
 
 					<view class="phone-info">
-						<text>绑定手机号:185-7033-6037</text>
+						<text>绑定手机号:{{userInfo.phone}}</text>
 						<image src="/static/img/ic-copy.png">
 						</image>
 					</view>
@@ -47,21 +53,19 @@
 					</view>
 				</view>
 
-				<view class="profile-link">
+				<!-- <view class="profile-link">
 					<text>个人中心</text>
 					<img src="/static/img/ic-right.png" />
-				</view>
+				</view> -->
 			</view>
 		</view>
 
 		<view class="item-settled">
-			<image @tap="menusTap('/pages/users/settled/index')" src="/static/img/ic-settled-left.png"
-				style="width: 350rpx;height: 116rpx;"></image>
+			<image @tap="menusTap('/pages/users/settled/index')" src="/static/img/ic-settled-left.png" style="width: 350rpx;height: 116rpx;"></image>
 
 			<image src="/static/img/ic-bg-line.png" style="width: 4rpx;height: 154rpx;margin: 0 20rpx;"></image>
 
-			<image @tap="menusTap('')" src="/static/img/ic-settled-right.png"
-				style="width: 350rpx;height: 116rpx;"></image>
+			<image @tap="menusRider('/pages/users/user_rider/index')" src="/static/img/ic-settled-right.png" style="width: 350rpx;height: 116rpx;"></image>
 		</view>
 
 		<view class="item-features" v-if="isLogin">
@@ -83,6 +87,10 @@
 <script>
 	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
 	let app = getApp();
+	import {
+		userCenterInfo,
+		copyrightImageApi
+	} from '@/api/user.js';
 	import Cache from '@/utils/cache';
 	import {
 		toLogin
@@ -93,12 +101,15 @@
 	import {
 		BACK_URL
 	} from '@/config/cache';
+	import animationType from '@/utils/animationType.js'
 	export default {
 		computed: mapGetters(['isLogin']),
 		data() {
 			return {
 				statusBarHeight: app.globalData.statusBarHeight,
 				navigationBarHeight: 0,
+				userInfo: {},
+				urlDomain: this.$Cache.get("imgHost"),
 				featuresList: [{
 						id: 1,
 						icon: '/static/img/ic-express.png',
@@ -157,7 +168,7 @@
 						id: 10,
 						icon: '/static/img/ic-security-settings.png',
 						text: '安全设置',
-						url: ''
+						url: '/pages/users/user_setting/index'
 					}
 				],
 			}
@@ -175,7 +186,26 @@
 			// #endif
 
 		},
+		onShow: function() {
+			if (this.isLogin) {
+				this.getUserCenterInfo();
+			}
+		},
 		methods: {
+			/**
+			 * 
+			 * 获取个人中心详情
+			 */
+			getUserCenterInfo: function() {
+				userCenterInfo().then(res => {
+					let data = res.data;
+					this.userInfo = data;
+					console.log(this, UserInfo)
+					// this.showSkeleton = false;
+				}).catch(err => {
+					// this.showSkeleton = false;
+				});
+			},
 			menusTap(url) {
 				if (!this.isLogin) {
 					this.openAuto();
@@ -189,6 +219,22 @@
 				Cache.set(BACK_URL, '')
 				toLogin();
 			},
+			// 跳转骑手
+			menusRider(url) {
+				this.$util.navigateTo(url);
+			},
+			// 编辑页面
+			goEdit() {
+				if (this.isLogin == false) {
+					this.openAuto();
+				} else {
+					uni.navigateTo({
+						animationType: animationType.type,
+						animationDuration: animationType.duration,
+						url: '/pages/users/user_info/index'
+					})
+				}
+			},
 		},
 	}
 </script>
@@ -393,4 +439,4 @@
 		color: #2E261E;
 		line-height: 38rpx;
 	}
-</style>
+</style>

+ 2 - 1
mer_uniapp/pages/users/user_info/index.vue

@@ -518,7 +518,8 @@
 	}
 
 	.bg_color {
-		@include main_bg_color(theme);
+		// @include main_bg_color(theme);
+		background-color: $bg-color-primary;
 	}
 
 	.personal-data .logOut {

+ 255 - 0
mer_uniapp/pages/users/user_rider/index.vue

@@ -0,0 +1,255 @@
+<template>
+	<view>
+		<!-- 状态栏高度 -->
+		<view :style="{ height: `${statusBarHeight}px`, backgroundColor: '#FF6702' }"></view>
+
+		<!-- 导航栏 -->
+		<view :style="{ height: `${navigationBarHeight}rpx`,lineHeight: `${navigationBarHeight}rpx`}" class="order-nav">
+			<view class="back-button" @tap="handBack()"></view>
+			成为骑手
+		</view>
+		<!-- <form @submit="formSubmit"> -->
+		<view style="background-color: #fff;padding: 21rpx 0 86rpx 39rpx;">
+			<view class="item-box">
+				<view class="title" style="width: 147rpx;">姓名</view>
+				<input class="uni-input" v-model="name" focus placeholder="请输入你的姓名" />
+			</view>
+			<view class="item-box">
+				<view class="title" style="width: 147rpx;">手机号</view>
+				<input type='number' class="uni-input" v-model="phone" focus placeholder="请输入你的手机号" />
+			</view>
+			<view class="item-box">
+				<view class="title" style="width: 147rpx;">短信验证</view>
+				<input type='number' class="uni-input" maxlength="6" v-model="bindingCaptcha" focus placeholder="请输入验证码" />
+				<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
+					{{ text }}
+				</button>
+			</view>
+			<view class="item-box" style="justify-content: space-between;">
+				<view class="title">是否有过配送经验</view>
+				<switch :value="isSwitch" :checked="isSwitch" color="#12CA00" style="transform:scale(0.7)" />
+			</view>
+			<view class="item-box" style="border: none;padding: 0;">
+				<view class="title">配送职责(可多选)</view>
+			</view>
+			<view class="item-box" style="border-bottom: none;">
+				<checkbox-group name="checkbox" style="margin-top: 38rpx;">
+					<label style="margin-left: 96rpx">
+						<checkbox class="mycheck" :value="1" :checked="checkbox1" /> <text style="margin-left: 10rpx"> 骑手</text>
+					</label>
+					<label style="margin-left: 96rpx">
+						<checkbox class="mycheck" :value="2" :checked="checkbox2" /> <text style="margin-left: 10rpx"> 快递员</text>
+					</label>
+				</checkbox-group>
+			</view>
+		</view>
+		<view style="padding: 0 96rpx;margin: 96rpx 0 20rpx 0;">
+			<label class="radio">
+				<radio value="isAgree" @tap="isAgree = !isAgree" :checked="isAgree" />我已阅读相关条款
+			</label>
+		</view>
+		<view style="padding: 0 96rpx;">
+			<button class="sub" @tap="formSubmit">提交</button>
+		</view>
+		<!-- </form> -->
+	</view>
+</template>
+
+<script>
+	import {
+		registerVerify,
+	} from '@/api/api.js';
+	import {
+		Debounce
+	} from '@/utils/validate.js'
+	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
+	let app = getApp();
+	export default {
+		data() {
+			return {
+				checkbox1: true,
+				checkbox2: false,
+				statusBarHeight: app.globalData.statusBarHeight,
+				navigationBarHeight: 112,
+				isAgree: false,
+				isSwitch: false,
+				name: '',
+				phone: '',
+				bindingCaptcha: '',
+				disabled: false,
+				text: '发送验证码',
+				nums: 60,
+				timer: '',
+			}
+		},
+		methods: {
+			onVerify() {
+				let that = this;
+
+				if (!that.name) return that.$util.Tips({
+					title: '请填写姓名!'
+				});
+				if (!that.phone) return that.$util.Tips({
+					title: '请填写手机号码!'
+				});
+				if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
+					title: '请输入正确的手机号码!'
+				});
+				if (!that.bindingCaptcha) return that.$util.Tips({
+					title: '请填写验证码!'
+				});
+				if (!that.checkbox1 && !that.checkbox2) return that.$util.Tips({
+					title: '请选择配送职责!'
+				});
+				if (!that.isAgree) return that.$util.Tips({
+					title: '请勾选相关条款!'
+				});
+				return true;
+			},
+			handBack() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			/**
+			 * 发送验证码
+			 *
+			 */
+			code: Debounce(function() {
+				this.nums = 60;
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				});
+				let that = this;
+				if (!that.phone) return that.$util.Tips({
+					title: '请填写手机号码!'
+				});
+				if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
+					title: '请输入正确的手机号码!'
+				});
+				// registerVerify().then(res => {
+				// 	that.$util.Tips({
+				// 		title: res.message
+				// 	});
+				// 	that.timer = setInterval(that.getTimes, 1000);
+				// 	that.disabled = true;
+				uni.hideLoading();
+				// })
+			}),
+			getTimes() {
+				this.nums = this.nums - 1;
+				this.text = "剩余 " + this.nums + "s";
+				if (this.nums < 0) {
+					clearInterval(this.timer);
+				}
+				this.text = "剩余 " + this.nums + "s";
+				if (this.text < "剩余 " + 0 + "s") {
+					this.disabled = false;
+					this.text = "重新获取";
+				}
+			},
+			checkboxChange(e) {
+				console.log(e)
+			},
+			formSubmit: function() {
+				if (this.onVerify()) {
+					const params = {
+						checkbox1: this.checkbox1, // 骑手
+						checkbox2: this.checkbox2, // 快递员
+						isSwitch: this.isSwitch, // 是否有配送经验
+						name: this.name, // 姓名
+						phone: this.phone, // 电话
+						bindingCaptcha: this.bindingCaptcha // 验证码
+					}
+					console.log(params)
+				}
+			}
+		},
+		onLoad(options) {},
+		mounted() {
+
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	/* 可以使用 !important 来确保样式覆盖 */
+	uni-checkbox .uni-checkbox-input {
+		border-radius: 5rpx !important;
+	}
+
+	.item-box {
+		display: flex;
+		align-items: center;
+		border-bottom: 3rpx solid #D7D8DD;
+		margin-bottom: 21rpx;
+		padding-bottom: 21rpx;
+		margin-right: 38rpx;
+
+		.title {
+			font-weight: 600;
+			font-size: 27rpx;
+			color: #141414;
+		}
+
+		input {
+			flex: 1;
+		}
+	}
+
+	.code {
+		padding: 13rpx 23rpx;
+		font-weight: 400;
+		font-size: 21rpx;
+		color: #FFFFFF;
+		background-color: $bg-color-primary;
+	}
+
+	.code.on {
+		color: #b9b9bc !important;
+	}
+
+	.sub {
+		width: 100%;
+		background-color: #FF6702;
+		font-weight: 600;
+		font-size: 35rpx;
+		color: #FFFFFF;
+		padding: 25rpx 0;
+	}
+
+	.order-nav {
+		font-weight: 500;
+		font-size: 35rpx;
+		color: #FFFFFF;
+		position: relative;
+		background-color: #FF6702;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+
+		.back-button {
+			position: absolute;
+			left: 20rpx;
+		}
+	}
+
+	.back-button {
+
+		width: 30rpx;
+
+		height: 30rpx;
+
+		border-right: 4rpx solid #fff;
+		border-bottom: 4rpx solid #fff;
+
+		transform: rotate(135deg);
+
+		margin-left: 10rpx;
+
+		display: inline-block;
+
+		position: relative;
+	}
+</style>