|
@@ -5,19 +5,22 @@
|
|
|
<img :src="ware.waresPic" alt="" />
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
- <div class="title">{{ware.waresName}}</div>
|
|
|
+ <div class="title">{{ ware.waresName }}</div>
|
|
|
<div class="amount">
|
|
|
- <span class="text">积分 {{ware.saleIntegral}}</span> <span class="num">x 1</span>
|
|
|
+ <span class="text">积分 {{ ware.saleIntegral }}</span>
|
|
|
+ <span class="num">x 1</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="have">
|
|
|
<span class="icon1"></span>
|
|
|
- <span class="text">当前可用积分余额 {{pointInfo.points}}</span>
|
|
|
+ <span class="text">当前可用积分余额 {{ pointInfo.points }}</span>
|
|
|
<span class="icon2"></span>
|
|
|
</div>
|
|
|
<div class="total">
|
|
|
- <div class="text">合计:<span class="num">{{ware.saleIntegral}}积分</span></div>
|
|
|
+ <div class="text">
|
|
|
+ 合计:<span class="num">{{ ware.saleIntegral }}积分</span>
|
|
|
+ </div>
|
|
|
<button @click="pay">提交订单</button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -50,42 +53,46 @@ export default {
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
pointInfo: (state) => state.point.pointInfo,
|
|
|
- userInfo:(state) => state.authen.userInfo
|
|
|
+ userInfo: (state) => state.authen.userInfo,
|
|
|
}),
|
|
|
...mapGetters({
|
|
|
userInfo: "authen/userInfo",
|
|
|
findWare: "point/findWare",
|
|
|
}),
|
|
|
ware() {
|
|
|
- console.log("ware");
|
|
|
- return this.findWare(this.id)
|
|
|
- }
|
|
|
+ return this.findWare(this.id);
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
ProductList,
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log(this);
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- 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"
|
|
|
+ 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) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.retCode === 0) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/point/success",
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ alert("兑换失败")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|