|
@@ -2,37 +2,43 @@
|
|
<div class="point-pay">
|
|
<div class="point-pay">
|
|
<div class="product">
|
|
<div class="product">
|
|
<div class="img">
|
|
<div class="img">
|
|
- <img :src="img" alt="" />
|
|
|
|
|
|
+ <img :src="ware.waresPic" alt="" />
|
|
</div>
|
|
</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
- <div class="title">教育读本</div>
|
|
|
|
|
|
+ <div class="title">{{ware.waresName}}</div>
|
|
<div class="amount">
|
|
<div class="amount">
|
|
- <span class="text">积分 99</span> <span class="num">x 1</span>
|
|
|
|
|
|
+ <span class="text">积分 {{ware.saleIntegral}}</span> <span class="num">x 1</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="have">
|
|
<div class="have">
|
|
<span class="icon1"></span>
|
|
<span class="icon1"></span>
|
|
- <span class="text">当前可用积分余额 100</span>
|
|
|
|
|
|
+ <span class="text">当前可用积分余额 {{pointInfo.points}}</span>
|
|
<span class="icon2"></span>
|
|
<span class="icon2"></span>
|
|
</div>
|
|
</div>
|
|
<div class="total">
|
|
<div class="total">
|
|
- <div class="text">合计:<span class="num">99积分</span></div>
|
|
|
|
- <nuxt-link to="/point/success" tag="button">提交订单</nuxt-link>
|
|
|
|
|
|
+ <div class="text">合计:<span class="num">{{ware.saleIntegral}}积分</span></div>
|
|
|
|
+ <button @click="pay">提交订单</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import ProductList from "../../components/ProductList";
|
|
|
|
|
|
+import ProductList from "../../../components/ProductList";
|
|
|
|
+import { mapState, mapGetters, mapActions } from "vuex";
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
|
|
+ validate({ params }) {
|
|
|
|
+ return /^\d{1,}$/.test(params.id);
|
|
|
|
+ },
|
|
head() {
|
|
head() {
|
|
return {
|
|
return {
|
|
- title: "积分支付",
|
|
|
|
|
|
+ title: "积分兑换确认",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ id: this.$route.params.id,
|
|
images: [],
|
|
images: [],
|
|
list: [],
|
|
list: [],
|
|
loading: false, //加载状态
|
|
loading: false, //加载状态
|
|
@@ -41,46 +47,45 @@ export default {
|
|
img: "/test/pro.png",
|
|
img: "/test/pro.png",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState({
|
|
|
|
+ pointInfo: (state) => state.point.pointInfo,
|
|
|
|
+ userInfo:(state) => state.authen.userInfo
|
|
|
|
+ }),
|
|
|
|
+ ...mapGetters({
|
|
|
|
+ userInfo: "authen/userInfo",
|
|
|
|
+ findWare: "point/findWare",
|
|
|
|
+ }),
|
|
|
|
+ ware() {
|
|
|
|
+ console.log("ware");
|
|
|
|
+ return this.findWare(this.id)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
components: {
|
|
components: {
|
|
ProductList,
|
|
ProductList,
|
|
},
|
|
},
|
|
- beforeCreate() {},
|
|
|
|
- created() {},
|
|
|
|
- beforeMount() {},
|
|
|
|
mounted() {
|
|
mounted() {
|
|
console.log(this);
|
|
console.log(this);
|
|
},
|
|
},
|
|
- beforeUpdate() {},
|
|
|
|
- updated() {},
|
|
|
|
- beforeDestroy() {},
|
|
|
|
- destroyed() {},
|
|
|
|
methods: {
|
|
methods: {
|
|
- // onLoad() {
|
|
|
|
- // var that = this;
|
|
|
|
- // that.$axios
|
|
|
|
- // .get("/getIntegralWaresInfoList", {
|
|
|
|
- // params: {
|
|
|
|
- // stationId: "1",
|
|
|
|
- // },
|
|
|
|
- // })
|
|
|
|
- // .then((res) => {
|
|
|
|
- // if (res.data.retCode == 0) {
|
|
|
|
- // that.list = res.data.data; //追加数据
|
|
|
|
- // // 加载状态结束
|
|
|
|
- // that.loading = false;
|
|
|
|
- // that.finished = true;
|
|
|
|
- // console.log(that.list);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // },
|
|
|
|
- // onRefresh() {
|
|
|
|
- // // 清空列表数据
|
|
|
|
- // that.finished = true;
|
|
|
|
- // // 重新加载数据
|
|
|
|
- // // 将 loading 设置为 true,表示处于加载状态
|
|
|
|
- // that.loading = true;
|
|
|
|
- // that.onLoad();
|
|
|
|
- // },
|
|
|
|
|
|
+ pay(){
|
|
|
|
+ this.$axios.$post("insertIntegralOrder",{
|
|
|
|
+ "waresId":this.id,
|
|
|
|
+ "waresName":this.ware.waresName,
|
|
|
|
+ "openId":this.openId,
|
|
|
|
+ "unionId":this.unionId,
|
|
|
|
+ "customerName":this.userInfo.nickname,
|
|
|
|
+ "exchangeNum":1,
|
|
|
|
+ "integral":this.ware.saleIntegral,
|
|
|
|
+ "stationId":this.stationId
|
|
|
|
+ }).then((res)=>{
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path:"/point/success"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -152,7 +157,7 @@ export default {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
width: 0.4rem;
|
|
width: 0.4rem;
|
|
height: 0.35rem;
|
|
height: 0.35rem;
|
|
- background: url("../../static/point/jifen@2x.png") no-repeat 0 0;
|
|
|
|
|
|
+ background: url("../../../static/point/jifen@2x.png") no-repeat 0 0;
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0.39rem;
|
|
top: 0.39rem;
|
|
@@ -172,7 +177,7 @@ export default {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
width: 0.36rem;
|
|
width: 0.36rem;
|
|
height: 0.36rem;
|
|
height: 0.36rem;
|
|
- background: url("../../static/point/xuanzhong@2x.png") no-repeat 0 0;
|
|
|
|
|
|
+ background: url("../../../static/point/xuanzhong@2x.png") no-repeat 0 0;
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 0.36rem;
|
|
right: 0.36rem;
|
|
@@ -185,31 +190,30 @@ export default {
|
|
opacity: 0.95;
|
|
opacity: 0.95;
|
|
position: fixed;
|
|
position: fixed;
|
|
bottom: 0;
|
|
bottom: 0;
|
|
- left:0;
|
|
|
|
|
|
+ left: 0;
|
|
right: 0;
|
|
right: 0;
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content:flex-end;
|
|
|
|
|
|
+ justify-content: flex-end;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
- padding:.4rem;
|
|
|
|
- align-items:center;
|
|
|
|
|
|
+ padding: 0.4rem;
|
|
|
|
+ align-items: center;
|
|
}
|
|
}
|
|
|
|
|
|
-.point-pay .total .text{
|
|
|
|
-font-size: 0.28rem;
|
|
|
|
-font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
-font-weight: 400;
|
|
|
|
-color: #111111;
|
|
|
|
-line-height: 0.4rem;
|
|
|
|
-
|
|
|
|
|
|
+.point-pay .total .text {
|
|
|
|
+ font-size: 0.28rem;
|
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ color: #111111;
|
|
|
|
+ line-height: 0.4rem;
|
|
}
|
|
}
|
|
-.point-pay .total .text .num{
|
|
|
|
-width: 1.17rem;
|
|
|
|
-height: 0.62rem;
|
|
|
|
-font-size: 0.44rem;
|
|
|
|
-font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
-font-weight: 400;
|
|
|
|
-color: #111111;
|
|
|
|
-line-height: 0.62rem;
|
|
|
|
|
|
+.point-pay .total .text .num {
|
|
|
|
+ width: 1.17rem;
|
|
|
|
+ height: 0.62rem;
|
|
|
|
+ font-size: 0.44rem;
|
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ color: #111111;
|
|
|
|
+ line-height: 0.62rem;
|
|
}
|
|
}
|
|
.point-pay .total button {
|
|
.point-pay .total button {
|
|
border: none;
|
|
border: none;
|
|
@@ -225,6 +229,6 @@ line-height: 0.62rem;
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
line-height: 0.4rem;
|
|
line-height: 0.4rem;
|
|
- margin-left:0.2rem;
|
|
|
|
|
|
+ margin-left: 0.2rem;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|