Przeglądaj źródła

Merge branch 'master' of http://git.cc-lotus.info/pointToNetwork/point-app

guhongwei 2 lat temu
rodzic
commit
9e6961f996

+ 32 - 28
common/css/font-icon.css

@@ -1,81 +1,85 @@
 @font-face {
-  font-family: "iconfont"; /* Project id 3674157 */
-  /* Color fonts */
-  src: 
-       url('https://at.alicdn.com/t/c/font_3674157_g19wel1yxjd.woff2?t=1664269541651') format('woff2'),
-       url('https://at.alicdn.com/t/c/font_3674157_g19wel1yxjd.woff?t=1664269541651') format('woff'),
-       url('https://at.alicdn.com/t/c/font_3674157_g19wel1yxjd.ttf?t=1664269541651') format('truetype');
+	font-family: "iconfont";
+	/* Project id 3674157 */
+	/* Color fonts */
+	src:
+		url('https://at.alicdn.com/t/c/font_3674157_kx83v79ah2c.woff2?t=1664331158645') format('woff2'),
+		url('https://at.alicdn.com/t/c/font_3674157_kx83v79ah2c.woff?t=1664331158645') format('woff'),
+		url('https://at.alicdn.com/t/c/font_3674157_kx83v79ah2c.ttf?t=1664331158645') format('truetype');
 }
 
 .iconfont {
-  font-family: "iconfont" !important;
-  font-size: 16px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
+	font-family: "iconfont" !important;
+	font-size: 16px;
+	font-style: normal;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+}
+
+.icon-dingweixiao:before {
+	content: "\e8ba";
 }
 
 .icon-shangdian:before {
-  content: "\e67a";
+	content: "\e67a";
 }
 
 .icon-shangjiantou:before {
-  content: "\e603";
+	content: "\e603";
 }
 
 .icon-xiajiantou:before {
-  content: "\e604";
+	content: "\e604";
 }
 
 .icon-shangjiantou-copy:before {
-  content: "\e714";
+	content: "\e714";
 }
 
 .icon-xiajiantou-copy:before {
-  content: "\e715";
+	content: "\e715";
 }
 
 .icon-del-copy:before {
-  content: "\e716";
+	content: "\e716";
 }
 
 .icon-del:before {
-  content: "\e616";
+	content: "\e616";
 }
 
 .icon-fanhuidingbu:before {
-  content: "\e713";
+	content: "\e713";
 }
 
 .icon-gouwuche:before {
-  content: "\e628";
+	content: "\e628";
 }
 
 .icon-dayufuhao:before {
-  content: "\e62b";
+	content: "\e62b";
 }
 
 .icon-daifahuo:before {
-  content: "\e600";
+	content: "\e600";
 }
 
 .icon-daifukuan:before {
-  content: "\e601";
+	content: "\e601";
 }
 
 .icon-shouhoufuwuicon:before {
-  content: "\e633";
+	content: "\e633";
 }
 
 .icon-geren2:before {
-  content: "\e6bc";
+	content: "\e6bc";
 }
 
 .icon-daishouhuo:before {
-  content: "\e612";
+	content: "\e612";
 }
 
 .icon-daipinglun:before {
-  content: "\e602";
+	content: "\e602";
 }
-

+ 6 - 2
pages.json

@@ -106,15 +106,19 @@
 					"style": {
 						"navigationBarTitleText": "新增收货地址"
 					}
-
 				},
 				{
+					"path": "address/location",
+					"style": {
+						"navigationBarTitleText": "定位"
+					}
+
+				}, {
 					"path": "account/index",
 					"style": {
 						"navigationBarTitleText": "账号管理"
 					}
 				}
-
 			]
 		},
 		{

+ 152 - 4
pagesMy/address/add.vue

@@ -1,24 +1,172 @@
 <template>
-	<mobile-frame>
-		新增收货地址
+	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
+		<view class="main">
+			<view class="one">
+				<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
+					<uni-forms-item label="收货人" name="name">
+						<uni-easyinput type="text" v-model="form.name" placeholder="请输入收货人" />
+					</uni-forms-item>
+					<uni-forms-item label="联系电话" name="phone">
+						<uni-easyinput type="text" v-model="form.phone" placeholder="请输入联系电话" />
+					</uni-forms-item>
+					<uni-forms-item label="所在地区" name="deptname">
+						<uni-data-picker placeholder="请选择省,市,区/街道" popup-title="选择省,市,区/街道" :localdata="provincial"
+							@change="onchange">
+						</uni-data-picker>
+						<text class="iconfont icon-dingweixiao"
+							@click="tolocation('/pagesMy/address/location')">定位</text>
+					</uni-forms-item>
+					<uni-forms-item label="详细地址" name="address">
+						<uni-easyinput type="text" v-model="form.address" placeholder="请输入所在小区/大厦/学校" />
+					</uni-forms-item>
+					<uni-forms-item label="楼牌号" name="num">
+						<uni-easyinput type="text" v-model="form.num" placeholder="请输入楼牌号" />
+					</uni-forms-item>
+					<uni-forms-item label="设为默认" name="true">
+						<switch :checked="check" @change="switchChange" />
+					</uni-forms-item>
+				</uni-forms>
+				<view class="btn">
+					<button type="primary" @click="onSubmit('form')" size="small">提交保存</button>
+				</view>
+			</view>
+		</view>
+
 	</mobile-frame>
 </template>
 
 <script>
 	export default {
 		data() {
-			return {};
+			return {
+				frameStyle: {
+					useBar: false
+				},
+				form: {},
+				rules: {
+					name: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入收货人',
+						}]
+					},
+					phone: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入联系电话',
+							tel: true
+						}]
+					},
+					deptname: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入机构名称'
+						}]
+					},
+					address: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入详细地址'
+						}]
+					},
+				},
+				provincial: [],
+				check: false,
+			};
 		},
 		onLoad: function(e) {
 			console.log(e);
 		},
 		onShow: function() {},
 		methods: {
-
+			toPath(e) {
+				if (e && e.route) uni.redirectTo({
+					url: `/${e.route}`
+				})
+			},
+			// 是否设为默认地址
+			switchChange(e) {
+				const that = this;
+				const {
+					value
+				} = e.detail;
+				that.$set(that, `check`, value);
+			},
+			// 选择城市
+			onchange() {},
+			// 定位
+			tolocation(route,e) {
+				uni.navigateTo({
+					url: `${route}`
+				})
+			},
+			// 提交保存
+			onSubmit() {
+				const that = this;
+				let data = that.form;
+				data = {
+					...data,
+					check: that.check
+				}
+				console.log(data);
+				// this.$refs.form.validate().then(async (res) => {
+				// let arr;
+				// if (data._id) {
+				// 	arr = await that.$api(``, 'POST', data)
+				// } else {
+				// 	arr = await that.$api(``, 'POST', data)
+				// }
+				// if (arr.errcode == '0') {
+				// 	uni.showToast({
+				// 		title: `维护信息成功`,
+				// 		icon: 'success',
+				// 		duration: 2000
+				// 	});
+				// 	that.back()
+				// } else {
+				// 	uni.showToast({
+				// 		title: arr.errmsg,
+				// 		icon: 'error',
+				// 		duration: 2000
+				// 	})
+				// }
+				// })
+			},
 		}
 	}
 </script>
 
 <style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+
+			.uni-input {
+				border: #f1f1ff 1px solid;
+				padding: 2vw 2vw;
+				border-radius: 1vw;
+			}
+
+			.btn {
+				text-align: center;
 
+				button {
+					margin: 0 2vw 2vw 2vw;
+					background-color: var(--f35BColor);
+					color: var(--fffColor);
+				}
+			}
+		}
+	}
+
+	.uni-forms-item {
+		margin-bottom: 6vw !important;
+		display: flex;
+		flex-direction: row;
+	}
 </style>

+ 51 - 0
pagesMy/address/location.vue

@@ -0,0 +1,51 @@
+<template>
+	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
+		<view class="main">
+			<view class="one">
+			</view>
+		</view>
+
+	</mobile-frame>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				frameStyle: {
+					useBar: true
+				},
+			};
+		},
+		onLoad: function(e) {
+			uni.getLocation({
+				type: 'wgs84',
+				success: function(res) {
+					console.log('当前位置的经度:' + res.longitude);
+					console.log('当前位置的纬度:' + res.latitude);
+				}
+			});
+		},
+		onShow: function() {},
+		methods: {
+			toPath(e) {
+				if (e && e.route) uni.redirectTo({
+					url: `/${e.route}`
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+		}
+	}
+</style>

+ 4 - 0
pagesMy/collection/shop.vue

@@ -65,6 +65,10 @@
 				const that = this;
 				console.log(e);
 			},
+			// 分页
+			toPage(e) {
+			
+			},
 		}
 	}
 </script>

+ 53 - 17
pagesMy/order/index.vue

@@ -9,16 +9,16 @@
 					<view class="list-scroll-view">
 						<view class="two_1">
 							<view class="cond_1">
-								默认
+								全部
 							</view>
 							<view class="cond_1">
-								默认
+								待付款
 							</view>
 							<view class="cond_1">
-								默认
+								待发货
 							</view>
 							<view class="cond_1">
-								默认
+								待发货/消费
 							</view>
 						</view>
 						<view class="two_2">
@@ -48,7 +48,15 @@
 								</view>
 								<view class="list_3">
 									<text>共{{item.num}}件商品</text>
-									<text>总价¥{{item.money}}</text>
+									<view class="money">
+										<text>总价¥</text>
+										<text>{{item.money}}</text>
+									</view>
+								</view>
+								<view class="list_4">
+									<button type="default" size="mini" plain="true"
+										@click="toCancel(item)">取消订单</button>
+									<button type="warn" size="mini" plain="true" @click="toPay(item)">付款</button>
 								</view>
 							</view>
 						</view>
@@ -102,6 +110,14 @@
 			toInput(e) {
 				const that = this;
 				that.$set(that.searchInfo, `name`, e.detail.value)
+			},
+			// 取消订单
+			toCancel(e) {
+				console.log(e);
+			},
+			// 付款
+			toPay(e) {
+				console.log(e);
 			}
 		}
 	}
@@ -128,6 +144,7 @@
 		.two {
 			position: relative;
 			flex-grow: 1;
+			background-color: var(--f9Color);
 
 			.two_1 {
 				background-color: var(--fffColor);
@@ -139,13 +156,11 @@
 			.two_2 {
 				display: flex;
 				flex-direction: column;
-				padding: 2vw 2vw 0 2vw;
 
 				.list {
-					width: 95vw;
-					border-radius: 5px;
-					border: 1px solid red;
+					width: 100vw;
 					margin: 2vw 0 0 0;
+					background-color: var(--mainColor);
 
 					.list_1 {
 						display: flex;
@@ -154,7 +169,7 @@
 						padding: 2vw;
 
 						.name {
-							font-size: var(--font16Size);
+							font-size: var(--font14Size);
 
 							text {
 								margin: 0 1vw 0 0;
@@ -162,7 +177,7 @@
 						}
 
 						.status {
-							font-size: var(--font16Size);
+							font-size: var(--font14Size);
 							color: var(--ff0Color);
 						}
 					}
@@ -172,11 +187,11 @@
 						flex-direction: row;
 						justify-content: space-between;
 						padding: 2vw;
-						background-color: var(--f1Color);
+						background-color: var(--f8Color);
 
 						.image {
-							width: 25vw;
-							height: 25vw;
+							width: 20vw;
+							height: 20vw;
 							margin: 0 2vw 0 0;
 						}
 
@@ -186,25 +201,46 @@
 							flex-grow: 1;
 
 							.name {
-								font-size: var(--font16Size);
+								font-size: var(--font14Size);
 								font-weight: bold;
 								margin: 0 0 2vw 0;
 							}
 
 							.other_1 {
-								font-size: var(--font14Size);
+								font-size: var(--font12Size);
 								color: var(--f85Color);
 							}
 						}
 
 						.money {
-							font-size: var(--font14Size);
+							font-size: var(--font12Size);
 
 							.num {
 								text-align: right;
 							}
 						}
 					}
+
+					.list_3 {
+						display: flex;
+						justify-content: flex-end;
+						padding: 2vw;
+						border-bottom: 0.5vw solid var(--f9Color);
+						font-size: var(--font12Size);
+
+						text {
+							margin: 0 1vw;
+						}
+					}
+
+					.list_4 {
+						padding: 2vw;
+						text-align: right;
+
+						button {
+							margin: 0 1vw 0 2vw;
+						}
+					}
 				}
 			}
 		}