“wangyihan” 11 månader sedan
förälder
incheckning
9bd10797a6
9 ändrade filer med 259 tillägg och 42 borttagningar
  1. 4 3
      main.js
  2. 71 10
      package-lock.json
  3. 4 1
      package.json
  4. 3 1
      pages.json
  5. 138 26
      pages/equ_list/bind.vue
  6. 3 0
      pages/equ_list/index.vue
  7. 28 0
      project.config.json
  8. 7 0
      project.private.config.json
  9. 1 1
      uni.scss

+ 4 - 3
main.js

@@ -5,7 +5,8 @@ import Cache from './utils/cache'
 import util from 'utils/util'
 import configs from './config/app.js'
 import * as Order from './libs/order';
-import uView from 'uview-ui'
+import uView from "uview-ui";
+Vue.use(uView);
 
 Vue.prototype.$util = util;
 Vue.prototype.$config = configs;
@@ -16,8 +17,8 @@ Vue.prototype.$Order = Order;
 
 // #ifdef APP-PLUS
 
-Vue.use(uView)
-uni.$u.config.unit = 'rpx'
+// Vue.use(uView)
+// uni.$u.config.unit = 'rpx'
 // #endif
 
 // #ifdef H5

+ 71 - 10
package-lock.json

@@ -7,8 +7,11 @@
       "dependencies": {
         "@amap/amap-jsapi-loader": "^1.0.1",
         "@vant/weapp": "^1.11.6",
-        "uview-ui": "^2.0.36",
+        "uview-ui": "^1.8.8",
         "vant": "^2.13.2"
+      },
+      "devDependencies": {
+        "sass-loader": "^14.2.1"
       }
     },
     "node_modules/@amap/amap-jsapi-loader": {
@@ -216,6 +219,12 @@
         "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
       }
     },
+    "node_modules/neo-async": {
+      "version": "2.6.2",
+      "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+      "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
+      "dev": true
+    },
     "node_modules/picocolors": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
@@ -255,6 +264,46 @@
       "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
       "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
     },
+    "node_modules/sass-loader": {
+      "version": "14.2.1",
+      "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-14.2.1.tgz",
+      "integrity": "sha512-G0VcnMYU18a4N7VoNDegg2OuMjYtxnqzQWARVWCIVSZwJeiL9kg8QMsuIZOplsJgTzZLF6jGxI3AClj8I9nRdQ==",
+      "dev": true,
+      "dependencies": {
+        "neo-async": "^2.6.2"
+      },
+      "engines": {
+        "node": ">= 18.12.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/webpack"
+      },
+      "peerDependencies": {
+        "@rspack/core": "0.x || 1.x",
+        "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
+        "sass": "^1.3.0",
+        "sass-embedded": "*",
+        "webpack": "^5.0.0"
+      },
+      "peerDependenciesMeta": {
+        "@rspack/core": {
+          "optional": true
+        },
+        "node-sass": {
+          "optional": true
+        },
+        "sass": {
+          "optional": true
+        },
+        "sass-embedded": {
+          "optional": true
+        },
+        "webpack": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/source-map-js": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
@@ -265,12 +314,9 @@
       }
     },
     "node_modules/uview-ui": {
-      "version": "2.0.36",
-      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
-      "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
-      "engines": {
-        "HBuilderX": "^3.1.0"
-      }
+      "version": "1.8.8",
+      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.8.tgz",
+      "integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg=="
     },
     "node_modules/vant": {
       "version": "2.13.2",
@@ -490,6 +536,12 @@
       "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
       "peer": true
     },
+    "neo-async": {
+      "version": "2.6.2",
+      "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+      "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
+      "dev": true
+    },
     "picocolors": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
@@ -512,6 +564,15 @@
       "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
       "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
     },
+    "sass-loader": {
+      "version": "14.2.1",
+      "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-14.2.1.tgz",
+      "integrity": "sha512-G0VcnMYU18a4N7VoNDegg2OuMjYtxnqzQWARVWCIVSZwJeiL9kg8QMsuIZOplsJgTzZLF6jGxI3AClj8I9nRdQ==",
+      "dev": true,
+      "requires": {
+        "neo-async": "^2.6.2"
+      }
+    },
     "source-map-js": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
@@ -519,9 +580,9 @@
       "peer": true
     },
     "uview-ui": {
-      "version": "2.0.36",
-      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
-      "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
+      "version": "1.8.8",
+      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.8.tgz",
+      "integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg=="
     },
     "vant": {
       "version": "2.13.2",

+ 4 - 1
package.json

@@ -2,7 +2,10 @@
   "dependencies": {
     "@amap/amap-jsapi-loader": "^1.0.1",
     "@vant/weapp": "^1.11.6",
-    "uview-ui": "^2.0.36",
+    "uview-ui": "^1.8.8",
     "vant": "^2.13.2"
+  },
+  "devDependencies": {
+    "sass-loader": "^14.2.1"
   }
 }

+ 3 - 1
pages.json

@@ -1,5 +1,7 @@
 {
-	
+	"easycom": {
+		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
 			"path": "pages/index/index",

+ 138 - 26
pages/equ_list/bind.vue

@@ -1,5 +1,44 @@
 <template>
+
 	<view class="page">
+		<!-- #ifdef APP-PLUS||MP -->
+		<view class="content-box">
+			<u-form-item label="姓名"><u-input v-model="formData.deviceCode" /></u-form-item>
+			<view class="form-box">
+				<u-form :model="form" ref="uForm">
+					<u-form-item label="照片">
+						<view class="pictrue" @click.stop='uploadpic'>
+							<image :src='newAvatar ? newAvatar : userInfo.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>
+					<u-form-item label="开关"><u-switch slot="right" v-model="switchVal"></u-switch></u-form-item>
+				</u-form>
+
+			</view>
+
+		</view>
+		<!-- #endif -->
+
 		<view class="content_box">
 			<van-field v-model="formData.deviceCode" readonly name="ID号" label="ID号" placeholder="ID号" />
 			<view class="content">
@@ -18,7 +57,6 @@
 						@change="formData.cardNumber = $event.detail" />
 					<van-field class="btn" readonly clickable name="picker" :value="formData.sexValue" label="性别"
 						placeholder="请选择性别">
-						<!-- @click.native.stop.prevent="showPickerFn" -->
 						<template #button>
 							<image src="/static/img/arrow.png" mode=""></image>
 						</template>
@@ -30,7 +68,8 @@
 						</template>
 					</van-field>
 					<van-field v-model="formData.tel" name="手机号" label="手机号" placeholder="请输入手机号"
-						:rules="[{ required: true, message: '请填写手机号' }]" @blur="telBlur" @change="formData.tel = $event.detail" />
+						:rules="[{ required: true, message: '请填写手机号' }]" @blur="telBlur"
+						@change="formData.tel = $event.detail" />
 
 				</van-form>
 
@@ -40,7 +79,6 @@
 				<van-popup :show="showCalendar" position="bottom">
 					<van-datetime-picker @cancel="showCalendar=false" @confirm="calendarConfirm" :value="currentDay"
 						type="date" :min-date="minDate" />
-					<!-- :min-date="minDate" -->
 				</van-popup>
 			</view>
 			<van-field readonly class="btn" v-model="formData.relationValue" label="关系" clearable
@@ -49,7 +87,7 @@
 					<image src="/static/img/arrow.png" mode=""></image>
 				</template>
 			</van-field>
-			
+
 		</view>
 		<view class="footer_btn">
 			<view class="footer" @click="bindEqu('formData')">
@@ -68,8 +106,45 @@
 	export default {
 		data() {
 			return {
+				form: {
+					name: '',
+					intro: '',
+					sex: ''
+				},
+				checkboxList: [{
+						name: '苹果',
+						checked: false,
+						disabled: false
+					},
+					{
+						name: '雪梨',
+						checked: false,
+						disabled: false
+					},
+					{
+						name: '柠檬',
+						checked: false,
+						disabled: false
+					}
+				],
+				radioList: [{
+						name: '鲜甜',
+						disabled: false
+					},
+					{
+						name: '麻辣',
+						disabled: false
+					}
+				],
+				radio: '',
+				switchVal: false,
+
+
+
+
+
 				formData: {
-					photo:'',
+					photo: '',
 					deviceCode: '',
 					nickName: '',
 					relationId: null,
@@ -78,8 +153,8 @@
 					sex: null, //1 男 2女
 					sexValue: '',
 					birthday: '',
-					cardNumber:'',
-					tel:''
+					cardNumber: '',
+					tel: ''
 				},
 
 				username: '',
@@ -154,16 +229,16 @@
 						icon: 'none'
 					})
 				} else if (cardNumber == '') {
-				 	this.$util.Tips({
-				 		title: '请填写证件号',
-				 		icon: 'none'
-				 	})
-				 } else if (tel == '') {
-				 	this.$util.Tips({
-				 		title: '请填写手机号',
-				 		icon: 'none'
-				 	})
-				 }else if (relationId == null) {
+					this.$util.Tips({
+						title: '请填写证件号',
+						icon: 'none'
+					})
+				} else if (tel == '') {
+					this.$util.Tips({
+						title: '请填写手机号',
+						icon: 'none'
+					})
+				} else if (relationId == null) {
 					this.$util.Tips({
 						title: '请选择与设备使用者关系',
 						icon: 'none'
@@ -229,16 +304,16 @@
 						} = this.parseIDCard(e.detail.value);
 						console.log('性别:', sexValue);
 						console.log('出生年月日:', birthday);
-						this.$set(this.formData,'sex',sex)
-						this.$set(this.formData,'sexValue',sexValue)
-						this.$set(this.formData,'birthday',birthday)
+						this.$set(this.formData, 'sex', sex)
+						this.$set(this.formData, 'sexValue', sexValue)
+						this.$set(this.formData, 'birthday', birthday)
 					}
 				});
 			},
-			telBlur(e){
+			telBlur(e) {
 				if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(e.detail.value))) {
 					return this.$util.Tips({
-					  title: '请输入正确的手机号码!'
+						title: '请输入正确的手机号码!'
 					});
 				}
 			},
@@ -266,7 +341,7 @@
 				console.log('出生年月日:', formattedBirthday);
 
 				return {
-					sex:sex,
+					sex: sex,
 					sexValue: sexValue,
 					birthday: formattedBirthday
 				};
@@ -313,6 +388,11 @@
 </script>
 
 <style lang="scss">
+	::v-deep .u-form-item {
+		background-color: red;
+		padding: 20rpx !important;
+	}
+
 	.avatar_box {
 		height: 342rpx;
 		display: flex;
@@ -331,9 +411,40 @@
 		// padding: 60rpx 30rpx;
 	}
 
+	.content-box {
+		padding: 60rpx 30rpx;
+
+		.form-box {
+			margin-top: 30rpx;
+			.pictrue {
+				width: 96rpx;
+				height: 96rpx;
+				position: relative;
+				image {
+					width: 100%;
+					height: 100%;
+					border-radius: 50%;
+				}
+				.alter {
+					width: 30rpx;
+					height: 30rpx;
+					border-radius: 50%;
+					position: absolute;
+					bottom: 0;
+					right: 0;
+				}
+			}
+			// .pictrue image {
+			// 	width: 100%;
+			// 	height: 100%;
+			// 	border-radius: 50%;
+			// }
+		}
+	}
+
 	.content_box {
 		background-color: #F7F7F7;
-		    padding: 60rpx 30rpx;
+		padding: 60rpx 30rpx;
 
 		.btn {
 			image {
@@ -360,6 +471,7 @@
 			}
 		}
 	}
+
 	.footer_btn {
 		width: 100%;
 		height: 98rpx;
@@ -370,13 +482,13 @@
 		font-size: 32rpx;
 		padding: 32rpx;
 		box-sizing: border-box;
-	
+
 		.footer {
 			background: #F35546;
 			border-radius: 9rpx;
 			text-align: center;
 		}
-	
+
 	}
 
 	::v-deep uni-image {

+ 3 - 0
pages/equ_list/index.vue

@@ -66,7 +66,9 @@
 				<image src="/static/img/addicon.png" mode=""></image>
 				<view>
 					添加设备
+					
 				</view>
+				
 			</view>
 		</view>
 		<!-- <view class="swiper" v-if="undeviceId">
@@ -105,6 +107,7 @@
 		},
 		data() {
 			return {
+				checked:false,
 				// equipmentList: [{
 				// 	id: 11,
 				// 	name: '王艺涵',

+ 28 - 0
project.config.json

@@ -0,0 +1,28 @@
+{
+  "appid": "wx63c280fe3248a3e7",
+  "compileType": "miniprogram",
+  "libVersion": "3.4.9",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "setting": {
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "enhance": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmRelationList": [],
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    }
+  },
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  }
+}

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "projectname": "yyky_new_app",
+  "setting": {
+    "compileHotReLoad": true
+  }
+}

+ 1 - 1
uni.scss

@@ -11,7 +11,7 @@
  *
  * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  */
-
+@import 'uview-ui/theme.scss';
 /* 颜色变量 */
 
 /* 行为相关颜色 */