首页 > 其他分享 >uni-app 16用户投诉开发

uni-app 16用户投诉开发

时间:2022-10-14 16:01:35浏览次数:57  
标签:return 16 default app free uni type icon


用户投诉

user-report.nvue

<template>
<view class="page">
<!-- 导航栏 -->
<free-nav-bar title="用户投诉" showBack :showRight="true" bgColor="bg-white">
<free-main-button name="投诉" slot="right" @click="submit"></free-main-button>
</free-nav-bar>

<picker mode="selector" :range="range" @change="change">
<view>
<free-list-item :showLeftIcon="false" :title="cate ? cate : '请选择分类'" showRight></free-list-item>
</view>
</picker>
<textarea value="" placeholder="请填写投诉内容..." class="bg-white p-2 font-md" v-model="content" />
</view>
</template>

<script>
import freeNavBar from '@/components/free-ui/free-nav-bar.vue';
import freeMainButton from '@/components/free-ui/free-main-button.vue';
import freeListItem from '@/components/free-ui/free-list-item.vue';
export default {
components:{
freeNavBar,
freeMainButton,
freeListItem
},
data() {
return {
content:'',
range:['分类一','分类二','分类三','分类四','分类五'],
cate:''
}
},
methods: {
change(e){
this.cate = this.range[e.detail.value];
},
submit(){
if(!this.cate){
return uni.showToast({
title:'请选择分类',
icon:'none'
})
}
if(!this.content){
return uni.showToast({
title:'请填写投诉内容',
icon:'none'
})
}

// 请求服务器
uni.navigateBack({
delta:1
});
uni.showToast({
title:'投诉成功',
icon:'none'
})
}
}
}
</script>

<style>

</style>

所使用的组件

// free-nav-bar.vue
<template>
<view>
<view :class="getClass">
<!-- 状态栏 -->
<view :style="'height:'+statusBarHeight+'px;'"></view>
<!-- 导航 -->
<view class="w-100 flex align-center justify-between" style="height: 90rpx;">
<!-- 左边 -->
<view class="flex align-center">
<!-- 返回按钮 -->
<free-icon-button v-if="showBack" @click="back"><text class="iconfont font-md"></text></free-icon-button>
<!-- 标题 -->
<text v-if="title" class="font-md ml-3" >{{getTitle}}</text>
</view>
<!-- 右边 -->
<view class="flex align-center" v-if="showRight">
<slot name="right">
<free-icon-button @click="search"><text class="iconfont font-md"></text></free-icon-button>
<free-icon-button @click="openExtend"><text class="iconfont font-md"></text></free-icon-button>
</slot>
</view>
<!--\ue6e3 \ue682 -->
</view>
</view>

<!-- 站位 -->
<view v-if="fixed" :style="fixedStyle"></view>

<!-- 扩展菜单 -->
<free-popup v-if="showRight" ref="extend" maskColor bottom :bodyWidth="320" :bodyHeight="525" bodyBgColor="bg-dark" transformOrigin="right top">
<view class="flex flex-column" style="width:320rpx;height: 525rpx;">
<view v-for="(item,index) in menus" :key="index" class="flex-1 flex align-center" hover-class="bg-hover-dark" @click="clickEvent(item.event)">
<text class="pl-3 pr-2 iconfont font-md text-white">{{item.icon}}</text>
<text class="font-md text-white">{{item.name}}</text>
</view>
</view>
</free-popup>
</view>
</template>

<script>
import freeIconButton from './free-icon-button.vue';
import freePopup from './free-popup.vue';
export default {
components: {
freeIconButton,
freePopup
},
props: {
showBack:{
type:Boolean,
default:false
},
title: {
type: String,
default: ''
},
fixed:{
type:Boolean,
default:false
},
noreadnum:{
type:Number,
default:0
},
bgColor:{
type:String,
default:"bg-light"
},
showRight:{
type:Boolean,
default:true
}
},
data() {
return {
statusBarHeight: 0,
navBarHeight: 0,
menus:[
{
name:'发起群聊',
event:"",
icon:"\ue633"
},
{
name:'添加好友',
event:"",
icon:"\ue65d"
},
{
name:'扫一扫',
event:"",
icon:"\ue614"
},
{
name:'收付款',
event:"",
icon:"\ue66c"
},
{
name:'帮助与反馈',
event:"",
icon:"\ue61c"
}
],
}
},
mounted() {
// 获取任务栏高度
// #ifdef APP-PLUS-NVUE
this.statusBarHeight = plus.navigator.getStatusbarHeight()
// #endif
this.navBarHeight = this.statusBarHeight + uni.upx2px(90)
},
computed: {
fixedStyle() {
return `height:${this.navBarHeight}px`;
},
getTitle(){
let noreadnum = this.noreadnum>0 ? '('+this.noreadnum+')' : '';
return this.title + noreadnum;
},
getClass(){
let fixed = this.fixed?"fixed-top":"";
return `${fixed} ${this.bgColor}`;
}
},
methods:{
openExtend(){
this.$refs.extend.show(uni.upx2px(415),uni.upx2px(150));
},
// 返回
back(){
uni.navigateBack({
delta:1
})
}
}
}
</script>

<style>

</style>

// free-main-button.vue

<template>
<view class="rounded mr-2 px-2 py-1"
@click="clickEvent"
:class="disabled ? 'bg-light border' : 'main-bg-color'">
<text class="font"
:class="disabled ? 'text-light-muted':'text-white'">{{name}}</text>
</view>
</template>

<script>
export default {
props: {
name: {
type: String,
default: ""
},
disabled:{
type:Boolean,
default:false
}
},
methods: {
clickEvent() {
if(!this.disabled){
this.$emit('click')
}
}
},
}
</script>

<style>
</style>

// free-list-item.vue
<template>
<view class="bg-white flex align-stretch" hover-class="bg-light" @click="$emit('click')">
<view class="flex align-center justify-center py-2 pl-3" v-if="showLeftIcon">
<slot name="icon"></slot>
<image :src="cover" v-if="cover" style="width: 75rpx;height: 75rpx;" mode="widthFix" :style="coverStyle"></image>
</view>
<view class="flex-1 flex align-center justify-between py-3 pl-3" :class="border ? 'border-bottom' : ''">
<slot>
<text class="font-md text-dark">{{title}}</text>
</slot>
<view class="flex align-center pr-3" v-if="showRight">
<slot name="right"></slot>
<!-- 右 -->
<text class="iconfont text-light-muted font-md" v-if="showRightIcon" ></text>
</view>
</view>
</view>
</template>

<script>
export default{
props:{
// 是否开启下边线
border:{
type:Boolean,
default:true
},
// 封面
cover:{
type:String,
default:""
},
// 标题
title:{
type:String,
default:""
},
// 显示右边
showRight:{
type:Boolean,
default:false
},
// 封面大小
coverSize:{
type:[String,Number],
default:75
},
// 显示左边图标
showLeftIcon:{
type:Boolean,
default:true
},
showRightIcon:{
type:Boolean,
default:true
}
},
computed:{
coverStyle(){
return `width:${this.coverSize}rpx;height:${this.coverSize}rpx;`;
}
}
}
</script>

<style>
</style>

页面是酱紫的

uni-app 16用户投诉开发_#ifdef


感谢大家观看,我们下次见。


标签:return,16,default,app,free,uni,type,icon
From: https://blog.51cto.com/u_15565664/5757142

相关文章

  • uni-app 8聊天页开发
    主文件chat.nvue<template><view><!--导航栏--><free-nav-bartitle="呵呵呵呵":noreadnum="1"showBack><free-icon-buttonslot="right"><textclass......
  • uni-app 7个人中心页开发
    my.nvue内容如下<template><viewclass="page"><free-nav-barbgColor="bg-white"><free-icon-buttonslot="right"><textclass="iconfontfont-md"></text......
  • uni-app 9.2聊天信息设置页(二)
    主页面chat-set.nvue<template><viewstyle="background-color:#EDEDED;"><!--导航栏--><free-nav-bartitle="聊天信息"showBack:showRight="false"></free......
  • MAPPO学习笔记(2) —— 从MAPPO论文入手
    在有了上一节一些有关PPO算法的概念作为基础后,我们就可以正式开始对于MAPPO这一算法的学习。那么,既然要学习一个算法,就不得不去阅读提出这一算法的论文。那么本篇博客将从......
  • 高校垃圾分类APP技术服务支持
      高校垃圾分类app有助于创造更加美好的生活学习环境,培养学生的责任心和环保意识;有利于推动高校的生态文明建设,构建“绿色校园”,提升学校形象;有利于环境的保护,实现绿......
  • SpringBoot中Server层以及Mapper层常用注解
    4.Service层注解@Service注解一般写在业务层的接口实现类上,而不是接口上。4.1@Service@Service:@Service注解用于类上,标记当前类是一个service类,加上该注解会将当......
  • TZOJ 1693:银牛派对(最短路/dijstra)
    描述 N个农场(1≤ N ≤1000)中的每一个都有一头奶牛,编号为1.. N将参加在农场# X(1≤ X ≤ N)举行的大型奶牛聚会。总共有M (1≤ M ≤100,000)条单向(单向......
  • CF1693F I Might Be Wrong 题解
    感觉是一个比较套路的题目。思路很容易就可以胡出一个贪心策略。每一次操作都选一个从前面开始最长的\(0,1\)数量相同的序列进行操作。看一眼好像样例都能过。可以......
  • Unity 在模型上展示标签UI
    voidUpdate(){this.transform.LookAt(Camera.main.transform);}   在主摄像机下设置一个子摄像机,主摄像机CullingMask去掉显示UI。子摄像机Cul......
  • uniapp应用间实现通信,通过自定义广播实现
    uniapp应用间实现通信,通过自定义广播实现一、uniapp检测应用安装,并实现跳转至其他appif( plus.runtime.isApplicationExist({ //查看安卓系统手机有没有下载这款......