Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提交电子商城wepy代码 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
weapp
.DS_Store
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
4 changes: 4 additions & 0 deletions .wepyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.DS_Store
*.wpy___jb_tmp___
5,962 changes: 5,962 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "shopping",
"version": "0.0.2",
"description": "A WePY project",
"main": "weapp/app.js",
"scripts": {
"dev": "./node_modules/.bin/wepy build --watch",
"build": "cross-env NODE_ENV=production ./node_modules/.bin/wepy build --no-cache",
"clean": "rm -rf weapp",
"test": "echo \"Error: no test specified\" && exit 1"
},
"wepy": {
"module-a": false,
"./src/components/list": "./src/components/wepy-list.wpy"
},
"author": "BubbleSci <[email protected]>",
"license": "MIT",
"dependencies": {
"@wepy/core": "^2.0.0-alpha.16",
"miniprogram-slide-view": "0.0.3",
"wepy": "^1.7.2",
"wepy-async-function": "^1.4.7"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@wepy/babel-plugin-import-regenerator": "0.0.2",
"@wepy/cli": "^2.0.0-alpha.28",
"@wepy/compiler-babel": "^2.0.1",
"@wepy/compiler-less": "^2.0.1",
"babel-eslint": "^7.2.1",
"cross-env": "^5.1.3",
"less": "^3.8.1",
"wepy-compiler-babel": "^1.5.3",
"wepy-compiler-less": "^1.3.14"
}
}
133 changes: 133 additions & 0 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"description": "A WePY project",
"setting": {
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"appid": "wx548eefd296fc87a5",
"projectname": "shopping",
"miniprogramRoot": "weapp/",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"libVersion": "2.12.0",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": -1,
"name": "分类页面",
"pathName": "pages/category",
"query": "",
"scene": null
},
{
"id": 1,
"name": "商品列表",
"pathName": "pages/goods_list",
"query": "cid = 5",
"scene": null
},
{
"id": 2,
"name": "详情界面",
"pathName": "pages/goos_detail",
"query": "goods_id=57445",
"scene": null
},
{
"id": -1,
"name": "购物车",
"pathName": "pages/cart",
"query": "goods_id=57445",
"scene": null
},
{
"id": -1,
"name": "登录",
"pathName": "pages/login",
"query": "goods_id=57445",
"scene": null
},
{
"id": -1,
"name": "个人中心",
"pathName": "pages/user",
"query": "goods_id=57445",
"scene": null
},
{
"id": -1,
"name": "订单查询",
"pathName": "pages/order",
"query": "type = 1",
"scene": null
},
{
"id": -1,
"name": "授权",
"pathName": "pages/auth",
"query": "",
"scene": null
},
{
"id": -1,
"name": "收藏页面",
"pathName": "pages/collect",
"query": "",
"scene": null
},
{
"id": -1,
"name": "搜索",
"pathName": "pages/search",
"scene": null
}
]
}
}
}
119 changes: 119 additions & 0 deletions src/app.wpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<style lang="less">
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
page{
// 定义主题颜色
--themeColor:#eb4450;

}
</style>

<script>
import wepy from '@wepy/core';
import eventHub from './common/eventHub';
import 'wepy-async-function';

wepy.app({
hooks: {

'before-setData': function(dirty) {
console.log('setData dirty: ', dirty);
return dirty;
}
},
globalData: {
userInfo: null
},

onLaunch() {
wx.hideTabBar();
this.testAsync();
eventHub.$on('app-launch', (...args) => {
console.log('app-launch event emitted, the params are:');
console.log(args);
});
},

methods: {
sleep(s) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve('promise resolved');
}, s * 1000);
});
},

async testAsync() {
let d = await this.sleep(3);
console.log(d);
}
}
});
</script>
<config>
{
pages: [
'pages/index',
'pages/category',
'pages/cart',
'pages/user',
'pages/collect',
'pages/feedback',
'pages/goos_detail',
'pages/goods_list',
'pages/pay',
'pages/order',
'pages/search',
'pages/login',
'pages/auth',
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#eb4450',
navigationBarTitleText: '买你所想',
navigationBarTextStyle: 'white'
},
tabBar: {
list: [{
pagePath: 'pages/index',
text: '首页',
iconPath: '/icons/home.png',
selectedIconPath: '/icons/home_clone.png'
},
{
pagePath: 'pages/category',
text: '分类',
iconPath: '/icons/category.png',
selectedIconPath: '/icons/category_clone.png'
},
{
pagePath: 'pages/cart',
text: '购物车',
iconPath: '/icons/cart.png',
selectedIconPath: '/icons/cart_clone.png'
},
{
pagePath: 'pages/user',
text: '我的',
iconPath: '/icons/my.png',
selectedIconPath: '/icons/my_clone.png'
}
]
},

}
</config>
<script>
import wepy from '@wepy/core';
wepy.app({
onLaunch() {
console.log('on launch')
}
})
</script>
5 changes: 5 additions & 0 deletions src/common/eventHub.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import wepy from '@wepy/core';

let eventHub = new wepy();

export default eventHub;
49 changes: 49 additions & 0 deletions src/components/SearchInput.wpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<style lang="less">
.search_input {
height: 90rpx;
padding: 10rpx;
background-color: var(--themeColor) ;
}

.search_input navigator {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: white;
border-radius: 15rpx;
color: #666;
}
</style>

<template>
<view class="search_input">
<navigator url="./search" open-type="navigate">搜索</navigator>
</view>
</template>

<script>
import wepy from '@wepy/core'

wepy.component({

properties: {

},

data: {

},

methods: {

}
})
</script>

<config>
{
"component": true,
"usingComponents": {}
}
</config>
Loading