订单评价, WIP

This commit is contained in:
quantulr
2024-05-11 17:21:15 +08:00
parent 67cdb9e667
commit 8e5986a8ef
11 changed files with 274 additions and 119 deletions

View File

@ -1,136 +1,137 @@
<!--pages/index/index.wxml-->
<view class="top-all">
<view class="top" style="background: url({{bgImg}}index-top.png) no-repeat;background-size: 100%;padding-top:{{statusBarHeight}}px;">
<view class="title">三品慧采</view>
<view class="display_J_B topCont">
<view class="address display_J_B display_A_C" catchtap="map">
<image class="address-icon" src="/icon/index-address.png"></image>
<view class="address-name GStitleOne">{{addressName}}</view>
<image class="address-right" src="/icon/down.png"></image>
</view>
<view class="top-search" catchtap='search'>
<view class="search">
<image src="/icon/search.png"></image>
<input placeholder="搜索您想要的商品" disabled="true" placeholder-style="color:#aaa;"></input>
</view>
<view catchtap='search' class="sear">搜索</view>
</view>
</view>
<!-- bannner -->
<!-- <swiper class='banner' previous-margin='35rpx' next-margin='35rpx' indicator-dots='true' autoplay='true' interval='5000' duration='1000' circular='true'> -->
<swiper class='bannner' indicator-dots='true' autoplay='true' interval='5000' duration='1000' circular='true'>
<block wx:for="{{bnrUrl}}" wx:key="index">
<swiper-item catchtap="goodsDetails" data-type='{{item.bannerJump}}' data-wid='{{item.welfareId}}' data-id='{{item.goodsId}}'>
<image src='{{item.bannerImage}}'></image>
</swiper-item>
</block>
</swiper>
<!-- 金刚区 -->
<view class="jg">
<view class="jg-cont" wx:for='{{jg}}' wx:key='index' catchtap="jgType" data-id='{{item.id}}' data-pid='{{item.pid}}'>
<image src="{{item.typePhoto}}"></image>
<view class="jg-name">{{item.typeName}}</view>
</view>
<view class="jg-cont" catchtap="jgMore">
<image src="/icon/index-more.png"></image>
<view class="jg-name">更多</view>
</view>
</view>
</view>
<view class="top" style="background: url({{bgImg}}index-top.png) no-repeat;background-size: 100%;padding-top:{{statusBarHeight}}px;">
<view class="title">三品慧采</view>
<view class="display_J_B topCont">
<view class="address display_J_B display_A_C" catchtap="map">
<image class="address-icon" src="/icon/index-address.png"></image>
<view class="address-name GStitleOne">{{addressName}}</view>
<image class="address-right" src="/icon/down.png"></image>
</view>
<view class="top-search" catchtap='search'>
<view class="search">
<image src="/icon/search.png"></image>
<input placeholder="搜索您想要的商品" disabled="true" placeholder-style="color:#aaa;"></input>
</view>
<view catchtap='search' class="sear">搜索</view>
</view>
</view>
<!-- bannner -->
<!-- <swiper class='banner' previous-margin='35rpx' next-margin='35rpx' indicator-dots='true' autoplay='true' interval='5000' duration='1000' circular='true'> -->
<swiper class='bannner' indicator-dots='true' autoplay='true' interval='5000' duration='1000' circular='true'>
<block wx:for="{{bnrUrl}}" wx:key="index">
<swiper-item catchtap="goodsDetails" data-type='{{item.bannerJump}}' data-wid='{{item.welfareId}}' data-id='{{item.goodsId}}'>
<image src='{{item.bannerImage}}'></image>
</swiper-item>
</block>
</swiper>
<!-- 金刚区 -->
<view class="jg">
<view class="jg-cont" wx:for='{{jg}}' wx:key='index' catchtap="jgType" data-id='{{item.id}}' data-pid='{{item.pid}}'>
<image src="{{item.typePhoto}}"></image>
<view class="jg-name">{{item.typeName}}</view>
</view>
<view class="jg-cont" catchtap="jgMore">
<image src="/icon/index-more.png"></image>
<view class="jg-name">更多</view>
</view>
</view>
</view>
</view>
<view class="fx" catchtap="fx">
<image wx:for="{{imgList}}" wx:if="{{item.bannerType==6}}" src="{{item.bannerImage}}"></image>
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==6}}" src="{{item.bannerImage}}"></image>
</view>
<view class="fl display_J_B">
<view catchtap="fl1">
<image wx:for="{{imgList}}" wx:if="{{item.bannerType==7}}" src="{{item.bannerImage}}"></image>
</view>
<view catchtap="fl2">
<image wx:for="{{imgList}}" wx:if="{{item.bannerType==8}}" src="{{item.bannerImage}}"></image>
</view>
<view catchtap="fl1">
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==7}}" src="{{item.bannerImage}}"></image>
</view>
<view catchtap="fl2">
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==8}}" src="{{item.bannerImage}}"></image>
</view>
</view>
<!-- 促销专区 -->
<view class="cx" wx:if='{{cxGoodsList.length>0}}'>
<view class="cx-top display_J_B" >
<view class="cx-topl display_A_C">
<text class="cx-topl1">促销</text>
<text class="cx-topl2">专区</text>
<text class="cx-topl3">好物优选</text>
</view>
<view class="cx-topr display_A_C" catchtap="cx_more">
更多<image src="/icon/index-cx.png"></image>
</view>
</view>
<view class="cx" wx:if='{{cxGoodsList.length>0}}'>
<view class="cx-top display_J_B">
<view class="cx-topl display_A_C">
<text class="cx-topl1">促销</text>
<text class="cx-topl2">专区</text>
<text class="cx-topl3">好物优选</text>
</view>
<view class="cx-topr display_A_C" catchtap="cx_more">
更多<image src="/icon/index-cx.png"></image>
</view>
</view>
<!--增加一列-->
<view class="cx-goods display_J_B" wx:if='{{cxGoodsList.length>0}}'>
<!--增加一列-->
<view class="cx-goods display_J_B" wx:if='{{cxGoodsList.length>0}}'>
<view class="cg" wx:for="{{cxGoodsList}}" wx:key='index' wx:if="{{index < 3}}" data-id='{{item.id}}' catchtap="cxDetails">
<view class="cg-img display_J_C"><image src="{{item.goodsPhoto}}"></image></view>
<view class="cg-name">¥{{item.wisdGoodsSpecList[0].specPromotionPrice}}
<text>¥{{item.wisdGoodsSpecList[0].originalPrice}}</text>
</view>
</view>
<view class="cg" wx:for="{{cxGoodsList}}" wx:key='index' wx:if="{{index < 3}}" data-id='{{item.id}}' catchtap="cxDetails">
<view class="cg-img display_J_C">
<image src="{{item.goodsPhoto}}"></image>
</view>
<view class="cg-name">¥{{item.wisdGoodsSpecList[0].specPromotionPrice}}
<text>¥{{item.wisdGoodsSpecList[0].originalPrice}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 专区 -->
<view class="zone display_J_B">
<view class="zone-l" data-title='积分专区' catchtap="integral" style="background: url({{bgImg}}zone-1.png) no-repeat;background-size: 100%;">
<view class="zone-name zone-name__1">积分专区</view>
<view class="zone-tips" style="text-align: center;">尊享美好生活</view>
<view class="zone-icon zone-icon__1 display_J_C display_A_C">
GO<image src="/icon/zone-right.png"></image>
</view>
<image wx:for="{{imgList}}" wx:if="{{item.bannerType==9}}" src="{{item.bannerImage}}"></image>
</view>
<view class="zone-r">
<view class="zone-2 display_J_B" data-title='节令甄选' catchtap="integral" style="background: url({{bgImg}}zone-2.png) no-repeat;background-size: 100%;">
<view class="zone-2__l">
<view class="zone-name zone-name__2">节令甄选</view>
<view class="zone-tips zone-tips__2">为您精心挑选</view>
<view class="zone-icon zone-icon__2 display_J_C display_A_C">GO<image src="/icon/zone-right.png"></image>
</view>
</view>
<image wx:for="{{imgList}}" wx:if="{{item.bannerType==10}}" src="{{item.bannerImage}}"></image>
</view>
<view class="zone-2 display_J_B" data-title='热卖专区' catchtap="integral" style="background: url({{bgImg}}zone-3.png) no-repeat;background-size: 100%;margin-top:30rpx;">
<view class="zone-2__l">
<view class="zone-name zone-name__3">热卖专区</view>
<view class="zone-tips zone-tips__2">所有人都在买</view>
<view class="zone-icon zone-icon__3 display_J_C display_A_C">GO<image src="/icon/zone-right.png"></image>
</view>
</view>
<image wx:for="{{imgList}}" wx:if="{{item.bannerType==11}}" src="{{item.bannerImage}}"></image>
</view>
</view>
<view class="zone-l" data-title='积分专区' catchtap="integral" style="background: url({{bgImg}}zone-1.png) no-repeat;background-size: 100%;">
<view class="zone-name zone-name__1">积分专区</view>
<view class="zone-tips" style="text-align: center;">尊享美好生活</view>
<view class="zone-icon zone-icon__1 display_J_C display_A_C">
GO<image src="/icon/zone-right.png"></image>
</view>
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==9}}" src="{{item.bannerImage}}"></image>
</view>
<view class="zone-r">
<view class="zone-2 display_J_B" data-title='节令甄选' catchtap="integral" style="background: url({{bgImg}}zone-2.png) no-repeat;background-size: 100%;">
<view class="zone-2__l">
<view class="zone-name zone-name__2">节令甄选</view>
<view class="zone-tips zone-tips__2">为您精心挑选</view>
<view class="zone-icon zone-icon__2 display_J_C display_A_C">GO<image src="/icon/zone-right.png"></image>
</view>
</view>
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==10}}" src="{{item.bannerImage}}"></image>
</view>
<view class="zone-2 display_J_B" data-title='热卖专区' catchtap="integral" style="background: url({{bgImg}}zone-3.png) no-repeat;background-size: 100%;margin-top:30rpx;">
<view class="zone-2__l">
<view class="zone-name zone-name__3">热卖专区</view>
<view class="zone-tips zone-tips__2">所有人都在买</view>
<view class="zone-icon zone-icon__3 display_J_C display_A_C">GO<image src="/icon/zone-right.png"></image>
</view>
</view>
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==11}}" src="{{item.bannerImage}}"></image>
</view>
</view>
</view>
<view class="goods">
<view class="type-all display_J_S">
<view class="type {{item.active?'type-active':''}}" wx:for='{{type}}' wx:key='index' catchtap="goodsType" data-index='{{index}}' data-id='{{item.id}}'>
<view class="type-name GStitleOne">{{item.typeName}}</view>
<view class="type-label">{{item.typeLabel}}</view>
</view>
</view>
<view class="type-all display_J_S">
<view class="type {{item.active?'type-active':''}}" wx:for='{{type}}' wx:key='index' catchtap="goodsType" data-index='{{index}}' data-id='{{item.id}}'>
<view class="type-name GStitleOne">{{item.typeName}}</view>
<view class="type-label">{{item.typeLabel}}</view>
</view>
</view>
</view>
<view class="cont-all">
<view class="cont" catchtap="goodsDetails" data-type='1' data-id='{{item.id}}' wx:for='{{goods}}' wx:key='index'>
<image class="goods-img" src="{{item.goodsPhoto}}"></image>
<view class="goods-name GStitleTwo">{{item.goodsName}}</view>
<view class="goods-price">
<view class="price">
<text class="price-text1">¥</text>{{item.price}}
<text class="price-text2">¥{{item.wisdGoodsSpecList[0].originalPrice}}</text>
</view>
</view>
<view class="goods-sales">已出售{{item.goodsSales}}件</view>
</view>
<view class="empty" wx:if='{{goods.length==0}}'>暂无此类商品~</view>
</view>
<view class="cont" catchtap="goodsDetails" data-type='1' data-id='{{item.id}}' wx:for='{{goods}}' wx:key='index'>
<image class="goods-img" src="{{item.goodsPhoto}}"></image>
<view class="goods-name GStitleTwo">{{item.goodsName}}</view>
<view class="goods-price">
<view class="price">
<text class="price-text1">¥</text>{{item.price}}
<text class="price-text2">¥{{item.wisdGoodsSpecList[0].originalPrice}}</text>
</view>
</view>
<view class="goods-sales">已出售{{item.goodsSales}}件</view>
</view>
<view class="empty" wx:if='{{goods.length==0}}'>暂无此类商品~</view>
</view>

View File

@ -277,6 +277,12 @@ Page({
},
// 评价订单
rate(e){
wx.navigateTo({
url: '/pages/rate/rate',
})
},
// 删除订单
del(e) {
let orderId = this.data.goods.id

View File

@ -148,6 +148,7 @@
<view class="btn" wx:if="{{goods.status==5||goods.status==4}}" catchtap="del">删除订单</view>
<view class="btn" wx:if="{{goods.status==3}}" data-item='{{goods}}' data-logistics-num='{{goods.logisticsNum}}' data-logistics-name="{{goods.logisticsName}}" catchtap="viewLogisticsDetails">物流查询</view>
<view class="btn btn-red" catchtap="confirm" wx:if="{{goods.status==3}}">确认收货</view>
<view class="btn btn-red" catchtap="rate" wx:if="{{goods.status==4}}">评价</view>
</view>
<!-- 待支付 -->

97
pages/rate/rate.js Normal file
View File

@ -0,0 +1,97 @@
// pages/rate/rate.js
Page({
/**
* 页面的初始数据
*/
data: {
stars: 0,
description: ""
},
setStarNum(e) {
const { stars } = e.currentTarget.dataset
this.setData({
stars
})
},
handleTextInput(e) {
this.setData({
description: e.detail.value
})
},
submitRate() {
const { stars, description } = this.data
if (stars === 0) {
wx.showToast({
title: '请选择评分',
icon: "error"
})
return
}
if (!description) {
wx.showToast({
title: '请输入评价内容',
icon: "error"
})
return
}
wx.showToast({
title: 'TODO: WIP',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/rate/rate.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

13
pages/rate/rate.wxml Normal file
View File

@ -0,0 +1,13 @@
<!--pages/rate/rate.wxml-->
<view style="padding: 48rpx;">
<view class="star-rate">
<text class="title">商品评价</text>
<view class="stars">
<image wx:for="{{5}}" wx:key="item" data-stars="{{item+1}}" bind:tap="setStarNum" src="{{item >= stars ? '/icon/star-gray.svg' : '/icon/star-solid.svg'}}" class="star" />
</view>
</view>
<view class="rate-description">
<textarea placeholder="请输入评价详情" bindinput="handleTextInput" value="{{description}}"></textarea>
</view>
<button style="margin-top: 48rpx;" bind:tap="submitRate" type="primary">发布评价</button>
</view>

31
pages/rate/rate.wxss Normal file
View File

@ -0,0 +1,31 @@
/* pages/rate/rate.wxss */
.star-rate {
display: flex;
align-items: center;
}
.star-rate .stars {
display: flex;
margin-left: 16rpx;
}
.star-rate .title {
font-size: 36rpx;
}
.star-rate .stars .star {
width: 48rpx;
height: 48rpx;
}
.star-rate .stars .star:not(:first-of-type) {
margin-left: 12rpx;
}
.rate-description {
margin-top: 48rpx;
border: 1px solid rgb(209 213 219);
border-radius: 12rpx;
padding: 16rpx
}