团购订单核销

ymt-groupSet
游梦婷 1 year ago
parent 765511b4d4
commit c3839f37ef
  1. 2
      App.vue
  2. 13
      Utils/groupBuying.js
  3. 266
      subpackages/groupBuyingConfiguration/groupVerify/groupVerify.vue

@ -7,10 +7,12 @@
// url: 'https://pay.dctpay.com/crest',
// imgUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com',
// redirectUrl:'https://pay.dctpay.com/cweb',
// hsgUrl:'https://hsg.dctpay.com',
//
url: 'https://gratia-pay.dctpay.com/crest',
imgUrl: 'https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com',
redirectUrl:'https://gratia-pay.dctpay.com/cweb',
hsgUrl:'https://hsgcs.dctpay.com',
userInfo: "",
openId: '',
h5code: '',

@ -3,7 +3,8 @@ import {
} from './Request.js';
let app = getApp();
let base = app.globalData.url;
let hsgCrest = app.globalData.hsgUrl+'/crest';
let hsgOrder = app.globalData.hsgUrl+'/order';
//新增门店图片
export const insertStoreImg = params => {
@ -106,3 +107,13 @@ export const editStoreExtMsg = params => {
export const findStoreExtMsgByStoreId = params => {
return POST('POST', `${base}/storeGroup/findStoreExtMsgByStoreId`, params).then(res => res.data);
}
//查询获取团购内容code
export const getGroupContentByCode = params => {
return POST('GET', `${hsgCrest}/group/getGroupContentByCode`, params).then(res => res.data);
}
//核销团购码
export const gorOrderNotify = params => {
return POST('GET', `${hsgOrder}/groupOrder/gorOrderNotify`, params).then(res => res.data);
}

@ -1,22 +1,264 @@
<template>
<view>
========={{key}}========
</view>
<view class="all-container backcor9 pd-main font15">
<view v-if="detailData">
<view class="border-8r backcorfff marb10 pd-main border-box " >
<view class="bgLight border-8r paddbotm15 fcorfff">
<view class="pd10 ">
<view class="font22 fontwig6 fontspec">{{detailData.name}}</view>
<view class=" dis-flex margle font18 mart10 ">
<view class=" dis-flex fontspec">现价:¥<view class="font18 fontwig6 ">{{detailData.price}}</view>
</view>
<view class="corf6 dis-flex fontspec margle text-lt font13" v-if="detailData.originalPrice">原价:¥<view>{{detailData.originalPrice}}</view>
</view>
</view>
</view>
<view class=" width100 circle pr">
<view class="border-dash width100"></view>
</view>
</view>
<view class=" paddtop10">
<view class="dis-flex marb5" >
<view class="flex-s0 fcor333 paddtright10 fontwig6">限制</view>
<view class="dis-flex flex-1">
<text>{{detailData.astrict}}</text>
</view>
</view>
<view class="dis-flex marb5" >
<view class="flex-s0 fcor333 paddtright10 fontwig6">须知</view>
<view class="dis-flex flex-1">
<text>{{detailData.serviceTime}}</text>
<text class="icon-ymt to-right font13 fontColor "></text>
</view>
</view>
<!-- <view class="dis-flex marb5" >
<view class="flex-s0 fcor333 paddtright10 fontwig6">保障</view>
<view class="dis-flex flex-1">
<text>随时退</text>
</view>
</view> -->
</view>
</view>
<view class=" font16 fontwig6 paddtop10 paddbotm10 ">
团购
</view>
<view class="border-8r backcorfff marb10 font14 pd-main border-box " v-if="detailData.groupDetails">
<view :class=" 'paddbotm5 '+(index<detailData.groupDetails.length-1?'border-b-666':'') "
v-for="(item,index) in detailData.groupDetails" :key="index">
<view class="dis-flex paddtop5 ">
<view class="dot bgb2"></view>
<view class="fontwig6">
{{item.name}}
</view>
</view>
<view class=" dis-flex flex-sp " v-for="(item2,index2) in item.list" :key="item2.id">
<view class="flex-1 fc333 paddleft10 dis-flex ">
<view class="dot bg33"></view>
<view class="dis-flex flex-1 flex-sp">
<view>{{item2.productName}}</view>
<view>({{item2.count}})</view>
</view>
</view>
<!-- <view class="flex-s0 paddleft10">
{{item2.price}}
</view> -->
</view>
</view>
</view>
<view class=" font16 fontwig6 paddtop10 paddbotm10 ">
购买须知
</view>
<view class="border-8r backcorfff marb10 font14 pd-main border-box ">
<view class=" paddbotm5 border-b-666 ">
<view class=" paddtop5 fontwig6">有效期</view>
<view class=" dis-flex paddleft10">
<view class="dot bgb2"></view>
<view>
{{detailData.validity || ''}}
</view>
</view>
</view>
<view class=" paddbotm5 border-b-666 ">
<view class=" paddtop5 fontwig6">使用时间</view>
<view class=" dis-flex paddleft10">
<view class="dot bgb2"></view>
<view>
{{detailData.serviceTime || ''}}
</view>
</view>
</view>
<view class=" paddbotm5 " v-if="detailData.storeGroupServeRule">
<view class=" paddtop5 fontwig6">使用规则</view>
<view class=" dis-flex paddleft10">
<view class="dot bgb2"></view>
<view>
{{detailData.storeGroupServeRule.content || ''}}
</view>
</view>
</view>
</view>
<view class="btn92 mart10 marb10" @click="comfirmVerify()">
立即核销
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
key:'',
import {getGroupContentByCode,gorOrderNotify} from '@/Utils/groupBuying.js';
const app = getApp();
export default {
data(){
return{
groupCode:'',
detailData:null,//
imgUrl: app.globalData.imgUrl, //访
instructionList:[],//使
}
},
onLoad(option){
if(option.orderKey){
this.groupCode = option.orderKey;
this.getGroupContentByCode();//
}
},
methods:{
getGroupContentByCode(){
let params={
groupCode:this.groupCode
}
uni.showLoading({
title:"加载中...",
mask:true,
})
getGroupContentByCode(params).then(res=>{
uni.hideLoading();
if (res.return_code == '000000') {
this.detailData = res.return_data;
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
/* 立即核销 */
comfirmVerify(){
uni.showLoading({
title:"核销中...",
mask:true,
})
let params={
groupCode:this.groupCode
}
gorOrderNotify(params).then(res=>{
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: "核销成功",
icon: 'none',
duration: 2000
})
setTimeout(()=>{
uni.navigateBack();
},1000)
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
}
},
onLoad(option){
this.key = option.orderKey;
}
}
</script>
<style scoped>
<style lang="scss" scoped>
.pr {
position: relative;
}
.border-box{
box-sizing: border-box;
}
.text-lt{
text-decoration: line-through;
}
/* ======== */
.bgLight {
background-color: #089bf5;
}
.pd10 {
padding: 10px;
}
.border-dash {
border-bottom: 1px dashed #f6f6f6;
position: absolute;
top: 9px;
}
.circle {
height:40px;
&::before {
content: "";
width: 20px;
height: 20px;
background-color: #ffffff;
position: absolute;
left: -10px;
top: 0px;
display: block;
z-index: 99;
border-radius: 50%;
}
&::after {
content: "";
display: block;
width: 20px;
height: 20px;
background-color: #ffffff;
position: absolute;
right: -10px;
top: 0px;
z-index: 99;
border-radius: 50%;
}
}
//end
//content
.dot {
width: 5px;
height: 5px;
border-radius: 50%;
flex-shrink: 0;
margin-right: 8px;
&.bgb2 {
background-color: #b2b2b2;
}
&.bg33 {
background-color: #333333;
}
}
</style>
Loading…
Cancel
Save