pull/2/head
js199000126 2023-05-26 15:11:55 +08:00
parent 4f9bb936b4
commit 8938ee67c7
4 changed files with 196 additions and 214 deletions

View File

@ -97,10 +97,13 @@ export function orderData() {
* @param string id
*
*/
// export function orderCancel(id) {
// return request.post('front/order/cancel', {
// id: id
// }, {}, 1);
// }
export function orderCancel(id) {
return request.post('front/order/cancel', {
id: id
}, {}, 1);
return request.post('front/order/cancel?id=' + id);
}
/**

View File

@ -41,14 +41,8 @@
</view>
</view>
<view class="header_bottom">
<u-swiper
:list="bannerList"
keyName="picUrl"
height="100%"
radius="20rpx"
bgColor="transparent"
@click="goUrl"
></u-swiper>
<u-swiper :list="bannerList" keyName="picUrl" height="100%" radius="20rpx" bgColor="transparent"
@click="goUrl"></u-swiper>
</view>
</view>
<view class="notice" @tap="goNoticeDetail">
@ -184,7 +178,7 @@
import Loading from '@/components/Loading/index.vue';
const arrTemp = ["beforePay", "afterPay", "refundApply", "beforeRecharge", "createBargain", "pink"];
export default {
computed: mapGetters(['isLogin', 'uid']),
computed: mapGetters(['isLogin', 'uid','tenantId']),
components: {
tabNav,
goodList,
@ -269,7 +263,7 @@
page: 1,
limit: 10,
},
vip: {},//
vip: {}, //
tempArr: [], //
roll: [], //
site_name: '', //title
@ -335,53 +329,51 @@
// Promise.all([this.getAllCategory(), this.getIndexConfig()
// // , this.setVisit()
// ]);
// #ifdef MP
this.getTemlIds()
// #endif
},
onShow() {
this.getIndexConfig();
getUserInfo().then(res => {
this.userInfo = res.data
getTenant(153).then(res => {
getTenant(this.tenantId).then(res => {
this.tenant = res.data
this.text = res.data.notice
})
})
getHeader().then(res => {
this.vip = res.data
console.log(this.vip, '会员')
})
this.getBanners()
this.getIndexPage()
this.getIndexConfig();
// #ifdef MP
this.getTemlIds()
// #endif
},
onShow() {
let self = this
uni.setNavigationBarTitle({
title: self.site_name
})
},
methods: {
goUrl(e){
goUrl(e) {
let url = ''
if(this.bannerList[e].url.indexOf('http')>=0){
if (this.bannerList[e].url.indexOf('http') >= 0) {
url = this.bannerList[e].url
}else{
} else {
url = 'http://' + this.bannerList[e].url
}
window.open(url)
},
//
goEquity(){
console.log('goEmember_equity')
goEquity() {
uni.switchTab({
url:'/pages/member_equity/index'
url: '/pages/member_equity/index'
})
},
//
goNoticeDetail() {
uni.navigateTo({
url: '/pages/notice/index'
})
uni.navigateTo({
url: '/pages/notice/index'
})
},
//
searchSubmitValue: function() {
@ -397,32 +389,23 @@
//
addCart(id) {
getSpuDetail(id).then(res => {
console.log(res.data.productValue.默认.id, '1111111111111')
let unique = res.data.productValue.默认.id
postCartAdd({
productId: id,
productAttrUnique: unique,
cartNum: 1
}).then(res => {
console.log('加入成功')
})
})
},
go() {
console.log(this.productList, '------')
},
// banneruserInfo
getBanners() {
// console.log(this.$store.tenantId,'tenantId')
getBanner().then(res => {
this.bannerList = [...res.data.list]
console.log(res.data.list,'banner')
this.bannerList = [...res.data.list]
})
console.log(this.userInfo.userId, 'userInfo111111')
},
getCoupon: function(id, index) {
let that = this;
@ -540,9 +523,7 @@
getIndexPage() {
let that = this
productPage().then(res => {
console.log(res.data.list, '商品列表')
this.productList = this.productList.concat(res.data.list)
console.log(this.productList, '---------')
})
},
getcouponList() {

View File

@ -21,7 +21,7 @@
<view class="boxs"></view>
<view class="tops">
<view class="shopName">
古驰旗舰店>
{{orderInfo.orderId}}
</view>
</view>
<view class="content" v-for="(item,index) in orderInfo.orderInfoList" :key="item.productId">
@ -37,10 +37,10 @@
{{item.sku}}
</view>
<view class="prices">
<u--text color="#E50202" mode="price" :text="item.proTotalPrice"></u--text>
<u--text color="#E50202" mode="price" :text="item.price"></u--text>
</view>
</view>
<div class="sum">x{{item.cartNum}}</div>
<div class="sum">x{{item.payNum}}</div>
</view>
<view class="boxs"></view>
</view>
@ -48,21 +48,21 @@
<view style="height: 1rpx;"></view>
<view class="priceitems">
<text class="itemsleft">商品总价</text>
<text class="itemsright">
<view class="itemsright">
<u--text mode="price" :text="orderInfo.proTotalPrice"></u--text>
</text>
</view>
</view>
<view class="priceitems">
<text class="itemsleft">运费</text>
<text class="itemsright">
<view class="itemsright">
<u--text mode="price" :text="orderInfo.payPostage"></u--text>
</text>
</view>
</view>
<view class="priceitems">
<text class="itemsleft">待付金额</text>
<text class="itemsright">
<view class="itemsright">
<u--text mode="price" :text="orderInfo.totalPrice"></u--text>
</text>
</view>
</view>
</view>
<view class="detail">
@ -81,7 +81,7 @@
<text class="detailright">{{orderInfo.createTime}}</text>
</view>
</view>
<view class="pay">
<!-- <view class="pay">
<view style="height: 1rpx;"></view>
<view class="title">支付方式</view>
<view class="payment" @click="isWx=!isWx">
@ -98,13 +98,13 @@
<view :class="[isWx?'radio':'radioNo']"></view>
</view>
</view>
</view>
</view> -->
</view>
<view class="zf">
<view class="zfNumber"> <text>待支付:</text>
<u--text class="text" size="35rpx" mode="price" :text="orderInfo.totalPrice"></u--text>
</view>
<view class="closeOrder" tap="cancelOrder()">取消订</view>
<view class="closeOrder" @tap="cancelOrder()"></view>
<view class="orderPay" @tap='pay_open(orderInfo.orderId)'>立即付款</view>
</view>
@ -307,10 +307,11 @@
* 打开支付组件
*
*/
pay_open: function() {
this.pay_close = true;
this.pay_order_id = this.orderInfo.orderId;
this.totalPrice = this.orderInfo.payPrice;
pay_open: function(item) {
console.log(item,'0000000000')
uni.navigateTo({
url: '/pages/goods_cashier/index?order_id=' + item
})
},
/**
* 支付成功回调
@ -494,6 +495,7 @@
},
cancelOrder() {
let self = this
console.log(self)
uni.showModal({
title: '提示',
content: '确认取消该订单?',
@ -618,9 +620,9 @@
.shopName {
width: 240rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
// overflow: hidden;
// white-space: nowrap;
// text-overflow: ellipsis;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;

View File

@ -105,7 +105,7 @@
value="" name="mark" placeholder='请添加备注150字以内'></textarea>
</view>
</view>
<view class='wrapper borRadius14'>
<!-- <view class='wrapper borRadius14'>
<view class='item'>
<view>支付方式</view>
<view class='list'>
@ -122,7 +122,7 @@
</view>
</view>
</view>
</view>
</view> -->
<view class='moneyList borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>商品总价</view>
@ -156,7 +156,7 @@
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
<!-- <home></home> -->
</view>
</template>
<script>
@ -616,6 +616,7 @@
payment: function(data) {
let that = this;
orderCreate(data).then(res => {
console.log(res.data,'订单信息')
that.getOrderPay(res.data.orderNo, '支付成功');
}).catch(err => {
@ -627,149 +628,151 @@
},
getOrderPay: function(orderNo, message) {
let that = this;
let goPages = '/pages/order_pay_status/index?order_id=' + orderNo + '&msg=' + message;
wechatOrderPay({
orderNo: orderNo,
payChannel: that.payChannel,
payType: that.payType,
scene: that.productType==='normal'? 0 :1177 //
}).then(res => {
let jsConfig = res.data.jsConfig;
switch (res.data.payType) {
case 'weixin':
// #ifdef MP
uni.requestPayment({
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
ticket: that.productType==='normal'? null : jsConfig.ticket,
success: function(ress) {
uni.hideLoading();
wechatQueryPayResult(orderNo).then(res => {
uni.hideLoading();
if (that.orderInfoVo.bargainId || that.orderInfoVo.combinationId || that.pinkId || that
.orderInfoVo.seckillId)
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 4,
url: goPages
});
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: goPages
});
}).cache(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
})
uni.navigateTo({
url: '/pages/goods_cashier/index?order_id=' + orderNo
})
// wechatOrderPay({
// orderNo: orderNo,
// payChannel: that.payChannel,
// payType: that.payType,
// scene: that.productType==='normal'? 0 :1177 //
// }).then(res => {
// let jsConfig = res.data.jsConfig;
// switch (res.data.payType) {
// case 'weixin':
// // #ifdef MP
// uni.requestPayment({
// timeStamp: jsConfig.timeStamp,
// nonceStr: jsConfig.nonceStr,
// package: jsConfig.packages,
// signType: jsConfig.signType,
// paySign: jsConfig.paySign,
// ticket: that.productType==='normal'? null : jsConfig.ticket,
// success: function(ress) {
// uni.hideLoading();
// wechatQueryPayResult(orderNo).then(res => {
// uni.hideLoading();
// if (that.orderInfoVo.bargainId || that.orderInfoVo.combinationId || that.pinkId || that
// .orderInfoVo.seckillId)
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, {
// tab: 4,
// url: goPages
// });
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, {
// tab: 5,
// url: goPages
// });
// }).cache(err => {
// uni.hideLoading();
// return that.$util.Tips({
// title: err
// });
// })
},
fail: function(e) {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
complete: function(e) {
uni.hideLoading();
//
if (e.errMsg == 'requestPayment:cancel') return that.$util
.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
})
// #endif
// #ifdef H5
let data = {
timestamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign
};
that.$wechat.pay(data).then(res => {
if (res.errMsg == 'chooseWXPay:cancel') {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
} else {
wechatQueryPayResult(orderNo).then(res => {
uni.hideLoading();
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: goPages
});
}).cache(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
})
}
}).cache(res => {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=0'
});
});
// #endif
break;
case 'yue':
uni.hideLoading();
return that.$util.Tips({
title: message
}, {
tab: 5,
url: goPages + '&status=1'
});
break;
case 'weixinh5':
uni.hideLoading();
that.$util.Tips({
title: '订单创建成功'
}, {
tab: 5,
url: goPages + '&status=0'
});
setTimeout(() => {
location.href = jsConfig.mwebUrl + '&redirect_url=' + window.location
.protocol + '//' + window.location.host +
goPages + '&status=1';
}, 100)
break;
}
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
});
// },
// fail: function(e) {
// uni.hideLoading();
// return that.$util.Tips({
// title: ''
// }, {
// tab: 5,
// url: goPages + '&status=2'
// });
// },
// complete: function(e) {
// uni.hideLoading();
// //
// if (e.errMsg == 'requestPayment:cancel') return that.$util
// .Tips({
// title: ''
// }, {
// tab: 5,
// url: goPages + '&status=2'
// });
// },
// })
// // #endif
// // #ifdef H5
// let data = {
// timestamp: jsConfig.timeStamp,
// nonceStr: jsConfig.nonceStr,
// package: jsConfig.packages,
// signType: jsConfig.signType,
// paySign: jsConfig.paySign
// };
// that.$wechat.pay(data).then(res => {
// if (res.errMsg == 'chooseWXPay:cancel') {
// uni.hideLoading();
// return that.$util.Tips({
// title: ''
// }, {
// tab: 5,
// url: goPages + '&status=2'
// });
// } else {
// wechatQueryPayResult(orderNo).then(res => {
// uni.hideLoading();
// return that.$util.Tips({
// title: '',
// icon: 'success'
// }, {
// tab: 5,
// url: goPages
// });
// }).cache(err => {
// uni.hideLoading();
// return that.$util.Tips({
// title: err
// });
// })
// }
// }).cache(res => {
// uni.hideLoading();
// return that.$util.Tips({
// title: ''
// }, {
// tab: 5,
// url: goPages + '&status=0'
// });
// });
// // #endif
// break;
// case 'yue':
// uni.hideLoading();
// return that.$util.Tips({
// title: message
// }, {
// tab: 5,
// url: goPages + '&status=1'
// });
// break;
// case 'weixinh5':
// uni.hideLoading();
// that.$util.Tips({
// title: ''
// }, {
// tab: 5,
// url: goPages + '&status=0'
// });
// setTimeout(() => {
// location.href = jsConfig.mwebUrl + '&redirect_url=' + window.location
// .protocol + '//' + window.location.host +
// goPages + '&status=1';
// }, 100)
// break;
// }
// }).catch(err => {
// uni.hideLoading();
// return that.$util.Tips({
// title: err
// });
// });
},
getPayType: function(status, orderId, message, jsConfig) {
let that = this;
@ -961,14 +964,7 @@
uni.showLoading({
title: '订单支付中'
});
// #ifdef MP
openPaySubscribe().then(() => {
that.payment(data);
});
// #endif
// #ifndef MP
that.payment(data);
// #endif
}
}
}