Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cg_approveApp_2023
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
cg_approveApp_2023
Commits
cb06428c
You need to sign in or sign up before continuing.
Commit
cb06428c
authored
Oct 08, 2020
by
miko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aa
parent
9b1124a0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
310 deletions
+138
-310
.idea/vcs.xml
.idea/vcs.xml
+6
-0
src/app.wpy
src/app.wpy
+1
-1
src/assets/close.png
src/assets/close.png
+0
-0
src/components/counter.wpy
src/components/counter.wpy
+0
-77
src/components/group.wpy
src/components/group.wpy
+0
-41
src/components/groupitem.wpy
src/components/groupitem.wpy
+0
-28
src/pages/index.wpy
src/pages/index.wpy
+131
-163
No files found.
.idea/vcs.xml
0 → 100644
View file @
cb06428c
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
src/app.wpy
View file @
cb06428c
...
...
@@ -2,9 +2,9 @@
.container {
height: 100%;
display: flex;
overflow-y: scroll;
flex-direction: column;
align-items: center;
box-sizing: border-box;
background: #F5F5F5;
}
page{
...
...
src/assets/close.png
0 → 100644
View file @
cb06428c
1.35 KB
src/components/counter.wpy
deleted
100644 → 0
View file @
9b1124a0
<style lang="less">
.counter {
text-align: left;
font-size: 12px;
}
.count {
font-size: 18px;
font-weight: bold;
&.red {
color: red;
}
&.green {
color: green;
}
}
</style>
<template>
<div class="counter {{style}}">
<button @tap="plus" size="mini"> + </button>
<button @tap="minus" size="mini"> - </button>
<button @tap="increment" size="mini"> INCREMENT </button>
<button @tap="decrement" size="mini"> DECREMENT </button>
<button @tap="incrementAsync" size="mini"> ASYNC INCREMENT </button>
<span class="count"> {{counter}} </span>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '../store';
import { mapState, mapActions } from '@wepy/x';
wepy.component({
store,
props: {
num: {
type: [Number, String],
coerce: function (v) {
return +v
},
default: 50
}
},
computed: mapState([ 'counter' ]),
events: {
'index-broadcast': (...args) => {
let $event = args[args.length - 1]
console.log(`${this.$name} receive ${$event.name} from ${$event.source.$name}`)
}
},
watch: {
num (curVal, oldVal) {
console.log(`旧值:${oldVal},新值:${curVal}`)
}
},
methods: {
...mapActions([
'increment',
'decrement',
'incrementAsync'
]),
plus () {
this.num = this.num + 1
console.log('plus tapped in component');
this.$emit('index-emit', this.num);
},
minus () {
this.num = this.num - 1
console.log(this.$name + ' minus tap')
}
}
})
</script>
src/components/group.wpy
deleted
100644 → 0
View file @
9b1124a0
<style type="less">
.group {}
</style>
<template>
<div class="group">
<span class="id">{{grouplist.id}}. </span>
<span class="name" @tap="tap">{{grouplist.name}}</span>
<div>
<div v-for="item in grouplist.list">
<groupitem :gitem="item"></groupitem>
</div>
</div>
</div>
</template>
<script>
import wepy from '@wepy/core';
//import GroupItem from './groupitem'
wepy.component({
props: {
grouplist: {},
index: {}
},
methods: {
tap () {
this.grouplist.name = `Parent Random(${Math.random()})`
let groups = this.$parent.$children.filter(com => com.$is === 'components/group');
let index = groups.indexOf(this);
console.log(`Clicked Group ${index}, ID is ${this.grouplist.id}`)
}
}
});
</script>
<config>
{
usingComponents: {
'groupitem': './groupitem'
}
}
</config>
src/components/groupitem.wpy
deleted
100644 → 0
View file @
9b1124a0
<style type="less">
.groupitem {
}
</style>
<template>
<div class="groupitem">
--<span class="id">{{gitem.childid}}.</span>
<span class="name" @tap="tap"> {{gitem.childname}}</span>
</div>
</template>
<script>
import wepy from '@wepy/core';
wepy.component({
props: {
gitem: {}
},
data: {
},
methods: {
tap () {
this.gitem.childname = `Child Random(${Math.random()})`
let index = this.$parent.$children.indexOf(this);
console.log(`Item ${index}, ID is ${this.gitem.childid}`)
}
}
});
</script>
src/pages/index.wpy
View file @
cb06428c
<style lang="less">
.panel-title {
font-size: 36rpx;
color: black;
}
.main{
flex: 1;
overflow-y: scroll;
width: 100%;
}
.header {
width: 100%;
...
...
@@ -46,26 +50,47 @@
border: 1px solid #EBEBEB;
border-radius: 7px;
background: #FFFFFFDB;
height: 228rpx;
min-
height: 228rpx;
width: 678rpx;
margin-left: 36rpx;
margin-top: -80rpx;
max-height: 366rpx;
.inner {
border-radius: 7px;
box-sizing: border-box;
background: white;
padding: 0 24rpx;
align-items: center;
margin-top: 80rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
height: 148rpx;
flex-direction: column;
min-height: 148rpx;
.inner-left {
.inner-top{
min-height: 148rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-right: 24rpx;
.scroll-container{
display: flex;
flex-direction: row;
align-items: center;
overflow-y: scroll;
min-height: 148rpx;
max-height: 200rpx;
}
}
.parse-result{
box-sizing: border-box;
justify-content: space-between;
border-top: 1px solid #EBEBEB;
display: flex;
flex-direction: row;
align-items: center;
margin: 0 24rpx;
height: 90rpx;
}
image {
...
...
@@ -73,14 +98,34 @@
width: 36rpx
}
}
.input-null{
font-size: 33rpx;
margin-left:25rpx;
width: 553rpx;border: none
}
.placeholder{
color: black!important;
}
.input-notnull{
min-height: 148rpx;
max-height: 170rpx;
padding: 15rpx 13rpx;
align-self: flex-start;
font-size: 28rpx;
height: 33rpx;
width: 553rpx;border: none
}
}
.bt-submit{
margin-left: 214rpx;
color: white!important;
margin-top: 43rpx;
height: 91rpx!important;
width: 322rpx;
}
.address {
margin-left: 36rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
...
...
@@ -119,6 +164,8 @@
}
.remark {
margin-left: 36rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
...
...
@@ -193,54 +240,76 @@ module.exports.getTime = getTime;
<template>
<div class="container" style="align-items: center">
<header background="#FE991B" title_text="捎带"/>
<div class="header pc">
<div class="inner">
<image class="avatar-small"></image>
<image class="avatar-big"></image>
<image class="avatar-small"></image>
<div class="main">
<div class="header pc">
<div class="inner">
<image class="avatar-small"></image>
<image class="avatar-big"></image>
<image class="avatar-small"></image>
</div>
</div>
</div>
<div class="message">
<div class="inner">
<div class="inner-left">
<input style="position: absolute;border: none"/>
<div style="width: 9rpx;height: 33rpx;" class="pc"/>
<span style="color: black;margin-left: 30rpx;font-size: 31rpx">粘贴短信或者识别截图</span>
<div class="message">
<div class="inner">
<div class="inner-top">
<div class="scroll-container">
<div v-if="!messageText" style="width: 9rpx;height: 40rpx;margin-top: -3rpx;align-self: center;margin-left: 24rpx" class="pc"/>
<textarea contenteditable="true" placeholder="粘贴短信或者识别截图"
auto-height="true"
placeholder-class="placeholder"
v-bind:value="messageText" @input="messageInputChange" class="{{messageText? 'input-notnull':'input-null'}}"/>
</div>
<img v-if="!messageText" src="@/assets/pic.png"/>
<img v-if="messageText" @tap="cleanMessage" src="@/assets/close.png"/>
</div>
<div class="parse-result" v-if="messageText">
<span style="font-size: 28rpx">识别结果</span>
<div>
<span>百事</span>
<span>213213</span>
</div>
<van-button round type="primary" size="small">确认</van-button>
</div>
</div>
<img src="@/assets/pic.png"/>
</div>
</div>
<div class="address">
<div class="top">
<span class="panel-title">送达宿舍</span>
</div>
<div class="bottom">
<div class="address-text">一号楼01层01号邹德宏邹德宏 15891396443</div>
<img src="@/assets/edit.png"/>
</div>
</div>
<div class="remark">
<div class="top">
<span class="panel-title">留言</span>
<div class="address">
<div class="top">
<span class="panel-title">送达宿舍</span>
</div>
<div class="bottom">
<div class="address-text">一号楼01层01号邹德宏邹德宏 15891396443</div>
<img src="@/assets/edit.png"/>
</div>
</div>
<div class="middle">
<div class="tag-uncheck">晚上再送</div>
<div class="tag-uncheck">我很着急</div>
<div class="tag-uncheck">请敲门</div>
<div class="tag-uncheck">易碎物品</div>
<div class="tag-uncheck">冷藏物品 请勿暴晒</div>
</div>
<div class="remark">
<div class="top">
<span class="panel-title">留言</span>
</div>
<div class="middle">
<div class="tag-uncheck">晚上再送</div>
<div class="tag-uncheck">我很着急</div>
<div class="tag-uncheck">请敲门</div>
<div class="tag-uncheck">易碎物品</div>
<div class="tag-uncheck">冷藏物品 请勿暴晒</div>
</div>
<div class="bottom">
<img src="@/assets/info.png"/>
<input placeholder="也可以填写其他留言"/>
<div class="bottom">
<img src="@/assets/info.png"/>
<input placeholder="也可以填写其他留言"/>
</div>
</div>
<van-button round custom-class="bt-submit pc">提 交</van-button>
</div>
<van-button round custom-class="bt-submit pc">提 交</van-button>
<!-- <button class="bt-submit pc">提 交</button>-->
</div>
</template>
...
...
@@ -261,73 +330,22 @@ wepy.page({
},
hooks: {
// Page 级别 hook, 只对当前 Page 的 setData 生效。
'before-setData': function(dirty) {
if (Math.random() < 0.2) {
console.log('setData canceled')
return false // Cancel setData
}
dirty.time = +new Date()
return dirty
}
//
//
Page 级别 hook, 只对当前 Page 的 setData 生效。
//
'before-setData': function(dirty) {
//
if (Math.random() < 0.2) {
//
console.log('setData canceled')
//
return false // Cancel setData
//
}
//
dirty.time = +new Date()
//
return dirty
//
}
},
mixins: [testMixin],
data: {
inputmodel: 'v-model',
mynum: 20,
userInfo: {
nickName: '加载中...'
},
currentTime: +new Date(),
setTimeoutTitle: '标题三秒后会被修改',
count: 0,
netrst: '',
groupList: [
{
id: 1,
name: '点击改变',
list: [
{
childid: '1.1',
childname: '子项,点我改变'
}, {
childid: '1.2',
childname: '子项,点我改变'
}, {
childid: '1.3',
childname: '子项,点我改变'
}
]
},
{
id: 2,
name: '点击改变',
list: [
{
childid: '2.1',
childname: '子项,点我改变'
}, {
childid: '2.2',
childname: '子项,点我改变'
}, {
childid: '2.3',
childname: '子项,点我改变'
}
]
},
{
id: 3,
name: '点击改变',
list: [
{
childid: '3.1',
childname: '子项,点我改变'
}
]
}
]
messageText: '',
showMessageParse: true
},
computed: {
...
...
@@ -338,56 +356,11 @@ wepy.page({
},
methods: {
handleViewTap() {
console.log('handleVieTap clicked')
},
tap() {
throw 'can not go here'
},
plus() {
this.mynum++
},
toast() {
let promise = this.$invoke('toast', 'show', {
title: '自定义标题',
img: 'https://raw.githubusercontent.com/kiinlam/wetoast/master/images/star.png'
})
promise.then((d) => {
console.log('toast done')
})
},
mixintap() {
console.log('do noting from ' + this.$is)
},
communicate() {
let counters = this.$children.filter((com) => com.$is === 'components/counter')
// Get children counter
counters[0].num++
counters[1].num--
eventHub.$emit('app-launch', { a: 1 }, { b: 2 })
},
request() {
let self = this
let i = 10
let map = ['MA==', 'MQo=', 'Mg==', 'Mw==', 'NA==', 'NQ==', 'Ng==', 'Nw==', 'OA==', 'OQ==']
while (i--) {
wx.request({
url: 'https://www.madcoder.cn/tests/sleep.php?time=1&t=css&c=' + map[i] + '&i=' + i,
success: function(d) {
if (d.statusCode !== 200) {
self.netrst += d.statusCode + '.'
} else {
self.netrst += d.data + '.'
}
}
})
}
cleanMessage() {
this.messageText = ''
},
counterEmit(num
) {
console.log(`${this.$is} receive event, the number is: ${num}`)
messageInputChange({$wx}
) {
this.messageText = $wx.detail.value
}
},
...
...
@@ -415,12 +388,7 @@ navigationBarBackgroundColor: "#45C9C3",
navigationBarTitleText: '小树懒捎带',
usingComponents: {
header: '~@/components/header',
panel: '~@/components/panel',
'van-button': 'module:@vant/weapp/lib/button',
counter: '~counter',
list: '../components/list',
group: '../components/group',
"slide-view": "module:miniprogram-slide-view",
'van-button': 'module:@vant/weapp/lib/button'
}
}
</config>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment