|
@@ -50,8 +50,7 @@
|
|
|
/> -->
|
|
|
<div class="xy" @click="goXy()">
|
|
|
点击购买即代表同意<span style="color: #fff; font-weight: 900"
|
|
|
- >《平台用户服务协议》</span
|
|
|
- >
|
|
|
+ >《平台用户服务协议》</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -83,24 +82,19 @@ export default {
|
|
|
this.$router.push("/xy");
|
|
|
},
|
|
|
goDetails(item) {
|
|
|
- console.log(item)
|
|
|
- this.$router.push({name:'payDetails',query: {contentImg:item.contentImg,valuable:item.valuable,title:item.title}})
|
|
|
- // this.$router.push("/firstPay");
|
|
|
+ console.log(item);
|
|
|
+ this.$router.push({
|
|
|
+ name: "payDetails",
|
|
|
+ query: {
|
|
|
+ contentImg: item.contentImg,
|
|
|
+ valuable: item.valuable,
|
|
|
+ title: item.title,
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
- // goSecond() {
|
|
|
- // this.$router.push("/secondPay");
|
|
|
- // },
|
|
|
- // goThird() {
|
|
|
- // this.$router.push("/thirdPay");
|
|
|
- // },
|
|
|
radioChange: (val) => {
|
|
|
console.log(val);
|
|
|
- // console.log(this.radioTreaty)
|
|
|
},
|
|
|
- // checkboxChange: (val) => {
|
|
|
- // this.checked = val;
|
|
|
- // console.log(this.checked);
|
|
|
- // },
|
|
|
jsSdk() {
|
|
|
// 判断微信的WeixinJSBridge
|
|
|
console.log(typeof WeixinJSBridge);
|
|
@@ -140,8 +134,17 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
async pay() {
|
|
|
+ if(!this.radioTreaty){
|
|
|
+ this.$message({
|
|
|
+ message: '至少选择一种权益哦',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log(this.radioTreaty);
|
|
|
let params = {};
|
|
|
- for (let i = 0; i++; i < this.arr.length) {
|
|
|
+ for (let i = 0; i < this.arr.length; i++) {
|
|
|
+ console.log(this.arr[i].valuable);
|
|
|
if (this.arr[i].valuable == this.radioTreaty) {
|
|
|
params = {
|
|
|
body: this.arr[i].title,
|
|
@@ -150,48 +153,11 @@ export default {
|
|
|
spbillCreateIp: "127.0.0.1",
|
|
|
notifyUrl: "https://yuehe.hellevil.com/pay/notify/order",
|
|
|
tradeType: "JSAPI",
|
|
|
- openid: "oyp646XW37eIqrv3XisVWQ3xq3BQ",
|
|
|
- // openid: window.localStorage.getItem("openId"),
|
|
|
+ // 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);
|
|
@@ -207,15 +173,13 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
async mounted() {
|
|
|
- // openId.getOpenId(() => {
|
|
|
- // let openid = window.localStorage.getItem("openId");
|
|
|
- // console.log(openid, "我是获取的openid");
|
|
|
- // });
|
|
|
+ openId.getOpenId(() => {
|
|
|
+ let openid = window.localStorage.getItem("openId");
|
|
|
+ console.log(openid, "我是获取的openid");
|
|
|
+ });
|
|
|
const result = await getPayList();
|
|
|
- console.log(result);
|
|
|
this.arr = result.grades;
|
|
|
- console.log(this.arr);
|
|
|
-
|
|
|
+ // console.log(this.arr);
|
|
|
},
|
|
|
};
|
|
|
</script>
|