删除不必要文件
This commit is contained in:
parent
2f53bf71e5
commit
dc20a1c4b1
@ -1,541 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view v-if="!isWeixin" class="v-navbar">
|
||||
<u-navbar title="提货付款" :safeAreaInsetTop="false" :fixed="false" @leftClick="leftClick" bgColor="transparent"
|
||||
leftIconColor="#333" :titleStyle="{color:'#333',fontWeight:'bold',fontSize:'32rpx'}">
|
||||
</u-navbar>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view style="height: 100rpx;"></view>
|
||||
<!-- #endif -->
|
||||
<view style="height: 50rpx;"></view>
|
||||
<view class="wrap">
|
||||
<view class="shop">
|
||||
<image src="@/static/shop_logo.webp" style="width: 62rpx;height: 54rpx;" />
|
||||
<text class="shop-name" v-if="mer_name">{{mer_name||''}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 付款金额 -->
|
||||
<view class="v-con">
|
||||
<view class="v-con-text">订单金额</view>
|
||||
<view class="v-con-input" @click="handleOpenKeyboard">
|
||||
<text style="color: #303133;font-size:32rpx;">¥</text>
|
||||
<u--input type="text" fontSize="23" height="112rpx" placeholder="请输入金额" border="none" readonly
|
||||
v-model="cartForm.total_amount" placeholderStyle="color:#999;font-size:32rpx">
|
||||
</u--input>
|
||||
<view class="placeholder"></view>
|
||||
</view>
|
||||
|
||||
<view class="v-con-group">
|
||||
<view class="v-con-group-title">
|
||||
<view class="v-con-group-title-left">套餐详情</view>
|
||||
<view class="v-con-group-title-right" @click.stop="handleOpen">
|
||||
<text>{{isOpen?'折叠':'展开'}}</text>
|
||||
<u-icon :name="isOpen?'arrow-down' : 'arrow-right'" size="15"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y>
|
||||
<view class="v-con-group-list" :style="{'max-height':isOpen?'400rpx':'0'}">
|
||||
<block v-for="(item,indx) in merchantInfo" :key="indx">
|
||||
<view class="v-con-group-list-item">
|
||||
<image :src="item.image" :showLoading="true" style="width:86rpx;height:86rpx;" />
|
||||
<text class="line1">{{item.store_name}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="v-btn-wrap" @click="cartForm.total_amount?submitOrder():null">
|
||||
<u-button class="v-btn" :loading="loading"
|
||||
:text="Number(cartForm.total_amount||0).toFixed(2)+'元 确认支付'"></u-button>
|
||||
</view>
|
||||
|
||||
<!-- 登陆 -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun" />
|
||||
</view>
|
||||
|
||||
<!-- 无商户信息提示 -->
|
||||
<!-- <view class="empty">
|
||||
<authorize v-show="!isWeixin" ref="authRef" :isAuto="isAuto" :isGoIndex="false" :isShowAuth="isShowAuth"
|
||||
@authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
</view> -->
|
||||
|
||||
<!-- 键盘 -->
|
||||
<popups ref="popups" @confirm="handleConfirm" @clear="handleClear" @change="handleChange"></popups>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
var that;
|
||||
|
||||
import {
|
||||
getProductInfo,
|
||||
addCart,
|
||||
orderCheck
|
||||
} from "@/api/payment.js";
|
||||
import Cache from '@/utils/cache';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import authorize from '@/components/Authorize';
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi";
|
||||
import popups from "@/components/popups/index.vue";
|
||||
export default {
|
||||
components: {
|
||||
authorize,
|
||||
popups
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: true,
|
||||
// isWeixin: this.$wechat.isWeixin(),
|
||||
isWeixin: false,
|
||||
cartForm: {
|
||||
product_id: '',
|
||||
product_attr_unique: '',
|
||||
cart_num: 1,
|
||||
is_new: 1,
|
||||
product_type: 0,
|
||||
source: 999,
|
||||
total_amount: ''
|
||||
},
|
||||
merchantInfo: '',
|
||||
checkForm: {
|
||||
address_id: '',
|
||||
cart_id: [],
|
||||
consumption_id: '',
|
||||
product_type: 0,
|
||||
source: 999,
|
||||
takes: [],
|
||||
use_coupon: {},
|
||||
use_integral: false
|
||||
},
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
mer_id: '',
|
||||
changeTxt: '展开',
|
||||
isOpen: false,
|
||||
keyBoardShow: false,
|
||||
mer_name: '',
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(opt) {
|
||||
that = this;
|
||||
this.mer_id = opt.mer_id;
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (!this.isLogin) {
|
||||
Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id);
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true;
|
||||
if (this.isWeixin) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.authRef.toWecahtAuth();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.checkForm.cart_id = [];
|
||||
this.getProductInfoByMerid();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开键盘
|
||||
handleOpenKeyboard() {
|
||||
if (!this.isLogin) {
|
||||
Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id);
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true;
|
||||
if (this.isWeixin) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.authRef.toWecahtAuth();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$refs.popups.handleOpen('money');
|
||||
}
|
||||
},
|
||||
|
||||
// 键盘提交
|
||||
handleConfirm(e) {
|
||||
if (!e) return;
|
||||
this.cartForm.total_amount = e;
|
||||
this.submitOrder();
|
||||
},
|
||||
|
||||
// 清空
|
||||
handleClear() {
|
||||
this.cartForm.total_amount = '';
|
||||
this.merchantInfo = [];
|
||||
},
|
||||
|
||||
// 输入数字
|
||||
handleChange(e) {
|
||||
this.cartForm.total_amount = e;
|
||||
uni.$u.debounce(that.getProductInfoByMerid, 200)
|
||||
},
|
||||
|
||||
leftClick(e) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
},
|
||||
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e;
|
||||
},
|
||||
|
||||
onLoadFun() {
|
||||
this.getProductInfoByMerid(this.mer_id);
|
||||
this.isShowAuth = false;
|
||||
},
|
||||
|
||||
// 提交订单
|
||||
async submitOrder() {
|
||||
if (!this.cartForm.total_amount) {
|
||||
return this.$util.Tips({
|
||||
title: "请输入付款金额!"
|
||||
})
|
||||
}
|
||||
this.loading = true;
|
||||
|
||||
// 循环加入购物车
|
||||
for (var i = 0; i < that.merchantInfo.length; i++) {
|
||||
let info = {
|
||||
product_id: that.merchantInfo[i].product_id,
|
||||
product_attr_unique: that.merchantInfo[i].unique,
|
||||
cart_num: that.merchantInfo[i].num,
|
||||
is_new: 1,
|
||||
product_type: 0,
|
||||
source: 999,
|
||||
total_amount: that.cartForm.total_amount
|
||||
};
|
||||
|
||||
try {
|
||||
let res = await addCart(info);
|
||||
that.checkForm.cart_id.push(res.data.cart_id);
|
||||
} catch (e) {
|
||||
return that.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (that.checkForm.cart_id && that.checkForm.cart_id.length > 0) {
|
||||
// return console.log(this.checkForm);
|
||||
// return uni.navigateTo({
|
||||
// url: "/pages/payment/settlement?cartId="+this.checkForm.cart_id.join(',')+"&money="+this.cartForm.total_amount,
|
||||
// })
|
||||
orderCheck(that.checkForm).then(res1 => {
|
||||
that.loading = false;
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/payment/settlement",
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('acceptDataFromOpenedPage', {
|
||||
platformConsumption: res1.data.platformCoupon || [],
|
||||
productData: that.merchantInfo,
|
||||
checkForm: that.checkForm,
|
||||
merName: that.mer_name,
|
||||
money: that.cartForm.total_amount,
|
||||
key: res1.data.key,
|
||||
order_type: res1.data.order_type,
|
||||
enabledPlatformCoupon: res1.data.enabledPlatformCoupon,
|
||||
platformCoupon: res1.data.platformCoupon
|
||||
})
|
||||
|
||||
// uni.setStorageSync('datas', {
|
||||
// platformConsumption: res1.data.platformConsumption ||
|
||||
// [],
|
||||
// productData: that.merchantInfo,
|
||||
// checkForm: that.checkForm,
|
||||
// merName: that.mer_name,
|
||||
// money: that.cartForm.total_amount,
|
||||
// key: res1.data.key
|
||||
// })
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
that.loading = false;
|
||||
Toast(err.message || err)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 折叠商品
|
||||
handleOpen() {
|
||||
this.isOpen = !this.isOpen;
|
||||
},
|
||||
|
||||
// 根据店铺获取商品
|
||||
getProductInfoByMerid(merid, money) {
|
||||
this.loading = true;
|
||||
getProductInfo({
|
||||
mer_id: that.mer_id,
|
||||
money: that.cartForm.total_amount
|
||||
}).then(res => {
|
||||
this.loading = false;
|
||||
if (!that.cartForm.total_amount) {
|
||||
this.mer_name = res.data.merchant;
|
||||
} else {
|
||||
that.merchantInfo = res.data.list;
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.loading = false;
|
||||
that.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
}, () => {
|
||||
|
||||
})
|
||||
// #ifdef APP
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1500)
|
||||
// #endif
|
||||
|
||||
// #ifndef APP
|
||||
that.isEmpty = true;
|
||||
// #endif
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
|
||||
image,
|
||||
uni-image {
|
||||
display: inline-block;
|
||||
width: 414rpx;
|
||||
height: 305rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
display: block;
|
||||
color: #666;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
// background-image: url("https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c582c202402291601584806.webp");
|
||||
background-size: 100% auto;
|
||||
background-repeat: no-repeat;
|
||||
padding-top: var(--status-bar-height);
|
||||
|
||||
.v-desc {
|
||||
position: absolute;
|
||||
top: 196rpx;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
background: transparent;
|
||||
|
||||
.v-desc-main {
|
||||
margin-bottom: 30rpx;
|
||||
font-weight: 600;
|
||||
font-size: 42rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.v-desc-sub {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 52rpx 0 54rpx;
|
||||
}
|
||||
|
||||
.shop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 54rpx;
|
||||
|
||||
text {
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.v-con {
|
||||
margin: 0 auto 150rpx;
|
||||
|
||||
.v-con-text {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.v-con-input {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 112rpx;
|
||||
margin-bottom: 32rpx;
|
||||
border-bottom: 1rpx solid #D6D6D6;
|
||||
|
||||
/deep/.uni-input-input {
|
||||
height: 112rpx;
|
||||
font-weight: bold;
|
||||
font-size: 72rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.v-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20rpx;
|
||||
width: 666rpx;
|
||||
height: 210rpx;
|
||||
|
||||
.v-wrap-money {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #FF5E0C;
|
||||
margin-right: 30rpx;
|
||||
|
||||
.icon {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 46rpx;
|
||||
display: inline-block;
|
||||
overflow: auto;
|
||||
width: 180rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.v-wrap-desc {
|
||||
.v-wrap-desc-main {
|
||||
margin-bottom: 16rpx;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #2E2E2E;
|
||||
}
|
||||
|
||||
.v-wrap-desc-sub {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #2E2E2E;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.v-con-group {
|
||||
.v-con-group-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.v-con-group-title-left {
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.v-con-group-title-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
margin-right: 18rpx;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.v-con-group-list {
|
||||
transition: max-height linear .1s;
|
||||
|
||||
.v-con-group-list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14rpx;
|
||||
|
||||
text {
|
||||
margin-left: 30rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.v-btn-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background: #40AE36;
|
||||
border-radius: 10rpx;
|
||||
|
||||
/deep/.u-button {
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/deep/.u-loading-icon__spinner {
|
||||
color: #fff !important;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/deep/.u-button__text {
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,425 +0,0 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view v-if="!isWeixin" class="v-navbar">
|
||||
<u-navbar title="提货付款" :safeAreaInsetTop="false" :fixed="false" @leftClick="leftClick" bgColor="transparent"
|
||||
leftIconColor="#fff" :titleStyle="{color:'#fff',fontWeight:'bold',fontSize:'32rpx'}">
|
||||
</u-navbar>
|
||||
</view>
|
||||
<view style="height: 150rpx;"></view>
|
||||
<view v-if="merchantInfo.length>0 && !isEmpty">
|
||||
<view class="v-desc">
|
||||
<view>
|
||||
<view class="v-desc-main">确认提货付款</view>
|
||||
<view class="v-desc-sub">{{merchantInfo.merchant.mer_name}}</view>
|
||||
</view>
|
||||
<u-image :showLoading="true" :src="merchantInfo.merchant.mer_avatar" width="182rpx" height="182rpx"
|
||||
:radius="10" />
|
||||
</view>
|
||||
|
||||
<!-- 付款金额 -->
|
||||
<view class="v-con">
|
||||
<view class="v-con-text">付款金额</view>
|
||||
<view class="v-con-input" style="margin-right: 10px;">
|
||||
<text style="color: #303133;font-size:46rpx;">¥</text>
|
||||
<u--input type="digit" fontSize="23" v-model="cartForm.total_amount" placeholder="请输入金额"
|
||||
border="none" placeholderStyle="color:#999;font-size:30rpx" @input="validateDecimal">
|
||||
</u--input>
|
||||
</view>
|
||||
|
||||
<view class="v-wrap" v-if="cartForm.total_amount">
|
||||
<view class="v-wrap-money">
|
||||
<text class="icon">¥</text>
|
||||
<text class="num">{{cartForm.total_amount}}</text>
|
||||
</view>
|
||||
<view class="v-wrap-desc">
|
||||
<view class="v-wrap-desc-main">实物提货券</view>
|
||||
<view class="v-wrap-desc-sub">即买即用</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="v-btn-wrap">
|
||||
<view class="v-btn" @click="submitOrder">提交订单</view>
|
||||
</view>
|
||||
|
||||
<!-- 登陆 -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
</view>
|
||||
|
||||
<!-- 无商户信息提示 -->
|
||||
<view v-else class="empty">
|
||||
<image src="/static/images/no_thing.png"></image>
|
||||
<text style="margin-top: 60rpx;">{{tips}}</text>
|
||||
<!-- 登陆 -->
|
||||
<authorize v-show="!isWeixin" ref="authRef" :isAuto="isAuto" :isGoIndex="false" :isShowAuth="isShowAuth"
|
||||
@authColse="authColse" @onLoadFun="onLoadFun">
|
||||
</authorize>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getProductInfo,
|
||||
addCart,
|
||||
orderCheck
|
||||
} from "@/api/payment.js";
|
||||
import Cache from '@/utils/cache';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import authorize from '@/components/Authorize';
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi";
|
||||
export default {
|
||||
components: {
|
||||
authorize
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: true,
|
||||
isWeixin: this.$wechat.isWeixin(),
|
||||
cartForm: {
|
||||
product_id: '',
|
||||
product_attr_unique: '',
|
||||
cart_num: 1,
|
||||
is_new: 1,
|
||||
product_type: 0,
|
||||
source: 999,
|
||||
total_amount: ''
|
||||
},
|
||||
merchantInfo: '',
|
||||
checkForm: {
|
||||
address_id: '',
|
||||
cart_id: [],
|
||||
consumption_id: '',
|
||||
product_type: 0,
|
||||
source: 999,
|
||||
takes: [],
|
||||
use_coupon: {},
|
||||
use_integral: false
|
||||
},
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
mer_id: '',
|
||||
tips: '暂未登陆~'
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(opt) {
|
||||
this.mer_id = opt.mer_id;
|
||||
},
|
||||
onShow() {
|
||||
if (!this.isLogin) {
|
||||
Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id);
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true;
|
||||
if (this.isWeixin) {
|
||||
this.tips = '加载中...';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.authRef.toWecahtAuth();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.checkForm.cart_id = [];
|
||||
this.getProductInfoByMerid(this.mer_id);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateDecimal(event) {
|
||||
let val = (this.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
|
||||
this.$nextTick(() => {
|
||||
this.cartForm.total_amount = val;
|
||||
})
|
||||
},
|
||||
|
||||
leftClick(e) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e;
|
||||
},
|
||||
onLoadFun() {
|
||||
this.getProductInfoByMerid(this.mer_id);
|
||||
this.isShowAuth = false;
|
||||
},
|
||||
|
||||
// 提交订单
|
||||
submitOrder() {
|
||||
if (!this.cartForm.total_amount) {
|
||||
return this.$util.Tips({
|
||||
title: "请输入付款金额!"
|
||||
})
|
||||
}
|
||||
// 订单
|
||||
this.cartForm.product_id = this.merchantInfo.product_id;
|
||||
this.cartForm.product_type = this.merchantInfo.product_type;
|
||||
this.cartForm.product_attr_unique = this.merchantInfo.sku[''].unique;
|
||||
|
||||
let that = this;
|
||||
addCart(this.cartForm).then(res => {
|
||||
// 购物车ID
|
||||
that.checkForm.cart_id.push(res.data.cart_id);
|
||||
orderCheck(that.checkForm).then(res1 => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/payment/settlement?cartId=" + this.checkForm
|
||||
.cart_id + "&money=" + this.cartForm.total_amount +
|
||||
"&merName=" + this.merchantInfo.merchant.mer_name,
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('datas', res1.data.platformConsumption);
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
Toast(err.message || err)
|
||||
});
|
||||
}).catch((err) => {
|
||||
this.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
getProductInfoByMerid(merid) {
|
||||
let that = this;
|
||||
getProductInfo({
|
||||
mer_id: merid,
|
||||
money: 444
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
this.merchantInfo = res.data.list;
|
||||
}).catch((err) => {
|
||||
this.tips = err.message || err.smg || err;
|
||||
this.$util.Tips({
|
||||
title: err.message || err.msg || err
|
||||
})
|
||||
// #ifdef APP
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1500)
|
||||
// #endif
|
||||
|
||||
// #ifndef APP
|
||||
that.isEmpty = true;
|
||||
// #endif
|
||||
})
|
||||
},
|
||||
|
||||
// 图片保存
|
||||
handleSavePic() {
|
||||
// 获取要保存的图片路径或URL
|
||||
let imageUrl = this.qrcodeUrl; // 这里使用了网络上的图片作为示例
|
||||
|
||||
// #ifdef H5
|
||||
var a = document.createElement("a");
|
||||
a.download = imageUrl;
|
||||
a.href = imageUrl;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
let that = this;
|
||||
uni.downloadFile({
|
||||
url: imageUrl,
|
||||
success(res) {
|
||||
if (res.statusCode === 200) {
|
||||
let tempFilePath = res.tempFilePath; // 临时文件路径
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: tempFilePath,
|
||||
success() {
|
||||
return that.$util.Tips({
|
||||
title: '图片已保存至相册!'
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
console.error('保存失败', err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('下载失败', res.statusCode);
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.error('下载失败', err);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FCDFAD;
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
|
||||
image,
|
||||
uni-image {
|
||||
display: inline-block;
|
||||
width: 414rpx;
|
||||
height: 305rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
display: block;
|
||||
color: #666;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
background-image: url("https://lihai001.oss-cn-chengdu.aliyuncs.com/def/c582c202402291601584806.webp");
|
||||
background-size: 100% auto;
|
||||
background-repeat: no-repeat;
|
||||
padding-top: var(--status-bar-height);
|
||||
|
||||
.v-desc {
|
||||
position: absolute;
|
||||
top: 196rpx;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 0 20rpx;
|
||||
background: transparent;
|
||||
|
||||
.v-desc-main {
|
||||
margin-bottom: 30rpx;
|
||||
font-weight: 600;
|
||||
font-size: 42rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.v-desc-sub {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.v-con {
|
||||
position: absolute;
|
||||
top: 436rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 710rpx;
|
||||
height: 680rpx;
|
||||
background: linear-gradient(180deg, #FEB992 0%, #FFFFFF 31%, #FFFFFF 100%);
|
||||
border-radius: 20rpx;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 -4rpx 0px 0px #fff;
|
||||
padding: 53rpx 30rpx 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.v-con-text {
|
||||
margin-bottom: 60rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #2E2E2E;
|
||||
line-height: 16rpx;
|
||||
}
|
||||
|
||||
.v-con-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 83rpx;
|
||||
padding: 0 0 40rpx 12rpx;
|
||||
border-bottom: 1rpx solid #D6D6D6;
|
||||
}
|
||||
|
||||
.v-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20rpx;
|
||||
width: 666rpx;
|
||||
height: 210rpx;
|
||||
background-image: url("https://lihai001.oss-cn-chengdu.aliyuncs.com/def/2f9c2202402291652415355.webp");
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.v-wrap-money {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #FF5E0C;
|
||||
margin-right: 30rpx;
|
||||
|
||||
.icon {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 46rpx;
|
||||
display: inline-block;
|
||||
overflow: auto;
|
||||
width: 180rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.v-wrap-desc {
|
||||
.v-wrap-desc-main {
|
||||
margin-bottom: 16rpx;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #2E2E2E;
|
||||
}
|
||||
|
||||
.v-wrap-desc-sub {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #2E2E2E;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.v-btn-wrap {
|
||||
position: fixed;
|
||||
z-index: 11;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
background-color: #FDD6A6;
|
||||
|
||||
.v-btn {
|
||||
width: 650rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background: #FF8056;
|
||||
box-shadow: 0rpx 3rpx 3rpx 1rpx rgba(255, 94, 12, 0.4);
|
||||
border-radius: 55rpx 55rpx 55rpx 55rpx;
|
||||
border: 1rpx solid #FF8056;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
|
||||
&:active {
|
||||
opacity: .8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user