yanjing 2 лет назад
Родитель
Сommit
40354864a6
7 измененных файлов с 183 добавлено и 23 удалено
  1. 16 12
      app.json
  2. 69 0
      pages/address/index.js
  3. 15 0
      pages/address/index.json
  4. 55 0
      pages/address/index.wxml
  5. 13 0
      pages/address/index.wxss
  6. 8 11
      project.config.json
  7. 7 0
      project.private.config.json

+ 16 - 12
app.json

@@ -2,7 +2,8 @@
   "pages": [
     "pages/index/index",
     "pages/search/index",
-    "pages/me/me"
+    "pages/me/me",
+    "pages/address/index"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -13,17 +14,20 @@
   "tabBar": {
     "color": "#CBCBCB",
     "selectedColor": "#F9872C",
-    "list": [{
-      "pagePath": "pages/index/index",
-      "text": "首页",
-      "iconPath": "/images/icon/index.png",
-      "selectedIconPath": "/images/icon/index-select.png"
-    }, {
-      "pagePath": "pages/me/me",
-      "text": "我的",
-      "iconPath": "/images/icon/me.png",
-      "selectedIconPath": "/images/icon/me-select .png"
-    }]
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "text": "首页",
+        "iconPath": "/images/icon/index.png",
+        "selectedIconPath": "/images/icon/index-select.png"
+      },
+      {
+        "pagePath": "pages/me/me",
+        "text": "我的",
+        "iconPath": "/images/icon/me.png",
+        "selectedIconPath": "/images/icon/me-select .png"
+      }
+    ]
   },
   "usingComponents": {
     "van-button": "@vant/weapp/button"

+ 69 - 0
pages/address/index.js

@@ -0,0 +1,69 @@
+// pages/address/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    checked: true,
+  },
+  onChange({ detail }) {
+    // 需要手动对 checked 状态进行更新
+    this.setData({ checked: detail });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 15 - 0
pages/address/index.json

@@ -0,0 +1,15 @@
+{
+  "usingComponents": {
+    "van-field": "@vant/weapp/field/index",
+    "van-icon": "@vant/weapp/icon/index",
+    "van-radio": "@vant/weapp/radio/index",
+    "van-radio-group": "@vant/weapp/radio-group/index",
+    "van-switch": "@vant/weapp/switch/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index",
+    "van-button": "@vant/weapp/button/index",
+    "van-row": "@vant/weapp/row/index",
+    "van-col": "@vant/weapp/col/index"
+  },
+  "navigationBarTitleText": "修改地址"
+}

+ 55 - 0
pages/address/index.wxml

@@ -0,0 +1,55 @@
+<view class="box">
+  <view class="content">
+    <van-cell-group>
+      <van-field
+        value="{{ name }}"
+        clearable
+        label="姓名"
+        placeholder="请填写姓名"
+      />
+      <van-field
+        value="{{ phone }}"
+        label="手机号"
+        placeholder="请填写手机号"
+        type="number"
+      />
+      <van-cell title="性别" value="{{ sex }}" title-width="100px" class="simulate-field">
+        <van-radio-group v-model="chargeType" direction="horizontal"  bind:change="onChange">
+            <van-radio name="0" checked-color="#F88300">男</van-radio>
+            <van-radio name="1" checked-color="#F88300">女</van-radio>
+        </van-radio-group>
+      </van-cell>
+      <van-field
+        value="{{ address }}"
+        label="收货地址"
+        placeholder="请点击选择地址"
+        is-link
+        bind:click-icon="selectaddress"
+      />
+      <van-field
+        value="{{ number }}"
+        label="门牌号"
+        placeholder="例:1号公寓2门312"
+      />
+      <van-cell title="设置默认" value="{{ default }}" 
+       size="small" >
+        <van-switch checked="{{ checked }}" 
+        bind:change="onChange"   size="20px"
+        active-color="#0D9C2B"
+        inactive-color="fff"
+        checked="{{checked}}"
+        />
+      </van-cell>
+    </van-cell-group>
+  </view>
+  <view class="button">
+    <van-row>
+      <van-col span="9" offset="2">
+        <van-button round type="info" block color="#999999"  size="small">删除</van-button>
+      </van-col>
+      <van-col span="9" offset="2">
+        <van-button round type="info" block color="#F88300"  size="small">保存</van-button>
+      </van-col>
+    </van-row>
+  </view>
+</view>

+ 13 - 0
pages/address/index.wxss

@@ -0,0 +1,13 @@
+Page{
+  background-color: #F4F4F4;
+}
+.box{
+  color: white;
+  padding-top: 10rpx;
+  padding-left: 10rpx;
+}
+.button{
+  position: fixed;
+  bottom: 20px;
+  width: 100%;
+}

+ 8 - 11
project.config.json

@@ -1,9 +1,5 @@
 {
   "description": "项目配置文件",
-  "packOptions": {
-    "ignore": [],
-    "include": []
-  },
   "setting": {
     "bundle": false,
     "userConfirmedBundleSwitch": false,
@@ -24,8 +20,6 @@
     "nodeModules": false,
     "enhance": true,
     "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
     "showShadowRootInWxmlPanel": true,
     "packNpmManually": true,
     "enableEngineNative": false,
@@ -43,15 +37,18 @@
       "disablePlugins": [],
       "outputPath": ""
     },
-    "condition": false
+    "condition": false,
+    "ignoreUploadUnusedFiles": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.19.4",
-  "appid": "wxc06fe0355f1e6452",
-  "projectname": "miniprogram-92",
   "condition": {},
   "editorSetting": {
     "tabIndent": "insertSpaces",
     "tabSize": 2
-  }
+  },
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wx5cb55b328049406b"
 }

+ 7 - 0
project.private.config.json

@@ -28,6 +28,13 @@
           "query": "",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/address/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }