├── laravel ├── public │ ├── favicon.ico │ ├── robots.txt │ ├── .htaccess │ ├── web.config │ └── index.php ├── database │ ├── .gitignore │ ├── seeds │ │ └── DatabaseSeeder.php │ ├── factories │ │ └── ModelFactory.php │ └── migrations │ │ ├── 2014_10_12_100000_create_password_resets_table.php │ │ ├── 2014_10_12_000000_create_users_table.php │ │ ├── 2018_06_09_195009_create_pclogin_table.php │ │ └── 2018_06_09_193549_add_morefield_weixin_to_users_table.php ├── app │ ├── wxpaycert │ │ ├── apiclient_cert.pem │ │ └── apiclient_key.pem │ ├── Pclogin.php │ ├── myUtil.php │ ├── Http │ │ ├── Middleware │ │ │ ├── EncryptCookies.php │ │ │ ├── VerifyCsrfToken.php │ │ │ ├── TrustProxies.php │ │ │ ├── RedirectIfAuthenticated.php │ │ │ └── checkadmin.php │ │ ├── Controllers │ │ │ └── Controller.php │ │ └── Kernel.php │ ├── Api │ │ └── V1 │ │ │ ├── Requests │ │ │ ├── LoginRequest.php │ │ │ ├── SignUpRequest.php │ │ │ ├── ForgotPasswordRequest.php │ │ │ └── ResetPasswordRequest.php │ │ │ └── Controllers │ │ │ ├── LogoutController.php │ │ │ ├── RefreshController.php │ │ │ ├── SignUpController.php │ │ │ ├── LoginController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── qiniuController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── UserController.php │ ├── Providers │ │ ├── AppServiceProvider.php │ │ ├── BroadcastServiceProvider.php │ │ ├── AuthServiceProvider.php │ │ ├── EventServiceProvider.php │ │ └── RouteServiceProvider.php │ ├── Console │ │ └── Kernel.php │ ├── User.php │ ├── Exceptions │ │ └── Handler.php │ └── WinXinRefund.php ├── resources │ ├── views │ │ ├── vendor │ │ │ └── .gitkeep │ │ ├── errors │ │ │ └── 503.blade.php │ │ └── welcome.blade.php │ ├── assets │ │ ├── sass │ │ │ ├── app.scss │ │ │ └── _variables.scss │ │ └── js │ │ │ ├── app.js │ │ │ ├── components │ │ │ └── Example.vue │ │ │ └── bootstrap.js │ └── lang │ │ └── en │ │ ├── pagination.php │ │ ├── auth.php │ │ └── passwords.php ├── storage │ ├── logs │ │ └── .gitignore │ ├── app │ │ ├── public │ │ │ └── .gitignore │ │ └── .gitignore │ └── framework │ │ ├── cache │ │ └── .gitignore │ │ ├── sessions │ │ └── .gitignore │ │ ├── views │ │ └── .gitignore │ │ └── .gitignore ├── bootstrap │ ├── cache │ │ └── .gitignore │ ├── autoload.php │ └── app.php ├── .gitattributes ├── config │ ├── qiniu.php │ ├── weixinpay.php │ ├── hashing.php │ ├── cors.php │ ├── compile.php │ ├── services.php │ ├── view.php │ ├── broadcasting.php │ ├── boilerplate.php │ ├── filesystems.php │ ├── logging.php │ ├── queue.php │ └── cache.php ├── .gitignore ├── routes │ ├── console.php │ ├── web.php │ └── api.php ├── server.php ├── tests │ ├── TestCase.php │ └── Functional │ │ └── Api │ │ └── V1 │ │ └── Controllers │ │ ├── LogoutControllerTest.php │ │ ├── UserControllerTest.php │ │ ├── SignUpControllerTest.php │ │ ├── ForgotPasswordControllerTest.php │ │ ├── RefreshControllerTest.php │ │ ├── LoginControllerTest.php │ │ └── ResetPasswordControllerTest.php ├── .env ├── env.pro ├── .env.example ├── phpunit.xml ├── artisan └── composer.json ├── wechat ├── pages │ ├── ordermanager │ │ ├── ordermanager.wxss │ │ ├── ordermanager.json │ │ └── ordermanager.js │ ├── personalcenter │ │ ├── personalcenter.wxss │ │ ├── personalcenter.json │ │ └── personalcenter.wxml │ ├── modifyradiooperation │ │ ├── modifyradiooperation.wxss │ │ ├── modifyradiooperation.json │ │ ├── modifyradiooperation.wxml │ │ └── modifyradiooperation.js │ ├── logs │ │ ├── logs.json │ │ ├── logs.wxss │ │ ├── logs.wxml │ │ └── logs.js │ ├── addressmanager │ │ ├── addressmanager.json │ │ ├── addressmanager.wxml │ │ ├── addressmanager.wxss │ │ └── addressmanager.js │ ├── modifyoperation │ │ ├── modifyOperation.json │ │ ├── modifyoperation.wxml │ │ ├── modifyoperation.wxss │ │ └── modifyoperation.js │ ├── orderpurchase │ │ ├── orderpurchase.json │ │ ├── orderpurchase.wxss │ │ ├── orderpurchase.js │ │ └── orderpurchase.wxml │ ├── productdetail │ │ ├── productdetail.json │ │ ├── productdetail.wxss │ │ └── productdetail.js │ ├── pclogin │ │ ├── pclogin.json │ │ ├── pclogin.wxss │ │ └── pclogin.wxml │ └── index │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js ├── components │ ├── item │ │ ├── item.wxss │ │ ├── item.json │ │ ├── item.js │ │ └── item.wxml │ └── adv │ │ ├── adv.json │ │ ├── adv.js │ │ ├── adv.wxss │ │ └── adv.wxml ├── images │ ├── adv.png │ ├── my.png │ ├── fruit.png │ ├── order.png │ ├── address.png │ ├── cartoff.png │ ├── carton.png │ ├── indexoff.png │ ├── indexon.png │ ├── arrowright.png │ ├── index_finger.png │ ├── productdetail1.jpeg │ ├── productdetail2.jpeg │ ├── personalcenteroff.png │ └── personalcenteron.png ├── app.json ├── project.config.json ├── config.js ├── app.wxss ├── app.js └── utils │ └── util.js ├── arch.pptx ├── images ├── arch.jpg ├── lavas.jpg └── pclogin.jpg ├── lavas ├── .fecsignore ├── static │ ├── img │ │ ├── logo.png │ │ └── icons │ │ │ ├── favicon.ico │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-512x512.png │ │ │ ├── apple-touch-icon-120x120.png │ │ │ ├── apple-touch-icon-152x152.png │ │ │ ├── apple-touch-icon-180x180.png │ │ │ ├── apple-touch-icon-60x60.png │ │ │ └── apple-touch-icon-76x76.png │ └── manifest.json ├── assets │ ├── images │ │ ├── icon.png │ │ └── logo.png │ ├── fonts │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ ├── iconfont.eot │ │ └── iconfont.svg │ ├── stylus │ │ └── main.styl │ └── css │ │ └── iconfont.css ├── .gitignore ├── .travis.yml ├── .editorconfig ├── .postcssrc.js ├── store │ ├── pageTransition.js │ ├── scrollBehavior.js │ ├── user.js │ └── basic.js ├── pages │ ├── Appshell.vue │ ├── Error.vue │ ├── Test.vue │ ├── settings │ │ └── Settings.vue │ ├── Userdetail │ │ └── _id.vue │ └── Dashboard.vue ├── README.md ├── core │ ├── app.js │ ├── service-worker.js │ ├── ssr.html.tmpl │ └── spa.html.tmpl ├── server.prod.js ├── LICENSE ├── package.json ├── lavas.config.js ├── components │ ├── UpdateToast.vue │ └── ProgressBar.vue └── server.dev.js ├── 微信小程序授权登录设计-0609.pptx └── LICENSE /laravel/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /wechat/pages/ordermanager/ordermanager.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/app/wxpaycert/apiclient_cert.pem: -------------------------------------------------------------------------------- 1 | xxx 2 | -------------------------------------------------------------------------------- /laravel/app/wxpaycert/apiclient_key.pem: -------------------------------------------------------------------------------- 1 | xxx 2 | -------------------------------------------------------------------------------- /laravel/resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /wechat/pages/personalcenter/personalcenter.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravel/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravel/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /laravel/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /wechat/components/item/item.wxss: -------------------------------------------------------------------------------- 1 | @import '../../app.wxss'; 2 | -------------------------------------------------------------------------------- /wechat/pages/modifyradiooperation/modifyradiooperation.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravel/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /laravel/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravel/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravel/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /wechat/components/adv/adv.json: -------------------------------------------------------------------------------- 1 | { 2 | "component":true 3 | } 4 | -------------------------------------------------------------------------------- /wechat/components/item/item.json: -------------------------------------------------------------------------------- 1 | { 2 | "component":true 3 | } 4 | -------------------------------------------------------------------------------- /wechat/pages/logs/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "查看启动日志" 3 | } -------------------------------------------------------------------------------- /arch.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/arch.pptx -------------------------------------------------------------------------------- /wechat/pages/addressmanager/addressmanager.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "地址管理" 3 | } 4 | -------------------------------------------------------------------------------- /wechat/pages/modifyoperation/modifyOperation.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "修改基本信息" 3 | } -------------------------------------------------------------------------------- /wechat/pages/ordermanager/ordermanager.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "我的订单" 3 | } 4 | -------------------------------------------------------------------------------- /wechat/pages/orderpurchase/orderpurchase.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "确认订单" 3 | } 4 | -------------------------------------------------------------------------------- /wechat/pages/productdetail/productdetail.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "抢购详情" 3 | } 4 | -------------------------------------------------------------------------------- /images/arch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/images/arch.jpg -------------------------------------------------------------------------------- /images/lavas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/images/lavas.jpg -------------------------------------------------------------------------------- /images/pclogin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/images/pclogin.jpg -------------------------------------------------------------------------------- /wechat/pages/modifyradiooperation/modifyradiooperation.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "修改基本信息" 3 | } -------------------------------------------------------------------------------- /lavas/.fecsignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | config 3 | dist 4 | lib 5 | test 6 | _old 7 | build/templates 8 | *.html 9 | -------------------------------------------------------------------------------- /wechat/images/adv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/adv.png -------------------------------------------------------------------------------- /wechat/images/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/my.png -------------------------------------------------------------------------------- /微信小程序授权登录设计-0609.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/微信小程序授权登录设计-0609.pptx -------------------------------------------------------------------------------- /wechat/images/fruit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/fruit.png -------------------------------------------------------------------------------- /wechat/images/order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/order.png -------------------------------------------------------------------------------- /lavas/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/logo.png -------------------------------------------------------------------------------- /wechat/images/address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/address.png -------------------------------------------------------------------------------- /wechat/images/cartoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/cartoff.png -------------------------------------------------------------------------------- /wechat/images/carton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/carton.png -------------------------------------------------------------------------------- /wechat/images/indexoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/indexoff.png -------------------------------------------------------------------------------- /wechat/images/indexon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/indexon.png -------------------------------------------------------------------------------- /lavas/assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/assets/images/icon.png -------------------------------------------------------------------------------- /lavas/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/assets/images/logo.png -------------------------------------------------------------------------------- /wechat/images/arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/arrowright.png -------------------------------------------------------------------------------- /lavas/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /wechat/images/index_finger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/index_finger.png -------------------------------------------------------------------------------- /wechat/pages/pclogin/pclogin.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "授权登录确认", 3 | "usingComponents": { 4 | 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lavas/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .lavas/ 7 | .nyc_output 8 | -------------------------------------------------------------------------------- /lavas/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /lavas/assets/stylus/main.styl: -------------------------------------------------------------------------------- 1 | @import '~normalize.css'; 2 | @import '../css/iconfont.css'; 3 | 4 | html, body 5 | height 100% 6 | -------------------------------------------------------------------------------- /wechat/images/productdetail1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/productdetail1.jpeg -------------------------------------------------------------------------------- /wechat/images/productdetail2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/productdetail2.jpeg -------------------------------------------------------------------------------- /lavas/static/img/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/favicon.ico -------------------------------------------------------------------------------- /wechat/images/personalcenteroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/personalcenteroff.png -------------------------------------------------------------------------------- /wechat/images/personalcenteron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/wechat/images/personalcenteron.png -------------------------------------------------------------------------------- /laravel/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /lavas/static/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /lavas/static/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /wechat/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "我的酷酷小程序", 3 | "usingComponents": { 4 | "adv": "/components/adv/adv" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /wechat/pages/logs/logs.wxss: -------------------------------------------------------------------------------- 1 | .log-list { 2 | display: flex; 3 | flex-direction: column; 4 | padding: 40rpx; 5 | } 6 | .log-item { 7 | margin: 10rpx; 8 | } 9 | -------------------------------------------------------------------------------- /laravel/storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /lavas/static/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /lavas/static/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /lavas/static/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /lavas/static/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /lavas/static/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /lavas/static/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /lavas/static/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pailjin/wechat-laravel-lavas-system/HEAD/lavas/static/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /wechat/pages/personalcenter/personalcenter.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "个人中心", 3 | "usingComponents": { 4 | "item": "/components/item/item" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /laravel/config/qiniu.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'AK' => 'xxxxxxxxxxxxx', 5 | 'SK' => 'xxxxxxxxxxx', 6 | 'Name' => 'common' 7 | ] 8 | ]; 9 | -------------------------------------------------------------------------------- /lavas/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "6.9" 5 | - "7" 6 | - "8" 7 | os: 8 | - linux 9 | install: 10 | - npm install 11 | script: 12 | - npm test 13 | -------------------------------------------------------------------------------- /wechat/pages/modifyoperation/modifyoperation.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /wechat/pages/logs/logs.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{index + 1}}. {{log}} 5 | 6 | 7 | -------------------------------------------------------------------------------- /wechat/pages/modifyoperation/modifyoperation.wxss: -------------------------------------------------------------------------------- 1 | /**modifyPersonalInfo.wxss**/ 2 | input{ 3 | padding: 10rpx; 4 | width: 100%; 5 | height:88rpx; 6 | border-bottom:1rpx solid #ccc; 7 | /* margin: 20rpx auto; */ 8 | } -------------------------------------------------------------------------------- /laravel/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /.idea 7 | /.vscode 8 | /.vagrant 9 | Homestead.json 10 | Homestead.yaml 11 | npm-debug.log 12 | yarn-error.log 13 | .env 14 | -------------------------------------------------------------------------------- /laravel/resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /wechat/pages/addressmanager/addressmanager.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /laravel/app/Pclogin.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lavas/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org/ 2 | root = true 3 | 4 | [*] 5 | indent_size = 4 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [{package.json,.travis.yml}] 16 | indent_size = 2 17 | -------------------------------------------------------------------------------- /wechat/pages/logs/logs.js: -------------------------------------------------------------------------------- 1 | //logs.js 2 | const util = require('../../utils/util.js') 3 | 4 | Page({ 5 | data: { 6 | logs: [] 7 | }, 8 | onLoad: function () { 9 | this.setData({ 10 | logs: (wx.getStorageSync('logs') || []).map(log => { 11 | return util.formatTime(new Date(log)) 12 | }) 13 | }) 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /wechat/pages/pclogin/pclogin.wxss: -------------------------------------------------------------------------------- 1 | /**myClub.wxss**/ 2 | .bannerImg { 3 | width: 100%; 4 | height: 440rpx; 5 | } 6 | 7 | .userIcon { 8 | position: absolute; 9 | width: 160rpx; 10 | height: 160rpx; 11 | top: 340rpx; 12 | left: 300rpx; 13 | border-radius: 50%; 14 | } 15 | 16 | .userName { 17 | margin-top: 70rpx; 18 | font-size: 32rpx; 19 | } 20 | -------------------------------------------------------------------------------- /laravel/app/myUtil.php: -------------------------------------------------------------------------------- 1 | [ 4 | 'app_id' => 'wxxxxxxxxxxxx',//小程序APPID 5 | 'app_secret' => 'dfadfdfdasfdsafdfdfdfadfdfdf', 6 | 'merchant_id' => '1232131232',//微信支付分配的商户号 7 | 'pay_key' => 'dafdafadfadsfdasfdsafdsf',//支付签名使用 8 | 'notify_url' => 'https://pay.abc.com/api/weixinpaycallback',//异步接收微信支付结果通知的回调地址 9 | ] 10 | ]; 11 | -------------------------------------------------------------------------------- /laravel/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | { 7 | return { 8 | enable: true, 9 | type: 'none', 10 | effect: 'none' 11 | }; 12 | }; 13 | 14 | export const mutations = { 15 | setType(state, type) { 16 | state.type = type; 17 | }, 18 | setEffect(state, effect) { 19 | state.effect = effect; 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /wechat/components/adv/adv.wxss: -------------------------------------------------------------------------------- 1 | @import '../../app.wxss'; 2 | .adv { 3 | top:0; 4 | width: 750rpx; 5 | position: fixed; 6 | z-index: 1000; 7 | } 8 | 9 | .index-adv-img { 10 | width:38rpx; 11 | height: 38rpx; 12 | margin-right: 10rpx; 13 | vertical-align: middle; 14 | } 15 | 16 | .index-adv-title { 17 | width: 300rpx; 18 | overflow: hidden; 19 | font-size: 30rpx; 20 | text-overflow:ellipsis; 21 | white-space: nowrap; 22 | margin-top: 10rpx; 23 | } 24 | -------------------------------------------------------------------------------- /lavas/pages/Appshell.vue: -------------------------------------------------------------------------------- 1 | 3 | 4 | 19 | -------------------------------------------------------------------------------- /wechat/components/adv/adv.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ advTitle }} 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /wechat/pages/addressmanager/addressmanager.wxss: -------------------------------------------------------------------------------- 1 | .float-btn { 2 | color: #888; 3 | position: fixed; 4 | /*display: flex; 5 | align-items: center; 6 | justify-content: right;*/ 7 | width: 100%; 8 | height: 100rpx; 9 | line-height: 100rpx; 10 | text-align: right; 11 | bottom: 0; 12 | right: 0; 13 | font-size: 28rpx; 14 | background: #fff; 15 | border-top: 2rpx solid #ccc; 16 | } 17 | 18 | .float-btn-part { 19 | padding: 20rpx 40rpx; 20 | } 21 | 22 | .float-btn-part-image { 23 | width: 50rpx; 24 | height: 50rpx; 25 | } 26 | -------------------------------------------------------------------------------- /laravel/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /wechat/pages/personalcenter/personalcenter.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /laravel/config/cors.php: -------------------------------------------------------------------------------- 1 | false, 15 | 'allowedOrigins' => ['*'], 16 | 'allowedHeaders' => ['*'], 17 | 'allowedMethods' => ['*'], 18 | 'exposedHeaders' => [], 19 | 'maxAge' => 0, 20 | 'hosts' => [], 21 | ]; 22 | 23 | -------------------------------------------------------------------------------- /laravel/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /laravel/public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /laravel/resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /wechat/pages/modifyradiooperation/modifyradiooperation.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /laravel/server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /lavas/README.md: -------------------------------------------------------------------------------- 1 | # pwa-lavas-admin 2 | 3 | > 这是一个 Lavas PWA 项目 4 | 5 | ## npm 相关命令 6 | 7 | ``` bash 8 | # 安装工程依赖 9 | npm install 10 | 11 | # 在本地启动调试 server 12 | npm run dev 13 | 14 | # 构建线上生产环境产物 15 | npm run build 16 | 17 | # 启动编译后的代码,注意,需要在 dist 目录中启动,仅 SSR 模式下有效 18 | npm run start 19 | 20 | # 检查代码是否符合规范 21 | npm run lint 22 | ``` 23 | 24 | Lavas 工程模版基于 [vue-template-vue](https://github.com/lavas-project/lavas-template-vue/) 模版的 `release-*` 分支创建。 25 | 如果想要了解具体如何玩转整个 Lavas 创建的 PWA 工程, 请查看[Lavas 官网教程](https://lavas.baidu.com/guide)。 26 | 27 | ## Changelog 28 | 29 | 详细的 Changelog 请看 [Release Notes](https://github.com/lavas-project/lavas-template-vue/releases) 30 | -------------------------------------------------------------------------------- /wechat/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages":[ 3 | "pages/index/index", 4 | "pages/logs/logs", 5 | "pages/productdetail/productdetail", 6 | "pages/orderpurchase/orderpurchase", 7 | "pages/addressmanager/addressmanager", 8 | "pages/personalcenter/personalcenter", 9 | "pages/modifyoperation/modifyoperation", 10 | "pages/modifyradiooperation/modifyradiooperation", 11 | "pages/ordermanager/ordermanager", 12 | "pages/pclogin/pclogin" 13 | ], 14 | 15 | "window":{ 16 | "backgroundTextStyle":"light", 17 | "navigationBarBackgroundColor": "#3fb207", 18 | "navigationBarTitleText": "首页", 19 | "navigationBarTextStyle":"white" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /laravel/app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /laravel/resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * include Vue and Vue Resource. This gives a great starting point for 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | /** 11 | * Next, we will create a fresh Vue application instance and attach it to 12 | * the page. Then, you may begin adding components to this application 13 | * or customize the JavaScript scaffolding to fit your unique needs. 14 | */ 15 | 16 | Vue.component('example', require('./components/Example.vue')); 17 | 18 | const app = new Vue({ 19 | el: '#app' 20 | }); 21 | -------------------------------------------------------------------------------- /laravel/routes/web.php: -------------------------------------------------------------------------------- 1 | 'password.reset', function($token) 15 | { 16 | // implement your reset password route here! 17 | }]); 18 | 19 | Route::get('/', function () { 20 | return view('welcome'); 21 | }); 22 | -------------------------------------------------------------------------------- /laravel/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | id === (int) $userId; 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /laravel/resources/assets/js/components/Example.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /wechat/pages/addressmanager/addressmanager.js: -------------------------------------------------------------------------------- 1 | //获取应用实例 2 | const app = getApp() 3 | 4 | Page({ 5 | data: { 6 | 7 | }, 8 | 9 | onLoad: function(options) { 10 |   // 生命周期函数--监听页面加载 11 | // console.log("test onLoad"); 12 | }, 13 | 14 | onReady: function() { 15 |    // 生命周期函数--监听页面初次渲染完成 16 |    // console.log("test onReady"); 17 |   }, 18 | 19 |   onShow: function() { 20 |   // 生命周期函数--监听页面显示 21 |   // console.log("test onShow"); 22 | }, 23 | 24 | onHide:function() { 25 |    // 生命周期函数--监听页面隐藏 26 |     // console.log("test onHide"); 27 |   }, 28 | 29 |   onUnload: function() { 30 |    // 生命周期函数--监听页面卸载 31 |     // console.log("test onUnload"); 32 |   }, 33 | 34 | }) 35 | -------------------------------------------------------------------------------- /lavas/core/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file entry 3 | * @author pail(pail@techcopemate.net) 4 | */ 5 | 6 | import Vue from 'vue'; 7 | import Meta from 'vue-meta'; 8 | 9 | import {createRouter} from '@/.lavas/router'; 10 | import {createStore} from '@/.lavas/store'; 11 | import AppComponent from './App.vue'; 12 | 13 | Vue.use(Meta); 14 | 15 | Vue.config.productionTip = false; 16 | 17 | export function createApp() { 18 | let router = createRouter(); 19 | let store = createStore(); 20 | let App = Vue.extend({ 21 | router, 22 | store, 23 | ...AppComponent 24 | }); 25 | return {App, router, store}; 26 | } 27 | 28 | if (module.hot) { 29 | module.hot.accept(); 30 | } 31 | -------------------------------------------------------------------------------- /laravel/resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /wechat/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": true, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true 12 | }, 13 | "compileType": "miniprogram", 14 | "libVersion": "2.0.9", 15 | "appid": "xxxxxxxxxxxxxx", 16 | "projectname": "WLLxcx", 17 | "isGameTourist": false, 18 | "condition": { 19 | "search": { 20 | "current": -1, 21 | "list": [] 22 | }, 23 | "conversation": { 24 | "current": -1, 25 | "list": [] 26 | }, 27 | "game": { 28 | "currentL": -1, 29 | "list": [] 30 | }, 31 | "miniprogram": { 32 | "current": -1, 33 | "list": [] 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /laravel/app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laravel/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 27 | 28 | return $app; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/LogoutController.php: -------------------------------------------------------------------------------- 1 | middleware('jwt.auth', []); 18 | } 19 | 20 | /** 21 | * Log the user out (Invalidate the token) 22 | * 23 | * @return \Illuminate\Http\JsonResponse 24 | */ 25 | public function logout() 26 | { 27 | Auth::guard()->logout(); 28 | 29 | return response() 30 | ->json(['message' => 'Successfully logged out']); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laravel/app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /wechat/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 小程序配置文件 3 | */ 4 | 5 | 6 | var host = 'https://api.abc.com'; 7 | var qiniudomain = 'https://qinius.abc.com'; 8 | var config = { 9 | 10 | // 下面的地址配合云端 Demo 工作 11 | service: { 12 | host, 13 | qiniudomain:qiniudomain, 14 | 15 | // 登录地址,用于建立会话 16 | loginUrl: `${host}/api/login`, 17 | 18 | // 测试的请求地址 19 | requestUrl: `${host}/api`, 20 | // requestUrlmalls: `${host}/api/searchmalls/search`, 21 | // requestUrlduobiusers: `${host}/api/duobiusers`, 22 | // 测试的信道服务地址 23 | tunnelUrl: `${host}/weapp/tunnel`, 24 | 25 | // 上传图片接口,不需要用,直接用七牛 26 | uploadUrl: `${host}/weapp/upload`, 27 | downloadUrl:`${qiniudomain}` 28 | } 29 | }; 30 | 31 | module.exports = config; 32 | -------------------------------------------------------------------------------- /lavas/pages/Error.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 26 | 27 | 34 | -------------------------------------------------------------------------------- /wechat/pages/pclogin/pclogin.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 确认登录吗? 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /laravel/database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 16 | static $password; 17 | 18 | return [ 19 | 'name' => $faker->name, 20 | 'email' => $faker->unique()->safeEmail, 21 | 'password' => $password ?: $password = bcrypt('secret'), 22 | 'remember_token' => str_random(10), 23 | ]; 24 | }); 25 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/RefreshController.php: -------------------------------------------------------------------------------- 1 | refresh(); 23 | 24 | return response()->json([ 25 | 'status' => 'ok', 26 | 'token' => $token, 27 | 'expires_in' => Auth::guard()->factory()->getTTL() * 60 28 | ]); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laravel/resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /lavas/server.prod.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file server.prod.js 3 | * @author lavas 4 | */ 5 | 6 | var LavasCore = require('lavas-core-vue'); 7 | var express = require('express'); 8 | var app = express(); 9 | 10 | var port = process.env.PORT || 3000; 11 | 12 | var core = new LavasCore(__dirname); 13 | 14 | core.init(process.env.NODE_ENV || 'production') 15 | .then(function () { 16 | core.runAfterBuild(); 17 | }) 18 | .then(function () { 19 | app.use(core.expressMiddleware()); 20 | app.listen(port, function () { 21 | console.log('server started at localhost:' + port); 22 | }); 23 | }).catch(function (err) { 24 | console.log(err); 25 | }); 26 | 27 | // catch promise error 28 | process.on('unhandledRejection', function (err, promise) { 29 | console.log('in unhandledRejection'); 30 | console.log(err); 31 | // cannot redirect without ctx! 32 | }); 33 | -------------------------------------------------------------------------------- /lavas/static/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "start_url": "/?utm_source=homescreen", 3 | "name": "pwa-lavas-admin", 4 | "short_name": "pwa-lavas-admin", 5 | "icons": [ 6 | { 7 | "src": "img/icons/android-chrome-512x512.png", 8 | "type": "image/png", 9 | "sizes": "512x512" 10 | }, 11 | { 12 | "src": "img/icons/android-chrome-192x192.png", 13 | "type": "image/png", 14 | "sizes": "192x192" 15 | }, 16 | { 17 | "src": "img/icons/apple-touch-icon-180x180.png", 18 | "type": "image/png", 19 | "sizes": "180x180" 20 | }, 21 | { 22 | "src": "img/icons/apple-touch-icon-152x152.png", 23 | "type": "image/png", 24 | "sizes": "152x152" 25 | } 26 | ], 27 | "display": "standalone", 28 | "background_color": "#000000", 29 | "theme_color": "#278fef" 30 | } 31 | -------------------------------------------------------------------------------- /laravel/database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/SignUpController.php: -------------------------------------------------------------------------------- 1 | all()); 17 | if(!$user->save()) { 18 | throw new HttpException(500); 19 | } 20 | 21 | if(!Config::get('boilerplate.sign_up.release_token')) { 22 | return response()->json([ 23 | 'status' => 'ok' 24 | ], 201); 25 | } 26 | 27 | $token = $JWTAuth->fromUser($user); 28 | return response()->json([ 29 | 'status' => 'ok', 30 | 'token' => $token 31 | ], 201); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /laravel/resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $font-family-sans-serif: "Raleway", sans-serif; 21 | $font-size-base: 14px; 22 | $line-height-base: 1.6; 23 | $text-color: #636b6f; 24 | 25 | // Navbar 26 | $navbar-default-bg: #fff; 27 | 28 | // Buttons 29 | $btn-default-color: $text-color; 30 | 31 | // Inputs 32 | $input-border: lighten($text-color, 40%); 33 | $input-border-focus: lighten($brand-primary, 25%); 34 | $input-color-placeholder: lighten($text-color, 30%); 35 | 36 | // Panels 37 | $panel-default-heading-bg: #fff; 38 | -------------------------------------------------------------------------------- /laravel/app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the Closure based commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /laravel/public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /wechat/components/item/item.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | options: { 3 | multipleSlots: true // 在组件定义时的选项中启用多slot支持 4 | }, 5 | 6 | properties: { 7 | // 这里定义了innerText属性,属性值可以在组件使用时指定 8 | itemLeft: { 9 | type: String, 10 | value: '' 11 | }, 12 | 13 | itemRight: { 14 | type: String, 15 | value: '', 16 | }, 17 | 18 | itemType: { 19 | type: String, 20 | value: '' 21 | }, 22 | 23 | tag: { 24 | type: String, 25 | value: '' 26 | }, 27 | }, 28 | 29 | data: { 30 | 31 | }, 32 | 33 | methods:{ 34 | setInput: function() { 35 | wx.navigateTo({ 36 | url: '/pages/modifyoperation/modifyoperation?from='+this.properties.tag+'&orgvalue=' + this.properties.itemRight 37 | }) 38 | }, 39 | 40 | setRadioChoose: function() { 41 | wx.navigateTo({ 42 | url: '/pages/modifyradiooperation/modifyradiooperation?from='+this.properties.tag+'&orgvalue=' + this.properties.itemRight 43 | }) 44 | } 45 | } 46 | }) 47 | -------------------------------------------------------------------------------- /laravel/.env: -------------------------------------------------------------------------------- 1 | APP_NAME=WLL 2 | APP_ENV=local 3 | APP_KEY=base64:B8CRetjQBe2GUEO0u3c+p3nQGFnq/sbPlrG5nWWUub0= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=106.12.34.28 11 | DB_PORT=3306 12 | DB_DATABASE=wlldb 13 | DB_USERNAME=root 14 | DB_PASSWORD=coolJe2018 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | SESSION_DRIVER=file 19 | SESSION_LIFETIME=120 20 | QUEUE_DRIVER=sync 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | PUSHER_APP_ID= 34 | PUSHER_APP_KEY= 35 | PUSHER_APP_SECRET= 36 | PUSHER_APP_CLUSTER=mt1 37 | 38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 40 | 41 | API_PREFIX=api 42 | API_SUBTYPE=app 43 | API_VERSION=v1 44 | 45 | SIGN_UP_RELEASE_TOKEN=false 46 | PASSWORD_RESET_RELEASE_TOKEN=false 47 | 48 | JWT_SECRET=zK9WgxqDBG4dMnrDuqyY9LzZWvzjOCk8 49 | -------------------------------------------------------------------------------- /laravel/env.pro: -------------------------------------------------------------------------------- 1 | APP_NAME=WLL 2 | APP_ENV=local 3 | APP_KEY=base64:B8CRetjQBe2GUEO0u3c+p3nQGFnq/sbPlrG5nWWUub0= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=mydbname 13 | DB_USERNAME=mydbusername 14 | DB_PASSWORD=mydbpassword 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | SESSION_DRIVER=file 19 | SESSION_LIFETIME=120 20 | QUEUE_DRIVER=sync 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | PUSHER_APP_ID= 34 | PUSHER_APP_KEY= 35 | PUSHER_APP_SECRET= 36 | PUSHER_APP_CLUSTER=mt1 37 | 38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 40 | 41 | API_PREFIX=api 42 | API_SUBTYPE=app 43 | API_VERSION=v1 44 | 45 | SIGN_UP_RELEASE_TOKEN=false 46 | PASSWORD_RESET_RELEASE_TOKEN=false 47 | 48 | JWT_SECRET=zK9WgxqDBG4dMnrDuqyY9LzZWvzjOCk8 49 | -------------------------------------------------------------------------------- /laravel/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=WLL 2 | APP_ENV=local 3 | APP_KEY=base64:B8CRetjQBe2GUEO0u3c+p3nQGFnq/sbPlrG5nWWUub0= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=8.8.8.8 11 | DB_PORT=3306 12 | DB_DATABASE=mydbname 13 | DB_USERNAME=mydbusername 14 | DB_PASSWORD=mydbpassword 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | SESSION_DRIVER=file 19 | SESSION_LIFETIME=120 20 | QUEUE_DRIVER=sync 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | PUSHER_APP_ID= 34 | PUSHER_APP_KEY= 35 | PUSHER_APP_SECRET= 36 | PUSHER_APP_CLUSTER=mt1 37 | 38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 40 | 41 | API_PREFIX=api 42 | API_SUBTYPE=app 43 | API_VERSION=v1 44 | 45 | SIGN_UP_RELEASE_TOKEN=false 46 | PASSWORD_RESET_RELEASE_TOKEN=false 47 | 48 | JWT_SECRET=zK9WgxqDBG4dMnrDuqyY9LzZWvzjOCk8 49 | -------------------------------------------------------------------------------- /lavas/store/scrollBehavior.js: -------------------------------------------------------------------------------- 1 | export const SET_PAGE_SCROLL_POSITION = 'SET_PAGE_SCROLL_POSITION'; 2 | 3 | export const state = () => { 4 | return { 5 | /** 6 | * 保存页面滚动位置,以 `route.fullPath` 为键 7 | * {'/': 0, '/detail/1': 100, '/detail/2': 200} 8 | * 9 | * @type {Object} 10 | */ 11 | scrollPostionMap: {} 12 | }; 13 | }; 14 | 15 | export const mutations = { 16 | [SET_PAGE_SCROLL_POSITION](state, {pageId, scrollPosition}) { 17 | state.scrollPostionMap = { 18 | ...state.scrollPostionMap, 19 | [pageId]: scrollPosition 20 | }; 21 | } 22 | }; 23 | 24 | export const actions = { 25 | /** 26 | * 保存页面滚动位置 27 | * 28 | * @param {Function} commit commit 29 | * @param {Object} payload 30 | * @param {string} payload.pageId 页面 ID 31 | * @param {Object} payload.scrollPosition 滚动位置对象 {x:, y:} 32 | */ 33 | savePageScrollPosition({commit}, {pageId, scrollPosition}) { 34 | commit(SET_PAGE_SCROLL_POSITION, {pageId, scrollPosition}); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 pailjin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /laravel/database/migrations/2018_06_09_195009_create_pclogin_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->timestamps(); 19 | 20 | $table->string('scene', 45)->nullable()->comment('微信qr的scene参数'); 21 | $table->string('openid', 100)->nullable()->comment('微信openid'); 22 | $table->string('status', 45)->nullable()->comment('登录状态:创建,使用中,允许,已使用,超时, 拒绝'); 23 | $table->integer('user_id')->unsigned()->comment('创建用户users表中的userid'); 24 | 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('pclogin'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lavas/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 pail 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /laravel/config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /laravel/config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /laravel/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/LogoutControllerTest.php: -------------------------------------------------------------------------------- 1 | 'Test', 20 | 'email' => 'test@email.com', 21 | 'password' => '123456' 22 | ]); 23 | 24 | $user->save(); 25 | } 26 | 27 | public function testLogout() 28 | { 29 | $response = $this->post('api/auth/login', [ 30 | 'email' => 'test@email.com', 31 | 'password' => '123456' 32 | ]); 33 | 34 | $response->assertStatus(200); 35 | 36 | $responseJSON = json_decode($response->getContent(), true); 37 | $token = $responseJSON['token']; 38 | 39 | $this->post('api/auth/logout?token=' . $token, [], [])->assertStatus(200); 40 | $this->post('api/auth/logout?token=' . $token, [], [])->assertStatus(401); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/UserControllerTest.php: -------------------------------------------------------------------------------- 1 | 'Test', 20 | 'email' => 'test@email.com', 21 | 'password' => '123456' 22 | ]); 23 | 24 | $user->save(); 25 | } 26 | 27 | public function testMe() 28 | { 29 | $response = $this->post('api/auth/login', [ 30 | 'email' => 'test@email.com', 31 | 'password' => '123456' 32 | ]); 33 | 34 | $response->assertStatus(200); 35 | 36 | $responseJSON = json_decode($response->getContent(), true); 37 | $token = $responseJSON['token']; 38 | 39 | $this->get('api/auth/me?token=' . $token, [], [])->assertJson([ 40 | 'name' => 'Test', 41 | 'email' => 'test@email.com' 42 | ])->isOk(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /laravel/bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 8 | 9 | 10 |
11 | 12 | 13 | 44 | 45 | 54 | -------------------------------------------------------------------------------- /laravel/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | ./app/Http/routes.php 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /lavas/core/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file service-worker.js with workbox api 3 | * @desc [example](https://workbox-samples.glitch.me/examples/workbox-sw/) 4 | * @author pail(pail@techcopemate.net) 5 | */ 6 | 7 | /* globals WorkboxSW */ 8 | 9 | const workboxSW = new WorkboxSW({ 10 | cacheId: 'lavas-cache', 11 | ignoreUrlParametersMatching: [/^utm_/], 12 | skipWaiting: true, 13 | clientsClaim: true 14 | }); 15 | 16 | // Define precache injection point. 17 | workboxSW.precache([]); 18 | 19 | /** 20 | * example runningCache with api 21 | */ 22 | // workboxSW.router.registerRoute(/^https:\/\/lavas\.baidu\.com\/some\/api/, 23 | // workboxSW.strategies.networkFirst()); 24 | 25 | 26 | /** 27 | * example runningCache with resources from CDN 28 | * including maxAge, maxEntries 29 | * cacheableResponse is important for CDN 30 | */ 31 | // workboxSW.router.registerRoute(/^https:\/\/cdn\.baidu\.com/i, 32 | // workboxSW.strategies.cacheFirst({ 33 | // cacheName: 'lavas-cache-images', 34 | // cacheExpiration: { 35 | // maxEntries: 100, 36 | // maxAgeSeconds: 7 * 24 * 60 * 60 37 | // }, 38 | // cacheableResponse: { 39 | // statuses: [0, 200] 40 | // } 41 | // }) 42 | // ); 43 | -------------------------------------------------------------------------------- /lavas/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pwa-lavas-admin", 3 | "version": "0.0.1", 4 | "description": "这是一个 Lavas PWA 项目", 5 | "author": "pail ", 6 | "private": true, 7 | "lavas": { 8 | "core": "lavas-core-vue", 9 | "version": "2" 10 | }, 11 | "scripts": { 12 | "dev": "lavas dev", 13 | "build": "lavas build", 14 | "start": "lavas start", 15 | "lint": "fecs ./ --rule --type 'vue,js,css'" 16 | }, 17 | "dependencies": { 18 | "array-includes": "^3.0.3", 19 | "array.prototype.find": "^2.0.4", 20 | "axios": "^0.18.0", 21 | "es6-promise": "^4.1.1", 22 | "lavas-core-vue": "^1.1.11", 23 | "mint-ui": "^2.2.13", 24 | "muse-ui": "^2.1.0", 25 | "normalize.css": "^7.0.0" 26 | }, 27 | "devDependencies": { 28 | "autoprefixer": "^7.2.5", 29 | "babel-preset-vue-app": "^1.3.1", 30 | "express": "^4.16.2", 31 | "http-proxy-middleware": "^0.17.4", 32 | "stoppable": "^1.0.4" 33 | }, 34 | "engines": { 35 | "node": ">= 6.9.0", 36 | "npm": ">= 3.0.0" 37 | }, 38 | "browserslist": [ 39 | "> 1%", 40 | "last 2 versions", 41 | "not ie <= 8" 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /laravel/resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/LoginController.php: -------------------------------------------------------------------------------- 1 | only(['email', 'password']); 25 | 26 | try { 27 | $token = Auth::guard()->attempt($credentials); 28 | 29 | if(!$token) { 30 | throw new AccessDeniedHttpException(); 31 | } 32 | 33 | } catch (JWTException $e) { 34 | throw new HttpException(500); 35 | } 36 | 37 | return response() 38 | ->json([ 39 | 'status' => 'ok', 40 | 'token' => $token, 41 | 'expires_in' => Auth::guard()->factory()->getTTL() * 60 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | get('email'))->first(); 17 | 18 | if(!$user) { 19 | throw new NotFoundHttpException(); 20 | } 21 | 22 | $broker = $this->getPasswordBroker(); 23 | $sendingResponse = $broker->sendResetLink($request->only('email')); 24 | 25 | if($sendingResponse !== Password::RESET_LINK_SENT) { 26 | throw new HttpException(500); 27 | } 28 | 29 | return response()->json([ 30 | 'status' => 'ok' 31 | ], 200); 32 | } 33 | 34 | /** 35 | * Get the broker to be used during password reset. 36 | * 37 | * @return \Illuminate\Contracts\Auth\PasswordBroker 38 | */ 39 | private function getPasswordBroker() 40 | { 41 | return Password::broker(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lavas/store/user.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | export const state = () => ({ 4 | global_userlist:{} 5 | }); 6 | 7 | export const mutations = { 8 | SET_NEW_USER_LIST(state,userlist){ 9 | var saveData = [] 10 | if(state.global_userlist.data){ 11 | saveData = state.global_userlist.data 12 | } 13 | var tmpuserlist = userlist; 14 | if(saveData.length==0){ 15 | tmpuserlist.data = userlist.data 16 | }else{ 17 | tmpuserlist.data = saveData.concat(userlist.data) 18 | } 19 | 20 | state.global_userlist = tmpuserlist; 21 | }, 22 | CLEAN_NEW_USER_LIST(state,userlist){ 23 | state.global_userlist = {}; 24 | } 25 | 26 | }; 27 | export const actions = { 28 | async getUserlist({commit}, params){//params == { token, page} 29 | if(params.page<=1){ 30 | commit('CLEAN_NEW_USER_LIST',{}) 31 | } 32 | let new_token = params.token; 33 | let url = 'https://api.abc.com/api/auth/getuserlistpage?token='+new_token+'&page='+params.page; 34 | 35 | axios.get(url) 36 | .then(function (listresult) { 37 | console.log("listresult===",listresult); 38 | if(listresult.data && listresult.data.status=='ok'){ 39 | var newuserlist = listresult.data.ret 40 | commit('SET_NEW_USER_LIST',newuserlist) 41 | } 42 | }) 43 | .catch(function (error) { 44 | console.log(error); 45 | }); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /laravel/app/Http/Middleware/checkadmin.php: -------------------------------------------------------------------------------- 1 | is('admin/*') 10 | /* 11 | The path method returns the request's path information. 12 | So, if the incoming request is targeted at http://domain.com/foo/bar, 13 | the path method will return foo/bar: 14 | 15 | $uri = $request->path(); 16 | */ 17 | use Auth; 18 | use App\User; 19 | 20 | class checkadmin 21 | { 22 | /** 23 | * Handle an incoming request. 24 | * 25 | * @param \Illuminate\Http\Request $request 26 | * @param \Closure $next 27 | * @return mixed 28 | */ 29 | public function handle($request, Closure $next) 30 | { 31 | // 用户等级:0 无效,10 普通user, 20 管理员 30 员工 32 | if ($request->isMethod('post')) { 33 | if($request->get('userlevel')){ 34 | $user_id = Auth::id(); 35 | if($user_id){ 36 | $user = User::find($user_id); 37 | if($user){ 38 | if($user->userlevel != 20){ 39 | return response()->json([ 40 | 'status' => 'ko', 41 | 'ret' => 'not admin' 42 | ], 201); 43 | } 44 | 45 | } 46 | 47 | } 48 | 49 | } 50 | } 51 | 52 | return $next($request); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/SignUpControllerTest.php: -------------------------------------------------------------------------------- 1 | post('api/auth/signup', [ 16 | 'name' => 'Test User', 17 | 'email' => 'test@email.com', 18 | 'password' => '123456' 19 | ])->assertJson([ 20 | 'status' => 'ok' 21 | ])->assertStatus(201); 22 | } 23 | 24 | public function testSignUpSuccessfullyWithTokenRelease() 25 | { 26 | Config::set('boilerplate.sign_up.release_token', true); 27 | 28 | $this->post('api/auth/signup', [ 29 | 'name' => 'Test User', 30 | 'email' => 'test@email.com', 31 | 'password' => '123456' 32 | ])->assertJsonStructure([ 33 | 'status', 'token' 34 | ])->assertJson([ 35 | 'status' => 'ok' 36 | ])->assertStatus(201); 37 | } 38 | 39 | public function testSignUpReturnsValidationError() 40 | { 41 | $this->post('api/auth/signup', [ 42 | 'name' => 'Test User', 43 | 'email' => 'test@email.com' 44 | ])->assertJsonStructure([ 45 | 'error' 46 | ])->assertStatus(422); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/ForgotPasswordControllerTest.php: -------------------------------------------------------------------------------- 1 | 'Test', 19 | 'email' => 'test@email.com', 20 | 'password' => '123456' 21 | ]); 22 | 23 | $user->save(); 24 | } 25 | 26 | public function testForgotPasswordRecoverySuccessfully() 27 | { 28 | $this->post('api/auth/recovery', [ 29 | 'email' => 'test@email.com' 30 | ])->assertJson([ 31 | 'status' => 'ok' 32 | ])->isOk(); 33 | } 34 | 35 | public function testForgotPasswordRecoveryReturnsUserNotFoundError() 36 | { 37 | $this->post('api/auth/recovery', [ 38 | 'email' => 'unknown@email.com' 39 | ])->assertJsonStructure([ 40 | 'error' 41 | ])->assertStatus(404); 42 | } 43 | 44 | public function testForgotPasswordRecoveryReturnsValidationErrors() 45 | { 46 | $this->post('api/auth/recovery', [ 47 | 'email' => 'i am not an email' 48 | ])->assertJsonStructure([ 49 | 'error' 50 | ])->assertStatus(422); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lavas/lavas.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lavas config 3 | * @author pail(pail@techcopemate.net) 4 | */ 5 | 6 | 'use strict'; 7 | 8 | const path = require('path'); 9 | const BUILD_PATH = path.resolve(__dirname, 'dist'); 10 | const isDev = process.env.NODE_ENV === 'development'; 11 | const isProd = process.env.NODE_ENV === 'production'; 12 | 13 | module.exports = { 14 | build: { 15 | ssr: false, 16 | path: BUILD_PATH, 17 | publicPath: '/', 18 | ssrCopy: isDev ? [] : [ 19 | { 20 | src: 'server.prod.js' 21 | }, 22 | { 23 | src: 'package.json' 24 | } 25 | ] 26 | }, 27 | router: { 28 | mode: 'history', 29 | base: '/', 30 | pageTransition: { 31 | type: 'fade', 32 | transitionClass: 'fade' 33 | } 34 | }, 35 | serviceWorker: { 36 | swSrc: path.join(__dirname, 'core/service-worker.js'), 37 | swDest: path.join(BUILD_PATH, 'service-worker.js'), 38 | // swPath: '/custom_path/', // specify custom serveice worker file's path, default is publicPath 39 | globDirectory: BUILD_PATH, 40 | globPatterns: [ 41 | '**/*.{html,js,css,eot,svg,ttf,woff}' 42 | ], 43 | globIgnores: [ 44 | 'sw-register.js', 45 | '**/*.map' 46 | ], 47 | appshellUrl: '/appshell', 48 | dontCacheBustUrlsMatching: /\.\w{8}\./ 49 | } 50 | }; 51 | -------------------------------------------------------------------------------- /wechat/components/item/item.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ itemLeft }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {{ itemLeft }} 14 | {{ itemRight }} 15 | 16 | 17 | 18 | 19 | 20 | {{ itemLeft }} 21 | {{ itemRight }} 22 | 23 | 24 | 25 | 26 | 27 | {{ itemLeft }} 28 | {{ itemRight }} 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/RefreshControllerTest.php: -------------------------------------------------------------------------------- 1 | 'Test', 20 | 'email' => 'test@email.com', 21 | 'password' => '123456' 22 | ]); 23 | 24 | $user->save(); 25 | } 26 | 27 | public function testRefresh() 28 | { 29 | $response = $this->post('api/auth/login', [ 30 | 'email' => 'test@email.com', 31 | 'password' => '123456' 32 | ]); 33 | 34 | $response->assertStatus(200); 35 | 36 | $responseJSON = json_decode($response->getContent(), true); 37 | $token = $responseJSON['token']; 38 | 39 | $this->post('api/auth/refresh', [], [ 40 | 'Authorization' => 'Bearer ' . $token 41 | ])->assertJsonStructure([ 42 | 'status', 43 | 'token', 44 | 'expires_in' 45 | ])->isOk(); 46 | } 47 | 48 | public function testRefreshWithError() 49 | { 50 | $response = $this->post('api/auth/refresh', [], [ 51 | 'Authorization' => 'Bearer Wrong' 52 | ]); 53 | 54 | $response->assertStatus(500); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /laravel/resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | window.$ = window.jQuery = require('jquery'); 11 | require('bootstrap-sass'); 12 | 13 | /** 14 | * Vue is a modern JavaScript library for building interactive web interfaces 15 | * using reactive data binding and reusable components. Vue's API is clean 16 | * and simple, leaving you to focus on building your next great project. 17 | */ 18 | 19 | window.Vue = require('vue'); 20 | require('vue-resource'); 21 | 22 | /** 23 | * We'll register a HTTP interceptor to attach the "CSRF" header to each of 24 | * the outgoing requests issued by this application. The CSRF middleware 25 | * included with Laravel will automatically verify the header's value. 26 | */ 27 | 28 | Vue.http.interceptors.push((request, next) => { 29 | request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken); 30 | 31 | next(); 32 | }); 33 | 34 | /** 35 | * Echo exposes an expressive API for subscribing to channels and listening 36 | * for events that are broadcast by Laravel. Echo and event broadcasting 37 | * allows your team to easily build robust real-time web applications. 38 | */ 39 | 40 | // import Echo from "laravel-echo" 41 | 42 | // window.Echo = new Echo({ 43 | // broadcaster: 'pusher', 44 | // key: 'your-pusher-key' 45 | // }); 46 | -------------------------------------------------------------------------------- /laravel/database/migrations/2018_06_09_193549_add_morefield_weixin_to_users_table.php: -------------------------------------------------------------------------------- 1 | integer('userlevel')->default(10)->comment('用户等级:0 无效,10 普通user, 20 管理员 30 员工'); 19 | $table->string('nickname', 45)->nullable()->comment('昵称'); 20 | $table->string('iconurl', 500)->nullable()->comment('头像的url,一般为七牛存储的图片路径'); 21 | $table->string('sex', 45)->nullable()->comment('性别:男,女,保密'); 22 | $table->string('phone', 45)->nullable()->comment('电话'); 23 | $table->json('wxinfo')->nullable()->comment('微信用户信息json格式'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table('users', function (Blueprint $table) { 35 | // 36 | $table->dropColumn('userlevel'); 37 | $table->dropColumn('nickname'); 38 | $table->dropColumn('iconurl'); 39 | $table->dropColumn('sex'); 40 | $table->dropColumn('phone'); 41 | $table->dropColumn('wxinfo'); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/LoginControllerTest.php: -------------------------------------------------------------------------------- 1 | 'Test', 20 | 'email' => 'test@email.com', 21 | 'password' => '123456' 22 | ]); 23 | 24 | $user->save(); 25 | } 26 | 27 | public function testLoginSuccessfully() 28 | { 29 | $this->post('api/auth/login', [ 30 | 'email' => 'test@email.com', 31 | 'password' => '123456' 32 | ])->assertJson([ 33 | 'status' => 'ok' 34 | ])->assertJsonStructure([ 35 | 'status', 36 | 'token', 37 | 'expires_in' 38 | ])->isOk(); 39 | } 40 | 41 | public function testLoginWithReturnsWrongCredentialsError() 42 | { 43 | $this->post('api/auth/login', [ 44 | 'email' => 'unknown@email.com', 45 | 'password' => '123456' 46 | ])->assertJsonStructure([ 47 | 'error' 48 | ])->assertStatus(403); 49 | } 50 | 51 | public function testLoginWithReturnsValidationError() 52 | { 53 | $this->post('api/auth/login', [ 54 | 'email' => 'test@email.com' 55 | ])->assertJsonStructure([ 56 | 'error' 57 | ])->assertStatus(422); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /wechat/pages/ordermanager/ordermanager.js: -------------------------------------------------------------------------------- 1 | //获取应用实例 2 | const app = getApp() 3 | 4 | var sliderWidth = 96; // 需要设置slider的宽度,用于计算中间位置 5 | 6 | Page({ 7 | data: { 8 | tabs: ["全部", "待付款", "待发货", "待收货"], 9 | activeIndex: 0, 10 | sliderOffset: 0, 11 | sliderLeft: 0, 12 | storeName: '墨刀小集市集市集市集市集市集市集市集市', 13 | orderStatus: '等待买家付款', 14 | orderNumber: '102390219302139', 15 | productName: '商品名称', 16 | productPrice: '233.00', 17 | productDesc: '商品描述商品描述商品描述商品描述商品描述', 18 | productNumber: '1', 19 | orderTotalPrice: '233.00' 20 | }, 21 | 22 | onLoad: function(options) { 23 |   // 生命周期函数--监听页面加载 24 | // console.log("test onLoad"); 25 | var that = this; 26 | wx.getSystemInfo({ 27 | success: function(res) { 28 | that.setData({ 29 | sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2, 30 | sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex 31 | }); 32 | } 33 | }); 34 | }, 35 | 36 | onReady: function() { 37 |    // 生命周期函数--监听页面初次渲染完成 38 |    // console.log("test onReady"); 39 |   }, 40 | 41 |   onShow: function() { 42 |   // 生命周期函数--监听页面显示 43 |   // console.log("test onShow"); 44 | }, 45 | 46 | onHide:function() { 47 |    // 生命周期函数--监听页面隐藏 48 |     // console.log("test onHide"); 49 |   }, 50 | 51 |   onUnload: function() { 52 |    // 生命周期函数--监听页面卸载 53 |     // console.log("test onUnload"); 54 |   }, 55 | 56 | tabClick: function (e) { 57 | this.setData({ 58 | sliderOffset: e.currentTarget.offsetLeft, 59 | activeIndex: e.currentTarget.id 60 | }); 61 | } 62 | 63 | }) 64 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/qiniuController.php: -------------------------------------------------------------------------------- 1 | COMMON_AK = Config::get('qiniu.commonbuket.AK'); 23 | $this->COMMON_SK = Config::get('qiniu.commonbuket.SK'); 24 | $this->COMMON_BUKET_NAME = Config::get('qiniu.commonbuket.Name'); 25 | // $this->middleware('jwt.auth', []); 26 | $exceptapi=[ 27 | // 'uptoken' 28 | ]; 29 | // $this->middleware('auth:api', ['except'=>$exceptapi]); 30 | $this->middleware('jwt.auth', ['except'=>$exceptapi]); 31 | } 32 | /** 33 | * qiniu router 34 | * 35 | * 36 | * @return \Illuminate\Http\JsonResponse 37 | */ 38 | public function uptoken(Request $request) 39 | { 40 | $accessKey=$this->COMMON_AK; 41 | $secretKey=$this->COMMON_SK; 42 | $bucketName=$this->COMMON_BUKET_NAME; 43 | 44 | $auth = new Auth($accessKey, $secretKey); 45 | $token = $auth->uploadToken($bucketName); 46 | 47 | return response() 48 | ->json([ 49 | 'uptoken' =>$token 50 | ] 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /wechat/pages/modifyoperation/modifyoperation.js: -------------------------------------------------------------------------------- 1 | // 引入配置 2 | var config = require('../../config'); 3 | var Util = require('../../utils/util.js'); 4 | //获取应用实例 5 | const app = getApp() 6 | 7 | Page({ 8 | data: { 9 | inputValue: '', 10 | fromKeyword: '', 11 | }, 12 | 13 | onLoad: function(options) { 14 |   // 生命周期函数--监听页面加载 15 |   console.log("test onLoad",options); 16 | if (options && options.from) { 17 | console.log("test onLoad--options.query.from----",options.from); 18 | this.setData({ 19 | fromKeyword: options.from, 20 | inputValue: options.orgvalue 21 | }) 22 | } 23 | }, 24 | 25 |   onReady: function() { 26 |    // 生命周期函数--监听页面初次渲染完成 27 | //    console.log("test onReady"); 28 |   }, 29 | 30 |   onShow: function() { 31 |   // 生命周期函数--监听页面显示 32 | //   console.log("test onShow"); 33 |   }, 34 | 35 |   onHide:function() { 36 |    // 生命周期函数--监听页面隐藏 37 | //     console.log("test onHide"); 38 |   }, 39 | 40 |   onUnload: function() { 41 |    // 生命周期函数--监听页面卸载 42 | //     console.log("test onUnload"); 43 | // wx.clearStorageSync(Util.ITEM_RETURN_VALUE, {}) 44 |   }, 45 | 46 |   onPullDownRefresh: function() { 47 |    // 页面相关事件处理函数--监听用户下拉动作 48 | //     console.log("test onPullDownRefresh"); 49 |   }, 50 | 51 |   onReachBottom: function() { 52 |    // 页面上拉触底事件的处理函数 53 | //     console.log("test onReachBottom"); 54 |   }, 55 | 56 | bindReplaceInput: function(event) { 57 | // console.log(event.detail) 58 | //if (this.data.fromKeyword === 'listNickname') { 59 | wx.setStorageSync(Util.ITEM_RETURN_VALUE, { 60 | value: event.detail.value, 61 | ifchange: 1, 62 | tag: this.data.fromKeyword 63 | }) 64 | //} 65 | } 66 | }) 67 | -------------------------------------------------------------------------------- /laravel/config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_KEY'), 36 | 'secret' => env('PUSHER_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /laravel/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /laravel/artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /laravel/config/boilerplate.php: -------------------------------------------------------------------------------- 1 | [ 7 | 8 | // this option must be set to true if you want to release a token 9 | // when your user successfully terminates the sign-in procedure 10 | 'release_token' => env('SIGN_UP_RELEASE_TOKEN', false), 11 | 12 | // here you can specify some validation rules for your sign-in request 13 | 'validation_rules' => [ 14 | 'name' => 'required', 15 | 'email' => 'required|email', 16 | 'password' => 'required' 17 | ] 18 | ], 19 | 20 | // these options are related to the login procedure 21 | 'login' => [ 22 | 23 | // here you can specify some validation rules for your login request 24 | 'validation_rules' => [ 25 | 'email' => 'required|email', 26 | 'password' => 'required' 27 | ] 28 | ], 29 | 30 | // these options are related to the password recovery procedure 31 | 'forgot_password' => [ 32 | 33 | // here you can specify some validation rules for your password recovery procedure 34 | 'validation_rules' => [ 35 | 'email' => 'required|email' 36 | ] 37 | ], 38 | 39 | // these options are related to the password recovery procedure 40 | 'reset_password' => [ 41 | 42 | // this option must be set to true if you want to release a token 43 | // when your user successfully terminates the password reset procedure 44 | 'release_token' => env('PASSWORD_RESET_RELEASE_TOKEN', false), 45 | 46 | // here you can specify some validation rules for your password recovery procedure 47 | 'validation_rules' => [ 48 | 'token' => 'required', 49 | 'email' => 'required|email', 50 | 'password' => 'required|confirmed' 51 | ] 52 | ] 53 | 54 | ]; 55 | -------------------------------------------------------------------------------- /lavas/core/ssr.html.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | << meta = meta.inject() >> 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{{ meta.title.text() }}} 11 | {{{ meta.meta.text() }}} 12 | {{{ meta.link.text() }}} 13 | {{{ meta.style.text() }}} 14 | {{{ meta.script.text() }}} 15 | {{{ meta.noscript.text() }}} 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | << if (isProd) { >> 28 | 38 | << } >> 39 | 40 | 41 | -------------------------------------------------------------------------------- /wechat/pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | 2 | .index-part1-data { 3 | padding-top: 20rpx; 4 | font-size: 28rpx; 5 | color: #999; 6 | } 7 | 8 | .index-part1-over { 9 | background: #e5246d; 10 | padding: 20rpx; 11 | color: #fff; 12 | } 13 | 14 | .index-part1-overtime { 15 | padding-top: 16rpx; 16 | } 17 | 18 | .index-part2-prodcutimg { 19 | width: 100%; 20 | height: 400rpx; 21 | } 22 | 23 | .index-part3-finger { 24 | width: 80rpx; 25 | height: 80rpx; 26 | } 27 | 28 | .float-btn { 29 | color: #ffffff; 30 | position: fixed; 31 | display: flex; 32 | align-items: center; 33 | justify-content: center; 34 | bottom: 20rpx; 35 | right: 20rpx; 36 | font-size: 28rpx; 37 | background: #3fb207; 38 | } 39 | 40 | .float-btn-part { 41 | padding: 20rpx 40rpx; 42 | } 43 | 44 | .float-btn-part-image { 45 | width: 50rpx; 46 | height: 50rpx; 47 | } 48 | 49 | /*.index-adv { 50 | margin-bottom: 84rpx; 51 | } 52 | 53 | 54 | 55 | .index-adv-title { 56 | margin-top: 10rpx; 57 | } 58 | 59 | .index-content { 60 | padding: 20rpx; 61 | } 62 | 63 | .index-content-part1-prodcutimg { 64 | width: 100%; 65 | height: 400rpx; 66 | } 67 | 68 | .index-content-part2-productitle { 69 | -webkit-line-clamp:2; 70 | } 71 | 72 | .marginright12 { 73 | margin-right: 12rpx; 74 | } 75 | 76 | .marginright20 { 77 | margin-right: 20rpx; 78 | } 79 | 80 | .index-content-part4-leftcontent { 81 | width: 512rpx; 82 | } 83 | 84 | .index-content-part4-rightcontent { 85 | width: 200rpx; 86 | }*/ 87 | 88 | 89 | /*.userinfo { 90 | display: flex; 91 | flex-direction: column; 92 | align-items: center; 93 | } 94 | 95 | .userinfo-avatar { 96 | width: 128rpx; 97 | height: 128rpx; 98 | margin: 20rpx; 99 | border-radius: 50%; 100 | } 101 | 102 | .userinfo-nickname { 103 | color: #aaa; 104 | } 105 | 106 | .usermotto { 107 | margin-top: 200px; 108 | }*/ 109 | -------------------------------------------------------------------------------- /wechat/app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | @import 'weui.wxss'; 3 | 4 | /*page{ 5 | background-color: #ccc; 6 | height:100%; 7 | }*/ 8 | 9 | .container { 10 | margin: 30rpx; 11 | border: 1px solid #ccc; 12 | background: #fff; 13 | } 14 | 15 | .overflowdot { 16 | overflow:hidden; 17 | text-overflow:ellipsis; 18 | display:-webkit-box; 19 | -webkit-box-orient:vertical; 20 | -webkit-line-clamp:1; 21 | } 22 | 23 | .postionstatic { 24 | position: static; 25 | } 26 | 27 | .floatleft { 28 | float: left; 29 | } 30 | 31 | .clearfloat { 32 | overflow: hidden; 33 | } 34 | 35 | .fontsize36 { 36 | font-size: 36rpx; 37 | } 38 | 39 | .fontsize32 { 40 | font-size: 32rpx; 41 | } 42 | 43 | .fontsize30 { 44 | font-size: 30rpx; 45 | } 46 | 47 | .fontsize28 { 48 | font-size: 28rpx; 49 | } 50 | 51 | .color666 { 52 | color: #666; 53 | } 54 | 55 | .color999 { 56 | color: #999; 57 | } 58 | 59 | .colored { 60 | color: red; 61 | } 62 | 63 | .orignalpricethroughline { 64 | text-decoration: line-through 65 | } 66 | 67 | .bgcolor3fb207 { 68 | background: #3fb207; 69 | } 70 | 71 | .borderbottom { 72 | border-bottom: 1px solid #ccc; 73 | } 74 | 75 | .textright { 76 | text-align: right; 77 | } 78 | 79 | /*.container { 80 | height: 100%; 81 | display: flex; 82 | flex-direction: column; 83 | align-items: center; 84 | justify-content: space-between; 85 | padding: 200rpx 0; 86 | box-sizing: border-box; 87 | } 88 | 89 | .colore84e2a { 90 | color: #e84e2a; 91 | } 92 | 93 | .color999 { 94 | color: #999; 95 | } 96 | 97 | .fontsize30 { 98 | font-size: 30rpx; 99 | } 100 | 101 | .fontsize40 { 102 | font-size: 40rpx; 103 | } 104 | 105 | .margintop30 { 106 | margin-top: 30rpx; 107 | } 108 | 109 | 110 | 111 | .clearfloat:after { 112 | content: "."; 113 | display: block; 114 | height: 0; 115 | clear: both; 116 | visibility: hidden; 117 | } 118 | */ 119 | -------------------------------------------------------------------------------- /laravel/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "francescomalatesta/laravel-api-boilerplate-jwt", 3 | "description": "An API Boilerplate to create a ready-to-use REST API in seconds.", 4 | "keywords": ["laravel", "api", "boilerplate", "jwt", "auth", "rest"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=7.1.3", 9 | "barryvdh/laravel-cors": "0.11.*", 10 | "dingo/api": "2.0.0-alpha1", 11 | "fideloper/proxy": "^4.0", 12 | "guzzlehttp/guzzle": "^6.3", 13 | "laravel/framework": "5.6.*", 14 | "laravel/tinker": "^1.0", 15 | "nesbot/carbon": "^1.29", 16 | "qiniu/php-sdk": "^7.2", 17 | "tymon/jwt-auth": "1.0.*" 18 | }, 19 | "require-dev": { 20 | "filp/whoops": "^2.0", 21 | "fzaninotto/faker": "^1.4", 22 | "mockery/mockery": "^1.0", 23 | "nunomaduro/collision": "^2.0", 24 | "phpunit/phpunit": "^7.0" 25 | }, 26 | "autoload": { 27 | "classmap": [ 28 | "database" 29 | ], 30 | "psr-4": { 31 | "App\\": "app/" 32 | } 33 | }, 34 | "autoload-dev": { 35 | "psr-4": { 36 | "App\\": "tests/" 37 | } 38 | }, 39 | "scripts": { 40 | "post-root-package-install": [ 41 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 42 | ], 43 | "post-create-project-cmd": [ 44 | "php artisan key:generate", 45 | "php artisan jwt:secret -f" 46 | ], 47 | "post-install-cmd": [ 48 | "Illuminate\\Foundation\\ComposerScripts::postInstall" 49 | ], 50 | "post-update-cmd": [ 51 | "Illuminate\\Foundation\\ComposerScripts::postUpdate" 52 | ] 53 | }, 54 | "config": { 55 | "preferred-install": "dist", 56 | "sort-packages": true, 57 | "optimize-autoloader": true 58 | }, 59 | "minimum-stability": "dev", 60 | "prefer-stable": true 61 | } 62 | -------------------------------------------------------------------------------- /laravel/public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /laravel/app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::group([ 55 | 'middleware' => 'web', 56 | 'namespace' => $this->namespace, 57 | ], function ($router) { 58 | require base_path('routes/web.php'); 59 | }); 60 | } 61 | 62 | /** 63 | * Define the "api" routes for the application. 64 | * 65 | * These routes are typically stateless. 66 | * 67 | * @return void 68 | */ 69 | protected function mapApiRoutes() 70 | { 71 | Route::group([ 72 | 'middleware' => 'api', 73 | 'namespace' => $this->namespace, 74 | 'prefix' => 'api', 75 | ], function ($router) { 76 | require base_path('routes/api.php'); 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lavas/pages/settings/Settings.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 65 | 66 | 78 | -------------------------------------------------------------------------------- /laravel/app/User.php: -------------------------------------------------------------------------------- 1 | attributes['password'] = Hash::make($value); 41 | } 42 | 43 | /** 44 | * Get the identifier that will be stored in the subject claim of the JWT. 45 | * 46 | * @return mixed 47 | */ 48 | public function getJWTIdentifier() 49 | { 50 | return $this->getKey(); 51 | } 52 | 53 | /** 54 | * Return a key value array, containing any custom claims to be added to the JWT. 55 | * 56 | * @return array 57 | */ 58 | public function getJWTCustomClaims() 59 | { 60 | return []; 61 | } 62 | 63 | //level : 0 无效,10 普通user, 20 管理员 30 员工 64 | public function getUserLevel($userid){ 65 | $user = $this->find($userid); 66 | if($user){ 67 | return $user->userlevel; 68 | }else{ 69 | return 0; 70 | } 71 | } 72 | 73 | public function isAdmin($userid){ 74 | $userlevel = $this->getUserLevel($userid); 75 | if($userlevel==20){ 76 | return true; 77 | }else{ 78 | return false; 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lavas/components/UpdateToast.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 43 | 44 | 84 | -------------------------------------------------------------------------------- /laravel/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 60 | return response()->json(['error' => 'Unauthenticated.'], 401); 61 | } 62 | 63 | return redirect()->guest('login'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /wechat/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | var config = require('./config'); 3 | App({ 4 | onLaunch: function () { 5 | // 展示本地存储能力 6 | var logs = wx.getStorageSync('logs') || [] 7 | logs.unshift(Date.now()) 8 | wx.setStorageSync('logs', logs) 9 | var _this = this; 10 | // 登录 11 | wx.login({ 12 | success: res => { 13 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 14 | wx.request({ 15 | url: config.service.requestUrl+'/wxlogin/'+res.code, //仅为示例,并非真实的接口地址 16 | data: { 17 | }, 18 | header: { 19 | 'content-type': 'application/json' // 默认值 20 | }, 21 | method: 'GET', 22 | success: function(res) { 23 | console.log('wx.login---res==',res.data); 24 | 25 | if(res.data.status=='ok'){ 26 | var ret = res.data.ret; 27 | _this.globalData.iflogin = true; 28 | _this.globalData.apitoken = ret.token; 29 | _this.globalData.userInfo = ret.userinfo; 30 | if (this.apiloginCallback) { 31 | this.apiloginCallback() 32 | } 33 | }else{ 34 | _this.globalData.iflogin = false; 35 | _this.globalData.apitoken = ''; 36 | _this.globalData.userInfo = null; 37 | } 38 | } 39 | }) 40 | 41 | } 42 | }) 43 | // 获取用户信息 44 | wx.getSetting({ 45 | success: res => { 46 | if (res.authSetting['scope.userInfo']) { 47 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 48 | wx.getUserInfo({ 49 | success: res => { 50 | // 可以将 res 发送给后台解码出 unionId 51 | _this.globalData.wxuserInfo = res.userInfo 52 | 53 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 54 | // 所以此处加入 callback 以防止这种情况 55 | if (this.userInfoReadyCallback) { 56 | this.userInfoReadyCallback(res) 57 | } 58 | } 59 | }) 60 | } 61 | } 62 | }) 63 | }, 64 | globalData: { 65 | userInfo: null, 66 | wxuserInfo:null, 67 | apitoken: '', 68 | iflogin:false 69 | } 70 | }) 71 | -------------------------------------------------------------------------------- /laravel/config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => 's3', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'visibility' => 'public', 55 | ], 56 | 57 | 's3' => [ 58 | 'driver' => 's3', 59 | 'key' => 'your-key', 60 | 'secret' => 'your-secret', 61 | 'region' => 'your-region', 62 | 'bucket' => 'your-bucket', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /laravel/app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 29 | \App\Http\Middleware\EncryptCookies::class, 30 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 31 | \Illuminate\Session\Middleware\StartSession::class, 32 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 33 | \App\Http\Middleware\VerifyCsrfToken::class, 34 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 35 | ], 36 | 37 | 'api' => [ 38 | 'throttle:60,1', 39 | 'bindings', 40 | ], 41 | ]; 42 | 43 | /** 44 | * The application's route middleware. 45 | * 46 | * These middleware may be assigned to groups or used individually. 47 | * 48 | * @var array 49 | */ 50 | protected $routeMiddleware = [ 51 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 52 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 53 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 54 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 55 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 56 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 57 | 58 | 'jwt.auth' => \Tymon\JWTAuth\Http\Middleware\Authenticate::class, 59 | 'jwt.refresh' => RefreshToken::class, 60 | 'checkadmin' => \App\Http\Middleware\checkadmin::class 61 | ]; 62 | } 63 | -------------------------------------------------------------------------------- /laravel/config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Log Channels 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the log channels for your application. Out of 24 | | the box, Laravel uses the Monolog PHP logging library. This gives 25 | | you a variety of powerful log handlers / formatters to utilize. 26 | | 27 | | Available Drivers: "single", "daily", "slack", "syslog", 28 | | "errorlog", "custom", "stack" 29 | | 30 | */ 31 | 32 | 'channels' => [ 33 | 'stack' => [ 34 | 'driver' => 'stack', 35 | 'channels' => ['single'], 36 | ], 37 | 38 | 'single' => [ 39 | 'driver' => 'single', 40 | 'path' => storage_path('logs/laravel.log'), 41 | 'level' => 'debug', 42 | ], 43 | 44 | 'daily' => [ 45 | 'driver' => 'daily', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => 'debug', 48 | 'days' => 7, 49 | ], 50 | 51 | 'slack' => [ 52 | 'driver' => 'slack', 53 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 54 | 'username' => 'Laravel Log', 55 | 'emoji' => ':boom:', 56 | 'level' => 'critical', 57 | ], 58 | 59 | 'syslog' => [ 60 | 'driver' => 'syslog', 61 | 'level' => 'debug', 62 | ], 63 | 64 | 'errorlog' => [ 65 | 'driver' => 'errorlog', 66 | 'level' => 'debug', 67 | ], 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /lavas/pages/Userdetail/_id.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 57 | 58 | 78 | -------------------------------------------------------------------------------- /lavas/pages/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 57 | 58 | 78 | -------------------------------------------------------------------------------- /lavas/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- 1 | �,�LPe1diconfontRegularVersion 1.0iconfont �0GSUB����8BOS/2V�H�|Vcmapϳl���glyf������headh��6hhea���$hmtx����locan�� 2 | maxp] name>T�}|mpost�i���=���\��d1e_<� �$���$�������Q 3 | 4 | � 5 | ,DFLTliga��������2PfEd@x�����\�����,hb, 6 | h6x�<����x�<���� 4xx�<�<����v�����(1DP+"!'4.+!'#'!#".="264&3!26'.'54>;2S%� 7 | '��J�#>-�I,?2 w �m  8 | ���) 'LY a�4n% �� �?|  #$w�  &�w� 64&" &" 27 264'?* $ ���� $ *�� $ ++ $ �+ $ ��* $ ���� $ *�� $ �����-&$7>7462&'6765462#!"&463pd�ɚ�05��� ������ ���4g ����QHM�أ������ר74_��  � �$, 4? 9 | +G r *� � � � � �  10 | V &i 11 | Created by iconfont 12 | iconfontRegulariconfonticonfontVersion 1.0iconfontGenerated by svg2ttf from Fontello project.http://fontello.com 13 | Created by iconfont 14 | iconfontRegulariconfonticonfontVersion 1.0iconfontGenerated by svg2ttf from Fontello project.http://fontello.com 15 | xcloserefresh -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | broker()->reset( 18 | $this->credentials($request), function ($user, $password) { 19 | $this->reset($user, $password); 20 | } 21 | ); 22 | 23 | if($response !== Password::PASSWORD_RESET) { 24 | throw new HttpException(500); 25 | } 26 | 27 | if(!Config::get('boilerplate.reset_password.release_token')) { 28 | return response()->json([ 29 | 'status' => 'ok', 30 | ]); 31 | } 32 | 33 | $user = User::where('email', '=', $request->get('email'))->first(); 34 | 35 | return response()->json([ 36 | 'status' => 'ok', 37 | 'token' => $JWTAuth->fromUser($user) 38 | ]); 39 | } 40 | 41 | /** 42 | * Get the broker to be used during password reset. 43 | * 44 | * @return \Illuminate\Contracts\Auth\PasswordBroker 45 | */ 46 | public function broker() 47 | { 48 | return Password::broker(); 49 | } 50 | 51 | /** 52 | * Get the password reset credentials from the request. 53 | * 54 | * @param ResetPasswordRequest $request 55 | * @return array 56 | */ 57 | protected function credentials(ResetPasswordRequest $request) 58 | { 59 | return $request->only( 60 | 'email', 'password', 'password_confirmation', 'token' 61 | ); 62 | } 63 | 64 | /** 65 | * Reset the given user's password. 66 | * 67 | * @param \Illuminate\Contracts\Auth\CanResetPassword $user 68 | * @param string $password 69 | * @return void 70 | */ 71 | protected function reset($user, $password) 72 | { 73 | $user->password = $password; 74 | $user->save(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lavas/server.dev.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file server.dev.js 3 | * @author lavas 4 | */ 5 | 6 | var LavasCore = require('lavas-core-vue'); 7 | var express = require('express'); 8 | var stoppable = require('stoppable'); 9 | var proxy = require('http-proxy-middleware'); 10 | 11 | 12 | var configPath = './lavas.config.js'; 13 | // fix https://github.com/lavas-project/lavas/issues/50 14 | if (process.argv.length >= 3 && process.argv[2] !== 'dev') { 15 | configPath = process.argv[2]; 16 | } 17 | 18 | /** 19 | * API Proxy Configuration 20 | * 21 | * @see https://github.com/chimurai/http-proxy-middleware 22 | * @type {Object} 23 | */ 24 | var proxyTable = { 25 | // proxy table example 26 | // '/api': { 27 | // target: 'http://pwa.abc.com',//TODO 28 | // changeOrigin: true 29 | // } 30 | }; 31 | 32 | var port = process.env.PORT || 3000; 33 | var core = new LavasCore(__dirname); 34 | var app; 35 | var server; 36 | 37 | /** 38 | * start dev server 39 | */ 40 | function startDevServer() { 41 | app = express(); 42 | core.build() 43 | .then(function () { 44 | // API Proxying during development 45 | Object.keys(proxyTable).forEach(function (pattern) { 46 | app.use(pattern, proxy(proxyTable[pattern])); 47 | }); 48 | 49 | app.use(core.expressMiddleware()); 50 | 51 | /** 52 | * server.close() only stop accepting new connections, 53 | * we need to close existing connections with help of stoppable 54 | */ 55 | server = stoppable(app.listen(port, function () { 56 | console.log('server started at localhost:' + port); 57 | })); 58 | }) 59 | .catch(function (err) { 60 | console.log(err); 61 | }); 62 | } 63 | 64 | /** 65 | * every time lavas rebuild, stop current server first and restart 66 | */ 67 | core.on('rebuild', function () { 68 | core.close().then(function () { 69 | server.stop(); 70 | startDevServer(); 71 | }); 72 | }); 73 | 74 | core.init(process.env.NODE_ENV || 'development', true, {configPath}) 75 | .then(function () { 76 | startDevServer(); 77 | }); 78 | 79 | // catch promise error 80 | process.on('unhandledRejection', function (err) { 81 | console.warn(err); 82 | }); 83 | -------------------------------------------------------------------------------- /laravel/app/Api/V1/Controllers/UserController.php: -------------------------------------------------------------------------------- 1 | middleware('jwt.auth', []); 25 | $exceptapi=[ 26 | 'wxlogintest' 27 | ]; 28 | // $this->middleware('auth:api', ['except'=>$exceptapi]); 29 | $this->middleware('jwt.auth', ['except'=>$exceptapi]); 30 | 31 | $exceptapi_checkadmin=[ 32 | // 'wxlogintest' 33 | ]; 34 | $this->middleware('checkadmin', ['except'=>$exceptapi_checkadmin]); 35 | } 36 | 37 | /** 38 | * Get the authenticated User 39 | * 40 | * @return \Illuminate\Http\JsonResponse 41 | */ 42 | public function me() 43 | { 44 | return response()->json(Auth::guard()->user()); 45 | } 46 | 47 | public function updatebyuid(Request $request, $uid) 48 | { 49 | $cuser = User::find($uid); 50 | 51 | if(!$cuser){ 52 | return response()->json([ 53 | 'status' => 'ko', 54 | 'ret' => 'not find' 55 | ], 201); 56 | } 57 | 58 | $cuser->fill($request->all()); 59 | 60 | if($cuser->save()){ 61 | return response()->json([ 62 | 'status' => 'ok', 63 | 'ret' => $cuser 64 | ], 201); 65 | }else{ 66 | return response()->json([ 67 | 'status' => 'ko', 68 | 'ret' => 'save fail' 69 | ], 201); 70 | } 71 | } 72 | 73 | public function wxlogintest(JWTAuth $JWTAuth,$code) 74 | { 75 | // $user = User::find(1); 76 | // $newtoken = $JWTAuth->fromUser($user); 77 | // $ret['token'] = $newtoken; 78 | // $ret['expires_in'] = Auth::guard()->factory()->getTTL() * 600; 79 | 80 | return response()->json([ 81 | 'status' => 'ok' 82 | ], 201); 83 | } 84 | 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /lavas/assets/fonts/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by iconfont 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /wechat/pages/orderpurchase/orderpurchase.wxss: -------------------------------------------------------------------------------- 1 | .orderpurchase-address { 2 | border-bottom: 4rpx solid #3fb207; 3 | } 4 | 5 | .orderpurchase-address-part1 { 6 | width: 660rpx; 7 | } 8 | 9 | .orderpurchase-address-part1-contact { 10 | padding-bottom: 0; 11 | } 12 | 13 | .orderpurchase-address-part1-image { 14 | margin-right: 10rpx; 15 | vertical-align: middle; 16 | width: 50rpx; 17 | height: 50rpx; 18 | } 19 | 20 | .orderpurchase-address-part2 { 21 | width: 70rpx; 22 | text-align: right; 23 | padding: 10rpx; 24 | margin-top: 42rpx; 25 | } 26 | 27 | .orderpurchase-address-part2-image { 28 | width: 50rpx; 29 | height: 50rpx; 30 | } 31 | 32 | .orderpurchase-product { 33 | border-bottom: 1rpx solid #ccc; 34 | } 35 | 36 | .orderpurchase-price { 37 | display: inline-block; 38 | width: 320rpx; 39 | font-size: 34rpx; 40 | color: red; 41 | } 42 | 43 | .orderpurchase-number { 44 | display: inline-block 45 | } 46 | 47 | /*购物车*/ 48 | /*主容器*/ 49 | .stepper { 50 | width: 186rpx; 51 | height: 55rpx; 52 | /*给主容器设一个边框*/ 53 | border: 1px solid #ccc; 54 | border-radius: 10rpx; 55 | margin:0 auto; 56 | } 57 | 58 | /*加号和减号*/ 59 | .stepper text { 60 | width: 49rpx; 61 | line-height: 55rpx; 62 | text-align: center; 63 | float: left; 64 | } 65 | 66 | /*数值*/ 67 | .stepper input { 68 | width: 84rpx; 69 | height: 55rpx; 70 | float: left; 71 | margin: 0 auto; 72 | text-align: center; 73 | font-size: 26rpx; 74 | /*给中间的input设置左右边框即可*/ 75 | border-left: 1px solid #ccc; 76 | border-right: 1px solid #ccc; 77 | } 78 | 79 | /*普通样式*/ 80 | .stepper .normal{ 81 | color: black; 82 | } 83 | 84 | /*禁用样式*/ 85 | .stepper .disabled{ 86 | color: #ccc; 87 | } 88 | 89 | .float-btn { 90 | color: #888; 91 | position: fixed; 92 | /*display: flex; 93 | align-items: center; 94 | justify-content: right;*/ 95 | width: 100%; 96 | height: 100rpx; 97 | line-height: 100rpx; 98 | text-align: right; 99 | bottom: 0; 100 | right: 0; 101 | font-size: 28rpx; 102 | background: #fff; 103 | border-top: 2rpx solid #ccc; 104 | } 105 | 106 | .float-btn-part { 107 | padding: 20rpx 40rpx; 108 | } 109 | 110 | .float-btn-part-image { 111 | width: 50rpx; 112 | height: 50rpx; 113 | } 114 | 115 | .orderpurchase-paybtn { 116 | height: 120rpx; 117 | } 118 | 119 | .orderpurchase-paybtn-style { 120 | display: inline-block; 121 | width: 220rpx; 122 | text-align: center; 123 | color: #fff; 124 | margin-left: 20rpx; 125 | } 126 | -------------------------------------------------------------------------------- /wechat/utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | 13 | const formatNumber = n => { 14 | n = n.toString() 15 | return n[1] ? n : '0' + n 16 | } 17 | 18 | const ITEM_RETURN_VALUE ='itemReturnValue' 19 | 20 | var config = require('../config'); 21 | const app = getApp() 22 | 23 | 24 | function apiCommonPost(apipath, newdata,rcb){ 25 | var curapitoken=app.globalData.apitoken; 26 | wx.request({ 27 | url: config.service.requestUrl+apipath+'?token='+curapitoken, 28 | data: newdata, 29 | method:"POST", 30 | header: { 31 | 'content-type': 'application/json' // 默认值 32 | }, 33 | success: (res)=> { 34 | console.log("success===",res.data); 35 | if(res.data.status=='ko'){ 36 | wx.showToast({ 37 | title: '更新失败', 38 | icon: 'none', 39 | duration: 2000 40 | }) 41 | rcb(res.data,null) 42 | }else{ 43 | rcb(null,res.data) 44 | } 45 | }, 46 | fail: (res)=> { 47 | console.log("fail==",res.data); 48 | 49 | wx.showToast({ 50 | title: '网络异常,请刷新', 51 | icon: 'none', 52 | duration: 2000 53 | }) 54 | rcb(res.data,null) 55 | } 56 | }) 57 | } 58 | 59 | function apiCommonGet(apipath,rcb){// apipath example : /auth/me 60 | var curapitoken=app.globalData.apitoken; 61 | wx.request({ 62 | url: config.service.requestUrl+apipath+'?token='+curapitoken, 63 | data: {}, 64 | method:"GET", 65 | header: { 66 | 'content-type': 'application/json' // 默认值 67 | }, 68 | success: (res)=> { 69 | console.log("success===",res.data); 70 | if(res.data.error){ 71 | wx.showToast({ 72 | title: '从服务器获取失败', 73 | icon: 'none', 74 | duration: 2000 75 | }) 76 | rcb(res.data.error,null) 77 | }else{ 78 | rcb(null,res.data) 79 | } 80 | }, 81 | fail: (res)=> { 82 | console.log("fail==",res.data); 83 | 84 | wx.showToast({ 85 | title: '网络异常,请刷新', 86 | icon: 'none', 87 | duration: 2000 88 | }) 89 | rcb(res.data,null) 90 | } 91 | }) 92 | } 93 | 94 | 95 | module.exports = { 96 | formatTime: formatTime,apiCommonPost,apiCommonGet, 97 | ITEM_RETURN_VALUE: ITEM_RETURN_VALUE, 98 | } 99 | -------------------------------------------------------------------------------- /laravel/tests/Functional/Api/V1/Controllers/ResetPasswordControllerTest.php: -------------------------------------------------------------------------------- 1 | 'Test User', 22 | 'email' => 'test@email.com', 23 | 'password' => '123456' 24 | ]); 25 | $user->save(); 26 | 27 | DB::table('password_resets')->insert([ 28 | 'email' => 'test@email.com', 29 | 'token' => bcrypt('my_super_secret_code'), 30 | 'created_at' => Carbon::now() 31 | ]); 32 | } 33 | 34 | public function testResetSuccessfully() 35 | { 36 | $this->post('api/auth/reset', [ 37 | 'email' => 'test@email.com', 38 | 'token' => 'my_super_secret_code', 39 | 'password' => 'mynewpass', 40 | 'password_confirmation' => 'mynewpass' 41 | ])->assertJson([ 42 | 'status' => 'ok' 43 | ])->isOk(); 44 | } 45 | 46 | public function testResetSuccessfullyWithTokenRelease() 47 | { 48 | Config::set('boilerplate.reset_password.release_token', true); 49 | 50 | $this->post('api/auth/reset', [ 51 | 'email' => 'test@email.com', 52 | 'token' => 'my_super_secret_code', 53 | 'password' => 'mynewpass', 54 | 'password_confirmation' => 'mynewpass' 55 | ])->assertJsonStructure([ 56 | 'status', 57 | 'token' 58 | ])->assertJson([ 59 | 'status' => 'ok' 60 | ])->isOk(); 61 | } 62 | 63 | public function testResetReturnsProcessError() 64 | { 65 | $this->post('api/auth/reset', [ 66 | 'email' => 'unknown@email.com', 67 | 'token' => 'this_code_is_invalid', 68 | 'password' => 'mynewpass', 69 | 'password_confirmation' => 'mynewpass' 70 | ])->assertJsonStructure([ 71 | 'error' 72 | ])->assertStatus(500); 73 | } 74 | 75 | public function testResetReturnsValidationError() 76 | { 77 | $this->post('api/auth/reset', [ 78 | 'email' => 'test@email.com', 79 | 'token' => 'my_super_secret_code', 80 | 'password' => 'mynewpass' 81 | ])->assertJsonStructure([ 82 | 'error' 83 | ])->assertStatus(422); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lavas/assets/css/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; 3 | src: url('../fonts/iconfont.eot?t=1509868770941'); /* IE9*/ 4 | src: url('../fonts/iconfont.eot?t=1509868770941#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAWoAAsAAAAACCwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7kjGY21hcAAAAYAAAABnAAABnM+zbIdnbHlmAAAB6AAAAboAAAHw+/qCrWhlYWQAAAOkAAAAMQAAADYPaA/iaGhlYQAAA9gAAAAgAAAAJAfdA4VobXR4AAAD+AAAABAAAAAQD+n//2xvY2EAAAQIAAAACgAAAAoBbgCsbWF4cAAABBQAAAAfAAAAIAETAF1uYW1lAAAENAAAAUUAAAJtPlT+fXBvc3QAAAV8AAAALAAAAD3BaZjseJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/sU4gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVDw7yNzwv4EhhnkmQwNQmBEkBwAzaA1IeJzFkMENwCAIRT9iG9N0lB6bnpymp47gei7DGhbQixP4zRP4IWIAsAFg5VIiQB8Iplddcp9xuB/xaJ30BI1FstTWpsxE3pE8C/Yy7VgmWjd61un3PSrbdxnoFyV3bK9SO+AfrE8TZwB4nG1Pv2/TUBC+e46f45LnkPf8I7GTJrZTGxoagevYAyJZGACBBGJiQkhITCC2LEhkqVQkBjYECz+lQvkX8g+wIrVhLKJ/AlK3Z+yycjrd6ft03919oAIUv5Sl0gYB5+ASXIXbAEhHGBikh36cjskILV+1HNNQ4jD2tTAYK1fQCahpJ1kaOVSjTTRwHbf9JIvHJMZJOiWXMbF7iB3Pvcs3ulx5hWvteH1H3iAf0eqH3eZ0S16/MDOTgajPG5x3OH9Zp6paJ6TWNPCxY+uqvkblZ7XpWsv+edLHRid2b95jA48/2E2f9DYcHXGxQOENjL1Zy22V+cy1Be9oZ1m97bJwaOL8+ExbNHrRbygDq6LMyQl4ADqWzweajlHppFxV2cl1rDzFZIabzB0yeSAP2NBluCkPK4wjHJ3ixb8uD/8/V90qimK3Bsob2CpBNNQocexaPsU8zRLboqBFEGc8z2rO5JRpmTT0gyjNtpWnD+X3t6+fX5xg6+veD4V7QpdHq5U80sny3XtMH/EuF0yeGJwbZPHizrVb8uenD/t2789+Ra3ksapid/UFaZ7e3/nGhGAFMFGq4C+oUmPgAAB4nGNgZGBgAOIUg89z4/ltvjJwszCAwDWVp49g9P///ztYGJhnArkcDEwgUQBqDw2GAAAAeJxjYGRgYG7438AQw8Lw/z8DAwsDA1AEBbAAAHXbBGsEAAAAA+kAAAQAAAAEAP//AAAAAAB2AKwA+AAAeJxjYGRgYGBhCGRgZQABJiDmAkIGhv9gPgMAERIBcQB4nGWPTU7DMBCFX/oHpBKqqGCH5AViASj9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxjYGKAAC4G7ICFkYmRmZGFkZWBsYI1OSe/OJW9KDWtKLU4g4EBADoVBa0=') format('woff'), 6 | url('../fonts/iconfont.ttf?t=1509868770941') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('../fonts/iconfont.svg?t=1509868770941#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family: "iconfont" !important; 12 | font-size: 16px; 13 | font-style: normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-close:before { 19 | content: "\e63c"; 20 | } 21 | 22 | .icon-refresh:before { 23 | content: "\e6c1"; 24 | } 25 | -------------------------------------------------------------------------------- /wechat/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ productTitle }} 10 | 11 | 12 | {{ groupData }} 13 | 14 | 15 | 16 | 17 | 距离团购结束 18 | 19 | 20 | 48时21分46秒 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | {{ groupTips }} 37 | 38 | 39 | {{ groupSubTips }} 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 订单 54 | 55 | 56 | 57 | 我的 58 | 59 | 60 | 61 | 62 | 63 | 75 | -------------------------------------------------------------------------------- /laravel/config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /wechat/pages/productdetail/productdetail.wxss: -------------------------------------------------------------------------------- 1 | .productdetail-part1-swiper { 2 | height: 400rpx; 3 | } 4 | 5 | .productdetailswiperimage { 6 | width: 100%; 7 | height: 400rpx; 8 | } 9 | 10 | .productdetail-part2-title { 11 | width: 200rpx; 12 | } 13 | 14 | .productdetail-part3-grouproduct-image { 15 | width: 150rpx; 16 | height: 150rpx; 17 | } 18 | 19 | .productdetail-part3-grouproduct-price text { 20 | padding: 10rpx 10rpx 0 0; 21 | } 22 | 23 | .productdetail-part4 { 24 | 25 | } 26 | 27 | .productdetail-consulticon { 28 | border-radius: 50%; 29 | } 30 | 31 | .productdetail-consultname { 32 | width: 400rpx; 33 | } 34 | 35 | .productdetail-consultdata { 36 | width: 158rpx; 37 | text-align: right; 38 | } 39 | 40 | .productdetail-adminreply { 41 | width: 700rpx; 42 | background: #F7F8F7; 43 | margin: 0 auto; 44 | font-size: 32rpx; 45 | } 46 | 47 | .productdetail-subreply-style { 48 | padding: 20rpx 40rpx; 49 | } 50 | 51 | .home-recom{ 52 | margin-top: 6%; 53 | background-color: #fff; 54 | } 55 | .home-recom .home2{ 56 | display: block; 57 | margin: 10px 10px; 58 | line-height: 50px; 59 | position: relative; 60 | text-align: center; 61 | line-height: 40px; 62 | margin-bottom: 0; 63 | } 64 | .home-recom .home2:after{ 65 | content: ''; 66 | position: absolute; 67 | left: 0; 68 | top: 50%; 69 | width: 100%; 70 | height: 1px; 71 | background: rgba(213,213,213,0.4); 72 | } 73 | .home-recom .home2 .preview{ 74 | font-size:24px; 75 | color:#666; 76 | -webkit-tap-highlight-color: transparent; 77 | position:relative; 78 | display:inline-block; 79 | background: #fff; 80 | padding:0 10px; 81 | z-index:1; 82 | } 83 | 84 | .index-part1-over { 85 | background: #e5246d; 86 | padding: 10rpx 20rpx; 87 | color: #fff; 88 | } 89 | 90 | .index-part1-overtime { 91 | padding-top: 16rpx; 92 | } 93 | 94 | .input_null{ 95 | color: #C9C9C9; 96 | } 97 | 98 | .release{ 99 | display: flex; 100 | align-items: flex-end; /*底部对齐*/ 101 | justify-content: space-between; /*两端对齐*/ 102 | box-sizing: border-box; 103 | position: fixed; 104 | left: 0; 105 | bottom: 0; 106 | width: 100%; 107 | padding: 18rpx 0 18rpx 30rpx; 108 | background-color: #F7F8F7; 109 | font-size: 28rpx; 110 | z-index: 999; 111 | } 112 | .release .text{ 113 | width: 604rpx; 114 | min-height: 34rpx; 115 | max-height: 102rpx; /*最多显示三行*/ 116 | border-width: 15rpx 20rpx; /*使用padding与预期留白不一致,故使用border*/ 117 | border-style: solid; 118 | border-color: #ffffff; 119 | line-height: 34rpx; 120 | font-size: 28rpx; 121 | background-color: #ffffff; 122 | border-radius: 4rpx; 123 | } 124 | .release .submit{ 125 | width: 116rpx; 126 | height: 64rpx; 127 | line-height: 64rpx; 128 | text-align: center; 129 | color: #66CC00; 130 | } 131 | -------------------------------------------------------------------------------- /laravel/app/WinXinRefund.php: -------------------------------------------------------------------------------- 1 | openid = $openid; 16 | $this->outTradeNo = $outTradeNo; 17 | $this->totalFee = $totalFee; 18 | $this->outRefundNo = $outRefundNo; 19 | $this->refundFee = $refundFee; 20 | } 21 | public function refund(){ 22 | //对外暴露的退款接口 23 | $result = $this->wxrefundapi(); 24 | return $result; 25 | } 26 | private function wxrefundapi(){ 27 | //通过微信api进行退款流程 28 | 29 | $parma = array( 30 | 'appid'=> $this->APPID, 31 | 'mch_id'=> $this->MCHID, 32 | 'nonce_str'=> $this->createNoncestr(), 33 | 'out_refund_no'=> $this->outRefundNo, 34 | 'out_trade_no'=> $this->outTradeNo, 35 | 'total_fee'=> $this->totalFee, 36 | 'refund_fee'=> $this->refundFee, 37 | 'op_user_id' => $this->opUserId, 38 | ); 39 | $parma['sign'] = $this->getSign($parma); 40 | 41 | $xmldata = $this->arrayToXml($parma); 42 | $xmlresult = $this->postXmlSSLCurl($xmldata,'https://api.mch.weixin.qq.com/secapi/pay/refund'); 43 | 44 | $result = $this->xmlToArray($xmlresult); 45 | return $result; 46 | } 47 | //需要使用证书的请求 48 | function postXmlSSLCurl($xml,$url,$second=30) 49 | { 50 | $ch = curl_init(); 51 | //超时时间 52 | curl_setopt($ch,CURLOPT_TIMEOUT,$second); 53 | //这里设置代理,如果有的话 54 | //curl_setopt($ch,CURLOPT_PROXY, '8.8.8.8'); 55 | //curl_setopt($ch,CURLOPT_PROXYPORT, 8080); 56 | curl_setopt($ch,CURLOPT_URL, $url); 57 | curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE); 58 | curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE); 59 | //设置header 60 | curl_setopt($ch,CURLOPT_HEADER,FALSE); 61 | //要求结果为字符串且输出到屏幕上 62 | curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); 63 | //设置证书 64 | //使用证书:cert 与 key 分别属于两个.pem文件 65 | //默认格式为PEM,可以注释 66 | curl_setopt($ch,CURLOPT_SSLCERTTYPE,'PEM'); 67 | curl_setopt($ch,CURLOPT_SSLCERT, $this->SSLCERT_PATH); 68 | //默认格式为PEM,可以注释 69 | curl_setopt($ch,CURLOPT_SSLKEYTYPE,'PEM'); 70 | curl_setopt($ch,CURLOPT_SSLKEY, $this->SSLKEY_PATH); 71 | //post提交方式 72 | curl_setopt($ch,CURLOPT_POST, true); 73 | curl_setopt($ch,CURLOPT_POSTFIELDS,$xml); 74 | $data = curl_exec($ch); 75 | //返回结果 76 | if($data){ 77 | curl_close($ch); 78 | return $data; 79 | } 80 | else { 81 | $error = curl_errno($ch); 82 | echo "curl出错,错误码:$error"."
"; 83 | curl_close($ch); 84 | return false; 85 | } 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /lavas/core/spa.html.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | << for (var jsFilePath of htmlWebpackPlugin.files.js) { >> 19 | 20 | << } >> 21 | << for (var cssFilePath of htmlWebpackPlugin.files.css) { >> 22 | << if (htmlWebpackPlugin.options.config.enableAsyncCSS) { >> 23 | 24 | << } else { >> 25 | 26 | << } >> 27 | << } >> 28 | << if (htmlWebpackPlugin.options.config.enableAsyncCSS) { >> 29 | 30 | << } >> 31 | 32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /laravel/config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /lavas/components/ProgressBar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 88 | 89 | 102 | -------------------------------------------------------------------------------- /laravel/resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 78 | @endif 79 | 80 |
81 |
82 | Laravel 83 |
84 | 85 | 92 |
93 |
94 | 95 | 96 | -------------------------------------------------------------------------------- /laravel/routes/api.php: -------------------------------------------------------------------------------- 1 | version('v1', function (Router $api) { 9 | $api->group(['prefix' => 'auth'], function(Router $api) { 10 | // $api->post('signup', 'App\\Api\\V1\\Controllers\\SignUpController@signUp'); 11 | // $api->post('login', 'App\\Api\\V1\\Controllers\\LoginController@login'); 12 | 13 | // $api->post('recovery', 'App\\Api\\V1\\Controllers\\ForgotPasswordController@sendResetEmail'); 14 | // $api->post('reset', 'App\\Api\\V1\\Controllers\\ResetPasswordController@resetPassword'); 15 | 16 | $api->post('logout', 'App\\Api\\V1\\Controllers\\LogoutController@logout'); 17 | // $api->post('refresh', 'App\\Api\\V1\\Controllers\\RefreshController@refresh'); 18 | // $api->get('me', 'App\\Api\\V1\\Controllers\\UserController@me'); 19 | 20 | 21 | }); 22 | //user info 23 | $api->get('wxlogin/{code}', 'App\\Api\\V1\\Controllers\\WXRouterController@wxlogin'); 24 | $api->post('user/updatebyuid/{uid}', 'App\\Api\\V1\\Controllers\\UserController@updatebyuid'); 25 | $api->get('me', 'App\\Api\\V1\\Controllers\\UserController@me'); 26 | 27 | 28 | //qiniu 29 | $api->get('qiniu/uptoken', 'App\\Api\\V1\\Controllers\\qiniuController@uptoken'); 30 | 31 | //PC login 32 | $api->get('getwxqrcode', 'App\\Api\\V1\\Controllers\\WXRouterController@getwxqrcode'); 33 | $api->get('checkwxqrcode/{scene}', 'App\\Api\\V1\\Controllers\\WXRouterController@checkwxqrcode'); 34 | $api->get('permitwxqrcode/{scene}', 'App\\Api\\V1\\Controllers\\WXRouterController@permitwxqrcode'); 35 | $api->get('rejectwxqrcode/{scene}', 'App\\Api\\V1\\Controllers\\WXRouterController@rejectwxqrcode'); 36 | $api->get('pccheckwxqrcode/{scene}', 'App\\Api\\V1\\Controllers\\WXRouterController@PC_checkwxqrcode'); 37 | 38 | //weixin pay 39 | $api->get('wxpay/getprepay', 'App\\Api\\V1\\Controllers\\WXRouterController@predopay'); 40 | $api->get('wxpay/dorefund', 'App\\Api\\V1\\Controllers\\WXRouterController@dowxrefund'); 41 | 42 | 43 | $api->get('wxlogintest/{code}', 'App\\Api\\V1\\Controllers\\UserController@wxlogintest'); 44 | 45 | $api->group(['middleware' => 'jwt.auth'], function(Router $api) { 46 | $api->get('protected', function() { 47 | return response()->json([ 48 | 'message' => 'Access to protected resources granted! You are seeing this text as you provided the token correctly.' 49 | ]); 50 | }); 51 | 52 | $api->get('refresh', [ 53 | 'middleware' => 'jwt.refresh', 54 | function() { 55 | return response()->json([ 56 | 'message' => 'By accessing this endpoint, you can refresh your access token at each request. Check out this response headers!' 57 | ]); 58 | } 59 | ]); 60 | }); 61 | 62 | $api->get('hello', function() { 63 | return response()->json([ 64 | 'message' => 'This is a simple example of item returned by your APIs. Everyone can see it.' 65 | ]); 66 | }); 67 | }); 68 | -------------------------------------------------------------------------------- /wechat/pages/orderpurchase/orderpurchase.js: -------------------------------------------------------------------------------- 1 | //获取应用实例 2 | const app = getApp() 3 | 4 | Page({ 5 | data: { 6 | // input默认是1 7 | num: 1, 8 | // 使用data数据对象设置样式名 9 | minusStatus: 'disabled', 10 | buyerName: '', 11 | buyerPhonenumber: '', 12 | addressIcon: '/images/address.png', 13 | // buyerAddress: '广东省深圳市xxxxx', 14 | addressArrowRight: '/images/arrowright.png', 15 | productName: '山东红富士', 16 | productPrice: '¥5.2', 17 | productTotalPrice: '¥28.8', 18 | isExtraPay: '免运费', 19 | region: ['广东省', '深圳市', '龙岗区'], 20 | customItem: '全部', 21 | detailAddressValue: '' 22 | }, 23 | 24 | onLoad: function(options) { 25 |   // 生命周期函数--监听页面加载 26 | // console.log("test onLoad"); 27 | }, 28 | 29 | onReady: function() { 30 |    // 生命周期函数--监听页面初次渲染完成 31 |    // console.log("test onReady"); 32 |   }, 33 | 34 |   onShow: function() { 35 |   // 生命周期函数--监听页面显示 36 |   // console.log("test onShow"); 37 | }, 38 | 39 | onHide:function() { 40 |    // 生命周期函数--监听页面隐藏 41 |     // console.log("test onHide"); 42 |   }, 43 | 44 |   onUnload: function() { 45 |    // 生命周期函数--监听页面卸载 46 |     // console.log("test onUnload"); 47 |   }, 48 | 49 | /* 点击减号 */ 50 | bindMinus: function() { 51 | var num = this.data.num; 52 | // 如果大于1时,才可以减 53 | if (num > 1) { 54 | num --; 55 | } 56 | // 只有大于一件的时候,才能normal状态,否则disable状态 57 | var minusStatus = num <= 1 ? 'disabled' : 'normal'; 58 | // 将数值与状态写回 59 | this.setData({ 60 | num: num, 61 | minusStatus: minusStatus 62 | }); 63 | }, 64 | /* 点击加号 */ 65 | bindPlus: function() { 66 | var num = this.data.num; 67 | // 不作过多考虑自增1 68 | num ++; 69 | // 只有大于一件的时候,才能normal状态,否则disable状态 70 | var minusStatus = num < 1 ? 'disabled' : 'normal'; 71 | // 将数值与状态写回 72 | this.setData({ 73 | num: num, 74 | minusStatus: minusStatus 75 | }); 76 | }, 77 | 78 | /* 输入框事件 */ 79 | bindManual: function(e) { 80 | var num = e.detail.value; 81 | // 将数值与状态写回 82 | this.setData({ 83 | num: num 84 | }); 85 | }, 86 | 87 | gotoPayment: function() { 88 | console.log('支付'); 89 | }, 90 | 91 | chooseAddress: function() { 92 | wx.navigateTo({ 93 | url: '/pages/addressmanager/addressmanager' 94 | }) 95 | }, 96 | 97 | bindRegionChange: function (e) { 98 | console.log('picker发送选择改变,携带值为', e.detail.value) 99 | this.setData({ 100 | region: e.detail.value 101 | }) 102 | }, 103 | 104 | inputReceiverName: function(e) { 105 | if (e && e.detail && e.detail.value) { 106 | this.setData({ 107 | buyerName: e.detail.value 108 | }) 109 | } 110 | }, 111 | 112 | inputReceiverContact: function(e) { 113 | if (e && e.detail && e.detail.value) { 114 | this.setData({ 115 | buyerPhonenumber: e.detail.value 116 | }) 117 | } 118 | }, 119 | 120 | inputDetailAddress: function(e) { 121 | // console.log(e.detail.value); 122 | if (e && e.detail && e.detail.value) { 123 | this.setData({ 124 | detailAddressValue: e.detail.value 125 | }) 126 | } 127 | } 128 | 129 | }) 130 | -------------------------------------------------------------------------------- /wechat/pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | motto: 'Hello World', 8 | userInfo: {}, 9 | hasUserInfo: false, 10 | canIUse: wx.canIUse('button.open-type.getUserInfo'), 11 | productImg: '/images/fruit.png', 12 | productTitle: '水果 6月1日推荐 抢购组合尾矿库扩扩多扩多', 13 | groupData: '抢购日期:6月1日-6月3日', 14 | groupTips: '这个季节吃什么呢?你想要吃什么我们就有什么', 15 | groupSubTips: '今日抢购开始,精选3款', 16 | fingerImage: '/images/index_finger.png', 17 | floatIcon1: '/images/order.png', 18 | floatIcon2: '/images/my.png', 19 | loginscene:'' 20 | }, 21 | //事件处理函数 22 | bindViewTap: function() { 23 | wx.navigateTo({ 24 | url: '../logs/logs' 25 | }) 26 | }, 27 | gopclogin: function (scene) { 28 | 29 | if(scene !=''){ 30 | wx.navigateTo({ 31 | url: '../pclogin/pclogin?scene='+scene 32 | }) 33 | } 34 | 35 | }, 36 | onLoad: function(options) { 37 |   // 生命周期函数--监听页面加载 38 | if(options && options.scene){ 39 | this.data.loginscene = options.scene; 40 | }else{ 41 | this.data.loginscene = ''; 42 | } 43 | app.apiloginCallback = () => { 44 | this.gopclogin(this.data.loginscene); 45 | } 46 | // console.log("test onLoad"); 47 | if (app.globalData.userInfo) { 48 | this.setData({ 49 | userInfo: app.globalData.userInfo, 50 | hasUserInfo: true 51 | }) 52 | this.gopclogin(this.data.loginscene); 53 | } else if (this.data.canIUse){ 54 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 55 | // 所以此处加入 callback 以防止这种情况 56 | app.userInfoReadyCallback = res => { 57 | this.setData({ 58 | wxuserInfo: res.userInfo, 59 | hasUserInfo: true 60 | }) 61 | } 62 | } else { 63 | // 在没有 open-type=getUserInfo 版本的兼容处理 64 | wx.getUserInfo({ 65 | success: res => { 66 | app.globalData.wxuserInfo = res.userInfo 67 | this.setData({ 68 | wxuserInfo: res.userInfo, 69 | hasUserInfo: true 70 | }) 71 | } 72 | }) 73 | } 74 | }, 75 | 76 | onReady: function() { 77 |    // 生命周期函数--监听页面初次渲染完成 78 |    // console.log("test onReady"); 79 |   }, 80 | 81 |   onShow: function() { 82 |   // 生命周期函数--监听页面显示 83 |   // console.log("test onShow"); 84 | }, 85 | 86 | onHide:function() { 87 |    // 生命周期函数--监听页面隐藏 88 |     // console.log("test onHide"); 89 |   }, 90 | 91 |   onUnload: function() { 92 |    // 生命周期函数--监听页面卸载 93 |     // console.log("test onUnload"); 94 |   }, 95 | 96 | gotoProductDetail: function() { 97 | wx.navigateTo({ 98 | url: '/pages/productdetail/productdetail' 99 | }) 100 | }, 101 | 102 | gotoPersonalCenter: function() { 103 | wx.navigateTo({ 104 | url: '/pages/personalcenter/personalcenter' 105 | }) 106 | }, 107 | 108 | gotoOrderManager: function() { 109 | wx.navigateTo({ 110 | url: '/pages/ordermanager/ordermanager' 111 | }) 112 | }, 113 | 114 | getUserInfo: function(e) { 115 | console.log(e) 116 | app.globalData.userInfo = e.detail.userInfo 117 | this.setData({ 118 | userInfo: e.detail.userInfo, 119 | hasUserInfo: true 120 | }) 121 | } 122 | }) 123 | -------------------------------------------------------------------------------- /wechat/pages/orderpurchase/orderpurchase.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 收货地址:{{region[0]}}{{region[1]}}{{region[2]}} 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | {{ productName }} 43 | 44 | 45 | {{ productPrice }} 46 | 47 | 48 | 49 | 50 | - 51 | 52 | 53 | 54 | + 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 合计金额: 65 | {{ productTotalPrice }} 66 | ({{ isExtraPay }}) 67 | 立即支付 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /lavas/store/basic.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | export const state = () => ({ 4 | global_token:'', 5 | token: { 6 | newtoken: '无', 7 | oldtoken: '无' 8 | }, 9 | logininfo: { 10 | name:'', 11 | password:'', 12 | response: {} 13 | }, 14 | header: {show: true}, 15 | global_userinfo: { 16 | 'isLogin': false, 17 | 'name':'', 18 | 'id': 0 19 | }, 20 | homeNavValue:'dashboard', 21 | global_loginqrcode : '', 22 | global_pcloginret : {}, 23 | global_pclogin_scene:'' 24 | }); 25 | 26 | export const mutations = { 27 | SET_NAV_VALUE(state, navValue) { 28 | state.homeNavValue = navValue; 29 | }, 30 | SET_GLOBAL_TOKEN(state, token) { 31 | state.global_token = token; 32 | }, 33 | SET_LOGIN_INFO(state,logininfo){ 34 | state.logininfo = logininfo; 35 | }, 36 | SET_USER_INFO(state,userinfo){ 37 | state.global_userinfo = userinfo; 38 | }, 39 | SET_USER_LOGIN_QRCODE(state,qrcode){ 40 | state.global_loginqrcode = qrcode; 41 | }, 42 | SET_USER_LOGIN_QRCODE_RET(state,qrcoderet){ 43 | state.global_pcloginret = qrcoderet; 44 | }, 45 | SET_USER_LOGIN_QRCODE_SCENE(state,qrcodescene){ 46 | state.global_pclogin_scene = qrcodescene; 47 | } 48 | }; 49 | export const actions = { 50 | async setHomeNavValue({ commit, state },params){ 51 | // console.log('params===',params); 52 | commit('SET_NAV_VALUE', params); 53 | }, 54 | async PC_qrcode_login({commit}, params){//params == { token, page} 55 | let scene = params.scene; 56 | //API URL api.abc.com 57 | let url = 'https://api.abc.com/api/pccheckwxqrcode/'+scene; 58 | 59 | axios.get(url) 60 | .then(function (listresult) { 61 | if(listresult.data && listresult.data.result=='ok'){ 62 | var ret = listresult.data.ret 63 | commit('SET_GLOBAL_TOKEN',ret.token) 64 | 65 | var newuserinfo=ret.userinfo; 66 | newuserinfo['isLogin'] = true; 67 | commit('SET_USER_INFO',newuserinfo) 68 | }else{ 69 | if(listresult.data && listresult.data.ret){ 70 | var ret = listresult.data.ret//errorcode是状态 71 | commit('SET_USER_LOGIN_QRCODE_RET',ret) 72 | } 73 | 74 | commit('SET_GLOBAL_TOKEN','') 75 | } 76 | }) 77 | .catch(function (error) { 78 | console.log(error); 79 | commit('SET_GLOBAL_TOKEN','') 80 | }); 81 | }, 82 | async getUserloginqrcode({commit}, params){ 83 | commit('SET_USER_LOGIN_QRCODE','') 84 | // let new_token = params.token; 85 | let url = 'https://api.abc.com/api/getwxqrcode'; 86 | 87 | axios.get(url) 88 | .then(function (result) { 89 | if(result.data && result.data.result=='ok'){ 90 | var qrcode = result.data.ret; 91 | var qrcodescene = result.data.scene; 92 | // console.log("qrcode==",qrcode); 93 | commit('SET_USER_LOGIN_QRCODE',qrcode) 94 | commit('SET_USER_LOGIN_QRCODE_SCENE',qrcodescene) 95 | } 96 | // var qrcode = result.data 97 | 98 | // commit('SET_USER_LOGIN_QRCODE',qrcode) 99 | }) 100 | .catch(function (error) { 101 | console.log(error); 102 | }); 103 | } 104 | 105 | 106 | }; 107 | -------------------------------------------------------------------------------- /wechat/pages/productdetail/productdetail.js: -------------------------------------------------------------------------------- 1 | //获取应用实例 2 | const app = getApp() 3 | 4 | Page({ 5 | data: { 6 | imgUrls:[ 7 | '/images/fruit.png', 8 | '/images/productdetail1.jpeg', 9 | '/images/productdetail2.jpeg' 10 | ], 11 | indicatorDots: true, 12 | autoplay: true, 13 | interval: 5000, 14 | duration: 1300, 15 | bg: '#C79C77', 16 | Height: "", //这是swiper要动态设置的高度属性 17 | // releaseFocus: false, 18 | productDetailTitle: '有机食物大集合有机食物大集合有机食物大集合有机食物大集合有机食物大集合', 19 | productDetailOverDesc: '距离抢购结束', 20 | productDetailOverTime: '48时21分46秒', 21 | productDetailFeeTips: '满69免运费,不满69加收6元配送费,小区内全部免费送货上门', 22 | productDetailRefundTips: '下单后,如果未成团时间结束后,系统安排退款', 23 | groupProductimage: '/images/fruit.png', 24 | groupProductTitle: '山西红富士苹果', 25 | groupProductSubTitle: '又脆又甜又香', 26 | groupProductOriginalPrice: '3.6', 27 | groupProductCommonPrice: '7.2', 28 | groupProductNumber: '100', 29 | groupProductSoldProgress: '20', 30 | consultTitle: '咨询/评价', 31 | productDetailConsultIcon: '/images/fruit.png', 32 | productDetailConsultName: '不告诉你我是谁', 33 | productDetailConsultData: '2018-06-19', 34 | productDetailConsultContent: '你这个苹果咋样啊斤斤计较军军军军军军军啦啦啦啦啦啦啦啦啦啦啦啦啦啊', 35 | productDetailAdminReply: '300块一斤', 36 | productDetailInputContent: '', 37 | productDetailBtnFlag: false 38 | }, 39 | 40 | onLoad: function(options) { 41 |   // 生命周期函数--监听页面加载 42 | // console.log("test onLoad"); 43 | }, 44 | 45 | onReady: function() { 46 |    // 生命周期函数--监听页面初次渲染完成 47 |    // console.log("test onReady"); 48 |   }, 49 | 50 |   onShow: function() { 51 |   // 生命周期函数--监听页面显示 52 |   // console.log("test onShow"); 53 | }, 54 | 55 | onHide:function() { 56 |    // 生命周期函数--监听页面隐藏 57 |     // console.log("test onHide"); 58 |   }, 59 | 60 |   onUnload: function() { 61 |    // 生命周期函数--监听页面卸载 62 |     // console.log("test onUnload"); 63 |   }, 64 | 65 | toupper:function(){ 66 | console.log("触发了toupper"); 67 | }, 68 | 69 | // imgHeight:function(e){ 70 | // console.log(e); 71 | // var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度 72 | // console.log('winWid:' + winWid); 73 | // var imgh=e.detail.height;//图片高度 74 | // console.log('imgh:' + imgh); 75 | // var imgw=e.detail.width;//图片宽度 76 | // console.log('imgw:' + imgw); 77 | // var swiperH=winWid*imgh/imgw + "px"//等比设置swiper的高度。 即 屏幕宽度 / swiper高度 = 图片宽度 / 图片高度 ==》swiper高度 = 屏幕宽度 * 图片高度 / 图片宽度 78 | // console.log('swiperH:' + swiperH); 79 | // this.setData({ 80 | // Height:swiperH//设置高度 81 | // }) 82 | // }, 83 | 84 | textareaInputMethods: function(e) { 85 | console.log(e); 86 | if (e.detail && e.detail.value) { 87 | this.setData({ 88 | productDetailBtnFlag: true, 89 | productDetailInputContent: e.detail.value 90 | }) 91 | } else { 92 | this.setData({ 93 | productDetailBtnFlag: false, 94 | productDetailInputContent: '' 95 | }) 96 | } 97 | }, 98 | 99 | sendConsultMessageMethod: function() { 100 | console.log('发送评论'); 101 | this.setData({ 102 | productDetailInputContent: '', 103 | productDetailBtnFlag: false 104 | }) 105 | }, 106 | 107 | purchaseMethod: function() { 108 | console.log('购买'); 109 | wx.navigateTo({ 110 | url: '/pages/orderpurchase/orderpurchase' 111 | }) 112 | } 113 | 114 | }) 115 | -------------------------------------------------------------------------------- /wechat/pages/modifyradiooperation/modifyradiooperation.js: -------------------------------------------------------------------------------- 1 | //modifyPersonalInfo.js 2 | 3 | // 引入配置 4 | var config = require('../../config'); 5 | var Util = require('../../utils/util.js'); 6 | //获取应用实例 7 | const app = getApp() 8 | 9 | Page({ 10 | data: { 11 | radioItems: [ 12 | { name: '男', value: '男' }, 13 | { name: '女', value: '女' }, 14 | { name: '保密', value: '保密'} 15 | ], 16 | fromKeyword: '', 17 | optionItems: '' 18 | }, 19 | 20 | onLoad: function(options) { 21 |   // 生命周期函数--监听页面加载 22 |   console.log("test onLoad",options); 23 | if (options && options.from) { 24 | console.log("test onLoad--options.query.from----",options.from); 25 | 26 | // var sexs = [ 27 | // { name: '女', value: '女' }, 28 | // { name: '男', value: '男' }, 29 | // { name: '保密', value: '保密' } 30 | // ] 31 | var sexs = this.data.radioItems 32 | for (var i = 0; i < sexs.length; i++) { 33 | if (sexs[i].value === options.orgvalue) { 34 | sexs[i].checked = true 35 | // sexs[i].style.display ='block' 36 | }else{ 37 | sexs[i].checked = false 38 | } 39 | } 40 | 41 | console.log(sexs); 42 | 43 | this.setData({ 44 | fromKeyword: options.from, 45 | optionItems: sexs, 46 | radioItems: sexs 47 | }) 48 | } 49 | }, 50 | 51 |   onReady: function() { 52 |    // 生命周期函数--监听页面初次渲染完成 53 | //    console.log("test onReady"); 54 |   }, 55 | 56 |   onShow: function() { 57 |   // 生命周期函数--监听页面显示 58 | //   console.log("test onShow"); 59 |   }, 60 | 61 |   onHide:function() { 62 |    // 生命周期函数--监听页面隐藏 63 | //     console.log("test onHide"); 64 |   }, 65 | 66 |   onUnload: function() { 67 |    // 生命周期函数--监听页面卸载 68 | //     console.log("test onUnload"); 69 |   }, 70 | 71 |   onPullDownRefresh: function() { 72 |    // 页面相关事件处理函数--监听用户下拉动作 73 | //     console.log("test onPullDownRefresh"); 74 |   }, 75 | 76 |   onReachBottom: function() { 77 |    // 页面上拉触底事件的处理函数 78 | //     console.log("test onReachBottom"); 79 |   }, 80 | 81 | radioChange: function (e) { 82 | console.log('radio发生change事件,携带value值为:', e.detail.value); 83 | 84 | var radioItems = this.data.radioItems; 85 | for (var i = 0, len = radioItems.length; i < len; ++i) { 86 | radioItems[i].checked = radioItems[i].value == e.detail.value; 87 | } 88 | 89 | console.log(radioItems); 90 | this.setData({ 91 | radioItems: radioItems 92 | }); 93 | 94 | wx.setStorageSync(Util.ITEM_RETURN_VALUE, { 95 | value: e.detail.value, 96 | ifchange: 1, 97 | tag: this.data.fromKeyword 98 | }) 99 | }, 100 | 101 | // radioChange: function(e) { 102 | // console.log('radio发生change事件,携带value值为:', e.detail.value) 103 | // if (this.data.inputValue === e.detail.value) { 104 | // for (var i = 0; i < this.data.optionItems.length; i++) { 105 | // console.log(this.data.optionItems[i].value); 106 | // if (this.data.optionItems[i].value === e.detail.value) { 107 | // this.data.optionItems[i].checked = 'true' 108 | // } else { 109 | // this.data.optionItems[i].checked = 'false' 110 | // } 111 | // } 112 | // } 113 | // 114 | // wx.setStorageSync(Util.ITEM_RETURN_VALUE, { 115 | // value: e.detail.value, 116 | // ifchange: 1, 117 | // tag: this.data.fromKeyword 118 | // }) 119 | // } 120 | 121 | }) 122 | --------------------------------------------------------------------------------