Skip to content

Commit

Permalink
chore:升级脚手架
Browse files Browse the repository at this point in the history
  • Loading branch information
HopeFE committed Sep 10, 2018
1 parent 86b5ed8 commit 44ba14c
Show file tree
Hide file tree
Showing 25 changed files with 3,052 additions and 1,028 deletions.
2 changes: 1 addition & 1 deletion .wepycache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/wepy.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy-async-function/index.js":1487759227000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/app.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/page.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/component.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/event.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/base.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/util.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/mixin.js":1519786782000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy-async-function/global.js":1487760749000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/promise-polyfill/promise.js":1511627065000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/regenerator-runtime/runtime.js":1493390741000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/native.js":1519786782000}
{"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/wepy.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy-async-function/index.js":1523427808000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/app.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/page.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/component.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/event.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/base.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/util.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/mixin.js":499162500000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy-async-function/global.js":1517302333000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/promise-polyfill/promise.js":1511627065000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/regenerator-runtime/runtime.js":1493390741000,"/Users/liyingkun/Documents/WEAPP/WEAPP_GNB_PRIMARY/node_modules/wepy/lib/native.js":499162500000}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
├── components # 组件
├── pages # 页面
├── init # 配置信息
├── camera # 拍错题
├── workbook # 记错题
├── papaer # 资源
├── statistics # 错题本
Expand Down
42 changes: 24 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
{
"name": "gnb_primary_math",
"version": "1.0.0",
"name": "gnb_primary",
"version": "3.5.0",
"description": "",
"main": "dist/app.js",
"scripts": {
"dev": "wepy build --watch",
"build": "cross-env NODE_ENV=production wepy build --no-cache",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint --ext .js,.wpy src --fix"
},
"author": "Hope",
"license": "MIT",
"dependencies": {
"wepy": "^1.7.1",
"wepy-async-function": "^1.4.4",
"wepy-compiler-sass": "^1.3.12"
"wepy": "^1.7.0",
"wepy-async-function": "^1.4.6"
},
"devDependencies": {
"babel-eslint": "^7.2.1",
"babel-eslint": "^9.0.0",
"babel-plugin-syntax-export-extensions": "^6.13.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"cross-env": "^5.1.3",
"eslint": "^3.18.0",
"eslint-config-standard": "^7.1.0",
"eslint-friendly-formatter": "^2.0.7",
"eslint-plugin-html": "^2.0.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^2.0.1",
"wepy-compiler-babel": "^1.5.1",
"wepy-compiler-less": "^1.3.10",
"wepy-eslint": "^1.5.3"
"babel-preset-env": "^1.7.0",
"cross-env": "^5.2.0",
"eslint": "^5.5.0",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-html": "^4.0.5",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"wepy-compiler-babel": "^1.5.3",
"wepy-compiler-less": "^1.3.12",
"wepy-compiler-sass": "^1.3.12",
"wepy-compiler-stylus": "^1.3.12",
"wepy-eslint": "^1.5.4",
"wepy-plugin-imagemin": "^1.5.3",
"wepy-plugin-uglifyjs": "^1.3.7"
}
}
4 changes: 2 additions & 2 deletions src/pages/camera/index.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
}
/** 上传图片 */
_uploadFile (file) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.uploadFile({
url: 'https://api.guinaben.com/upload/img',
Expand Down Expand Up @@ -146,7 +146,7 @@
}
/** 上传错题 */
_uploadWrong (url, id) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/camera/upload',
Expand Down
6 changes: 3 additions & 3 deletions src/pages/my/email.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}
/** 绑定用户 */
_bindUser (user) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/member/v2/bind',
Expand All @@ -125,7 +125,7 @@
}
/** 设置用户信息 */
_setUserEmail (email) {
wepy.showLoading({title: '提交中'})
wepy.showLoading({ title: '提交中' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/member/info',
Expand Down Expand Up @@ -169,7 +169,7 @@
type: this.tag
}
}
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: url,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/my/info.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

/** 设置用户信息 */
_setUserInfo (user) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/member/info',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/my/pay.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class MyPay extends wepy.page {

/** 购买VIP */
_orderVip (id) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://wechat.guinaben.com/mini-program/pay',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/my/vip.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/** 购买VIP */
_orderVip (id) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://wechat.guinaben.com/mini-program/pay',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/resource/chengPin.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
_download (item) {
// 不是会员跳转到VIP购买, 是跳转到下载
if (Number(wepy.getStorageSync('gnb_primary_user').vip)) {
wepy.navigateTo({url: `/pages/my/email?id=${item.id}&type=resource&tag=2`})
wepy.navigateTo({ url: `/pages/my/email?id=${item.id}&type=resource&tag=2` })
} else {
wepy.navigateTo({url: `/pages/my/vip`})
wepy.navigateTo({ url: `/pages/my/vip` })
}
},
/** 选择标签 */
Expand Down
8 changes: 4 additions & 4 deletions src/pages/resource/fenCeng.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
_download (item) {
// 不是会员跳转到VIP购买, 是跳转到下载
if (Number(wepy.getStorageSync('gnb_primary_user').vip)) {
wepy.navigateTo({url: `/pages/my/email?id=${item.id}&type=resource&tag=6`})
wepy.navigateTo({ url: `/pages/my/email?id=${item.id}&type=resource&tag=6` })
} else {
wepy.navigateTo({url: `/pages/my/vip`})
wepy.navigateTo({ url: `/pages/my/vip` })
}
},
/** 章节名称切换 */
Expand All @@ -110,7 +110,7 @@
// 无更多数据或者正在加载则返回
if (this.loading || this.nomore) return
this.loading = true
this._getResourceList(this.offset, {tag: this.tag, chapterId: this.chapterId}).then((res) => {
this._getResourceList(this.offset, { tag: this.tag, chapterId: this.chapterId }).then((res) => {
this.loading = false
this.list = this.list.concat(res.list)
this.offset = res.offset
Expand Down Expand Up @@ -160,7 +160,7 @@
this.offset = ''
this.nomore = false
try {
let result = await this._getResourceList(this.offset, {tag: this.tag, chapterId: this.chapterId})
let result = await this._getResourceList(this.offset, { tag: this.tag, chapterId: this.chapterId })
this.loading = false
this.list = result.list
this.offset = result.offset
Expand Down
6 changes: 3 additions & 3 deletions src/pages/resource/index.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

methods = {
_intoPage (value) {
wepy.navigateTo({url: `/pages/resource/${value}?textbookId=${this.textbook}`})
wepy.navigateTo({ url: `/pages/resource/${value}?textbookId=${this.textbook}` })
},
/** 教材切换 */
async textbookChange (id) {
Expand Down Expand Up @@ -190,7 +190,7 @@

/** 更改用户教材信息 */
_setUserInfoOtherTextbook (id, subject) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/member/info',
Expand All @@ -214,7 +214,7 @@

/** 更改用户科目信息 */
_setUserInfoSubject (subject) {
wepy.showLoading({title: '请稍候'})
wepy.showLoading({ title: '请稍候' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/member/info',
Expand Down
8 changes: 4 additions & 4 deletions src/pages/resource/zhuanTi.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
_download (item) {
// 不是会员跳转到VIP购买, 是跳转到下载
if (Number(wepy.getStorageSync('gnb_primary_user').vip)) {
wepy.navigateTo({url: `/pages/my/email?id=${item.id}&type=resource&tag=7`})
wepy.navigateTo({ url: `/pages/my/email?id=${item.id}&type=resource&tag=7` })
} else {
wepy.navigateTo({url: `/pages/my/vip`})
wepy.navigateTo({ url: `/pages/my/vip` })
}
},
/** 章节名称切换 */
Expand All @@ -99,7 +99,7 @@
// 无更多数据或者正在加载则返回
if (this.loading || this.nomore) return
this.loading = true
this._getResourceList(this.offset, {tag: this.tag, chapterId: this.chapterId}).then((res) => {
this._getResourceList(this.offset, { tag: this.tag, chapterId: this.chapterId }).then((res) => {
this.loading = false
this.list = this.list.concat(res.list)
this.offset = res.offset
Expand Down Expand Up @@ -150,7 +150,7 @@
this.offset = ''
this.nomore = false
try {
let result = await this._getResourceList(this.offset, {tag: this.tag, chapterId: this.chapterId})
let result = await this._getResourceList(this.offset, { tag: this.tag, chapterId: this.chapterId })
this.loading = false
this.list = result.list
this.offset = result.offset
Expand Down
84 changes: 42 additions & 42 deletions src/pages/statistics/correct.wpy
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
<style lang="less" scoped>
.container{
position: relative;
color: #c69c6d;
}
.correct_name{
position:absolute;
top: 36%;
width:100%;
}
.correct_content{
position:absolute;
top: 52%;
left: 8%;
width:85%;
}
.correct_date{
position:absolute;
top: 72%;
left: 14%;
}
.correct_app{
position:absolute;
top: 72%;
left: 71%;
}
.share_button {
position: fixed;
background:#eac363;
color:#fff;
font-size: 30rpx;
height: 130rpx;
line-height: 130rpx;
width: 130rpx;
border-radius: 50%;
bottom: 5%;
right: 8%;
box-shadow: 5rpx 5rpx 14rpx #eac363;
text-align: center;
}
</style>
<template>
<view class="container">
<view class="correct_name zan-center zan-font-22 zan-font-bold">{{name}}</view>
Expand Down Expand Up @@ -78,7 +37,7 @@
}

async onLoad(options) {
wx.setNavigationBarTitle({title: options.name})
wx.setNavigationBarTitle({ title: options.name })
this.result = await this._getContent(options.id)
this.name = wepy.getStorageSync('gnb_primary_user').name
this.$apply()
Expand All @@ -93,3 +52,44 @@
}
}
</script>
<style lang="less" scoped>
.container{
position: relative;
color: #c69c6d;
}
.correct_name{
position:absolute;
top: 36%;
width:100%;
}
.correct_content{
position:absolute;
top: 52%;
left: 8%;
width:85%;
}
.correct_date{
position:absolute;
top: 72%;
left: 14%;
}
.correct_app{
position:absolute;
top: 72%;
left: 71%;
}
.share_button {
position: fixed;
background:#eac363;
color:#fff;
font-size: 30rpx;
height: 130rpx;
line-height: 130rpx;
width: 130rpx;
border-radius: 50%;
bottom: 5%;
right: 8%;
box-shadow: 5rpx 5rpx 14rpx #eac363;
text-align: center;
}
</style>
8 changes: 4 additions & 4 deletions src/pages/statistics/error.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class StatisticsError extends wepy.page {
async _reviseChange (e) {
console.log(e.target.val)
console.log(e.target.dataset.current)
let index = e.target.dataset.current // 获取当前索引
let index = e.target.dataset.current // 获取当前索引
let status = Boolean(Number(e.detail.value)).toString()
this._setRevise(this.id, this.error[index], status).then((res) => {
this.error[index].count = res.count
Expand Down Expand Up @@ -139,7 +139,7 @@ export default class StatisticsError extends wepy.page {
},
/** 查看大图 */
_preview (url) {
wepy.previewImage({current: `${url}-primaryError`, urls: this.imgs})
wepy.previewImage({ current: `${url}-primaryError`, urls: this.imgs })
},
/** 下载错题 */
_download () {
Expand Down Expand Up @@ -182,7 +182,7 @@ export default class StatisticsError extends wepy.page {

/** 设置错题订正状态 */
_setRevise (chapterId, item, status) {
wx.showLoading({title: '提交中'})
wx.showLoading({ title: '提交中' })
return new Promise((resolve, reject) => {
wepy.request({
url: 'https://api.guinaben.com/textbook/statistics/revise',
Expand All @@ -206,7 +206,7 @@ export default class StatisticsError extends wepy.page {

async onLoad(options) {
this.scrollHeight = this.$parent.globalData.system.windowHeight - 30
wx.setNavigationBarTitle({title: options.name})
wx.setNavigationBarTitle({ title: options.name })
// 开始加载数据
try {
this.id = options.id
Expand Down
Loading

0 comments on commit 44ba14c

Please sign in to comment.