zhashaonan 7 лет назад
Родитель
Сommit
f8a996e2de
3 измененных файлов с 60 добавлено и 28 удалено
  1. 5 1
      pages/details/details.js
  2. 31 24
      pages/details/details.wxml
  3. 24 3
      pages/details/details.wxss

+ 5 - 1
pages/details/details.js

@@ -238,13 +238,17 @@ Page({
       wx.showToast({
         icon: 'none',
         title: app.globalData.fcodeErr,
-        duration: 2000
+        duration: 1500
       })
       app.globalData.fcodeErr = ''
       this.setData({
         animation_flag: false
       })
+      // console.log(this.data.options_goods_id)
+      setTimeout(() => {
+
       this.getDatas(this.data.options_goods_id)  
+      }, 1500)
     }
     if (app.globalData.backLogin) {
       this.getDatas(this.data.getOneSummary.goods_id);

+ 31 - 24
pages/details/details.wxml

@@ -61,33 +61,40 @@
 
   <view class="place-bac247"></view>
 
-  <view class="comments_block">
-    <view>用户评价
-      <text class="colef524d">({{datas.common_info.comments}})</text>
+  <navigator url="/pages/special/special?title=N元任选&special_id=869&is_special=true" wx:if="{{getOneSummary.is_opgoods}}">
+    <view class="congratulation_text one_line_hidden">{{getOneSummary.opgoods_desc}}
+      <view class="tospecial">去看看 ></view>
     </view>
-    <navigator url="/pages/comments/comments?common_id={{datas.comment.common_id}}">
-      <view class="f24">查看全部评论 > </view>
-    </navigator>
-  </view>
-
-  <view class="comment">
-    <view class="user">
-      <view class="member_avatar f_left">
-        <image src="{{datas.comment.member_avatar}}">
-        </image>
+  </navigator>
+  <block wx:if="{{datas.comment}}">
+    <view class="comments_block">
+      <view>用户评价
+        <text class="colef524d">({{datas.common_info.comments}})</text>
       </view>
-      <view class="f28 f_left">{{datas.comment.nickname}}</view>
-      <view class="scores f_right">
-        <view class="flex-stars">
-          <image class="star" src="../../image/star.png" wx:for="{{datas.comment.scores}}" wx:index="starindex" wx:key="starindex"></image>
+      <navigator url="/pages/comments/comments?common_id={{datas.comment.common_id}}">
+        <view class="f24">查看全部评论 > </view>
+      </navigator>
+    </view>
+
+    <view class="comment">
+      <view class="user">
+        <view class="member_avatar f_left">
+          <image src="{{datas.comment.member_avatar}}">
+          </image>
+        </view>
+        <view class="f28 f_left">{{datas.comment.nickname}}</view>
+        <view class="scores f_right">
+          <view class="flex-stars">
+            <image class="star" src="../../image/star.png" wx:for="{{datas.comment.scores}}" wx:index="starindex" wx:key="starindex"></image>
+          </view>
+          <view class="comment_time">{{datas.comment.comment_time}}</view>
         </view>
-        <view class="comment_time">{{datas.comment.comment_time}}</view>
       </view>
+      <view class="spec">规格:{{datas.comment.goods_spec}}</view>
+      <view class="content">{{datas.comment.content}}</view>
+      <view class="content_img"></view>
     </view>
-    <view class="spec">规格:{{datas.comment.goods_spec}}</view>
-    <view class="content">{{datas.comment.content}}</view>
-    <view class="content_img"></view>
-  </view>
+  </block>
 
   <view class="place-bac247"></view>
 
@@ -116,8 +123,8 @@
       <image class="details_tabbar_icon" src="../../image/shopcart-icon.png"></image>
       <view class="details_tabbar_label">购物车</view>
     </navigator>
-      <view class="details_tabbar_simple" bindtap='animation_flag' data-flag="true" data-cartorbuy="isCart">加入购物车</view>
-      <view class="details_tabbar_simple buy" bindtap='animation_flag' data-flag="true" data-cartorbuy="isBuy">立即购买</view>
+    <view class="details_tabbar_simple" bindtap='animation_flag' data-flag="true" data-cartorbuy="isCart">加入购物车</view>
+    <view class="details_tabbar_simple buy" bindtap='animation_flag' data-flag="true" data-cartorbuy="isBuy">立即购买</view>
   </view>
 
 

+ 24 - 3
pages/details/details.wxss

@@ -118,9 +118,11 @@
   -webkit-transform: scaleY(0.5);
   transform: scaleY(0.5);
 }
+
 .congratulation_text.colef524d {
-  color:#ef524d;
+  color: #ef524d;
 }
+
 .tospecial {
   float: right;
   padding: 4rpx 16rpx;
@@ -269,6 +271,21 @@
   background: #fff;
 }
 
+.details_tabbar:before {
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  right: 0;
+  height: 1px;
+  border-top: 1px solid #c0bfc4;
+  color: #c0bfc4;
+  -webkit-transform-origin: 0 0;
+  transform-origin: 0 0;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+
 .details_tabbar_item {
   display: block;
   -webkit-box-flex: 1;
@@ -324,9 +341,11 @@
 .details_tabbar_simple.buy {
   background: rgb(255, 78, 78);
 }
+
 .details_tabbar_simple.buy.soldout {
-   flex: 3 1 0%;
+  flex: 3 1 0%;
 }
+
 .simple_shopcart {
   position: fixed;
   left: 0;
@@ -501,16 +520,18 @@
   font-size: 20rpx;
   background: #ffe3c6;
   border-radius: 5rpx;
-  padding:10rpx;
+  padding: 10rpx;
   margin-right: 18rpx;
   margin-top: 10rpx;
 }
+
 .gift_tag {
   background: #eb4e4f;
   border-radius: 4rpx;
   padding: 2rpx;
   color: #fff;
 }
+
 .gift_underline {
   text-decoration: underline;
 }