Explorar el Código

客户端第一次提交

zhanghaoran hace 2 años
padre
commit
fbe28c7ae1

+ 24 - 8
app.json

@@ -1,17 +1,33 @@
 {
-  "pages":[
+  "pages": [
+    "pages/homePage/homePage",
+    "pages/settlement/settlement",
     "pages/index/index",
-    "pages/logs/logs"
+    "pages/logs/logs",
+    "pages/my/my"
   ],
-  "window":{
-    "backgroundTextStyle":"light",
+  "window": {
+    "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",
     "navigationBarTitleText": "Weixin",
-    "navigationBarTextStyle":"black"
+    "navigationBarTextStyle": "black"
+  },
+  "tabBar":{
+    "selectedColor":"#EA986C",
+    "list":[{
+        "pagePath":"pages/homePage/homePage",
+        "text": "首页",
+        "iconPath": "pages/homePage/shouye.png",
+        "selectedIconPath": "pages/homePage/shouye1.png"
+      },{
+        "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"
   },
-
   "sitemapLocation": "sitemap.json"
-}
+}

+ 4 - 9
app.wxss

@@ -1,10 +1,5 @@
 /**app.wxss**/
-.container {
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: space-between;
-  padding: 200rpx 0;
-  box-sizing: border-box;
-} 
+.add-icon{
+  width: 2rpx;
+  height: 2rpx;
+}

+ 51 - 0
pages/homePage/homePage.js

@@ -0,0 +1,51 @@
+// pages/homePage/homePage.js
+Page({
+  data: {
+  },
+  onLoad(options) {
+  },
+
+  
+  onReady() {
+  },
+
+ 
+  onShow() {
+
+  },
+
+  
+  onHide() {
+
+  },
+
+  
+  onUnload() {
+
+  },
+
+  
+  onPullDownRefresh() {
+
+  },
+
+  
+  onReachBottom() {
+
+  },
+
+  
+  onShareAppMessage() {
+
+  },
+    onRmove(e){
+      wx.showModal({
+        title: '信息完善',
+        content: "为校园人员使用,新用户请完善个人信息。",
+        success(res) {},
+        fail(res) {},
+        showCancel: false,
+        confirmText: "确定", //默认是“确定”
+      })
+    }
+})

+ 4 - 0
pages/homePage/homePage.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"外卖小程序"
+}

+ 51 - 0
pages/homePage/homePage.wxml

@@ -0,0 +1,51 @@
+<view class="page">
+  <view class="sea">
+    <input type="text" placeholder="搜索商家名称" class="input1" />
+    <button class="btn1" bindtap="onRmove">搜索</button>
+  </view>
+
+  <view>
+    <image src="/pages/homePage/微信图片_20230507174346.jpg" class="img" />
+  </view>
+
+  <view class="desc"></view>
+
+  <view class="shop1">
+    <image src="https://img0.baidu.com/it/u=3283861449,672075529&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=400" class="shop-img" />
+    <view class="shop-msg">
+      <view class="msg">
+        <view class="name">二食堂二楼麻辣烫麻辣...</view>
+        <view class="ift">
+          <span class="grey">起送</span>
+          <span class="org">¥15</span>
+          <span class="grey">货到付款</span>
+          <span class="grey">月售</span>
+          <span class="org">231</span>
+          <view class="org orgg">30分钟</view>
+        </view>
+      </view>
+      <view class="score">¥ 积分有优惠</view>
+    </view>
+  </view>
+
+  <view class="desc"></view>
+
+  <view class="shop1">
+    <image src="https://img0.baidu.com/it/u=3283861449,672075529&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=400" class="shop-img" />
+    <view class="shop-msg">
+      <view class="msg">
+        <view class="name">二食堂二楼麻辣烫麻辣...</view>
+        <view class="ift">
+          <span class="grey">起送</span>
+          <span class="org">¥15</span>
+          <span class="grey">货到付款</span>
+          <span class="grey">月售</span>
+          <span class="org">231</span>
+          <view class="org orgg">30分钟</view>
+        </view>
+      </view>
+      <view class="score">¥ 积分有优惠</view>
+    </view>
+  </view>
+  <view class="desc"></view>
+</view>

+ 75 - 0
pages/homePage/homePage.wxss

@@ -0,0 +1,75 @@
+.btn1{
+  display: inline-block;
+  text-align: center;
+  background-color: #ff8e0a;
+  border-radius: 60rpx;
+  color: #fff;
+  font-size: 30rpx;
+}
+.input1{
+  font-size: 30rpx;
+  display: inline-block;
+  border: 1px solid #b9b2b2;
+  border-radius: 10px;
+  height: 60rpx;
+  width: 570rpx;
+  margin: 0 20rpx;
+}
+.sea{
+  display:flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.img{
+  margin: 30rpx;
+  height: 360rpx;
+  width: 690rpx;
+}
+.desc{
+  background-color:  #eee;
+  height: 20rpx;
+}
+.shop-img{
+  width: 240rpx; 
+  height: 140rpx;
+  margin: 20rpx;
+  display: inline-block;
+}
+.shop-msg{
+  display: inline-block;
+  margin: 20rpx 0;
+}
+.grey{
+  color:#b9b2b2;
+  font-size: 24rpx;
+}
+.org{
+  color:#ff8e0a;
+  font-size: 24rpx;
+}
+.msg{
+  margin: 20rpx 0;
+}
+.name{
+  font-size: 36rpx;
+}
+.ift{
+  display: flex;
+  justify-content: space-around;
+}
+.orgg{
+  width: 90rpx;
+  height: 30rpx;
+  background-color: #ff8e0a;
+  color:seashell;
+  text-align: center;
+}
+.score{
+  color:#ff8e0a;
+  background-color: #FFCC99;
+  width: 450rpx;
+  height: 30rpx;
+  font-size: 22rpx;
+  text-align: center;
+  margin: 60rpx 0 0 0;
+}

BIN
pages/homePage/shouye.png


BIN
pages/homePage/shouye1.png


BIN
pages/homePage/wode.png


BIN
pages/homePage/wode1.png


BIN
pages/homePage/微信图片_20230507174346.jpg


+ 66 - 0
pages/my/my.js

@@ -0,0 +1,66 @@
+// pages/my/my.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/my/my.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
pages/my/my.wxml

@@ -0,0 +1,2 @@
+<!--pages/my/my.wxml-->
+<text>pages/my/my.wxml</text>

+ 1 - 0
pages/my/my.wxss

@@ -0,0 +1 @@
+/* pages/my/my.wxss */

BIN
pages/settlement/dizhi.png


+ 31 - 0
pages/settlement/settlement.js

@@ -0,0 +1,31 @@
+// pages/settlement/settlement.js
+Page({
+  data: {
+    min: 0,//最少字数
+    max: 15, //最多字数 
+    currentWordNumber:0
+  },
+  inputs: function (e) {
+    // 获取输入框的内容
+    var value = e.detail.value;
+    // 获取输入框内容的长度
+    var len = parseInt(value.length);
+    console.log(len)
+    //最少字数限制
+    if (len <= this.data.min)
+      this.setData({
+        num:this.data.min-len
+      })
+    else if (len > this.data.min)
+      this.setData({
+        num:''
+      })
+    this.setData({
+      currentWordNumber: len //当前字数  
+    });
+ //最多字数限制
+ if (len > this.data.max) return;
+ // 当输入框内容的长度大于最大长度限制(max)时,终止setData()的执行
+      console.log(this.data)
+  }
+})

+ 4 - 0
pages/settlement/settlement.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"修改商品"
+}

+ 75 - 0
pages/settlement/settlement.wxml

@@ -0,0 +1,75 @@
+<!--pages/settlement/settlement.wxml-->
+<view class="address-container">
+  <view class="address-img">
+    <image src="./dizhi.png" class="add_icon" mode="scaleToFill" />
+  </view>
+  <view>
+    <view>哈尔滨师范大学第一公寓2门312室</view>
+    <view class="gray">吴迪(先生)182****2898</view>
+  </view>
+  <view class="gray">></view>
+</view>
+
+<view class="desc"></view>
+
+<view class="shop-container">
+  <view class="shop-name">二楼麻辣烫、麻辣香锅、麻辣拌饭</view>
+  <view class="line"></view>
+  <view class="food-msg">
+    <image src="https://img1.baidu.com/it/u=3706419765,551590657&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=300" class="food-img" />
+    <view class="msg">
+      <view class="name">麻辣烫微麻微辣</view>
+      <view class="num">*2</view>
+    </view>
+    <view class="integral">
+      <view class="pri-in">¥10.98+40积分</view>
+      <view class="pri">¥28.8</view>
+    </view>
+  </view>
+</view>
+
+<view class="line"></view>
+
+<view class="package-container">
+  <view class="package">包装费</view>
+  <view class="package-pri">¥0</view>
+</view>
+
+<view class="line"></view>
+
+<view class="package-container">
+  <view class="package">付款费</view>
+  <view class="package-pri">¥3</view>
+</view>
+
+<view class="line"></view>
+
+<view class="favo-container">
+  <view class="favo">
+    <span class="package">已优惠</span>
+    <span class="package-pri">10¥</span>
+    <span class="package">累计</span>
+    <span class="package-pri">21.8¥</span>
+  </view>
+</view>
+
+<view class="desc"></view>
+
+<view class="notes-container">
+  <view class="notes">备注</view>
+  <textarea minlength="{{min}}" maxlength="{{max}}"bindinput="inputs">
+    <text class="currentWordNumber">{{currentWordNumber}}/{{max}}</text>
+  </textarea>
+</view>
+
+<view class="desc"></view>
+
+<view class="foot">
+  <view>
+    <view class="total">累计</view>
+    <view class="package-pri">¥10.98</view>
+  </view>
+  <view>
+    <button class="btn1">提交订单</button>
+  </view>
+</view>

+ 165 - 0
pages/settlement/settlement.wxss

@@ -0,0 +1,165 @@
+/* pages/settlement/settlement.wxss */
+.add_icon {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.address-container {
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+}
+
+.gray {
+  font-size: 30rpx;
+  color: #666;
+}
+
+.desc {
+  height: 12rpx;
+  width: 100%;
+  background: #eee;
+  margin: 20rpx 0;
+}
+
+.food-img {
+  margin: 20rpx 20rpx;
+  width: 200rpx;
+  height: 125rpx;
+}
+
+.shop-name {
+  font-size: 30rpx;
+  font-style: normal;
+  margin: 20rpx 20rpx;
+}
+
+.line {
+  margin: 0 20rpx;
+  height: 4rpx;
+  background-color: #eee;
+}
+
+.msg {
+  height: 100%;
+  display: inline-block;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  margin: 20rpx 4rpx;
+}
+
+.num {
+  margin-top: 46rpx;
+  font-size: 28rpx;
+  color:#666;
+}
+
+.name {
+  font-size: 30rpx;
+}
+
+.integral {
+  display: inline-block;
+  margin: 20rpx 20rpx 0 0;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+  position: absolute;
+  right:0;
+}
+
+.food-msg {
+  display: flex;
+  align-items: flex-start;
+  position: relative;
+}
+.pri-in{
+  color:red;
+  font-size: 30rpx;
+}
+.pri{
+  font-size: 28rpx;
+  color:#666;
+}
+.package{
+  font-size: 28rpx;
+  color:#666;
+  display: inline-block;
+}
+.package-pri{
+  display: inline-block;
+  font-size: 28rpx;
+  color:red;
+}
+.package-container{
+  margin: 20rpx 20rpx;
+  display: flex;
+  justify-content: space-between;
+}
+.favo-container{
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+  margin: 20rpx ;
+}
+.notes{
+  display: inline-block;
+  font-size: 28rpx;
+  margin: 20rpx;
+}
+textarea{
+  background-color: #eee;
+  border-radius: 5px;
+  margin: 20rpx;
+  padding: 10rpx;
+  box-sizing: border-box;
+  width: 80%;
+  height:200rpx;
+  color: #666;
+  font-size: 28rpx;
+  display: inline-block;
+  position: relative;
+}
+.notes-container{
+  display: flex;
+  justify-content: center;
+  position: relative;
+}
+.total{
+  font-size: 28rpx;
+  display: inline-block;
+  margin: 20rpx 20rpx; 
+}
+.btn1{
+  margin: 20rpx 20rpx;
+  display: inline-block;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  background-color: #ff8e0a;
+  color: #fff;
+  border-radius: 30px;
+}
+.foot{
+  display: flex;
+  justify-content: center;
+  justify-content: space-between
+}
+.currentWordNumber{
+  font-size: 28rpx;
+  color: gray;
+  position: absolute;
+  position: absolute;
+  right:0;
+  bottom: 0;
+  margin:15rpx
+}
+.hint{
+   font-size: 28rpx;
+   position: absolute;
+   top: 130rpx;
+   left: 320rpx;
+   color: #FF6600;
+}
+

BIN
pages/settlement/sousuo.png


+ 1 - 1
project.config.json

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

+ 1 - 1
project.private.config.json

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