WangYiHan преди 11 месеца
родител
ревизия
827db7db38
променени са 9 файла, в които са добавени 147 реда и са изтрити 81 реда
  1. 2 1
      App.vue
  2. 1 0
      api/product/category.js
  3. 2 0
      pages/equ_list/add_equ.vue
  4. 59 30
      pages/equ_list/bind.vue
  5. 47 41
      pages/equ_list/choose.vue
  6. 6 0
      pages/equ_list/index.vue
  7. 10 2
      pages/goods_cate/goods_cate.vue
  8. 18 7
      pages/goods_list/index.vue
  9. 2 0
      utils/request.js

+ 2 - 1
App.vue

@@ -194,7 +194,8 @@
 		color: transparent;
 	}
 	.status_bar{
-		background-color: transparent;
+		background-color: #F35546;
+		/* #F35546 */
 		width: 100%;
 		height: var(--status-bar-height);
 		position: fixed;

+ 1 - 0
api/product/category.js

@@ -2,6 +2,7 @@ import request from "@/utils/request.js";
 
 // 查询分类列表
 export function getCategoryList() {
+	console.log('走到接口里了')
   return request.get('app-api/product/category/list', {}, {
     noAuth: true // TODO 芋艿:后续要做调整
   });

+ 2 - 0
pages/equ_list/add_equ.vue

@@ -44,6 +44,8 @@
 		</view> -->
 		<!-- #endif -->
 		<!-- #ifdef APP-PLUS -->
+		<!-- 状态栏占位 -->
+		<view class="status_bar"></view>
 		<view class="" style="margin-top: var(--status-bar-height);">
 			<uni-nav-bar title="添加设备" left-icon="left" backgroundColor="#F35546" color="#fff"
 				@clickLeft="back"></uni-nav-bar>

+ 59 - 30
pages/equ_list/bind.vue

@@ -1,44 +1,45 @@
 <template>
 
 	<view class="page">
-		<!-- #ifdef APP-PLUS||MP -->
+		<!-- #ifdef APP-PLUS -->
+		<!-- 状态栏占位 -->
+		<view class="status_bar"></view>
+		<view class="" style="margin-top: var(--status-bar-height);">
+			<uni-nav-bar title="" left-icon="left" backgroundColor="#F35546" color="#fff" @clickLeft="back"></uni-nav-bar>
+		</view>
 		<view class="content-box">
-			<u-form-item label="姓名"><u-input v-model="formData.deviceCode" /></u-form-item>
+			<u-form :model="formData" ref="uForm" label-align="right" label-width="50">
+				<u-form-item label="ID号"><u-input v-model="formData.deviceCode" /></u-form-item>
+			</u-form>
+			
 			<view class="form-box">
-				<u-form :model="form" ref="uForm">
+				<u-form :model="formData" ref="uForm" label-align="right" label-width="50">
 					<u-form-item label="照片">
 						<view class="pictrue" @click.stop='uploadpic'>
-							<image :src='newAvatar ? newAvatar : userInfo.avatar'></image>
+							<image :src='newAvatar ? newAvatar : formData.avatar'></image>
 							<image src='../../static/images/alter.png' class="alter"></image>
 						</view>
-						<!-- <u-input v-model="formData.deviceCode" @click.native.stop.prevent="uploadpic"/> -->
-					</u-form-item>
-					<u-form-item label="简介"><u-input v-model="form.intro" /></u-form-item>
-					<u-form-item label="性别"><u-input v-model="form.sex" type="select" /></u-form-item>
-					<u-form-item label="水果">
-						<u-checkbox-group>
-							<u-checkbox v-model="item.checked" v-for="(item, index) in checkboxList" :key="index"
-								:name="item.name">
-								{{ item.name }}
-							</u-checkbox>
-						</u-checkbox-group>
 					</u-form-item>
-					<u-form-item label="味道">
-						<u-radio-group v-model="radio">
-							<u-radio v-for="(item, index) in radioList" :key="index" :name="item.name"
-								:disabled="item.disabled">
-								{{ item.name }}
-							</u-radio>
-						</u-radio-group>
+					<u-form-item label="姓名"><u-input v-model="formData.nickName" placeholder="请输入姓名"/></u-form-item>
+					<u-form-item label="证件号"><u-input v-model="formData.cardNumber" placeholder="请输入证件号" @blur="cardNumberBlur"/></u-form-item>
+					<u-form-item label="性别" right-icon="arrow-right"><u-input v-model="formData.sexValue" placeholder="请选择性别" disabled/></u-form-item>
+					<u-form-item label="生日" right-icon="arrow-right"><u-input v-model="formData.birthday" placeholder="请选择生日" disabled/></u-form-item>
+					<u-form-item label="手机号"><u-input v-model="formData.tel" @blur="telBlur" placeholder="请输入手机号"/></u-form-item>
+				</u-form>
+			</view>
+			<view class="form-box">
+				<u-form :model="formData" ref="uForm" label-align="right" label-width="50">
+					<!-- 问题:u-input在disabled得情况下点击事件失效 -->
+					<u-form-item label="关系" right-icon="arrow-right" @click.native="goChooseRelation">
+							<u-input disabled  v-model="formData.relationValue"  placeholder="请选择关系" input-align="right" />
 					</u-form-item>
-					<u-form-item label="开关"><u-switch slot="right" v-model="switchVal"></u-switch></u-form-item>
 				</u-form>
-
 			</view>
 
 		</view>
 		<!-- #endif -->
 
+		<!-- #ifdef MP -->
 		<view class="content_box">
 			<van-field v-model="formData.deviceCode" readonly name="ID号" label="ID号" placeholder="ID号" />
 			<view class="content">
@@ -89,6 +90,7 @@
 			</van-field>
 
 		</view>
+		<!-- #endif -->
 		<view class="footer_btn">
 			<view class="footer" @click="bindEqu('formData')">
 				绑定
@@ -166,6 +168,7 @@
 				minDate: new Date(1900, 0, 1).getTime(),
 				id: '',
 				list: [],
+				newAvatar: '',
 			}
 		},
 		computed: mapGetters(['uid', 'deviceId']),
@@ -179,6 +182,9 @@
 			}
 		},
 		methods: {
+			back() {
+				uni.navigateBack()
+			},
 			getList() {
 				infoApi.getDetailList().then(res => {
 					let obj = {
@@ -285,9 +291,16 @@
 				}
 			},
 			cardNumberBlur(e) {
-				console.log(e.detail.value, 66666)
+				let value=''
+				// #ifdef APP-PLUS 
+					value = e
+				// #endif 
+				// #ifdef MP 
+					value = e.detail.value
+				// #endif 
+				console.log(value, 2222)
 				// 调用身份证号验证方法
-				this.idCardValidator({}, e.detail.value, (error) => {
+				this.idCardValidator({}, value, (error) => {
 					if (error) {
 						// 这里可以根据验证结果处理逻辑
 						this.$util.Tips({
@@ -301,7 +314,7 @@
 							sex,
 							sexValue,
 							birthday
-						} = this.parseIDCard(e.detail.value);
+						} = this.parseIDCard(value);
 						console.log('性别:', sexValue);
 						console.log('出生年月日:', birthday);
 						this.$set(this.formData, 'sex', sex)
@@ -311,7 +324,15 @@
 				});
 			},
 			telBlur(e) {
-				if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(e.detail.value))) {
+				let val=''
+				// #ifdef APP-PLUS 
+					val = e
+				// #endif 
+				// #ifdef MP 
+					val = e.detail.value
+				// #endif 
+				console.log(val, 2222)
+				if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(val))) {
 					return this.$util.Tips({
 						title: '请输入正确的手机号码!'
 					});
@@ -360,6 +381,7 @@
 				this.formData.relationValue = item.name
 			},
 			goChooseRelation() {
+				console.log('点击了跳转',666)
 				uni.navigateTo({
 					url: '/pages/equ_list/choose'
 				})
@@ -389,8 +411,15 @@
 
 <style lang="scss">
 	::v-deep .u-form-item {
-		background-color: red;
-		padding: 20rpx !important;
+		background-color: #fff;
+		padding:0 20rpx !important;
+		border-bottom: 2rpx solid #F5F5F5;
+	}
+	::v-deep .u-form-item__body__right__content__slot{
+		align-content: flex-end;
+	}
+	::v-deep .u-input{
+		background-color: #fff !important;
 	}
 
 	.avatar_box {

+ 47 - 41
pages/equ_list/choose.vue

@@ -16,6 +16,11 @@
 			<van-field class="chageName" :value="nameValue" :focus="true" placeholder="请输入"
 				@change="nameValue = $event.detail" />
 		</van-dialog>
+		<!-- #ifdef APP-PLUS -->
+		<u-modal :show="showDialog" :title-style="{color: 'red'}" title="自定义" show-cancel-button="true" @cancel="showDialog=false" @confirm="confirm">
+			<u-input v-model="nameValue"  placeholder="请输入"/>
+		</u-modal>
+		<!-- #endif -->
 	</view>
 </template>
 
@@ -27,47 +32,47 @@
 	export default {
 		data() {
 			return {
-				// list: [{
-				// 		src: '/pages/users/static/choose1.png',
-				// 		name: '爸爸',
-				// 		value: 1
-				// 	}, {
-				// 		src: '/pages/users/static/choose2.png',
-				// 		name: '妈妈',
-				// 		value: 2
-				// 	}, {
-				// 		src: '/pages/users/static/choose3.png',
-				// 		name: '儿子',
-				// 		value: 3
-				// 	}, {
-				// 		src: '/pages/users/static/choose4.png',
-				// 		name: '女儿',
-				// 		value: 4
-				// 	}, {
-				// 		src: '/pages/users/static/choose5.png',
-				// 		name: '爷爷',
-				// 		value: 5
-				// 	}, {
-				// 		src: '/pages/users/static/choose6.png',
-				// 		name: '奶奶',
-				// 		value: 6
-				// 	}, {
-				// 		src: '/pages/users/static/choose7.png',
-				// 		name: '姥爷',
-				// 		value: 7
-				// 	}, {
-				// 		src: '/pages/users/static/choose8.png',
-				// 		name: '姥姥',
-				// 		value: 8
-				// 	},
-				// 	{
-				// 		src: '/pages/users/static/vip04.png',
-				// 		name: '自定义',
-				// 		value: 9,
-				// 		id: 99
-				// 	},
-				// ],
-				list: [],
+				list: [{
+						avatar: '/pages/users/static/vip04.png',
+						name: '爸爸',
+						value: 1
+					}, {
+						avatar: '/pages/users/static/choose2.png',
+						name: '妈妈',
+						value: 2
+					}, {
+						avatar: '/pages/users/static/choose3.png',
+						name: '儿子',
+						value: 3
+					}, {
+						avatar: '/pages/users/static/choose4.png',
+						name: '女儿',
+						value: 4
+					}, {
+						avatar: '/pages/users/static/choose5.png',
+						name: '爷爷',
+						value: 5
+					}, {
+						avatar: '/pages/users/static/choose6.png',
+						name: '奶奶',
+						value: 6
+					}, {
+						avatar: '/pages/users/static/choose7.png',
+						name: '姥爷',
+						value: 7
+					}, {
+						avatar: '/pages/users/static/choose8.png',
+						name: '姥姥',
+						value: 8
+					},
+					{
+						avatar: '/pages/users/static/vip04.png',
+						name: '自定义',
+						value: 9,
+						id: 99
+					},
+				],
+				// list: [],
 				showDialog: false,
 				nameValue: '',
 			}
@@ -127,6 +132,7 @@
 				})
 			},
 			choose(item) {
+				console.log(item.id,'我带你寄了')
 				if (item.id == 99) {
 					this.showDialog = true
 				} else {

+ 6 - 0
pages/equ_list/index.vue

@@ -4,6 +4,9 @@
 			<!-- #ifdef APP-PLUS -->
 			<!-- 状态栏占位 -->
 			<view class="status_bar"></view>
+			<view class="" style="margin-top: var(--status-bar-height);">
+				<uni-nav-bar title="" left-icon="left" backgroundColor="#F35546" color="#fff" @clickLeft="back"></uni-nav-bar>
+			</view>
 			<!-- #endif -->
 			<view class='address-management' :class='equipmentList.length === 0 ? "fff":""'>
 				<radio-group class="radio-group" @change="radioChange" v-if="equipmentList.length">
@@ -166,6 +169,9 @@
 			this.getEquipmentList();
 		},
 		methods: {
+			back() {
+				uni.navigateBack()
+			},
 			// 轮播图改变事件
 			handleSwiperChange :function(e) {
 				console.log(e,666);

+ 10 - 2
pages/goods_cate/goods_cate.vue

@@ -7,7 +7,12 @@
 		<!-- 商品搜索 -->
 		<view class='header acea-row row-center-wrapper' style="margin-top: var(--status-bar-height)">
 			<view class='acea-row row-between-wrapper input'>
+				<!-- #ifdef MP -->
 				<text class='iconfont icon-sousuo'></text>
+				<!-- #endif -->
+				<!-- #ifdef APP-PLUS -->
+				<u-icon name="search"></u-icon>
+				<!-- #endif -->
 				<input type='text' placeholder='点击搜索商品信息' @confirm="searchSubmitValue" confirm-type='search'
 					name="search" placeholder-class='placeholder' />
 			</view>
@@ -137,8 +142,11 @@
 			orderAddcart
 		},
 		computed: mapGetters(['isLogin']),
-		onLoad(options) {
-			this.getAllCategory();
+		// onLoad(options) {
+		// 	this.getAllCategory();
+		// },
+		onShow(){
+			this.getAllCategory()
 		},
 		methods: {
 			infoScroll: function() {

+ 18 - 7
pages/goods_list/index.vue

@@ -4,12 +4,14 @@
 			<!-- #ifdef APP-PLUS -->
 			<!-- 状态栏占位 -->
 			<view class="status_bar"></view>
+			<view class="" style="margin-top: var(--status-bar-height);">
+				<uni-nav-bar title="" left-icon="left" backgroundColor="#F35546" color="#fff" @clickLeft="gotabbarback"></uni-nav-bar>
+			</view>
 			<!-- #endif -->
-			<view class='search bg-color acea-row row-between-wrapper' style="margin-top: var(--status-bar-height);">
-				<!-- #ifdef H5||APP-PLUS -->
-				<view class="iconfont icon-xiangzuo" @click="goback()"></view>
-				<!-- #endif -->
-				<view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text>
+			<view class='search bg-color1 acea-row row-between-wrapper' style="margin-top: calc(2 * var(--status-bar-height));;">
+				
+				<view class='input acea-row row-between-wrapper'>
+					<u-icon name="search" color="#C4C4C4" size='26'></u-icon>
 					<input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
 						:value='where.keyword' @confirm="searchSubmit" />
 				</view>
@@ -125,11 +127,16 @@
 			this.get_product_list();
 		},
 		methods: {
+			gotabbarback(){
+				uni.switchTab({
+					url:'/pages/goods_cate/goods_cate'
+				})
+			},
 			goback() {
 				// #ifdef H5
 				return history.back();
 				// #endif
-				// #ifndef H5
+				// #ifndef H5||APP-PLUS
 				return uni.navigateBack({
 					delta: 1,
 				})
@@ -300,6 +307,9 @@
 		top: 0;
 		z-index: 9;
 	}
+	.productList .bg-color1{
+		background-color: #F35546;
+	}
 
 	.productList .search .input {
 		// width: 640rpx;
@@ -348,7 +358,8 @@
 		font-size: 28rpx;
 		background-color: #fff;
 		margin-top: 86rpx;
-		top: var(--status-bar-height);
+		// top:0;
+		top: calc(2 * var(--status-bar-height));
 		z-index: 9;
 	}
 

+ 2 - 0
utils/request.js

@@ -81,6 +81,7 @@ function baseRequest(url, method, data, {
 			header: header,
 			data: data || {},
 			success: (res) => {
+				console.log(res,'我接口请求成功了')
 				if (noVerify)
 					reslove(res.data, res);
 				else if (res.data.code === 200 || res.data.code === 0)
@@ -92,6 +93,7 @@ function baseRequest(url, method, data, {
 					reject(res.data.msg || res.data.message || '系统错误');
 			},
 			fail: (msg) => {
+				console.log(msg,'我接口失败了')
 				reject('请求失败');
 			}
 		})