上传代码
This commit is contained in:
82
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.js
vendored
Normal file
82
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.js
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_rate2 = common_vendor.resolveComponent("uni-rate");
|
||||
_easycom_uni_rate2();
|
||||
}
|
||||
const _easycom_uni_rate = () => "../../uni_modules/uni-rate/components/uni-rate/uni-rate.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_rate();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "allOrder",
|
||||
setup(__props) {
|
||||
const reviewList = common_vendor.ref([]);
|
||||
const getMyReview = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/level/list",
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log(res.data.data);
|
||||
reviewList.value = res.data.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(getMyReview());
|
||||
const deleteReview = (item) => {
|
||||
console.log(item.id);
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/level/delete",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: item.id
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
reviewList.value = reviewList.value.filter((review) => review.id !== item.id);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作成功",
|
||||
icon: "sucess",
|
||||
duration: 2e3
|
||||
});
|
||||
},
|
||||
fail(error) {
|
||||
console.log(error);
|
||||
common_vendor.index.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.f(reviewList.value, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.createTime.substr(0, 19).replace("T", " ")),
|
||||
b: common_vendor.t(item.rating),
|
||||
c: "20c9fcae-0-" + i0,
|
||||
d: common_vendor.p({
|
||||
readonly: true,
|
||||
value: item.rating,
|
||||
["active-color"]: "#13c2c2",
|
||||
["is-fill"]: false,
|
||||
color: "#13c2c2"
|
||||
}),
|
||||
e: common_vendor.t(item.review),
|
||||
f: common_vendor.o(($event) => _ctx.reviewUser(item), index),
|
||||
g: item.businessReview && item.businessReview.trim() !== ""
|
||||
}, item.businessReview && item.businessReview.trim() !== "" ? {
|
||||
h: common_vendor.t(item.businessReview)
|
||||
} : {}, {
|
||||
i: index,
|
||||
j: common_vendor.o(($event) => deleteReview(item), index)
|
||||
});
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
wx.createPage(_sfc_main);
|
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.json
vendored
Normal file
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的评论",
|
||||
"usingComponents": {
|
||||
"uni-rate": "../../uni_modules/uni-rate/components/uni-rate/uni-rate"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="container"><view class="history-list"><view wx:for="{{a}}" wx:for-item="item" wx:key="i" class="history-item" bindtap="{{item.j}}"><view class="history-info"><image class="history-img" src="https://tse4-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?rs=1&pid=ImgDetMain"></image><view class="nameTime"><text class="history-title">匿名用户</text><text class="time">{{item.a}}</text></view><view class="star"><text class="history-sale">{{item.b}}</text><uni-rate wx:if="{{item.d}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d}}"/></view></view><view class="extend"><text bindtap="{{item.f}}">{{item.e}}</text><block wx:if="{{item.g}}"><view class="businessReviewTitle"> 商家回复 </view><text class="businessReview">{{item.h}}</text></block></view></view></view></view>
|
63
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.wxss
vendored
Normal file
63
uniapp04/unpackage/dist/dev/mp-weixin/pages/allOrder/allOrder.wxss
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
|
||||
.container {
|
||||
align-items: center;
|
||||
width: 90%;
|
||||
height: 100vh;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.history-list {
|
||||
width: 95%;
|
||||
background-color: #fff;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 15px;
|
||||
padding: 10px;
|
||||
}
|
||||
.history-item {
|
||||
margin-top: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.history-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%; /* 设置为正圆形 */
|
||||
margin-right: 10px;
|
||||
padding-right: 50px;
|
||||
}
|
||||
.history-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.nameTime {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.history-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
width: 170px;
|
||||
}
|
||||
.time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.star {
|
||||
display: inline-block;
|
||||
line-height: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
}
|
||||
.history-sale {
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
line-height: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.extend {
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
padding-top: 10px;
|
||||
}
|
Reference in New Issue
Block a user