Browse Source

vip通道

wangyong 6 years ago
parent
commit
85b181e21e

+ 111 - 33
customized/pages/index/index.js

@@ -8,40 +8,46 @@ Page({
    * 页面的初始数据
    */
   data: {
+    Length: 6,        //输入框个数
+    isFocus: true,    //聚焦
+    Value: "",        //输入的内容
+    ispassword: true, //是否密文显示 true为密文, false为明文。
+    pwdStatic:false, // 密码状态框,是否显示
     carNum:null,
+    host:host,
     madeList:[
-      {
-      src:'/customized/images/customized/cup_black_small.png',
-      name:'奶缸-黑色 350ml',
-      price:'¥45.00',
-      btnText:'去定制',
-      btnDisabled:false,
-      state:true,
-      },
-      {
-        src: '/customized/images/customized/cup_black_small_2.png',
-        name: '奶缸-白色 350ml',
-        price: '¥45.00',
-        btnText: '去定制',
-        btnDisabled: true,
-        state: false,
-      },
-      {
-        src: '/customized/images/customized/cup_black_small_3.png',
-        name: '马克杯-白色 450ml',
-        price: '¥45.00',
-        btnText: '去定制',
-        btnDisabled: true,
-        state: false,
-      },
-      {
-        src: '/customized/images/customized/cup_black_small_4.png',
-        name: '马克杯-白色 300ml',
-        price: '¥45.00',
-        btnText: '去定制',
-        btnDisabled: true,
-        state: false,
-      }
+      // {
+      // src:'/customized/images/customized/cup_black_small.png',
+      // name:'奶缸-黑色 350ml',
+      // price:'¥45.00',
+      // btnText:'去定制',
+      // btnDisabled:false,
+      // state:true,
+      // },
+      // {
+      //   src: '/customized/images/customized/cup_black_small_2.png',
+      //   name: '奶缸-白色 350ml',
+      //   price: '¥45.00',
+      //   btnText: '去定制',
+      //   btnDisabled: true,
+      //   state: false,
+      // },
+      // {
+      //   src: '/customized/images/customized/cup_black_small_3.png',
+      //   name: '马克杯-白色 450ml',
+      //   price: '¥45.00',
+      //   btnText: '去定制',
+      //   btnDisabled: true,
+      //   state: false,
+      // },
+      // {
+      //   src: '/customized/images/customized/cup_black_small_4.png',
+      //   name: '马克杯-白色 300ml',
+      //   price: '¥45.00',
+      //   btnText: '去定制',
+      //   btnDisabled: true,
+      //   state: false,
+      // }
     ]
   },
 
@@ -63,7 +69,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    this.getCarlist(this)
+    let data = this.data.Value ? {channalPwd: this.data.Value}: false
+    this.getMadeList(this,data); // 获取商品列表
+    this.getCarlist(this);//获取购物车列表
   },
 
   /**
@@ -135,4 +143,74 @@ Page({
       }
     })
   },
+  getMadeList(that,data){ // 获取列表
+    wx.showLoading({
+      title: '加载中...',
+    })
+    wx.request({
+      url: host+ '/custom/queryNotOpenCustomGoodsByPwd',
+      method:'get',
+      header: {
+        'content-type': 'application/x-www-form-urlencoded'
+      },
+      data:data? data:{},
+      success(res){
+        console.log(res)
+        if(res.data.length === 0 && data){
+          wx.showToast({
+            title: '密码输入错误',
+            icon:'none'
+          })
+        } else {
+          that.setData({
+            madeList: [...res.data]
+          })
+        }
+       
+      },
+      fail(err){
+        console.log(err)
+      },
+      complete(){
+        console.log('完成');
+        wx.hideLoading()
+      }
+    })
+  },
+  vipBtn(){ // 表示是vip操作
+    this.setData({
+      pwdStatic:true
+    })
+  },
+  Focus(e) {
+    var that = this;
+    console.log(e.detail.value);
+    var inputValue = e.detail.value;
+    that.setData({
+      Value: inputValue,
+    })
+  },
+  Tap() {
+    var that = this;
+    that.setData({
+      isFocus: true,
+    })
+  },
+  fromDel(){
+    this.setData({
+      Value: "",
+    })
+  },
+  formSubmit(e) {
+    console.log(this.data.Value);
+    this.getMadeList(this,{
+      channalPwd: this.data.Value
+    })
+  },
+  close(){
+    this.setData({
+      pwdStatic:false
+    })
+  }
+
 })

+ 25 - 5
customized/pages/index/index.wxml

@@ -1,16 +1,16 @@
 <view class="auto">
   <view wx:for="{{madeList}}" class="f-box mar-t20 custom-list" data-state="{{item.state}}" bindtap='customized'>
     <view class='cust-img mar-r20 mar-l20 f-box f-align-items-center'>
-      <image src="{{item.src}}" mode="aspectFit"></image>
+      <image src="{{host}}/{{item.customgoodsNameImgJson}}" mode="aspectFit"></image>
     </view>
     <view class="f-item mar-l20 mar-t20 mar-r20">
     <view class='cup-main'>
-     <view class='f-s32 mar-t20'>{{item.name}}</view>
-      <view class="mar-t20 f-s30 c-orange">{{item.price}}</view>
+     <view class='f-s32 mar-t20'>{{item.customgoodsName}}</view>
+      <view class="mar-t20 f-s30 c-orange">{{item.customgoodsPriceNow}}</view>
      
      <view class='f-box mar-t20 f-s32 f-align-items-center'>
       <view class='f-item'>
-        <navigator class="{{item.btnDisabled ? 'disabled' : ''}} cust-btn  f-s30 c-green">{{item.btnText}}</navigator>
+        <navigator class="{{item.customgoodsIsAllow === '1' ? 'disabled' : ''}} cust-btn  f-s30 c-green">去定制</navigator>
        </view>
        <view class='tu-icon f-box f-align-items-center'>
         <image src='/customized/images/customized/tu_icon.png' mode="aspectFit"></image>
@@ -29,6 +29,10 @@
 <view class='footer'>
   <view class='footer-box'>
   <view class='cust-footer f-box f-justify-content-end'>
+  <view class='f-item'>
+  <navigator class='icon-VIP iconfont c-green' bindtap='vipBtn'></navigator>
+  </view>
+  
     <navigator open-type="switchTab" url='/pages/index/index' class='icon-shouye iconfont c-green'></navigator>
     <navigator url='/customized/pages/car/car' class='icon-gouwuche iconfont c-green icon-car'>
       <view class='car-num bg-green c-white' wx:if="{{carNum && carNum !=null}}">{{carNum}}</view>
@@ -38,6 +42,22 @@
   </view>
 </view>
 
-  
+
+
+<!-- 密码输入框 -->
+<view class='pwd-box' bindtap='close' wx:if="{{pwdStatic}}">
+<view class='pwd-main'>
+<view class='f-box content'>
+  <block wx:for="{{Length}}" wx:key="item">
+    <input class='iptbox' value="{{Value.length>=index+1?Value[index]:''}}" disabled password='{{ispassword}}' catchtap='Tap'></input>
+  </block>
+</view>
+  <input name="password" password="{{true}}" value='{{Value}}' class='ipt' maxlength="{{Length}}" focus="{{isFocus}}" bindinput="Focus" style='display:none'></input>
+  <view class='f-box btn-box'>
+    <view class="btn-area f-s32 btn-del" bindtap='fromDel'>删除</view>
+    <view class="btn-area f-s32 bg-orange c-white" bindtap='formSubmit'>确定</view>
+  </view>
+  </view>
+</view>
 
 

+ 58 - 1
customized/pages/index/index.wxss

@@ -19,7 +19,7 @@ page{
   border-radius:100%;
   text-align: center;
   line-height:70rpx;
-  margin-right:30rpx;
+  margin:0 15rpx;
 }
 .icon-car{
   position:relative;
@@ -60,4 +60,61 @@ page{
 }
 .cust-btn.disabled{
   background:#aaa;
+}
+
+/* 密码输入 */
+.pwd-box{
+  background:rgba(0,0,0,0.6);
+  width:100%;
+  height:100%;
+  position: fixed;
+  top:0;
+  left:0;
+  z-index:100;
+}
+.pwd-main{
+  /* height:300rpx; */
+  padding:50rpx 0;
+  width:100%;
+  position:fixed;
+  margin-top:150rpx;
+  background:#fff;
+}
+.content{
+  width:612rpx;
+  margin:0 auto;
+}
+.iptbox{
+  /* width: 100rpx; */
+  height: 100rpx;
+  border:2rpx solid #e0e0e0;
+  border-right:none;
+  /* border-radius: 20rpx; */
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  text-align: center;
+  background:#fff;
+}
+.iptbox:last-child{
+  border-right:2rpx solid #e0e0e0;
+}
+.ipt{
+  width: 0;
+  height: 0;
+}
+.btn-box{
+  width:612rpx;
+  margin:50rpx auto 0;
+}
+.btn-area{
+  margin:0 20rpx;
+  text-align: center;
+  width:100%;
+  height:80rpx;
+  line-height:80rpx;
+  border-radius:10rpx;
+}
+.btn-del{
+  border:2rpx solid #e0e0e0;
 }

+ 5 - 0
customized/pages/order/order.wxss

@@ -15,4 +15,9 @@
   height:70rpx;
   border-radius:6rpx;
   color:#fff;
+}
+.content{
+  background:#fff;
+  width:100%;
+  height:100rpx;
 }

+ 23 - 0
style/font/demo_index.html

@@ -79,6 +79,12 @@
               </li>
           
             <li class="dib">
+              <span class="icon iconfont">&#xe688;</span>
+                <div class="name">VIP</div>
+                <div class="code-name">&amp;#xe688;</div>
+              </li>
+          
+            <li class="dib">
               <span class="icon iconfont">&#xe61a;</span>
                 <div class="name">我的</div>
                 <div class="code-name">&amp;#xe61a;</div>
@@ -231,6 +237,15 @@
           </li>
           
           <li class="dib">
+            <span class="icon iconfont icon-VIP"></span>
+            <div class="name">
+              VIP
+            </div>
+            <div class="code-name">.icon-VIP
+            </div>
+          </li>
+          
+          <li class="dib">
             <span class="icon iconfont icon-wode"></span>
             <div class="name">
               我的
@@ -370,6 +385,14 @@
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-VIP"></use>
+                </svg>
+                <div class="name">VIP</div>
+                <div class="code-name">#icon-VIP</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-wode"></use>
                 </svg>
                 <div class="name">我的</div>

File diff suppressed because it is too large
+ 10 - 6
style/font/iconfont.css


BIN
style/font/iconfont.eot


File diff suppressed because it is too large
+ 1 - 1
style/font/iconfont.js


File diff suppressed because it is too large
+ 3 - 0
style/font/iconfont.svg


BIN
style/font/iconfont.ttf


BIN
style/font/iconfont.woff


BIN
style/font/iconfont.woff2


File diff suppressed because it is too large
+ 10 - 6
style/iconfont.wxss