前端:整理首页

前端:修复订单列表和详情价格展示错误
前端:H5 页面的登陆拦截补充
后端 + 前端:增加 refreshToken 刷新 accessToken
This commit is contained in:
YunaiV
2019-04-22 19:11:23 +08:00
parent 3e156b18ee
commit f46a4f7010
28 changed files with 292 additions and 94 deletions

View File

@@ -12,15 +12,37 @@
</a>
</van-swipe-item>
</van-swipe>
<van-panel title="新品推荐">
<van-row style="text-align: center">
<van-col span="8">
<router-link to="/category">
<van-icon name="http://static.iocoder.cn/icons8-medium-priority-45.png"/>
<div style="font-size:12px;margin-top: -10px;">分类</div>
</router-link>
</van-col>
<van-col span="8">
<router-link to="/category">
<van-icon name="http://static.iocoder.cn/icons8-sun-45.png" />
<div style="font-size:12px;margin-top: -10px;">热卖</div>
</router-link>
</van-col>
<van-col span="8">
<router-link to="/category">
<van-icon name="http://static.iocoder.cn/icons8-new-45.png" />
<div style="font-size:12px;margin-top: -10px;">新品</div>
</router-link>
</van-col>
</van-row>
<van-panel title="新品推荐" >
<!-- <product :data="productRecommends['1']" ></product>-->
<div v-for="(product,i) in productRecommends['1']" :key="i">
<div style="height: 70px;" v-for="(product,i) in productRecommends['1']" :key="i">
<product-card :product='product' @click="showProduct(product)" />
</div>
</van-panel>
<van-panel title="热卖推荐">
<div v-for="(product,i) in productRecommends['2']" :key="i">
<div style="height: 70px;" v-for="(product,i) in productRecommends['2']" :key="i">
<product-card :product='product' @click="showProduct(product)" />
</div>
</van-panel>
@@ -28,21 +50,20 @@
</div>
</template>
<script>
import "../../assets/style/index.css";
import whitespace from "../../components/page/whitespace.vue";
import pageLine from "../../components/page/line.vue";
import pageText from "../../components/page/text.vue";
import notice from "../../components/page/notice.vue";
import search from "../../components/page/search.vue";
import pageTitle from "../../components/page/title.vue";
import cube from "../../components/page/cube.vue";
import imageAd from "../../components/page/imageAd.vue";
import imageText from "../../components/page/imageText.vue";
import product from "../../components/page/product.vue";
import { GetPage } from "../../api/page.js";
import { getBannerList, getProductRecommendList } from '../../api/promotion.js';
import "../../assets/style/index.css";
import whitespace from "../../components/page/whitespace.vue";
import pageLine from "../../components/page/line.vue";
import pageText from "../../components/page/text.vue";
import notice from "../../components/page/notice.vue";
import search from "../../components/page/search.vue";
import pageTitle from "../../components/page/title.vue";
import cube from "../../components/page/cube.vue";
import imageAd from "../../components/page/imageAd.vue";
import imageText from "../../components/page/imageText.vue";
import product from "../../components/page/product.vue";
import {getBannerList, getProductRecommendList} from '../../api/promotion.js';
export default {
export default {
name:"page",
components:{
whitespace,

View File

@@ -174,6 +174,7 @@
import {getProductSpuInfo} from '../../api/product';
import {addCart, countCart, getCartCalcSkuPrice} from '../../api/order';
import {Dialog} from 'vant';
import {checkLogin} from "../../utils/cache";
export default {
components: {},
@@ -316,6 +317,13 @@
});
},
onAddCartClicked(data) {
if (!checkLogin()) {
Dialog.alert({
title: '系统提示',
message: '未登陆用户,暂时不支持使用购物车',
});
return;
}
const { selectedNum } = data;
// debugger;
addCart(data.selectedSkuComb.id,selectedNum).then(data => {
@@ -398,9 +406,11 @@
this.doCalcSkuPrice(this.initialSku.id);
});
// 获得购物车数量
countCart().then(data => {
this.cartCount = data;
})
if (checkLogin()) {
countCart().then(data => {
this.cartCount = data;
})
}
}
};
</script>

View File

@@ -39,15 +39,16 @@
</van-cell-group>
<div style="height:15px;"></div>
<van-cell-group class="total">
<van-cell title="商品总额" :value="orderInfo.price"/>
<van-cell title="运费" :value="'+' + orderInfo.logisticsPrice / 100"/>
<van-cell title="实付金额" :value="orderInfo.payAmount" style="font-weight: 700;"/>
<van-cell title="商品总额" :value="orderInfo.buyPrice / 100.0"/>
<van-cell title="运费" :value="'+' + orderInfo.logisticsPrice / 100.0"/>
<van-cell title="折扣" :value="- orderInfo.discountPrice / 100.0"/>
<van-cell title="实付金额" :value="orderInfo.presentPrice / 100.0" style="font-weight: 700;"/>
</van-cell-group>
<div class="footer">
<div class="munu">
<van-button v-if="orderInfo.status === 3 " size="small">退货</van-button>
<van-button v-if="orderInfo.status === 3 " size="small" v-on:click="clickConfirmReceiving(orderId)">确认收货</van-button>
<van-button v-if="orderInfo.status === 1 " size="small" type="danger">支付</van-button>
<van-button v-if="orderInfo.status === 1 " size="small" type="danger" @click="goPay(orderInfo.id)">支付</van-button>
</div>
</div>
</div>
@@ -88,6 +89,9 @@
this.queryOrderPage(this.queryParams)
})
},
goPay(itemId) {
this.$router.push('/pay?appId=POd4RC6a&orderId=' + itemId + '&returnUrl=' + encodeURI('/user/order/info/' + itemId));
},
},
mounted() {
const { id } = this.$route.params;

View File

@@ -33,7 +33,7 @@
</router-link>
</div>
<div slot="footer" class="footer">
<span class="total">总价{{item.payAmount / 100}} </span>
<span class="total">总价{{item.presentPrice / 100}} </span>
<router-link :to="'/user/order/logistics/'+item.orderid">
<van-button v-if="[3,4,5].indexOf(item.status) != -1" size="small">查看物流</van-button>
</router-link>
@@ -114,7 +114,7 @@
state: `${statusArray[order.status]}`,
status: order.status,
products,
payAmount: order.payAmount,
presentPrice: order.presentPrice,
};
});