Z1hgq 7 년 전
부모
커밋
cb498b654d
6개의 변경된 파일47개의 추가작업 그리고 21개의 파일을 삭제
  1. BIN
      Album/.DS_Store
  2. BIN
      Album/images/.DS_Store
  3. BIN
      Album/images/close.png
  4. 6 4
      Album/js/draw/FirstLevelDirectory.js
  5. 1 1
      Album/js/draw/details.js
  6. 40 16
      Album/js/main.js

BIN
Album/.DS_Store


BIN
Album/images/.DS_Store


BIN
Album/images/close.png


+ 6 - 4
Album/js/draw/FirstLevelDirectory.js

xqd xqd
@@ -29,6 +29,9 @@ export default class FLD {
       //drawText(text, index)
       context.fillStyle = '#000'
       context.font = "20px Arial"
+      if(text.length == 1){
+        context.fillText(text, (screenWidth - 29) * 2, ((index + 2) * 50 - 4) * 2)
+      }
       if (text.length == 2) {
         context.fillText(text, (screenWidth - 33) * 2, ((index + 2) * 50 - 4) * 2)
       }
@@ -48,13 +51,12 @@ export default class FLD {
       image.onload = function () {
         let ratio = image.width / image.height
         context.drawImage(image, (screenWidth - 48) * 2, (index * 50) * 2, 50 * 2, (50 / ratio) * 2)
-        context.drawImage(image, screenWidth - 60,20,30*2,(30/ratio)*2)
-        context.fillStyle = '#000'
-        context.font = '30px 黑体'
-        context.fillText(text, screenWidth,52)
       }
       context.fillStyle = '#000'
       context.font = "20px Arial"
+      if (text.length == 1) {
+        context.fillText(text, (screenWidth - 29) * 2, ((index + 2) * 50 - 4) * 2)
+      }
       if (text.length == 2) {
         context.fillText(text, (screenWidth - 33) * 2, ((index + 2) * 50 - 4) * 2)
       }

+ 1 - 1
Album/js/draw/details.js

xqd xqd
@@ -33,7 +33,6 @@ let ratio = img1.width / img1.height
 let loadingDown = false
 export default class Details {
   showDetails(context, image, text, price) {
-    console.log('detail begin')
     if (isiPhoneX) {
       //加载大图
       image.onload = function () {        
@@ -81,6 +80,7 @@ export default class Details {
         context.drawImage(img4, (screenWidth / 2 + 100) * 2, (screenHeight - 35) * 2, 90 * 2, (90 / ratio) * 2)
         context.drawImage(img5, 10 * 2, (screenHeight - 40) * 2, 30 * 2, 30 * 2)
         context.drawImage(forward, (screenWidth - 40) * 2, (screenHeight / 2 - 15) * 2, 60, 60)
+        context.drawImage(back, 10 * 2, (screenHeight / 2 - 15) * 2, 60, 60)
         wx.hideLoading()  
       }
     }

+ 40 - 16
Album/js/main.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -29,6 +29,7 @@ wx.getSystemInfo({
     else isiPhoneX = false
   }
 })
+console.log('iphonex:' + isiPhoneX)
 const screenWidth = sw
 const screenHeight = sh
 //定义画布
@@ -85,7 +86,7 @@ let SearchButton = [{ startX: 38, startY: 10, endX: 140, endY: 30 }, { startX: 1
 //翻页按钮
 const pageArea = [{ startX: screenWidth - 50, startY: screenHeight - 30, endX: screenWidth, endY: screenHeight }, { startX: screenWidth - 50, startY: screenHeight - 65, endX: screenWidth, endY: screenHeight - 35 }]
 //尺寸安装图片转换界面
-const attrArea = [{ startX: (screenWidth - (screenHeight - 100) * 1.778) / 2, startY: 30, endX: screenWidth / 2, endY: 60 }, { startX: screenWidth / 2, startY: 30, endX: (screenWidth + (screenHeight - 100) * 1.778) / 2 - 15, endY: 60 }, { startX: (screenWidth + (screenHeight - 100) * 1.778) / 2 - 15, startY: 30, endX: (screenWidth + (screenHeight - 100) * 1.778) / 2, endY: 60 }]
+const attrArea = [{ startX: (screenWidth - (screenHeight - 100) * 1.778) / 2, startY: 30, endX: screenWidth / 2, endY: 60 }, { startX: screenWidth / 2, startY: 30, endX: (screenWidth + (screenHeight - 100) * 1.778) / 2 - 30, endY: 60 }, { startX: (screenWidth + (screenHeight - 100) * 1.778) / 2 - 30, startY: 30, endX: (screenWidth + (screenHeight - 100) * 1.778) / 2, endY: 60 }]
 
 //定义目录选中状态
 let FLDstatus = false
@@ -102,6 +103,8 @@ let isAgent = false
 let attrFlag = false
 //风格是否打开
 let styleOpen = true
+//当前是尺寸还是安装
+let attrORupload = true
 //定义当前页数
 let page = 0
 //手指开始点击的坐标,用于判断手势滑动的左右上下方向
@@ -114,6 +117,8 @@ let style = 0
 let cat_id = 0
 //输入的搜索内容
 var KeyWord = ''
+//厂家名字
+var FactoryName = ''
 //绘制函数
 function reStart() {
   console.log('reStartSuccess')//调用成功输出'reStartSuccess'
@@ -137,6 +142,10 @@ function reStart() {
       context.font = "26px Arial"
       context.fillText('上一页', (screenWidth - 46) * 2, (screenHeight - 44) * 2)
     }
+    //厂家名字
+    context.fillStyle = '#000'
+    context.font = '30px 黑体'
+    context.fillText(FactoryName, screenWidth - 60, 52)
     //绘制一级目录
     try {
       let dir1 = new FLD()
@@ -630,20 +639,25 @@ wx.onTouchStart(((e) => {
         && y >= DetailbtnArea[4].startY
         && y <= DetailbtnArea[4].endY) {
         attrFlag = true
-        if (Buttonstatus == true) Buttonstatus = false
-        else Buttonstatus = true
+        Buttonstatus = false
         let img = new wx.createImage()
         img.src = GoodsDetail.upload_img
         img.onload = function () {
           let ratio = img.width / img.height
-          console.log(ratio)
           context.drawImage(img, (screenWidth - (screenHeight - 100) * ratio), 120, (screenHeight - 100) * 2 * ratio, (screenHeight - 100) * 2)
           context.fillStyle = '#F5F5F5'
           context.fillRect((screenWidth - (screenHeight - 100) * ratio), 60, (screenHeight - 100) * 2 * ratio, 60)
+          context.fillStyle = '#FFA500'
+          context.fillRect((screenWidth - (screenHeight - 100) * ratio), 118, (screenHeight - 100) * ratio,2 )
           context.fillStyle = '#696969'
           context.font = '30px Arial'
-          context.fillText('安装图/尺寸图', screenWidth - 100, 100)
-          context.fillText('✘', screenWidth + (screenHeight - 100) * ratio - 30, 100)
+          context.fillText('安装图', screenWidth - 280, 100)
+          context.fillText('尺寸图', screenWidth + 190, 100)
+          let closeImg = wx.createImage()
+          closeImg.src = 'images/close.png'
+          closeImg.onload = function(){
+            context.drawImage(closeImg,screenWidth + (screenHeight - 100) * ratio - 60,60,60,60)
+          }
         }
       }
       //上一张
@@ -707,19 +721,24 @@ wx.onTouchStart(((e) => {
         && y <= attrArea[0].endY) {
         attrFlag = true
         Buttonstatus = false
-        reStart()
         let img = new wx.createImage()
         img.src = GoodsDetail.upload_img
         img.onload = function () {
           let ratio = img.width / img.height
-          console.log('安装图')
           context.drawImage(img, (screenWidth - (screenHeight - 100) * ratio), 120, (screenHeight - 100) * 2 * ratio, (screenHeight - 100) * 2)
           context.fillStyle = '#F5F5F5'
           context.fillRect((screenWidth - (screenHeight - 100) * ratio), 60, (screenHeight - 100) * 2 * ratio, 60)
+          context.fillStyle = '#FFA500'
+          context.fillRect((screenWidth - (screenHeight - 100) * ratio), 118, (screenHeight - 100) * ratio, 2)
           context.fillStyle = '#696969'
           context.font = '30px Arial'
-          context.fillText('安装图/尺寸图', screenWidth - 100, 100)
-          context.fillText('✘', screenWidth + (screenHeight - 100) * ratio - 30, 100)
+          context.fillText('安装图', screenWidth - 280, 100)
+          context.fillText('尺寸图', screenWidth + 190, 100)
+          let closeImg = wx.createImage()
+          closeImg.src = 'images/close.png'
+          closeImg.onload = function () {
+            context.drawImage(closeImg, screenWidth + (screenHeight - 100) * ratio - 60, 60, 60, 60)
+          }
         }
       }
       if (x >= attrArea[1].startX
@@ -728,20 +747,24 @@ wx.onTouchStart(((e) => {
         && y <= attrArea[1].endY) {
         attrFlag = true
         Buttonstatus = false
-        reStart()
         let img = new wx.createImage()
         img.src = GoodsDetail.attr
         img.onload = function () {
           let ratio = img.width / img.height
-          console.log('尺寸图')
           context.drawImage(img, (screenWidth - (screenHeight - 100) * ratio), 120, (screenHeight - 100) * 2 * ratio, (screenHeight - 100) * 2)
           context.fillStyle = '#F5F5F5'
           context.fillRect((screenWidth - (screenHeight - 100) * ratio), 60, (screenHeight - 100) * 2 * ratio, 60)
+          context.fillStyle = '#FFA500'
+          context.fillRect(screenWidth, 118, (screenHeight - 100) * ratio, 2)
           context.fillStyle = '#696969'
           context.font = '30px Arial'
-          context.fillText('安装图/尺寸图', screenWidth - 100, 100)
-          context.fillText('✘', screenWidth + (screenHeight - 100) * ratio - 30, 100)
-
+          context.fillText('安装图', screenWidth - 280, 100)
+          context.fillText('尺寸图', screenWidth + 190, 100)
+          let closeImg = wx.createImage()
+          closeImg.src = 'images/close.png'
+          closeImg.onload = function () {
+            context.drawImage(closeImg, screenWidth + (screenHeight - 100) * ratio - 60, 60, 60, 60)
+          }
         }
       }
       //隐藏安装尺寸图片
@@ -928,6 +951,7 @@ function getGoodsSource(callback3, SLDsource) {
       try {
         let test = JSON.stringify(res.data)
         let tet = JSON.parse(test)
+        FactoryName = tet.data.name
         GoodsSource.splice(0, GoodsSource.length)//每次调用重新填充数据的时候清空之前数据
         for (let i in tet.data.goods) {
           GoodsSource.push(tet.data.goods[i])
@@ -946,7 +970,7 @@ function getGoodsSource(callback3, SLDsource) {
 
 }
 function callback3(res) {
- // console.log(GoodsSource)
+  // console.log(GoodsSource)
   reStart()
 }
 function getGoodsDetail(callback4, GoodsSource) {