wangyong hace 6 años
padre
commit
35d130f00f

BIN
customized/images/customized/cup_black_small_2.png


BIN
customized/images/customized/cup_black_small_3.png


BIN
customized/images/customized/cup_black_small_4.png


+ 9 - 2
customized/pages/accounts/accounts.js

@@ -124,8 +124,15 @@ Page({
           success(res){
             console.log(res,"结算结果")
             if (res.errMsg === 'requestPayment:ok'){
-              wx.showToast({
-                title: '支付成功',
+              // wx.showToast({
+              //   title: '支付成功',
+              // })
+              wx.redirectTo({
+                url: '/customized/pages/result/result?state=true',
+              })
+            } else {
+              wx.redirectTo({
+                url: '/customized/pages/result/result?state=false',
               })
             }
           },

+ 39 - 2
customized/pages/index/index.js

@@ -8,7 +8,41 @@ Page({
    * 页面的初始数据
    */
   data: {
-    carNum:null
+    carNum:null,
+    madeList:[
+      {
+      src:'/customized/images/customized/cup_black_small.png',
+      name:'奶缸-黑色 350ml',
+      price:'¥45.00',
+      btnText:'定制',
+      btnDisabled:false,
+      state:true,
+      },
+      {
+        src: '/customized/images/customized/cup_black_small_2.png',
+        name: '奶缸-白色 350ml',
+        price: '¥45.00',
+        btnText: '定制',
+        btnDisabled: true,
+        state: false,
+      },
+      {
+        src: '/customized/images/customized/cup_black_small_3.png',
+        name: '马克杯-白色 450ml',
+        price: '¥45.00',
+        btnText: '定制',
+        btnDisabled: true,
+        state: false,
+      },
+      {
+        src: '/customized/images/customized/cup_black_small_4.png',
+        name: '马克杯-白色 300ml',
+        price: '¥45.00',
+        btnText: '定制',
+        btnDisabled: true,
+        state: false,
+      }
+    ]
   },
 
   /**
@@ -66,7 +100,10 @@ Page({
   onShareAppMessage: function () {
 
   },
-  customized:function(){
+  customized(e){
+    if (!e.currentTarget.dataset.state){
+      return;
+    }
     console.log('canvas')
     let user_id = getApp().globalData.user_id;
     console.log(user_id, "user_iduser_iduser_id")

+ 14 - 8
customized/pages/index/index.wxml

@@ -1,15 +1,17 @@
 <view class="auto">
-  <view class="f-box mar-t20 custom-list" bindtap='customized'>
+  <view wx:for="{{madeList}}" class="f-box mar-t20 custom-list" data-state="{{item.state}}" bindtap='customized'>
     <view class='cust-img mar-r20 mar-l20 f-box f-align-items-center'>
-      <image src="/customized/images/customized/cup_black_small.png" mode="aspectFit"></image>
+      <image src="{{item.src}}" mode="aspectFit"></image>
     </view>
     <view class="f-item mar-l20 mar-t20 mar-r20">
     <view class='cup-main'>
-     <view class='f-s32 mar-t20'>奶缸-黑色 350ml</view>
-      <view class="mar-t20 f-s30 c-orange">¥45.00</view>
+     <view class='f-s32 mar-t20'>{{item.name}}</view>
+      <view class="mar-t20 f-s30 c-orange">{{item.price}}</view>
      
      <view class='f-box mar-t20 f-s32 f-align-items-center'>
-       <navigator class='cust-btn f-item f-s32 c-green'>定制</navigator>
+      <view class='f-item'>
+        <navigator class="{{item.btnDisabled ? 'disabled' : ''}} cust-btn  f-s32 c-green">{{item.btnText}}</navigator>
+       </view>
        <view class='tu-icon f-box f-align-items-center'>
         <image src='/customized/images/customized/tu_icon.png' mode="aspectFit"></image>
       </view>
@@ -22,10 +24,10 @@
 
 
 
+</view>
 
-
-
-
+<view class='footer'>
+  <view class='footer-box'>
   <view class='cust-footer f-box f-justify-content-end'>
     <navigator open-type="switchTab" url='/pages/index/index' class='icon-shouye iconfont c-green'></navigator>
     <navigator url='/customized/pages/car/car' class='icon-gouwuche iconfont c-green icon-car'>
@@ -33,5 +35,9 @@
     </navigator>
     <navigator url='/customized/pages/user/user' class='icon-wode iconfont c-green'></navigator>
   </view>
+  </view>
 </view>
 
+  
+
+

+ 16 - 5
customized/pages/index/index.wxss

@@ -9,10 +9,7 @@ page{
 .cust-footer{
   height:100rpx;
   line-height:100rpx;
-  position: fixed;
-  bottom:0;
-  right:20rpx;
-  z-index:10;
+  padding-top:16rpx;
 }
 .cust-footer .iconfont{
   font-size:48rpx;
@@ -43,10 +40,24 @@ page{
   height:256rpx;
   background:#fff;
   border-radius:30rpx;
-  box-shadow: #ddd 1px 1px 10px 5px;
+  box-shadow: #ddd 1px 1px 8px 4px;
   overflow: hidden;
+  margin-top:30rpx;
 }
 .tu-icon image{
   width:109rpx;
   height:35rpx;
+}
+.cust-btn{
+  display: inline-block;
+  width:100rpx;
+  height:60rpx;
+  line-height:60rpx;
+  border-radius:10rpx;
+  text-align: center;
+  background:#00af66;
+  color:#fff;
+}
+.cust-btn.disabled{
+  background:#aaa;
 }

+ 7 - 4
customized/pages/order/order.js

@@ -7,7 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    state:null, // 请求状态]
+    state:2, // 请求状态]
     orderList:[], // 订单列表
     host: host,
     rows:1, //默认第一页
@@ -18,9 +18,12 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.setData({
-      state:options.state
-    })
+
+      this.setData({
+        state: options.state
+      })
+    
+    
     
   },
 

+ 3 - 3
customized/pages/order/order.wxml

@@ -1,5 +1,5 @@
-<view class='order-box bg-white c-333' wx:if="{{orderList.length !== 0}}">
-  <view class='order-list mar-b20' wx:for="{{orderList}}">
+<view class='order-box  c-333' wx:if="{{orderList.length !== 0}}">
+  <view class='order-list bg-white mar-b20' wx:for="{{orderList}}">
     <view class='mar-r20 mar-l20'>
       <text class='f-s30'>{{item.orderCustomGoodsList[0].customGoodsName}}</text>
       <view  class='f-box f-align-items-center f-s28 mar-t20 mar-b20'>
@@ -15,7 +15,7 @@
     <view class='f-box f-justify-content-end pad-t20 pad-b20 f-s30'>
       <view class='order-btn bg-orange' wx:if="{{item.orderStatus === '0'}}">立即付款</view>
       <!-- <view class='order-btn bg-orange' wx:if="{{item.orderStatus === '3'}}">查看物流</view> -->
-      <view class='order-btn bg-green' wx:if="{{item.orderStatus === '3'}}">确认收货</view>
+      <!-- <view class='order-btn bg-green' wx:if="{{item.orderStatus === '3'}}">确认收货</view> -->
     </view>
   </view>
 </view>

+ 18 - 2
customized/pages/result/result.js

@@ -5,14 +5,30 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    result:{
+      type:'success',
+      size:40,
+      color:'#00af66',
+      text:'支付成功',
+      btnText:'查看订单',
+      url:'/customized/pages/order/order?state=2'
+    }
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    if(!options.state){
+      this.setData({
+        type: 'clear',
+        size: 40,
+        color: 'purple',
+        text: '支付失败',
+        btnText: '返回首页',
+        url: '/pages/index/index'
+      })
+    }
   },
 
   /**

+ 12 - 2
customized/pages/result/result.wxml

@@ -1,2 +1,12 @@
-<!--customized/pages/result/result.wxml-->
-<text>customized/pages/result/result.wxml</text>
+<view class='result-box'>
+  <view class='bg-white result-icon'>
+    <block>
+      <icon type="{{result.type}}" size="{{result.size}}" color='{{result.color}}'/>
+    </block>
+    <view class='mar-t20 c-333'>{{result.text}}</view>
+  </view>
+  <view class='f-box result-nav'>
+    <navigator url='{{result.url}}' class='f-item c-white bg-green f-s32'>{{result.btnText}}</navigator>
+  </view>
+  
+</view>

+ 17 - 1
customized/pages/result/result.wxss

@@ -1 +1,17 @@
-/* customized/pages/result/result.wxss */
+.result-box{
+  text-align: center;
+}
+.result-icon{
+  padding:100rpx 0 60rpx;
+}
+.result-nav{
+  width:650rpx;
+  margin:100rpx auto;
+}
+.result-nav navigator{
+  height:88rpx;
+  line-height:88rpx;
+  display: inline-block;
+  margin:0 50rpx;
+  border-radius:50rpx;
+}

+ 15 - 1
project.config.json

@@ -28,7 +28,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 12,
+			"current": 14,
 			"list": [
 				{
 					"id": 0,
@@ -115,6 +115,20 @@
 					"pathName": "customized/pages/order/order",
 					"query": "",
 					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "result",
+					"pathName": "customized/pages/result/result",
+					"query": "",
+					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "index",
+					"pathName": "customized/pages/index/index",
+					"query": "",
+					"scene": null
 				}
 			]
 		}