| xqd
@@ -29,6 +29,7 @@ wx.getSystemInfo({
|
|
|
else isiPhoneX = false
|
|
|
}
|
|
|
})
|
|
|
+console.log('iphonex:' + isiPhoneX)
|
|
|
const screenWidth = sw
|
|
|
const screenHeight = sh
|
|
|
//定义画布
|
| xqd
@@ -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
|
| xqd
@@ -102,6 +103,8 @@ let isAgent = false
|
|
|
let attrFlag = false
|
|
|
//风格是否打开
|
|
|
let styleOpen = true
|
|
|
+//当前是尺寸还是安装
|
|
|
+let attrORupload = true
|
|
|
//定义当前页数
|
|
|
let page = 0
|
|
|
//手指开始点击的坐标,用于判断手势滑动的左右上下方向
|
| xqd
@@ -114,6 +117,8 @@ let style = 0
|
|
|
let cat_id = 0
|
|
|
//输入的搜索内容
|
|
|
var KeyWord = ''
|
|
|
+//厂家名字
|
|
|
+var FactoryName = ''
|
|
|
//绘制函数
|
|
|
function reStart() {
|
|
|
console.log('reStartSuccess')//调用成功输出'reStartSuccess'
|
| xqd
@@ -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()
|
| xqd
@@ -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)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//上一张
|
| xqd
@@ -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
|
| xqd
@@ -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)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//隐藏安装尺寸图片
|
| xqd
@@ -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])
|
| xqd
@@ -946,7 +970,7 @@ function getGoodsSource(callback3, SLDsource) {
|
|
|
|
|
|
}
|
|
|
function callback3(res) {
|
|
|
- // console.log(GoodsSource)
|
|
|
+ // console.log(GoodsSource)
|
|
|
reStart()
|
|
|
}
|
|
|
function getGoodsDetail(callback4, GoodsSource) {
|