|
@@ -63,7 +63,7 @@
|
|
<view class="text" v-if="item.status === '1'">
|
|
<view class="text" v-if="item.status === '1'">
|
|
实付款: ¥{{item.buyPrice}}元
|
|
实付款: ¥{{item.buyPrice}}元
|
|
</view>
|
|
</view>
|
|
- <view class="button" v-if="item.status === '0'">
|
|
|
|
|
|
+ <view class="button error" v-if="item.status === '0'" @click.stop="onPay(item)">
|
|
待支付
|
|
待支付
|
|
</view>
|
|
</view>
|
|
<view class="button" v-if="item.status === '2'">
|
|
<view class="button" v-if="item.status === '2'">
|
|
@@ -87,6 +87,7 @@
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
|
import { query } from '@/api/order.js'
|
|
import { query } from '@/api/order.js'
|
|
|
|
+ import { msgError, msgSuccess } from '@/utils/common'
|
|
|
|
|
|
const searchInputStyle = {
|
|
const searchInputStyle = {
|
|
backgroundColor: '#E5E5E5'
|
|
backgroundColor: '#E5E5E5'
|
|
@@ -137,6 +138,26 @@
|
|
// 培训课程
|
|
// 培训课程
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ function onPay(order) {
|
|
|
|
+ wx.requestPayment({
|
|
|
|
+ timeStamp: order.prepay.timeStamp,
|
|
|
|
+ nonceStr: order.prepay.nonceStr,
|
|
|
|
+ package: order.prepay.package,
|
|
|
|
+ signType: order.prepay.signType,
|
|
|
|
+ paySign: order.prepay.paySign,
|
|
|
|
+ success (res) {
|
|
|
|
+ msgSuccess('支付成功')
|
|
|
|
+ onSearch()
|
|
|
|
+ },
|
|
|
|
+ fail (res) {
|
|
|
|
+ // console.log('支付失败', res)
|
|
|
|
+ const errMsg = res.errMsg
|
|
|
|
+ if (errMsg.indexOf('fail cancel')) {
|
|
|
|
+ msgError('已取消支付')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
function onSearchConfirm() {
|
|
function onSearchConfirm() {
|
|
searchForm.value.pageNumber = 1
|
|
searchForm.value.pageNumber = 1
|
|
@@ -176,6 +197,7 @@
|
|
}
|
|
}
|
|
onPullDownRefresh((e) => {
|
|
onPullDownRefresh((e) => {
|
|
searchForm.value.pageNumber = 1
|
|
searchForm.value.pageNumber = 1
|
|
|
|
+ searchForm.value.type = searchType[searchForm.value.type].value
|
|
loadMoreStatus.value = 'more'
|
|
loadMoreStatus.value = 'more'
|
|
query(searchForm.value).then(res => {
|
|
query(searchForm.value).then(res => {
|
|
if (res && res.message === 'success') {
|
|
if (res && res.message === 'success') {
|
|
@@ -308,6 +330,9 @@
|
|
padding: 6rpx 25rpx;
|
|
padding: 6rpx 25rpx;
|
|
border-radius: $uni-card-border-radius;
|
|
border-radius: $uni-card-border-radius;
|
|
}
|
|
}
|
|
|
|
+ .error {
|
|
|
|
+ background-color: $uni-color-error;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|