zhangzihan 2 years ago
parent
commit
8f48d7fe15

+ 1 - 4
app.json

@@ -1,5 +1,6 @@
 {
   "pages": [
+    "pages/change/change",
     "pages/log-on/log-on",
     "pages/index/index",
     "pages/logs/logs",
@@ -12,16 +13,13 @@
     "pages/order_search/order_search",
     "pages/add/add",
     "pages/Store-Management/Store-Management"
-    
   ],
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",
-
     "navigationBarTitleText": "Weixin",
     "navigationBarTextStyle": "black"
   },
-  
   "tabBar": {
     "list": [
       {
@@ -59,6 +57,5 @@
     "van-icon": "@vant/weapp/icon/index",
     "van-calendar": "@vant/weapp/calendar/index"
   },
- 
   "sitemapLocation": "sitemap.json"
 }

+ 0 - 0
pages/images/上传图片.svg → images/上传图片.svg


+ 0 - 0
pages/images/个人.svg → images/个人.svg


+ 0 - 0
pages/images/返回.png → images/返回.png


+ 8 - 0
pages/Store-Management/Store-Management.js

@@ -33,6 +33,14 @@ Page({
           },
       ]
   },
+  return(event){
+    wx.switchTab({
+      url: '/pages/me/me',
+      success: (result)=>{},//成功回调
+      fail: ()=>{},//失败回调
+      complete: ()=>{},//无论成功还是失败都会执行
+  })
+},
   checkboxChange(e) {
       // console.log('checkbox发生change事件,携带value值为:', e.detail.value)
       const items = this.data.items

+ 1 - 1
pages/Store-Management/Store-Management.wxml

@@ -1,5 +1,5 @@
 <view class="top">
-  <image src="/pages/images/返回.png" mode="" class="return" bindtap="return" />
+  <image src="/images/返回.png" mode="" class="return" bindtap="return" />
   <text class="top-title">商品管理</text>
   <view class="top-button" bindtap="change">+ 添加商品</view>
 </view>

+ 1 - 1
pages/add/add.wxml

@@ -5,7 +5,7 @@
   <view class="store-pic">
     <text class="store-pic-con">商品图片</text>
     <view class="store-pic-right">
-      <image src="/pages/images/上传图片.svg" mode="" class="store-pic-right-img" />
+      <image src="/images/上传图片.svg" mode="" class="store-pic-right-img" />
       <text class="store-pic-right-go">上传照片</text>
     </view>
   </view>

+ 0 - 1
pages/add/add.wxss

@@ -130,5 +130,4 @@
   display: flex;
   justify-content: space-around;
   margin-top: 270rpx;
-
 }

+ 93 - 0
pages/change/change.js

@@ -0,0 +1,93 @@
+// pages/change/change.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+        name:'麻辣烫重麻重辣',
+        price:'¥5.00',
+        message:'麻辣烫中麻中辣',
+        maxTextLen: 15,
+        textLen:7,
+  },
+  getIntroduce(e){
+    let page = this;
+    //设置最大字符串长度(为-1时,则不限制)
+    let maxTextLen = page.data.maxTextLen;
+    //文本长度
+    let textLen = e.detail.value.length;
+
+    page.setData({
+      maxTextLen : maxTextLen,
+      textLen: textLen
+    });
+  },
+  getTitle(e){
+    let page = this;
+    //设置最大字符串长度(为-1时,则不限制)
+    let maxTitleLen = page.data.maxTitleLen;
+    //文本长度
+    let textLen = e.detail.value.length;
+
+    page.setData({
+      maxTitleLen : maxTitleLen,
+      textLen: textLen
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 6 - 0
pages/change/change.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationStyle": "custom",
+  "navigationBarTitleText": "添加商品",
+  "navigationBarRightButton":{"hide":true}
+}

+ 31 - 0
pages/change/change.wxml

@@ -0,0 +1,31 @@
+<view class="top">
+  <text class="top-title">修改管理</text>
+</view>
+<view class="main">
+  <view class="store-pic">
+    <text class="store-pic-con">商品图片</text>
+    <image src="/images/tupian2.png" mode=""class="store-pic-right"/>
+  </view>
+  <view class="store-name">
+    <text class="store-pic-con">商品名称</text>
+    <view class="line"></view>
+    <view class="search">
+      <input type="text" placeholder="{{name}}" class="search-text" />
+    </view>
+    <view class="store-price">
+      <text class="store-pri-con">商品价格</text>
+      <view class="search">
+        <input type="number" placeholder="{{price}}" class="search-pri-text" />
+      </view>
+    </view>
+  </view>
+  <view class="store-content">
+    <text class="store-pri-content">商品内容</text>
+    <textarea bindinput="getIntroduce" maxlength='{{maxTextLen}}' class="theme-content" placeholder="{{message}}"/>
+  <view class="introduce-number">{{textLen}}/{{maxTextLen}}</view>
+  </view>
+  <view class="btn">
+    <van-button round size="normal" color="#A9A9A9">保存</van-button>
+    <van-button round size="normal" color="#FF8C00">提交</van-button>
+  </view>
+</view>

+ 131 - 0
pages/change/change.wxss

@@ -0,0 +1,131 @@
+.top{
+  height: 3rem;
+  margin-top: 2.3rem;
+  width: 100%;
+  position: relative;
+  z-index: 0;
+}
+.top-title{
+ line-height: 1.75rem;
+ box-sizing: border-box;
+ margin-left: 9.5rem;
+ float: left;
+ font-weight: 600;
+ color: #333333;
+ font-size: large;
+}
+.main{
+  background-color: rgb(223, 222, 222);
+  height:36.5rem;
+  width: 100%;
+}
+.store-pic{
+  width: 100%;
+  height: 8rem;
+  background-color: white;
+  position: relative;
+  top: 1rem;
+}
+.store-pic-con{
+  position: relative;
+  top: 1rem;
+  left: 1rem;
+  font-weight: 600;
+  color: #111111;
+}
+.store-pic-right{
+  width: 9rem;
+  height: 5rem;
+  float: right;
+  position: relative;
+  top: 1rem;
+  right: 1rem;
+}
+.store-pic-right-go{
+  font-size:0.8rem;
+  position: relative;
+  top: 1.7rem;
+  left: 1rem;
+}
+.store-name{
+  width: 100%;
+  height: 6rem;
+  background-color: white;
+  position: relative;
+  top: 2rem;
+  position: relative;
+}
+.line{
+  height: 0.1rem;
+  width: 22rem;
+  background-color: rgb(223, 222, 222);
+  position: relative;
+  top: 1rem;
+  margin: 0.3rem 0.8rem;
+}
+.search{
+  margin:1rem -0.5rem;
+}
+.search-text{
+  border-radius: 0.3rem;
+  line-height: 1.5rem;
+  padding-left: 1.5rem;
+  height: 3rem;
+}
+.store-price{
+  background-color: white;
+  width: 100%;
+  height: 3rem;
+}
+.store-pri-con{
+  position: relative;
+  top: 0.8rem;
+  left: 1rem;
+  font-weight: 600;
+  display: inline-block;
+  float: left;
+}
+.search-pri-text{
+  float: left;
+  display: inline-block;
+  position: relative;
+  left: 14rem;
+   top: 0.7rem;
+  color: red;
+}
+.store-content{
+  background-color: white;
+  width: 100%;
+  height: 10rem;
+  position: relative;
+  top: 6.5rem;
+}
+.store-pri-content{
+  position: relative;
+  top: 0.7rem;
+  right: 13.9rem;
+  font-weight: 600;
+  display: inline-block;
+}
+.theme-content{
+  border: 0.05rem solid rgb(134, 134, 134);
+  padding: 0.125rem;
+  height: 6rem;
+  margin: 1rem;
+  margin-bottom: 0.5rem;
+  border-radius: 0.5rem; 
+  width: 20rem;
+  position: relative;
+  left: 1rem;
+  top: 0.7rem;
+}
+.introduce-number{
+  position: relative;
+  left: 19.8rem;
+  top: -2rem;
+}
+.btn{
+  display: flex;
+  justify-content: space-around;
+  margin-top: 270rpx;
+}

+ 1 - 1
pages/log-on/log-on.wxml

@@ -2,7 +2,7 @@
   <text class="top-title">登录</text>
 </view>
 <view class="hair">
-  <image src="/pages/images/个人.svg" mode="" class="hair-image"/>
+  <image src="/images/个人.svg" mode="" class="hair-image"/>
 </view>
 <view class="search">
   <input type="text" placeholder="输入你的账号" type="number" class="search-text"/>

+ 8 - 1
pages/me/me.js

@@ -9,7 +9,14 @@ Page({
       {url:'../../images/tupian2.png'}
     ]
   },
-
+  goshopmessage(event){
+    wx.navigateTo({
+      url: '/pages/Store-Management/Store-Management',
+      success: (result)=>{},//成功回调
+      fail: ()=>{},//失败回调
+      complete: ()=>{},//无论成功还是失败都会执行
+  })
+},
   /**
    * 生命周期函数--监听页面加载
    */

+ 1 - 1
pages/me/me.wxml

@@ -19,7 +19,7 @@
 
   <view>
     <view style="margin-bottom: 20rpx;">
-      <van-cell is-link icon="/images/shangpin.svg" title-class="title" title="商品管理" link-type="navigateTo" url="/pages/Store-Management/Store-Management" />
+      <van-cell is-link icon="/images/shangpin.svg" title-class="title" title="商品管理" link-type="navigateTo" url="/pages/Store-Management/Store-Management" bindtap="goshopmessage"/>
     </view>
 
     <view style="margin-bottom: 20rpx;">