|
@@ -1,31 +1,52 @@
|
|
|
<template>
|
|
|
- <view class="container login" v-if="isShareStatus">
|
|
|
- <view class="container-main clearfix">
|
|
|
- <view class="main-title">此订单包含如下商品:</view>
|
|
|
- <view class="main-list clearfix">
|
|
|
- <view class="main-list-item" v-for="(item, index) in productList" :key="index">
|
|
|
- <view class="item-image"> <image :src="item.image" mode="scaleToFill"></image> </view>
|
|
|
- <view class="item-mesage">
|
|
|
- <view class="item-name">{{ item.name }}</view>
|
|
|
- <view class="item-num"><text>X</text>{{ item.num }}</view>
|
|
|
+ <view class="container login">
|
|
|
+ <tui-skeleton
|
|
|
+ v-if="skeletonShow"
|
|
|
+ backgroundColor="#fafafa"
|
|
|
+ borderRadius="10rpx"
|
|
|
+ :isLoading="true"
|
|
|
+ :loadingType="5"
|
|
|
+ ></tui-skeleton>
|
|
|
+ <template v-else>
|
|
|
+ <view class="container-main clearfix">
|
|
|
+ <view class="main-title">此订单包含如下商品:</view>
|
|
|
+ <view class="main-list clearfix">
|
|
|
+ <view class="main-list-item" v-for="(item, index) in productList" :key="index">
|
|
|
+ <view class="item-image"> <image :src="item.image" mode="scaleToFill"></image> </view>
|
|
|
+ <view class="item-mesage">
|
|
|
+ <view class="item-name">{{ item.name }}</view>
|
|
|
+ <view class="item-num"><text>X</text>{{ item.num }}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="container-footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
|
|
|
- <view class="login-btn" v-if="btnState.isPay" @click.stop="btnConfirmPay">立即支付</view>
|
|
|
- <view class="login-sub">
|
|
|
- <view class="btn" @click.stop="goLogin(1)">账号登录查看</view>
|
|
|
- <view class="btn" @click.stop="goLogin(2)">使用分享码查看</view>
|
|
|
- </view>
|
|
|
- <view class="pay-statustext">
|
|
|
- <view class="pay-statustext-inner">
|
|
|
- <view class="pay-text">
|
|
|
- <text>使用账号登录支持确认订单和直接付款,使用分享码只支持查看订单,不能操作</text>
|
|
|
+ <view class="container-footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
|
|
|
+ <view class="login-btn" v-if="btnState.isPay" @click.stop="btnConfirmPay">立即支付</view>
|
|
|
+ <view class="login-sub">
|
|
|
+ <view class="btn" @click.stop="goLogin(1)">账号登录查看</view>
|
|
|
+ <view class="btn" @click.stop="goLogin(2)">使用分享码查看</view>
|
|
|
+ </view>
|
|
|
+ <view class="pay-statustext">
|
|
|
+ <view class="pay-statustext-inner">
|
|
|
+ <view class="pay-text">
|
|
|
+ <text>使用账号登录支持确认订单和直接付款,使用分享码只支持查看订单,不能操作</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
+ <!-- 提示弹窗 -->
|
|
|
+ <tui-modal
|
|
|
+ :show="modal"
|
|
|
+ @click="handleClick"
|
|
|
+ :content="contentModalText"
|
|
|
+ :button="modalButton"
|
|
|
+ color="#333"
|
|
|
+ :size="32"
|
|
|
+ shape="circle"
|
|
|
+ :maskClosable="false"
|
|
|
+ >
|
|
|
+ </tui-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -36,7 +57,7 @@ export default {
|
|
|
isIphoneX: this.$store.state.isIphoneX,
|
|
|
shareCode: '', //获取用户登录的邀请码
|
|
|
isUserInfo: false, //控制显示授权弹窗
|
|
|
- isShareStatus: false,
|
|
|
+ skeletonShow: true,
|
|
|
productList: [],
|
|
|
params: {
|
|
|
code: '',
|
|
@@ -51,6 +72,18 @@ export default {
|
|
|
},
|
|
|
mapStateArr: [
|
|
|
{ label: 'isPay', val: [11, 12, 13, 21, 22, 23, 111], status: true }
|
|
|
+ ],
|
|
|
+ modal:false,
|
|
|
+ contentModalText: '', //操作文字提示语句
|
|
|
+ modalButton: [
|
|
|
+ {
|
|
|
+ text: '确定',
|
|
|
+ customStyle: {
|
|
|
+ color: '#fff',
|
|
|
+ bgColor: '#F3B574'
|
|
|
+ },
|
|
|
+ plain: false
|
|
|
+ }
|
|
|
]
|
|
|
}
|
|
|
},
|
|
@@ -65,26 +98,26 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async initQueryUser() {
|
|
|
- const getUserInfo = await authorize.getUserInfo('weixin')
|
|
|
- this.params.code = await authorize.getCode('weixin')
|
|
|
- this.params.iv = getUserInfo.iv
|
|
|
- this.params.encryptedData = getUserInfo.encryptedData
|
|
|
- this.OrderService.OrderShareCodeIdentity(this.params).then(response => {
|
|
|
- if (response.code == 0) {
|
|
|
+ try{
|
|
|
+ const getUserInfo = await authorize.getUserInfo('weixin')
|
|
|
+ this.params.code = await authorize.getCode('weixin')
|
|
|
+ this.params.iv = getUserInfo.iv
|
|
|
+ this.params.encryptedData = getUserInfo.encryptedData
|
|
|
+ const res = await this.OrderService.OrderShareCodeIdentity(this.params)
|
|
|
+ if(res.code === 0){
|
|
|
// 初始化订单商品数据
|
|
|
- console.log(response.msg)
|
|
|
this.getOrderCommodityData()
|
|
|
- } else if (response.code == 1) {
|
|
|
+ }else if (res.code === 1) {
|
|
|
// 同为会所运营人员查看订单详情
|
|
|
this.$api.navigateTo(`/pages/user/order/order-details?type=share&orderId=${this.params.orderId}`)
|
|
|
- } else if (response.code == 2) {
|
|
|
+ } else if (res.code === 2) {
|
|
|
// 协销查看分享订单
|
|
|
this.$api.navigateTo(
|
|
|
`/pages/seller/order/order-details?type=share&orderId=${this.params.orderId}&userId=${
|
|
|
this.params.userId
|
|
|
}`
|
|
|
)
|
|
|
- } else if (response.code == 3) {
|
|
|
+ } else if (res.code === 3) {
|
|
|
// 游客第二次查看订单详情
|
|
|
this.$api.redirectTo(
|
|
|
`/pages/user/order/order-sharedetails?orderId=${this.params.orderId}&userId=${
|
|
@@ -92,29 +125,54 @@ export default {
|
|
|
}`
|
|
|
)
|
|
|
} else {
|
|
|
- // 错误信息返回
|
|
|
- this.$util.modal('提示', response.msg, '确定', '', false, () => {})
|
|
|
+ this.modal = true
|
|
|
+ this.contentModalText = res.msg
|
|
|
}
|
|
|
- })
|
|
|
+ }catch(error){
|
|
|
+ // 错误信息返回
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
},
|
|
|
- getOrderCommodityData() {
|
|
|
+ async getOrderCommodityData() {
|
|
|
//查询订单商品信息s
|
|
|
- this.OrderService.OrderCommodityData({ orderId: this.params.orderId })
|
|
|
- .then(response => {
|
|
|
- const data = response.data
|
|
|
- this.productList = data.productList
|
|
|
- this.mapStateArr.forEach(el => {
|
|
|
- el.val.forEach(value => {
|
|
|
- if (!data.payButton && data.orderStatus === value) {
|
|
|
- this.btnState[el.label] = el.status
|
|
|
- }
|
|
|
- })
|
|
|
+ try{
|
|
|
+ const res = await this.OrderService.OrderCommodityData({ orderId: this.params.orderId })
|
|
|
+ const data = res.data
|
|
|
+ this.productList = data.productList
|
|
|
+ this.mapStateArr.forEach(el => {
|
|
|
+ el.val.forEach(value => {
|
|
|
+ if (!data.payButton && data.orderStatus === value) {
|
|
|
+ this.btnState[el.label] = el.status
|
|
|
+ }
|
|
|
})
|
|
|
- this.isShareStatus = true
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- this.$util.msg(error.msg, 2000)
|
|
|
})
|
|
|
+ this.skeletonShow = false
|
|
|
+ }catch(error){
|
|
|
+ console.log('查询订单商品信息失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ btnConfirmPay() {
|
|
|
+ // 待支付订单
|
|
|
+ this.getOrderPaymentValidation(this.params.orderId)
|
|
|
+ },
|
|
|
+ async getOrderPaymentValidation(orderId) {
|
|
|
+ //监听根据付款状态做操作
|
|
|
+ try{
|
|
|
+ const res = await this.OrderService.OrderPaymentValidation({ orderId: orderId })
|
|
|
+ const data = res.data
|
|
|
+ if(data.code == -1){
|
|
|
+ this.modal = true
|
|
|
+ this.contentModalText ='订单已申请全部退款,无需再付款!'
|
|
|
+ }else{
|
|
|
+ if (data.onlinePayFlag === 1) {// 只能线下
|
|
|
+ this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${orderId}`)
|
|
|
+ } else {
|
|
|
+ this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${orderId}`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch(error){
|
|
|
+ this.$util.msg(error.msg, 2000)
|
|
|
+ }
|
|
|
},
|
|
|
goLogin(index) {
|
|
|
switch (index) {
|
|
@@ -130,27 +188,12 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
},
|
|
|
- btnConfirmPay() {
|
|
|
- // 待支付订单
|
|
|
- this.getOrderPaymentValidation(this.params.orderId)
|
|
|
- },
|
|
|
- getOrderPaymentValidation(orderId) {
|
|
|
- //监听根据付款状态做操作
|
|
|
- this.OrderService.OrderPaymentValidation({ orderId: orderId })
|
|
|
- .then(response => {
|
|
|
- if(response.data.code == -1){
|
|
|
- this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
|
|
|
- }else{
|
|
|
- if (response.data.onlinePayFlag === 1) {// 只能线下
|
|
|
- this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${orderId}`)
|
|
|
- } else {
|
|
|
- this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${orderId}`)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- this.$util.msg(error.msg, 2000)
|
|
|
- })
|
|
|
+ handleClick(e){
|
|
|
+ //确认操作
|
|
|
+ if (e.index == 1) {
|
|
|
+ this.modal = false
|
|
|
+ }
|
|
|
+ this.modal = false
|
|
|
},
|
|
|
},
|
|
|
onShow() {}
|