Commit d8a7ae72 by 李嘉林

原生支付成功暂存

parent 65209f7f
......@@ -9,4 +9,8 @@ export default {
addOrderNowBuy(data) {
return requestPOST(`${process.env.OLSHOP_URL}/order/add_order`, data)
},
// 查询订单详情
orderDetail(data) {
return requestPOST(`${process.env.OLSHOP_URL}/order/detail?orderSn=${data.orderSn}`)
},
}
......@@ -41,5 +41,9 @@ export default {
query_isEntry(data) {
return requestPOST(`${process.env.OLSHOP_URL}/spokesman/getSpokesmanRemindAndDisplayEntryByLogin`, { data })
},
// 获取分销员注册配置,及指标是否达成
subordinateSpokesmanProfit(params) {
return requestPOST(`${process.env.OLSHOP_URL}/spokesman/getSpokesmanRegisterConfigByInvitation/${params}`)
},
}
<template>
<div class="pay-success-info">
<div class="paySuccess_content">
<div
class="paySuccess_detail"
:style="{ 'padding-top': paddingTop, 'padding-bottom': paddingBottom }"
>
<div class="iconPay" :style="{'width':imgSize,'height':imgSize}">
<image mode="aspectFit" :src="icon" alt></image>
</div>
<p class="success">{{ payTitle }}</p>
<p v-if="orderDetail.orderType == 5" class="tips">
您可在【我的】-【我的礼包】中进行送礼
</p>
<p v-if="orderDetail.orderType == 5" class="tips">
亦可以直接点下面按钮【立即送出】
</p>
<div v-if="orderDetail.orderType == 5"></div>
<div v-else class="orderPrice" v-html="subTitle">
订单金额:
<span v-if="routeQuery.multiMerchantsFlag"
>{{ routeQuery.totalMoney }}</span
>
<span v-else>{{ totalMoney }}</span>
</div>
<div class="bottom flex">
<template v-if="orderDetail.orderType == 5"> </template>
<template v-else>
<div
v-if="routeQuery.multiMerchantsFlag"
@click="toOrderList"
>
<van-button size="normal">查看详情</van-button>
</div>
<div v-else @click="toOrderDetail">
<van-button size="normal">查看详情</van-button>
</div>
<div @click="toIndex">
<van-button size="normal">回首页</van-button>
</div>
</template>
</div>
</div>
</div>
<div class="line" v-if="orderDetail.orderType == 5"></div>
<div class="steps_wrap" v-if="orderDetail.orderType == 5">
<div class="steps_box">
<div class="steps_item paystyle">
<image
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/ad3f8f16-c461-4844-a384-bf77a5e80263.png"
alt
></image>
付款
</div>
<div class="steps_dot">........</div>
</div>
<div class="steps_box">
<div class="steps_item two">
<image
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/c925ae0f-1c56-43a2-8ca0-1ccdcf82c357.png"
alt
></image>
微信赠送
</div>
<div class="steps_dot">........</div>
</div>
<div class="steps_box">
<div class="steps_item three">
<image
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/928f1247-ba6c-4760-a92a-c090200ae4f1.png"
alt
></image>
好友领取
</div>
<div class="steps_dot">........</div>
</div>
<div class="steps_box">
<div class="steps_item four">
<image
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/4c004310-e19d-4475-834e-6391398b2646.png"
alt
></image>
送货上门
</div>
</div>
</div>
<div class="line" v-if="orderDetail.orderType == 5"></div>
<div class="bottom_box" v-if="orderDetail.orderType == 5">
<div class="bottom_item" @click="toShare">现在就分享</div>
<div class="bottom_item bottom_last" @click="backTo">回首页</div>
</div>
</div>
</template>
<script>
const app = getApp();
const { log } = app;
export default {
name: "pay-success-info",
props: {
render: {
type: Boolean,
default: false,
},
datas: {
type: Object,
default: () => {
return {};
},
},
orderDetail: {
type: Object,
default: () => {
return {};
},
},
routeQuery: {
type: Object,
default: () => {
return {};
},
},
totalMoney: {
type: Number,
default: 0,
},
},
computed: {
icon() {
return this.datas.componentData["icon"]||'http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/83a4a0bc-37fc-411e-bc5c-6dd9c1b4a921.png';
},
payTitle() {
return this.datas.componentData["title"];
},
subTitle() {
let totalMoney = this.routeQuery.multiMerchantsFlag
? this.routeQuery.totalMoney
: this.totalMoney;
let subTitle = this.datas.componentData["subTitle"];
let replaceList = [
{
key: "#金额#",
val: totalMoney,
},
{ key: "#订单号#", val: this.orderSn },
];
replaceList.forEach((item, index) => {
if (subTitle.includes(item.key)) {
// <span style="font-size:18px;color:var(--main-color);padding:0 4px;">${item.val}</span>
subTitle = subTitle.replace(new RegExp(item.key, "g"), item.val);
}
});
return subTitle;
},
paddingTop() {
return this.datas.componentData["paddingTop"] + "px";
},
paddingBottom() {
return this.datas.componentData["paddingBottom"] + "px";
},
imgSize() {
return this.datas.componentData["imgSize"] + 'px';
},
orderSn() {
return this.render?this.routeQuery.orderSn:'----------'
}
},
onLoad() {
console.log("-----------------------info",this.$store.state.spokemanInfo)
},
methods: {
toOrderDetail() {
if (!this.render) return;
console.log("查看详情");
let url = `/pages/index/main?from=home&backpath=${encodeURIComponent(`/order/orderDetail?orderSn=${this.orderSn}&isReplace=true`)}}`
wx.redirectTo({
url,
});
},
toOrderList() {
let url = `/pages/index/main?from=home&backpath=${encodeURIComponent(`/order/orderList`)}`
wx.redirectTo({
url,
});
},
toIndex() {
if (!this.render) return;
wx.reLaunch({
url: "/pages/home/main",
});
},
backTo() {
if (!this.render) return;
wx.reLaunch({
url: "/pages/home/main",
});
},
//云送礼去分享
toShare() {
if (!this.render) return;
console.log(this.giftsKey, "this.giftsKey");
if (this.giftsKey == 1) {
let spokesmanRelId;
let spokesmanGroupId;
let spokesmanShopId;
let spokemanInfo = this.$store.state.spokemanInfo;
let userInfo = this.$store.state.userInfo;
console.log(spokemanInfo,'-------spokemanInfo');
console.log(this.$store.state.userInfo);
if (spokemanInfo) {
if (spokemanInfo.hasInvitationStatus == 1) {
spokesmanRelId = spokemanInfo.spokesmanId;
spokesmanGroupId = spokemanInfo.groupId;
spokesmanShopId = spokemanInfo.shopId;
}
}
let nickname = "";
let headerImg =
"http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/jpg/02c0c235-daae-412d-bced-5fb315ad570e.jpg";
if (userInfo) {
if (userInfo.nickname) {
nickname = userInfo.nickname;
} else if (userInfo.wxNickname) {
nickname = wxNickname;
}
if (userInfo.headPortraitUrl) {
headerImg = userInfo.headPortraitUrl;
}
}
console.log("nickname", nickname);
console.log("headerImg", headerImg);
app.$themeToLink({
type: 1,
link: `/goods/posters
?type=cloudGift
&href=${window.location.protocol}//${window.location.host}/activty/receivingGift?mixid=${this.routeQuery.mixid}&orderId=${this.orderId}
&spokesmanGroupId=${spokesmanGroupId}
&hasInvitationStatus=${spokemanInfo.hasInvitationStatus}
&spokesmanShopId=${spokesmanShopId}
&spokesmanRelId=${spokesmanRelId}
&nickname=${nickname}
&headerImg=${headerImg}
&ordernumber=${this.routeQuery.orderSn}
&orderId=${this.orderId}
&orgName=${this.orgName}
&goodsImg=${this.orderDetail.noShipmentOrderItems[0].specificationPictureUrl}
`,
})
// this.$router.push({
// path: "/goods/posters",
// query: {
// type: "cloudGift",
// href: `${window.location.protocol}//${window.location.host}/activty/receivingGift?mixid=${this.routeQuery.mixid}&orderId=${this.orderId}`,
// spokesmanGroupId: spokesmanGroupId,
// hasInvitationStatus: spokemanInfo.hasInvitationStatus,
// spokesmanShopId: spokesmanShopId,
// spokesmanRelId: spokesmanRelId,
// nickname: nickname,
// headerImg: headerImg,
// ordernumber: this.routeQuery.orderSn,
// orderId: this.orderId,
// orgName: this.orgName,
// goodsImg:
// this.orderDetail.noShipmentOrderItems[0].specificationPictureUrl,
// },
// });
}
},
},
};
</script>
<style lang="scss" scoped>
.paySuccess_content {
width: 100%;
margin-top: 1px;
overflow: hidden;
.paySuccess_detail {
padding: 0 63px;
.iconPay {
margin: 0 auto;
border-radius: 50%;
text-align: center;
.iconfont {
color: #fff;
font-size: 50px;
line-height: 80px;
}
image {
width: 100%;
height: 100%;
object-fit: contain;
}
}
.success {
margin: 10px 0;
text-align: center;
line-height: 20px;
font-size: 18px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: #191919;
}
.tips {
text-align: center;
color: #191919;
font-size: 13px;
}
.orderPrice {
text-align: center;
margin: 10px;
font-size: 14px;
span {
font-size: 18px;
color: var(--minor-color);
}
}
.price {
width: 116px;
height: 14px;
font-size: 13px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(25, 25, 25, 1);
margin-bottom: 12px;
margin: 17px auto;
.dcolor {
font-size: 15px;
color: var(--minor-color);
}
}
.bottom {
margin-top: 10px;
justify-content: space-around;
/deep/.van-button {
width: 118px;
height: 35px;
color: #929292;
line-height: 35px;
border-radius: 4px;
border: 1px solid rgba(146, 146, 146, 1);
}
.toShare {
background: var(--main-color);
border-color: var(--main-color);
color: #fff;
}
}
}
.steps_wrap {
display: flex;
background: #fff;
margin-top: 10px;
justify-content: space-evenly;
padding-top: 16px;
padding-bottom: 10px;
.steps_box {
display: flex;
.steps_item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
image {
margin-bottom: 5px;
}
}
.paystyle {
image {
width: 27.5px;
height: 23.5px;
}
color: #e94f4f;
}
.two {
image {
width: 32px;
height: 26px;
}
}
.three {
image {
width: 26px;
height: 26px;
}
}
.four {
image {
width: 35px;
height: 21.5px;
}
}
.steps_dot {
color: #999999;
position: relative;
top: 3px;
left: 15px;
}
}
}
}
</style>
\ No newline at end of file
......@@ -195,7 +195,10 @@ wx.onAppRoute(res => {
if (!spokesmanId) {
// 获取当前分销员 id
spokesman.getSpokesmanidByShare().then(res => {
if (res.data.data.spokesmanId) { spokesmanId = res.data.data.spokesmanId }
Store.commit("setSpokesmanInfo",res.data.data);
if (res.data.data.spokesmanId) {
spokesmanId = res.data.data.spokesmanId
}
})
}
if (!userId) { // 防止多次调用
......
......@@ -102,7 +102,7 @@ export default {
'text-text':text,
'rich-text':richText,
interval,
partition,
partition,
ThemeDataPlant,
loginLogo,
loginBox,
......
<template>
<!-- 支付成功页 -->
<div class="paySuccess" @click="toDingyue">
点击订阅
<div class="paySuccess">
<ThemeDataPlant :pageCode="11"></ThemeDataPlant>
<div style="margin-top: 60px;"></div>
<div v-for="(item, index) in pageData" :key="index">
<!-- 其他组件 -->
<div
v-if="item.componentCode == 'text-text' && item.componentInfo.visible == 1"
>
<text-text :datas="item"></text-text>
</div>
<div
v-if="item.componentCode == 'rich-text' && item.componentInfo.visible == 1"
>
<rich-text :datas="item"></rich-text>
</div>
<div
v-if="item.componentCode == 'photo-gallery' &&item.componentInfo.visible == 1"
>
<photo-gallery :datas="item"></photo-gallery>
</div>
<div
v-if="item.componentCode == 'interval' && item.componentInfo.visible == 1"
>
<interval :datas="item"></interval>
</div>
<div
v-if="item.componentCode == 'partition' && item.componentInfo.visible == 1"
>
<partition :datas="item"></partition>
</div>
<div
v-if="item.componentCode == 'notice' && item.componentInfo.visible == 1"
>
<notice :datas="item"></notice>
</div>
<pay-success-info
v-if="item.componentCode=='pay-success-info' && item.componentInfo.visible==1"
:render="true"
:datas="item"
:routeQuery="routeQuery"
:orderDetail="orderDetail"
:totalMoney="totalMoney"
/>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import shop from "@/api/shop";
import order from "@/api/order";
import spokesman from "@/api/spokesman";
import { getMiniProgram, query_isEntry } from "@/utils/mayi_fenxiao";
import { serialize } from "@/utils/index";
import { checkTabbarPage, checkShowConditionIds } from "@/utils/mayi";
import ThemeDataPlant from "../../components/ThemeDataPlant";
import paySuccessInfo from "../../components/paySuccess/paySuccessInfo";
import text from "@/components/content/text";
import richText from "../../components/basicTool/rich-text";
import interval from "@/components/basicTool/interval/index.vue";
import partition from "@/components/basicTool/partition/index.vue";
const app = getApp();
const { log } = app;
export default {
name: "",
data() {
return {};
return {
query: {
orderSn: "",
},
routeQuery: {},
title: "",
inviteelShow: false,
isGroupBuy: false, //是否是拼团订单
totalMoney: 0,
orderDetail: {},
showGuide: false,
showspokmanEntry: false, //分销员弹框
goodsId: "",
orderId: "",
orgName: "",
splitStatus: "0", //拆单状态(0:未拆单;1:已拆单)已拆单时付款后跳订单列表
giftsKey: 0,
showReceiveCard: false,
cardInfo: {},
cardTime: null,
cardnum: 0,
pageInfo: {},
pageData: {},
showPage: false,
};
},
components: {
ThemeDataPlant,
"text-text": text,
"rich-text": richText,
interval,
partition,
paySuccessInfo,
},
components: {},
computed: {},
created() {},
mounted() {},
onLoad(options) {
console.log(options, "--paySuccess-onLoad");
this.query.orderSn = options.orderSn;
this.routeQuery = options;
this.orderMsg();
// 获取页面数据
if (this.mpApp.globalData.pageList) {
console.log(
this.mpApp.globalData.pageList,
"-----------------this.mpApp.globalData.pageList"
);
this.init(this.mpApp.globalData.pageList);
} else {
this.mpApp.pageCallBack = (params) => {
console.log(params, "-----------------this.mpApp.globalData.pageList");
that.init(params);
};
}
},
onShow() {
console.log("--paySuccess-onShow");
},
methods: {
toDingyue() {
wx.requestSubscribeMessage({
tmplIds: ['cTgB0EMEibieOPU6HWPbmr3YCea7MZYCryxmi2_fS5o','pWi2-icKybK1fSSjRf-wrsQE1jmsuEp1QgPTAxn2nB0'],
success (res) {
console.log(res,'-------------res')
orderMsg() {
order.orderDetail(this.query).then(res1 => {
let res = res1.data;
if (res.code == 200) {
console.log("----------------------------------2")
if(res.data.orderType == '14') {
this.isGroupBuy = true;
this.title = "拼团详情"
}else {
this.title = "支付成功"
}
this.splitStatus=res.data.splitStatus;
this.orderId = res.data.orderId;
this.orgName = res.data.orgName;
if(res.data.noShipmentOrderItems&&res.data.noShipmentOrderItems.length) {
this.goodsId =
res.data.noShipmentOrderItems[0].terminalProductGoodsId;
}
//查询是否是分销员
getMiniProgram().then(res1 => {
console.log(res1,'---------------------------res1143')
let res = res1.data;
if (
res.code == "200" &&
(!res.data || res.data.spokesmanFlag !== "1")
) {
query_isEntry().then(res1 => {
let res = res1.data;
if (
res.code == "200" &&
res.data &&
res.data != "null" &&
res.data != "false"
) {
if (res.data.displayEntry == 'true'&&res.data.remind == "true") {
//查询是否达标
spokesman.subordinateSpokesmanProfit(res.data.distributionModel).then(res1 => {
let res = res1.data;
if (
res.code == "200" &&
res.data &&
res.data.thresholdToStandard == "1"
) {
this.showspokmanEntry = true;
}
});
} else {
this.showspokmanEntry = false;
}
}
});
}
});
this.orderDetail = res.data;
if (
this.orderDetail.orderType == 5
) {
this.initWxShare();
}
this.totalMoney = Number(res.data.totalAmountPayable).toFixed(2);
console.log(Number(res.data.totalAmountPayable).toFixed(2),'--Number(res.data.totalAmountPayable).toFixed(2)')
this.inviteelShow = true;
}else {
this.inviteelShow = true;
}
});
},
async initWxShare() {
return
let this_ = this;
console.log(this.$store.state.spokemanInfo,'分销员信息---=====');
let spokesmanRelId;
let spokesmanGroupId;
let spokesmanShopId
let spokemanInfo=this.$store.state.spokemanInfo;
if (spokemanInfo) {
if (spokemanInfo.hasInvitationStatus == 1) {
spokesmanRelId=spokemanInfo.spokesmanId;
spokesmanGroupId=spokemanInfo.groupId;
spokesmanShopId=spokemanInfo.shopId;
}
}
console.log(spokesmanRelId,'分销员信息---=====',spokesmanGroupId,spokesmanShopId);
let newWindowHref = '';
if(getTokenmu() && spokesmanRelId){
newWindowHref = `${window.location.protocol}//${window.location.host}/activty/receivingGift?mixid=${this.$route.query.mixid}&orderId=${this.orderDetail.orderId}&spokesmanGroupId=${spokesmanGroupId}&spokesmanShopId=${spokesmanShopId}&spokesmanRelId=${spokesmanRelId}&userId=${getTokenmu()}`;
}else {
newWindowHref = `${window.location.protocol}//${window.location.host}/activty/receivingGift?mixid=${this.$route.query.mixid}&orderId=${this.orderDetail.orderId}&userId=${getTokenmu()}`;
}
let shareImgUrl = DFSImg(
this.orderDetail.noShipmentOrderItems[0].specificationPictureUrl,
500,
400
);
let orgName = this.orderDetail.orgName;
let shareData="";
await shop.indexWxShare({storeRouterUrl : '/activty/receivingGift'}).then(res => {
if(res.code == 200){
shareData = res.data
}
})
}
let shareText=shareData&&shareData.shareText?shareData.shareText:'我选了一份小礼物送你,赶紧收下吧!免费的哦~';
this.$customShare.customShare(
shareText,
newWindowHref,
'',
DFSImg('https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/b9f3fdd1-513f-46df-aed2-7f42330beaca.png',500,460),
this.$store.state.wechatSignUrl
)
},
init() {
console.log("----------------------207");
this.setVisible(this.mpApp.globalData.pageList, (res) => {
console.log(res,'-----------------------res120')
this.pageInfo = res;
this.pageData = JSON.parse(this.pageInfo.pageData);
console.log(this.pageData, "----------pageData");
});
},
async setVisible(pageList, cb) {
// 首页显示条件
let pageInfo = pageList.filter((item) => item.pageCode == 11)[0];
console.log(pageInfo, "-----------pageInfo");
let pageData = JSON.parse(pageInfo.pageData);
// 查询显示条件id
let showConditionIds = checkShowConditionIds(pageData);
// 查询可显示的条件
let { data: ids, isAreaNavigation } = await this.checkCondition(
showConditionIds
);
console.log(ids,'--------------showConditionIds')
// 没有定位组件
// if (!isAreaNavigation) {
// cb()
// return
// }
// 设置visible
pageInfo.pageData = this.updateCondition(pageData, ids);
log.info(showConditionIds, "--------------5454", ids, pageInfo);
cb(pageInfo);
},
checkCondition({ allCondition }) {
console.log('---checkCondition')
return new Promise((resolve, reject) => {
// 获取
let params = { showConditionIds: allCondition, region: "" };
shop
.checkShowCondition(params)
.then((res) => {
console.log('-------------------157')
log.info(params, "check显示条件", res.data);
if (res.data.code == 200) {
resolve(res.data);
}
})
.catch((err) => {
log.info("check显示条件失败", err);
});
});
},
updateCondition(pageData, ids) {
pageData.forEach((item) => {
pollCondition(item);
});
function pollCondition(data) {
if (Object.prototype.toString.call(data) === "[object Object]") {
if (
data.visible &&
data.visible > 1 &&
data.visibleCopy == undefined
) {
data.visibleCopy = data.visible;
console.log(data.visibleCopy, "--data.visibleCopy");
}
if (
(data.visibleCopy == 2 && wx.getStorageSync("sessionid")) ||
(data.visibleCopy == 3 && !wx.getStorageSync("sessionid"))
) {
data.visible = 1;
} else if (
(data.visibleCopy == 2 && !wx.getStorageSync("sessionid")) ||
(data.visibleCopy == 3 && wx.getStorageSync("sessionid"))
) {
data.visible = 0;
} else {
if (data.condition != "" && data.condition != undefined) {
data.visible = ids.some((item) => {
return item == data.condition;
})
? 1
: 0;
}
}
for (const key in data) {
if (data.hasOwnProperty(key)) {
const element = data[key];
if (
Object.prototype.toString.call(element) === "[object Object]"
) {
if (
element.visible &&
element.visible > 1 &&
element.visibleCopy == undefined
) {
element.visibleCopy = element.visible;
}
if (
(element.visibleCopy == 2 &&
wx.getStorageSync("sessionid")) ||
(element.visibleCopy == 3 && !wx.getStorageSync("sessionid"))
) {
element.visible = 1;
} else if (
(element.visibleCopy == 2 &&
!wx.getStorageSync("sessionid")) ||
(element.visibleCopy == 3 && wx.getStorageSync("sessionid"))
) {
element.visible = 0;
} else {
if (
element.condition != "" &&
element.condition != undefined
) {
console.log("979797", element.condition);
element.visible = ids.some((item) => {
return item == element.condition;
})
? 1
: 0;
}
}
pollCondition(element);
} else if (
Object.prototype.toString.call(element) === "[object Array]" &&
element.length > 0
) {
element.forEach((item) => {
pollCondition(item);
});
}
}
}
}
}
return JSON.stringify(pageData);
},
toDingyue() {
wx.requestSubscribeMessage({
tmplIds: [
"cTgB0EMEibieOPU6HWPbmr3YCea7MZYCryxmi2_fS5o",
"pWi2-icKybK1fSSjRf-wrsQE1jmsuEp1QgPTAxn2nB0",
],
success(res) {
console.log(res, "-------------res");
},
});
},
},
};
</script>
<style lang="scss" scoped>
.paySuccess{
margin-top: 200px;
.paySuccess {
}
</style>
{
"navigationBarTitleText": "登录",
"navigationBarTitleText": "支付成功",
"usingComponents": {
"van-checkbox": "/static/vant/checkbox/index",
"van-popup":"/static/vant/popup/index",
"van-button":"/static/vant/button/index",
"van-picker": "/static/vant/picker/index",
"van-icon":"/static/vant/icon/index",
"photo-gallery":"/static/nativeComponents/PhotoGallery/index",
......
......@@ -4,6 +4,9 @@ const mutations = {
state[key] = val;
}
},
setSpokesmanInfo(state, obj) {
state.spokemanInfo = obj;
},
setSubscribeMessageObj(state, subscribeMessageObj) {
state.subscribeMessageObj = subscribeMessageObj;
},
......
......@@ -20,6 +20,7 @@ const state = {
offlineShopCode:"",
isLogin,
userInfo,
spokemanInfo: {},
mixid : '',
extConfig : {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment