|
@@ -7,7 +7,7 @@
|
|
|
<view class="box-card box-border-box mb-20 bgc-f">
|
|
<view class="box-card box-border-box mb-20 bgc-f">
|
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
|
<view class="fs-28 fw-600 w158">姓名</view>
|
|
<view class="fs-28 fw-600 w158">姓名</view>
|
|
|
- <input type="text" placeholder="请输入姓名">
|
|
|
|
|
|
|
+ <input v-model="fromData.name" type="text" placeholder="请输入姓名">
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
|
<view class="fs-28 fw-600 w158">手机号</view>
|
|
<view class="fs-28 fw-600 w158">手机号</view>
|
|
@@ -16,26 +16,24 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
|
<view class="fs-28 fw-600 w158">验证码</view>
|
|
<view class="fs-28 fw-600 w158">验证码</view>
|
|
|
- <input type="number" placeholder="请输入验证码">
|
|
|
|
|
|
|
+ <input v-model="fromData.code" type="number" placeholder="请输入验证码">
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
<view class="box-input align-items-center box-border-box p-b-20 mb-20">
|
|
|
<view class="fs-28 fw-600 w158">联系地址</view>
|
|
<view class="fs-28 fw-600 w158">联系地址</view>
|
|
|
- <input type="text" placeholder="请输入联系地址(选填)">
|
|
|
|
|
|
|
+ <input v-model="fromData.address" type="text" placeholder="请输入联系地址(选填)">
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="box-card box-border-box mb-20 bgc-f">
|
|
<view class="box-card box-border-box mb-20 bgc-f">
|
|
|
<view class="box-top box-border-box flex-justify-space">
|
|
<view class="box-top box-border-box flex-justify-space">
|
|
|
<view class="box-left display-flex">
|
|
<view class="box-left display-flex">
|
|
|
- <image src="@/static/img/buy/group-bg.png" mode="scaleToFill"></image>
|
|
|
|
|
- <view class="w336 fs-28 fw-400">
|
|
|
|
|
- 巧大耳朵游乐场大耳朵游乐 1大耳朵游乐场
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <image :src="goodsData.cover_img" mode="aspectFill"></image>
|
|
|
|
|
+ <view class="w336 fs-28 fw-400">{{goodsData.title||''}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-right">
|
|
<view class="box-right">
|
|
|
<view class="fs-32 fw-600 text-align-right mb-12">¥19.5</view>
|
|
<view class="fs-32 fw-600 text-align-right mb-12">¥19.5</view>
|
|
|
- <view class="fs-26 text-align-right fc-9">x1</view>
|
|
|
|
|
|
|
+ <!-- <view class="fs-26 text-align-right fc-9">x1</view> -->
|
|
|
<!-- <view class="display-flex align-items-center">
|
|
<!-- <view class="display-flex align-items-center">
|
|
|
<view class="right-only-right-red fw-500 text-align-center fs-36 fc-f">-</view>
|
|
<view class="right-only-right-red fw-500 text-align-center fs-36 fc-f">-</view>
|
|
|
<view class="right-only-right-2 text-align-center fs-28 fw-400">1</view>
|
|
<view class="right-only-right-2 text-align-center fs-28 fw-400">1</view>
|
|
@@ -44,15 +42,15 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="box-buttom text-align-right">
|
|
<view class="box-buttom text-align-right">
|
|
|
- <span class="fs-28 fc-9 fw-400">共5件,</span>
|
|
|
|
|
|
|
+ <!-- <span class="fs-28 fc-9 fw-400">共5件,</span> -->
|
|
|
<span class="fs-28 fc-0 fw-400">合计¥</span>
|
|
<span class="fs-28 fc-0 fw-400">合计¥</span>
|
|
|
- <span class="fs-44 fc-0 fw-b">19.5</span>
|
|
|
|
|
|
|
+ <span class="fs-44 fc-0 fw-b">{{goodsData.deposit||''}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
|
|
<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
|
|
|
<view class="fs-28 fw-600 w158">备注</view>
|
|
<view class="fs-28 fw-600 w158">备注</view>
|
|
|
- <input class="text-align-right" type="text" placeholder="请填写你的需求">
|
|
|
|
|
|
|
+ <input v-model="fromData.note" class="text-align-right" type="text" placeholder="请填写你的备注">
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
|
|
<view class="box-card box-border-box mb-20 bgc-f flex-justify-space">
|
|
@@ -68,7 +66,7 @@
|
|
|
<view class="flex-justify-space">
|
|
<view class="flex-justify-space">
|
|
|
<view class="align-items-flex-end box-1">
|
|
<view class="align-items-flex-end box-1">
|
|
|
<span class="fs-28 fc-f fw-600">¥</span>
|
|
<span class="fs-28 fc-f fw-600">¥</span>
|
|
|
- <span class="fs-44 fc-f fw-600">19.5</span>
|
|
|
|
|
|
|
+ <span class="fs-44 fc-f fw-600">{{goodsData.deposit||''}}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">立即支付</view>
|
|
<view class="text-align-center box-2 fs-32 fc-f fw-600" @click="toSave()">立即支付</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -78,6 +76,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import {getCode} from '@/api/common.js';
|
|
import {getCode} from '@/api/common.js';
|
|
|
|
|
+ import {groupPay,groupCreate} from '@/api/groupOrder.js';
|
|
|
import tools from "@/service/tools";
|
|
import tools from "@/service/tools";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -87,12 +86,24 @@
|
|
|
codeText:'获取验证码',
|
|
codeText:'获取验证码',
|
|
|
|
|
|
|
|
fromData:{
|
|
fromData:{
|
|
|
|
|
+ name:'',
|
|
|
id:'',
|
|
id:'',
|
|
|
phone:'',
|
|
phone:'',
|
|
|
school_id:'',
|
|
school_id:'',
|
|
|
code:'',
|
|
code:'',
|
|
|
note:'',
|
|
note:'',
|
|
|
|
|
+ address:'',
|
|
|
},
|
|
},
|
|
|
|
|
+ isAJAX:false,
|
|
|
|
|
+
|
|
|
|
|
+ goodsData:{},
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad(e) {
|
|
|
|
|
+ if(e.goodsData){
|
|
|
|
|
+ let obj = JSON.parse(decodeURIComponent(e.goodsData));
|
|
|
|
|
+ this.goodsData = obj;
|
|
|
|
|
+ this.fromData.id = obj.id;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
@@ -119,6 +130,48 @@
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ toSave(){
|
|
|
|
|
+ if (this.isAJAX) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.isAJAX = true;
|
|
|
|
|
+ this.fromData.school_id = uni.getStorageSync('school_id');
|
|
|
|
|
+ groupCreate(this.fromData).then((res)=>{
|
|
|
|
|
+ if(res.code === 1){
|
|
|
|
|
+ groupPay({order_id:res.data.order_id}).then((ret)=>{
|
|
|
|
|
+ if(ret.code === 1){
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ provider: "wxpay", //支付类型-固定值
|
|
|
|
|
+ timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
|
|
|
|
|
+ nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
|
|
|
|
|
+ package: ret.data.wx_pay.package, // 固定值
|
|
|
|
|
+ signType: ret.data.wx_pay.signType, //固定值
|
|
|
|
|
+ paySign: ret.data.wx_pay.paySign, //签名
|
|
|
|
|
+ success: (ren) => {
|
|
|
|
|
+ tools.success("支付成功");
|
|
|
|
|
+ this.isAJAX = false;
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ uni.switchTab({
|
|
|
|
|
+ url:"/pages/order/index"
|
|
|
|
|
+ })
|
|
|
|
|
+ },1500)
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (err) =>{
|
|
|
|
|
+ this.isAJAX = false;
|
|
|
|
|
+ tools.error("支付失败");
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.isAJAX = false;
|
|
|
|
|
+ tools.error("支付失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.isAJAX = false;
|
|
|
|
|
+ tools.error(res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|