Browse Source

feat():修改bug

geek 4 years ago
parent
commit
1a0a0749fe

+ 11 - 2
componets/shop/index.js

@@ -13,9 +13,18 @@ Component({
         },
         gotoShopInfo:function (e){
             let id = e.currentTarget.dataset.id;
-            wx.navigateTo({
-              url: '../../pages/shopinfo/shopinfo?id='+id,
+            let pages = getCurrentPages(); // 当前页,
+            let prevPage = pages[pages.length - 2]; // 上一页
+            prevPage.setData({
+                chooseStoreId: id,
             })
+        
+            wx.navigateBack({ //返回
+            delta: 1
+            })
+            // wx.switchTab({
+            //   url: '../../pages/index/index?storeId='+id,
+            // })
         }
     },
     created: function(){

+ 15 - 5
pages/appointment/appointment.js

@@ -37,8 +37,17 @@ Page({
     console.log(options)
     let shopId = options.shopId;
     let productId = options.productId
-    let address = options.address;
-    let shopName = options.shopName;
+    const isAuth = await app.isAuth()
+    if (!isAuth) {
+      wx.redirectTo({
+        url: '/pages/prompt/prompt?page=' + this.route+`&shopId=${shopId}&productId=${productId}`,
+      })
+      return
+    }
+    
+    let storeInfo = await storeApi.getStoreById(shopId);
+    let address = storeInfo.info.address;
+    let shopName = storeInfo.info.shopName;
     let product = await productApi.getProductById(productId);
     let productImg = product.info.productImg;
     let productName = product.info.productName;
@@ -70,7 +79,7 @@ Page({
     const isAuth = await app.isAuth()
     if (!isAuth) {
       wx.redirectTo({
-        url: '/pages/prompt/prompt?page=' + this.route,
+        url: '/pages/appointment/appointment?page=' + this.route,
       })
       return
     }
@@ -126,10 +135,10 @@ Page({
       iv: params.detail.iv
     }
     const userInfo = await app.getPhoneNumber(data)
-    console.log(userInfo)
+    console.log(userInfo.mobile)
     let hasMobile = false
     if (userInfo.mobile > 1) {
-      hasMobile:true
+      hasMobile = true
     }
     _self.setData({
       hasMobile: hasMobile,
@@ -233,6 +242,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: async function () {
+    
   },
 
   /**

+ 2 - 2
pages/appointment/appointment.wxml

@@ -17,12 +17,12 @@
                     <view >
                         ¥
                     </view>
-                    <view style="padding-top: 10rpx;">{{price}}</view>
+                    <view style="padding-top: 10rpx;font-size: 31rpx;font-weight: 400;">{{price}}</view>
                 </view>
             </view>
         </view>
         <view class="people-num ">
-            <view class="title">请选择人数</view>
+            <view class="title" style="font-size: 31rpx;font-weight: 400;">请选择人数</view>
             <view class="num-box">
                 <view bindtap="reducePeopleNum" class="" data-num="{{peopleNum}}">
                     <image class="" src="../../images/icons/reduce.png" lazy-load="false" binderror="" bindload=""></image>

+ 10 - 7
pages/appointment/appointment.wxss

@@ -40,9 +40,9 @@
 }
 
 .container .shop-info .shop .shop-name {
-  font-size: 17px;
+  font-size: 32rpx;
   color: #000;
-  font-weight: 500;
+  font-weight: 400;
   letter-spacing: 2rpx;
 }
 
@@ -83,7 +83,8 @@
 }
 
 .container .product-desc .product .product-name .title {
-  font-size: 17px;
+  font-size: 31rpx;
+    font-weight: 400;
 }
 
 .container .product-desc .product .product-name .price {
@@ -98,7 +99,7 @@
 .container .product-desc .product .product-name .price :first-child {
   font-size: 12px;
   color: #424242;
-  padding-top: 25rpx;
+  padding-top: 17rpx;
   margin-right: 10rpx;
 }
 
@@ -238,16 +239,17 @@
 
 .container .product-mobile .phone .phone-icon {
   position: absolute;
-  width: 50rpx;
-  height: 50rpx;
+  width: 40rpx;
+  height:35rpx;
   top: 50%;
   transform: translateY(-50%);
   left: 40rpx;
 }
 
 .container .product-mobile .phone .desc-text {
-  margin-left: 140rpx;
+  margin-left: 120rpx;
   letter-spacing: 4rpx;
+  font-size: 27rpx;
 }
 
 .container .product-mobile :first-child {
@@ -259,6 +261,7 @@
   height: 100rpx;
   display: flex;
   justify-content: flex-start;
+  /* padding-bottom: 20rpx; */
 }
 
 .container .appointment .price {

+ 1 - 1
pages/comments/comments.wxml

@@ -1,7 +1,7 @@
 <!--pages/comments/comments.wxml-->
 <comments wx:if="{{commentsList.length > 0}}" commentsList="{{commentsList}}"></comments>
 <view class="comments-end c-707070 f14" wx:if="{{loadingEnd}}">已经到底啦</view>
-<view class="discuss-info" wx:if="{{commentsList.length == 0}}">
+<view class="discuss-info" wx:if="{{commentsList.length ==0 }}">
   <image style="height: 400rpx;width: 400rpx;" src="../../images/no-discuss.png"></image>
   <view class="discuss">暂无评论</view>
 </view>

+ 1 - 0
pages/comments/comments.wxss

@@ -12,4 +12,5 @@
   text-align: center;
   position: absolute;
   top: 13%;
+  left: 22%;
 }

+ 25 - 6
pages/index/index.js

@@ -27,14 +27,18 @@ Page({
   },
 
 
-  onLoad: async function () {
+  onLoad: async function (options) {
+    console.log(options)
     const self = this
+
     const tokenData = await commonApi.getToken();
 
     if (tokenData.token && !requestApi.HEAD.token) {
+      console.log('设置token')
       wx.setStorageSync('token', tokenData.token)
       requestApi.HEAD.token = tokenData.token
     }
+    if (!options.storeId){
     wx.getSetting({
       success: (res) => {
         let authSetting = res.authSetting
@@ -64,16 +68,31 @@ Page({
         }
       }
     })
+  }else {
+    const rs = await storeApi.getStoreByI(options.storeId)
+    self.setData({
+      storeInfo: rs.info
+    })
+  } 
 
     // this.getProductHeight()
   },
-  onShow: async function () {
+  onShow: async function (op) {
+    console.log(op)
     const self = this
     const tokenData = await commonApi.getToken();
     if (tokenData.token && !requestApi.HEAD.token) {
       wx.setStorageSync('token', tokenData.token)
       requestApi.HEAD.token = tokenData.token
     }
+    if (self.data.chooseStoreId){
+      const rs = await storeApi.getStoreById(self.data.chooseStoreId)
+      self.setData({
+        storeInfo: rs.info,
+        chooseStoreId:0
+      })
+    }
+    
     var tabs = await this.getProductList(true);
     this.setData({
       tabs
@@ -261,10 +280,10 @@ Page({
     let shopName = self.data.storeInfo.storeName;
     const isAuth = await app.isAuth()
     if (!isAuth) {
-      wx.redirectTo({
-        url: '/pages/prompt/prompt?page=' + this.route + `&shopId=${shopId}&productId=${productId}`,
-      })
-      return
+      // wx.redirectTo({
+      //   url: '/pages/prompt/prompt?page=' + this.route + `&shopId=${shopId}&productId=${productId}&address=${address}&shopName=${shopName}`,
+      // })
+      // return
     }
     wx.navigateTo({
       url: '../appointment/appointment?' + 'shopId=' + shopId + '&productId=' + productId + '&address=' + address+"&shopName="+shopName,

+ 1 - 1
pages/index/index.wxml

@@ -8,7 +8,7 @@
     <view class="title">
       <view class="c-202020 title-left" user-select="false" space="false" decode="false">
         <image class="shop-icon" src="../../images/icons/shop-icon.png" lazy-load="false"></image>
-        品牌名
+        康道养生馆
       </view>
       <navigator class="c-202020 f15" url="../shop/shop" hover-class="none" open-type="navigate">
         {{storeInfo.storeName}}

+ 7 - 5
pages/index/index.wxss

@@ -124,7 +124,7 @@ Page {
 .container .product .productinfo .product-item .product-desc .price {
   display: flex;
   justify-content: flex-start;
-  line-height: 50rpx;
+  line-height: 33rpx;
 }
 
 .container .product .productinfo .product-item .product-desc .price :last-child {
@@ -136,16 +136,18 @@ Page {
 }
 
 .fw700 {
-  font-weight: 500;
-  font-size: 17px;
+  font-weight: 400;
+  font-size: 32rpx;
 }
 
 .gold {
-  font-size: 15px;
+  font-size: 30rpx;
   color: #b1a384;
+  letter-spacing: 0rpx;
 }
 
 .gray {
-  font-size: 13px;
+  font-size: 26rpx;
   color: #999;
+  letter-spacing: 0rpx;
 }

+ 1 - 1
pages/order/order.wxml

@@ -21,7 +21,7 @@
             <image class="" src="{{order.productImg}}"></image>
         </view>
         <view class="order-info">
-            <view class="order-id f13 c-707070">{{order.orderSn}}</view>
+            <view class="order-id f13 c-707070" style="font-size:30rpx;">{{order.orderSn}}</view>
             <view class="order-title c-202020">{{order.productName}}</view>
             <view class="order-price f18">¥{{order.orderMoney}}</view>
             <view class="order-date f13 c-707070">

+ 18 - 6
pages/order/order.wxss

@@ -139,10 +139,10 @@
 .container .order-btn .pay-btn {
   background-color: #BA9D6E;
   width: 180rpx;
-  height: 50rpx;
-  font-size: 14px;
+  height: 60rpx;
+  font-size: 15px;
   text-align: center;
-  line-height: 50rpx;
+  line-height: 60rpx;
   border-radius: 25rpx;
   color: #fff;
   margin-right: 20rpx;
@@ -150,12 +150,24 @@
 
 .container .order-btn .delete-btn {
   width: 180rpx;
-  height: 50rpx;
-  font-size: 14px;
+  height: 60rpx;
+  font-size: 15px;
   text-align: center;
-  line-height: 50rpx;
+  line-height: 60rpx;
   border-radius: 25rpx;
   color: #999;
   border: 1rpx solid #999;
   margin: 0 20rpx;
 }
+
+.xiaofei {
+  width: 200rpx;
+    height: 60rpx;
+    font-size: 15px;
+    text-align: center;
+    line-height: 60rpx;
+    border-radius: 40rpx;
+    color: #999;
+    border: 1rpx solid #999;
+    margin: 0px 20rpx;
+}

+ 1 - 2
pages/personorder/personorder.wxml

@@ -4,7 +4,6 @@
         bindchange="onChange" activeClass="tab-bar-title__selected" tabActiveTextColor="#BA9D6E"
         swiperHeight="{{(tabs[activeTab].list.length)*420}}">
         <block wx:for="{{tabs}}" wx:key="title">
-
             <view class="tab-content" data-set="{{item}}" slot="tab-content-{{index}}" bind:tap="handleClick">
                 <view  class="orders">
                     <block wx:for="{{tabs[index].list}}" wx:key="id">
@@ -51,10 +50,10 @@
                                     data-orderid="{{item.id}}" data-shopid="{{item.storeId}}"
                                     data-productid="{{item.productId}}" bindtap="gotoComment">评价</view>
                                 <view class="pay btn f14" data-orderId="{{item.id}}" bindtap="payOrder" wx:if="{{item.status==1}}">付款</view>
+                                <view class="pay btn f14" data-orderId="{{item.id}}" catchtap="showOrderInfo">查看详情</view>
                             </view>
                         </view>
                     </block>
-
                 </view>
             </view>
         </block>

+ 5 - 0
pages/personorder/personorder.wxss

@@ -136,3 +136,8 @@
   top: -3rpx;
   left: 0;
 }
+
+.tab-item {
+  position: fixed;
+  background-color: #FFF;
+}

+ 1 - 1
pages/prompt/prompt.js

@@ -15,7 +15,7 @@ Page({
   onLoad: async function (options) {
     console.log(options)
     let page = options.page
-    if (options.page === 'pages/product/product') {
+    if (options.page === 'pages/appointment/appointment') {
       page = `${page}?shopId=${options.shopId}&productId=${options.productId}`
     }
     this.setData({