|
@@ -2,18 +2,43 @@
|
|
|
<div style="position: relative">
|
|
|
<el-image style="width: 100%" :src="url" fit="contain"></el-image>
|
|
|
<div class="area">
|
|
|
- <div class="radio_area">
|
|
|
- <el-radio-group v-model="radioTreaty" @change="radioChange">
|
|
|
- <el-radio label="1">199/年 精准匹配一次权益</el-radio>
|
|
|
- <el-radio label="2">399/年 精准匹配三次权益</el-radio>
|
|
|
- <el-radio label="3">1999/年 精准匹配十次权益</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- <div class="detail_area">
|
|
|
+ <!-- <div class="radio_area"> -->
|
|
|
+ <el-radio-group
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="radioTreaty"
|
|
|
+ @change="radioChange"
|
|
|
+ >
|
|
|
+ <el-radio
|
|
|
+ v-for="(item, index) in arr"
|
|
|
+ :key="index"
|
|
|
+ :value="item.valuable"
|
|
|
+ :label="item.valuable"
|
|
|
+ ><span
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ left: 20px;
|
|
|
+ background: #1c1817;
|
|
|
+ padding: 0 5%;
|
|
|
+ font-weight: 900;
|
|
|
+ font-size: 22px;
|
|
|
+ color: #fec629;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ height: 80%;
|
|
|
+ "
|
|
|
+ >{{ item.valuable / 100 }}</span
|
|
|
+ >
|
|
|
+ <span class="content">{{ item.content }}</span
|
|
|
+ ><span class="ck" @click="goDetails(item)">详情</span></el-radio
|
|
|
+ >
|
|
|
+ </el-radio-group>
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <div class="detail_area">
|
|
|
<div class="ck" @click="goFirst">查看详情</div>
|
|
|
<div class="ck" @click="goSecond">查看详情</div>
|
|
|
<div class="ck" @click="goThird">查看详情</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div class="pay_area">
|
|
|
<div class="pay_btn" @click="pay">立即购买</div>
|
|
@@ -24,8 +49,7 @@
|
|
|
style="margin-top: 2px"
|
|
|
/> -->
|
|
|
<div class="xy" @click="goXy()">
|
|
|
- 点击购买即代表同意<span
|
|
|
- style="color: rgba(20, 80, 130); font-weight: 900"
|
|
|
+ 点击购买即代表同意<span style="color: #fff; font-weight: 900"
|
|
|
>《平台用户服务协议》</span
|
|
|
>
|
|
|
</div>
|
|
@@ -36,13 +60,14 @@
|
|
|
<script>
|
|
|
import openId from "../util/getOpenId";
|
|
|
import { Message } from "element-ui";
|
|
|
-import { getPay, getPayList, getMypayList } from "../api";
|
|
|
+import { getPay, getPayList } from "../api";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
url: require("../assets/huiyuan_bj.jpg"),
|
|
|
- radioTreaty: "1",
|
|
|
+ arr: [],
|
|
|
+ radioTreaty: "",
|
|
|
payOptions: {
|
|
|
appId: "", //公众号名称,由商户传入
|
|
|
timeStamp: "", //时间戳,自1970年以来的秒数
|
|
@@ -57,17 +82,20 @@ export default {
|
|
|
goXy() {
|
|
|
this.$router.push("/xy");
|
|
|
},
|
|
|
- goFirst() {
|
|
|
- this.$router.push("/firstPay");
|
|
|
- },
|
|
|
- goSecond() {
|
|
|
- this.$router.push("/secondPay");
|
|
|
- },
|
|
|
- goThird() {
|
|
|
- this.$router.push("/thirdPay");
|
|
|
+ goDetails(item) {
|
|
|
+ console.log(item)
|
|
|
+ this.$router.push({name:'payDetails',query: {contentImg:item.contentImg,valuable:item.valuable,title:item.title}})
|
|
|
+ // this.$router.push("/firstPay");
|
|
|
},
|
|
|
+ // goSecond() {
|
|
|
+ // this.$router.push("/secondPay");
|
|
|
+ // },
|
|
|
+ // goThird() {
|
|
|
+ // this.$router.push("/thirdPay");
|
|
|
+ // },
|
|
|
radioChange: (val) => {
|
|
|
console.log(val);
|
|
|
+ // console.log(this.radioTreaty)
|
|
|
},
|
|
|
// checkboxChange: (val) => {
|
|
|
// this.checked = val;
|
|
@@ -113,42 +141,57 @@ export default {
|
|
|
},
|
|
|
async pay() {
|
|
|
let params = {};
|
|
|
- if (this.radioTreaty == "1") {
|
|
|
- params = {
|
|
|
- body: "wxtest199",
|
|
|
- outTradeNo: new Date().getTime(),
|
|
|
- totalFee: "1",
|
|
|
- spbillCreateIp: "127.0.0.1",
|
|
|
- notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
- tradeType: "JSAPI",
|
|
|
- openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
- // openid: window.localStorage.getItem("openId"),
|
|
|
- };
|
|
|
- }
|
|
|
- if (this.radioTreaty == "2") {
|
|
|
- params = {
|
|
|
- body: "wxtest399",
|
|
|
- outTradeNo: new Date().getTime(),
|
|
|
- totalFee: "2",
|
|
|
- spbillCreateIp: "127.0.0.1",
|
|
|
- notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
- tradeType: "JSAPI",
|
|
|
- openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
- // openid: window.localStorage.getItem("openId"),
|
|
|
- };
|
|
|
- }
|
|
|
- if (this.radioTreaty == "3") {
|
|
|
- params = {
|
|
|
- body: "wxtest1999",
|
|
|
- outTradeNo: new Date().getTime(),
|
|
|
- totalFee: "3",
|
|
|
- spbillCreateIp: "127.0.0.1",
|
|
|
- notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
- tradeType: "JSAPI",
|
|
|
- openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
- // openid: window.localStorage.getItem("openId"),
|
|
|
- };
|
|
|
+ for (let i = 0; i++; i < this.arr.length) {
|
|
|
+ if (this.arr[i].valuable == this.radioTreaty) {
|
|
|
+ params = {
|
|
|
+ body: this.arr[i].title,
|
|
|
+ outTradeNo: new Date().getTime(),
|
|
|
+ totalFee: this.arr[i].valuable,
|
|
|
+ spbillCreateIp: "127.0.0.1",
|
|
|
+ notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
+ tradeType: "JSAPI",
|
|
|
+ openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
+ // openid: window.localStorage.getItem("openId"),
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
+ // }
|
|
|
+ // if (this.radioTreaty == "1") {
|
|
|
+ // params = {
|
|
|
+ // body: "wxtest199",
|
|
|
+ // outTradeNo: new Date().getTime(),
|
|
|
+ // totalFee: "1",
|
|
|
+ // spbillCreateIp: "127.0.0.1",
|
|
|
+ // notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
+ // tradeType: "JSAPI",
|
|
|
+ // openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
+ // // openid: window.localStorage.getItem("openId"),
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // if (this.radioTreaty == "2") {
|
|
|
+ // params = {
|
|
|
+ // body: "wxtest399",
|
|
|
+ // outTradeNo: new Date().getTime(),
|
|
|
+ // totalFee: "2",
|
|
|
+ // spbillCreateIp: "127.0.0.1",
|
|
|
+ // notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
+ // tradeType: "JSAPI",
|
|
|
+ // openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
+ // // openid: window.localStorage.getItem("openId"),
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ // if (this.radioTreaty == "3") {
|
|
|
+ // params = {
|
|
|
+ // body: "wxtest1999",
|
|
|
+ // outTradeNo: new Date().getTime(),
|
|
|
+ // totalFee: "3",
|
|
|
+ // spbillCreateIp: "127.0.0.1",
|
|
|
+ // notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
+ // tradeType: "JSAPI",
|
|
|
+ // openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
+ // // openid: window.localStorage.getItem("openId"),
|
|
|
+ // };
|
|
|
+ // }
|
|
|
console.log(params);
|
|
|
const result = await getPay(params);
|
|
|
console.log(result);
|
|
@@ -157,7 +200,7 @@ export default {
|
|
|
this.payOptions.nonceStr = result.nonceStr; //随机串
|
|
|
this.payOptions.package = result.packageValue; //prepay_id用等式的格式
|
|
|
this.payOptions.signType = result.signType; //微信签名方式:
|
|
|
- this.payOptions.paySign = result.paySign; //微信签
|
|
|
+ this.payOptions.paySign = result.paySign; //微信签名
|
|
|
console.log(this.payOptions);
|
|
|
this.jsSdk();
|
|
|
},
|
|
@@ -169,9 +212,10 @@ export default {
|
|
|
// console.log(openid, "我是获取的openid");
|
|
|
// });
|
|
|
const result = await getPayList();
|
|
|
- console.log(result)
|
|
|
- const result1 = await getMypayList();
|
|
|
- console.log(result1)
|
|
|
+ console.log(result);
|
|
|
+ this.arr = result.grades;
|
|
|
+ console.log(this.arr);
|
|
|
+
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -180,20 +224,23 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 10%;
|
|
|
position: absolute;
|
|
|
- bottom: 1.5%;
|
|
|
+ bottom: 8%;
|
|
|
left: 0;
|
|
|
// border: 1px solid red;
|
|
|
// text-align: center;
|
|
|
}
|
|
|
.pay_btn {
|
|
|
- height: 60px;
|
|
|
+ height: 85%;
|
|
|
width: 100%;
|
|
|
- text-align: center;
|
|
|
+ // text-align: center;
|
|
|
// border: 1px solid red;
|
|
|
color: #fff;
|
|
|
font-weight: 900;
|
|
|
font-size: 30px;
|
|
|
- line-height: 60px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ // line-height: 60px;
|
|
|
}
|
|
|
.el-image {
|
|
|
display: block;
|
|
@@ -202,23 +249,43 @@ export default {
|
|
|
display: flex;
|
|
|
width: 70%;
|
|
|
position: absolute;
|
|
|
- top: 52%;
|
|
|
+ top: 30%;
|
|
|
left: 15%;
|
|
|
- height: 100px;
|
|
|
-}
|
|
|
-.radio_area {
|
|
|
- height: 100%;
|
|
|
- width: 75%;
|
|
|
-}
|
|
|
-.detail_area {
|
|
|
- width: 25%;
|
|
|
- height: 100%;
|
|
|
- // margin-left: %;
|
|
|
+ height: 30%;
|
|
|
+ // border: 1px solid red;
|
|
|
}
|
|
|
+// .radio_area {
|
|
|
+// height: 100%;
|
|
|
+// width: 100%;
|
|
|
+// border: 1px solid red;
|
|
|
+// }
|
|
|
+// .detail_area {
|
|
|
+// width: 25%;
|
|
|
+// height: 100%;
|
|
|
+// // margin-left: %;
|
|
|
+// }
|
|
|
.el-radio-group .el-radio {
|
|
|
display: block;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+.el-radio /deep/ .el-radio__input{
|
|
|
+ margin-top: 13%;
|
|
|
+}
|
|
|
+.content{
|
|
|
+ // width: 80%;
|
|
|
+ // overflow: hidden;
|
|
|
+ // border: 1px solid red;
|
|
|
+ position: absolute;
|
|
|
+ top: 20%;
|
|
|
+ left: 45%;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
+ width: 55%;
|
|
|
+ word-break:break-all;
|
|
|
+ white-space:normal,
|
|
|
+ // overflow: hidden;
|
|
|
+
|
|
|
+}
|
|
|
.el-radio-group
|
|
|
.el-radio
|
|
|
/deep/
|
|
@@ -230,6 +297,9 @@ export default {
|
|
|
color: #fff !important;
|
|
|
font-size: 13px !important;
|
|
|
padding-left: 4px !important;
|
|
|
+ width: 80%!important;
|
|
|
+ // border: 1px solid red;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
.el-radio-group
|
|
|
.el-radio
|
|
@@ -240,7 +310,7 @@ export default {
|
|
|
content: "";
|
|
|
width: 10px !important;
|
|
|
height: 5px !important;
|
|
|
- border: 2px solid #fea001 !important;
|
|
|
+ border: 2px solid #1c1817 !important;
|
|
|
border-top: transparent !important;
|
|
|
border-right: transparent !important;
|
|
|
text-align: center !important;
|
|
@@ -258,13 +328,21 @@ export default {
|
|
|
background: #fff;
|
|
|
width: 15px;
|
|
|
height: 15px;
|
|
|
+ // margin-top: 20%;
|
|
|
}
|
|
|
.el-radio-group .el-radio /deep/ .el-radio__input .el-radio__inner {
|
|
|
width: 15px;
|
|
|
height: 15px;
|
|
|
}
|
|
|
.el-radio-group .el-radio {
|
|
|
- margin-top: 10px;
|
|
|
+ margin-top: 6%;
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ // overflow: hidden;
|
|
|
+ background: #feb800;
|
|
|
+ overflow: hidden;
|
|
|
+ height: 26%;
|
|
|
+ // width: 100%;
|
|
|
.el-radio__input {
|
|
|
display: none;
|
|
|
color: #fff;
|
|
@@ -285,15 +363,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.ck {
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 13px;
|
|
|
margin-top: 11px;
|
|
|
- background: #fea001;
|
|
|
- color: #fff;
|
|
|
- text-align: center;
|
|
|
+ background: #1f1619;
|
|
|
+ color: #feb800;
|
|
|
+ float: right;
|
|
|
+ padding: 5px 12px;
|
|
|
+ font-weight: 900;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 5%;
|
|
|
+ right: 2%;
|
|
|
+ // text-align: right;
|
|
|
}
|
|
|
.xy {
|
|
|
font-size: 13px;
|
|
|
color: #fff;
|
|
|
margin-left: 5px;
|
|
|
+ margin-top: 10%;
|
|
|
}
|
|
|
</style>
|