Browse Source

pages

master
1549469775 4 years ago
parent
commit
71854f5798
  1. 22
      cypress/integration/enesoon/login-page.js
  2. 24
      gulpfile.js/index.js
  3. 13
      package-lock.json
  4. 5
      package.json
  5. 2
      src/common/style.less
  6. 6
      src/html/__include/person.pug
  7. 8
      src/html/about.pug
  8. 1
      src/html/index.pug

22
cypress/integration/enesoon/login-page.js

@ -27,4 +27,26 @@ describe('The Home Page', () => {
expect(rep).to.have.property("message", '用户名非邮箱手机号')
})
})
// it('输入正确的账号密码', () => {
// cy.intercept(
// 'https://www.enesoon-saas-back-test.cn:8381/**/*',
// { middleware: true },
// (req) => {
// req.on('before:response', (res) => {
// // force all API responses to not be cached
// res.headers['cache-control'] = 'no-store'
// })
// }
// ).as('login');
// cy.get('body > uni-app > uni-page > uni-page-wrapper > uni-page-body > uni-view > uni-view:nth-child(2) > uni-view:nth-child(1) > uni-input > div > input')
// .type('xieyaxin@enesoon.net')
// cy.get('body > uni-app > uni-page > uni-page-wrapper > uni-page-body > uni-view > uni-view:nth-child(2) > uni-view:nth-child(2) > uni-input > div > input')
// .type('123456qaz')
// cy.get('.login').click()
// cy.wait("@login").its('response.body').should((rep) => {
// expect(rep).to.have.property("code", 1)
// expect(rep).to.have.property("message", '用户名非邮箱手机号')
// })
// })
})

24
gulpfile.js/index.js

@ -11,17 +11,21 @@ const browserSync = require('browser-sync').create();
const reload = browserSync.reload;
let srcPath = "src"
let distPath = "node_modules/.gcache"
// let distPath = "dist"
let isProd = process.env.NODE_ENV === "production"
let distPath = isProd?"dist":"node_modules/.gcache"
let pageName = "about"
/**
* 删除输出文件夹目录
*/
function remove() {
return del(['dist/**/*']);
return del([distPath+'/**/*']);
}
function removeStatic() {
return del(['dist/static/**/*']);
return del([distPath+'/static/**/*']);
}
const exculde = `!${srcPath}/**/__*/**`
@ -66,14 +70,14 @@ function pageFn(name="index") {
}
}
let task = series(remove,static, common, parallel(asset("index")),parallel(pageFn("index")))
/**
* 开发时监听
*/
function watchTask() {
browserSync.init({
startPath: `/${pageName}.html`,
server: {
baseDir: `./${distPath}`
baseDir: `./${distPath}`,
}
});
watch([`${srcPath}/static/**/*`], series(removeStatic, static))
@ -84,18 +88,18 @@ function watchTask() {
.on("add", reload)
.on("change", reload)
.on("unlink", reload)
watch([`${srcPath}/css/**/*`,`${srcPath}/js/**/*`], asset("index"))
watch([`${srcPath}/css/**/*`,`${srcPath}/js/**/*`], asset(pageName))
.on("add", reload)
.on("change", reload)
.on("unlink", reload)
watch([`${srcPath}/html/**/*`], pageFn("index"))
watch([`${srcPath}/html/**/*`], pageFn(pageName))
.on("add", reload)
.on("change", reload)
.on("unlink", reload)
}
exports.watch = series(task,watchTask)
exports.default = task
exports.watch = series(remove,static, common,parallel(asset(pageName)),parallel(pageFn(pageName)),watchTask)
exports.default = series(remove,static, common, parallel(asset("index"), asset("about")),parallel(pageFn("index"), pageFn("about")))
exports.index = series(remove, static, common, asset("index"), pageFn("index"))
exports.about = series(remove, static, common, asset("about"), pageFn("about"))

13
package-lock.json

@ -1519,6 +1519,15 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"cross-env": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.1"
}
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@ -2574,7 +2583,7 @@
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fsevents": {
@ -3226,7 +3235,7 @@
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",

5
package.json

@ -4,8 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "gulp watch",
"build": "gulp",
"dev": "cross-env NODE_ENV=development gulp watch",
"build": "cross-env NODE_ENV=production gulp",
"test": "cypress open"
},
"keywords": [],
@ -13,6 +13,7 @@
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.27.5",
"cross-env": "^7.0.3",
"cypress": "^8.3.1",
"gulp": "^4.0.2",
"gulp-inject": "^5.0.5"

2
src/common/style.less

@ -14,7 +14,7 @@ body{
.container{
margin: 0 auto;
width: 960px;
width: 700px;
}

6
src/html/__include/person.pug

@ -0,0 +1,6 @@
.userProfile.mb
.head 无极
img(src=avatarURL, alt="topuser", srcset="").avatar
.text
.userName 龙门客栈
.userDesc.over-ellipsis 白龙马,蹄儿朝西

8
src/html/about.pug

@ -0,0 +1,8 @@
//- 继承布局
extends __layout/layout.pug
block title
- var title = "关于"
block content
p 关于

1
src/html/index.pug

@ -29,7 +29,6 @@ block content
.text
.userName 龙门客栈
.userDesc.over-ellipsis 白龙马,蹄儿朝西
.line
.panel
h1 出师表

Loading…
Cancel
Save