Parcourir la source

Merge branch 'master' of https://gitee.com/huangg/panda_beauty_makeup_small_program

* 'master' of https://gitee.com/huangg/panda_beauty_makeup_small_program:
  details
  details
  details
  order
  del
huanggang il y a 7 ans
Parent
commit
c0c911128c

+ 2 - 7
pages/confirmOrder/confirmOrder.js

@@ -81,10 +81,7 @@ Page({
         })
         appInstance.globalData.fcodeErr = res.message
         wx.navigateBack()      
-
       }
-    }, function () {
-      wx.navigateBack()
     })
   },
   getGoodsList(summary, goods_list) {
@@ -115,6 +112,7 @@ Page({
     let goods_num = this.data.num
     let iscart = this.data.ifcart
     let cart_id = this.data.cart_id
+    
     let vat_hash = this.data.datas['payinfo'].vat_hash
     let offpay_hash = this.data.datas['payinfo'].offpay_hash
     let offpay_hash_batch = this.data.datas['payinfo'].offpay_hash_batch
@@ -136,7 +134,6 @@ Page({
       offpay_hash_batch
     }, function (res) {
       wx.hideLoading()
-      console.log(res)
       if (res.code == 200) {
 
 
@@ -148,10 +145,9 @@ Page({
           title: res.message,
           duration: 2000
         })
+        appInstance.globalData.fcodeErr = res.message
         wx.navigateBack()
       }
-    }, function (err) {
-      wx.navigateBack()
     })
   },
   /**
@@ -167,7 +163,6 @@ Page({
   onShow: function () {
     if (!this.data.firstLoad) {
       let defaultAddress = appInstance.globalData.defaultAddress
-      console.log(defaultAddress)
       this.setData({
         defaultAddress
       })

+ 1 - 1
pages/confirmOrder/confirmOrder.wxml

@@ -31,7 +31,7 @@
 
   <view class="mt20 bacfff" wx:for="{{goods_list}}" wx:for-index="idx" wx:key="idx">
     <view class="order_goods_content vux-1px-b">
-      <image class="order_content_img" src="{{item.goods_image_url}}"></image>
+      <image class="order_content_img" mode="widthFix" src="{{item.goods_image_url}}"></image>
       <view class="order_content_middle">
         <view>{{item.goods_mobile_name}}</view>
         <view class="order_letter_pro">{{item.goods_spec}}</view>

+ 0 - 1
pages/confirmOrder/confirmOrder.wxss

@@ -69,7 +69,6 @@
   -webkit-flex: 0 0 33.3333%;
   flex: 0 0 33.3333%;
   width: 175rpx;
-  height: 175rpx;
 }
 
 .order_content_middle {

+ 21 - 4
pages/details/details.js

@@ -21,7 +21,8 @@ Page({
     sec_index: 0,
     goodsNumber: 1,
     cartOrBuy: '',
-    getgift: ''
+    getgift: '',
+    options_goods_id:'' 
   },
 
   /**
@@ -30,10 +31,10 @@ Page({
   onLoad: function (options) {
     let webViewUrl = `https://passport.lrlz.com/mobile/index.php?act=goods_common&op=detail&goods_id=${options.goods_id}&client_type=ios`
     this.setData({
-      webViewUrl
+      webViewUrl,
+      options_goods_id: options.goods_id
     })
     this.getDatas(options.goods_id)
-    // this.getDatas(6779)
   },
   getDatas(goods_id) {
     wx.showLoading({
@@ -167,6 +168,14 @@ Page({
       })
     }
     else if (cartOrBuy == 'isBuy') {
+      if (this.data.getOneSummary.goods_storage < 1) {
+        wx.showToast({
+          title: '客官!暂时没有库存!',
+          icon: 'none',
+          duration: 1500
+        })
+        return
+      }
       wx.navigateTo({
         url: `/pages/confirmOrder/confirmOrder?goods_id=${this.data.getOneSummary.goods_id}&iscart=0&num=${this.data.goodsNumber}`
       })
@@ -229,9 +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 - 22
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>
 
@@ -120,6 +127,8 @@
     <view class="details_tabbar_simple buy" bindtap='animation_flag' data-flag="true" data-cartorbuy="isBuy">立即购买</view>
   </view>
 
+
+
   <view class="animation_popup {{animation_flag ? 'show_popup' : ''}}" bindtap='animation_flag' data-flag="false"></view>
   <view class="simple_shopcart {{animation_flag ? 'show_animation' : ''}}">
     <view class="simple_goods_info pab30 vux-1px-b">

+ 25 - 2
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;
@@ -325,6 +342,10 @@
   background: rgb(255, 78, 78);
 }
 
+.details_tabbar_simple.buy.soldout {
+  flex: 3 1 0%;
+}
+
 .simple_shopcart {
   position: fixed;
   left: 0;
@@ -499,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;
 }

+ 0 - 74
project.config.json

@@ -1,74 +0,0 @@
-{
-	"description": "项目配置文件。",
-	"setting": {
-		"urlCheck": false,
-		"es6": true,
-		"postcss": true,
-		"minified": true,
-		"newFeature": true
-	},
-	"compileType": "miniprogram",
-	"libVersion": "1.9.91",
-	"appid": "wxfdaeb25e38c4c47e",
-	"projectname": "panda_small_%20routine",
-	"isGameTourist": false,
-	"condition": {
-		"search": {
-			"current": -1,
-			"list": []
-		},
-		"conversation": {
-			"current": -1,
-			"list": []
-		},
-		"plugin": {
-			"current": -1,
-			"list": []
-		},
-		"game": {
-			"currentL": -1,
-			"list": []
-		},
-		"miniprogram": {
-			"current": -1,
-			"list": [
-				{
-					"id": 0,
-					"name": "details",
-					"pathName": "pages/details/details",
-					"query": ""
-				},
-				{
-					"id": 1,
-					"name": "comments",
-					"pathName": "pages/comments/comments",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "shopcart",
-					"pathName": "pages/shopCart/shopCart",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "person",
-					"pathName": "pages/person/person",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "orderTabs",
-					"pathName": "pages/order_tabs/orderTabs",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "addAddress",
-					"pathName": "pages/addAddress/addAddress",
-					"query": ""
-				}
-			]
-		}
-	}
-}