zhashaonan преди 7 години
родител
ревизия
ea73aba330

+ 14 - 3
pages/addAddress/addAddress.js

@@ -1,6 +1,6 @@
 // pages/addAddress/addAddress.js
 const getReq = require('./../../config.js').getReq
-
+let appInstance = getApp()
 Page({
 
   /**
@@ -36,11 +36,11 @@ Page({
   },
   bindChange: function (e) {
     const val = e.detail.value
-    if (this.data.oldval[0] != val[0]) {
+    if (this.data.value[0] != val[0]) {
       val[1] = 0
       val[2] = 0
     } else {    //若省份column未做滑动,地级市做了滑动则定位区县第一位
-      if (this.data.oldval[1] != val[1]) {
+      if (this.data.value[1] != val[1]) {
         val[2] = 0
       }
     }
@@ -180,6 +180,17 @@ Page({
       if (res.code == 200) {
         let address_id = res.datas.address_id
         let is_default = self.data.checked ? 1 : 0
+        if (is_default) {
+          let area_info = self.data.province.n + self.data.city.n + self.data.district.n
+          appInstance.checkDefaultAddress({
+            true_name: name,
+            mob_phone: phone,
+            area_info,
+            address,
+            address_id
+          })
+        }
+
         getReq({
           act: 'member_address',
           op: 'set_default',

+ 3 - 1
pages/addAddress/addAddress.json

@@ -1 +1,3 @@
-{}
+{
+  "navigationBarTitleText": "添加收货地址"
+}

+ 2 - 2
pages/addAddress/addAddress.wxml

@@ -5,7 +5,7 @@
     <view class="info_cell vux-1px-b">
       <view class="info_cell_lable">收件人:</view>
       <view class="info_cell_content">
-        <input placeholder="请输入收件人" value="{{name}}" bindinput="bindKeyInput" data-value="name" />
+        <input auto-focus placeholder="请输入收件人" value="{{name}}" bindinput="bindKeyInput" data-value="name" />
       </view>
     </view>
   </view>
@@ -35,7 +35,7 @@
     <view class="info_cell">
       <view class="info_cell_lable">详细地址:</view>
       <view class="info_cell_content">
-        <input auto-focus placeholder="请输入详细地址" value="{{address}}" bindinput="bindKeyInput" data-value="address" />
+        <input  placeholder="请输入详细地址" value="{{address}}" bindinput="bindKeyInput" data-value="address" />
       </view>
     </view>
   </view>

+ 10 - 4
pages/address/address.js

@@ -7,7 +7,8 @@ Page({
    * 页面的初始数据
    */
   data: {
-    address_list: []
+    address_list: [],
+    firstLoad: true,
   },
 
   /**
@@ -29,7 +30,8 @@ Page({
       if (res.code == 200) {
         let address_list = res.datas.address_list
         self.setData({
-          address_list
+          address_list,
+          firstLoad: false
         })
 
       }
@@ -48,11 +50,13 @@ Page({
     let true_name = dataset.truename
     let mob_phone = dataset.mobphone
     let area_info = dataset.areainfo
+    let address_id = dataset.addressid
     appInstance.checkDefaultAddress({
       true_name,
       mob_phone,
       area_info,
-      address
+      address,
+      address_id
     })
     wx.navigateBack()
 
@@ -68,7 +72,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    if (!this.data.firstLoad) {
+      this.getDatas()
+    }
   },
 
   /**

+ 3 - 1
pages/address/address.json

@@ -1 +1,3 @@
-{}
+{
+  "navigationBarTitleText": "收货地址"
+}

+ 1 - 0
pages/comments/comments.json

@@ -1,4 +1,5 @@
 {
+  "navigationBarTitleText": "评论",
   "usingComponents": {
     "commentsCarousel": "../components/blocks/commentsCarousel/commentsCarousel"
   }

+ 58 - 4
pages/confirmOrder/confirmOrder.js

@@ -13,7 +13,8 @@ Page({
     datas: {},
     goods_list: [],
     firstLoad: true,
-    defaultAddress: null
+    defaultAddress: null,
+    cart_id: ''
   },
 
   /**
@@ -27,7 +28,8 @@ Page({
     this.setData({
       goods_id,
       ifcart: iscart,
-      num
+      num,
+      cart_id
     })
     this.getDatas(goods_id, iscart, num, cart_id)
   },
@@ -53,7 +55,9 @@ Page({
       wx.hideLoading()
       if (res.code == 200) {
         let datas = res.datas
-        let goods_list = self.getGoodsList(datas.summary,datas.goods_list)
+        console.log('datas')
+        console.log(datas)
+        let goods_list = self.getGoodsList(datas.summary, datas.goods_list)
         self.setData({
           datas,
           goods_list,
@@ -68,12 +72,15 @@ Page({
           title: res.message,
           duration: 2000
         })
+        wx.navigateBack()
       }
+    }, function () {
+      wx.navigateBack()
     })
   },
   getGoodsList(summary, goods_list) {
     let newGoodsList = []
-    goods_list.map((item,index) => {
+    goods_list.map((item, index) => {
       summary.filter((list, key) => {
         if (item.goods_id == list.goods_id) {
           let goods_item = list
@@ -86,6 +93,51 @@ Page({
     return newGoodsList
 
   },
+  toPay() {
+    let goods_id = this.data.goods_id
+    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
+    let address_id = this.data.defaultAddress.address_id ? this.data.defaultAddress.address_id : this.data.datas['address'].address_id
+
+    let ifcart = cart_id ? 1 : 0
+    let cartids = cart_id ? cart_id : (goods_id + '|' + goods_num)
+    getReq({
+      act: 'member_buy',
+      op: 'step_second',
+      payment: 'jspay',
+      usebonus: 1,
+      ifcart,
+      cart_id: cartids,
+      address_id,
+      invoice_id: 0,
+      vat_hash,
+      offpay_hash,
+      offpay_hash_batch
+    }, function (res) {
+      wx.hideLoading()
+      console.log(res)
+      if (res.code == 200) {
+        
+        
+
+      }
+      else {
+        wx.showToast({
+          icon: 'none',
+          title: res.message,
+          duration: 2000
+        })
+        wx.navigateBack()
+      }
+    }, function (err) {
+      console.log(err)
+      wx.navigateBack()
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -97,8 +149,10 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    console.log('show')
     if (!this.data.firstLoad) {
       let defaultAddress = appInstance.globalData.defaultAddress
+      console.log(defaultAddress)
       this.setData({
         defaultAddress
       })

+ 3 - 1
pages/confirmOrder/confirmOrder.json

@@ -1 +1,3 @@
-{}
+{
+  "navigationBarTitleText": "确认订单"
+}

+ 1 - 1
pages/confirmOrder/confirmOrder.wxml

@@ -69,7 +69,7 @@
         <text>应付: </text>
         <text class="coleb4e4f">¥ {{datas.payinfo['pay_cash_pred']}}</text>
       </view>
-      <view class="just_buy_right">去付款</view>
+      <view class="just_buy_right" bindtap='toPay'>去付款</view>
     </view>
   </view>
 

+ 3 - 6
pages/details/details.js

@@ -30,8 +30,8 @@ Page({
     this.setData({
       webViewUrl
     })
-    this.getDatas(options.goods_id)
-    // this.getDatas(6417)
+    // this.getDatas(options.goods_id)
+    this.getDatas(6779)
   },
   getDatas(goods_id) {
     wx.showLoading({
@@ -145,12 +145,9 @@ Page({
         }
       })
     }
-    else if (cartOrBuy == 'isBuy') {
+    else if (cartOrBuy == 'isBuy') {     
       wx.navigateTo({
         url: `/pages/confirmOrder/confirmOrder?goods_id=${this.data.getOneSummary.goods_id}&iscart=0&num=${this.data.goodsNumber}`
-
-        // // 测试多种商品
-        // url: `/pages/confirmOrder/confirmOrder?goods_id=${this.data.getOneSummary.goods_id}&iscart=1&num=${this.data.goodsNumber}&cart_id='131344,131343,131342'`
       })
     }
     else {

+ 3 - 1
pages/details/details.json

@@ -1 +1,3 @@
-{}
+{
+  "navigationBarTitleText": "商品详情"
+}

+ 11 - 2
pages/details/details.wxml

@@ -1,5 +1,5 @@
 <!--pages/details/details.wxml-->
-<view>
+<view class="bacfff">
   <view class="pos_rel">
     <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" style="height:750rpx">
       <block wx:for="{{imgUrls}}" wx:key="*this">
@@ -35,6 +35,11 @@
   </view>
 
   <view wx:if="{{getOneSummary['act_type'] == 0}}" class="congratulation_text one_line_hidden">{{getOneSummary.gap_desc}}</view>
+  <navigator url="/pages/special/special?title=F码专区&special_id=905" wx:if="{{getOneSummary['is_fcode']}}">
+    <view class="congratulation_text one_line_hidden colef524d">F码购买
+      <view class="tospecial">去看看 ></view>
+    </view>
+  </navigator>
   <view class="details_stamps">
     <view class="stamps_item">
       <image class="goods_logo" src="{{getOneSummary.brand_country_logo}}"></image>
@@ -98,7 +103,11 @@
   </view>
 
   <view class="place-bac247"></view>
-  <button style="width: 60%;" type="primary" plain="true" bindtap="toWebView">查看更多详情</button>
+
+  <!-- <button style="width: 40%; margin: 160rpx auto;" type="primary" plain="true" bindtap="toWebView">查看更多详情</button>  -->
+  <view class="see_more_details" bindtap="toWebView">查看更多详情</view>
+  <view class="place_details_tabbar"></view>
+
   <view class="details_tabbar">
     <navigator class="details_tabbar_item" url="/pages/index/index" open-type="switchTab">
       <image class="details_tabbar_icon" src="../../image/home-icon.png"></image>

+ 30 - 3
pages/details/details.wxss

@@ -118,6 +118,18 @@
   -webkit-transform: scaleY(0.5);
   transform: scaleY(0.5);
 }
+.congratulation_text.colef524d {
+  color:#ef524d;
+}
+.tospecial {
+  float: right;
+  padding: 4rpx 16rpx;
+  margin-right: 25rpx;
+  background: rgb(236, 92, 86);
+  border-radius: 20rpx;
+  color: rgb(242, 203, 100);
+  font-size: 20rpx;
+}
 
 .details_stamps {
   /* height: 166rpx; */
@@ -283,6 +295,21 @@
   color: #000;
 }
 
+.place_details_tabbar {
+  height: 100rpx;
+}
+
+.see_more_details {
+  margin: 40rpx auto;
+  text-align: center;
+  width: 40%;
+  padding: 15rpx;
+  font-size: 30rpx;
+  border-radius: 8rpx;
+  color: rgb(255, 78, 78);
+  border: 1px solid #ff4e4e;
+}
+
 .details_tabbar_simple {
   text-align: center;
   background: rgb(0, 0, 0);
@@ -397,7 +424,7 @@
   background: #fff;
   color: #000;
   border-radius: 5rpx;
-  padding: 8rpx 15rpx;
+  padding: 10rpx 15rpx;
   font-size: 24rpx;
   border: 1rpx solid #000;
   margin-right: 15rpx;
@@ -414,13 +441,13 @@
   color: #eb4e4f;
   font-size: 40rpx;
   display: inline-block;
-  width: 50rpx;
+  width: 80rpx;
   text-align: center;
 }
 
 .simple_goods_result {
   display: inline-block;
-  width: 200rpx;
+  width: 140rpx;
   text-align: center;
   font-size: 30rpx;
 }