Kaynağa Gözat

Initial Commit

master
Eddie 3 yıl önce
işleme
09ca9e7d09
50 değiştirilmiş dosya ile 1959 ekleme ve 0 silme
  1. +14
    -0
      .gitignore
  2. +30
    -0
      app.js
  3. +41
    -0
      app.json
  4. +63
    -0
      app.wxss
  5. +24
    -0
      cmponent/loading/loading.js
  6. +4
    -0
      cmponent/loading/loading.json
  7. +6
    -0
      cmponent/loading/loading.wxml
  8. +34
    -0
      cmponent/loading/loading.wxss
  9. BIN
     
  10. BIN
     
  11. BIN
     
  12. BIN
     
  13. BIN
     
  14. BIN
     
  15. BIN
     
  16. BIN
     
  17. BIN
     
  18. BIN
     
  19. BIN
     
  20. BIN
     
  21. BIN
     
  22. +271
    -0
      pages/detailContent/detailContent.js
  23. +4
    -0
      pages/detailContent/detailContent.json
  24. +54
    -0
      pages/detailContent/detailContent.wxml
  25. +159
    -0
      pages/detailContent/detailContent.wxss
  26. +134
    -0
      pages/index/index.js
  27. +4
    -0
      pages/index/index.json
  28. +36
    -0
      pages/index/index.wxml
  29. +89
    -0
      pages/index/index.wxss
  30. +97
    -0
      pages/pageBusiness/pageBusiness.js
  31. +4
    -0
      pages/pageBusiness/pageBusiness.json
  32. +62
    -0
      pages/pageBusiness/pageBusiness.wxml
  33. +103
    -0
      pages/pageBusiness/pageBusiness.wxss
  34. +74
    -0
      pages/pageInquire/pageInquire.js
  35. +4
    -0
      pages/pageInquire/pageInquire.json
  36. +10
    -0
      pages/pageInquire/pageInquire.wxml
  37. +35
    -0
      pages/pageInquire/pageInquire.wxss
  38. +106
    -0
      pages/pageSearch/pageSearch.js
  39. +4
    -0
      pages/pageSearch/pageSearch.json
  40. +35
    -0
      pages/pageSearch/pageSearch.wxml
  41. +60
    -0
      pages/pageSearch/pageSearch.wxss
  42. +108
    -0
      pages/pageSerchDetail/pageSerchDetail.js
  43. +4
    -0
      pages/pageSerchDetail/pageSerchDetail.json
  44. +29
    -0
      pages/pageSerchDetail/pageSerchDetail.wxml
  45. +45
    -0
      pages/pageSerchDetail/pageSerchDetail.wxss
  46. +71
    -0
      project.config.json
  47. +47
    -0
      project.private.config.json
  48. +7
    -0
      sitemap.json
  49. +49
    -0
      utils/pubic.js
  50. +38
    -0
      utils/serve.js

+ 14
- 0
.gitignore Dosyayı Görüntüle

@@ -0,0 +1,14 @@
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/

# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes

# Node.js
node_modules/

+ 30
- 0
app.js Dosyayı Görüntüle

@@ -0,0 +1,30 @@
App({

/**
* 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
*/
onLaunch: function () {
},

/**
* 当小程序启动,或从后台进入前台显示,会触发 onShow
*/
onShow: function (options) {
},

/**
* 当小程序从前台进入后台,会触发 onHide
*/
onHide: function () {
},

/**
* 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
*/
onError: function (msg) {
}
})

+ 41
- 0
app.json Dosyayı Görüntüle

@@ -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"
}

+ 63
- 0
app.wxss Dosyayı Görüntüle

@@ -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;
}


+ 24
- 0
cmponent/loading/loading.js Dosyayı Görüntüle

@@ -0,0 +1,24 @@
// cmponent/loading/loading.js
Component({
/**
* 组件的属性列表
*/
properties: {

},

/**
* 组件的初始数据
*/
data: {

},

/**
* 组件的方法列表
*/
methods: {
}
})

+ 4
- 0
cmponent/loading/loading.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 6
- 0
cmponent/loading/loading.wxml Dosyayı Görüntüle

@@ -0,0 +1,6 @@
<view class="masked-box">
<view class="masked-loading">
<image src="/images/juhua.gif"></image>
<text>加载中···</text>
</view>
</view>

+ 34
- 0
cmponent/loading/loading.wxss Dosyayı Görüntüle

@@ -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;
}














+ 271
- 0
pages/detailContent/detailContent.js Dosyayı Görüntüle

@@ -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 () {

}
})

+ 4
- 0
pages/detailContent/detailContent.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "配色"
}

+ 54
- 0
pages/detailContent/detailContent.wxml Dosyayı Görüntüle

@@ -0,0 +1,54 @@
<view class="head-box">
<view class="head-search" bindtap="skipSearch">
<i style="padding: 0 10rpx 0 20rpx">
<image class="search-icon" src="/images/search-icon.png"></image>
</i>
<input disabled class="head-input" placeholder="请输入" placeholder-style="color:#999999" />
</view>
</view>

<view class="body-box">
<!-- 美甲效果 -->
<view class="head-title">美甲效果</view>
<view class="swiper-box">
<swiper class="swiper" current="{{ isItem }}" bindchange="onSwiperItem">
<block wx:for="{{searchData}}" wx:key="index">
<swiper-item>
<view class="imageUrl-box">
<view class="itemTitle">色号:{{item.name}}</view>
<image class="imageUrl" src="{{ item.img }}"></image>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class="head-title">指甲色</view>

</view>

<!-- 指甲色 -->

<scroll-view class="scroll-view" scroll-x scroll-into-view="{{ 'i' + isItem }}" scroll-with-animation bindscrolltolower="onbolwerRight" bindscrolltoupper="onbolwerLeft">
<block wx:for="{{searchData}}" wx:key="index">
<view class="scroll-view-box" bindtap="setSearchColor" data-index="{{index}}" id="{{ 'i' + index}}">
<image src="{{item.img}}"></image>
<view class="{{ isItem === index ? 'itemColor' : 'itemTitle' }}" >{{item.name}}</view>
</view>
</block>
</scroll-view>


<view class="bottom-box">
<view class="input-box">
<input class="inputItem" type="number" placeholder="请输入要查询的克数" bindinput="onInputGram"/>
<view class="text-g">g</view>
</view>
<view class="button-box" bindtap="skipInquire">
<image src="/images/serch.png" class="serch-n" mode="widthFix"></image>
<text>查询</text>
</view>
</view>

<view hidden="{{ hLoading }}" >
<loading ></loading>
</view>

+ 159
- 0
pages/detailContent/detailContent.wxss Dosyayı Görüntüle

@@ -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;

}

+ 134
- 0
pages/index/index.js Dosyayı Görüntüle

@@ -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 () {

}
})

+ 4
- 0
pages/index/index.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "美甲"
}

+ 36
- 0
pages/index/index.wxml Dosyayı Görüntüle

@@ -0,0 +1,36 @@
<view class="head-box">
<view class="head-search" bindtap="skipSearch">
<i style="padding: 0 10rpx 0 20rpx">
<image class="search-icon" src="/images/search-icon.png"></image>
</i>
<input disabled class="head-input" placeholder="搜索更多美甲产品" placeholder-style="color:#999999" />
</view>
</view>

<view class="swiper-box">
<swiper class="swiper" indicator-dots indicator-color="#D0D0D0" indicator-active-color="#F85E4C" autoplay circular>
<block wx:for="{{ swiperArr }}" wx:key="index">
<swiper-item>
<image class="imageUrl" src="{{ item.img }}"></image>
</swiper-item>
</block>
</swiper>
</view>

<view class="main-box">
<block wx:for="{{mainData}}" wx:key="index">
<view class="mainItem-box" bindtap="skipSerchDetail" data-param="{{item}}">
<view class="imageUrl-box">
<image class="imageUrl" src="{{item.img}}"></image>
</view>
<view class="item-title">{{item.name}}</view>
</view>
</block>
</view>
<block wx:if="{{ mainData.length < paginate.total }}">
<view class="juhua-box">
<image class="juhua" src="/images/juhua.gif"></image>
<text>加载中···</text>
</view>
</block>

+ 89
- 0
pages/index/index.wxss Dosyayı Görüntüle

@@ -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;
}

+ 97
- 0
pages/pageBusiness/pageBusiness.js Dosyayı Görüntüle

@@ -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 () {

}
})

+ 4
- 0
pages/pageBusiness/pageBusiness.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "商务合作"
}

+ 62
- 0
pages/pageBusiness/pageBusiness.wxml Dosyayı Görüntüle

@@ -0,0 +1,62 @@
<view class="swiper-box">
<swiper class="swiper" autoplay circular>
<block wx:for="{{ swiperArr }}" wx:key="index">
<swiper-item>
<image class="imageUrl" src="{{ item.img }}"></image>
</swiper-item>
</block>
</swiper>
</view>



<view class="business-box">
<view class="title1">联系方式</view>

<view class="bus-list">
<view class="itemHead">
<image src="/images/dizhi.png" mode="widthFix"></image>
<text>办公地址</text>
</view>
<view class="itemCotnent">
<view class="itemLeft">{{ busData.businessAddress }}</view>
<view class="itemRihgt" bindtap="Clipboard" data-value="{{ busData.businessAddress }}">
<image src="/images/fuzhi.png" mode="widthFix"></image>
<text>复制</text>
</view>
</view>
</view>



<view class="bus-list">
<view class="itemHead">
<image src="/images/phone.png" mode="widthFix"></image>
<text>联系电话</text>
</view>
<view class="itemCotnent">
<view class="itemLeft">{{busData.businessPhone}}</view>
<view class="itemRihgt" bindtap="Clipboard" data-value="{{busData.businessPhone}}">
<image src="/images/fuzhi.png" mode="widthFix"></image>
<text>复制</text>
</view>
</view>
</view>



<view class="bus-list">
<view class="itemHead">
<image src="/images/weixin.png" mode="widthFix"></image>
<text>联系微信</text>
</view>
<view class="itemCotnent">
<view class="itemLeft">{{busData.businessWechat}}</view>
<view class="itemRihgt" bindtap="Clipboard" data-value="{{busData.businessWechat}}">
<image src="/images/fuzhi.png" mode="widthFix"></image>
<text>复制</text>
</view>
</view>
</view>

</view>

+ 103
- 0
pages/pageBusiness/pageBusiness.wxss Dosyayı Görüntüle

@@ -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;
}

+ 74
- 0
pages/pageInquire/pageInquire.js Dosyayı Görüntüle

@@ -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 () {

}
})

+ 4
- 0
pages/pageInquire/pageInquire.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "配色查询"
}

+ 10
- 0
pages/pageInquire/pageInquire.wxml Dosyayı Görüntüle

@@ -0,0 +1,10 @@
<block wx:for="{{searchData.infoList}}" wx:key="index">
<view class="view-box" bindtap="onItem">
<image class="imageUrl" src="{{item.img}}"></image>
<view class="item-title">{{item.colorName}}</view>
<view class="floatRight">
<text style="color:#F85E4C">{{item.unit}}</text>
<text style="color:#999999">g</text>
</view>
</view>
</block>

+ 35
- 0
pages/pageInquire/pageInquire.wxss Dosyayı Görüntüle

@@ -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;
}

+ 106
- 0
pages/pageSearch/pageSearch.js Dosyayı Görüntüle

@@ -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 () {

}
})

+ 4
- 0
pages/pageSearch/pageSearch.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "搜索"
}

+ 35
- 0
pages/pageSearch/pageSearch.wxml Dosyayı Görüntüle

@@ -0,0 +1,35 @@
<view class="head-box">
<view class="head-search">
<i style="padding: 0 10rpx 0 20rpx">
<image class="search-icon" src="/images/search-icon.png"></image>
</i>
<input class="head-input" placeholder="搜索更多美甲产品" placeholder-style="color:#999999" bindinput="onInput" focus="{{ true }}"/>
</view>
</view>



<block wx:if="{{ searchData.length >= 1 }}">
<view class="serchData-body">
<view class="serchData-box">
<block wx:for="{{ searchData }}" wx:key="index">
<view class="searchData-item" bindtap="skipDetail" data-param="{{ item }}">
<view class="imageUrl-box">
<image src="{{item.img}}"></image>
</view>
<view class="title-box">{{ item.name }} </view>
<view class="you-box">
<image class="you-item" src="/images/you.png" mode="widthFix"></image>
</view>
</view>
</block>
</view>
</view>
</block>

<block wx:if="{{searchData.length === 0 && value.length >= 1}}">
<view class="kong-box">
<image class="kongPng" src="/images/kong.png" mode="widthFix"></image>
<view class="kongText">暂无该色号!</view>
</view>
</block>

+ 60
- 0
pages/pageSearch/pageSearch.wxss Dosyayı Görüntüle

@@ -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;
}

+ 108
- 0
pages/pageSerchDetail/pageSerchDetail.js Dosyayı Görüntüle

@@ -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 () {

}
})

+ 4
- 0
pages/pageSerchDetail/pageSerchDetail.json Dosyayı Görüntüle

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": ""
}

+ 29
- 0
pages/pageSerchDetail/pageSerchDetail.wxml Dosyayı Görüntüle

@@ -0,0 +1,29 @@
<view class="head-box">
<view class="head-search" bindtap="skipSearch">
<i style="padding: 0 10rpx 0 20rpx">
<image class="search-icon" src="/images/search-icon.png"></image>
</i>
<input disabled class="head-input" placeholder="搜索更多美甲产品" placeholder-style="color:#999999" />
</view>
</view>


<view class="detail-box">
<block wx:for="{{ searchData }}" wx:key="index">
<view class="detail-item" bindtap="skipDetail" data-param="{{ item }}">
<view class="itemHead">
<image lazy-load src="{{ item.img }}"></image>
</view>
<view class="item-title">{{ item.name }}</view>
</view>
</block>


<block wx:if="{{ searchData.length === 0 }}">
<view class="kong-box">
<image class="kongPng" src="/images/kong.png" mode="widthFix"></image>
<view class="kongText">暂无该色号!</view>
</view>
</block>

</view>

+ 45
- 0
pages/pageSerchDetail/pageSerchDetail.wxss Dosyayı Görüntüle

@@ -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;
}

+ 71
- 0
project.config.json Dosyayı Görüntüle

@@ -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": []
}
}
}

+ 47
- 0
project.private.config.json Dosyayı Görüntüle

@@ -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
}
]
}
}
}

+ 7
- 0
sitemap.json Dosyayı Görüntüle

@@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

+ 49
- 0
utils/pubic.js Dosyayı Görüntüle

@@ -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);
}
}
}

+ 38
- 0
utils/serve.js Dosyayı Görüntüle

@@ -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) => {},
})
},
})
})
}





Yükleniyor…
İptal
Kaydet