提交 911ff155 编写于 作者: 芊里

修改反馈列表页

上级 6aa1a7b8
......@@ -69,8 +69,7 @@
}, {
"path": "uni_modules/opendb-feedback/pages/opendb-feedback/list",
"style": {
"navigationBarTitleText": "反馈列表",
"enablePullDownRefresh":true
"navigationBarTitleText": "反馈列表"
}
}, {
"path": "uni_modules/opendb-feedback/pages/opendb-feedback/add",
......
......@@ -97,6 +97,8 @@
.then(imgs=>{
res.imgs = imgs;
res.create_date = Date.now();
res.is_reply = true;
this.submitForm(res)
});
}).catch((errors) => {
......
<template>
<view class="container">
<unicloud-db ref="udb" v-slot:default="{data, pagination, loading, hasMore, error}" collection="opendb-feedback" field="user_id,create_date,content,imgs,is_reply,feedback_id,contact,mobile,reply_count">
<view v-if="error">{{error.message}}</view>
<view v-else-if="data">
<unicloud-db ref="udb" v-slot:default="{data, pagination, loading, hasMore, error}" collection="opendb-feedback"
field="user_id,create_date,content,imgs,is_reply,feedback_id,contact,mobile,reply_count">
<view v-if="data && data.length">
<uni-list>
<uni-list-item v-for="(item, index) in data" :key="index" showArrow :clickable="true" @click="handleItemClick(item._id)">
<uni-list-item v-for="(item, index) in data" :key="index" showArrow :clickable="true"
@click="handleItemClick(item._id)">
<view slot="body">
<!-- 此处默认显示为_id,请根据需要自行修改为其他字段 -->
{{item.content}}
......@@ -12,7 +13,7 @@
</uni-list-item>
</uni-list>
</view>
<uni-load-more :status="loading?'loading':(hasMore ? 'more' : 'noMore')"></uni-load-more>
<uni-nodata v-else @retry="refreshData"></uni-nodata>
</unicloud-db>
<uni-fab ref="fab" horizontal="right" vertical="bottom" :pop-menu="false" @fabClick="fabClick" />
</view>
......@@ -29,17 +30,12 @@
}
}
},
onPullDownRefresh() {
methods: {
refreshData() {
this.$refs.udb.loadData({
clear: true
}, (res) => {
uni.stopPullDownRefresh()
})
}, (res) => {})
},
onReachBottom() {
this.$refs.udb.loadMore()
},
methods: {
handleItemClick(id) {
uni.navigateTo({
url: './detail?id=' + id
......
{
"bsonType": "object",
"permission": {
"read": "auth.uid && doc.uid == auth.uid",
"read": "!doc.is_reply",
"create": true,
"update": false,
"delete": false
......@@ -18,6 +18,9 @@
"$env": "uid"
}
},
"title":{
"description": "反馈标题(用于列表展示)"
},
"ip": {
"forceDefaultValue": {
"$env": "clientIP"
......
<template>
<view class="nodata">
<view class="nodata-content">
<view class="text-view a-i-c j-c-c t-a-c">
<text class="title">{{textTypes[networkType]}}</text>
</view>
<view class="icon-view">
<image src="/uni_modules/uni-nodata/static/nodata.png" class="icon-image"></image>
</view>
<view class="opera-view">
<view class="btn btn-default" v-if="networkType!='none'" @click="retry">
<text class="btn-text">重试</text>
</view>
<view class="btn btn-default" v-if="networkType=='none'" @click="openSettings">
<text class="btn-text">设置</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'uni-nodata',
data() {
return {
textTypes: {
none: "暂无网络"
},
isConnected: false,
networkType: "none"
}
},
mounted() {
this.isIOS = (uni.getSystemInfoSync().platform === 'ios');
uni.onNetworkStatusChange((res) => {
this.isConnected = res.isConnected;
this.networkType = res.networkType;
});
uni.getNetworkType({
success: (res) => {
this.networkType = res.networkType;
}
});
},
methods: {
retry() {
this.$emit('retry');
},
async openSettings() {
if (this.networkType == "none") {
this.openSystemSettings();
return;
}
},
openAppSettings() {
this.gotoAppSetting();
},
openSystemSettings() {
if (this.isIOS) {
this.gotoiOSSetting();
} else {
this.gotoAndroidSetting();
}
},
network() {
var result = null;
var cellularData = plus.ios.newObject("CTCellularData");
var state = cellularData.plusGetAttribute("restrictedState");
if (state == 0) {
result = null;
console.log("StateUnknown");
} else if (state == 2) {
result = 1;
console.log("已经开启了互联网权限:NotRestricted");
} else if (state == 1) {
result = 2;
console.log("Restricted");
}
plus.ios.deleteObject(cellularData);
return result;
},
gotoAppSetting() {
if (this.isIOS) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
},
gotoiOSSetting() {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("App-prefs:root=General");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
},
gotoAndroidSetting() {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent(Settings.ACTION_SETTINGS);
mainActivity.startActivity(intent);
}
}
}
</script>
<style>
.a-i-c {
align-items: center;
}
.j-c-c {
justify-content: center;
}
.t-a-c {
text-align: center;
}
.nodata {
flex: 1;
flex-direction: column;
/* #ifndef APP-PLUS */
display: flex;
/* #endif */
align-items: center;
justify-content: center;
padding: 30px;
background-color: #f8f8f8;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
/* #ifndef APP-NVUE */
margin: auto;
/* #endif */
}
.nodata-content {
transform: translateY(-50px);
}
.text-view {
margin-bottom: 40px;
}
.title {
color: #999999;
font-size: 18px;
}
.opera-view {
flex-direction: column;
align-items: center;
justify-content: center;
}
.btn {
padding: 5px 10px;
width: 128px;
flex-direction: row;
align-items: center;
justify-content: center;
text-align: center;
}
.btn-text {
color: #999999;
font-size: 15px;
}
.btn-default {
border-color: #999999;
border-style: solid;
border-width: 1px;
border-radius: 3px;
}
.icon-view{
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
border-width: 1rpx;
border-color: #DD524D;
}
.icon-image{
width: 640rpx;
height: 640rpx;
}
</style>
{
"id": "uni-nodata",
"displayName": "uni-nodata",
"version": "1.0.0",
"description": "uni-nodata",
"keywords": [
"uni-nodata"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
\ No newline at end of file
# uni-nodata
\ No newline at end of file
......@@ -11,7 +11,15 @@
"version": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"uni-id": {
"version": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id"
"version": "file:../../../../uni-id/uniCloud/cloudfunctions/common/uni-id",
"requires": {
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
},
"dependencies": {
"uni-config-center": {
"version": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册