[锶源昆仑-寺庙捐赠活动]
This commit is contained in:
@@ -25,19 +25,21 @@
|
||||
|
||||
<view class="While orderGoods">
|
||||
<view class="orderGoods-wares" v-for="(item, index) in goodsData.items" :key="index">
|
||||
<image class="orderGoods-img" :src="item.sku.cover" mode="aspectFill"></image>
|
||||
<!-- <image class="orderGoods-img" :src="item.sku.cover" mode="aspectFill"></image> -->
|
||||
<!-- 先默认固定图 -->
|
||||
<image class="orderGoods-img" src="@/static/imgs/photo.png" mode="widthFix"></image>
|
||||
<view class="orderGoods-cont">
|
||||
<view class="nowrap orderGoods-name">{{ item.sku.goods_name }}</view>
|
||||
<view class="orderGoods-price">
|
||||
<text>¥{{ item.sku.price }}</text>
|
||||
x{{ item.qty }}
|
||||
<text>x{{ item.qty }}</text>
|
||||
<!-- x{{ item.qty }} -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderGoods-brief">
|
||||
<!-- <view class="orderGoods-brief">
|
||||
<view>商品总价</view>
|
||||
<text>¥{{ goodsData.amount }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="While reserveCont">
|
||||
@@ -54,25 +56,48 @@
|
||||
<view class="reserve-name">交易状态</view>
|
||||
<view class="reserve-text green">{{ goodsData.state }}</view>
|
||||
</view>
|
||||
<view class="reserve-label">
|
||||
<!-- <view class="reserve-label">
|
||||
<view class="reserve-name">实际金额</view>
|
||||
<view class="reserve-text reserve-price">¥{{ goodsData.total }}.00</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="While reserveCont" v-if="express.express_name">
|
||||
<view class="reserveCont-title">物流信息</view>
|
||||
<view class="reserve-label">
|
||||
<view class="reserve-name">物流公司</view>
|
||||
<view class="reserve-text">{{ express.express_name }}</view>
|
||||
</view>
|
||||
<view class="reserve-label">
|
||||
<view class="reserve-name">收货姓名</view>
|
||||
<view class="reserve-text green">{{ express.name }}</view>
|
||||
</view>
|
||||
<view class="reserve-label">
|
||||
<view class="reserve-name">收货电话</view>
|
||||
<view class="reserve-text green">{{ express.mobile }}</view>
|
||||
</view>
|
||||
<view class="reserve-label">
|
||||
<view class="reserve-name">物流单号</view>
|
||||
<view class="reserve-text">{{ express.express_no }}<view class="reserve-copy" @tap="copyUrl(express.express_noo)">复制</view></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-data-footer">
|
||||
<view class="order-btn" open-type="navigateBack" @click="$Router.push({name: 'OrderIndex', params: { listType: $Route.query.listType}})">返回订单</view>
|
||||
<!-- @click="$Router.replaceAll({name: 'OrderIndex', params: { listType: $Route.query.listType}})" -->
|
||||
<view class="order-btn" open-type="navigateBack" @click="$router.back()">返回订单</view>
|
||||
<view class="order-btn" @click="signClick()" v-if="sign">签收订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { goodsDet } from '@/apis/interfaces/user'
|
||||
import { goodsDet, goodsSign } from '@/apis/interfaces/user'
|
||||
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsData: '', //详情
|
||||
sign: '', //签收
|
||||
express: '' //物流
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -84,6 +109,8 @@
|
||||
goodsInfo() {
|
||||
goodsDet(this.$Route.query.orderNo).then(res => {
|
||||
this.goodsData = res
|
||||
this.sign = res.can.sign
|
||||
this.express = res.express
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -105,7 +132,31 @@
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 订单签收
|
||||
signClick() {
|
||||
uni.showModal({
|
||||
title : '提示',
|
||||
content : '是否签收',
|
||||
success : res=> {
|
||||
if (res.confirm) {
|
||||
goodsSign(this.$Route.query.orderNo).then(res => {
|
||||
uni.showToast({
|
||||
title:'签收成功',
|
||||
icon:'none'
|
||||
})
|
||||
this.$Router.back()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -136,8 +187,8 @@
|
||||
// 订单
|
||||
.orderData-cont-label {
|
||||
padding: 40rpx 30rpx;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border-bottom: #f2f2f2 2rpx solid;
|
||||
.orderData-cont-img {
|
||||
width: 48rpx;
|
||||
@@ -145,11 +196,8 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
.orderData-cont-text {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
padding: 25rpx 30rpx 0 120rpx;
|
||||
width: calc(100% - 68rpx);
|
||||
margin-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.orderData-cont-name {
|
||||
margin-bottom: 10rpx;
|
||||
@@ -168,7 +216,7 @@
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
view {
|
||||
color: #edb25f;
|
||||
color: #eb504c;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +228,6 @@
|
||||
box-sizing: border-box;
|
||||
.orderGoods-wares {
|
||||
position: relative;
|
||||
margin-bottom: 10rpx;
|
||||
.orderGoods-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
@@ -231,6 +278,7 @@
|
||||
display: flex;
|
||||
padding: 0 30rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: $title-size-m;
|
||||
.reserve-name {
|
||||
flex: 1;
|
||||
width: 200rpx;
|
||||
@@ -243,7 +291,18 @@
|
||||
line-height: 50rpx;
|
||||
&.reserve-price {
|
||||
font-weight: 600;
|
||||
color: #6d79ec;
|
||||
color: #1d37e2;
|
||||
}
|
||||
.reserve-copy {
|
||||
color: #6774ff;
|
||||
border: #6774ff 2rpx solid;
|
||||
display: inline-block;
|
||||
height: 34rpx;
|
||||
line-height: 34rpx;
|
||||
font-size: $title-size-sm;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 4rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user