tremble 5 年之前
父節點
當前提交
888238d85f
共有 66 個文件被更改,包括 1384 次插入759 次删除
  1. 2 1
      app.js
  2. 2 3
      app.json
  3. 5 1
      app.wxss
  4. 7 0
      config/api.js
  5. 7 7
      custom-tab-bar/index.wxml
  6. 9 4
      custom-tab-bar/index.wxss
  7. 9 6
      pages/auth/btnAuth/btnAuth.js
  8. 2 1
      pages/auth/btnAuth/btnAuth.json
  9. 22 4
      pages/auth/btnAuth/btnAuth.wxml
  10. 61 72
      pages/auth/btnAuth/btnAuth.wxss
  11. 5 5
      pages/brandDetail/brandDetail.wxml
  12. 11 3
      pages/brandDetail/brandDetail.wxss
  13. 8 7
      pages/cart/cart.js
  14. 2 2
      pages/cart/cart.wxml
  15. 18 18
      pages/cart/cart.wxss
  16. 2 2
      pages/catalog/catalog.wxss
  17. 4 1
      pages/category/category.wxss
  18. 42 59
      pages/goods/goods.js
  19. 9 7
      pages/goods/goods.wxml
  20. 22 9
      pages/goods/goods.wxss
  21. 271 85
      pages/index/index.js
  22. 1 1
      pages/index/index.json
  23. 14 15
      pages/index/index.wxml
  24. 37 17
      pages/index/index.wxss
  25. 1 1
      pages/logistics/index.wxml
  26. 3 3
      pages/pay/pay.js
  27. 3 5
      pages/pay/pay.wxss
  28. 1 0
      pages/payResult/payResult.js
  29. 2 3
      pages/payResult/payResult.wxml
  30. 2 3
      pages/search/search.js
  31. 1 1
      pages/search/search.json
  32. 10 4
      pages/search/search.wxss
  33. 8 6
      pages/shopping/address/address.wxss
  34. 5 0
      pages/shopping/addressAdd/addressAdd.js
  35. 1 1
      pages/shopping/addressAdd/addressAdd.wxss
  36. 2 2
      pages/shopping/checkout/checkout.wxml
  37. 10 9
      pages/shopping/checkout/checkout.wxss
  38. 1 1
      pages/topicDetail/topicDetail.wxml
  39. 7 5
      pages/ucenter/address/address.wxss
  40. 26 3
      pages/ucenter/addressAdd/addressAdd.js
  41. 1 1
      pages/ucenter/addressAdd/addressAdd.wxml
  42. 5 4
      pages/ucenter/addressAdd/addressAdd.wxss
  43. 1 1
      pages/ucenter/collect/collect.wxml
  44. 1 1
      pages/ucenter/feedback/feedback.wxml
  45. 3 2
      pages/ucenter/feedback/feedback.wxss
  46. 162 60
      pages/ucenter/index/index.js
  47. 49 62
      pages/ucenter/index/index.wxml
  48. 162 112
      pages/ucenter/index/index.wxss
  49. 45 3
      pages/ucenter/order/order.js
  50. 12 5
      pages/ucenter/order/order.wxml
  51. 47 35
      pages/ucenter/order/order.wxss
  52. 二進制
      pages/ucenter/orderDetail/dianpu.png
  53. 16 2
      pages/ucenter/orderDetail/orderDetail.js
  54. 20 2
      pages/ucenter/orderDetail/orderDetail.wxml
  55. 83 73
      pages/ucenter/orderDetail/orderDetail.wxss
  56. 28 12
      pages/webview/index.js
  57. 86 2
      project.config.json
  58. 二進制
      static/images/ic_menu_choice_nor.png
  59. 二進制
      static/images/ic_menu_choice_pressed.png
  60. 二進制
      static/images/ic_menu_me_nor.png
  61. 二進制
      static/images/ic_menu_me_pressed.png
  62. 二進制
      static/images/ic_menu_shoping_nor.png
  63. 二進制
      static/images/ic_menu_shoping_pressed.png
  64. 二進制
      static/images/ic_menu_sort_nor.png
  65. 二進制
      static/images/ic_menu_sort_pressed.png
  66. 8 5
      utils/util.js

+ 2 - 1
app.js

@@ -45,7 +45,8 @@ App({
         token: '',
         userCoupon: 'NO_USE_COUPON',//默认不适用优惠券
         courseCouponCode: {},//购买课程的时候优惠券信息
-        isiPhoneX: false
+        isiPhoneX: false,
+        isLogin:false
     },
 
     onGetSysInfo() {

+ 2 - 3
app.json

@@ -48,7 +48,6 @@
     "enablePullDownRefresh": true
   },
   "tabBar": {
-    "custom": true,
     "backgroundColor": "#fafafa",
     "borderStyle": "white",
     "selectedColor": "#1fe4dc",
@@ -58,7 +57,7 @@
         "pagePath": "pages/index/index",
         "iconPath": "static/images/ic_menu_choice_nor.png",
         "selectedIconPath": "static/images/ic_menu_choice_pressed.png",
-        "text": "首页"
+        "text": "店铺"
       },
       {
         "pagePath": "pages/catalog/catalog",
@@ -86,7 +85,7 @@
   },
   "plugins": {
     "ykfchat": {
-      "version": "2.0.6",
+      "version": "2.0.7",
       "provider": "wx1fdc8c9f3a3a05e4"
     }
   },

+ 5 - 1
app.wxss

@@ -1,6 +1,6 @@
 /**app.wxss**/
 page{
-  padding-bottom: 80rpx;
+  /* padding-bottom: 80rpx; */
 }
 
 .container {
@@ -14,6 +14,10 @@ page{
   bottom:64rpx!important;
 }
 
+.isIPxBottom{
+  padding-bottom:64rpx!important;
+}
+
 
 .buttomPart{
   bottom: 80rpx!important;

+ 7 - 0
config/api.js

@@ -1,5 +1,12 @@
 const API_BASE_URL = 'https://shop.4dkankan.com/platform-framework/api/';
+// const API_BASE_URL = 'http://192.168.0.207:8080/platform-framework/api/';
+
+
 module.exports = {
+
+    
+    IndexList: API_BASE_URL + 'brand/list', //首页商铺列表
+
     IndexUrlNewGoods: API_BASE_URL + 'index/newGoods', //新品首发
     IndexUrlHotGoods: API_BASE_URL + 'index/hotGoods', //热卖商品
     IndexUrlTopic: API_BASE_URL + 'index/topic', //专题精选

+ 7 - 7
custom-tab-bar/index.wxml

@@ -1,8 +1,8 @@
 <!--miniprogram/custom-tab-bar/index.wxml-->
-<cover-view class="tab-bar">
-  <cover-view class="tab-bar-border"></cover-view>
-  <cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
-    <cover-image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></cover-image>
-    <cover-view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</cover-view>
-  </cover-view>
-</cover-view>
+<view class="tab-bar">
+  <view class="tab-bar-border"></view>
+  <view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
+    <image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
+    <view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
+  </view>
+</view>

+ 9 - 4
custom-tab-bar/index.wxss

@@ -7,6 +7,7 @@
   background: white;
   display: flex;
   padding-bottom: env(safe-area-inset-bottom);
+  z-index: 999999999999999;
 }
 
 .tab-bar-border {
@@ -29,12 +30,16 @@
   flex-direction: column;
 }
 
-.tab-bar-item cover-image {
-  width: 52rpx;
-  height: 52rpx;
+.tab-bar-item image {
+  width: 48rpx;
+  height: 48rpx;
   margin-bottom: 6rpx;
+  position: relative;
+  z-index: 99999999;
 }
 
-.tab-bar-item cover-view {
+.tab-bar-item view {
   font-size: 20rpx;
+  position: relative;
+  z-index: 99999999;
 }

+ 9 - 6
pages/auth/btnAuth/btnAuth.js

@@ -7,7 +7,9 @@ Page({
   data: {
     canIUse: wx.canIUse('button.open-type.getUserInfo'),
     navUrl: '',
-    code: ''
+    code: '',
+    login_img: "https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/login-bg.png",
+    login_logo: "https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/login-login.svg"    
   },
 
   onLoad: function(options) {
@@ -47,13 +49,14 @@ Page({
           wx.setStorageSync('token', res.data.token);
           wx.setStorageSync('userId', res.data.userId);
           wx.navigateBack({})
+          wx.setStorageSync('isLogin', true);
         } else {
           // util.showErrorToast(res.errmsg)
-          wx.showModal({
-            title: '提示',
-            content: res.errmsg,
-            showCancel: false
-          });
+          // wx.showModal({
+          //   title: '提示',
+          //   content: res.errmsg,
+          //   showCancel: false
+          // });
         }
       });
     }

+ 2 - 1
pages/auth/btnAuth/btnAuth.json

@@ -1,4 +1,5 @@
 {
   "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "enablePullDownRefresh": false
 }

+ 22 - 4
pages/auth/btnAuth/btnAuth.wxml

@@ -1,4 +1,24 @@
 <!--index.wxml-->
+
+<!--pages/login_page/index.wxml-->
+<view class='login_con'>
+  <view class='needLogin'>
+    <image src='{{login_img}}'></image>
+
+  </view>
+  <view class='login_text'>
+    <image src='{{login_logo}}'></image>
+    <view>四维商圈新体验</view>
+    <view>宅家中,云逛街,轻松买</view>
+  </view>
+  <view class="quanxian">
+    <view>四维商圈小程序申请获得以下权限</view>
+    <view>· 获得您的公开信息(昵称、头像等)</view>
+  </view>
+  <button  wx:if="{{canIUse}}" class='btn_login' open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">授权登录</button>
+</view>
+
+<!-- 
 <view class="page">
   <view class="hd">
     <image class="logo" src="https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/logo.png"></image>
@@ -7,11 +27,9 @@
   <view class="bd">
     <view class="top_line"></view>
     <text class="m_name">四维时代网络科技有限公司申请获得以下权限</text>
-    <text class="s_name">· 获得的公开信息(昵称、头像等)</text>
+    <text class="s_name">· 获得的公开信息(昵称、头像等)</text>
   </view>
   <view class="btn spacing">
-    <!-- 需要使用 button 来授权登录 -->
     <button wx:if="{{canIUse}}" open-type="getUserInfo" class="weui_btn weui_btn_primary" bindgetuserinfo="bindGetUserInfo">授权登录</button>
-    <!-- <view wx:else>请升级微信版本</view> -->
   </view>
-</view>
+</view> -->

+ 61 - 72
pages/auth/btnAuth/btnAuth.wxss

@@ -1,95 +1,84 @@
-view, text {
-  font-family: PingFangSC-Light, helvetica, 'Heiti SC';
-  font-size: 29rpx;
-  color: #333;
-}
+/* pages/login_page/index.wxss */
 
-.hd {
-  display: flex;
+page {
   width: 100%;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.hd .logo {
-  width: 520rpx;
-  height: 140rpx;
-  margin: 50rpx auto;
+  background: #1fe4dc;
+  height: 100%;
+  overflow: hidden;
 }
 
-.hd .title {
-  text-align: center;
-  font-size: 36rpx;
-  color: #000;
+.login_con {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  overflow: hidden;
 }
 
-.bd {
+.needLogin {
   width: 100%;
-  padding: 50rpx;
+  height: 100%;
+  position: absolute;
 }
 
-.bd .top_line {
+.needLogin image {
   width: 100%;
-  height: 1rpx;
-  background: #ccc;
-  margin-top: 20rpx;
-  margin-bottom: 50rpx;
+  height: 100%;
 }
 
-.bd .m_name {
-  display: block;
-  font-size: 36rpx;
-  color: #000;
+.quanxian{
+  position: absolute;
+  font-size: 30rpx;
+  border: none;
+  bottom: 20%;
+  margin: 0 10%;
+  text-align: center;
+  width: 80%;
 }
 
-.bd .s_name {
-  margin-top: 25rpx;
-  display: block;
-  font-size: 34rpx;
-  color: #8a8a8a;
+.quanxian view{
+  color:404040;
+  opacity: 0.6;
+  font-size: 28rpx;
 }
 
-.btn {
-  padding: 120rpx 50rpx 0;
+.quanxian view:first-of-type{
+  margin-bottom: 10rpx;
 }
 
-.weui_btn_primary {
-  background-color: #04be02;
-}
 
-.weui_btn {
-  position: relative;
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-  padding-left: 14px;
-  padding-right: 14px;
-  box-sizing: border-box;
-  font-size: 18px;
+.btn_login {
+  background: #fff;
+  line-height: 100rpx;
+  color: #2d2d2d;
+  border: none;
+  position: absolute;
+  bottom: 10%;
+  margin: 0 10%;
   text-align: center;
-  text-decoration: none;
-  color: #fff;
-  line-height: 2.33333333;
-  border-radius: 5px;
-  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-  overflow: hidden;
+  width: 80%;
 }
-
-.weui_btn:after {
-  content: " ";
-  width: 200%;
-  height: 200%;
+.login_text{
   position: absolute;
-  top: 0;
-  left: 0;
-  border: 1px solid rgba(0, 0, 0, 0.2);
-  -webkit-transform: scale(0.5);
-  -ms-transform: scale(0.5);
-  transform: scale(0.5);
-  -webkit-transform-origin: 0 0;
-  -ms-transform-origin: 0 0;
-  transform-origin: 0 0;
-  box-sizing: border-box;
-  border-radius: 10px;
+  top: 15%;
+  width: 80%;
+  margin: 0 10%;
+  text-align: center;
+}
+
+.login_text view{
+  color: #404040;
+  letter-spacing: 2rpx;
+  margin-top: 20rpx;
+}
+
+.login_text view:last-of-type{
+  margin-top: 30rpx;
+  font-size: 40rpx;
 }
+
+
+.login_text image{
+  width: 240rpx;
+  height: 240rpx;
+  border-radius:50%; 
+}

+ 5 - 5
pages/brandDetail/brandDetail.wxml

@@ -1,23 +1,23 @@
 <view class="container">
     <view class="brand-info">
         <view class="name">
-            <image class="img" src="{{brand.app_list_pic_url}}" background-size="cover"></image>
+            <image class="img" src="{{brand.listPicUrl}}" background-size="cover"></image>
             <view class="info-box">
                 <view class="info">
-                    <text class="txt">{{brand.name}}</text>
-                    <text class="line"></text>
+                    <!-- <text class="txt">{{brand.name}}</text>
+                    <text class="line"></text> -->
                 </view>
             </view>
         </view>
         <view class="desc">
-            {{brand.simple_desc}}
+            {{brand.simpleDesc}}
         </view>
     </view>
 
     <view class="cate-item">
         <view class="b">
             <block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem">
-            <navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}">
+            <navigator hover-class="none" class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}&isBrand=true">
                 <image class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
                 <text class="name">{{iitem.name}}</text>
                 <text class="price">¥{{iitem.retail_price}}</text>

+ 11 - 3
pages/brandDetail/brandDetail.wxss

@@ -76,6 +76,9 @@ page{
   height: auto;
   overflow: hidden;
   text-align: center;
+  min-height: 530rpx;
+  position: relative;
+
 }
 
 .cate-item .b .item-b{
@@ -90,14 +93,15 @@ page{
 
 .cate-item .item .name{
   display: block;
-  width: 365.625rpx;
-  height: 35rpx;
   padding: 0 20rpx;
-  overflow: hidden;
   margin: 11.5rpx 0 22rpx 0;
   text-align: center;
   font-size: 30rpx;
   color: #333;
+  display: -webkit-box;
+  overflow: hidden;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 3;
 }
 
 .cate-item .item .price{
@@ -107,4 +111,8 @@ page{
   text-align: center;
   font-size: 30rpx;
   color: #1fe4dc;
+  bottom: 18rpx;
+  left: 50%;
+  position: absolute;
+  transform: translateX(-50%);
 }

+ 8 - 7
pages/cart/cart.js

@@ -19,6 +19,8 @@ Router({
   },
   onLoad: function (options) {
     // 页面初始化 options为页面跳转所带来的参数
+    // this.getCartList();
+
   },
   onReady: function () {
     // 页面渲染完成
@@ -31,8 +33,9 @@ Router({
         selected: 2
       })
     }
+
+    let isLogin = wx.getStorageSync('isLogin')
     this.getCartList();
-    
   },
   onPullDownRefresh(){
     this.getCartList();
@@ -173,7 +176,7 @@ Router({
   },
   toIndexPage: function () {
     wx.switchTab({
-      url: "/pages/webview/index"
+      url: "/pages/index/index"
     });
   },
   updateCart: function (itemIndex, tag) {
@@ -201,11 +204,8 @@ Router({
           cartGoods: that.data.cartGoods
         });
       } else if (res.errno === 400){
-        wx.showToast({
-          title: '库存不足',
-          icon: 'warn',
-          duration: 2000
-        });
+        util.showErrorToast('库存不足');
+
         that.setData({
           canAdd:false
         })
@@ -274,6 +274,7 @@ Router({
     });
 
     if (productIds.length <= 0) {
+      util.showErrorToast('请选择商品');
       return false;
     }
 

+ 2 - 2
pages/cart/cart.wxml

@@ -72,8 +72,8 @@
                 </view>
             </view>-->
     </view>
-    <view class="cart-bottom" style="bottom: {{isiPhoneX ? '160rpx' : '100rpx'}};">
-      <view class="checkbox {{checkedAllStatus ? 'checked' : ''}}" bindtap="checkedAll">全选({{cartTotal.checkedGoodsCount}})</view>
+    <view class="cart-bottom">
+      <view class="checkbox {{checkedAllStatus ? 'checked' : ''}}" bindtap="checkedAll">全选 ({{cartTotal.checkedGoodsCount}})</view>
       <view class="total">{{!isEditCart ? '¥'+cartTotal.checkedGoodsAmount : ''}}</view>
       <view class="delete" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view>
       <view class="checkout" bindtap="deleteCart" wx:if="{{isEditCart}}">删除所选</view>

+ 18 - 18
pages/cart/cart.wxss

@@ -1,16 +1,16 @@
 page{
-    height: 100%;
-    min-height: 100%;
     background: #f4f4f4;
     padding-bottom: 100rpx;
+    min-height: calc(100% - 200rpx);
+
 }
 .container{
     background: #f4f4f4;
     width: 100%;
     height: auto;
-    min-height: calc(100% - 200rpx);
     overflow: hidden;
 }
+
 .service-policy{
     width: 750rpx;
     height: 73rpx;
@@ -96,14 +96,13 @@ page{
     height: auto;
     width: 100%;
     overflow: hidden;
-    margin-bottom: 120rpx;
+    padding-bottom: 180rpx;
 }
 
 .cart-view .group-item{
     height: auto;
     width: 100%;
     background: #fff;
-    margin-bottom: 18rpx;
 }
 
 .cart-view .item{
@@ -322,12 +321,15 @@ page{
 
 .cart-bottom{
     position: fixed;
-    bottom:100rpx;
+    z-index: 999;
+    bottom:0;
     left:0;
     height: 100rpx;
     width: 100%;
     background: #fff;
     display: flex;
+    border-top: 1px solid #f4f4f4;
+    align-items: center;
 }
 
 .isIPhoneX{
@@ -336,34 +338,32 @@ page{
 
 
 .cart-bottom .checkbox{
-    height: 34rpx;
-
-    padding-left: 60rpx;
-    line-height: 34rpx;
-    margin: 33rpx 18rpx 33rpx 26rpx;
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon-normal_checkbox.png) no-repeat;
+    /* height: 100%; */
+    padding-left: 80rpx;
+    /* line-height: 100%; */
+    /* padding: 34rpx 18rpx 34rpx 80rpx; */
+    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon-normal_checkbox.png) 26rpx 50% no-repeat;
     background-size: 34rpx;
-    font-size: 29rpx;
+    font-size: 30rpx;
 }
 
 .cart-bottom .checkbox.checked{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon-normal_checkbox-checked.png) no-repeat;
+    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon-normal_checkbox-checked.png) 26rpx 50% no-repeat;
     background-size: 34rpx;
 }
 
 .cart-bottom .total{
-    height: 34rpx;
     flex: 1;
-    margin: 30rpx 10rpx 33rpx 10rpx;
+    /* margin: 26rpx 10rpx 34rpx 14rpx; */
     font-size: 29rpx;
+    padding-left: 20rpx;
 }
 
 
 .cart-bottom .delete{
-    height: 34rpx;
     width: auto;
-    margin: 33rpx 18rpx;
     font-size: 29rpx;
+    margin-right: 30rpx;
 }
 
 .cart-bottom .checkout{

+ 2 - 2
pages/catalog/catalog.wxss

@@ -45,8 +45,8 @@ page {
 }
 
 .search .txt {
-  height: 42rpx;
-  line-height: 42rpx;
+  top: 50%;
+  transform: translateY(-50%);
   color: #959595;
   padding-left: 10rpx;
   font-size: 28rpx;

+ 4 - 1
pages/category/category.wxss

@@ -101,10 +101,13 @@
   width: 365.625rpx;
   margin: 11.5rpx 0 22rpx 0;
   text-align: center;
-  overflow: hidden;
   padding: 0 20rpx;
   font-size: 28rpx;
   color: #333;
+  display: -webkit-box;
+  overflow: hidden;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 3;
 }
 
 .cate-item .item .price{

+ 42 - 59
pages/goods/goods.js

@@ -2,7 +2,6 @@ var app = getApp();
 var WxParse = require('../../lib/wxParse/wxParse.js');
 var util = require('../../utils/util.js');
 var api = require('../../config/api.js');
-var plugin = requirePlugin("ykfchat");
 import { Router } from '../../utils/router.js'
 
 Router({
@@ -26,13 +25,11 @@ Router({
     selectId:'',
     noCollectImage: "https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon_collect.png",
     hasCollectImage: "https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon_collect_checked.png",
-    collectBackImage: "https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon_collect.png"
-  },
-  norma() {
-    wx.navigateTo({
-      url: 'plugin://ykfchat/chat-page?wechatapp_id=165586&channel_id=7549&scene=p2004q9l8pl&getOpenIdType=1',
-    });
+    collectBackImage: "https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon_collect.png",
+    collected:'',
+    isfromBrand:false
   },
+ 
   getGoodsInfo: function () {
     let that = this;
     util.request(api.GoodsDetail, { id: that.data.id }).then(function (res) {
@@ -52,11 +49,13 @@ Router({
           that.setDefSpecInfo(that.data.specificationList);
         if (res.data.userHasCollect == 1) {
           that.setData({
-            'collectBackImage': that.data.hasCollectImage
+            'collectBackImage': that.data.hasCollectImage,
+            collected: that.data.hasCollectImage
           });
         } else {
           that.setData({
-            'collectBackImage': that.data.noCollectImage
+            'collectBackImage': that.data.noCollectImage,
+            collected: that.data.hasCollectImage
           });
         }
 
@@ -76,7 +75,6 @@ Router({
         });
       }
     });
-
   },
   back:function(){
     wx.navigateBack({
@@ -204,33 +202,10 @@ Router({
     // 页面初始化 options为页面跳转所带来的参数
     this.setData({
       id: parseInt(options.id),
+      isfromBrand: options.isBrand||false,
       imgServer: util.imgServer
       // id: 1181000
     });
-    // var that = this;
-    // this.getGoodsInfo();
-    // util.request(api.CartGoodsCount).then(function (res) {
-    //   if (res.errno === 0) {
-    //     that.setData({
-    //       cartGoodsCount: res.data.cartTotal.goodsCount
-    //     });
-
-    //   }
-    // });
-
-    // var that = this
-    // //  高度自适应
-    // wx.getSystemInfo({
-    //   success: function (res) {
-    //     var clientHeight = res.windowHeight,
-    //       clientWidth = res.windowWidth,
-    //       rpxR = 750 / clientWidth;
-    //     var calc = clientHeight * rpxR - 100;
-    //     that.setData({
-    //       winHeight: calc
-    //     });
-    //   }
-    // });
   },
   onReady: function () {
     // 页面渲染完成
@@ -239,12 +214,12 @@ Router({
   onShow: function () {
     var that = this;
     this.getGoodsInfo();
+    
     util.request(api.CartGoodsCount).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           cartGoodsCount: res.data.cartTotal.goodsCount
         });
-
       }
     });
 
@@ -286,11 +261,15 @@ Router({
       });
       if (that.data.userHasCollect == 1) {
         that.setData({
-          'collectBackImage': that.data.hasCollectImage
+          'collectBackImage': that.data.hasCollectImage,
+          collected: that.data.hasCollectImage
+
         });
       } else {
         that.setData({
-          'collectBackImage': that.data.noCollectImage
+          'collectBackImage': that.data.noCollectImage,
+          collected: that.data.noCollectImage
+
         });
       }
     } else {
@@ -301,14 +280,20 @@ Router({
           if (_res.errno == 0) {
             if ( _res.data.type == 'add') {
               that.setData({
-                'collectBackImage': that.data.hasCollectImage
+                'collectBackImage': that.data.hasCollectImage,
+                collected: that.data.hasCollectImage
+
               });
+              wx.showToast({
+                title: '收藏成功'
+              })
             } else {
               that.setData({
-                'collectBackImage': that.data.noCollectImage
+                'collectBackImage': that.data.noCollectImage,
+                collected: that.data.noCollectImage
+
               });
             }
-
           } else {
             wx.showToast({
               image: 'https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon_error.png',
@@ -316,7 +301,6 @@ Router({
               mask: true
             });
           }
-
         });
     }
 
@@ -402,9 +386,8 @@ Router({
 
       //提示选择完整规格
       if (!this.isCheckedAllSpec()) {
-          wx.showToast({
-              title: '请选择完整规格'
-          });
+        util.showErrorToast('请选择完整规格');
+
         return false;
       }
 
@@ -431,23 +414,21 @@ Router({
             });
             that.setData({
               openAttr: !that.data.openAttr,
-              cartGoodsCount: _res.data.cartTotal.goodsCount
+              collectBackImage: that.data.collected,
+              cartGoodsCount: _res.data.cartTotal.goodsCount,
+              number:1
             });
-            if (that.data.userHasCollect == 1) {
-              that.setData({
-                'collectBackImage': that.data.hasCollectImage
-              });
-            } else {
-              that.setData({
-                'collectBackImage': that.data.noCollectImage
-              });
-            }
+            // if (that.data.userHasCollect == 1) {
+            //   that.setData({
+            //     'collectBackImage': that.data.hasCollectImage
+            //   });
+            // } else {
+            //   that.setData({
+            //     'collectBackImage': that.data.noCollectImage
+            //   });
+            // }
           } else {
-            wx.showToast({
-              image: 'https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/icon_error.png',
-              title: _res.errmsg,
-              mask: true
-            });
+            return util.showErrorToast(_res.errmsg);
           }
 
         });
@@ -460,6 +441,8 @@ Router({
     });
   },
   addNumber: function () {
+    if (this.data.number >= this.data.productList[0].goods_number)
+      return util.showErrorToast('库存不足');
     this.setData({
       number: this.data.number + 1
     });

+ 9 - 7
pages/goods/goods.wxml

@@ -15,7 +15,7 @@
         <view class="gt">
           <text class="price">¥{{goods.retail_price}}</text>
           <view class="brand" wx:if="{{brand.name}}">
-          <navigator hover-class="none" url="../brandDetail/brandDetail?id={{brand.id}}">
+          <navigator hover-class="none" open-type="{{isfromBrand?'navigateBack':'redirect'}}" hover-class="none" url="../brandDetail/brandDetail?id={{brand.id}}">
             <text>{{brand.name}}</text>
           </navigator>
         </view>
@@ -96,12 +96,12 @@
       </view>
     </view> -->
 
-    <!-- <view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
+    <view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
       <view class="h">
         <view class="line"></view>
         <text class="title">大家都在看</text>
       </view>
-      <view class="b">
+      <view class="b {{isiPhoneX ? 'isIPxBottom' : ''}}">
         <view class="item" wx:for="{{relatedGoods}}" wx:key="*this">
           <navigator url="/pages/goods/goods?id={{item.id}}">
             <image class="img" src="{{item.list_pic_url}}" background-size="cover"></image>
@@ -110,7 +110,7 @@
           </navigator>
         </view>
       </view>
-    </view> -->
+    </view>
 
   </view>
 
@@ -121,6 +121,7 @@
         <view class="c">
           <view class="p">价格:¥{{goods.retail_price}}</view>
           <view class="a" wx:if="{{productList.length>0}}">已选择:{{checkedSpecText}}</view>
+          <view class="kucun">库存{{productList[0].goods_number}}件</view>
         </view>
       </view>
     </view>
@@ -145,7 +146,8 @@
 
 </scroll-view>
 
-<view class="bottom-btn {{isiPhoneX ? 'isIPx' : ''}}">
+<!-- {{isiPhoneX ? 'isIPx' : ''}} -->
+<view class="bottom-btn {{isiPhoneX ? 'isIPx' : ''}}" >
   <view class="l l-collect {{ openAttr ? 'back' : ''}}" bindtap="closeAttrOrCollect">
     <image class="icon" src="{{ collectBackImage }}"></image>
   </view>
@@ -155,9 +157,9 @@
       <image bindtap="openCartPage" wx:if="{{imgServer}}" class="icon" src="{{imgServer+'/ic_menu_shoping_nor.png'}}"></image>
     </view>
   </view>
-  <view class="l " bindtap="norma">
+  <button hover-class="none" open-type="contact" class="l ">
     <image class="icon icon-kefu" src="../../static/images/wechat.png"></image>
-  </view>
+  </button>
   <view class="c" bindtap='buyGoods'>立即购买</view>
   <view class="r" bindtap="addToCart">加入购物车</view>
 </view>

+ 22 - 9
pages/goods/goods.wxss

@@ -1,6 +1,7 @@
 .container{
     /* margin-bottom: 100rpx; */
 }
+
 .goodsimgs{
   width: 100%;
   height: 352rpx;
@@ -11,6 +12,12 @@
   height: 100%;
 }
 
+.kucun{
+  font-size: 28rpx;
+  color: #ccc;
+  margin-top: 20rpx;
+}
+
 .service-policy{
     width: 750rpx;
     height: 73rpx;
@@ -420,7 +427,6 @@
   color: #787878;
 }
 
-
 .related-goods{
     width: 750rpx;
     height: auto;
@@ -477,31 +483,38 @@
   padding: 15rpx 31.25rpx;
   border-right: 1px solid #f4f4f4;
   border-bottom: 1px solid #f4f4f4;
+  min-height: 530rpx;
+  position: relative;
 }
 
 .related-goods .item .img{
-  width: 311.45rpx;
-  height: 311.45rpx;
+  width: 312rpx;
+  height: 312rpx;
 }
 
 .related-goods .item .name{
   display: block;
-  width: 311.45rpx;
-  height: 35rpx;
+  width: 312rpx;
   margin: 11.5rpx 0 15rpx 0;
   text-align: center;
-  overflow: hidden;
   font-size: 30rpx;
   color: #333;
+  display: -webkit-box;
+  overflow: hidden;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 3;
 }
 
 .related-goods .item .price{
   display: block;
-  width: 311.45rpx;
-  height: 30rpx;
+  width: 312rpx;
+  height: 40rpx;
   text-align: center;
   font-size: 30rpx;
   color: #1fe4dc;
+  position: absolute;
+  bottom: 10rpx;
+
 }
 
 .bottom-btn{
@@ -529,7 +542,7 @@
     display: flex;
     align-items: center;
     justify-content: center;
-    
+    background: #fff;
 }
 
 .bottom-btn .l.l-collect{

+ 271 - 85
pages/index/index.js

@@ -3,125 +3,310 @@ const api = require('../../config/api.js');
 const user = require('../../services/user.js');
 import { Router } from '../../utils/router.js'
 
+let raw = [
+  {
+    name: "FURLA",
+    link: "gu6HmTLKp",
+    type: "fushi",
+    img: "hf4",
+    belong: "",
+    qrcode: "furla"
+  },
+  {
+    name: "Adidas",
+    link: "wmgAlMV6w",
+    type: "fushi",
+    img: "hf1",
+    belong: "",
+    qrcode: "Adidas"
+  },
+  {
+    name: "Clarks",
+    link: "TSC1mTgLg",
+    type: "fushi",
+    img: "hf11",
+    belong: "",
+    qrcode: "Clarks"
+  },
+  {
+    name: "润园四季",
+    link: "8OBkdB5a8",
+    type: "fushi",
+    img: "hf13",
+    belong: "",
+    qrcode: "DAZZLE"
+  },
+  {
+    name: "FILA",
+    link: "dP6EECGrI",
+    type: "fushi",
+    img: "hf2",
+    belong: "",
+    qrcode: "FILA"
+  },
+  {
+    name: "DAZZLE",
+    link: "n1Pg6NjKW",
+    type: "fushi",
+    img: "hf3",
+    belong: "",
+    qrcode: "DAZZLE"
+  },
+  {
+    name: "LANCOME",
+    link: "kklFfbwet",
+    type: "liren",
+    img: "hf5",
+    belong: "",
+    qrcode: "FILA"
+  },
+  {
+    name: "名表专柜",
+    link: "qzInCQin1",
+    type: "qita",
+    img: "hf12",
+    belong: "",
+    qrcode: "FILA"
+  },
+  {
+    name: "MJstyle",
+    link: "UK5iVJ2yu",
+    type: "fushi",
+    img: "hf7",
+    belong: "",
+    qrcode: "MJstyle"
+  },
+  {
+    name: "PANDORA",
+    link: "teO9zu7cP",
+    type: "fushi",
+    img: "hf6",
+    belong: "",
+    qrcode: "FILA"
+  },
+  {
+    name: "NOME",
+    link: "bTpjhkgSh",
+    type: "fushi",
+    img: "hf8",
+    belong: "",
+    qrcode: "NOME"
+  },
+  {
+    name: "探鱼",
+    link: "lzNp1eYM3",
+    type: "meishi",
+    img: "hf9",
+    belong: "",
+    qrcode: "tanyu"
+  },
+  {
+    name: "LOHAS",
+    link: "ZNTxtgnlJ",
+    type: "qita",
+    img: "hf14",
+    belong: "",
+    qrcode: "LOHAS"
+  }
+]
+
+
 //获取应用实例
 const app = getApp()
 Router({
   data: {
-    raw: [
+    raw,
+    data: raw,
+    showSearch: false,
+    activeType:-1,
+    header:[
       {
-        name: "FURLA",
-        link: "gu6HmTLKp",
-        type: "fushi",
-        img: "hf4",
-        belong: "",
-        qrcode: "furla"
+        name:'全部',
+        type:'all',
+        id: -1
       },
       {
-        name: "Adidas",
-        link: "wmgAlMV6w",
-        type: "fushi",
-        img: "hf1",
-        belong: "",
-        qrcode: "Adidas"
+        name: '美食',
+        id: 1,
+        type: 'meishi'
       },
       {
-        name: "FILA",
-        link: "dP6EECGrI",
-        type: "fushi",
-        img: "hf2",
-        belong: "",
-        qrcode: "FILA"
+        name: '服饰',
+        id: 2,
+        type: 'fushi'
       },
       {
-        name: "DAZZLE",
-        link: "n1Pg6NjKW",
-        type: "fushi",
-        img: "hf3",
-        belong: "",
-        qrcode: "DAZZLE"
+        name: '丽人',
+        id: 3,
+        type: 'liren'
       },
       {
-        name: "LANCOME",
-        link: "kklFfbwet",
-        type: "liren",
-        img: "hf5",
-        belong: "",
-        qrcode: "FILA"
+        name: '其他',
+        id: 0,
+        type: 'qita'
       },
-      {
-        name: "名表专柜",
-        link: "qzInCQin1",
-        type: "qita",
-        img: "hf12",
-        belong: "",
-        qrcode: "FILA"
-      },
-      {
-        name: "MJstyle",
-        link: "UK5iVJ2yu",
-        type: "fushi",
-        img: "hf7",
-        belong: "",
-        qrcode: "MJstyle"
-      },
-      {
-        name: "PANDORA",
-        link: "teO9zu7cP",
-        type: "fushi",
-        img: "hf6",
-        belong: "",
-        qrcode: "FILA"
-      },
-      {
-        name: "NOME",
-        link: "bTpjhkgSh",
-        type: "fushi",
-        img: "hf8",
-        belong: "",
-        qrcode: "NOME"
-      },
-      {
-        name: "探鱼",
-        link: "lzNp1eYM3",
-        type: "meishi",
-        img: "hf9",
-        belong: "",
-        qrcode: "tanyu"
-      },
-      {
-        name: "LOHAS",
-        link: "ZNTxtgnlJ",
-        type: "qita",
-        img: "hf13",
-        belong: "",
-        qrcode: "LOHAS"
-      }
     ],
+    noRecord:'',
     hideMask: false,
-    url:'https://www.4dkankan.com/eShopMobile.html?m='
+    keyword:'',
+    url:'https://www.4dkankan.com/eShopMobile.html?m=',
+    totalPages: 1,
+    currentPage: 1,
+    size: 10,
+    loading: false,
+    brandList:[]
   },
   onShareAppMessage: function () {
     return {
-      title: 'NideShop',
-      desc: '微信小程序商城',
+      title: '四维商圈:宅家中,云逛街,轻松买',
+      desc: '四维商圈:宅家中,云逛街,轻松买',
       path: '/pages/index/index'
     }
   },
   onPullDownRefresh(){
+    this.setData({
+      brandList: this.data.brandList.slice(0,10),
+      currentPage: 1
+    });
+    this.getBrandList(1,false,true);
+  },
+
+  onReachBottom() {
+    if (!this.data.loading) {
+      this.loadMore();
+      console.log('reach down')
+    }
+  },
+
+  loadMore: function () {
+    if (this.data.currentPage<this.data.totalPages) {
+      console.log(this.data.currentPage + 1)
+      this.getBrandList(this.data.currentPage + 1);
+    } else {
+      return;
+    }
+  },
+
+  getBrandList(page,isSearch=false,refresh=false){
     
+    this.setData({
+      loading: true
+    })
+    let tempContent = this.data.brandList ?
+      this.data.brandList :
+      [];
+    let { activeType, size, keyword,} = this.data
+    
+    util.request(api.IndexList, { type: activeType, page, name:keyword, size })
+      .then(res=> {
+        if (isSearch){
+          if (res.data.data.length <= 0) {
+            this.setData({
+              noRecord: true
+            });
+          }
+          else {
+            wx.pageScrollTo({
+              scrollTop: 0
+            })
+            this.setData({
+              brandList: res.data.data,
+              currentPage: res.data.currentPage,
+              totalPages: res.data.totalPages,
+              loading: false,
+              noRecord: false,
+              showSearch: false
+            });
+          }
+        }
+        else if(refresh){
+          this.setData({
+            brandList: res.data.data,
+            currentPage: res.data.currentPage,
+            totalPages: res.data.totalPages,
+            loading: false
+          });
+        }
+        else {
+          this.setData({
+            brandList: tempContent.concat(res.data.data),
+            currentPage: res.data.currentPage,
+            totalPages: res.data.totalPages,
+            loading: false
+          });
+        }
+
+        
+
+      });
+  },
+
+  inputChange: function (e) {
+    let val = e.detail.value
+    this.setData({
+      keyword:val,
+      noRecord: false
+    })
+  },
+
+  search:function(){
+    let {keyword} = this.data
+ 
+    this.getBrandList(1, true)
+    // if (this.brandList.length <= 0) {
+    //   this.setData({
+    //     noRecord: true
+    //   })
+    // }
+    // else {
+    //   this.setData({
+    //     activeType: -1,
+    //     noRecord: false,
+    //     showSearch: false
+    //   })
+    // }
   },
 
-  onReachBottom () {
+  inputFocus: function () {
+
+  },
+
+  tapHeaderBar(e){
+    let { id } = e.currentTarget.dataset
+    this.setData({
+      activeType: id,
+      showSearch: false,
+      keyword: '',
+      brandList: [],
+      currentPage: 1
+    })
+
+    this.getBrandList(1)
+  },
+
+  tabShow(){
     this.setData({
-      hideMask: false
+      showSearch: true
     })
   },
+
+
+  tabHide() {
+    this.setData({
+      showSearch: false,
+      noRecord:false,
+      keyword:''
+    })
+  },
+
+
   
 
   onLoad: function (options) {
     this.setData({
       imgServer: util.imgServer
     })
+    this.getBrandList(1)
   },
   onReady: function () {
     // 页面渲染完成
@@ -141,8 +326,9 @@ Router({
     // 页面关闭
   },
   gotoWV: function (event){
+    let { id } = event.currentTarget.dataset
     wx.navigateTo({
-      url: '/pages/webview/index?url=' + event.currentTarget.dataset.url,
+      url: `/pages/webview/index?id=${id}`,
     })
   }
 })

+ 1 - 1
pages/index/index.json

@@ -1,3 +1,3 @@
 {
-  "enablePullDownRefresh": false
+  "enablePullDownRefresh": true
 }

+ 14 - 15
pages/index/index.wxml

@@ -1,24 +1,23 @@
 <view class="container">
-  
-  <view class="c-body" style="padding-bottom:{{ isiPhoneX ? '160rpx' : '100rpx'}}">
+<!-- style="padding-bottom:{{ isiPhoneX ? '150rpx' : '20rpx'}} -->
+  <view class="c-body">
     <view class="header">
       <view class="ul">
-        <view data-type='all' id="all" class="li active">全部</view>
-        <view data-type='meishi' class="li">美食</view>
-        <view data-type='fushi' class="li">服饰</view>
-        <view data-type='liren' class="li">丽人</view>
-        <view data-type='qita' class="li">其他</view>
+        <view bindtap="tapHeaderBar" wx:for="{{header}}" wx:key="{{item.type}}"  data-id='{{item.id}}' class="li {{item.id==activeType?'active':''}}">{{item.name}}</view>
+ 
       </view>
-       <view class="search">
-        <view></view>
+       <view class="search" bindtap="tabShow">
+        <view>
+          <text>{{keyword}}</text>
+        </view>
         <image wx:if="{{imgServer}}" src="{{imgServer + '/search.png'}}"></image>
       </view>
     </view>
 
     <view class="body" id="tab-con">
       <view class="ul">
-        <view bindtap="gotoWV" data-url="{{item.link}}" class="li" wx:for='{{raw}}' wx:key="*this">
-          <image wx:if="{{imgServer}}" mode="aspectFill" src="{{imgServer + '/' + item.img + '.png'}}"></image>
+        <view bindtap="gotoWV" data-img="{{item.img}}" data-id="{{item.id}}" class="li" wx:for='{{brandList}}' wx:key="*this">
+          <image wx:if="{{imgServer}}" mode="aspectFill" src="{{item.appListPicUrl}}"></image>
           <view class="b-title">
             <text>{{item.name}}</text>
           </view>
@@ -27,12 +26,12 @@
     </view>
 
     <view class="linear-mask {{hideMask? '': 'mask-hidden'}}" ></view>
-    <view class="search-con">
-      <view class="sc-con">
-        <input type="text"></input>
+    <view bindtap="tabHide" class="search-con" wx:if="{{showSearch}}">
+      <view class="sc-con" catchtap>
+        <input focus="true" value="{{keyword}}" bindinput="inputChange" bindconfirm="search" confirm-type="search" type="text"></input>
         <image  wx:if="{{imgServer}}" src="{{imgServer + '/fangdajing.png'}}"></image>
       </view>
-      <view class="no-record">未搜索到相关内容</view>
+      <view class="no-record" wx:if="{{noRecord}}">未搜索到相关内容</view>
     </view>
 
   </view>

+ 37 - 17
pages/index/index.wxss

@@ -1,5 +1,5 @@
 page,.container{
-  height: 100%;
+  background: #231815;
 }
 
 .c-body{
@@ -9,6 +9,10 @@ page,.container{
   position: relative;
 }
 
+.ul::-webkit-scrollbar{
+  display: none;
+}
+
 .linear-mask{
   position: fixed;
   bottom: 0;
@@ -36,7 +40,6 @@ page,.container{
 }
 
 .search-con{
-  display: none;
   position: fixed;
   bottom: 0;
   right: 0;
@@ -47,18 +50,17 @@ page,.container{
 }
 
 .no-record{
-  width: calc(100% - 40px);
-  margin: 20px 0 0 30px;
-  display: none;
+  width: calc(100% - 80rpx);
+  margin: 40rpx 0 0 60rpx;
 }
 
 .sc-con{
-  width: calc(100% - 40px);
-  line-height: 30px;
-  height: 30px;
+  width: calc(100% - 80rpx);
+  line-height: 60rpx;
+  height: 60rpx;
   border: 1px solid #808080;
-  border-radius: 15px;
-  margin: 10px 0 0 20px;
+  border-radius: 30rpx;
+  margin: 20rpx 0 0 40rpx;
   background: #fff;
   position: relative;
 }
@@ -67,19 +69,21 @@ page,.container{
   width: 90%;
   background: none;
   border: none;
-  padding-left: 15px;
-  font-size: 12px;
+  padding-left: 30rpx;
+  font-size: 24rpx;
   color: #000;
-  line-height: 20px;
+  line-height: 40rpx;
+  height: 56rpx;
 }
 
-.sc-con img{
-  width: 20px;
+.sc-con image{
+  width: 40rpx;
+  height: 40rpx;
   display: inline-block;
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
-  right: 10px;
+  right: 20rpx;
 }
 
 
@@ -96,7 +100,7 @@ page,.container{
 .header .ul{
   display: flex;
   justify-content: space-between;
-  padding-left: 20px;
+  padding-left: 40rpx;
   width: 70%;
 }
 
@@ -136,6 +140,22 @@ page,.container{
   font-size: 24rpx;
   color: #fff;
   line-height: 24rpx;
+  vertical-align: middle;
+}
+
+.header .search view text{
+  position: absolute;
+  top: 50%;
+  left: 20rpx;
+  font-size: 22rpx;
+  color:rgba(255,255,255,0.5);
+  transform: translateY(-50%);
+  display: inline-block;
+  width: 60%;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  word-break: break-all;
 }
 
 .header .search image{

+ 1 - 1
pages/logistics/index.wxml

@@ -9,7 +9,7 @@
     </view>
   </view>
 
-  <map id="map" longitude="113.214520" latitude="23.26329" scale="10" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%; height: 300px;"></map>
+  <!-- <map id="map" longitude="113.214520" latitude="23.26329" scale="10" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%; height: 300px;"></map> -->
 
   <view class="logisdetail">
     <view class="ul">

+ 3 - 3
pages/pay/pay.js

@@ -48,9 +48,9 @@ Page({
             })
           },
           'fail': function (res) {
-            wx.redirectTo({
-              url: '/pages/payResult/payResult?status=0',
-            })
+            // wx.redirectTo({
+            //   url: '/pages/payResult/payResult?status=0',
+            // })
           }
         })
       }

+ 3 - 5
pages/pay/pay.wxss

@@ -33,15 +33,13 @@ page{
 }
 .pay-list .h{
     width: 100%;
-    height: 24rpx;
-    line-height: 24rpx;
-    margin-left: 31.25rpx;
-    margin-bottom: 31.25rpx;
+    margin-left: 30rpx;
+    margin-bottom: 30rpx;
 }
 
 .pay-list .item{
     height: 108rpx;
-    padding-left: 31.25rpx;
+    padding-left: 30rpx;
     background: #fff;
     display: flex;
     align-items: center;

+ 1 - 0
pages/payResult/payResult.js

@@ -48,6 +48,7 @@ Page({
       this.setData({
         status: true
       });
+      this.updateSuccess()
     }).catch(res => {
       util.showErrorToast('支付失败');
     });

+ 2 - 3
pages/payResult/payResult.wxml

@@ -4,7 +4,7 @@
       <view class="msg">付款成功</view>
       <view class="btns">
       <!-- url="/pages/ucenter/order/order" -->
-        <navigator url="/pages/ucenter/order/order" hover-class="none"  open-type="redirect" class="btn">
+        <navigator url="/pages/ucenter/order/order?id=-1" hover-class="none"  open-type="redirect" class="btn">
           查看订单
         </navigator>
         <view class="btn" bindtap="naback">继续逛</view>
@@ -18,8 +18,7 @@
         <view class="p">否则订单将会被系统取消</view>
       </view>
       <view class="btns">
-        <navigator class="btn" url="/pages/ucenter/order/order" open-type="redirect">查看订单</navigator>
-        <!-- <view class="btn" bindtap="naback">查看订单</view> -->
+        <navigator class="btn" url="/pages/ucenter/order/order?id=-1" open-type="redirect">查看订单</navigator>
         <view class="btn" bindtap='payOrder'>重新付款</view>
       </view>
     </view>

+ 2 - 3
pages/search/search.js

@@ -11,7 +11,6 @@ Page({
     historyKeyword: [],
     categoryFilter: false,
     currentSortType: 'default',
-    currentSortOrder: '',
     filterCategory: [],
     defaultKeyword: {},
     hotKeyword: [],
@@ -126,8 +125,8 @@ Page({
     switch (currentId) {
       case 'categoryFilter':
         this.setData({
-          'categoryFilter': !this.data.categoryFilter,
-          'currentSortOrder': 'asc'
+          'categoryFilter': !this.data.categoryFilter
+          // 'currentSortOrder': 'asc'
         });
         break;
       case 'priceSort':

+ 1 - 1
pages/search/search.json

@@ -1,3 +1,3 @@
 {
-    
+  "enablePullDownRefresh": false    
 }

+ 10 - 4
pages/search/search.wxss

@@ -11,6 +11,7 @@ page{
 .search-header{
     position: fixed;
     top: 0;
+    z-index: 999;
     width: 750rpx;
     height: 91rpx;
     display: flex;
@@ -156,6 +157,7 @@ page{
     background: #fff;
     width: 100%;
     height: 78rpx;
+    z-index: 9999;
 }
 
 .sort-box{
@@ -207,9 +209,11 @@ page{
     background: #fff;
     width: 100%;
     height: auto;
+    z-index: 9999;
     overflow: hidden;
     padding: 40rpx 40rpx 0 0;
     border-bottom: 1px solid #d9d9d9;
+    position: relative;
 }
 
 .sort-box-category .item{
@@ -281,7 +285,9 @@ page{
   padding-bottom: 33.333rpx;
   height: auto;
   overflow: hidden;
+  min-height: 530rpx;
   text-align: center;
+  position: relative;
 }
 
 .cate-item .b .item-b{
@@ -295,8 +301,6 @@ page{
 
 .cate-item .item .name{
   display: block;
-  width: 365.625rpx;
-  height: 35rpx;
   margin: 11.5rpx 0 22rpx 0;
   text-align: center;
   overflow: hidden;
@@ -307,11 +311,13 @@ page{
 
 .cate-item .item .price{
   display: block;
-  width: 365.625rpx;
-  height: 30rpx;
   text-align: center;
   font-size: 30rpx;
   color: #1fe4dc;
+  position: absolute;
+  bottom: 10rpx;
+  left: 50%;
+  transform: translateX(-50%);
 }
 
 .search-result-empty{

+ 8 - 6
pages/shopping/address/address.wxss

@@ -1,7 +1,9 @@
 page{
-    height: 100%;
+    height: calc(100% - 100rpx);
     width: 100%;
     background: #f4f4f4;
+    padding-bottom: 100rpx;
+
 }
 
 .container{
@@ -14,13 +16,15 @@ page{
     background: #fff url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/address-bg-bd.png) 0 0 repeat-x;
     background-size: auto 10.5rpx;
     margin-bottom: 90rpx;
+    padding-bottom: 100rpx;
 }
 
 .address-list .item{
-    height: 156.55rpx;
+    min-height: 156rpx;
     align-items: center;
     display: flex;
     border-bottom: 1rpx solid #DCD9D9;
+    padding: 20rpx 0;
 }
 
 .address-list .item:last-child{
@@ -36,11 +40,11 @@ page{
 
 .address-list .name{
     width: 155rpx;
-    height: 43rpx;
+    min-height: 43rpx;
     font-size: 29rpx;
     color: #333;
     margin-bottom: 5.2rpx;
-        text-overflow: ellipsis;
+    text-overflow: ellipsis;
     white-space: nowrap;
     overflow: hidden;
 }
@@ -74,9 +78,7 @@ page{
 }
 
 .address-list .address{
-    height: 37rpx;
     font-size: 25rpx;
-    line-height: 37rpx;
     overflow: hidden;
     color: #666;
 }

+ 5 - 0
pages/shopping/addressAdd/addressAdd.js

@@ -292,6 +292,11 @@ Page({
       return false;
     }
 
+    if (!address.detailInfo.trim()) {
+      util.showErrorToast('请输入详细地址');
+      return false;
+    }
+
 
     let that = this;
     util.request(api.AddressSave, { 

+ 1 - 1
pages/shopping/addressAdd/addressAdd.wxss

@@ -104,7 +104,7 @@ page{
 }
 
 .region-select .region-selected .item{
-  max-width: 220rpx;
+  max-width: 170rpx;
   margin-right: 30rpx;
   text-align: left;
   line-height: 60rpx;

+ 2 - 2
pages/shopping/checkout/checkout.wxml

@@ -1,4 +1,4 @@
-<view class="container">
+<view class="container {{isiPhoneX ? 'pbtest' : ''}}" >
     <view class="address-box">
         <view class="address-item" bindtap="selectAddress" wx:if="{{checkedAddress.id > 0}}">
             <view class="l">
@@ -78,7 +78,7 @@
         </view>
     </view>
 
-    <view class="order-total {{isiPhoneX ? 'isIPx' : ''}}">
+    <view class="order-total">
         <view class="l">实付:¥{{actualPrice}}</view>
         <view class="r" bindtap="submitOrder">去付款</view>
     </view>

+ 10 - 9
pages/shopping/checkout/checkout.wxss

@@ -1,11 +1,13 @@
 page{
-    height: 100%;
-    background: #f4f4f4;
+  background: #f4f4f4;
+  height: 100%;
+}
+
+.container{
 }
 
 .address-box{
     width: 100%;
-    height: 166.55rpx;
     background: url('https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/address-bg-bd.png') 0 0 repeat-x;
     background-size: 62.5rpx 10.5rpx;
     margin-bottom: 20rpx;
@@ -14,7 +16,7 @@ page{
 
 .address-item{
     display: flex;
-    height: 155.55rpx;
+    min-height: 156rpx;
     background: #fff;
     padding: 41.6rpx 0 41.6rpx 31.25rpx;
 }
@@ -34,11 +36,12 @@ page{
     margin-top: -7.25rpx;
     display: block;
     width: 155rpx;
-    height: 43rpx;
-    line-height: 43rpx;
     font-size: 30rpx;
     color: #333;
     margin-bottom: 5rpx;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
 
 }
 
@@ -57,7 +60,6 @@ page{
 
 .address-box .m{
     flex: 1;
-    height: 72.25rpx;
     color: #999;
 }
 
@@ -72,8 +74,6 @@ page{
 
 .address-box .address{
     display: block;
-    height: 37.5rpx;
-    line-height: 37.5rpx;
     font-size: 25rpx;
     color:#666;
 }
@@ -188,6 +188,7 @@ page{
     background: #fff;
     padding-left: 31.25rpx;
     margin-bottom: 120rpx;
+    padding-bottom: 164rpx;
 }
 
 .goods-items .item{

+ 1 - 1
pages/topicDetail/topicDetail.wxml

@@ -32,7 +32,7 @@
     <view class="no-comments" wx:if="{{commentList.length <= 0}}">
         <view class="b">    
             <image class="icon" src="http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-comment-560f87660a.png"></image>
-            <text class="txt">等来留言</text>
+            <text class="txt">等来留言</text>
         </view>
     </view>
   </scroll-view>

+ 7 - 5
pages/ucenter/address/address.wxss

@@ -1,12 +1,13 @@
 page{
-    height: 100%;
     width: 100%;
+    height: calc(100% - 100rpx);
+    padding-bottom: 100rpx;
     background: #f4f4f4;
 }
 
 .container{
-  height: 100%;
   width: 100%;
+    height: 100%;
 }
 
 .address-list{
@@ -14,13 +15,16 @@ page{
     background: #fff url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/address-bg-bd.png) 0 0 repeat-x;
     background-size: auto 10.5rpx;
     margin-bottom: 90rpx;
+    padding-bottom: 100rpx;
 }
 
 .address-list .item{
-    height: 156.55rpx;
+    min-height: 156rpx;
     align-items: center;
     display: flex;
     border-bottom: 1rpx solid #DCD9D9;
+    padding: 20rpx 0; 
+
 }
 
 .address-list .l{
@@ -69,9 +73,7 @@ page{
 }
 
 .address-list .address{
-    height: 37rpx;
     font-size: 25rpx;
-    line-height: 37rpx;
     overflow: hidden;
     color: #666;
 }

+ 26 - 3
pages/ucenter/addressAdd/addressAdd.js

@@ -24,7 +24,8 @@ Page({
     ],
     regionType: 1,
     regionList: [],
-    selectRegionDone: false
+    selectRegionDone: false,
+    currentRegion:0
   },
   bindinputMobile(event) {
     let address = this.data.address;
@@ -43,6 +44,8 @@ Page({
   bindinputAddress (event){
     let address = this.data.address;
     address.detailInfo = event.detail.value;
+    
+
     this.setData({
       address: address
     });
@@ -164,6 +167,9 @@ Page({
     let selectRegionList = this.data.selectRegionList;
     selectRegionList[regionType - 1] = regionItem;
 
+    this.setData({
+      currentRegion: this.data.regionList[regionIndex]
+    })
 
     if (regionType != 3) {
       this.setData({
@@ -244,7 +250,7 @@ Page({
   getRegionList(regionId) {
     let that = this;
     let regionType = that.data.regionType;
-    util.request(api.RegionList, { parentId: regionId }).then(function (res) {
+    util.request(api.RegionList, { parentId: regionId || that.data.currentRegion.id }).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           regionList: res.data.map(item => {
@@ -286,7 +292,12 @@ Page({
       return false;
     }
 
-    if (!address.detailInfo) {
+    if (!address.detailInfo){
+      util.showErrorToast('请输入详细地址');
+      return false;
+    }
+
+    if (!address.detailInfo.trim()) {
       util.showErrorToast('请输入详细地址');
       return false;
     }
@@ -309,6 +320,18 @@ Page({
         wx.navigateBack({
           url: '/pages/ucenter/address/address',
         })
+      }else{
+
+        wx.showModal({
+          title: '提示',
+          content: res.errmsg,
+          showCancel: false,
+          confirmColor:'#1fe4dc',
+          success: function (res) {
+
+          }
+        })
+     
       }
     });
 

+ 1 - 1
pages/ucenter/addressAdd/addressAdd.wxml

@@ -1,7 +1,7 @@
 <view class="add-address">
     <view class="add-form">
         <view class="form-item">
-            <input class="input" bindinput="bindinputName" placeholder="姓名" value="{{address.userName}}" auto-focus/>
+            <input class="input"  bindinput="bindinputName" placeholder="姓名" value="{{address.userName}}" auto-focus/>
         </view>
         <view class="form-item">
             <input class="input" bindinput="bindinputMobile" value="{{address.telNumber}}" maxlength="15" type="number" placeholder="手机号码"/>

+ 5 - 4
pages/ucenter/addressAdd/addressAdd.wxss

@@ -104,7 +104,7 @@ page{
 }
 
 .region-select .region-selected .item{
-  max-width: 220rpx;
+  max-width: 170rpx;
   margin-right: 30rpx;
   text-align: left;
   line-height: 60rpx;
@@ -112,8 +112,8 @@ page{
   color: #333;
   font-size: 28rpx;
   overflow: hidden;
-      text-overflow: ellipsis;
-    white-space: nowrap;
+  text-overflow: ellipsis;
+  white-space: nowrap;
 }
 
 .region-select .region-selected .item.disabled{
@@ -150,7 +150,8 @@ page{
 
 .region-select .region-list{
   height: auto;
-  overflow: scroll;
+  overflow-y: scroll;
+  overflow-x: hidden;
 
 }
 

+ 1 - 1
pages/ucenter/collect/collect.wxml

@@ -1,6 +1,6 @@
 <view class="container">
   <view class="collect-list">
-    <view class="item" bindtap="openGoods"  bindtouchstart="touchStart" bindtouchend="touchEnd" wx:for="{{collectList}}" wx:key="{{item.id}}" data-index="{{index}}">
+    <view class="item" bindtap="openGoods" wx:for="{{collectList}}" wx:key="{{item.id}}" data-index="{{index}}">
       <image class="img" src="{{item.list_pic_url}}"></image>
       <view class="info">
         <view class="name">{{item.name}}</view>

+ 1 - 1
pages/ucenter/feedback/feedback.wxml

@@ -16,7 +16,7 @@
   <view class="fb-mobile">
     <view class="label">手机号码</view>
     <view class="mobile-box">
-      <input class="mobile" maxlength="11" type="number" placeholder="方便我们与联系" bindinput ="mobileInput" value="{{mobile}}"/>
+      <input class="mobile" maxlength="11" type="number" placeholder="方便我们与联系" bindinput ="mobileInput" value="{{mobile}}"/>
       <!--
       <image class="clear-icon" src="https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150647657fcdd0.png" bindtap="cleanMobile"></image>
       -->

+ 3 - 2
pages/ucenter/feedback/feedback.wxss

@@ -1,12 +1,13 @@
 page{
     background: #f4f4f4;
-    min-height: 100%;
 }
 
 .container{
     background: #f4f4f4;
-    min-height: 100%;
     padding-top: 30rpx;
+    width: 100%;
+    overflow: hidden;
+
 }
 
 .fb-type{

+ 162 - 60
pages/ucenter/index/index.js

@@ -3,49 +3,119 @@ var api = require('../../../config/api.js');
 var user = require('../../../services/user.js');
 var app = getApp();
 // 定义插件变量 引入方法
-var plugin = requirePlugin("ykfchat");
 
+const tempUserInfo = {
+  nickName: 'Hi,游客',
+  userName: '点击去登录',
+  avatarUrl: 'https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150547696d798c.png'
+}
 
 Page({
     data: {
         userInfo: {},
-        hasMobile: ''
+        hasMobile: '',
+        imgServer: util.imgServer,
+        all: {
+          icon: 'ct1',
+          name: '全部订单',
+          id: -1
+        },
+        orderList:[
+          
+          {
+            icon: 'ct2',
+            name: '待付款',
+            id: 0
+          },
+          {
+            icon: 'ct3',
+            name: '待发货',
+            id: 201
+          },
+          {
+            icon: 'ct4',
+            name: '待收货',
+            id: 300
+          },
+          {
+            icon: 'ct5',
+            name: '已完成',
+            id: 301
+          }
+        ],
+        barList:[
+          {
+            icon: 'cb1',
+            url: '/pages/ucenter/collect/collect',
+            name: '我的收藏',
+            id: 0
+          },
+          {
+            icon: 'cb2',
+            url: '/pages/ucenter/footprint/footprint',
+            name: '我的足迹',
+            id: 1
+          },
+          {
+            icon: 'cb3',
+            url: '/pages/ucenter/feedback/feedback',
+            name: '意见反馈',
+            id: 2
+          }
+        ],
+        relatedGoods: [],
+        isLogin: app.globalData.isLogin
+
     },
-    getOpenId(callback) {
-      //   wx.login({
-      //     success: function (res) {
-      //       console.log(res)
-      // wx.login({
-      //   success:function(res){
-      //     // openid = 
-      //       console.log('oppenid',res)
-      //   }
-      // })
-      // 拿到js-code如换取得到openid
-      let openid = '099231288474444' //假数据  模拟openid
-      let data = {
-        openid: openid
-      }
-      console.log(data)
-      callback(data)
-      // },
-      // })
-    },            
-    norma() {
-      //scene是从芝麻小客服后台接入获取的
-      plugin.callback.on("getOpenId", this.getOpenId, this); // 事件名称, 本地获取openid的方法,this作用域
-      wx.navigateTo({
-        url: 'plugin://ykfchat/chat-page?wechatapp_id=165586&channel_id=7549&scene=p2004q9l8pl',
+    getGoodsRelated: function () {
+      let that = this;
+      util.request(api.GoodsRelated, {}).then(function (res) {
+        if (res.errno === 0) {
+          that.setData({
+            relatedGoods: res.data.goodsList,
+          });
+        }
       });
     },
-    norma2() {
-      //scene是从芝麻小客服后台接入获取的
+
+  
+
+  tapByIdx:function(e){
+    let {
+      url
+    } = e.currentTarget.dataset;
+
+    console.log(app.globalData)
+
+    if (this.data.isLogin) {
       wx.navigateTo({
-        url: 'plugin://ykfchat/chat-page?wechatapp_id=165586&channel_id=7552&scene=p2007c6pupl',
-      });
-    },
-    onLoad: function (options) {
-        // 页面初始化 options为页面跳转所带来的参数
+        url: url,
+        success: function (res) { },
+        fail: function (res) { },
+        complete: function (res) { },
+      })
+    } else {
+
+      wx.navigateTo({
+        url: '/pages/auth/btnAuth/btnAuth',
+      })
+      // wx.showModal({
+      //   title: '提示',
+      //   content: '请登录后查看',
+      //   showCancel: false,
+      //   confirmColor: '#1fe4dc',
+      //   success: res=>{
+
+      //   }
+      // });
+    }
+
+  },
+  onLoad: function (options) {
+      // 页面初始化 options为页面跳转所带来的参数
+      this.getGoodsRelated()
+
+     
     },
     onReady: function () {
 
@@ -62,7 +132,30 @@ Page({
       }
 
       this.setData({
-          userInfo: app.globalData.userInfo,
+        userInfo: app.globalData.userInfo,
+        token: app.globalData.token
+      });
+
+      util.request(api.CartList).then((res) => {
+        let isLogin = false
+        if (res.errno === 401) {
+          isLogin = false
+          app.globalData.userInfo = tempUserInfo;
+          app.globalData.token = '';
+        } else {
+          isLogin = true
+          app.globalData.userInfo = userInfo;
+          app.globalData.token = token;
+        }
+        if (!isLogin){
+          this.setData({
+            token:'',
+            userInfo: tempUserInfo
+          });
+        }
+        this.setData({
+          isLogin
+        });
       });
 
       if (typeof this.getTabBar === 'function' && this.getTabBar()) {
@@ -92,38 +185,47 @@ Page({
             //用户按了允许授权按钮
             user.loginByWeixin(e.detail).then(res => {
                 this.setData({
-                    userInfo: res.data.userInfo
+                    userInfo: res.data.userInfo,
+                    isLogin: true
                 });
                 app.globalData.userInfo = res.data.userInfo;
                 app.globalData.token = res.data.token;
+                
             }).catch((err) => {
-                console.log(err)
+              this.setData({
+                token: '',
+                userInfo: tempUserInfo
+              });
+              app.globalData.userInfo = tempUserInfo;
+              app.globalData.token = '';
+              console.log(err)
             });
         } else {
             //用户按了拒绝按钮
-            wx.showModal({
-                title: '警告通知',
-                content: '您点击了拒绝授权,将无法正常显示个人信息,点击确定重新获取授权。',
-                success: function (res) {
-                    if (res.confirm) {
-                        wx.openSetting({
-                            success: (res) => {
-                                if (res.authSetting["scope.userInfo"]) {////如果用户重新同意了授权登录
-                                    user.loginByWeixin(e.detail).then(res => {
-                                        this.setData({
-                                            userInfo: res.data.userInfo
-                                        });
-                                        app.globalData.userInfo = res.data.userInfo;
-                                        app.globalData.token = res.data.token;
-                                    }).catch((err) => {
-                                        console.log(err)
-                                    });
-                                }
-                            }
-                        })
-                    }
-                }
-            });
+            // wx.showModal({
+            //     title: '温馨提示',
+            //     content: '您点击了"取消"授权,将无法获取四维商圈完整服务。请“授权”以保证各项功能正常使用。',
+            //     confirmText:'授权',
+            //     success: function (res) {
+            //         if (res.confirm) {
+            //             wx.openSetting({
+            //                 success: (res) => {
+            //                     if (res.authSetting["scope.userInfo"]) {////如果用户重新同意了授权登录
+            //                         user.loginByWeixin(e.detail).then(res => {
+            //                             this.setData({
+            //                                 userInfo: res.data.userInfo
+            //                             });
+            //                             app.globalData.userInfo = res.data.userInfo;
+            //                             app.globalData.token = res.data.token;
+            //                         }).catch((err) => {
+            //                             console.log(err)
+            //                         });
+            //                     }
+            //                 }
+            //             })
+            //         }
+            //     }
+            // });
         }
     },
     exitLogin: function () {

+ 49 - 62
pages/ucenter/index/index.wxml

@@ -1,72 +1,59 @@
 <view class="container">
-  <button class="userinfo" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
-		<image wx:if="{{userInfo && userInfo.avatarUrl}}" class="userinfo-avatar" src="{{ userInfo.avatarUrl }}" background-size="cover"></image>
-		<text class="userinfo-nickname">{{ userInfo.nickName }}</text>
-	</button>
-  <view style="height:20rpx;background: #eee;width:100%;"></view>
-  <view class="my-item" style='background:none;display:flex;flex-direction:column;height:auto;'></view>
-  
-  <view class="user-menu">
-    <view class="item">
-      <navigator hover-class="none" url="/pages/ucenter/order/order" class="a">
-        <text class="icon order"></text>
-        <text class="txt">我的订单</text>
-      </navigator>
-    </view>
-    <!-- <view class="item">
-      <navigator url="/pages/ucenter/coupon/coupon" class="a">
-        <text class="icon coupon"></text>
-        <text class="txt">优惠券</text>
-      </navigator>
-    </view> -->
-    <view class="item">
-      <navigator hover-class="none"  url="/pages/ucenter/collect/collect" class="a">
-        <text class="icon address"></text>
-        <text class="txt">我的收藏</text>
-      </navigator>
+  <view class="userinfo">
+    <view class="u-avatar" >
+      <button class="btn-cls" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo"></button>
+      <image  class="userinfo-avatar" src="{{ userInfo.avatarUrl }}" background-size="cover"></image>
+      <text class="userinfo-nickname">{{userInfo.nickName}}</text>
     </view>
-    <view class="item" style="border-right:none">
-      <navigator hover-class="none"  url="/pages/ucenter/footprint/footprint" class="a">
-        <text class="icon security"></text>
-        <text class="txt">我的足迹</text>
-      </navigator>
+    <view class="userinfo-setting navigator"  bindtap="tapByIdx" data-url="/pages/ucenter/address/address">
+      <image wx:if="{{imgServer}}" src="{{imgServer+'/c_setting.png'}}"></image>
     </view>
-    <view class="item">
-      <navigator hover-class="none"  hover-class="none" url="../address/address" class="a">
-        <text class="icon address"></text>
-        <text class="txt">地址管理</text>
-      </navigator>
+	</view>
+
+  
+  <view class="order-list">
+      <view  bindtap="tapByIdx" data-url="{{'/pages/ucenter/order/order?id='+all.id}}" class="navigator a or-a">
+        <image wx:if="{{imgServer}}" src="{{imgServer+'/'+all.icon+'.png'}}"></image>
+        <view class="txt">{{all.name}}</view>
+      </view>
+
+      <view class="i-line"></view>
+
+      <view wx:for="{{orderList}}"  bindtap="tapByIdx" wx:key="{{item.id}}" data-url="{{'/pages/ucenter/order/order?id='+item.id}}" class="navigator a">
+        <image wx:if="{{imgServer}}" src="{{imgServer+'/'+item.icon+'.png'}}"></image>
+        <view class="txt">{{item.name}}</view>
+      </view>
+  </view>
+
+   <view class="order-list">
+      <view wx:for="{{barList}}"  bindtap="tapByIdx" wx:key="{{item.id}}"  data-url="{{item.url}}" class="navigator a">
+        <image wx:if="{{imgServer}}" src="{{imgServer+'/'+item.icon+'.png'}}"></image>
+        <view>{{item.name}}</view>
+      </view>
+
+      <view class="navigator" >
+        <button  open-type="contact">
+          <image wx:if="{{imgServer}}" src="{{imgServer+'/cb4.png'}}"></image>
+          <view>联系客服</view>
+        </button>
+      </view>
+     
+  </view>
+
+    <view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
+    <view class="h">
+      <view class="line"></view>
+      <text class="title">大家都在看</text>
     </view>
-    <button class='service' open-type="contact">
-      <view class="item no-border">
-        <navigator hover-class="none"  url="url" class="a">
-          <text class="icon kefu"></text>
-          <text class="txt">联系客服</text>
+    <view class="b">
+      <view class="item" wx:for="{{relatedGoods}}" wx:key="*this">
+        <navigator hover-class="none" url="/pages/goods/goods?id={{item.id}}">
+          <image class="img" src="{{item.list_pic_url}}" background-size="cover"></image>
+          <text class="name">{{item.name}}</text>
+          <text class="price">¥{{item.retail_price}}</text>
         </navigator>
       </view>
-    </button>
-    <!-- <view class="item item-bottom">
-      <navigator url="/pages/ucenter/help/help" class="a">
-        <text class="icon help"></text>
-        <text class="txt">帮助中心</text>
-      </navigator>
-    </view> -->
-    <view class="item item-bottom">
-      <navigator hover-class="none"  url="/pages/ucenter/feedback/feedback" class="a">
-        <text class="icon feedback"></text>
-        <text class="txt">意见反馈</text>
-      </navigator>
     </view>
-    <!-- <view class="item item-bottom" v-if="hasMobile != ''">
-      <navigator url="/pages/auth/mobile/mobile" class="a">
-        <text class="icon phone"></text>
-        <text class="txt">绑定手机</text>
-      </navigator>
-    </view> -->
   </view>
-  <!-- <view class="kefutest" bindtap="norma">客服</view>
-  <view class="kefutest2" bindtap="norma">客服2</view> -->
 
-  <!-- <view class='company'>安徽微同科技有限公司提供技术支持 © fly2you.cn</view> -->
-  <!-- <view class="logout" bindtap="exitLogin">退出登录</view> -->
 </view>

+ 162 - 112
pages/ucenter/index/index.wxss

@@ -11,24 +11,49 @@ page{
 }
 .userinfo {
 	display: flex;
-	flex-direction: column;
-	padding: 50rpx 0;
-	align-items: center;
-	background: #333;
-  width: 750rpx;
+  justify-content: space-between;
+  align-items: center;
+	padding: 20rpx 60rpx 20rpx 40rpx;
+	background: #1fe4dc;
+  width: 100%;
+}
+
+.u-avatar{
+  position: relative;
+  display: flex;
+  align-items: center;
 }
 
 .userinfo-avatar {
-	width: 160rpx;
-	height: 160rpx;
-	margin: 20rpx;
+	width: 100rpx;
+	height: 100rpx;
+	margin: 0;
 	border-radius: 50%;
 }
 
 .userinfo-nickname {
-  margin-top: 20rpx;
-  color: #FFF;
+  color: #010101;
+  margin-left: 20rpx;
 }
+
+.userinfo-setting image{
+  width: 60rpx;
+  height: 60rpx;
+}
+
+.btn-cls{
+  opacity: 0;
+  position: absolute;
+  width: 100rpx;
+	height: 100rpx;
+	margin: 0;
+	border-radius: 50%;
+  padding: 0;
+  top: 0;
+  left: 0;
+  z-index: 999;
+}
+
 .profile-info{
     width: 100%;
     height: 280rpx;
@@ -70,143 +95,168 @@ page{
     font-size: 30rpx;
 }
 
-.user-menu{
-    width: 100%;
-    height: auto;
-    overflow: hidden;
-    background: #fff;
+.service {
+  position: static;
+  background-color: transparent;
+  color: transparent;
+  margin: 0;
+  padding: 0;
+  border: none;
+  text-align: left;
+  line-height: normal;
+  display: inline;
 }
 
-.user-menu .item{
-    float: left;
-    width: 33.33333%;
-    height: 187.5rpx;
-    border-right: 1px solid rgba(0,0,0,.15);
-    border-bottom: 1px solid rgba(0,0,0,.15);
-    text-align: center;
+.company {
+  font-size:20rpx;
+  text-align:center;
+  margin-top:50px;
 }
 
-.user-menu .item .a{
-  display: flex;
-  width: 100%;
-  height: 100%;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
+.kefutest{
+  width: 100rpx;
+  background: red;
+  height: 50rpx;
+  position: absolute;
+  bottom: 0;
 }
 
-.user-menu .item.no-border {
-    border-right: 0;
-    width: calc(33.33333% - 1px)
+.kefutest2{
+  width: 100rpx;
+  background: red;
+  height: 50rpx;
+  position: absolute;
+  bottom: 80rpx;
 }
 
-.user-menu .item.item-bottom {
-    border-right: none;
-    border-left: 1px solid rgba(0,0,0,.15);
+.order-list{
+  background: #fff;
+  padding: 40rpx 20rpx;
+  display: flex;
+  justify-content: space-around;
+  margin-bottom: 20rpx;
+  font-size: 24rpx;
 }
 
-.user-menu .icon{
-    margin: 0 auto;
-    display: block;
-    height: 52.803rpx;
-    width: 52.803rpx;
-    margin-bottom: 16rpx;
+.i-line{
+  width: 2rpx;
+  height: 100rpx;
+  background: #f4f4f4;
 }
 
-.user-menu .icon.order{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -437.5rpx no-repeat;
-    background-size: 52.803rpx;
+.order-list .or-a{
+  flex: 5
 }
 
-.user-menu .icon.coupon{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -62.4997rpx no-repeat;
-    background-size: 52.803rpx;
+.order-list .navigator,.order-list button{
+  text-align: center;
+  background: none;
+  opacity: 1;
+  font-size: 0;
+  padding: 0;
+  flex: 4;
 }
 
-.user-menu .icon.gift{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -187.5rpx no-repeat;
-    background-size: 52.803rpx;
-}
 
-.user-menu .icon.address{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 0 no-repeat;
-    background-size: 52.803rpx;
+.order-list view{
+  font-size: 24rpx;
+  line-height: 1;
 }
 
-.user-menu .icon.security{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -500rpx no-repeat;
-    background-size: 52.803rpx;
+.order-list image{
+  width: 54rpx;
+  height: 54rpx;
+  margin-bottom: 18rpx;
 }
 
-.user-menu .icon.kefu{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -312.5rpx no-repeat;
-    background-size: 52.803rpx;
-}
 
-.user-menu .icon.help{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -250rpx no-repeat;
-    background-size: 52.803rpx;
-}
 
-.user-menu .icon.feedback{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/img_sprites_ucenter.png) 0 -125rpx no-repeat;
-    background-size: 52.803rpx;
-}
-.user-menu .icon.phone{
-    background: url(https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/sp-phone.png) no-repeat;
-    background-size: 52.803rpx;
+.related-goods{
+    width: 750rpx;
+    height: auto;
+    overflow: hidden;
 }
 
+.related-goods .h{
+    position: relative;
+    height: 145.5rpx;
+    width: 750rpx;
+    padding: 56.25rpx 0;
+    background: #fff;
+    text-align: center;
+    border-bottom: 1px solid #f4f4f4;
+}
 
-.user-menu .txt{
-    display: block;
-    height: 24rpx;
-    width: 100%;
-    font-size: 24rpx;
-    color:#333;
+.related-goods .h .line{
+    display: inline-block;
+    position: absolute;
+    top: 72rpx;
+    left: 0;
+    z-index: 2;
+    height: 1px;
+    margin-left: 225rpx;
+    width: 300rpx;
+    background: #ccc;
 }
 
-.logout{
-    margin-top: 50rpx;
-    height: 101rpx;
-    width: 100%;
-    line-height: 101rpx;
-    text-align: center;
+.related-goods .h .title{
+    display: inline-block;
+    position: absolute;
+    top: 56.125rpx;
+    left: 0;
+    z-index: 3;
+    height: 33rpx;
+    margin-left: 285rpx;
+    width: 180rpx;
     background: #fff;
-    color: #333;
-    font-size: 30rpx;
 }
 
-.service {
-  position: static;
-  background-color: transparent;
-  color: transparent;
-  margin: 0;
-  padding: 0;
-  border: none;
-  text-align: left;
-  line-height: normal;
-  display: inline;
+.related-goods .b{
+  width: 750rpx;
+  height: auto;
+  overflow: hidden;
 }
 
-.company {
-  font-size:20rpx;
-  text-align:center;
-  margin-top:50px;
+.related-goods .b .item{
+  float: left;
+  background: #fff;
+  width: 375rpx;
+  height: auto;
+  overflow: hidden;
+  text-align: center;
+  padding: 15rpx 31.25rpx;
+  border-right: 1px solid #f4f4f4;
+  border-bottom: 1px solid #f4f4f4;
+  min-height: 530rpx;
+  position: relative;
 }
 
-.kefutest{
-  width: 100rpx;
-  background: red;
-  height: 50rpx;
-  position: absolute;
-  bottom: 0;
+.related-goods .item .img{
+  width: 312rpx;
+  height: 312rpx;
 }
 
-.kefutest2{
-  width: 100rpx;
-  background: red;
-  height: 50rpx;
+.related-goods .item .name{
+  display: block;
+  width: 312rpx;
+  margin: 11.5rpx 0 15rpx 0;
+  text-align: center;
+  font-size: 30rpx;
+  color: #333;
+  display: -webkit-box;
+  overflow: hidden;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 3;
+}
+
+.related-goods .item .price{
+  display: block;
+  width: 312rpx;
+  height: 40rpx;
+  text-align: center;
+  font-size: 30rpx;
+  color: #1fe4dc;
   position: absolute;
-  bottom: 80rpx;
-}
+  bottom: 10rpx;
+
+}

+ 45 - 3
pages/ucenter/order/order.js

@@ -9,9 +9,41 @@ Page({
     loadmoreText: '正在加载更多数据',
     nomoreText: '全部加载完成',
     nomore: false,
-    totalPages: 1
+    totalPages: 1,
+    activeIdx:-1,
+    header:[
+      {
+        icon: 'ct1',
+        name: '全部订单',
+        id: -1
+      },
+      {
+        icon: 'ct2',
+        name: '待付款',
+        id: 0
+      },
+      {
+        icon: 'ct3',
+        name: '待发货',
+        id: 201
+      },
+      {
+        icon: 'ct4',
+        name: '待收货',
+        id: 300
+      },
+      {
+        icon: 'ct5',
+        name: '已完成',
+        id: 301
+      }
+    ]
   },
   onLoad:function(options){
+    let {id} = options
+    this.setData({
+      activeIdx:id
+    })
     // 页面初始化 options为页面跳转所带来的参数
     // 页面显示
   },
@@ -41,10 +73,20 @@ Page({
     this.getOrderList()
   },
 
-  getOrderList(){
+  tabHeader:function(e){
+    let {id} = e.currentTarget.dataset
+    this.setData({
+      activeIdx: id
+    })
+    this.refresh()
+  },
+
+  getOrderList(id){
     let that = this;
 
-    util.request(api.OrderList, {page: that.data.page, size: that.data.size}).then(function (res) {
+    console.log('this.data', this.data.activeIdx)
+
+    util.request(api.OrderList, { page: that.data.page, size: that.data.size, orderStatus: that.data.activeIdx}).then(function (res) {
       if (res.errno === 0) {
         that.setData({
           orderList: that.data.orderList.concat(res.data.data),

+ 12 - 5
pages/ucenter/order/order.wxml

@@ -1,4 +1,10 @@
 <view class="container">
+  <view class="header-list">
+    <view class="li {{activeIdx==item.id?'active':''}}" wx:for="{{header}}" bindtap="tabHeader" data-id="{{item.id}}" wx:key="index">
+      {{item.name}}
+    </view>
+  </view>
+
     <view class="orders">
         <navigator hover-class="none" url="../orderDetail/orderDetail?id={{item.id}}" class="order" wx:for="{{orderList}}" wx:key="{{item.id}}">
             <view class="h">
@@ -7,19 +13,20 @@
             </view>
             <view class="goods" wx:for="{{item.goodsList}}" wx:key="{{gitem.id}}" wx:for-item="gitem">
                 <view class="img">
-                    <image src="{{gitem.list_pic_url}}"></image>
+                    <image mode="aspectFit" src="{{gitem.list_pic_url}}"></image>
                 </view>
                 <view class="info">
                     <text class="name">{{gitem.goods_name}}</text>
-                    <text class="number">共{{gitem.number}}件商品</text>
+                    <text class="number">¥{{gitem.retail_price}} x {{gitem.number}}</text>
                 </view>
                 <view class="status"></view>
             </view>
             <view class="b">
-                <view class="l">实付:¥{{item.actual_price}}</view>
-                <view class="r">
+                <!-- <view class="l">实付:¥{{item.actual_price}}</view> -->
+                <view class="t">共{{item.goodsCount}}件商品,价格:¥{{item.actual_price}}</view>
+                <!-- <view class="r">
                     <button class="btn default"  data-id="{{item.id}}" data-no="{{item.shipping_no}}" wx:if="{{item.shipping_status}}" catchtap="gotoLogti">查看物流</button>
-                </view>
+                </view> -->
                 <view class="r">
                     <button class="btn" data-order-index="{{index}}" catchtap="payOrder" wx:if="{{item.handleOption.pay}}">去付款</button>
                 </view>

+ 47 - 35
pages/ucenter/order/order.wxss

@@ -4,6 +4,23 @@ page{
     background: #f4f4f4;
 }
 
+.header-list{
+  background: #fff;
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+  padding: 20rpx 0;
+  border-top: 1px solid #f4f4f4;
+}
+
+.header-list .li{
+  font-size: 28rpx;
+}
+
+.header-list .active{
+  color: #1fe4dc;
+}
+
 .orders{
     height: auto;
     width: 100%;
@@ -20,60 +37,55 @@ page{
     line-height: 83.3rpx;
     margin-left: 31.25rpx;
     padding-right: 31.25rpx;
-    border-bottom: 1px solid #f4f4f4;
     font-size: 30rpx;
     color: #333;
 }
 
 .order .h .l{
-    float: left;
+  float: left;
+  font-size: 26rpx;
 }
 
 .order .h .r{
     float: right;
-    color: #1fe4dc;
-    font-size: 24rpx;
+    color: #000;
+    font-weight: bold;
+    font-size: 28rpx;
 }
 
 .order .goods{
     display: flex;
-    align-items: center;
-    height: 199rpx;
-    margin-left: 31.25rpx;
+    height: 200rpx;
+    margin-left: 30rpx;
 }
 
 .order .goods .img{
-    height:145.83rpx;
-    width:145.83rpx;
+    height:140rpx;
+    width:140rpx;
     background: #f4f4f4;
 }
 
 .order .goods .img image{
-    height:145.83rpx;
-    width:145.83rpx;
+    height:140rpx;
+    width:140rpx;
 }
 
 .order .goods .info{
-    height: 145.83rpx;
-    flex: 1;
+    width: 100%;
     padding-left: 20rpx;
 }
 
 .order .goods .name{
-    margin-top: 30rpx;
     display: block;
-    height: 44rpx;
-    line-height: 44rpx;
     color: #333;
-    font-size: 30rpx;
+    font-size: 28rpx;
 }
 
 .order .goods .number{
     display: block;
-    height: 37rpx;
-    line-height: 37rpx;
-    color: #666;
-    font-size: 25rpx;
+    color: #000;
+    font-size: 24rpx;
+    margin-top: 40rpx;
 }
 
 .order .goods .status{
@@ -83,35 +95,35 @@ page{
 }
 
 .order .b{
-    height: 103rpx;
-    line-height: 103rpx;
-    margin-left: 31.25rpx;
-    padding-right: 31.25rpx;
+    padding: 20rpx 32rpx 20rpx 0rpx;
     border-top: 1px solid #f4f4f4;
-    font-size: 30rpx;
-    color: #333;
+    font-size: 0;
 }
 
-.order .b .l{
-    float: left;
+.order .b .t{
+  text-align: right;
+  font-size: 28rpx;
+  color: #000000;
 }
 
 .order .b .r{
-    float: right;
     margin-left: 10rpx;
+    display: inline-block;
+    text-align: right;
+    width: 100%;
+    margin-top: 14rpx;
 }
 
-
 .order .b .btn{
-    margin-top: 19rpx;
-    height: 64.5rpx;
-    line-height: 64.5rpx;
+    height: 50rpx;
+    line-height: 50rpx;
+    padding: 0 30rpx;
     text-align: center;
-    padding: 0 20rpx;
     border-radius: 5rpx;
     font-size: 26rpx;
     color: #fff;
     background: #1fe4dc;
+    float: right;
 }
 
 .order .b .default{

二進制
pages/ucenter/orderDetail/dianpu.png


+ 16 - 2
pages/ucenter/orderDetail/orderDetail.js

@@ -15,6 +15,20 @@ Page({
     });
     this.getOrderDetail();
   },
+  gotoLogti: function(e){
+    let {no,id} = e.currentTarget.dataset
+    wx.navigateTo({
+      url: '/pages/logistics/index?no=' + no + '&id=' + id
+    })
+  },
+
+  gotoBrand:function(e){
+    let {id} = e.currentTarget.dataset
+    wx.navigateTo({
+      url: '/pages/brandDetail/brandDetail?id=' + id
+    })
+  },
+
   getOrderDetail() {
     let that = this;
     util.request(api.OrderDetail, {
@@ -98,7 +112,7 @@ Page({
                 success: function (res) {
                 //  util.redirect('/pages/ucenter/order/order');
                   wx.navigateBack({
-                    url: 'pages/ucenter/order/order',
+                    url: 'pages/ucenter/order/order?id=-1',
                   });
                 }
               });
@@ -191,7 +205,7 @@ Page({
                               success: function (res) {
                                   //  util.redirect('/pages/ucenter/order/order');
                                   wx.navigateBack({
-                                      url: 'pages/ucenter/order/order',
+                                    url: 'pages/ucenter/order/order?id=-1',
                                   });
                               }
                           });

+ 20 - 2
pages/ucenter/orderDetail/orderDetail.wxml

@@ -27,7 +27,25 @@
         </view>
         <view class="goods">
             <view class="item" wx:for="{{orderGoods}}" wx:key="{{item.id}}">
-                <view class="img">
+                <view class="brand">
+                    <view class="brand-top">
+                        <view class="brand-name" data-id="{{item.brandId}}" bindtap="gotoBrand">
+                            <image src="https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/dianpu.png"></image>
+                            <view>{{item.brandName}}</view>
+                            <image src="https://4d-tjw.oss-cn-shenzhen.aliyuncs.com/wxmall/images/address_right.png"></image>
+                        </view>
+                        <text class="hj">共计{{item.orderGoodsVoList.length}}件商品</text>
+                    </view>
+                    <view class="brand-con" wx:for="{{item.orderGoodsVoList}}" wx:for-index="idx" wx:for-item="sub" wx:key="{{sub.id}}">
+                        <image mode="aspectFill" class="sub-img" src="{{sub.list_pic_url}}"></image>
+                        <view class="sub-info">
+                            <view>{{sub.goods_name}}</view>
+                            <view>¥{{sub.retail_price}} x {{sub.number}}</view>
+                        </view>
+                    </view>
+                    <view class="btn-look"  data-id="{{item.id}}" data-no="{{item.shipping_no}}" wx:if="{{item.shipping_status}}" catchtap="gotoLogti"><text>查看物流</text></view>
+                </view>
+                <!-- <view class="img">
                     <image src="{{item.list_pic_url}}"></image>
                 </view>
                 <view class="info">
@@ -37,7 +55,7 @@
                     </view>
                     <view class="attr">{{item.goods_specifition_name_value||''}}</view>
                     <view class="price">¥{{item.retail_price}}</view>
-                </view>
+                </view> -->
             </view>
         </view>
     </view>

+ 83 - 73
pages/ucenter/orderDetail/orderDetail.wxss

@@ -73,15 +73,14 @@ page{
 
 .order-goods{
     margin-top: 20rpx;
-    background: #fff;
 }
 
 .order-goods .h{
     height: 93.75rpx;
     line-height: 93.75rpx;
-    margin-left: 31.25rpx;
     border-bottom: 1px solid #f4f4f4;
-    padding-right: 31.25rpx;
+    background: #fff;
+    padding: 0 32rpx;
 }
 
 .order-goods .h .label{
@@ -96,68 +95,6 @@ page{
     color: #1fe4dc;
 }
 
-.order-goods .item{
-    display: flex;
-    align-items: center;
-    margin-left: 31.25rpx;
-    padding-right: 31.25rpx;
-    border-bottom: 1px solid #f4f4f4;
-    min-height: 300rpx;
-}
-
-.order-goods .item:last-child{
-    border-bottom: none;
-}
-
-.order-goods .item .img{
-    height: 145rpx;
-    width: 145rpx;
-    background: #f4f4f4;
-}
-
-.order-goods .item .img image{
-    height: 145rpx;
-    width: 145rpx;
-}
-
-.order-goods .item .info{
-    flex: 1;
-    margin-left: 20rpx;
-}
-
-.order-goods .item .t{
-    margin-bottom: 10.5rpx;
-}
-
-.order-goods .item .t .name{
-    display: block;
-    float: left;
-    color: #333;
-    font-size: 30rpx;
-    margin-bottom: 10rpx;
-}
-
-.order-goods .item .t .number{
-    display: block;
-    float: right;
-    text-align: right;
-    line-height: 33rpx;
-    color: #333;
-    font-size: 30rpx;
-}
-
-.order-goods .item .attr{
-    color: #666;
-    margin-bottom: 25rpx;
-    font-size: 25rpx;
-}
-
-.order-goods .item .price{
-    height: 30rpx;
-    line-height: 30rpx;
-    color: #333;
-    font-size: 30rpx;
-}
 
 .order-bottom{
     margin-top: 20rpx;
@@ -168,23 +105,19 @@ page{
 }
 
 .order-bottom .address{
-    height: 128rpx;
     padding-top: 25rpx;
     border-bottom: 1px solid #f4f4f4;
 }
 
 .order-bottom .address .t{
-    height: 35rpx;
     line-height: 35rpx;
     margin-bottom: 7.5rpx;
 }
 
 .order-bottom .address .name{
     display: inline-block;
-    height: 35rpx;
-    width: 140rpx;
-    line-height: 35rpx;
     font-size: 25rpx;
+    margin-right: 20rpx;
 }
 
 .order-bottom .address .mobile{
@@ -195,9 +128,8 @@ page{
 }
 
 .order-bottom .address .b{
-    height: 35rpx;
-    line-height: 35rpx;
     font-size: 25rpx;
+    margin-bottom: 20rpx;
 }
 
 .order-bottom .total{
@@ -244,4 +176,82 @@ page{
     display: inline-block;
     width: 140rpx;
     color: #1fe4dc;
-}
+}
+
+
+
+
+.order-goods .item{
+    background: #fff;
+    margin-bottom: 20rpx;
+}
+
+
+.order-goods .brand{
+}
+
+.brand-top{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 20rpx 32rpx;
+    border-bottom: 1px solid #f4f4f4;
+}
+
+.brand-top .hj{
+    color: #ccc;
+    font-size: 28rpx;
+}
+
+
+.brand-name{
+    display: flex;
+    align-items: center;
+    vertical-align: middle;
+}
+
+.brand-name view{
+    vertical-align: middle;
+    display: inline-block;
+    font-size: 28rpx;
+}
+
+
+.brand-top image{
+    width: 30rpx;
+    height: 30rpx;
+    margin-right: 10rpx;
+    vertical-align: middle;
+    display: inline-block;
+}
+
+.brand-con{
+    display: flex;
+    justify-content: space-between;
+    border-bottom: 1px solid #f4f4f4;
+    padding: 20rpx 32rpx;
+}
+
+.sub-img{
+    width: 180rpx;
+    height: 180rpx;
+    flex-shrink: 0;
+}
+
+.sub-info{
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    margin-left: 20rpx;
+}
+
+.btn-look{
+    text-align: right;
+    padding: 20rpx 32rpx;
+}
+.btn-look text{
+    border-radius: 30rpx;
+    border: 1px solid #ddd;
+    display: inline-block;
+    padding: 10rpx 20rpx;
+}

+ 28 - 12
pages/webview/index.js

@@ -13,14 +13,21 @@ Page({
     temp:''
   },
 
+
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
 
-    this.setData({
-      temp: options.url
-    })
+    this.getBrandDetail(options.id)
+  
+    // this.setData({
+    //   url: (URL + options.url) || '',
+    //   m: options.url,
+    //   img: options.img,
+    //   imgServer: util.imgServer
+    // })
 
   },
 
@@ -31,15 +38,21 @@ Page({
 
   },
 
-  getCartList: function () {
-    util.request(api.CartList).then( (res) => {
+  getBrandDetail: function (id) {
+    util.request(api.BrandDetail, { id: id }).then( (res) => {
       if (res.errno === 0) {
-        let token = wx.getStorageSync('token')
-
         this.setData({
-          url: (URL + this.data.temp + '&token=' + token) || ''
+          url: res.data.brand.sceneUrl + "#" + id,
+          id: id,
+          newPicUrl: res.data.brand.newPicUrl
+        })
+        wx.onAppHide(() => {
+          this.setData({
+            url: res.data.brand.sceneUrl + '&rnd='+Math.random() + "#" + id,
+          })
         })
       }
+      console.log(this.data.url)
     });
   },
 
@@ -47,16 +60,13 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
-    this.getCartList()
-    
+    // this.getCartList()
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-
   },
 
   /**
@@ -84,6 +94,12 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
+    let { id, newPicUrl } = this.data
 
+    return {
+      title: '四维商圈:宅家中,云逛街,轻松买',
+      imageUrl: newPicUrl,
+      url: `/pages/webview/index?id=${id}`,
+    }
   }
 })

+ 86 - 2
project.config.json

@@ -20,8 +20,8 @@
 		}
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.10.2",
-	"appid": "wx0509bd21546d1597",
+	"libVersion": "2.10.3",
+	"appid": "wxb4c0527aa20a6e9a",
 	"projectname": "wxshop",
 	"simulatorType": "wechat",
 	"simulatorPluginLibVersion": {},
@@ -141,6 +141,90 @@
 					"pathName": "pages/logistics/index",
 					"query": "no=75326914125277&id=157",
 					"scene": null
+				},
+				{
+					"id": 14,
+					"name": "pages/ucenter/order/order",
+					"pathName": "pages/ucenter/order/order",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/ucenter/feedback/feedback",
+					"pathName": "pages/ucenter/feedback/feedback",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/ucenter/feedback/feedback",
+					"pathName": "pages/ucenter/feedback/feedback",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/shopping/checkout/checkout",
+					"pathName": "pages/shopping/checkout/checkout",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/ucenter/address/address",
+					"pathName": "pages/ucenter/address/address",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/shopping/address/address",
+					"pathName": "pages/shopping/address/address",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/shopping/address/address",
+					"pathName": "pages/shopping/address/address",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/search/search",
+					"pathName": "pages/search/search",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/webview/index",
+					"pathName": "pages/webview/index",
+					"query": "url=gu6HmTLKp",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/auth/btnAuth/btnAuth",
+					"pathName": "pages/auth/btnAuth/btnAuth",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/brandDetail/brandDetail",
+					"pathName": "pages/brandDetail/brandDetail",
+					"query": "id=1046017",
+					"scene": null
+				},
+				{
+					"id": 25,
+					"name": "pages/ucenter/orderDetail/orderDetail",
+					"pathName": "pages/ucenter/orderDetail/orderDetail",
+					"query": "id=412",
+					"scene": null
 				}
 			]
 		}

二進制
static/images/ic_menu_choice_nor.png


二進制
static/images/ic_menu_choice_pressed.png


二進制
static/images/ic_menu_me_nor.png


二進制
static/images/ic_menu_me_pressed.png


二進制
static/images/ic_menu_shoping_nor.png


二進制
static/images/ic_menu_shoping_pressed.png


二進制
static/images/ic_menu_sort_nor.png


二進制
static/images/ic_menu_sort_pressed.png


+ 8 - 5
utils/util.js

@@ -1,5 +1,6 @@
 var api = require('../config/api.js');
 
+
 function formatTime(date) {
     var year = date.getFullYear()
     var month = date.getMonth() + 1
@@ -22,7 +23,8 @@ function formatNumber(n) {
  * 封封微信的的request
  */
 function request(url, data = {}, method = "POST", header = "application/x-www-form-urlencoded") {
-  if (!~url.indexOf('/api/cart/update')){
+  
+  if (!~url.indexOf('/api/cart/update') && !~url.indexOf('/api/cart/index')){
     wx.showLoading({
       title: '加载中...',
     });
@@ -41,10 +43,11 @@ function request(url, data = {}, method = "POST", header = "application/x-www-fo
                 wx.hideLoading();
                 if (res.statusCode == 200) {
 
-                    if (res.data.errno == 401) {
-                        wx.navigateTo({
-                            url: '/pages/auth/btnAuth/btnAuth',
-                        })
+                  if (res.data.errno == 401 && !~url.indexOf('/api/cart/index')) {
+                      wx.setStorageSync('isLogin', false)
+                      wx.navigateTo({
+                          url: '/pages/auth/btnAuth/btnAuth',
+                      })
                     } else {
                         resolve(res.data);
                     }