zhashaonan 7 years ago
parent
commit
37288812eb

+ 2 - 1
app.json

@@ -10,7 +10,8 @@
     "pages/special/special",
     "pages/brand/brand",
     "pages/comments/comments",
-    "pages/search/search"
+    "pages/search/search",
+    "pages/confirmOrder/confirmOrder"
   ],
   "window": {
     "backgroundTextStyle": "dark",

+ 21 - 3
app.wxss

@@ -54,15 +54,33 @@ page {
 .f28 {
   font-size: 28rpx;
 }
-
+.f30 {
+  font-size: 30rpx;
+}
+.mt10 {
+  margin-top: 10rpx;
+}
+.mt20 {
+  margin-top: 20rpx;
+}
+.cola7 {
+  color: #a7a7a7;
+}
 .col333 {
   color: #333;
 }
-
+.coleb4e4f {
+  color: #EB4E4F
+}
+.col09BB07 {
+  color: #09BB07
+}
 .colef524d {
   color: #ef524d;
 }
-
+.bacfff {
+  background: #fff;
+}
 .f_left {
   float: left;
 }

BIN
image/address-icon.jpeg


+ 106 - 0
pages/confirmOrder/confirmOrder.js

@@ -0,0 +1,106 @@
+// pages/confirmOrder/confirmOrder.js
+const getReq = require('./../../config.js').getReq
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    goods_id: '',
+    ifcart: '',
+    num: '',
+    datas: {}
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let { goods_id, iscart, num } = options
+    this.setData({
+      goods_id,
+      ifcart: iscart,
+      num
+    })
+    this.getDatas(goods_id, iscart, num)
+    console.log(options)
+  },
+  getDatas(goods_id, ifcart, num) {
+    wx.showLoading({
+      title: '加载中',
+    })
+    var self = this
+    getReq({
+      act: 'member_buy',
+      op: 'step_first',
+      curpage: 1,
+      cart_id: `${goods_id}|${num}`,
+      ifcart,
+    }, function (res) {
+      wx.hideLoading()
+      console.log(res)
+      if (res.code == 200) {
+        let datas = res.datas
+        self.setData({
+          datas
+        })
+
+      }
+      else {
+        wx.showToast({
+          icon: 'none',
+          title: res.message,
+          duration: 2000
+        })
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  }
+})

+ 1 - 0
pages/confirmOrder/confirmOrder.json

@@ -0,0 +1 @@
+{}

+ 70 - 0
pages/confirmOrder/confirmOrder.wxml

@@ -0,0 +1,70 @@
+<!--pages/confirmOrder/confirmOrder.wxml-->
+<view>
+  <view class="address_wrap" wx:if="{{datas.address}}">
+    <image class="adress-icon" src="../../image/address-icon.jpeg"></image>
+    <view>
+      <view>江海苗 13911129867</view>
+      <view class="mt10">上海 上海市 徐汇区番禺路876号丽人丽妆</view>
+    </view>
+  </view>
+  <view wx:else class="address_none"> 
+    <icon type="warn" size="23"/>
+    <text decode="{{true}}">&nbsp;&nbsp;请填写收货人信息</text> 
+   </view>
+  
+
+  <view class="mt20">
+    <view class="payment_method payment-1px-b">
+      <view>红包支付</view>
+      <icon type="success" size="20" color="red" />
+    </view>
+    <view class="payment_method">
+      <view>微信支付</view>
+      <icon type="success" size="20" color="red" />
+    </view>
+  </view>
+
+  <view class="mt20 bacfff">
+    <view class="order_goods_content vux-1px-b">
+      <image class="order_content_img" src="https://passport.lrlz.com/data/upload/shop/store/goods/6/6_05543959481448371_1280.jpg"></image>
+      <view class="order_content_middle">
+        <view>梦妆 花心派对唇膏</view>
+        <view class="order_letter_pro">14(霓虹粉色)</view>
+        <view>
+          <text class="f30 coleb4e4f">¥48.25</text>
+          <text decode="{{true}}" class="cola7">&nbsp;&nbsp;天猫价70.00</text>
+        </view>
+      </view>
+      <view class="order_content_nums">x4</view>
+    </view>
+    <view class="packet_price-tips">恭喜,您的红包已经达到员工内买价格~</view>
+  </view>
+
+  <view class="order_entry mt20">
+    <view class="expenses_info">
+      <view>商品总价</view>
+      <view class="coleb4e4f">¥ 280</view>
+    </view>
+    <view class="expenses_info">
+      <view><text class="bonus_bg"><text class="bonus_rate">40%</text></text><text>红包抵扣</text></view>
+      <view class="col09BB07">- ¥ 3</view>
+    </view>
+    <view class="expenses_info">
+      <view><text class="bonus_bg"><text class="bonus_rate">40%</text></text><text>红包抵扣</text></view>
+      <view class="col09BB07">- ¥ 3</view>
+    </view>
+    <view class="expenses_info">
+      <view>运费</view>
+      <view class="coleb4e4f">+ ¥ 9</view>
+    </view>
+  </view>
+
+  <view class="order_pay">
+    <view class="default_address">配送至:上海	上海市	徐汇区番禺路876号丽人丽妆</view>
+    <view class="just_buy">
+      <view class="just_buy_left"><text>应付: </text><text class="coleb4e4f">¥ 204.25</text></view>
+      <view class="just_buy_right">去付款</view>
+    </view>
+  </view>
+
+</view>

+ 162 - 0
pages/confirmOrder/confirmOrder.wxss

@@ -0,0 +1,162 @@
+/* pages/confirmOrder/confirmOrder.wxss */
+
+.address_wrap {
+  display: -webkit-flex;
+  display: flex;
+  align-items: center;
+  height: 148rpx;
+  font-size: 24rpx;
+  color: #333;
+  background: #fff;
+}
+.address_none {
+  display: -webkit-flex;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color:#EB4E4F; 
+  padding: 50rpx 0;
+  background: #fff; 
+  font-size: 26rpx;
+}
+.adress-icon {
+  display: block;
+  width: 34rpx;
+  height: 47rpx;
+  margin: 0 56rpx 0 40rpx;
+}
+
+.payment_method {
+  display: -webkit-flex;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 28rpx;
+  padding: 25rpx 40rpx;
+  background: #fff;
+}
+
+.payment-1px-b {
+  position: relative;
+}
+
+.payment-1px-b::after {
+  content: " ";
+  position: absolute;
+  left: 40rpx;
+  bottom: 0;
+  right: 0;
+  height: 1px;
+  border-bottom: 1px solid #d9d9d9;
+  color: #d9d9d9;
+  -webkit-transform-origin: 0 100%;
+  transform-origin: 0 100%;
+  -webkit-transform: scaleY(0.5);
+  transform: scaleY(0.5);
+}
+
+.order_goods_content {
+  display: -webkit-flex;
+  display: flex;
+  align-items: center;
+  padding: 30rpx;
+}
+
+.order_content_img {
+  display: block;
+  -webkit-flex: 0 0 33.3333%;
+  flex: 0 0 33.3333%;
+  width: 175rpx;
+  height: 175rpx;
+}
+
+.order_content_middle {
+  -webkit-flex: 0 0 50%;
+  flex: 0 0 50%;
+  font-size: 24rpx;
+}
+
+.order_letter_pro {
+  margin: 20rpx 0 40rpx;
+  color: #a7a7a7;
+}
+
+.order_content_nums {
+  -webkit-flex: 1;
+  flex: 1;
+  color: #a7a7a7;
+  font-size: 24rpx;
+  text-align: right;
+}
+
+.packet_price-tips {
+  padding: 20rpx 0 20rpx 30rpx;
+  color: #a7a7a7;
+  font-size: 24rpx;
+}
+
+.order_entry {
+  padding: 30rpx;
+  background: #fff;
+  font-size: 24rpx;
+}
+
+.expenses_info {
+  display: -webkit-flex;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  height: 50rpx;
+}
+
+.bonus_bg {
+  background: #f2bb11;
+  padding: 5rpx;
+  margin-right: 5rpx;
+}
+
+.bonus_rate {
+  border: 1px dashed #fff;
+}
+
+.order_pay {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  z-index: 99;
+}
+
+.default_address {
+  font-size: 18rpx;
+  background: #ffeab8;
+  color: #f2bc73;
+  height: 40rpx;
+  line-height: 40rpx;
+  padding-left: 30rpx;
+}
+
+.just_buy {
+  display: -webkit-flex;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  line-height: 94rpx;
+  font-size: 30rpx;
+  background: #fff;
+}
+
+.just_buy_left {
+  -webkit-flex: 0 0 67%;
+  flex: 0 0 67%;
+  font-size: 30rpx;
+}
+
+.just_buy_right {
+  -webkit-flex: 0 0 33%;
+  flex: 0 0 33%;
+  font-size: 32rpx;
+  color: #fff;
+  background: rgb(235, 78, 79);
+}

+ 5 - 5
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(6417)
   },
   getDatas(goods_id) {
     wx.showLoading({
@@ -123,8 +123,6 @@ Page({
         goods_id: this.data.getOneSummary.goods_id
       },function(res) {
         wx.hideLoading()
-        console.log('++')
-        console.log(res)
         if (res.code == 200) {
           wx.showToast({
             title: '添加成功!',
@@ -141,7 +139,9 @@ Page({
       })
     }
     else if (cartOrBuy == 'isBuy') {
-
+      wx.navigateTo({
+        url: `/pages/confirmOrder/confirmOrder?goods_id=${this.data.getOneSummary.goods_id}&iscart=0&num=${this.data.goodsNumber}`
+      })
     }
     else {
       return