Przeglądaj źródła

小程序前端修改

hyq 6 lat temu
rodzic
commit
b91becb58c

+ 1 - 1
wx-mall/pages/auth/newuser/newuser.js

@@ -75,7 +75,7 @@ Page({
       return false;
     }
     util.request(api.smscodeSend, {
-      phone: that.data.phone
+      mobile: that.data.phone
     }, 'POST').then(function (res) {
       let n = 59;
       var timer = setInterval(function () {

+ 2 - 0
wx-mall/pages/cart/cart.wxml

@@ -27,6 +27,8 @@
       <view class="group-item">
         <view class="goods">
           <view class="item" wx:for="{{cartGoods}}" wx:key="{{item.id}}">
+            <view class='title_'>
+            <text class="title-name">{{item.goodsBizType}}</text> </view>
             <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
             <view class="cart-goods">
               <navigator url="/pages/goods/goods?id={{item.goods_id}}">

+ 17 - 1
wx-mall/pages/cart/cart.wxss

@@ -117,7 +117,7 @@ page {
 }
 
 .cart-view .item {
-  height: 200rpx;
+  height: 240rpx;
   width: 100%;
   overflow: hidden;
 }
@@ -635,4 +635,20 @@ page {
   flex: 1;
   text-align: center;
   color: #fff;
+}
+
+.title-name {
+  width: 100%;
+  text-align: center;
+  font-size: 28rpx;
+  color: rgba(87, 86, 86, 0.63);
+  background:url(http://image.meiping123.com/upload/20180104/1055343561cd30.png) no-repeat center 205rpx;
+  background-size: 100rpx 100rpx;
+  margin-bottom: 10rpx;
+  margin-left: 30rpx;
+  font-weight: bolder;
+}
+.title_{
+  height: 20rpx;
+  margin-top: 10rpx;
 }

+ 3 - 3
wx-mall/pages/catalog/catalog.wxml

@@ -58,13 +58,13 @@
   <view class="activity">
     <view class="activity-box">
       <view class="item {{filterDiscount == 0 ? 'active' : ''}}" bindtap="openSortFilter" id="defaultActivity">
-        <text class="txt">不限</text>
+        <text class="txt">保税仓</text>
       </view>
       <view class="item by-sell {{filterDiscount == 1 ? 'active' : ''}}" bindtap="openSortFilter" id="discountActivity">
-        <text class="txt">今日特价</text>
+        <text class="txt">保税展示</text>
       </view>
       <view class="item by-price {{filterDiscount == 2 ? 'active' : ''}}" bindtap="openSortFilter" id="groupActivity">
-        <text class="txt">活动</text>
+        <text class="txt">现场速递</text>
       </view>
     </view>
   </view>

+ 2 - 2
wx-mall/pages/goods/goods.wxml

@@ -49,7 +49,7 @@
     </view>
     <view class="goods-info">
       <view class="c">
-        <text class="name">{{goods.name}}</text>
+        <text class="name">{{goods.goodsBizType}} {{goods.name}}</text>
         <text class="desc">{{goods.goods_brief}}</text>
         <view class="goods-do">
           <text class="price">¥{{goods.retail_price}}</text>
@@ -80,7 +80,7 @@
           </navigator>
 
           <view class="goods-do">
-            <text class="price">¥{{item.retail_crash_price}}</text>
+            <text class="price">¥{{item.market_price}}</text>
             <text class="org-price line-through">¥{{item.retail_price}}</text>
             <view class="add" data-goods-id="{{item.goods_crash_id}}" data-product-id="{{item.product_crash_id}}" bindtap="addCrashNumber">+</view>
           </view>

+ 1 - 0
wx-mall/pages/groupDetail/groupDetail.wxml

@@ -60,6 +60,7 @@
             <text class="price-desc">{{group.min_open_group}}人拼团  拼团立省¥{{group.retail_price - group.retail_min_price}}</text>
           </view>
         </view>
+        <!-- <text class='bizType'>{{goods.goodsBizType}}</text> -->
         <text class="name">{{goods.name}}</text>
         <text class="desc">{{goods.goods_brief}}</text>
       </view>

+ 3 - 0
wx-mall/pages/groupDetail/groupDetail.wxss

@@ -115,6 +115,9 @@
   font-size: 41rpx;
   line-height: 41rpx;
 }
+.bizType {
+  font-size: 20rpx;
+}
 
 .goods-info .desc {
   height: 43rpx;

+ 41 - 0
wx-mall/pages/index/index.js

@@ -44,6 +44,7 @@ Page({
     let that = this;
     util.request(api.IndexUrl).then(function (res) {
       if (res.errno === 0) {
+        console.log(res.data.banner);
         that.setData({
           // newGoods: res.data.newGoodsList,
           hotGoods: res.data.hotGoodsList,
@@ -241,5 +242,45 @@ Page({
         });
       }
     });
+  },
+  // 商品扫码
+  scanGoodsCode: function (e) {
+    var that = this;
+    var code;
+    // 调起客户端扫码界面进行扫码
+    wx.scanCode({
+      // 是否只能从相机扫码
+      onlyFromCamera: true,
+      // 扫码类型, barCode:一维码, qrCode:二维码
+      scanType: ['barCode', 'qrCode'],
+      success: function (res) {
+        that.code = "结果:" + res.result + ",路径:" + res.path;
+        that.setData({
+          goodsCode: that.code
+        })
+
+        // 跳转页面
+        wx.navigateTo({
+          url: '../details/details?id=111',
+          success: function (e) {
+            console.log('跳转成功')
+          },
+          fail: function (e) {
+            console.log('跳转失败')
+          }
+        })
+      },
+
+      fail: function () {
+        // 显示提示框
+        wx.showToast({
+          title: '扫码失败',
+          icon: 'none',
+          // 提示的延迟时间
+          duration: 3000
+        })
+      }
+
+    })
   }
 })

+ 22 - 2
wx-mall/pages/index/index.wxml

@@ -14,18 +14,38 @@
     </view>
   </view>
 
+  <view class="search-header">
+    <view class="input-box">
+    <input name="input" class="keywrod" value="搜索商品" confirm-type="search" bindtap="goSearch" />
+    </view>
+    <image src="../../static/images/service-sao.png" class="search-icon-shop" bindtap="scanGoodsCode"></image>
+  </view>
   <view class="home-header">
     <view bindtap="handleStore" class="current-store arrow arrow-down">{{ storeName }}</view>
-    <image src="../../static/images/nav-3.png" class="search-icon" bindtap="goSearch"></image>
   </view>
+
   <swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="750">
     <swiper-item wx:for="{{banner}}" wx:key="{{item.id}}">
       <navigator url="{{item.link}}">
-        <image class="swiper-item" src="{{item.image_url}}" background-size="cover"></image>
+        <image class="swiper-item" src="{{item.imageUrl}}" background-size="cover"></image>
       </navigator>
     </swiper-item>
   </swiper>
   <view class="m-menu">
+    <navigator class="itemb">
+      <image src="../../static/images/service-bao.png" background-size="cover"></image>
+      <text>保税仓</text>
+    </navigator>
+    <navigator class="itemb">
+      <image src="../../static/images/service-zs.png" background-size="cover"></image>
+      <text>保税展示</text>
+    </navigator>
+    <navigator class="itemb">
+      <image src="../../static/images/service-ziti.png" background-size="cover"></image>
+      <text>现场速递</text>
+    </navigator>
+  </view>
+  <view class="m-menu">
     <navigator class="item" url="{{item.url}}" wx:for="{{channel}}" wx:key="{{item.id}}">
       <image src="{{item.icon_url}}" background-size="cover"></image>
       <text>{{item.name}}</text>

+ 76 - 5
wx-mall/pages/index/index.wxss

@@ -40,18 +40,19 @@
 }
 
 .home-header {
-  height: 90rpx;
+  height: 160rpx;
   display: flex;
-  justify-content: center;
-  align-items: center;
+  justify-content: left;
+  align-items: left;
   background-color: #fff;
   padding: 20rpx;
 }
 
 .current-store {
-  text-align: center;
+  text-align: left;
   position: relative;
-  margin-left: auto;
+  margin-top:70rpx;
+  margin-left: 26rpx;
 }
 
 .search-icon {
@@ -81,6 +82,11 @@
   padding: 20rpx 0;
 }
 
+.m-menu .itemb  {
+  flex: 1;
+  display: block;
+}
+
 .m-menu image {
   display: block;
   width: 58rpx;
@@ -565,3 +571,68 @@
   font-size: 28rpx;
   border-radius: 16px 16px 16px 16px;
 }
+
+.search-header .input-box {
+  position: relative;
+  margin-top: 16rpx;
+  float: left;
+  width: 0;
+  flex: 1;
+  height: 59rpx;
+  line-height: 59rpx;
+  padding: 0 20rpx;
+  background: #f4f4f4;
+  color: #999;
+}
+
+.search-header {
+  position: fixed;
+  top: 0;
+  width: 750rpx;
+  height: 91rpx;
+  display: flex;
+  background: #fff;
+  padding: 0 31.25rpx;
+  font-size: 29rpx;
+  color: #333;
+}
+.search-header .icon {
+  position: absolute;
+  top: 14rpx;
+  left: 20rpx;
+  width: 31rpx;
+  height: 31rpx;
+}
+
+.search-header .del {
+  position: absolute;
+  top: 3rpx;
+  right: 10rpx;
+  width: 53rpx;
+  height: 53rpx;
+  z-index: 10;
+}
+
+.search-header .keywrod {
+  position: absolute;
+  top: 0;
+  width: 506rpx;
+  height: 59rpx;
+}
+
+.search-header .right {
+  margin-top: 24rpx;
+  margin-left: 31rpx;
+  margin-right: 6rpx;
+  width: 58rpx;
+  height: 43rpx;
+  line-height: 43rpx;
+  float: right;
+}
+
+.search-icon-shop {
+  width: 40rpx;
+  height: 40rpx;
+  margin-left: 15rpx;
+  margin-top: 20rpx;
+}

+ 3 - 1
wx-mall/pages/ucenter/index/index.js

@@ -32,7 +32,9 @@ Page({
     this.setData({
       userInfo: app.globalData.userInfo,
     });
-    util.request(api.getCurUser).then(function (res) {
+    util.request(api.getCurUser, {
+      userInfo: app.globalData.userInfo
+    }, 'POST').then(function (res) {
       if (res.errno === 0) {
         that.setData({
           curUser: res.data

BIN
wx-mall/static/images/service-bao.png


BIN
wx-mall/static/images/service-sao.png


BIN
wx-mall/static/images/service-ziti.png


BIN
wx-mall/static/images/service-zs.png