Browse Source

no message

master
xpz2018 4 years ago
parent
commit
964be5be81
15 changed files with 243 additions and 5 deletions
  1. 2
      .gitignore
  2. 8
      package.json
  3. 2
      project.config.json
  4. 27
      src/app.config.ts
  5. BIN
      src/assets/images/icon_post_blue.png
  6. BIN
      src/assets/images/icon_post_gray.png
  7. BIN
      src/assets/images/icon_self_blue.png
  8. BIN
      src/assets/images/icon_self_gray.png
  9. BIN
      src/assets/images/icon_trans_blue.png
  10. BIN
      src/assets/images/icon_trans_gray.png
  11. BIN
      src/assets/raw/ding.mp3
  12. 4
      src/pages/home/index.config.ts
  13. 101
      src/pages/home/index.vue
  14. 3
      src/pages/moment/index.config.ts
  15. 101
      src/pages/moment/index.vue

2
.gitignore

@ -0,0 +1,2 @@
dist/
node_modules/

8
package.json

@ -33,7 +33,7 @@
"Android >= 4.1",
"ios >= 8"
],
"author": "",
"author": "xpz2018 <107107461@qq.com>",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.7.7",
@ -50,8 +50,8 @@
"vue": "^3.0.0"
},
"devDependencies": {
"@qnjs/cli": "0.1.9",
"@babel/core": "^7.8.0",
"@qnjs/cli": "0.1.9",
"@tarojs/cli": "3.3.2",
"@tarojs/mini-runner": "3.3.2",
"@tarojs/plugin-sass": "^2.2.10",
@ -71,5 +71,7 @@
"typescript": "^3.7.0",
"vue-loader": "^16.0.0-beta.8",
"webpack-bundle-analyzer": "^4.4.2"
}
},
"main": "index.js",
"repository": "http://git.qniao.cn/libo/ztb-client-weapp.git"
}

2
project.config.json

@ -2,7 +2,7 @@
"miniprogramRoot": "./dist",
"projectname": "ztb-client-mini",
"description": "",
"appid": "touristappid",
"appid": "wx7a4a8415e6821108",
"setting": {
"urlCheck": true,
"es6": false,

27
src/app.config.ts

@ -1,7 +1,32 @@
export default {
pages: [
'pages/index/index'
'pages/index/index',
'pages/moment/index',
'pages/home/index'
],
tabBar: {
selectedColor: '#007AFF',
list: [
{
pagePath: 'pages/moment/index',
text: '情报',
iconPath: './assets/images/icon_post_gray.png',
selectedIconPath: './assets/images/icon_post_blue.png'
},
{
pagePath: 'pages/index/index',
text: '交易',
iconPath: './assets/images/icon_trans_gray.png',
selectedIconPath: './assets/images/icon_trans_blue.png'
},
{
pagePath: 'pages/home/index',
text: '我的',
iconPath: './assets/images/icon_self_gray.png',
selectedIconPath: './assets/images/icon_self_blue.png'
}
]
},
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',

BIN
src/assets/images/icon_post_blue.png

Before After
Width: 50  |  Height: 50  |  Size: 704 B

BIN
src/assets/images/icon_post_gray.png

Before After
Width: 50  |  Height: 50  |  Size: 692 B

BIN
src/assets/images/icon_self_blue.png

Before After
Width: 50  |  Height: 50  |  Size: 736 B

BIN
src/assets/images/icon_self_gray.png

Before After
Width: 50  |  Height: 50  |  Size: 711 B

BIN
src/assets/images/icon_trans_blue.png

Before After
Width: 50  |  Height: 50  |  Size: 651 B

BIN
src/assets/images/icon_trans_gray.png

Before After
Width: 50  |  Height: 50  |  Size: 562 B

BIN
src/assets/raw/ding.mp3

4
src/pages/home/index.config.ts

@ -0,0 +1,4 @@
export default {
navigationBarTitleText: '我的',
navigationStyle: 'custom'
}

101
src/pages/home/index.vue

@ -0,0 +1,101 @@
<template>
<div class="p-1 index-page">
<qn-title required type="form" size="md" title="测试@qn/c中的qn-title组件"></qn-title>
<div class="select-text bg-gradient-to-r from-green-400 to-blue-500">
{{ msg }}
</div>
<div class="flex justify-between m-1">
<nut-button type="info" shape="square" @click="testLogin">测试登录</nut-button>
<nut-button type="primary" @click="testMenu">测试登录后的接口</nut-button>
</div>
</div>
</template>
<script>
import { reactive, toRefs, ref, onMounted, onUnmounted } from 'vue'
import Taro, { eventCenter, getCurrentInstance } from '@tarojs/taro'
import { type } from '@qnjs/shared'
import { random, debounce } from 'lodash-es'
import {
yyt_ob_CfobAdminApi_getLoginInfoUsingGET
} from '@/qnApi'
import Qn from '@qnjs/qn'
const { log } = console
export default {
name: 'Home',
//
mounted() {
log('home>>>mounted')
},
onReady() {
log('home onReady')
},
onShow() {
log('home onShow')
},
onHide() {
log('home onHide')
},
methods: {
testLogin() {
Qn.$http({
url: `/cloud-factory-operation-backend/admin/login`,
data: {
username: 'liuji@qniao.cn',
password: 'qn123456',
$configs: {
$isFormData: true,
$isWithTotalHttpResponse: true
}
},
method: 'POST'
}).then(res => {
if (res && res.statusCode === 200 && res.data && res.data.code === 200) {
const token = res.header.authorization
Qn.setToken(token)
}
})
}
},
setup() {
const msg = ref('测试 tailwind')
//
// onMounted(function() {
// eventCenter.once(getCurrentInstance().router.onShow, function() {
// log('index onShow from eventCenter: ', )
// })
// eventCenter.once(getCurrentInstance().router.onReady, function() {
// log('index onReady from eventCenter: ', )
// })
// eventCenter.once(getCurrentInstance().router.onHide, function() {
// log('index onHide from eventCenter: ', )
// })
// })
log('use type in @qn/shared example: ', type(1))
log('use random in lodash-es example: ', random(0, 100))
onUnmounted(() => {
log('index onUnmounted')
})
// 1s
const testMenu = debounce(yyt_ob_CfobAdminApi_getLoginInfoUsingGET, 1000)
return {
msg,
testMenu
}
}
}
</script>
<style lang="scss">
.index-page {
padding: 0px;
}
</style>

3
src/pages/moment/index.config.ts

@ -0,0 +1,3 @@
export default {
navigationBarTitleText: '情报'
}

101
src/pages/moment/index.vue

@ -0,0 +1,101 @@
<template>
<div class="p-1 index-page">
<qn-title required type="form" size="md" title="测试@qn/c中的qn-title组件"></qn-title>
<div class="select-text bg-gradient-to-r from-green-400 to-blue-500">
{{ msg }}
</div>
<div class="flex justify-between m-1">
<nut-button type="info" shape="square" @click="testLogin">测试登录</nut-button>
<nut-button type="primary" @click="testMenu">测试登录后的接口</nut-button>
</div>
</div>
</template>
<script>
import { reactive, toRefs, ref, onMounted, onUnmounted } from 'vue'
import Taro, { eventCenter, getCurrentInstance } from '@tarojs/taro'
import { type } from '@qnjs/shared'
import { random, debounce } from 'lodash-es'
import {
yyt_ob_CfobAdminApi_getLoginInfoUsingGET
} from '@/qnApi'
import Qn from '@qnjs/qn'
const { log } = console
export default {
name: 'QnUI',
//
mounted() {
log('mounted')
},
onReady() {
log('index onReady')
},
onShow() {
log('index onShow')
},
onHide() {
log('index onHide')
},
methods: {
testLogin() {
Qn.$http({
url: `/cloud-factory-operation-backend/admin/login`,
data: {
username: 'liuji@qniao.cn',
password: 'qn123456',
$configs: {
$isFormData: true,
$isWithTotalHttpResponse: true
}
},
method: 'POST'
}).then(res => {
if (res && res.statusCode === 200 && res.data && res.data.code === 200) {
const token = res.header.authorization
Qn.setToken(token)
}
})
}
},
setup() {
const msg = ref('测试 tailwind')
//
// onMounted(function() {
// eventCenter.once(getCurrentInstance().router.onShow, function() {
// log('index onShow from eventCenter: ', )
// })
// eventCenter.once(getCurrentInstance().router.onReady, function() {
// log('index onReady from eventCenter: ', )
// })
// eventCenter.once(getCurrentInstance().router.onHide, function() {
// log('index onHide from eventCenter: ', )
// })
// })
log('use type in @qn/shared example: ', type(1))
log('use random in lodash-es example: ', random(0, 100))
onUnmounted(() => {
log('index onUnmounted')
})
// 1s
const testMenu = debounce(yyt_ob_CfobAdminApi_getLoginInfoUsingGET, 1000)
return {
msg,
testMenu
}
}
}
</script>
<style lang="scss">
.index-page {
padding: 0px;
}
</style>
Loading…
Cancel
Save