wangyong 6 年之前
父节点
当前提交
f9780c9de0

+ 1 - 1
app.json

@@ -102,7 +102,7 @@
     }
   ],
   "window": {
-    "backgroundTextStyle": "white",
+    "backgroundTextStyle": "light",
     "navigationBarTextStyle": "white",
     "navigationBarTitleText": "大良造",
     "navigationBarBackgroundColor": "#252a2d",

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

@@ -12,14 +12,14 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-    console.log('canvas')
+    
   },
 
   /**
@@ -62,5 +62,20 @@ Page({
    */
   onShareAppMessage: function () {
 
+  },
+  customized:function(){
+    console.log('canvas')
+    let user_id = getApp().globalData.user_id;
+    console.log(user_id, "user_iduser_iduser_id")
+    if (!user_id) {
+      wx.navigateTo({
+        url: '/pages/authorize/authorize?link=customized',
+      })
+    } else {
+      wx.navigateTo({
+        url: "/customized/pages/made/made",
+      })
+    }
+   
   }
 })

+ 1 - 1
customized/pages/index/index.wxml

@@ -8,7 +8,7 @@
      <view class='f-s32'>奶缸-黑色 350ml</view>
       <view class="mar-t20 f-s32 c-orange">¥45.00</view>
     </view>
-      <navigator url="/customized/pages/made/made" class='cust-btn f-s36 bg-green c-white'>去定制</navigator>
+      <navigator bindtap='customized' class='cust-btn f-s36 bg-green c-white'>去定制</navigator>
     </view>
   </view>
   <view class='cust-footer f-box f-justify-content-end'>

+ 18 - 5
customized/pages/made/comb/comb.js

@@ -96,24 +96,31 @@ Page({
       wx.showLoading({
         title: '图片合成中...'
       })
-      let that = this;
+      let that = this,result = true;
       // for (let i = 1; i <= 4; i++) {
       //   if (wx.getStorageSync('madeCupImgData' + i) || wx.getStorageSync('madeCupFontData' + i)) {
       //     console.log(i, "iiiii")
       //     that.getCombImg(that, i);
       //   }
       // }
+      
       if (wx.getStorageSync('madeCupImgData1') || wx.getStorageSync('madeCupFontData1')) {
         that.getCombImg(that, 1);
+        result = false
       } else if (wx.getStorageSync('madeCupImgData2') || wx.getStorageSync('madeCupFontData2')) {
         that.getCombImg(that, 2);
+        result = false
       } else if (wx.getStorageSync('madeCupImgData3') || wx.getStorageSync('madeCupFontData3')) {
         that.getCombImg(that, 3);
-      } else if (wx.getStorageSync('madeCupImgData4') || wx.getStorageSync('madeCupFontData4')) {
+        result = false
+      }else if (wx.getStorageSync('madeCupImgData4') || wx.getStorageSync('madeCupFontData4')) {
         that.getCombImg(that, 4);
-      } else {
-        wx.hideLoading();
+        result = false
       }
+  
+    if (result){
+      wx.hideLoading();
+    }
     // }
     
 
@@ -252,6 +259,7 @@ Page({
     
   },
   getComb(that, imgSrcArray,i,_static) {
+    console.log(imgSrcArray,"imgSrcArray")
     if(_static){
       let imgTouch = wx.getStorageSync('madeCupImgData' + i);
       let dataPositionObj = util.changeCup(i.toString()).dataPositionObj;
@@ -302,7 +310,12 @@ Page({
         },
       })
     } else {
-      wx.hideLoading()
+      if (i < 4) {
+        i = i + 1
+        that.getCombImg(that, i);
+      } else {
+        wx.hideLoading()
+      }
     }
     
   }

+ 1 - 1
customized/pages/made/comb/comb.wxml

@@ -25,5 +25,5 @@
 
 <view class='footer f-box f-justify-content-between' hover-class="none">
   <view class='f-item footer-btn f-s32' style='background:#ffc102;color:#fff' bindtap='addImgRouter' hover-class="none">加入购物车</view>
-  <view class='f-item footer-btn f-s32' style='background:#ff7103;color:#fff' bindtap='addFontRouter' hover-class="none">立即购买</view>
+  <!-- <view class='f-item footer-btn f-s32' style='background:#ff7103;color:#fff' bindtap='addFontRouter' hover-class="none">立即购买</view> -->
 </view>

+ 6 - 2
pages/authorize/authorize.js

@@ -113,7 +113,7 @@ Page({
                   console.log("link:" + link);
 
                   //授权成功后,跳转
-                  if (link != 'awaitState' && link != 'buy' && link != 'mine') {//来自收礼物页面的授权请求  来自产品详情页
+                  if (link != 'awaitState' && link != 'buy' && link != 'mine' && link != 'customized') {//来自收礼物页面的授权请求  来自产品详情页
                     wx.redirectTo({
                       url: "/pages/" + link + "/" + link,
                     })
@@ -129,7 +129,11 @@ Page({
                       url: "/pages/" + link + "/" + link,
                     })
 
-                  } else if (link == 'midAutumn') {
+                  } else if (link == 'customized') { // 设计
+                    wx.redirectTo({
+                      url: "/customized/pages/made/made",
+                    })
+                  }else if (link == 'midAutumn') {
                     wx.navigateBack({
                       delta: 1
                     })

+ 0 - 1
pages/mine/mine.wxml

@@ -19,7 +19,6 @@
     </view> -->
 
   </view>
-
   <!-- 模块按钮 -->
   <view class='cont_btn_wrap'>
     <view  bindtap='linkOrder'   class='cont_btn_each  cont_btn_each_left'>