zh
zhangjinli 3 years ago
parent a42b549495
commit 1ca67c5163

@ -3,7 +3,7 @@
<!-- <view v-if="type !== 'share'" style="position: absolute; top: 25px; right: 16px;" @tap="toMobileLogin"></view> -->
<view class="logo-box flex flex-direction align-center">
<image :src="IMAGE_URL+'/wxapp/jyy.png'" mode="widthFix"></image>
<view class="">跟着英子去开店</view>
<view class="">数字化批发零售服务平台</view>
</view>
<view class="btn-box">
<view class="text-center" style="font-size: 24rpx;color: #999;margin-top: 20rpx;">

@ -1,5 +1,9 @@
<template>
<view>
<view>
<view class="back" @tap="back">
<text class="cuIcon-home" v-if="type=='share'"></text>
<text class="cuIcon-back" v-else></text>
</view>
<view class="top" :style="'background-image:url('+IMAGE_URL+'/wxapp/vip/3.png);'">
<view class="box" :style="'background-image:url('+IMAGE_URL+'/wxapp/vip/2.png);'">
<image class="l" :src="IMAGE_URL+'/wxapp/vip/1.png'" mode="widthFix" />
@ -41,7 +45,7 @@
{{i.sku_name.slice(-2)}}
</view>
<view class="price">
<span class="unit">¥</span>{{i.discount_price}}
<span class="unit">¥</span>{{i.discount_price}}<span class="unit">/{{['月','季','年'][I]}}</span>
</view>
<view class="discount" :style="i.coupon?'':'visibility: hidden;'">
原价¥{{i.discount_price+i.coupon}}
@ -56,7 +60,7 @@
<view class="notify">
<image class="icon" :src="IMAGE_URL+'/wxapp/vip/12.png'" mode="widthFix" />
<view class="n1">安心保障</view>
<view>不自动续费 无任何附带扣费项目 无广告无插件</view>
<view class="n2">不自动续费 无任何附带扣费项目 无广告无插件</view>
</view>
</view>
</view>
@ -66,7 +70,8 @@
export default {
data() {
return {
IMAGE_URL: this.IMAGE_URL,
IMAGE_URL: this.IMAGE_URL,
type: null,
list: [{
title: '底价批发',
text: 'VIP店铺可享受平台数字化底价批发进货的权益。线上进货各大品牌随你挑选想进多少货你说了算。最低一件起批避免囤货压资金打破线下五公里生活圈的地域壁垒不再受品牌授权期限制约没有年采购 销售指标考核',
@ -120,13 +125,28 @@
this.invite = options.invite
this.$store.commit('setinvite', options.invite);
uni.setStorageSync("invite", options.invite)
}
if (options.type) {
this.type = options.type
}
this.initData()
},
methods: {
async initData() {
this.vipList = (await this.$u.post("/api/v2/app/vip/goods")).data.data
this.vipIsUsed = (await this.$u.post("/api/v2/app/vip/is_used")).data.data.is_used
this.vipList = (await this.$u.post("/api/v2/app/vip/goods")).data.data
this.vipIsUsed = (await this.$u.post("/api/v2/app/vip/is_used")).data.data.is_used
if (this.vipIsUsed) {
this.vipSel = 0
}
},
back() {
if (this.type == "share") {
uni.switchTab({
url: "/pages/index/index"
})
} else {
uni.navigateBack()
}
},
confirm() {
if (this.vipSel === -1) {
@ -135,24 +155,24 @@
content: 'VIP7日体验卡将在领取后开始使用每个账号仅限一次是否领取',
success: (res) => {
if (res.confirm) {
this.$u.post('/api/v2/app/vip/active').then(res => {
if (res.data.code == "FAIL") {
this.$u.toast(res.data.msg, 2000);
return
}
this.$u.toast('领取成功!', 2000);
this.vipIsUsed = false
this.$u.post('/api/v2/app/vip/active').then(res => {
if (res.data.code == "FAIL") {
this.$u.toast(res.data.msg, 2000);
return
}
this.$u.toast('领取成功!', 2000);
this.vipIsUsed = false
})
}
}
});
return
}
let SkuID = this.vipList[this.vipSel].sku_id
let SkuName = this.vipList[this.vipSel].sku_name
this.createOrder(SkuID,SkuName)
}
let SkuID = this.vipList[this.vipSel].sku_id
let SkuName = this.vipList[this.vipSel].sku_name
this.createOrder(SkuID, SkuName)
},
createOrder(SkuID,SkuName) {
createOrder(SkuID, SkuName) {
let sendData = {
UserID: uni.getStorageSync("userInfo").id,
SkuID,
@ -163,35 +183,85 @@
if (uni.getStorageSync("invite")) {
sendData.invite = uni.getStorageSync("invite")
}
//
console.log('/order_preview/create:',sendData);
console.log('/order_preview/create:', sendData);
this.$u.post('/api/v1/order_preview/create', sendData).then(res => {
if (res.data.code == "FAIL") {
this.$u.toast(res.data.msg);
return
}
this.$u.post('/api/v1/order/submit', {
userId: uni.getStorageSync("userInfo").id,
previewOrderId: res.data.data.id
}).then(res1 => {
console.log(res1.data);
if (res1.data.code == "FAIL") {
this.$u.toast(res1.data.msg, 2000);
return
}
let orderDetail = res1.data.data
let msg = res1.data.msg
// this.$store.commit('setOrderDetail',orderDetail);
//
uni.redirectTo({
url: "../orderPay/orderPay?orderId=" + orderDetail.id,
// url: "../orderDetail/orderDetail?orderId=" + orderDetail.id,
success: (res2) => {
this.$u.toast(msg);
}
})
});
this.$u.post('/api/v1/order/submit', {
userId: uni.getStorageSync("userInfo").id,
previewOrderId: res.data.data.id
}).then(res1 => {
console.log(res1.data);
if (res1.data.code == "FAIL") {
this.$u.toast(res1.data.msg, 2000);
return
}
this.$u.post('/api/v1/pay/wxminipay/order/create', {
userId: uni.getStorageSync("userInfo").id,
orderId: res1.data.data.id,
// wxType:"recook-weapp"
}).then(res2 => {
console.log(res2);
if (res2.data.code == "FAIL") {
this.$u.toast(res2.data.msg);
return
}
let result = res2.data.data
wx.requestPayment({
timeStamp: result.timestamp,
nonceStr: result.noncestr,
package: result.package,
signType: 'MD5',
paySign: result.sign,
success: (res3) => {
console.log(res3)
this.$u.toast('支付完成!', 2000);
},
fail: (err) => {
console.log(err)
this.$u.toast('支付失败!', 2000);
// this.$u.toast(err);
}
})
});
});
})
//
// console.log('/order_preview/create:',sendData);
// this.$u.post('/api/v1/order_preview/create', sendData).then(res => {
// if (res.data.code == "FAIL") {
// this.$u.toast(res.data.msg);
// return
// }
// this.$u.post('/api/v1/order/submit', {
// userId: uni.getStorageSync("userInfo").id,
// previewOrderId: res.data.data.id
// }).then(res1 => {
// console.log(res1.data);
// if (res1.data.code == "FAIL") {
// this.$u.toast(res1.data.msg, 2000);
// return
// }
// let orderDetail = res1.data.data
// let msg = res1.data.msg
// // this.$store.commit('setOrderDetail',orderDetail);
// //
// uni.redirectTo({
// url: "../orderPay/orderPay?orderId=" + orderDetail.id,
// // url: "../orderDetail/orderDetail?orderId=" + orderDetail.id,
// success: (res2) => {
// this.$u.toast(msg);
// }
// })
// });
// })
} else {
this.$u.toast("游客无法使用该功能,请登录");
let pages = getCurrentPages();
@ -213,7 +283,21 @@
}
</script>
<style lang="scss">
<style lang="scss">
.back {
position: absolute;
top: 80rpx;
left: 30rpx;
width: 80rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #FFFFFF;
border-radius: 50%;
font-size: 40rpx;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.top {
height: 300px;
padding-top: 92px;
@ -333,11 +417,11 @@
.price {
margin: 12px 6px 6px;
font-size: 16px;
font-size: 24px;
font-family: MiSans-Semibold, MiSans;
font-weight: 600;
color: #C29761;
white-space: nowrap;
.unit {
font-size: 12px;
}
@ -347,7 +431,8 @@
margin: 8px;
font-size: 10px;
font-weight: 400;
color: #999999;
color: #999999;
text-decoration:line-through;
}
.calculate {
@ -409,7 +494,11 @@
margin-left: 8px;
font-size: 14px;
font-weight: 500;
color: #278022;
color: #278022;
white-space: nowrap;
}
.n2{
white-space: nowrap;
}
}

Loading…
Cancel
Save