Commit 25b37130 by zqm

MM-评价,倒计时优化

parent 12350e31
...@@ -412,7 +412,12 @@ Page({ ...@@ -412,7 +412,12 @@ Page({
* @returns * @returns
*/ */
onOrderEvaluate: function (event) { 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({ ...@@ -12,25 +12,19 @@ Page({
content: '', // 评价内容, content: '', // 评价内容,
imgUrls: [], // 评价图片本地路径 imgUrls: [], // 评价图片本地路径
orderInfo: { orderInfo: {
orderId: '02aaa9a62d5645c59109218c27d2174a', id: '',
name: '精灵鸟理想国年卡', name: '',
price: '1680.00', amount: '',
quantity: 4, commodity: []
coverList: [
{
id: 0,
imgUrl: ''
}, },
{
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({ ...@@ -41,9 +35,16 @@ Page({
*/ */
onChangeScore: function (event) { onChangeScore: function (event) {
// type 1: 服务评价 2: 产品评价 3: 环境评价 // type 1: 服务评价 2: 产品评价 3: 环境评价
const { index, type } = event.currentTarget.dataset const {
index,
type
} = event.currentTarget.dataset
console.log(index, type) console.log(index, type)
let { scoreServe, scoreProduct, scoreEnvironment } = this.data let {
scoreServe,
scoreProduct,
scoreEnvironment
} = this.data
switch (type) { switch (type) {
case 1: case 1:
scoreServe = index + 1 scoreServe = index + 1
...@@ -130,7 +131,7 @@ Page({ ...@@ -130,7 +131,7 @@ Page({
// fileUrls // fileUrls
// }) // })
let formData = {} let formData = {}
formData.orderId = this.data.orderInfo.orderId formData.orderId = this.data.orderInfo.id
formData.imgUrls = fileUrls, formData.imgUrls = fileUrls,
formData.serviceEvaluation = this.data.scoreServeText formData.serviceEvaluation = this.data.scoreServeText
formData.productEvaluation = this.data.scoreProductText formData.productEvaluation = this.data.scoreProductText
...@@ -149,6 +150,9 @@ Page({ ...@@ -149,6 +150,9 @@ Page({
}, },
success: (response) => { success: (response) => {
console.log(response) console.log(response)
wx.navigateBack({
delta: 0,
})
} }
}) })
} }
......
...@@ -6,22 +6,22 @@ ...@@ -6,22 +6,22 @@
<text>购买商品</text> <text>购买商品</text>
</view> </view>
<view class="row align-c"> <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"> <view class="order-cover">
<image src="{{item.imgUrl}}"></image> <image src="{{item.cover}}"></image>
</view> </view>
</block> </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> <text>{{orderInfo.name}}</text>
</view> </view>
<view class="order-price-wrapper col align-e"> <view class="order-price-wrapper col align-e">
<view class="order-price"> <view class="order-price">
<text class="price-symbol">¥</text> <text class="price-symbol">¥</text>
<text>{{orderInfo.price}}</text> <text>{{orderInfo.amount}}</text>
</view> </view>
<view class="order-quantity"> <view class="order-quantity">
<text>{{'共' + orderInfo.quantity + '件'}}</text> <text>{{'共' + orderInfo.commodity.length + '件'}}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -142,6 +142,7 @@ ...@@ -142,6 +142,7 @@
padding: 30rpx 40rpx 0; padding: 30rpx 40rpx 0;
background-color: #fff; background-color: #fff;
border-top: 1px solid #E2E7EF; border-top: 1px solid #E2E7EF;
z-index: 5;
} }
.comment-btn { .comment-btn {
width: 670rpx; width: 670rpx;
......
...@@ -14,7 +14,7 @@ Page({ ...@@ -14,7 +14,7 @@ Page({
codeInfo: {}, codeInfo: {},
isFromUse: false, isFromUse: false,
winCode: false, winCode: false,
residuePayTime: "",//剩余支付时间 residuePayTime: "", //剩余支付时间
}, },
...@@ -39,6 +39,7 @@ Page({ ...@@ -39,6 +39,7 @@ Page({
* @returns * @returns
*/ */
queryOrderDetail: function () { queryOrderDetail: function () {
let that = this
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderDetail', url: '/api/v1/order/getOrderDetail',
data: { data: {
...@@ -75,23 +76,30 @@ Page({ ...@@ -75,23 +76,30 @@ Page({
funcOrderInfo.commodity.push(funcCommodityItem) funcOrderInfo.commodity.push(funcCommodityItem)
} }
// 倒计时 // 倒计时
let that = this
if (funcOrderInfo.state == 0) { if (funcOrderInfo.state == 0) {
// 待付款状态
let doTime = 1 * 60 * 1000
let timeInter = setInterval(() => { let timeInter = setInterval(() => {
let creatdTime = new Date(funcOrderInfo.tipTimeSubmit.replace(/-/g, '/')).getTime() let creatdTime = new Date(funcOrderInfo.tipTimeSubmit.replace(/-/g, '/')).getTime()
let doTime = 15 * 60 * 1000
let endTime = creatdTime + doTime let endTime = creatdTime + doTime
let now = new Date().getTime() let now = new Date().getTime()
let residueStamp = endTime - now 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) { if (residueStamp > 0) {
that.setData({ that.setData({
residuePayTime: residuePayTime residuePayTime: residuePayTime
}) })
} else { } else {
that.queryOrderDetail()
console.log(residueStamp, 'residueStamp----------------');
clearInterval(timeInter) clearInterval(timeInter)
// that.queryOrderDetail()
let state = `orderInfo.state`
that.setData({
[state]: -1
})
} }
}, 1000) }, 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