浏览代码

底部添加轮子覆盖

sharp-agezi 5 年之前
父节点
当前提交
98bf33ad7d

二进制
box_white_big_1.psd


+ 6 - 4
components/component-made/made-solid.js

@@ -4,17 +4,19 @@ Component({
    */
   properties: {
     propPosition: Object,
-    propSize:Object
+    propSize: Object,
+    propBox: Object
+
   },
 
   /**
    * 组件的初始数据
    */
   data: {
-    
+
   },
-  ready(){
-    
+  ready() {
+
   },
 
   /**

+ 10 - 0
components/component-made/made-solid.wxml

@@ -7,5 +7,15 @@
       <view class='solid-slot'>
       <slot></slot>
       </view>
+      {{box}}
+      <!-- 凹凸块 -->
+      <view class="box" wx:if="{{propBox}}">
+        <view class="{{propBox.left}} box-size">
+          <view class="box-dashed"></view>
+        </view>
+        <view class="{{propBox.right}} box-size">
+         <view class="box-dashed"></view>
+        </view>
+      </view>
   </view>
 </view>

文件差异内容过多而无法显示
+ 37 - 0
components/component-made/made-solid.wxss


二进制
customized/images/customized/images/box_white_big_1_left.png


二进制
customized/images/customized/images/box_white_big_1_right.png


二进制
customized/images/customized/images/box_white_big_2_left.png


二进制
customized/images/customized/images/box_white_big_2_right.png


+ 24 - 5
customized/pages/boxMade/boxMade.js

@@ -29,6 +29,11 @@ Page({
       fontSize: '',
       height: '',
       width: '',
+    },
+    box: { // 盒子默认是白色正面
+      static: true,
+      left: 'box-white-1-left',
+      right: 'box-white-1-right'
     }
   },
 
@@ -130,11 +135,25 @@ Page({
     // data-id== 1正面,2背面,3手柄,4杯底
     // this.changeCupImg(e.currentTarget.dataset.id);
     let that = this;
-    let cupNum = util.changeCup(e.currentTarget.dataset.id)
+    let cupNum = util.changeCup(e.currentTarget.dataset.id);
+    let box = {};
+    if (e.currentTarget.dataset.id == 5) {
+      box = {
+        left: 'box-white-1-left',
+        right: 'box-white-1-right'
+      }
+    }
+    if (e.currentTarget.dataset.id == 6) {
+      box = {
+        left: 'box-white-2-left',
+        right: 'box-white-2-right'
+      }
+    }
     that.setData({
       isActive: e.currentTarget.dataset.id,
       dataPositionObj: cupNum.dataPositionObj,
-      propSize: cupNum.propSize
+      propSize: cupNum.propSize,
+      box: box
     })
     that.getDataTouch(that)
 
@@ -192,9 +211,9 @@ Page({
   finishDesign() { // 完成设计
     let that = this;
     let designObj = {
-      '5': '正面',
-      '6': '背面',
-    },
+        '5': '正面',
+        '6': '背面',
+      },
       designVal = '',
       madeStatic = false;
     for (let i = 5; i < 7; i++) {

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

@@ -3,7 +3,7 @@
 <view class='made-content'>
   <view class='made-img-box'>
     <image class='made-img-image' src='{{obverseImgObject[isActive]}}' mode="aspectFill"></image>
-    <made-solid prop-position="{{dataPositionObj}}" prop-size="{{propSize}}">
+    <made-solid prop-box="{{box}}" prop-position="{{dataPositionObj}}" prop-size="{{propSize}}">
       <view class='f-box f-align-items-center f-justify-content-center made-prompt ' style='text-align:center' wx:if="{{touchStatic}}">{{fontContent}}</view>
       <view class='made-box'>
       <!-- img -->

+ 1 - 1
utils/util.js

@@ -98,7 +98,7 @@ function changeCup(e) {
     case '6': //表示是箱子
       dataPositionObj = { // 正面数据
         top: 128,
-        left: 104,
+        left: 109,
         width: 534,
         height: 654
       };