jiasiqi 2 tahun lalu
induk
melakukan
97fdec8f9d

+ 17 - 9
app.json

@@ -4,7 +4,8 @@
     "pages/settlement/settlement",
     "pages/index/index",
     "pages/logs/logs",
-    "pages/my/my"
+    "pages/my/my",
+    "pages/newuser/newuser"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -12,22 +13,29 @@
     "navigationBarTitleText": "Weixin",
     "navigationBarTextStyle": "black"
   },
-  "tabBar":{
-    "selectedColor":"#EA986C",
-    "list":[{
-        "pagePath":"pages/homePage/homePage",
+  "tabBar": {
+    "selectedColor": "#EA986C",
+    "list": [
+      {
+        "pagePath": "pages/homePage/homePage",
         "text": "首页",
         "iconPath": "pages/homePage/shouye.png",
         "selectedIconPath": "pages/homePage/shouye1.png"
-      },{
-        "pagePath":"pages/my/my",
+      },
+      {
+        "pagePath": "pages/my/my",
         "text": "我的",
         "iconPath": "pages/homePage/wode.png",
         "selectedIconPath": "pages/homePage/wode1.png"
-      }]
+      }
+    ]
   },
   "usingComponents": {
-    "van-button": "@vant/weapp/button"
+    "van-button": "@vant/weapp/button",
+    "van-picker": "@vant/weapp/picker/index",
+    "van-field": "@vant/weapp/field/index",
+    "van-panel": "@vant/weapp/panel/index",
+    "van-popup": "@vant/weapp/popup/index"
   },
   "sitemapLocation": "sitemap.json"
 }

+ 115 - 0
pages/newuser/newuser.js

@@ -0,0 +1,115 @@
+// 定义年、月、日的数组都为空
+const date = new Date()
+const years = []
+const months = []
+const days = []
+// 获取年
+for (let i = 1990; i <= date.getFullYear(); i++) {
+years.push(i)
+}
+// 获取月份
+for (let i = 1; i <= 12; i++) {
+months.push(i)
+}
+// 获取日期
+for (let i = 1; i <= 31; i++) {
+days.push(i)
+}
+
+
+Page({
+  data: {
+    // 身份选择器
+    show:false,     //控制弹出层是否弹出的值
+    columns: ['学生','老师'],   //选择器中的值
+    gender:'',  //选择身份之后的值进行页面显示
+    // 时间选择器
+    showtime:false,
+    years,
+    year: date.getFullYear(),
+    months,
+    month: 2,
+    days,
+    day: 2,
+    value: [9999, 1, 1],
+    // 专业选择器
+    showproject:false,     //控制弹出层是否弹出的值
+    columns2: ['计算机科学与技术','软件工程','物联网工程'],   //选择器中的值
+    project:'',  //选择身份之后的值进行页面显示
+
+    // 美食偏好
+    showhobby:false,
+    columns3: ['快餐便当','米粉面馆','地方菜系','炸鸡汉堡'],   //选择器中的值
+    hobby:'',  //选择身份之后的值进行页面显示
+
+
+  
+  },
+  // 身份选择器
+  showPopup(e){      //点击选择身份,打开弹出层(选择器)
+       this.setData({show:true})
+      //  this.setData({show:true})
+     },
+  // 专业选择器
+  showProject(p){    
+      this.setData({showproject:true})
+     //  this.setData({show:true})
+    },
+  // 美食偏好
+  showHobby(h){    
+    this.setData({showhobby:true})
+   //  this.setData({show:true})
+  },
+  onClose() {     //点击空白处开闭弹出层(选择器)及选择器左上角的取消
+     this.setData({ show: false });
+     this.setData({showtime:false});
+     this.setData({showproject:false});
+     this.setData({showhobby:false});
+     
+   },
+  onConfirm(e){    //选择器右上角的确定,点击确定获取值
+    this.setData({
+      gender:e.detail.value,
+      show:false
+    });
+  },
+  onConfirm2(p){    //选择器右上角的确定,点击确定获取值
+    this.setData({
+      project:p.detail.value,
+      showproject:false
+    });
+  },
+  onConfirm3(h){    //选择器右上角的确定,点击确定获取值
+    this.setData({
+      hobby:h.detail.value,
+      showhobby:false
+    });
+  },
+
+ submitNewStuInfo(e){
+   //表单输入框提交的内容包含在e参数中
+ },
+ submitNewStuInfo(p){
+  //表单输入框提交的内容包含在e参数中
+},
+submitNewStuInfo(h){
+  //表单输入框提交的内容包含在e参数中
+},
+//  时间选择器
+showPopuptime(el){      //点击选择身份,打开弹出层(选择器)
+  this.setData({showtime:true});
+},
+ bindChange(el) {
+  const val = el.detail.value
+  this.setData({
+  year: this.data.years[val[0]],
+  month: this.data.months[val[1]],
+  day: this.data.days[val[2]],
+  show:false,
+  });
+  },
+  submitNewStuInfo(el){
+    //表单输入框提交的内容包含在el参数中
+  },
+
+});

+ 16 - 0
pages/newuser/newuser.json

@@ -0,0 +1,16 @@
+{
+  "usingComponents": {
+
+    "van-picker": "@vant/weapp/picker/index",
+    "van-field": "@vant/weapp/field/index",
+    "van-panel": "@vant/weapp/panel/index",
+    "van-button": "@vant/weapp/button/index",
+    "van-popup": "@vant/weapp/popup/index",
+    "van-datetime-picker": "@vant/weapp/datetime-picker/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index"
+
+  },
+  "navigationBarTitleText":"新用户认证"
+
+}

+ 156 - 0
pages/newuser/newuser.wxml

@@ -0,0 +1,156 @@
+<!--pages/newuser/newuser.wxml-->
+<!-- <text>pages/newuser/newuser.wxml</text> -->
+<view class="pagetop">
+
+
+      <van-cell-group >
+        <van-cell title="完善信息" label="请填写以下个人信息" size="large"/>
+        <van-field
+          value="{{ name }}"
+          required
+          clearable
+          label="姓名"
+          placeholder="请输入用户名"
+          size="large"
+
+        />
+
+        <van-field
+          value="{{ iphone }}"
+          type="iphone"
+          label="手机号"
+          placeholder="请输入手机号"
+          required
+          border="{{ false }}"
+          size="large"
+        />
+        <van-field
+          value="{{ id }}"
+          type="id"
+          label="身份证号"
+          placeholder="请输入身份证号"
+          required
+          border="{{ false }}"
+          size="large"
+        />
+      </van-cell-group>
+</view>
+<view class="middle">
+
+  <van-cell-group>
+  <!-- 身份选择器 -->
+    <view bindtap="showPopup">
+    <van-field
+      label="请选择身份"
+      title-width="5em"
+      input-align="right"
+      placeholder="请选择"
+      value="{{gender}}"
+      size="large"
+      required
+      readonly
+      is-link
+    />
+    </view>
+    <van-field
+            value="{{ school }}"
+            required
+            clearable
+            label="学校"
+            placeholder="请填写学校全称"
+            size="large"
+
+          />
+    <view bindtap="showPopuptime">
+    <van-field
+      label="入学时间"
+      title-width="5em"
+      input-align="right"
+      placeholder="请选择"
+      value="{{year}}年{{month}}月{{day}}日"
+      size="large"
+      required
+      readonly
+      is-link
+    />
+    </view>
+
+
+    <view bindtap="showProject">
+    <van-field
+      label="专业"
+      title-width="5em"
+      input-align="right"
+      placeholder="请选择"
+      value="{{project}}"
+      size="large"
+      required
+      readonly
+      is-link
+    />
+    </view>
+
+    <view bindtap="showHobby">
+    <van-field
+      label="美食偏好"
+      title-width="5em"
+      input-align="right"
+      placeholder="请选择"
+      value="{{hobby}}"  
+      size="large"   
+      readonly
+      is-link
+    />
+    </view>
+  </van-cell-group>
+</view>
+
+<view>
+<!-- 选择日期 -->
+<van-popup show="{{ showtime }}" bind:close="onClose"  position="bottom"
+  custom-style="height: 40%">
+    <picker-view
+    indicator-style="height: 60px;"
+    style="width: 100%; height: 300px; margin-left: 50px;"
+    value="{{value}}"
+    bindchange="bindChange"
+    >
+      <picker-view-column>
+      <view wx:for="{{years}}" wx:key='{{index}}' style="line-height: 50px">{{item}}年</view>
+      </picker-view-column>
+
+      <picker-view-column>
+      <view wx:for="{{months}}" wx:key='{{index}}' style="line-height: 50px">{{item}}月</view>
+      </picker-view-column>
+
+      <picker-view-column>
+      <view wx:for="{{days}}" wx:key='{{index}}' style="line-height: 50px">{{item}}日</view>
+      </picker-view-column>
+  </picker-view>
+  </van-popup>
+  </view>
+
+  <!-- 选择身份 -->
+<van-popup show="{{ show }}" bind:close="onClose"  position="bottom"
+  custom-style="height: 40%">
+    <van-picker title="选择身份" show-toolbar columns="{{ columns }}"  bind:cancel="onClose"
+  bind:confirm="onConfirm"/>
+</van-popup>
+<!-- 选择专业 -->
+<van-popup show="{{ showproject }}" bind:close="onClose"  position="bottom"
+  custom-style="height: 40%">
+    <van-picker title="选择专业" show-toolbar columns="{{ columns2 }}"  bind:cancel="onClose"
+  bind:confirm="onConfirm2"/>
+</van-popup>
+
+<!-- 美食偏好 -->
+<van-popup show="{{ showhobby }}" bind:close="onClose"  position="bottom"
+  custom-style="height: 40%">
+    <van-picker title="选择偏好" show-toolbar columns="{{ columns3 }}"  bind:cancel="onClose"
+  bind:confirm="onConfirm3"/>
+</van-popup>
+
+
+<view class="bottom">
+  <van-button round type="primary" size="large" color="#7F7C7C">提交</van-button>
+</view>

+ 12 - 0
pages/newuser/newuser.wxss

@@ -0,0 +1,12 @@
+/* pages/newuser/newuser.wxss */
+/* .pagetop{
+  background: black;
+  height: 100rpx;
+  width:100%;
+} */
+.bottom{
+  margin-top: 150px;
+}
+/* .button{
+  font-size: 20px;
+} */ 

+ 1 - 1
project.config.json

@@ -47,7 +47,7 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.19.4",
-  "appid": "wxa4d74978f7ec4e2d",
+  "appid": "wxf2ccb10daea97192",
   "projectname": "miniprogram-92",
   "condition": {},
   "editorSetting": {

+ 16 - 3
project.private.config.json

@@ -1,8 +1,21 @@
 {
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "projectname": "miniprogram",
+  "projectname": "delivery-customer",
   "setting": {
-    "compileHotReLoad": true
+    "compileHotReLoad": false
   },
-  "libVersion": "2.19.6"
+  "libVersion": "2.17.0",
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "newuser",
+          "pathName": "pages/newuser/newuser",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
 }