Commit a32cd0f6 authored by wlxuqu's avatar wlxuqu

Merge branch 'yiruiwen' into dev

parents ae5aa52e 6336ffd9
...@@ -86,7 +86,11 @@ Vue.use(uView); ...@@ -86,7 +86,11 @@ Vue.use(uView);
// pages.json // pages.json
{ {
"easycom": { "easycom": {
// 下载安装的方式需要前面的"@/",npm安装的方式无需"@/"
// 下载安装方式
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
// npm安装方式
// "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
// 此为本身已有的内容 // 此为本身已有的内容
"pages": [ "pages": [
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name" : "uView", "name" : "uView",
"appid" : "__UNI__60F4B81", "appid" : "__UNI__60F4B81",
"description" : "多平台快速开发的UI框架", "description" : "多平台快速开发的UI框架",
"versionName" : "1.6.4", "versionName" : "1.6.5",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// "current": 0, //当前激活的模式(list 的索引项) // "current": 0, //当前激活的模式(list 的索引项)
// "list": [{ // "list": [{
// "name": "test", //模式名称 // "name": "test", //模式名称
// "path": "pages/componentsA/field/index", //启动页面,必选 // "path": "pages/componentsC/test/index", //启动页面,必选
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到 // "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
// }] // }]
// }, // },
......
...@@ -114,7 +114,12 @@ ...@@ -114,7 +114,12 @@
this.toast(`点击了关闭图标`); this.toast(`点击了关闭图标`);
}, },
click(index) { click(index) {
this.toast(`点击了第${index + 1}条消息`); if(this.mode == 'horizontal' && this.isCircular) {
this.toast('此模式无法获取Index值');
} else {
this.toast(`点击了第${index + 1}条消息`);
}
}, },
getMore() { getMore() {
this.toast(`点击了更多图标`); this.toast(`点击了更多图标`);
......
<template> <template>
<view class=""> <view class="">
<u-dropdown ref="uDropdown" @open="open" @close="close">
<u-dropdown-item v-model="value1" title="距离" :options="options1" @change="change"></u-dropdown-item>
<u-dropdown-item v-model="value2" title="温度" :options="options2"></u-dropdown-item>
</u-dropdown>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() {
data() { return {
return { value1: 1,
value2: 2,
}; options1: [{
}, label: '默认排序',
onLoad() { value: 1,
console.log(this.$u.test.url('http://www.aa.com?b=3&a=328sdsfhiwiefwismdfhsewiemsnfwiemdhisi')); },
}, {
computed: { label: '距离优先',
value: 2,
}, }
methods: { ],
reachBottom() { options2: [{
// 此tab为空数据 label: '去冰',
if(this.current != 2) { value: 1,
this.loadStatus.splice(this.current,1,"loading") },
setTimeout(() => { {
this.getOrderList(this.current); label: '加冰',
}, 1200); value: 2,
} },
}, ],
// 页面数据
getOrderList(idx) {
for(let i = 0; i < 5; i++) {
let index = this.$u.random(0, this.dataList.length - 1);
let data = JSON.parse(JSON.stringify(this.dataList[index]));
data.id = this.$u.guid();
this.orderList[idx].push(data);
} }
this.loadStatus.splice(this.current,1,"loadmore")
},
change(index) {
this.swiperCurrent = index;
this.getOrderList();
}, },
transition({ detail: { dx } }) { methods: {
this.$refs.tabs.setDx(dx); open(index) {
}, // 展开某个下来菜单时,先关闭原来的其他菜单高亮
animationfinish({ detail: { current } }) { // 同时内部会自动给当前展开项进行高亮
this.$refs.tabs.setFinishCurrent(current); this.$refs.uDropdown.highlight();
this.swiperCurrent = current; },
this.current = current; close(index) {
}, // 关闭的时候,给当前项加上高亮
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
// 数据请求 this.$refs.uDropdown.highlight(index);
// post示例 },
// sumbitByPost() { change() {
// this.$u.post('http://10.28.83.111:59694/formMessage', { // 更多的细节,请自行实现
// username:this.loginForm.username,
// password:md5(this.loginForm.password).toUpperCase(),
// }).then(res => {
// // res为服务端返回的数据
// })
// },
sendInfo(){
let params = {
username:this.loginForm.username,
password:md5(this.loginForm.password).toUpperCase(),
}
let headers={
"Content-Type":"application/x-www-form-urlencoded",
// "Token":`this.userToken` //设置token,保证每一个用户进入系统的安全性
}
uni.request({
url: `http://10.28.83.111:59694/formMessage`,
method: 'POST',
header: headers,
data: params,
success: (res)=>{
},
fail: (err)=>{
}
})
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.order {
width: 710rpx;
background-color: #ffffff;
margin: 20rpx auto;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.store {
margin: 0 10rpx;
font-size: 32rpx;
font-weight: bold;
} }
} }
.right {
// color: $u-type-warning-dark;
color: #F29100;
// color: #5098ff;
// color: #e5d001;
}
} }
.item { </script>
display: flex; \ No newline at end of file
margin: 20rpx 0 0;
.left {
margin-right: 20rpx;
image {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
}
.content {
.title {
font-size: 28rpx;
line-height: 50rpx;
}
.type {
margin: 10rpx 0;
font-size: 24rpx;
color: $u-tips-color;
}
.delivery-time {
color: #999999;
font-size: 24rpx;
}
}
.right {
margin-left: 10rpx;
padding-top: 20rpx;
text-align: right;
.decimal {
font-size: 24rpx;
margin-top: 4rpx;
}
.number {
color: $u-tips-color;
font-size: 24rpx;
}
}
}
.total {
margin-top: 20rpx;
text-align: right;
font-size: 24rpx;
.total-price {
font-size: 32rpx;
}
}
.bottom {
display: flex;
margin-top: 40rpx;
padding: 0 10rpx;
justify-content: space-between;
align-items: center;
.btn {
line-height: 52rpx;
width: 160rpx;
border-radius: 26rpx;
border: 2rpx solid $u-border-color;
font-size: 26rpx;
text-align: center;
color: $u-type-info-dark;
}
.evaluate {
color: $u-type-warning-dark;
border-color: $u-type-warning-dark;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 250rpx;
height: 300rpx;
// margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
</style>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
}); });
}, },
created() { created() {
}, },
methods: { methods: {
openPage(path) { openPage(path) {
......
...@@ -55,7 +55,11 @@ Vue.use(uView); ...@@ -55,7 +55,11 @@ Vue.use(uView);
// pages.json // pages.json
{ {
"easycom": { "easycom": {
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
// npm安装方式
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
// 下载安装方式
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
}, },
// 此为本身已有的内容 // 此为本身已有的内容
"pages": [ "pages": [
......
...@@ -74,7 +74,11 @@ ...@@ -74,7 +74,11 @@
this.activeColor = parent.activeColor; this.activeColor = parent.activeColor;
this.inactiveColor = parent.inactiveColor; this.inactiveColor = parent.inactiveColor;
// 将本组件的this,放入到父组件的children数组中,让父组件可以操作本(子)组件的方法和属性 // 将本组件的this,放入到父组件的children数组中,让父组件可以操作本(子)组件的方法和属性
parent.children.push(this); // push进去前,显判断是否已经存在了本实例,因为在子组件内部数据变化时,会通过父组件重新初始化子组件
let exist = parent.children.find(val => {
return this === val;
})
if(!exist) parent.children.push(this);
if(parent.children.length == 1) this.active = true; if(parent.children.length == 1) this.active = true;
// 父组件无法监听children的变化,故将子组件的title,传入父组件的menuList数组中 // 父组件无法监听children的变化,故将子组件的title,传入父组件的menuList数组中
parent.menuList.push({ parent.menuList.push({
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
<view class="u-dropdown__menu__item" v-for="(item, index) in menuList" :key="index" @tap.stop="menuClick(index)"> <view class="u-dropdown__menu__item" v-for="(item, index) in menuList" :key="index" @tap.stop="menuClick(index)">
<view class="u-flex"> <view class="u-flex">
<text class="u-dropdown__menu__item__text" :style="{ <text class="u-dropdown__menu__item__text" :style="{
color: item.disabled ? '#c0c4cc' : index === current ? activeColor : inactiveColor, color: item.disabled ? '#c0c4cc' : (index === current || highlightIndex == index) ? activeColor : inactiveColor,
fontSize: $u.addUnit(titleSize) fontSize: $u.addUnit(titleSize)
}">{{item.title}}</text> }">{{item.title}}</text>
<view class="u-dropdown__menu__item__arrow" :class="{ <view class="u-dropdown__menu__item__arrow" :class="{
'u-dropdown__menu__item__arrow--rotate': index === current 'u-dropdown__menu__item__arrow--rotate': index === current
}"> }">
<u-icon :custom-style="{display: 'flex'}" name="arrow-down" size="26" :color="index === current ? activeColor : '#c0c4cc'"></u-icon> <u-icon :custom-style="{display: 'flex'}" name="arrow-down" size="26" :color="index === current || highlightIndex == index ? activeColor : '#c0c4cc'"></u-icon>
</view> </view>
</view> </view>
</view> </view>
...@@ -86,7 +86,9 @@ ...@@ -86,7 +86,9 @@
contentStyle: { contentStyle: {
zIndex: -1, zIndex: -1,
opacity: 0 opacity: 0
} },
// 让某个菜单保持高亮的状态
highlightIndex: 99999
} }
}, },
computed: { computed: {
...@@ -124,6 +126,12 @@ ...@@ -124,6 +126,12 @@
}, this.duration) }, this.duration)
return; return;
} }
this.open(index);
},
// 打开下拉菜单
open(index) {
// 重置高亮索引,否则会造成多个菜单同时高亮
// this.highlightIndex = 9999;
// 展开时,设置下拉内容的样式 // 展开时,设置下拉内容的样式
this.contentStyle = { this.contentStyle = {
zIndex: 11, zIndex: 11,
...@@ -137,9 +145,11 @@ ...@@ -137,9 +145,11 @@
this.children.map((val, idx) => { this.children.map((val, idx) => {
val.active = index == idx ? true : false; val.active = index == idx ? true : false;
}) })
this.$emit('open', this.current);
}, },
// 设置下拉菜单处于收起状态 // 设置下拉菜单处于收起状态
close() { close() {
this.$emit('close', this.current);
// 设置为收起状态,同时current归位,设置为空字符串 // 设置为收起状态,同时current归位,设置为空字符串
this.active = false; this.active = false;
this.current = 99999; this.current = 99999;
...@@ -154,6 +164,10 @@ ...@@ -154,6 +164,10 @@
// 如果不允许点击遮罩,直接返回 // 如果不允许点击遮罩,直接返回
if(!this.closeOnClickMask) return; if(!this.closeOnClickMask) return;
this.close(); this.close();
},
// 外部手动设置某个菜单高亮
highlight(index = undefined) {
this.highlightIndex = index !== undefined ? index : 99999;
} }
} }
} }
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
} }
.u-bg-gray { .u-bg-gray {
background-color: #e7e6eb; background-color: $u-border-color;
} }
.u-keyboard-back { .u-keyboard-back {
......
...@@ -35,13 +35,13 @@ ...@@ -35,13 +35,13 @@
backgroundColor: bgColor, backgroundColor: bgColor,
}, inputStyle]" }, inputStyle]"
/> />
<view class="u-close-wrap" v-if="keyword && clearabled && focused" @touchstart="clear"> <view class="u-close-wrap" v-if="keyword && clearabled && focused" @tap="clear">
<u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="#c0c4cc"></u-icon> <u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="#c0c4cc"></u-icon>
</view> </view>
</view> </view>
<view :style="[actionStyle]" class="u-action" <view :style="[actionStyle]" class="u-action"
:class="[showActionBtn || show ? 'u-action-active' : '']" :class="[showActionBtn || show ? 'u-action-active' : '']"
@touchstart.stop.prevent="custom" @tap.stop.prevent="custom"
>{{ actionText }}</view> >{{ actionText }}</view>
</view> </view>
</template> </template>
...@@ -267,7 +267,11 @@ export default { ...@@ -267,7 +267,11 @@ export default {
}, },
// 失去焦点 // 失去焦点
blur() { blur() {
this.focused = false; // 最开始使用的是监听图标@touchstart事件,自从hx2.8.4后,此方法在微信小程序出错
// 这里改为监听点击事件,手点击清除图标时,同时也发生了@blur事件,导致图标消失而无法点击,这里做一个延时
setTimeout(() => {
this.focused = false;
}, 100)
this.show = false; this.show = false;
this.$emit('blur', this.keyword); this.$emit('blur', this.keyword);
}, },
......
// 此版本发布于2020-08-21 // 此版本发布于2020-08-25
let version = '1.6.4'; let version = '1.6.5';
export default { export default {
v: version, v: version,
......
...@@ -169,3 +169,4 @@ text { ...@@ -169,3 +169,4 @@ text {
} }
} }
...@@ -171,4 +171,5 @@ uni-toast .uni-toast { ...@@ -171,4 +171,5 @@ uni-toast .uni-toast {
.u-reset-button::after { .u-reset-button::after {
border: none; border: none;
} }
/* end--去除button的所有默认样式--end */ /* end--去除button的所有默认样式--end */
\ No newline at end of file
{ {
"name": "uview-ui", "name": "uview-ui",
"version": "1.6.4", "version": "1.6.5",
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水", "description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"main": "index.js", "main": "index.js",
"keywords": ["uview", "uView", "uni-app", "uni-app ui", "uniapp", "uviewui", "uview ui", "uviewUI", "uViewui", "uViewUI", "uView UI", "uni ui", "uni UI", "uniapp ui", "ui", "UI框架", "uniapp ui框架", "uniapp UI"], "keywords": ["uview", "uView", "uni-app", "uni-app ui", "uniapp", "uviewui", "uview ui", "uviewUI", "uViewui", "uViewUI", "uView UI", "uni ui", "uni UI", "uniapp ui", "ui", "UI框架", "uniapp ui框架", "uniapp UI"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment