comment 8.1

This commit is contained in:
ghusermoon 2020-08-01 16:36:48 +08:00
parent 865e2a741a
commit 854976c8f0
18 changed files with 356 additions and 120 deletions

View File

@ -3,7 +3,7 @@
<view class="user">
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
<text class="name">{{ content.geval_frommembername }}</text>
<u-rate v-if="reply" :disabled='true' count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
<u-rate v-if="reply" :disabled='true' :count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
</view>
<view class="content">
<view class="text">{{ content.geval_content }}</view>
@ -30,7 +30,7 @@ export default {
data() {
return {
count: 5,
rate: 2,
rate: 0,
}
},
props: {

View File

@ -24,11 +24,12 @@
</view>
</view>
</view>
<view class="order-btn" v-if="[1, 3, 4, 8].indexOf(order.view_type) >= 0">
<view class="calcel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
<view class="order-btn" v-if="[1, 2, 3, 4, 8].indexOf(order.view_type) >= 0">
<view class="cancel" v-if="order.view_type == 3 || order.view_type == 2" @click="applyRefund">申请退款</view>
<view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
<view class="calcel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>
<view class="cancel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>
<view class="payment" v-if="order.view_type == 1" @click="payNow(order.pay_sn, order.order_amount)">立即支付</view>
<view class="service" v-if="order.view_type == 8">联系官方客服</view>
<view class="submit" v-if="order.view_type == 8">提交官方审核</view>
@ -79,6 +80,9 @@ export default {
}
this.$u.toast(res.message);
})
},
applyRefund() {
},
confirmReceive() {
this.$u.api.confirmReceive({
@ -204,7 +208,7 @@ export default {
.logistics, .comment, .payment {
@include btn-class($width: 160rpx, $color: rgba(255,119,15,1));
}
.calcel {
.cancel {
@include btn-class($width: 160rpx, $color: rgba(155,153,153,1));
}
.service {

View File

@ -35,6 +35,9 @@ export default {
// this.getAllEvalue();
this.getEvaluateSpec();
},
onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageC/cart/index');
},
watch: {
current(value) {
this.page = 0;

View File

@ -19,7 +19,8 @@
</view>
<view class="info">
<view class="title u-line-2">
<text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }}
<text class="store-name">{{ goodsInfo.store_name }}</text>
<text class="goods-name">{{ goodsInfo.goods_name }}</text>
</view>
<view class="pic">
<text>{{ goodsInfo.goods_price }}</text>
@ -40,7 +41,7 @@
</view>
</view>
<comment :reply="false" :content="evaluate" v-if="evaluate.evaluate_num"></comment>
<view class="comment-none">暂无评价</view>
<view class="comment-none" v-else>暂无评价</view>
</view>
<view class="hr"></view>
<view class="group-user" v-if="groupUser.length">
@ -227,6 +228,9 @@ export default {
this.showGroupUser = false;
this.showInvolvementUser = false;
},
onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageC/cart/index');
},
beforeDestroy() {
clearInterval(this.timer);
},
@ -379,7 +383,7 @@ export default {
},
/*
* @description 下单 订单步骤1展示结算数据
* @params {Number} type 拼团或者开团
* @params {Number} type involvement 拼团或者 默认开团
* @params {Number} num 数量
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算立即购买/拼团/秒杀
**/
@ -553,17 +557,20 @@ export default {
.title{
flex-wrap: wrap;
margin-bottom: 30rpx;
line-height: 1.2;
>text{
display: inline-block;
.store-name {
display: inline-block;
padding: 8rpx 10rpx;
margin: 0 10rpx 4rpx 0;
vertical-align: middle;
font-size: 20rpx;
color: #fff;
border-radius: 30rpx;
background-color: #FF780F;
}
background-color: #FF780F;
margin-bottom: 10rpx;
}
.goods-name {
line-height: 1.5;
}
}
.pic{
>text{

View File

@ -97,7 +97,7 @@ export default {
return false;
}
if(!this.$u.test.mobile(this.phone)) {
this.$u.toast('请填写正确的新手机号');
this.$u.toast('请正确填写手机号');
return false;
}
if(this.$u.test.isEmpty(this.address)) {
@ -116,6 +116,10 @@ export default {
this.$u.toast('预约时间错误');
return false;
}
if(this.number > this.goodsInfo.goods_storage) {
this.$u.toast('库存不足');
return false;
}
return true;
},
chooseDate(e) {
@ -134,9 +138,17 @@ export default {
store_id: this.store.store_id,
appointment_time: new Date(this.time),
}).then(res => {
this.$u.toast(res.message);
if (res.errCode == 0) {
// this.$u.route({ type: 'navigateBack' });
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
},

View File

@ -297,7 +297,7 @@ export default {
},
setTotalPrice() {
const goods = this.orderInfo.store_goods_total;
console.log(this.freight);
// console.log(this.freight);
const freight = this.freight;
let price = 0;
//

View File

@ -73,6 +73,9 @@ export default {
deep: true
}
},
onPullDownRefresh() {
this.getCartList();
},
onShow() {
this.getCartList();
},
@ -111,6 +114,7 @@ export default {
getCartList() {
this.$u.api.getCartTreeList().then(res => {
if (res.errCode == 0) {
uni.stopPullDownRefresh();
let list = res.data.store_cart_list;
list.forEach((item, l_index) => {
// checked ,, false

View File

@ -113,7 +113,7 @@ export default {
filePath: res.tempFilePaths[0]
}).then(result => {
// console.log(result);
this.$set(this, 'avatar', result.file_path);
// this.$set(this, 'avatar', result.file_path);
// this.avatar = result.file_path;
this.uploadPath = result.file_name;
}, error => {
@ -142,7 +142,7 @@ export default {
userInfo.member_mobile,
userInfo.member_birthday,
userInfo.member_sex,
userInfo.member_avatar,
userInfo.member_avatar + '?' + new Date().getTime(),
];
}
})

View File

@ -1,7 +1,7 @@
<template>
<view class="information">
<view class="info-avatar">
<u-avatar :src="userInfo.member_avatar" :size="120"></u-avatar>
<u-avatar :src="userInfo.member_avatar + '?' + new Date().getTime()" :size="120"></u-avatar>
</view>
<view class="info-item">
<view class="title">昵称</view>

View File

@ -2,33 +2,7 @@
<view class="comment">
<view class="main-container">
<view class="goods-comment" v-for="(goods, index) in goodsList" :key="index">
<view class="goods-info">
<image :src="goods.goods_image"></image>
<view class="goods-text">
<view class="goods-name u-line-1">{{ goods.goods_name }}</view>
<!-- <view class="goods-spec u-line-1">{{ }}</view> -->
</view>
</view>
<view class="rate">
<view class="title">描述相符</view>
<u-rate :count="5" v-model="describe[index]" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
</view>
<u-input v-model="content[index]" type="textarea" height="100" :auto-height="true" placeholder="发表你的评价吧,收货时心情如何?" />
<u-upload
:ref="'upload' + index"
:custom-btn="true"
:max-count="count"
:auto-upload="false"
@on-uploaded="uploadImage"
:action="action"
:header="header"
:form-data="formData"
:name="fileName"
>
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="../static/mine/27.png"></image>
</view>
</u-upload>
<CommentView :goods="goods" :index="index" @setLocalImage="setLocalImage" @setContent="setContent" @setDescribe="setDescribe"></CommentView>
</view>
</view>
<view class="order-rate">
@ -45,45 +19,60 @@
</view>
</template>
<script>
import CommentView from './commentItem';
import common from '@/static/js/common.js'
export default {
data() {
return {
orderId: '',
count: 4, //
count: 3, //
logistics: 0, //
service: 0, //
action: this.$u.http.config.baseUrl + '/Upload/uploadfile', //
header: {
"authorization": 'Bearer' + " " + uni.getStorageSync('token')
},
fileName: 'common', // formData name
formData: {
name: 'common', //
},
describe: [],
content: [],
imageList: [],
imageList: [], //
goodsList: [],
imageIndex: 0, //
uploadImageList: [], // 线
}
},
beforeMount() {
// this.init();
// this.getOrderInfo();
components: {
CommentView
},
onLoad(option) {
this.orderId = option.oid;
this.getOrderInfo(option.oid);
},
methods: {
uploadImage(lists) {
let imageList = [];
lists.forEach(res => {
if(res.response.errCode == 0) imageList.push(res.response.data.file_name);
})
this.imageList[this.imageIndex] = imageList;
if(this.imageIndex == this.goodsList.length - 1) this.addOrderEvaluate();
setLocalImage({ list, index }) {
this.imageList[index] = list;
},
setContent({ content, index }) {
this.content[index] = content;
},
setDescribe({ describe, index }) {
this.describe[index] = describe;
},
uploadImage() {
let allPromise = [];
this.imageList.forEach((img, index) => {
this.uploadImageList[index] = [];
img.forEach(filePath => {
let promise = common.uploadFile({
url: this.$u.http.config.baseUrl + '/Upload/uploadfile',
name: 'common',
filePath: filePath,
})
promise.then(result => {
this.uploadImageList[index].push(result.file_name);
})
allPromise.push(promise);
})
})
Promise.all(allPromise).then(() => {
this.addOrderEvaluate();
})
},
//
setModelKey(data) {
data.forEach(() => {
this.content.push('');
@ -96,8 +85,39 @@ export default {
order_id: id,
}).then(res => {
if(res.errCode == 0) {
// this.goodsList = res.data.extend_order_goods;
this.goodsList = [1,2];
this.goodsList = res.data.extend_order_goods;
// this.goodsList = [{
// "rec_id": 14,
// "order_id": 13,
// "goods_id": 39,
// "goods_name": " 湿 湿",
// "goods_price": "69.40",
// "goods_num": 1,
// "goods_image": "1_2017092202443553519.jpg",
// "goods_pay_price": "43.40",
// "store_id": 1,
// "buyer_id": 3,
// "goods_type": "1",
// "promotions_id": 0,
// "commis_rate": 0,
// "gc_id": 30
// },
// {
// "rec_id": 13,
// "order_id": 13,
// "goods_id": 113,
// "goods_name": "",
// "goods_price": "168.00",
// "goods_num": 1,
// "goods_image": "1_2017092901414663050.jpg",
// "goods_pay_price": "106.00",
// "store_id": 1,
// "buyer_id": 3,
// "goods_type": "1",
// "promotions_id": 0,
// "commis_rate": 0,
// "gc_id": 72
// }];
this.setModelKey(this.goodsList);
}
})
@ -112,25 +132,19 @@ export default {
return true;
},
submitComment() {
this.goodsList.forEach((_, index) => {
this.imageIndex = index;
const upload = 'upload' + index;
this.$refs[upload][0].upload();
// console.log(this.content);
// console.log(this.describe);
// console.log(this.imageList);
this.uploadImage();
// this.goodsList.forEach((_, index) => {
})
// let i = 0;
// while(JSON.stringify(this.imageList[this.imageIndex]) != '[]' && i <= this.goodsList.length) {
// this.imageIndex = i;
// const upload = 'upload' + index;
// this.$refs[upload][0].upload();
// i++;
// }
// })
},
addOrderEvaluate() {
if(!this.verifyParams()) return false;
let files = [];
console.log(this.imageList);
this.imageList.forEach((item, index) => {
// console.log(this.uploadImageList);
this.uploadImageList.forEach((item, index) => {
files[index] = '';
// console.log(item);
item.forEach((img, idx) => {
@ -149,10 +163,10 @@ export default {
scores_three: this.describe,
file: files,
};
// console.log(params);
// this.$u.api.updateOrderEvaluate(params).then(res => {
// this.$u.toast(res.message);
// })
console.log(params);
this.$u.api.updateOrderEvaluate(params).then(res => {
this.$u.toast(res.message);
})
},
},
};

View File

@ -68,7 +68,7 @@
</view>
</view>
<view class="btn" v-if="['1', '2', '4', '6'].indexOf(state) >= 0">
<view class="cancel" v-if="state == '4' || state == '1' " @click="applyRefund">申请退款</view>
<view class="cancel" v-if="state == '4' || state == '1'" @click="applyRefund">申请退款</view>
<view class="cancel" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="state == '1'" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>

138
pageE/order/commentItem.vue Normal file
View File

@ -0,0 +1,138 @@
<template>
<view class="comment-item-view">
<view class="view-container">
<view class="goods-info">
<image :src="goods.goods_image"></image>
<view class="goods-text">
<view class="goods-name u-line-1">{{ goods.goods_name }}</view>
<!-- <view class="goods-spec u-line-1">{{ }}</view> -->
</view>
</view>
<view class="rate">
<view class="title">描述相符</view>
<u-rate :count="5" v-model="describe" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
</view>
<u-input v-model="content" type="textarea" height="100" :auto-height="true" placeholder="发表你的评价吧,收货时心情如何?" />
<u-upload
:ref="'upload' + index"
:custom-btn="true"
:max-count="count"
:auto-upload="false"
:action="action"
:header="header"
:form-data="formData"
:name="fileName"
@on-list-change="setImageList"
>
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="../static/mine/27.png"></image>
</view>
</u-upload>
</view>
</view>
</template>
<script>
export default {
data() {
return {
count: 3,
action: this.$u.http.config.baseUrl + '/Upload/uploadfile',
header: {
"authorization": 'Bearer' + " " + uni.getStorageSync('token')
},
fileName: 'common', // formData name
formData: {
name: 'common', //
},
content: '',
describe: '',
imageList: [],
}
},
props: {
goods: Object,
index: Number
},
watch: {
content(value) {
this.$emit('setContent', { content: value, index: this.index });
},
describe(value) {
this.$emit('setDescribe', { describe: value, index: this.index });
},
},
methods: {
setImageList(lists) {
// console.log(lists);
this.imageList = [];
lists.forEach(item => {
this.imageList.push(item.url);
})
console.log(this.imageList);
this.$emit('setLocalImage', { list: this.imageList, index: this.index });
}
}
};
</script>
<style lang="scss" scoped>
.comment-item-view {
.view-container {
.goods-info {
display: flex;
margin-bottom: 40rpx;
> image {
width: 113rpx;
height: 106rpx;
border-radius: 5rpx;
margin-right: 20rpx;
background-color: antiquewhite;
}
.goods-text {
.goods-name {
width: 530rpx;
font-size: 28rpx;
color: rgba(0,0,51,1);
margin-bottom: 20rpx;
}
.goods-spec {
max-width: 300rpx;
box-sizing: content-box;
padding: 10rpx 15rpx;
font-size: 24rpx;
color: rgba(153,153,153,1);
background:rgba(236,236,236,1);
border-radius: 6rpx;
display: inline-block;
}
}
}
textarea {
width: 100% !important;
margin-bottom: 60rpx;
}
.slot-btn {
width: 140rpx;
height: 140rpx;
background: rgba(236,236,236,1);
border-radius: 10rpx;
text-align: center;
> image {
margin-top: 48rpx;
width: 54rpx;
height: 49rpx;
}
}
.rate {
display: flex;
&:not(:last-child) {
margin-bottom: 35rpx;
}
.title {
margin-right: 25rpx;
font-size: 28rpx;
color: rgba(51,51,51,1);
}
}
}
}
</style>

View File

@ -16,7 +16,7 @@
<view class="order-name">美甲人姓名{{ item.manicure_name }}</view>
<view class="order-date">时间{{ item.manicure_time | dateFormat }}</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
<u-loadmore :status="loadStatus" bgColor="#ECECEC" margin-bottom="20" v-if="orderList.length>=pageSize"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
@ -32,6 +32,7 @@
export default {
data() {
return {
pageSize: 1,
list: [{
name: '我的订单'
}, {
@ -42,18 +43,16 @@ export default {
page: 1,
orderList: [],
loadStatus: 'loadmore',
timer: true,
}
},
onPullDownRefresh() {
this.getManicureList({ load: 'reload' });
},
onShow() {
this.current = 0;
this.swiperCurrent = 0;
this.getManicureList().then(order => {
// console.log(order);
this.orderList = this.orderList.concat(order);
// console.log(this.orderList);
});
this.getManicureList({ load: 'reload' });
},
filters: {
dateFormat(value) {
@ -66,27 +65,33 @@ export default {
}
},
methods: {
async getManicureList() {
let res = await this.$u.api.getManicureList({
async getManicureList({ load }) {
const res = await this.$u.api.getManicureList({
page: this.page
})
uni.stopPullDownRefresh();
this.timer = true;
if (res.errCode == 0) {
return res.data.list;
if(load == 'reload') this.orderList = res.data.list;
else if(load == 'loadmore') this.orderList.push(...res.data.list);
}
return res.data.list.length;
},
//
reachBottom() {
// loadStatus
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getManicureList().then(order => {
if (!order.length) {
// page-1
this.getManicureList({ load: 'loadmore' }).then(length => {
if(length == 0) {
this.page--;
this.loadStatus = "nomore";
this.loadStatus = 'nomore';
} else {
this.orderList = this.orderList.concat(order);
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
tabsChange(index) {

View File

@ -115,7 +115,16 @@
"navigationBarTitleText": "商品详情",
"app-plus":{
"titleNView":{
"backgroundColor":"#ffffff"
"backgroundColor":"#ffffff",
"buttons": [
{
"type":"none",
"text":"\ue636",
"float":"right",
"fontSize":"18",
"fontSrc": "/static/fonts/cart.ttf"
}
]
}
}
}
@ -137,7 +146,16 @@
"navigationBarTitleText": "商品评价",
"app-plus":{
"titleNView":{
"backgroundColor":"#ffffff"
"backgroundColor":"#ffffff",
"buttons": [
{
"type":"none",
"text":"\ue636",
"float":"right",
"fontSize":"18",
"fontSrc": "/static/fonts/cart.ttf"
}
]
}
}
}
@ -241,6 +259,7 @@
{
"path": "cart/index",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "购物车",
"app-plus": {
"titleSize": "36px",
@ -608,6 +627,7 @@
{
"path": "tool/Manicure",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "美甲",
"app-plus": {
"titleSize": "36px",
@ -916,6 +936,7 @@
{
"path": "pages/index/index",
"style": {
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
},

View File

@ -224,6 +224,9 @@
this.getZhiBoSwiper();
this.tabLiveList();
},
onPullDownRefresh() {
// this.getManicureList({ load: 'reload' });
},
methods: {
tabLiveList() {
this.$u.api.tabLiveList().then((res) => {

View File

@ -2,7 +2,7 @@
<view class="mine">
<view class="mine-top">
<view class="top">
<u-avatar @click="toOtherPage('/mine/MineInfo')" :src="userInfo.member_avatar" :size="110"></u-avatar>
<u-avatar @click="toOtherPage('/mine/MineInfo')" :src="userInfo.member_avatar + '?' + new Date().getTime()" :size="110"></u-avatar>
<view class="user-info">
<view class="info-left">
<view class="user-nickname">{{ userInfo.member_nickname }}</view>
@ -68,13 +68,13 @@
<view>试穿试送</view>
</view>
<view @click="toOtherPage('/order/Index?current=5')">
<image src="/static/image/mine/3.png"></image>
<view>待评价</view>
</view>
<view @click="toOtherPage('/order/Index?current=6')">
<image src="/static/image/mine/9.png"></image>
<view>售后</view>
</view>
<view @click="toOtherPage('/order/Index?current=6')">
<image src="/static/image/mine/3.png"></image>
<view>待评价</view>
</view>
</view>
</view>
<view class="tool">

View File

@ -45,7 +45,9 @@
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
<!-- 拼团列表 -->
<group></group>
<image class="lingquan"></image>
<view class="activity-view">
<image class="lingquan" :src="activityInfo.adv_code" @click="activityLink({ type: activityInfo.url_type, id: activityInfo.info_id })"></image>
</view>
<youhq></youhq>
<list ref="recommendGoods"></list>
<view class="cart" @click="toCartPage">
@ -87,12 +89,14 @@
seckillTime: {}, //
// couponGroupList: [], //
pinTuanPush: {}, //
activityInfo: {},
areaList: [], //
}
},
onLoad() {
this.getShopTopList();
this.getLocation(); //
this.getStoreActivity();
// this.area = uni.getStorageSync("address") || "";
},
onShow() {
@ -195,6 +199,25 @@
url: '/pageC/classify/index'
});
},
getStoreActivity() {
this.$u.api.getStoreActivity().then(res => {
if(res.errCode == 0) {
this.activityInfo = res.data;
}
})
},
activityLink({ type, id }) {
if(type == 0 || type == 2) return false;
// type 1 , 2
const url = type == 1 ? 'pageB/sdetails/index' : '';
let params = { id: id };
// type: 1 // 1 2 3 4
if(type == 1) Object.assign(params, { type: 1 });
this.$u.route({
url: url,
params: params
})
},
},
}
</script>
@ -291,12 +314,14 @@
}
}
.lingquan {
width: 750rpx;
height: 177rpx;
margin-left: -33rpx;
margin-top: 29rpx;
background-color: #ececec;
.activity-view {
padding: 20rpx 30rpx;
text-align: center;
.lingquan {
background-color: #ececec;
width: 688rpx;
height: 138rpx;
}
}
.cart {

BIN
static/fonts/cart.ttf Normal file

Binary file not shown.