Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
310341802 committed Dec 6, 2018
1 parent e660bf0 commit bbbfdbd
Show file tree
Hide file tree
Showing 82 changed files with 4,867 additions and 203 deletions.
39 changes: 39 additions & 0 deletions 1614080902436/Wechat小程序(有杂货商城)/app.js
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
}
})
52 changes: 52 additions & 0 deletions 1614080902436/Wechat小程序(有杂货商城)/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"pages":[
"pages/index/index",
"pages/logs/logs",
"pages/cart/cart",
"pages/more/more",
"pages/my/my",
"pages/resume/resume",
"pages/resume/edu/edu",
"pages/resume/contact/contact",
"pages/tabBar"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarTitleText": "有杂货",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"backgroundColor":"#f9f9f9"
},
"tabBar": {
"color": "#bfbfbf",
"selectedColor": "#F4A7B9",
"backgroundColor": "#fff",
"list": [{
"pagePath": "pages/index/index",
"iconPath":"images/home.png",
"selectedIconPath":"images/home-selected.png",
"text": "主页"
},{
"pagePath": "pages/more/more",
"text": "分类",
"iconPath": "images/app.png",
"selectedIconPath": "images/app-selected.png"
}
,
{
"pagePath": "pages/cart/cart",
"text": "购物车",
"iconPath": "images/cart.png",
"selectedIconPath": "images/cart-selected.png"
}
,
{
"pagePath": "pages/my/my",
"text": "",
"iconPath": "images/my.png",
"selectedIconPath": "images/my-selected.png"

}
]
}
}
10 changes: 10 additions & 0 deletions 1614080902436/Wechat小程序(有杂货商城)/app.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions 1614080902436/Wechat小程序(有杂货商城)/pages/cart/cart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// pages/cart/cart.js
Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!--pages/cart/cart.wxml-->
<text>pages/cart/cart.wxml</text>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* pages/cart/cart.wxss */
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//index.js fa6361
//获取应用实例
const app = getApp()
Page({
data: {
imgUrls: [
'../../images/swiper/s1.png',
'../../images/swiper/s2.png',
'../../images/swiper/s5.png'
],
recommendList:[
{
img:"../../images/swiper/s3.png",
title:"简约设计",
shortDesc:"留白式设计,你想不到的美"
},
{
img: "../../images/swiper/s8.png",
title: "LOGO",
shortDesc: "贴切生活"
},
{
img: "../../images/swiper/s4.png",
title: "暗色系",
shortDesc: "你不知道的暗搭配"
},
{
img: "../../images/swiper/s6.png",
title: "线框系",
shortDesc: "小小框,大作用"
}
],
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 1000,
indicatorColor:'white',
activeColor:'#F4A7B9',
//所有图片的高度
imgWidth: wx.getSystemInfoSync().windowWidth,
imgHeight: wx.getSystemInfoSync().windowWidth / 1.77
},
changeIndicatorDots: function(e) {
this.setData({
indicatorDots: !this.data.indicatorDots
})
},
changeAutoplay: function(e) {
this.setData({
autoplay: !this.data.autoplay
})
},
intervalChange: function(e) {
this.setData({
interval: e.detail.value
})
},
durationChange: function(e) {
this.setData({
duration: e.detail.value
})
},
toDetail: function(e){
var index = e.currentTarget.dataset.index;
console.log(index);
},
bindchange: function(e)
{

}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--index.wxml-->
<view id="head">
<view class='search'>
<image class="" src='../../images/search.png' bindtap='query'></image>
<input type='text' placeholder='输入你想要的内容' confirm-type='search' bindinput='inputBind' bindconfirm='query'></input>
</view>
<view class="home-swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-active-color='{{activeColor}}' indicator-color='{{indicatorColor}}' style="height:{{imgHeight}}px " bindchange="bindchange">
<block wx:for="{{imgUrls}}">
<swiper-item>
<image src="{{item}}" class="slide-image" style="width:{{imgWidth}}px;height:{{imgHeight}}px " />
</swiper-item>
</block>
</swiper>
</view>

</view>
<view id="main">
<view class="item" wx:for="{{recommendList}}" bindtap="toDetail" data-index="{{index}}">
<image src="{{item.img}}"></image>
<view class="item-desc">
<view>{{item.title}}</view>
<text>{{item.shortDesc}}</text>
</view>
</view>
<view class="cls"></view>
</view>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.cls
{
clear:both;
}
/*全局设置*/
.home-swiper swiper img,
#main
{
width: 100%;
height: auto;
}
/* 搜索框样式 */
.search
{
display: flex;
flex-direction: row;
justify-content:space-between;
align-items: center;

height:75rpx;
margin:15rpx auto;
}
.search input
{
font-size:28rpx;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
flex: 1;
}
.search image
{
width:45rpx;
height:45rpx;
margin:0 30rpx;
align-items: center;
}
/*main块样式*/
#main
{
padding:30rpx 0;
background:#f8f8f8;
}
.item
{
width:min-content;
float:left;
margin-top:30rpx;
overflow: hidden;
line-height:1.2;
}
.item:nth-child(odd)
{
margin-left:32.5rpx;
margin-right:12.5rpx;
}
.item:nth-child(even)
{
margin-left:12.5rpx;
margin-right:32.5rpx;
}
.item image
{
width:330rpx;
height:calc(330rpx / 1.77);
border-radius: 10rpx;
}
.item .item-desc view
{
color:#555;
font-size:28rpx;
}
.item .item-desc text
{
color:#999;
font-size:24rpx;
}
Loading

0 comments on commit bbbfdbd

Please sign in to comment.