Commit 25b37130 by zqm

MM-评价,倒计时优化

parent 12350e31
......@@ -412,7 +412,12 @@ Page({
* @returns
*/
onOrderEvaluate: function (event) {
console.log(event.currentTarget.dataset, '----------------event.currentTarget.dataset');
let item = JSON.stringify(event.currentTarget.dataset.item)
wx.navigateTo({
url: `/pages/pay/order-comment/order-comment?orderItem=${item}`,
})
},
/**
* 缓存用户信息
......
......@@ -12,25 +12,19 @@ Page({
content: '', // 评价内容,
imgUrls: [], // 评价图片本地路径
orderInfo: {
orderId: '02aaa9a62d5645c59109218c27d2174a',
name: '精灵鸟理想国年卡',
price: '1680.00',
quantity: 4,
coverList: [
{
id: 0,
imgUrl: ''
id: '',
name: '',
amount: '',
commodity: []
},
{
id: 1,
imgUrl: ''
},
{
id: 2,
imgUrl: ''
}
]
},
onLoad: function (options) {
console.log(options, '----------options------');
let orderItem = JSON.parse(options.orderItem)
this.setData({
orderInfo: orderItem
})
},
/**
......@@ -41,9 +35,16 @@ Page({
*/
onChangeScore: function (event) {
// type 1: 服务评价 2: 产品评价 3: 环境评价
const { index, type } = event.currentTarget.dataset
const {
index,
type
} = event.currentTarget.dataset
console.log(index, type)
let { scoreServe, scoreProduct, scoreEnvironment } = this.data
let {
scoreServe,
scoreProduct,
scoreEnvironment
} = this.data
switch (type) {
case 1:
scoreServe = index + 1
......@@ -130,7 +131,7 @@ Page({
// fileUrls
// })
let formData = {}
formData.orderId = this.data.orderInfo.orderId
formData.orderId = this.data.orderInfo.id
formData.imgUrls = fileUrls,
formData.serviceEvaluation = this.data.scoreServeText
formData.productEvaluation = this.data.scoreProductText
......@@ -149,6 +150,9 @@ Page({
},
success: (response) => {
console.log(response)
wx.navigateBack({
delta: 0,
})
}
})
}
......
......@@ -6,22 +6,22 @@
<text>购买商品</text>
</view>
<view class="row align-c">
<block wx:for="{{orderInfo.coverList}}" wx:key="id">
<block wx:for="{{orderInfo.commodity}}" wx:key="id">
<view class="order-cover">
<image src="{{item.imgUrl}}"></image>
<image src="{{item.cover}}"></image>
</view>
</block>
<view class="order-name" wx:if="{{orderInfo.coverList.length === 1}}">
<view class="order-name" wx:if="{{orderInfo.commodity.length === 1}}">
<text>{{orderInfo.name}}</text>
</view>
<view class="order-price-wrapper col align-e">
<view class="order-price">
<text class="price-symbol">¥</text>
<text>{{orderInfo.price}}</text>
<text>{{orderInfo.amount}}</text>
</view>
<view class="order-quantity">
<text>{{'共' + orderInfo.quantity + '件'}}</text>
<text>{{'共' + orderInfo.commodity.length + '件'}}</text>
</view>
</view>
</view>
......
......@@ -142,6 +142,7 @@
padding: 30rpx 40rpx 0;
background-color: #fff;
border-top: 1px solid #E2E7EF;
z-index: 5;
}
.comment-btn {
width: 670rpx;
......
......@@ -14,7 +14,7 @@ Page({
codeInfo: {},
isFromUse: false,
winCode: false,
residuePayTime: "",//剩余支付时间
residuePayTime: "", //剩余支付时间
},
......@@ -39,6 +39,7 @@ Page({
* @returns
*/
queryOrderDetail: function () {
let that = this
App.wxRequest({
url: '/api/v1/order/getOrderDetail',
data: {
......@@ -75,23 +76,30 @@ Page({
funcOrderInfo.commodity.push(funcCommodityItem)
}
// 倒计时
let that = this
if (funcOrderInfo.state == 0) {
// 待付款状态
let doTime = 1 * 60 * 1000
let timeInter = setInterval(() => {
let creatdTime = new Date(funcOrderInfo.tipTimeSubmit.replace(/-/g, '/')).getTime()
let doTime = 15 * 60 * 1000
let endTime = creatdTime + doTime
let now = new Date().getTime()
let residueStamp = endTime - now
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss') // 57
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss')
if (residueStamp > 0) {
that.setData({
residuePayTime: residuePayTime
})
} else {
that.queryOrderDetail()
console.log(residueStamp, 'residueStamp----------------');
clearInterval(timeInter)
// that.queryOrderDetail()
let state = `orderInfo.state`
that.setData({
[state]: -1
})
}
}, 1000)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment