-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a225b91
Showing
102 changed files
with
3,677 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_store |
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,63 @@ | ||
# 零食商城 | ||
## 零食商城 | ||
### 零食商城 | ||
#### 零食商城 | ||
##### 零食商城 | ||
###### 零食商城 | ||
*** | ||
*斜体文字* | ||
* * * | ||
_斜体文字_ | ||
***** | ||
斜体文件 | ||
--- | ||
**粗体文件** | ||
|
||
--- | ||
__粗体文件__ | ||
~~____粗斜体____~~ | ||
|
||
--- | ||
|
||
<u>下划线</u> | ||
|
||
- 业务逻辑 | ||
- 技术要点 | ||
- 详细代码 | ||
+ 业务逻辑 | ||
+ 技术要点 | ||
+ 详细代码 | ||
* 业务逻辑 | ||
* 技术要点 | ||
* 详细代码 | ||
|
||
1. 第一点 | ||
- 123 | ||
- 456 | ||
- 678 | ||
2. 第二点 | ||
3. 第三点 | ||
# 区域 | ||
> 引用的第一部分 | ||
>> 引用的第一部分子部分 | ||
>>> 引用的第一部分子部分子部分 | ||
> 引用的第二部分 | ||
> 引用的第二部分 | ||
> 引用的第二部分 | ||
```html | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
</body> | ||
</html> | ||
|
||
``` | ||
```js | ||
console.log(123) | ||
``` | ||
[百度](http://www.baidu.com) | ||
![百度](https://www.runoob.com/wp-content/uploads/2019/03/A042DF30-C232-46F3-8436-7D6C35351BBD.jpg) | ||
![图片](./image/1.jpg) | ||
|
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,39 @@ | ||
//app.js | ||
App({ | ||
onLaunch: function () { | ||
// 展示本地存储能力 | ||
var logs = wx.getStorageSync('logs') || [] | ||
logs.unshift(Date.now()) | ||
wx.setStorageSync('logs', logs) | ||
|
||
// 登录 | ||
wx.login({ | ||
success: res => { | ||
// 发送 res.code 到后台换取 openId, sessionKey, unionId | ||
} | ||
}) | ||
// 获取用户信息 | ||
wx.getSetting({ | ||
success: res => { | ||
if (res.authSetting['scope.userInfo']) { | ||
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | ||
wx.getUserInfo({ | ||
success: res => { | ||
// 可以将 res 发送给后台解码出 unionId | ||
this.globalData.userInfo = res.userInfo | ||
|
||
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | ||
// 所以此处加入 callback 以防止这种情况 | ||
if (this.userInfoReadyCallback) { | ||
this.userInfoReadyCallback(res) | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
}) | ||
}, | ||
globalData: { | ||
userInfo: null | ||
} | ||
}) |
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 @@ | ||
{ | ||
"pages":[ | ||
"pages/index/index", | ||
"pages/theme/theme", | ||
"pages/good/good", | ||
"pages/category/category", | ||
"pages/cart/cart", | ||
"pages/pay/pay", | ||
"pages/my/my", | ||
"pages/address/address", | ||
"pages/logs/logs" | ||
], | ||
"window":{ | ||
"backgroundTextStyle":"light", | ||
"navigationBarBackgroundColor": "#a99471", | ||
"navigationBarTitleText": "零食商城", | ||
"navigationBarTextStyle":"white" | ||
}, | ||
"tabBar": { | ||
"selectedColor": "#a99471", | ||
"list": [{ | ||
"pagePath": "pages/index/index", | ||
"text": "首页", | ||
"iconPath": "image/home.png", | ||
"selectedIconPath": "image/home-o.png" | ||
},{ | ||
"pagePath": "pages/category/category", | ||
"text": "分类", | ||
"iconPath": "image/category.png", | ||
"selectedIconPath": "image/category-o.png" | ||
},{ | ||
"pagePath": "pages/cart/cart", | ||
"text": "购物车", | ||
"iconPath": "image/cart.png", | ||
"selectedIconPath": "image/cart-o.png" | ||
},{ | ||
"pagePath": "pages/my/my", | ||
"text": "我的", | ||
"iconPath": "image/my.png", | ||
"selectedIconPath": "image/my-o.png" | ||
}] | ||
}, | ||
"style": "v2", | ||
"sitemapLocation": "sitemap.json" | ||
} |
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,18 @@ | ||
|
||
/* | ||
样式的初始化 | ||
*/ | ||
view,image,navigator,text,swiper,swiper-item,checkbox{ | ||
margin:0rpx; | ||
padding:0rpx; | ||
box-sizing: border-box; | ||
} | ||
|
||
image{ | ||
width: 100%; | ||
height: 100%; | ||
} | ||
/* 页面文件 */ | ||
page{ | ||
--themeColor:#a89473; /* 主题颜色 */ | ||
} |
Empty file.
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,36 @@ | ||
|
||
|
||
// showModal | ||
let asyncShowModal = function asyncShowModal(content){ | ||
return new Promise(function(resolve,reject){ | ||
wx.showModal({ | ||
content: content, | ||
success:function(res){ | ||
if(res.confirm){ | ||
resolve(res) | ||
}else{ | ||
reject(res) | ||
} | ||
} | ||
}) | ||
}) | ||
} | ||
// chooseAddress | ||
// https://developers.weixin.qq.com/miniprogram/dev/api/open-api/address/wx.chooseAddress.html | ||
let asyncChooseAddress = function asyncChooseAddress(){ | ||
return new Promise(function(resolve,reject){ | ||
wx.chooseAddress({ | ||
success:function(res){ | ||
resolve(res) | ||
}, | ||
fail:function(err){ | ||
reject(err) | ||
} | ||
}) | ||
}) | ||
} | ||
|
||
// 导出 | ||
export { | ||
asyncShowModal, asyncChooseAddress | ||
} |
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,26 @@ | ||
// components/newest-list/newest-list.js | ||
Component({ | ||
/** | ||
* 组件的属性列表 | ||
*/ | ||
properties: { | ||
newest:{ | ||
type:Array, | ||
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,4 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": {} | ||
} |
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,14 @@ | ||
<view class="snack-newest-list"> | ||
<navigator | ||
url="/pages/good/good?id={{item.id}}" | ||
open-type="navigate" | ||
class="snack-newest-list-item" wx:for="{{newest}}" wx:key="index"> | ||
<view class="imageWrapper"> | ||
<image src="{{item.imageUrl}}"></image> | ||
</view> | ||
<view class="desc"> | ||
<view class="title">{{item.title+" "}}{{item.count}}</view> | ||
<view class="price">¥{{item.price}}</view> | ||
</view> | ||
</navigator> | ||
</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,21 @@ | ||
.snack-newest-list { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
.snack-newest-list .snack-newest-list-item { | ||
width: 50%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.snack-newest-list .snack-newest-list-item .imageWrapper { | ||
height: 180rpx; | ||
width: 180rpx; | ||
} | ||
.snack-newest-list .snack-newest-list-item .desc .title { | ||
text-align: center; | ||
} | ||
.snack-newest-list .snack-newest-list-item .desc .price { | ||
text-align: center; | ||
} |
Oops, something went wrong.