forked from TDesignOteam/tdesign-miniprogram-starter-apply
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from LindsBravill/feat/home
feat/home
- Loading branch information
Showing
56 changed files
with
4,361 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,4 @@ module.exports = { | |
}, | ||
// extends: 'eslint:recommended', | ||
rules: {}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// components/info-card/index.js | ||
Component({ | ||
/** | ||
* 组件的属性列表 | ||
*/ | ||
properties: { | ||
data: { | ||
"type": Object, | ||
"value": {} | ||
} | ||
}, | ||
|
||
/** | ||
* 组件的初始数据 | ||
*/ | ||
data: { | ||
}, | ||
|
||
/** | ||
* 组件的方法列表 | ||
*/ | ||
methods: { | ||
|
||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-image": "tdesign-miniprogram/image/image", | ||
"stars-mark": "/components/stars-mark/index" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* components/info-card/index.wxss */ | ||
.card { | ||
height: 120px; | ||
width: 343px; | ||
margin: 16px auto; | ||
border-radius: 9px; | ||
overflow: hidden; | ||
background: #ffffff; | ||
box-shadow: 0 6px 30px 5px #0000000d, 0 16px 24px 2px #0000000a, 0 8px 10px -5px #00000014; | ||
|
||
.info { | ||
height: 100%; | ||
width: auto; | ||
background-color: #fff; | ||
display: inline-flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
padding-left: 16px; | ||
|
||
.name { | ||
color: #000000e6; | ||
font-size: 14px; | ||
font-weight: 400; | ||
font-family: "PingFang SC"; | ||
text-align: left; | ||
line-height: 22px; | ||
} | ||
|
||
.price { | ||
color: #000000e6; | ||
font-size: 14px; | ||
font-weight: 600; | ||
font-family: "PingFang SC"; | ||
text-align: left; | ||
line-height: 22px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!--components/info-card/index.wxml--> | ||
<view class="card"> | ||
<t-image src="{{data.imgUrl}}" mode="aspectFill" width="120px" height="100%" class="imag" /> | ||
<view class="info"> | ||
<text class="name">{{data.name}}</text> | ||
<stars-mark score="{{data.score}}"/> | ||
<text class="price" wx:if="{{!data.free}}">¥{{data.floorPrice}} -¥{{data.ceilingPrice}}</text> | ||
<text class="price" wx:if="{{data.free}}">{{data.free}}</text> | ||
</view> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// components/stars-mark/index.js | ||
Component({ | ||
/** | ||
* 组件的属性列表 | ||
*/ | ||
properties: { | ||
score: { | ||
"type": Number, | ||
"value": "" | ||
} | ||
}, | ||
|
||
/** | ||
* 组件的初始数据 | ||
*/ | ||
data: { | ||
}, | ||
|
||
/** | ||
* 组件的方法列表 | ||
*/ | ||
methods: { | ||
|
||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-icon": "tdesign-miniprogram/icon/icon" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* components/stars-mark/index.wxss */ | ||
.score { | ||
height: 20px; | ||
width: 143.6px; | ||
font-size: 12px; | ||
font-weight: 600; | ||
font-family: "PingFang SC"; | ||
line-height: 20px; | ||
display: inline-flex; | ||
position: relative; | ||
|
||
.stars-container { | ||
display: inline-flex; | ||
width: 100.6px; | ||
position: relative; | ||
|
||
.stars-background { | ||
color: #dcdcdc; | ||
display: inline-flex; | ||
padding-top: 2px; | ||
|
||
view { | ||
padding-right: 5.15px; | ||
} | ||
} | ||
|
||
.stars { | ||
color: #e37318; | ||
display: inline-flex; | ||
padding-top: 2px; | ||
position: absolute; | ||
overflow: hidden; | ||
|
||
view { | ||
padding-right: 5.15px; | ||
} | ||
} | ||
} | ||
|
||
text { | ||
color: #e37318; | ||
position: absolute; | ||
right: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!--components/stars-mark/index.wxml--> | ||
<view class="score"> | ||
<view class="stars-container"> | ||
<view class="stars-background"> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
</view> | ||
<view class="stars" style="width: {{score*16 + (score-0.5)*5.15}}px"> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
<t-icon name="star-filled" size="16px" /> | ||
</view> | ||
</view> | ||
<text>{{score}}分</text> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/** 配置城市名的数据 */ | ||
export const cities = { | ||
hotCities: ['北京', '上海', '广州', '深圳', '成都'], | ||
sortedCities: [{ | ||
index: 'A', | ||
children: ['澳门', '阿克苏', '阿吉', '鞍山'] | ||
}, | ||
{ | ||
index: 'B', | ||
children: ['北京', '包头', '宝鸡', '滨州', '宝山', '巴中'] | ||
}, | ||
{ | ||
index: 'C', | ||
children: ['重庆', '成都', '长沙', '常州', '长春', '沧州'] | ||
}, | ||
{ | ||
index: 'D', | ||
children: ['大连', '东莞', '德阳', '丹东', '大庆', '大同'] | ||
}, | ||
{ | ||
index: 'E', | ||
children: ['鄂尔多斯', '恩施', '鄂州'] | ||
}, | ||
{ | ||
index: 'F', | ||
children: ['福州', '佛山', '抚顺', '阜阳', '防城港', '阜新'] | ||
}, | ||
{ | ||
index: 'G', | ||
children: ['广州', '贵阳', '赣州', '桂林', '广元', '贵港'] | ||
}, | ||
{ | ||
index: 'H', | ||
children: ['上海', '深圳', '杭州', '哈尔滨', '合肥', '海口'] | ||
}, | ||
{ | ||
index: 'J', | ||
children: ['金华', '济南', '嘉兴', '江门', '吉林'] | ||
}, | ||
{ | ||
index: 'K', | ||
children: ['昆明', '克拉玛依', '开封', '喀什', '凯里', '克孜勒苏'] | ||
}, | ||
{ | ||
index: 'L', | ||
children: ['兰州', '拉萨', '洛阳', '丽江', '廊坊', '连云港'] | ||
}, | ||
{ | ||
index: 'M', | ||
children: ['梅州', '绵阳', '马鞍山', '茂名', '牡丹江', '眉山'] | ||
}, | ||
{ | ||
index: 'N', | ||
children: ['南京', '南昌', '南宁', '宁波', '南通', '南充'] | ||
}, | ||
{ | ||
index: 'P', | ||
children: ['莆田', '平顶山', '盘锦', '攀枝花', '萍乡'] | ||
}, | ||
{ | ||
index: 'Q', | ||
children: ['青岛', '秦皇岛', '泉州', '曲靖', '齐齐哈尔', '七台河'] | ||
}, | ||
{ | ||
index: 'R', | ||
children: ['日喀则', '日照'] | ||
}, | ||
{ | ||
index: 'S', | ||
children: ['上海', '深圳', '沈阳', '苏州', '石家庄', '三亚'] | ||
}, | ||
{ | ||
index: 'T', | ||
children: ['天津', '太原', '唐山', '台州', '泰安', '铁岭'] | ||
}, | ||
{ | ||
index: 'W', | ||
children: ['武汉', '无锡', '潍坊', '威海', '乌鲁木齐', '梧州'] | ||
}, | ||
{ | ||
index: 'X', | ||
children: ['西安', '厦门', '徐州', '西宁', '湘潭', '许昌'] | ||
}, | ||
{ | ||
index: 'Y', | ||
children: ['杭州', '武汉', '郑州', '石家庄', '西安'] | ||
}, | ||
{ | ||
index: 'Z', | ||
children: ['张家口', '中山', '珠海', '肇庆', '舟山', '漳州'] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** 小程序基本配置 */ | ||
// 是否使用mock数据代替api返回 | ||
export const config = { | ||
useMock: true | ||
} | ||
|
||
// 使用腾讯定位服务的key | ||
export const locationKey = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.