订单评价, WIP
This commit is contained in:
8
app.js
8
app.js
@ -123,7 +123,7 @@ App({
|
||||
})
|
||||
},
|
||||
//分享的积分
|
||||
share(){
|
||||
share() {
|
||||
wx.request({
|
||||
url: this.globalData.ip + '/wisdommining/api/user/putIntetralEarnings',
|
||||
method: 'PUT',
|
||||
@ -131,7 +131,7 @@ App({
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {
|
||||
userId:this.globalData.userId
|
||||
userId: this.globalData.userId
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
@ -146,8 +146,8 @@ App({
|
||||
bgImg: 'https://sanpinhuicai.com/wisdommining/static/icon/bg/',//背景图片地址
|
||||
|
||||
// ip: 'http://106.54.198.47/', //接口地址
|
||||
ip: 'https://sanpinhuicai.com/', //接口地址
|
||||
// ip: 'http://192.168.0.112:9000/', //接口地址/
|
||||
// ip: 'https://sanpinhuicai.com/', //接口地址
|
||||
ip: 'http://192.168.0.112:9000/', //接口地址/
|
||||
// ip: 'http://127.0.0.1:9000/', //接口地址/
|
||||
|
||||
//appId wx65c9560afc9cbaa7
|
||||
|
3
app.json
3
app.json
@ -44,7 +44,8 @@
|
||||
"pages/my/my_feedback_list/list_details/list_details",
|
||||
"pages/my/after_sales_next/after_sales_next",
|
||||
"pages/my/after_jilu/after_jilu",
|
||||
"pages/logistics_details/logistics_details"
|
||||
"pages/logistics_details/logistics_details",
|
||||
"pages/rate/rate"
|
||||
],
|
||||
"entryPagePath": "pages/index/index",
|
||||
"window": {
|
||||
|
1
icon/star-gray.svg
Normal file
1
icon/star-gray.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#c3c6d1" d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"/></svg>
|
After Width: | Height: | Size: 580 B |
1
icon/star-solid.svg
Normal file
1
icon/star-solid.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#FFD43B" d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"/></svg>
|
After Width: | Height: | Size: 580 B |
@ -40,19 +40,19 @@
|
||||
</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>
|
||||
<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:if="{{item.bannerType==8}}" src="{{item.bannerImage}}"></image>
|
||||
<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-top display_J_B">
|
||||
<view class="cx-topl display_A_C">
|
||||
<text class="cx-topl1">促销</text>
|
||||
<text class="cx-topl2">专区</text>
|
||||
@ -68,7 +68,9 @@
|
||||
<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-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>
|
||||
@ -86,7 +88,7 @@
|
||||
<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>
|
||||
<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%;">
|
||||
@ -96,7 +98,7 @@
|
||||
<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>
|
||||
<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">
|
||||
@ -105,7 +107,7 @@
|
||||
<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>
|
||||
<image wx:for="{{imgList}}" wx:key="id" wx:if="{{item.bannerType==11}}" src="{{item.bannerImage}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -133,4 +135,3 @@
|
||||
</view>
|
||||
<view class="empty" wx:if='{{goods.length==0}}'>暂无此类商品~</view>
|
||||
</view>
|
||||
|
||||
|
@ -277,6 +277,12 @@ Page({
|
||||
|
||||
},
|
||||
|
||||
// 评价订单
|
||||
rate(e){
|
||||
wx.navigateTo({
|
||||
url: '/pages/rate/rate',
|
||||
})
|
||||
},
|
||||
// 删除订单
|
||||
del(e) {
|
||||
let orderId = this.data.goods.id
|
||||
|
@ -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
97
pages/rate/rate.js
Normal 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
3
pages/rate/rate.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
13
pages/rate/rate.wxml
Normal file
13
pages/rate/rate.wxml
Normal 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
31
pages/rate/rate.wxss
Normal 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
|
||||
}
|
Reference in New Issue
Block a user