commit 09ca9e7d09fabdb573423f2e03c3cd6ce33dacb6 Author: Eddie <102564160@qq.com> Date: Tue Mar 2 09:29:00 2021 +0800 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14ea590 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Windows +[Dd]esktop.ini +Thumbs.db +$RECYCLE.BIN/ + +# macOS +.DS_Store +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes + +# Node.js +node_modules/ diff --git a/app.js b/app.js new file mode 100644 index 0000000..d78af5a --- /dev/null +++ b/app.js @@ -0,0 +1,30 @@ +App({ + + /** + * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) + */ + onLaunch: function () { + + }, + + /** + * 当小程序启动,或从后台进入前台显示,会触发 onShow + */ + onShow: function (options) { + + }, + + /** + * 当小程序从前台进入后台,会触发 onHide + */ + onHide: function () { + + }, + + /** + * 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息 + */ + onError: function (msg) { + + } +}) diff --git a/app.json b/app.json new file mode 100644 index 0000000..334c4db --- /dev/null +++ b/app.json @@ -0,0 +1,41 @@ +{ + "usingComponents": { + "loading": "./cmponent/loading/loading" + }, + "pages": [ + "pages/index/index", + "pages/pageSearch/pageSearch", + "pages/pageSerchDetail/pageSerchDetail", + "pages/detailContent/detailContent", + "pages/pageInquire/pageInquire", + "pages/pageBusiness/pageBusiness" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTextStyle": "black", + "backgroundColor": "#F9F9F9" + }, + "tabBar": { + "color": "#A3A3A3", + "selectedColor": "#F85E4C", + "backgroundColor": "#FFFFFF", + "borderStyle": "white", + "list": [ + { + "pagePath": "pages/index/index", + "text": "配色查询 ", + "iconPath": "images/business2.png", + "selectedIconPath": "images/business.png" + }, + { + "pagePath": "pages/pageBusiness/pageBusiness", + "text": "商务合作", + "iconPath": "images/index2.png", + "selectedIconPath": "images/index.png" + } + ] + }, + "style": "v2", + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..c99d48c --- /dev/null +++ b/app.wxss @@ -0,0 +1,63 @@ +page { + background: #F9F9F9; +} + + +.head-box { + width: 100vw; + background: #FFF; + height: 85rpx; + padding: 0rpx 24rpx 16rpx 24rpx; + box-sizing: border-box; +} + +.head-search { + width: 100%; + height: 100%; + background: #F9F9F9; + border-radius: 35rpx; + font-size: 28rpx; + color: #999999; + padding: 15rpx 0; + box-sizing: border-box; +} + +.search-icon { + display: inline-block; + height: 36rpx; + width: 36rpx; + vertical-align: middle; + margin: 0 10rpx 0 20prx; +} + +.head-input { + display: inline-block; + vertical-align: middle; +} + +::-webkit-scrollbar{ width: 0;height: 0;color: transparent; } + + + + + +.kong-box { + overflow: hidden; + width: 100%; + margin-top: 22.4%; + text-align: center; +} + +.kongPng { + width: 48.53%; + margin-bottom: 40rpx; +} + +.kongText { + color: #F85E4C; + font-size: 36rpx; + font-weight: 400; +} + + + \ No newline at end of file diff --git a/cmponent/loading/loading.js b/cmponent/loading/loading.js new file mode 100644 index 0000000..01e11a0 --- /dev/null +++ b/cmponent/loading/loading.js @@ -0,0 +1,24 @@ +// cmponent/loading/loading.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + + } +}) diff --git a/cmponent/loading/loading.json b/cmponent/loading/loading.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/cmponent/loading/loading.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/cmponent/loading/loading.wxml b/cmponent/loading/loading.wxml new file mode 100644 index 0000000..33ed769 --- /dev/null +++ b/cmponent/loading/loading.wxml @@ -0,0 +1,6 @@ + + + + 加载中··· + + \ No newline at end of file diff --git a/cmponent/loading/loading.wxss b/cmponent/loading/loading.wxss new file mode 100644 index 0000000..e0c1023 --- /dev/null +++ b/cmponent/loading/loading.wxss @@ -0,0 +1,34 @@ +/* cmponent/loading/loading.wxss */ + +.masked-box { + width: 100vw; + height: 100vh; + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; +} + +.masked-loading { + width: 220rpx; + height: 220rpx; + position: absolute; + left: 0; + right: 0; + top: 0%; + bottom: 0; + margin: auto auto; + background:rgba(0, 0, 0, 0.2); + border-radius: 10rpx; + text-align: center; + color: rgb(238, 238, 238); + font-size: 28rpx; +} + +.masked-loading image { + width: 80rpx; + height: 80rpx; + margin:40rpx auto 10rpx; + display: block; +} \ No newline at end of file diff --git a/images/business.png b/images/business.png new file mode 100644 index 0000000..efff77b Binary files /dev/null and b/images/business.png differ diff --git a/images/business2.png b/images/business2.png new file mode 100644 index 0000000..441fd8a Binary files /dev/null and b/images/business2.png differ diff --git a/images/dizhi.png b/images/dizhi.png new file mode 100644 index 0000000..5e07ae3 Binary files /dev/null and b/images/dizhi.png differ diff --git a/images/fuzhi.png b/images/fuzhi.png new file mode 100644 index 0000000..04b36f7 Binary files /dev/null and b/images/fuzhi.png differ diff --git a/images/index.png b/images/index.png new file mode 100644 index 0000000..8849c48 Binary files /dev/null and b/images/index.png differ diff --git a/images/index2.png b/images/index2.png new file mode 100644 index 0000000..137b07e Binary files /dev/null and b/images/index2.png differ diff --git a/images/juhua.gif b/images/juhua.gif new file mode 100644 index 0000000..78d58cc Binary files /dev/null and b/images/juhua.gif differ diff --git a/images/kong.png b/images/kong.png new file mode 100644 index 0000000..45c51a2 Binary files /dev/null and b/images/kong.png differ diff --git a/images/phone.png b/images/phone.png new file mode 100644 index 0000000..cd0cb87 Binary files /dev/null and b/images/phone.png differ diff --git a/images/search-icon.png b/images/search-icon.png new file mode 100644 index 0000000..137b07e Binary files /dev/null and b/images/search-icon.png differ diff --git a/images/serch.png b/images/serch.png new file mode 100644 index 0000000..65eff80 Binary files /dev/null and b/images/serch.png differ diff --git a/images/weixin.png b/images/weixin.png new file mode 100644 index 0000000..e7e9423 Binary files /dev/null and b/images/weixin.png differ diff --git a/images/you.png b/images/you.png new file mode 100644 index 0000000..51a13c5 Binary files /dev/null and b/images/you.png differ diff --git a/pages/detailContent/detailContent.js b/pages/detailContent/detailContent.js new file mode 100644 index 0000000..7f43665 --- /dev/null +++ b/pages/detailContent/detailContent.js @@ -0,0 +1,271 @@ +// pages/detailContent/detailContent.js +const utils = require('../../utils/serve') + +Page({ + + /** + * 页面的初始数据 + */ + data: { + searchData: [ + ], + isItem: 3, + gramNum: null, + paginate: null, + rightStatus: true, + leftStatus: true, + hLoading: true, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.initOn() + }, + skipSearch: function () { + wx.navigateTo({ + url: '/pages/pageSearch/pageSearch', + }) + }, + + + // 右滑翻页 + onbolwerRight: function () { + console.log(this.data.searchData[this.data.searchData.length - 1]) + this.setData({ + hLoading: false + }) + + + if (this.data.rightStatus) { + utils.http({ + url: '/manicureApi/Index/finishedProduct', + method: 'GET', + data: { + id: this.data.searchData[this.data.searchData.length - 1].id, + type: 'right' + } + }).then(res => { + if (res.data.lists.length === 0) { + wx.showToast({ + title: '已经到底啦~', + duration: 2000, + icon: 'none', + success: () => { + this.setData({ + hLoading: true + }) + } + }) + return + } + + if (res.data.lists.length >= 1 && res.data.lists.length === 20) { + this.data.rightStatus = true + } else { + this.data.rightStatus = false + } + + this.setData({ + searchData: this.data.searchData.concat(res.data.lists), + hLoading: true + }) + }) + } else { + wx.showToast({ + title: '已经到低啦~', + duration: 2000, + icon: 'none', + success:()=>{ + this.setData({ + hLoading: true + }) + } + }) + } + }, + + + // 左翻页 + onbolwerLeft: function () { + + this.setData({ + hLoading: false + }) + + if (this.data.leftStatus) { + utils.http({ + url: '/manicureApi/Index/finishedProduct', + method: 'GET', + data: { + id: this.data.searchData[0].id, + type: 'left' + } + }).then(res => { + if (res.data.lists.length >= 1 && res.data.lists.length === 20) { + this.data.leftStatus = true + } else { + this.data.leftStatus = false + } + + + + this.setData({ + searchData: res.data.lists.concat(this.data.searchData), + hLoading: true + }) + }) + } else { + wx.showToast({ + title: '已经到顶了~', + duration: 2000, + icon: 'none', + success:()=>{ + this.setData({ + hLoading: true + }) + } + }) + } + }, + + + onSwiperItem: function (ev) { + this.setData({ + isItem: ev.detail.current + }) + }, + + + + initOn: function (params) { + const eventChannel = this.getOpenerEventChannel() + eventChannel.on('acceptDataFromOpenerPage', (data, list, paginate, finData) => { + + let isItem = 0; + for (let i = 0; i < list.length; i++) { + if (list[i].id === data.id) { + isItem = i + break + } + } + + if (isItem <= 1) { + utils.http({ + url: '/manicureApi/Index/finishedProduct', + method: 'GET', + data: { + id: list[0].id, + type: 'left' + } + }).then(res => { + + if (res.data.lists.length >= 1 && res.data.lists.length === 20) { + this.data.leftStatus = true + } else { + this.data.leftStatus = false + } + + + + + this.setData({ + searchData: res.data.lists.concat(list), + isItem: isItem + res.data.lists.length + }, () => { + this.data.paginate = paginate + this.data.finData = finData + }) + }) + } else { + this.setData({ + searchData: list, + isItem: isItem + }, () => { + this.data.paginate = paginate + this.data.finData = finData + }) + } + }) + }, + + setSearchColor: function (ev) { + + this.setData({ + isItem: ev.currentTarget.dataset.index + }) + }, + + + skipInquire: function () { + utils.http({ + url: '/manicureApi/Index/productDetail', + method: 'GET', + data: { + id: this.data.searchData[this.data.isItem].id, + num: this.data.gramNum, + } + }).then(res => { + console.log(res) + let data = JSON.stringify(res.data) + wx.navigateTo({ + url: `/pages/pageInquire/pageInquire?data=${data}`, + }) + }) + }, + + + onInputGram: function (ev) { + this.data.gramNum = ev.detail.value + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/detailContent/detailContent.json b/pages/detailContent/detailContent.json new file mode 100644 index 0000000..aa887ad --- /dev/null +++ b/pages/detailContent/detailContent.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "配色" +} \ No newline at end of file diff --git a/pages/detailContent/detailContent.wxml b/pages/detailContent/detailContent.wxml new file mode 100644 index 0000000..89468f7 --- /dev/null +++ b/pages/detailContent/detailContent.wxml @@ -0,0 +1,54 @@ + + + + + + + + + + + + 美甲效果 + + + + + + 色号:{{item.name}} + + + + + + + 指甲色 + + + + + + + + + + {{item.name}} + + + + + + + + + g + + + + 查询 + + + + \ No newline at end of file diff --git a/pages/detailContent/detailContent.wxss b/pages/detailContent/detailContent.wxss new file mode 100644 index 0000000..050ebc5 --- /dev/null +++ b/pages/detailContent/detailContent.wxss @@ -0,0 +1,159 @@ +/* pages/detailContent/detailContent.wxss */ + +.body-box { + padding: 0 24rpx; + width: 100%; + box-sizing: border-box; +} + +.head-title { + height: 98rpx; + width: 100%; + line-height: 98rpx; + color: #333333; + font-size: 30rpx; + font-weight: 500; +} + +.swiper-box { + width: 100%; + height: 539rpx; + border-radius: 16rpx; + overflow: hidden; +} + +.swiper { + width: 100%; + height: 100%; +} + +.imageUrl { + width: 100%; + height: 100%; +} + +.imageUrl-box { + position: relative; + width: 100%; + height: 100%; +} + +.swiper .itemTitle { + position: absolute; + z-index: 9; + bottom: 20rpx; + left: 0rpx; + right: 0rpx; + margin: 0 auto; + text-align: center; + color: #F85E4C; + font-size: 24rpx; +} + +.scroll-view { + padding-left: 24rpx; + white-space: nowrap; + height: 209rpx; + width: 100%; + box-sizing: border-box; +} + +.scroll-view-box { + display: inline-block; + width: 160rpx; + height: 209rpx; + border-radius: 16rpx; + margin-right: 16rpx; + overflow: hidden; +} + + + + + +.scroll-view-box>image { + width: 160rpx; + height: 160rpx; + vertical-align: middle; +} + +.scroll-view-box>.itemTitle { + text-align: center; + color: #333333; + width: 100%; + height: 49rpx; + line-height: 49rpx; + font-size: 24rpx; + background: #F1F1F1; + font-weight: 500; +} + +.scroll-view-box>.itemColor { + text-align: center; + color: #FFF; + width: 100%; + height: 49rpx; + line-height: 49rpx; + font-size: 24rpx; + background: #F96956; + font-weight: 500; +} + + +.bottom-box { + width: 100%; + padding: 0 24rpx; + margin-top: 52rpx; + box-sizing: border-box; +} + +.input-box { + width: 100%; + background-color: #FFF; + height: 88rpx; + border-radius: 16rpx; + vertical-align: middle; + position: relative; + text-align: center; + +} + +.inputItem { + display: inline-block; + height:100%; + color: #333333; + font-size: 30rpx; + font-weight: 500; +} + + +.text-g { + position: absolute; + color: #999999; + font-size: 30rpx; + line-height: 88rpx; + right: 30rpx; + top: 0; +} + + +.button-box { + width: 100%; + height: 88rpx; + line-height: 88rpx; + text-align: center; + color: #FFF; + margin-top: 24rpx; + background: #F85E4C; + box-shadow: 0rpx 4rpx 20rpx 0px #FFB9B1; + border-radius: 16rpx; + font-size: 24rpx; + font-weight: 500; +} + +.serch-n { + width: 26rpx; + margin-right: 10rpx; + vertical-align: -4rpx; + +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js new file mode 100644 index 0000000..0e8a6b2 --- /dev/null +++ b/pages/index/index.js @@ -0,0 +1,134 @@ +// pages/index/index.js +const utils = require('../../utils/serve') + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + swiperArr: [], + mainData: [], + paginate: null, + juhuaLoading: false, + }, + + + skipSearch: function(){ + wx.navigateTo({ + url: '/pages/pageSearch/pageSearch', + }) + }, + + skipSerchDetail: function(ev){ + wx.navigateTo({ + url: `/pages/pageSerchDetail/pageSerchDetail?param=${JSON.stringify(ev.currentTarget.dataset.param)}`, + }) + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.init() + + }, + + init (){ + utils.http({ + url:'/manicureApi/Index/banner', + method:'GET', + }).then(res=>{ + this.setData({ + swiperArr: res.data + }) + }) + + utils.http({ + url:'/manicureApi/Index/colorList', + method:'GET', + }).then(res=>{ + this.setData({ + mainData: res.data.lists, + paginate: res.data.paginate + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + if( this.data.mainData.length < this.data.paginate.total) { + wx.showLoading({ + title: '加载中···', + mask: true, + + }) + + + // 加载更多 + utils.http({ + url:'/manicureApi/Index/colorList?p=2', + method:'GET', + }).then(res=>{ + this.setData({ + mainData: this.data.mainData.concat(res.data.lists) + },()=>{ + wx.hideLoading() + }) + }) + } else { + wx.showToast({ + title: '已经到底啦~', + duration: 3000, + icon: 'none', + }) + } + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/index/index.json b/pages/index/index.json new file mode 100644 index 0000000..b4011c5 --- /dev/null +++ b/pages/index/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "美甲" +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml new file mode 100644 index 0000000..0590b55 --- /dev/null +++ b/pages/index/index.wxml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.name}} + + + + + + + 加载中··· + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss new file mode 100644 index 0000000..1e80061 --- /dev/null +++ b/pages/index/index.wxss @@ -0,0 +1,89 @@ + + +.swiper-box { + width: 100%; + padding: 20rpx 24rpx 16rpx; + box-sizing: border-box; + background:#FFF; + +} + +.swiper { + width: 100%; + height: 265rpx; + border-radius: 10rpx; + overflow: hidden; +} + + +.imageUrl { + width: 100%; + height: 100%; + +} + +.wx-swiper-dots.wx-swiper-dots-horizontal{ + margin-left: 40%; + /* margin-bottom: 40rpx; */ +} + + +.main-box { + padding: 0 24rpx; + width: 100%; + box-sizing: border-box; + margin-top: 16rpx; +} + +.mainItem-box { + width: 223rpx; + height: 297rpx; + border-radius: 16rpx; + overflow: hidden; + display: inline-block; + margin: 0 16rpx 16rpx 0; + vertical-align: middle; +} + +.mainItem-box:nth-child(3n){ + margin-right: 0; +} + + + +.imageUrl-box { + width: 223rpx; + height: 223rpx; +} + + +.imageUrl-box > .imageUrl { + width: 100%; + height: 100% +} + + +.item-title { + height: 74rpx; + color: #333333; + font-weight: 500; + font-size: 30rpx; + line-height: 74rpx; + text-align: center; + background:#F1F1F1; +} + +.juhua-box { + text-align: center; + line-height: 30rpx; + font-size: 30rpx; + color: #333333; + padding: 10rpx 0; +} + +.juhua { + width: 50rpx; + height: 50rpx; + vertical-align: middle; + margin-left: 6rpx; +} \ No newline at end of file diff --git a/pages/pageBusiness/pageBusiness.js b/pages/pageBusiness/pageBusiness.js new file mode 100644 index 0000000..d7dd8aa --- /dev/null +++ b/pages/pageBusiness/pageBusiness.js @@ -0,0 +1,97 @@ +// pages/pageBusiness/pageBusiness.js +const utils = require('../../utils/serve') + + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + swiperArr: [], + busData: null, + }, + + Clipboard: function (event) { + let value = event.currentTarget.dataset.value + + wx.setClipboardData({ + data: value, + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.init() + }, + + init: function (params) { + utils.http({ + url: '/manicureApi/Index/business', + method: 'GET', + }).then(res => { + + + this.setData({ + swiperArr: res.data.list, + busData: { + businessWechat: res.data.businessWechat, + businessPhone: res.data.businessPhone, + businessAddress: res.data.businessAddress, + } + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/pageBusiness/pageBusiness.json b/pages/pageBusiness/pageBusiness.json new file mode 100644 index 0000000..6f4a905 --- /dev/null +++ b/pages/pageBusiness/pageBusiness.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "商务合作" +} \ No newline at end of file diff --git a/pages/pageBusiness/pageBusiness.wxml b/pages/pageBusiness/pageBusiness.wxml new file mode 100644 index 0000000..479674d --- /dev/null +++ b/pages/pageBusiness/pageBusiness.wxml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + 联系方式 + + + + + 办公地址 + + + {{ busData.businessAddress }} + + + 复制 + + + + + + + + + + 联系电话 + + + {{busData.businessPhone}} + + + 复制 + + + + + + + + + + 联系微信 + + + {{busData.businessWechat}} + + + 复制 + + + + + \ No newline at end of file diff --git a/pages/pageBusiness/pageBusiness.wxss b/pages/pageBusiness/pageBusiness.wxss new file mode 100644 index 0000000..c46ca58 --- /dev/null +++ b/pages/pageBusiness/pageBusiness.wxss @@ -0,0 +1,103 @@ +/* pages/pageBusiness/pageBusiness.wxss */ +page { + padding: 20rpx 24rpx 0; + box-sizing: border-box; + width: 100%; +} + +.swiper-box { + width: 100%; + height: 300rpx; + box-sizing: border-box; + background: #FFF; + +} + +.swiper { + width: 100%; + height: 300rpx; + border-radius: 10rpx; + overflow: hidden; +} + + +.imageUrl { + width: 100%; + height: 100%; + +} + +.bus-list { + overflow: hidden; + margin-bottom: 20rpx; +} + + +.business-box { + width: 100%; + height: 493rpx; + background: #FFF; + margin-top: 24rpx; + border-radius: 16rpx; + overflow: hidden; + box-sizing: border-box; + padding: 0 16rpx; +} + + +.title1 { + font-weight: 500; + color: #333333; + font-size: 28rpx; + height: 88rpx; + line-height: 88rpx; +} + +.itemHead { + font-size: 26rpx; + color: #666666; + font-weight: 500; + line-height: 26rpx; + margin-bottom: 20rpx; + vertical-align: middle; + overflow: hidden; +} + +.itemHead>image { + width: 24rpx; + margin-right: 6rpx; + vertical-align: -1rpx; + +} + + +.itemCotnent { + width: 100%; + height: 68rpx; + background: #F9F9F9; + border-radius: 6rpx; + vertical-align: middle; + line-height: 68rpx; + padding: 0 16rpx; + box-sizing: border-box; +} + +.itemLeft { + float: left; + height: 100%; + font-size: 24rpx; + color: #333333; +} + +.itemRihgt { + float: right; + height: 100%; + font-size: 22rpx; + color: #999999; +} + +.itemRihgt > image { + width: 24rpx; + vertical-align: -3rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/pageInquire/pageInquire.js b/pages/pageInquire/pageInquire.js new file mode 100644 index 0000000..f7598e2 --- /dev/null +++ b/pages/pageInquire/pageInquire.js @@ -0,0 +1,74 @@ +// pages/pageInquire/pageInquire.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + searchData: [] + }, + + onItem: function(){ + + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(options) + this.setData({ + searchData: JSON.parse(options.data) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/pageInquire/pageInquire.json b/pages/pageInquire/pageInquire.json new file mode 100644 index 0000000..865daf5 --- /dev/null +++ b/pages/pageInquire/pageInquire.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "配色查询" +} \ No newline at end of file diff --git a/pages/pageInquire/pageInquire.wxml b/pages/pageInquire/pageInquire.wxml new file mode 100644 index 0000000..77ca635 --- /dev/null +++ b/pages/pageInquire/pageInquire.wxml @@ -0,0 +1,10 @@ + + + + {{item.colorName}} + + {{item.unit}} + g + + + \ No newline at end of file diff --git a/pages/pageInquire/pageInquire.wxss b/pages/pageInquire/pageInquire.wxss new file mode 100644 index 0000000..7daa081 --- /dev/null +++ b/pages/pageInquire/pageInquire.wxss @@ -0,0 +1,35 @@ +/* pages/pageInquire/pageInquire.wxss */ + + +.view-box { + width: 93.6%; + height: 158rpx; + background: linear-gradient(93deg, #FFFFFF 0%, #F1F1F1 100%); + border-radius: 16rpx; + margin: 16rpx auto; + overflow: hidden; + line-height: 158rpx; +} + +.imageUrl { + width: 158rpx; + height: 158rpx; + vertical-align: middle; + display: inline-block; +} + + +.item-title { + height: 100%; + display: inline-block; + margin-left: 26rpx; + font-size: 30rpx; + font-weight: 500; + color: #333333; +} + +.floatRight { + float: right; + height: 100%; + margin-right: 24rpx; +} \ No newline at end of file diff --git a/pages/pageSearch/pageSearch.js b/pages/pageSearch/pageSearch.js new file mode 100644 index 0000000..667e019 --- /dev/null +++ b/pages/pageSearch/pageSearch.js @@ -0,0 +1,106 @@ +// pages/pageSearch/pageSearch.js +const pubic = require('../../utils/pubic') +const utils = require('../../utils/serve') + +Page({ + + /** + * 页面的初始数据 + */ + data: { + isKong: false, + searchData: [] + }, + skipDetail: function (ev) { + let param = ev.currentTarget.dataset.param + wx.redirectTo({ + url: '/pages/detailContent/detailContent', + success: res=> { + // 通过eventChannel向被打开页面传送数据 + res.eventChannel.emit('acceptDataFromOpenerPage', param , this.data.searchData , this.data.paginate , this.data.finData) + } + }) + }, + + onInput:pubic.Debounce(function(ev){ + console.log(ev) + wx.showLoading({ + title: '搜索中···', + mask: true, + }) + + + + utils.http({ + url:'/manicureApi/Index/finishedProduct', + method:'GET', + data:{ + name: ev.detail.value, + p: 1 + } + }).then(res=>{ + this.setData({ + searchData: res.data.lists, + value : ev.detail.value + }) + }) + }), + + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(pubic) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/pageSearch/pageSearch.json b/pages/pageSearch/pageSearch.json new file mode 100644 index 0000000..2add0d2 --- /dev/null +++ b/pages/pageSearch/pageSearch.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "搜索" +} \ No newline at end of file diff --git a/pages/pageSearch/pageSearch.wxml b/pages/pageSearch/pageSearch.wxml new file mode 100644 index 0000000..d28a9d5 --- /dev/null +++ b/pages/pageSearch/pageSearch.wxml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + + + 暂无该色号! + + \ No newline at end of file diff --git a/pages/pageSearch/pageSearch.wxss b/pages/pageSearch/pageSearch.wxss new file mode 100644 index 0000000..5715513 --- /dev/null +++ b/pages/pageSearch/pageSearch.wxss @@ -0,0 +1,60 @@ + + + +.serchData-body { + width: 100%; + box-sizing: border-box; + padding: 15rpx 24rpx 0; +} + +.serchData-box { + padding: 0 20rpx 24rpx; + width: 100%; + background: #FFF; + box-sizing: border-box; + border-radius: 16rpx; +} + + +.searchData-item { + height: 109rpx; + line-height: 109rpx; + overflow: hidden; + border-bottom: 1rpx solid #f0efef; +} + +.imageUrl-box { + display: inline-block; + width: 60rpx; + height: 60rpx; + line-height: 60rpx; + border-radius: 50%; + overflow: hidden; + box-sizing: border-box; + border: 1rpx solid #F1F1F1; + vertical-align: middle; +} + +.imageUrl-box > image { + width: 60rpx; + height: 60rpx; +} + +.title-box { + display: inline-block; + vertical-align: middle; + margin-left: 10rpx; + color: #333333; + font-weight: 400; + font-size: 28rpx; +} + +.you-box { + float: right; + height: 100%; + +} + +.you-item { + width: 26rpx; +} \ No newline at end of file diff --git a/pages/pageSerchDetail/pageSerchDetail.js b/pages/pageSerchDetail/pageSerchDetail.js new file mode 100644 index 0000000..9ce4d61 --- /dev/null +++ b/pages/pageSerchDetail/pageSerchDetail.js @@ -0,0 +1,108 @@ +// pages/pageSerchDetail/pageSerchDetail.js + +const utils = require('../../utils/serve') + + +Page({ + + /** + * 页面的初始数据 + */ + data: { + searchData: [], + paginate: null, + }, + skipSearch: function(){ + wx.navigateTo({ + url: '/pages/pageSearch/pageSearch', + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.init(JSON.parse(options.param)) + wx.setNavigationBarTitle({ + title: JSON.parse(options.param).name + }) + }, + + init: function (params) { + utils.http({ + url: '/manicureApi/Index/finishedProduct', + method: 'GET', + data: { + color_id: params.id, + } + }).then(res => { + this.setData({ + searchData: res.data.lists, + },()=>{ + this.data.paginate = res.data.paginate + this.data.finData = params + }) + }) + }, + + + skipDetail: function (ev) { + + let param = ev.currentTarget.dataset.param + wx.navigateTo({ + url: '/pages/detailContent/detailContent', + success: res=> { + // 通过eventChannel向被打开页面传送数据 + res.eventChannel.emit('acceptDataFromOpenerPage', param , this.data.searchData , this.data.paginate , this.data.finData) + } + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/pageSerchDetail/pageSerchDetail.json b/pages/pageSerchDetail/pageSerchDetail.json new file mode 100644 index 0000000..d8bbc60 --- /dev/null +++ b/pages/pageSerchDetail/pageSerchDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "" +} \ No newline at end of file diff --git a/pages/pageSerchDetail/pageSerchDetail.wxml b/pages/pageSerchDetail/pageSerchDetail.wxml new file mode 100644 index 0000000..517f660 --- /dev/null +++ b/pages/pageSerchDetail/pageSerchDetail.wxml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + 暂无该色号! + + + + \ No newline at end of file diff --git a/pages/pageSerchDetail/pageSerchDetail.wxss b/pages/pageSerchDetail/pageSerchDetail.wxss new file mode 100644 index 0000000..67860ad --- /dev/null +++ b/pages/pageSerchDetail/pageSerchDetail.wxss @@ -0,0 +1,45 @@ + +.detail-box { + padding: 0rpx 24rpx; + margin-top: 24rpx; + box-sizing: border-box; + width: 100%; +} + + +.detail-item { + width: 160rpx; + height: 204rpx; + display: inline-block; + margin: 0 20rpx 24rpx 0; + border-radius: 9rpx; + overflow: hidden; + vertical-align: middle; +} + +.detail-item:nth-child(4n) { + margin-right: 0; +} + + +.itemHead { + width: 100%; + height: 160rpx; +} + +.itemHead > image { + width: 100%; + height: 100%; + display: inline-block; + vertical-align: middle; +} + + +.item-title { + text-align: center; + background: #F1F1F1; + color: #333333; + font-size: 20rpx; + line-height: 45rpx; + height: 45rpx; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..3971b43 --- /dev/null +++ b/project.config.json @@ -0,0 +1,71 @@ +{ + "description": "项目配置文件", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": false, + "es6": true, + "enhance": false, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": false, + "coverView": true, + "nodeModules": false, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "useMultiFrameRuntime": true, + "useApiHook": true, + "useApiHostProcess": false, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "enableEngineNative": false, + "bundle": false, + "useIsolateContext": true, + "useCompilerModule": true, + "userConfirmedUseCompilerModuleSwitch": false, + "userConfirmedBundleSwitch": false, + "packNpmManually": false, + "packNpmRelationList": [], + "minifyWXSS": true + }, + "compileType": "miniprogram", + "libVersion": "2.15.0", + "appid": "wx518e1f26bfa0e1d3", + "projectname": "manicureLet", + "debugOptions": { + "hidedInDevtools": [] + }, + "scripts": {}, + "isGameTourist": false, + "condition": { + "search": { + "list": [] + }, + "conversation": { + "list": [] + }, + "game": { + "list": [] + }, + "plugin": { + "list": [] + }, + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [] + } + } +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..a5cd5ce --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,47 @@ +{ + "setting": {}, + "condition": { + "plugin": { + "list": [] + }, + "game": { + "list": [] + }, + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [ + { + "name": "搜索", + "pathName": "pages/pageSearch/pageSearch", + "query": "", + "scene": null + }, + { + "name": "搜索详情", + "pathName": "pages/pageSerchDetail/pageSerchDetail", + "query": "", + "scene": null + }, + { + "name": "配色", + "pathName": "pages/detailContent/detailContent", + "query": "", + "scene": null + }, + { + "name": "配色查询", + "pathName": "pages/pageInquire/pageInquire", + "query": "", + "scene": null + }, + { + "name": "商务合作", + "pathName": "pages/pageBusiness/pageBusiness", + "scene": null + } + ] + } + } +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/utils/pubic.js b/utils/pubic.js new file mode 100644 index 0000000..65c961c --- /dev/null +++ b/utils/pubic.js @@ -0,0 +1,49 @@ +/** + * 函数防抖 + * @param fn + * @param delay + * @returns {Function} + * @constructor + */ +export const Debounce = (fn, t) => { + let delay = t || 500; + let timer; + return function() { + let args = arguments; + if (timer) { + clearTimeout(timer); + } + timer = setTimeout(() => { + timer = null; + fn.apply(this, args); + }, delay); + } +}; + + +/** +1. 函数节流 +2. @param fn +3. @param interval +4. @returns {Function} +5. @constructor +*/ +export const Throttle = (fn, t) => { + let last; + let timer; + let interval = t || 500; + return function() { + let args = arguments; + let now = +new Date(); + if (last && now - last < interval) { + clearTimeout(timer); + timer = setTimeout(() => { + last = now; + fn.apply(this, args); + }, interval); + } else { + last = now; + fn.apply(this, args); + } + } +} \ No newline at end of file diff --git a/utils/serve.js b/utils/serve.js new file mode 100644 index 0000000..7c007c6 --- /dev/null +++ b/utils/serve.js @@ -0,0 +1,38 @@ + +const HTTPS = 'http://manicure.cn' + +export const http = function (param) { + let { url, data, method } = param + return new Promise((resolve, rejected) => { + wx.request({ + url: `${HTTPS + url}`, + data: data, + method: method, + success: (result) => { + if (result.statusCode === 200) { + resolve(result.data) + return + } + if(result.statusCode === 500) { + wx.showToast({ + title: `服务器错误:${result.statusCode}`, + duration: 2000, + icon: 'none', + }) + } + + }, + fail: (res) => { }, + complete: (res) => { + wx.hideLoading({ + success: (res) => {}, + }) + }, + }) + }) +} + + + + + \ No newline at end of file