[锶源昆仑-寺庙捐赠活动]

This commit is contained in:
2023-05-15 13:53:32 +08:00
parent 1b6eb2668c
commit c9b18c9074
284 changed files with 9505 additions and 3822 deletions

View File

@@ -2,6 +2,8 @@
<view class="content">
<view class="header">
<view class="tabs">
<view class="item" :class="{'show': listType == ''}" @click="onTabs('')">全部</view>
<view class="item" :class="{'show': listType == 'unpay'}" @click="onTabs('unpay')">待支付</view>
<view class="item" :class="{'show': listType == 'paid'}" @click="onTabs('paid')">待发货</view>
<view class="item" :class="{'show': listType == 'delivered'}" @click="onTabs('delivered')">已发货</view>
<view class="item" :class="{'show': listType == 'signed'}" @click="onTabs('signed')">已签收</view>
@@ -14,7 +16,9 @@
<view class="order-top-tips">{{ item.state }}</view>
</view>
<view class="order-name" v-for="(goodItem, index) in item.items" :key="index">
<image class="order-img" :src="goodItem.sku.cover" mode="aspectFill"></image>
<!-- <image class="order-img" :src="goodItem.sku.cover" mode="aspectFill"></image> -->
<!-- 先默认固定图 -->
<image class="order-img" src="@/static/imgs/photo.png" mode="widthFix"></image>
<view class="order-goods">
<view class="order-label">
<view class="nowrap order-label-name">
@@ -31,13 +35,23 @@
</view>
<view class="order-text">
<view class="order-time">下单时间{{ item.created_at }}</view>
<view class="order-price">合计金额<text class="red">{{ item.amount }}</text></view>
<!-- <view class="order-price">合计金额<text class="red">{{ item.amount }}</text></view> -->
</view>
<view class="order-btn">
<view class="order-btn-atn active" @click="orderSign(item.order_no)" v-if="item.can.sign == true">立即签收</view>
<view class="order-btn-atn" @click="$Router.push({name: 'OrderDetails', params: { orderNo: item.order_no, listType: listType}})">订单详情</view>
<!-- <view class="order-btn-atn" @click="$Router.push({name: 'OrderDetails', params: { orderNo: item.order_no, listType: listType}})">订单详情</view> -->
<view class="order-btn-atn" v-if="item.can.pay" @click="cancel(item.order_no)">取消支付</view>
<view class="order-btn-atn active" v-if="item.can.pay" @click="$Router.push({name: 'indexPay', params: { orderNo: item.order_no, total: item.total }})">去支付</view>
<view class="order-btn-atn active" v-if="item.can.sign" @click="signcel(item.order_no)">签收</view>
</view>
</view>
<view class="pagesLoding" v-if="lodingStats">
<block v-if="page.has_more">
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block v-else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" v-else>
<image src="/static/imgs/coupon_null.png"></image>
@@ -47,12 +61,16 @@
</template>
<script>
import { orders, goodsSign } from '@/apis/interfaces/user'
const jweixin = require('jweixin-module');
import { donationPay } from '@/apis/interfaces/mall'
import { orders, goodsSign, goodsCancel } from '@/apis/interfaces/user'
export default {
data() {
return {
listType: 'paid',
orderArr: [], //订单列表
listType : '', //unpay待付款paid待发货delivered已发货signed已签收
orderArr : [], //订单列表
page : {}, //分页信息
lodingStats : false //加载状态
}
},
onLoad() {
@@ -63,11 +81,19 @@
},
methods: {
// 商品详情数据
ordersInfo() {
ordersInfo(page) {
orders({
state: this.listType
state: this.listType,
page : page || 1
}).then(res => {
this.orderArr = res.data
let listArr = this.orderArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.orderArr = newData
this.page = res.page
this.lodingStats= false
uni.stopPullDownRefresh()
}).catch(err => {
uni.showToast({
title: err.message,
@@ -82,27 +108,121 @@
this.listType = val
// 商品详情数据
this.page = {};
this.ordersInfo();
},
// 支付
stockForm(order_no) {
// 微信支付
donationPay(order_no, {
type : 'mp',
openid: ''
}).then(res => {
let wxConfig = JSON.parse(res.wechat)
jweixin.config({
appId: wxConfig.appId,
debug: false,
jsApiList: ['chooseWXPay'],
signature: wxConfig.signature,
nonceStr: wxConfig.nonceStr,
timestamp: wxConfig.timestamp,
})
jweixin.ready(() => {
jweixin.chooseWXPay({
timestamp: wxConfig.timeStamp,
nonceStr: wxConfig.nonceStr,
package: wxConfig.package,
signType: wxConfig.signType,
paySign: wxConfig.paySign,
success: payRes => {
uni.showToast({
title: '支付成功',
icon: 'none'
})
this.disabled = true
setTimeout(()=>{
this.$Router.replace({ name: 'OrderIndex', params: { listType: 'paid' }});
},1000)
},
fail: payfail => {
uni.showToast({
title: '取消支付',
icon: 'none'
})
this.disabled = true
setTimeout(()=>{
this.$Router.replace({ name: 'OrderIndex', params: { listType: 'unpay' }});
},1000)
}
});
});
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
// 取消订单
cancel(e) {
uni.showModal({
title: '订单提示',
content: '是否取消订单支付',
confirmColor: '#8b64fd',
showCancel:false,
success: res=> {
goodsCancel(e).then(CancelRes => {
// 获取订单列表
this.ordersInfo();
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
})
},
// 签收订单
signcel(e) {
uni.showModal({
title: '订单提示',
content: '是否签收订单',
confirmColor: '#8b64fd',
showCancel:false,
success: res=> {
goodsSign(e).then(CancelRes => {
// 获取订单列表
this.ordersInfo();
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
}
})
},
// 立即签收
orderSign(orderNo) {
goodsSign(orderNo).then(res => {
uni.showToast({
title: '签收成功',
icon: "none"
})
setTimeout(()=>{
// 商品详情数据
this.ordersInfo();
},2000)
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取账变记录
this.logsList();
},
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
// 获取账变记录
this.logsList(pageNumber);
}
}
}
}
@@ -144,7 +264,7 @@
}
.order-top-tips {
font-size: 26rpx;
color: #edb25f;
color: #eb504c;
}
}
@@ -205,7 +325,7 @@
.order-price {
text {
font-weight: 600;
color: #6d79ec;
color: #1d37e2;
}
}
}
@@ -226,7 +346,7 @@
margin-left: 15rpx;
font-size: 24rpx;
&.active {
color: #6d79ec;
color: #1d37e2;
border-color: #bfc5ff;
}
}
@@ -250,8 +370,8 @@
height: 60rpx;
line-height: 60rpx;
&.show{
color: #6d79ec;
border-bottom: solid 4rpx #6d79ec;
color: #1d37e2;
border-bottom: solid 4rpx #1d37e2;
}
}
}
@@ -270,8 +390,8 @@
margin-right: $margin/2;
color: $text-gray;
&.show{
background-color:#6d79ec;
color: #6d79ec;
background-color:#1d37e2;
color: #1d37e2;
}
}
}