Commit 30a9d9f7 authored by zhangjianguo's avatar zhangjianguo

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp

parents 43ac37a0 5ce81878
<template>
<view class="catstyle11" style="height: 100%;">
<view class="left-slider">
<sidebar
:active="tid"
name="Name"
:active-color="mainColor"
:border="false"
:list="d"
@change="changeHandler"
></sidebar>
</view>
<view class="right-slider">
<view
class="adbox"
v-if="d[tid].advert_pic && d[tid].advert_pic.length>0"
@click="clickHandler(d[tid].advert_url)"
>
<image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
</view>
<view class="second-box">
<view class="second">
<view
class="item"
:style="{
'border-color': stid == i ? mainColor : '#999',
color: stid == i ? mainColor : '#999',
}"
v-for="(x, i) in d[tid].ChildList"
:key="i"
@click="clickSecondHandler(i)"
>{{ x.Name }}</view>
</view>
</view>
<view class="catstyle11" style="height: 100%;">
<view class="left-slider"><sidebar :active="tid" name="Name" :active-color="mainColor" :border="false" :list="d" @change="changeHandler"></sidebar></view>
<view class="right-slider">
<view class="adbox" v-if="d[tid].advert_pic && d[tid].advert_pic.length > 0" @click="clickHandler(d[tid].advert_url)">
<image mode="aspectFit" :src="d[tid].advert_url" style="width: 100%; height: 100%;" />
</view>
<view class="second-box">
<view class="second">
<view
class="item"
:style="{
'border-color': stid == i ? mainColor : '#999',
color: stid == i ? mainColor : '#999'
}"
v-for="(x, i) in d[tid].ChildList"
:key="i"
@click="clickSecondHandler(i)"
>
{{ x.Name }}
</view>
</view>
</view>
<view :style="{'height':scrollHeight}">
<scroll-view
:scroll-y="true"
@scrolltolower="lower"
:enable-back-to-top="true"
:enable-flex="true"
:style="{ height: '100%', padding: '0 0 0 10px' }"
>
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img">
<image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" />
</view>
<view class="good-info">
<view class="good-name">{{ cx.name }}</view>
<view class="goodprice">
<view class="left">
<view v-if="cx.vip_price">
<van-tag plain color="#f39800">会员价</van-tag>
<span class="vip">{{cx.level_price}}</span>
</view>
<view class="price" :style="{ color: mainColor }">{{ cx.price_content }}</view>
<view class="sell">{{ cx.price }}</view>
</view>
<view class="right">
<u-icon name="cart-circle-o" size="44" :color="mainColor" />
</view>
</view>
</view>
</view>
<u-divider
contentPosition="center"
v-if="isover"
:margin-top="20"
:margin-bottom="20"
>没有更多商品了</u-divider>
</scroll-view>
</view>
</view>
</view>
<view :style="{ height: scrollHeight }">
<scroll-view :scroll-y="true" @scrolltolower="lower" :enable-back-to-top="true" :enable-flex="true" :style="{ height: '100%', padding: '0 0 0 10px' }">
<view class="good" v-for="(cx, ci) in g" :key="ci" @click="clickHandler(cx)">
<view class="good-img"><image mode="aspectFit" :src="cx.cover_pic" style="width: 100%; height: 100%;" /></view>
<view class="good-info">
<view class="good-name">{{ cx.name }}</view>
<view class="goodprice">
<view class="left">
<view v-if="cx.level_price">
<van-tag plain color="#f39800">会员价</van-tag>
<span class="vip">{{ cx.level_price }}</span>
</view>
<view class="price" :style="{ color: mainColor }">{{ cx.price_content }}</view>
<view class="sell">{{ cx.sales }}</view>
</view>
<view @click.stop="showSkuHandler(cx)" class="right"><u-icon name="cart-circle-o" size="44" :color="mainColor" /></view>
</view>
</view>
</view>
<u-divider contentPosition="center" v-if="isover" :margin-top="20" :margin-bottom="20">没有更多商品了</u-divider>
</scroll-view>
</view>
</view>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
</view>
</template>
<script>
import sidebar from "../sidebar/index";
import sidebar from '../sidebar/index';
import goodSku from '../goods/goodsku';
export default {
props: ["d", "h"],
data() {
return {
mainColor: "",
page: 1,
page_count: 1,
mh: 0,
g: [],
isover: false,
loading: false,
tid: 0,
stid: 0,
active: 0,
scrollHeight: "calc(100% - 33px)",
msg:{
pageIndex: 1,
pageSize:14,
Name:'',
GoodsType:0,
CategoryIds:'',
OrderBy:1,
UserId:0,
},
CategoryIdsList:[],
CategoryIds1:'',
CategoryIds2:'',
};
},
components: {
sidebar
},
created() {
this.mainColor = this.$uiConfig.mainColor;
if (this.d[this.tid].advert_pic && this.d[this.tid].advert_pic.length > 0) {
this.scrollHeight += " - (100vw - 105px / 3.37))";
} else {
this.scrollHeight += ")";
}
},
mounted() {
this.CategoryIdsList=[];
this.CategoryIds1=this.d[0].Id;
this.CategoryIds2=this.d[0].ChildList[0].Id;
this.init();
},
methods: {
changeHandler(i) {
this.active=i;
this.CategoryIds1=this.d[i].Id;
this.CategoryIds2=this.d[i].ChildList[0].Id;
this.msg.page = 1;
this.tid = i;
this.stid = 0;
this.g = [];
this.init();
},
clickSecondHandler(i) {
let tid=this.tid;
this.CategoryIds2=this.d[tid].ChildList[i].Id;
this.stid = i;
this.msg.page = 1;
this.g = [];
this.init();
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
},
init() {
this.CategoryIdsList=[];
this.CategoryIdsList.push(this.CategoryIds1,this.CategoryIds2);
this.msg.CategoryIds=this.CategoryIdsList.join(',');
this.isover = false;
this.loading = true;
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsPageListForZY',
data: this.msg
props: ['d', 'h'],
data() {
return {
mainColor: '',
page: 1,
page_count: 1,
mh: 0,
g: [],
isover: false,
loading: false,
tid: 0,
stid: 0,
active: 0,
scrollHeight: 'calc(100% - 33px)',
msg: {
pageIndex: 1,
pageSize: 14,
Name: '',
GoodsType: 0,
CategoryIds: '',
OrderBy: 1,
UserId: 0
},
res => {
this.loading = false;
console.log("resggg",res);
if(res.resultCode==1){
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count==0) {
this.isover = true;
CategoryIdsList: [],
CategoryIds1: '',
CategoryIds2: '',
sku: {},
showSku: false
};
},
components: {
sidebar,goodSku
},
created() {
this.mainColor = this.$uiConfig.mainColor;
if (this.d[this.tid].advert_pic && this.d[this.tid].advert_pic.length > 0) {
this.scrollHeight += ' - (100vw - 105px / 3.37))';
} else {
this.scrollHeight += ')';
}
},
mounted() {
this.CategoryIdsList = [];
this.CategoryIds1 = this.d[0].Id;
this.CategoryIds2 = this.d[0].ChildList[0].Id;
this.init();
},
methods: {
// 购物车
showSkuHandler(g) {
console.log('g', g);
this.sku = g;
this.showSku = true;
},
changeHandler(i) {
this.active = i;
this.CategoryIds1 = this.d[i].Id;
this.CategoryIds2 = this.d[i].ChildList[0].Id;
this.msg.page = 1;
this.tid = i;
this.stid = 0;
this.g = [];
this.init();
},
clickSecondHandler(i) {
let tid = this.tid;
this.CategoryIds2 = this.d[tid].ChildList[i].Id;
this.stid = i;
this.msg.page = 1;
this.g = [];
this.init();
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.id });
},
init() {
this.CategoryIdsList = [];
this.CategoryIdsList.push(this.CategoryIds1, this.CategoryIds2);
this.msg.CategoryIds = this.CategoryIdsList.join(',');
this.isover = false;
this.loading = true;
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsPageListForZY',
data: this.msg
},
res => {
this.loading = false;
console.log('resggg', res);
if (res.resultCode == 1) {
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1 || this.page_count == 0) {
this.isover = true;
}
}
uni.hideNavigationBarLoading();
}
);
// this.isover = false;
// this.loading = true;
// this.request(
// {
// url: "",
// data: {
// r: "api/default/goods-list",
// page: this.page,
// cat_id: this.d[this.tid].child[this.stid].id
// }
// },
// res => {
// this.g = this.g.concat(res.data.list);
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// this.loading = false;
// }
// );
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
if (!this.loading) {
this.msg.pageIndex++;
this.init();
}
uni.hideNavigationBarLoading();
} else {
this.isover = true;
}
);
// this.isover = false;
// this.loading = true;
// this.request(
// {
// url: "",
// data: {
// r: "api/default/goods-list",
// page: this.page,
// cat_id: this.d[this.tid].child[this.stid].id
// }
// },
// res => {
// this.g = this.g.concat(res.data.list);
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// this.loading = false;
// }
// );
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
if (!this.loading) {
this.msg.pageIndex++;
this.init();
}
} else {
this.isover = true;
}
}
}
}
}
};
</script>
<style>
.catstyle11 {
display: flex;
display: flex;
}
.catstyle11 .left-slider {
width: 85px;
height: 100%;
background: #f5f5f5;
width: 85px;
height: 100%;
background: #f5f5f5;
}
.catstyle11 .right-slider {
padding: 10px 0;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
padding: 10px 0;
height: 100%;
width: 1px;
flex: 1;
overflow: hidden;
overflow-y: auto;
}
.catstyle11 .good {
border-bottom: 1rpx solid #f1f1f1;
display: flex;
padding: 10px 0;
margin-right: 16px;
border-bottom: 1rpx solid #f1f1f1;
display: flex;
padding: 10px 0;
margin-right: 16px;
}
.catstyle11 .good .good-img {
width: 77px;
height: 77px;
width: 77px;
height: 77px;
}
.catstyle11 .good .good-info .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 3px;
font-size: 14px;
height: 36px;
margin-bottom: 5px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 3px;
font-size: 14px;
height: 36px;
margin-bottom: 5px;
}
.catstyle11 .good .good-info {
margin-left: 5px;
width: 1px;
flex: 1;
min-height: 70px;
margin-left: 5px;
width: 1px;
flex: 1;
min-height: 70px;
}
.catstyle11 .good .good-info .goodprice {
display: flex;
align-items: flex-end;
display: flex;
align-items: flex-end;
}
.catstyle11 .good .good-info .left {
flex: 1;
width: 1px;
flex: 1;
width: 1px;
}
.catstyle11 .good .good-info .right {
width: 30px;
height: 30px;
display: flex;
justify-items: right;
align-items: flex-end;
width: 30px;
height: 30px;
display: flex;
justify-items: right;
align-items: flex-end;
}
.catstyle11 .good .good-info .left .vip {
font-size: 14px;
font-weight: 600;
color: #f39800;
font-size: 14px;
font-weight: 600;
color: #f39800;
}
.catstyle11 .good .good-info .goodprice .left .price {
font-size: 16px;
font-size: 16px;
}
.catstyle11 .good .good-info .goodprice .left .sell {
font-size: 12px;
color: gray;
font-size: 12px;
color: gray;
}
.catstyle11 .right-slider .adbox {
width: 100%;
height: calc(100vw - 105px / 3.37);
width: 100%;
height: calc(100vw - 105px / 3.37);
}
.catstyle11 .second-box {
width: 100%;
overflow-x: auto;
width: 100%;
overflow-x: auto;
}
.catstyle11 .second {
padding: 10px 0;
margin: 0 10px;
white-space: nowrap;
background: #fff;
overflow-x: auto;
padding: 10px 0;
margin: 0 10px;
white-space: nowrap;
background: #fff;
overflow-x: auto;
}
.catstyle11 .second .item {
margin-right: 10px;
display: inline-block;
padding: 5px 10px;
height: 23px;
line-height: 23rpx;
box-sizing: border-box;
border-radius: 23px;
border: 1px solid transparent;
font-size: 12px;
margin-right: 10px;
display: inline-block;
padding: 5px 10px;
height: 23px;
line-height: 23rpx;
box-sizing: border-box;
border-radius: 23px;
border: 1px solid transparent;
font-size: 12px;
}
</style>
......@@ -6,16 +6,16 @@
<view class="good-img">
<image
mode="aspectFill"
:src="cx.CoverImage"
:src="cx.cover_pic"
style="width: 100%; height: 100%;"
/>
</view>
<view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.Name }}</view>
<view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.name }}</view>
<view class="good-info">
<view class="price" :style="{ color: mainColor }">
{{cx.SellingPrice}}</view>
{{cx.price}}</view>
<!-- v-if="setting.is_show_sales_num=='1'" -->
<view class="sell">已售{{ cx.SalesNum }}</view>
<view class="sell">{{ cx.sales }}</view>
<view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" />
</view>
......@@ -65,11 +65,11 @@ export default {
},
methods: {
initConfig() {
this.setting = uni.getStorageSync("basedata").mall.setting
this.setting = uni.getStorageSync("basedata").setting
},
clickHandler(item) {
console.log("GoodsId",item)
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id });
},
showSkuHandler(g) {
this.sku = g;
......
......@@ -10,7 +10,7 @@
v-for="(item, gli) in goodList"
:key="gli"
class="good-one"
@click="openGood(item.page_url)"
@click="openGood(item)"
:style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background:
......@@ -107,10 +107,8 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(url) {
uni.navigateTo({
url: url
});
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
},
showSkuHandler(g){
this.sku=g
......
......@@ -11,7 +11,7 @@
<u-col span="6" v-for="(item, gli) in goodList" :key="gli">
<view
class="good-two"
@click="openGood"
@click="openGood(item)"
:style="{
border:
goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
......@@ -103,8 +103,8 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(e) {
console.log(e);
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
},
},
};
......
......@@ -13,7 +13,7 @@
v-for="(item, gli) in goodList"
:key="gli"
>
<div class="good-three" @click="openGood(item.page_url)" :style="{
<div class="good-three" @click="openGood(item)" :style="{
border:
goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background:
......@@ -110,10 +110,8 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(url) {
uni.navigateTo({
url: url
});
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
},
showSkuHandler(g){
this.sku=g
......
......@@ -11,7 +11,7 @@
class="good-four"
v-for="(item, gli) in goodList"
:key="gli"
@click="openGood(item.page_url)"
@click="openGood(item)"
:style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background:
......@@ -99,14 +99,12 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(url) {
uni.navigateTo({
url: url
});
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
},
showSkuHandler(g){
this.sku=g
this.showSku=true
this.showSku=true
},
//格式化价格添加.00
// getPrice(value){
......
......@@ -9,7 +9,7 @@
>
<view
class="good-five"
@click="openGood"
@click="openGood(item)"
v-for="(item, gli) in goodList"
:key="gli"
:style="{
......@@ -100,8 +100,8 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(e) {
console.log(e);
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
},
showSkuHandler(g){
this.sku=g
......
......@@ -11,7 +11,7 @@
class="good-four"
v-for="(item, gli) in goodList"
:key="gli"
@click="openGood"
@click="openGood(item)"
:style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background:
......@@ -92,8 +92,8 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(e) {
console.log(e);
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
},
},
};
......
......@@ -3,10 +3,7 @@
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [{
"path": "pages/order/after-sale/refunds-list"
},
{
"path": "pages/user-center/user-center"
"path": "pages/index/index"
},
{
"path": "pages/pay/pay/pay"
......@@ -14,50 +11,12 @@
{
"path": "pages/cart/cart"
},
{
"path": "pages/order/index/index"
},
{
"path": "pages/order/order-detail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/balance/balance"
},
{
"path": "pages/index/index"
},
{
"path": "pages/order/after-sale/refunds-detail"
},
{
"path": "pages/order/after-sale/refunds"
},
{
"path": "pages/order/after-sale/index"
},
{
"path": "pages/order-submit/order-submit"
},
{
"path": "pages/search/search"
},
{
"path": "pages/cats/cats"
},
{
"path": "pages/goods/goods"
},
{
"path": "pages/goods/comment-list"
},
{
"path": "pages/foot/index/index"
},
......@@ -65,57 +24,152 @@
"path": "pages/favorite/favorite"
},
{
"path": "pages/address/address"
},
{
"path": "pages/address/address_chosen"
"path": "pages/card/index/index"
},
{
"path": "pages/address/AddAddress"
"path": "pages/cash-detail/cash-detail"
},
{
"path": "pages/webbox/webbox"
},
{
"path": "pages/goods/list"
},
{
"path": "pages/order/index"
},
{
"path": "pages/balance/recharge"
}, {
"path": "pages/card/index/index"
}, {
"path": "pages/coupon/list/list"
}, {
"path": "pages/coupon/details/details"
}, {
"path": "pages/coupon/index/index"
}, {
"path": "pages/user-center/integral-detail/integral-detail"
}
, {
"path": "pages/share/index/index"
}, {
"path": "pages/share/add/add"
}, {
"path": "pages/share/cash/cash"
}, {
"path": "pages/share-money/share-money"
}, {
"path": "pages/cash-detail/cash-detail"
}, {
"path": "pages/share/level/level"
}, {
"path": "pages/share-qrcode/share-qrcode"
},{
"path" : "pages/share-order/share-order"
}
,{
"path" : "pages/share-team/share-team"
],
"subPackages": [{
"root": "pages/goods",
"pages": [{
"path": "goods",
"style": {}
},
{
"path": "comment-list"
},
{
"path": "list"
}
]
},
{
"root": "pages/balance",
"pages": [{
"path": "recharge"
},
{
"path": "balance"
}
]
},
{
"root": "pages/user-center",
"pages": [{
"path": "integral-detail/integral-detail"
},
{
"path": "user-center"
}
]
},
{
"root": "pages/share",
"pages": [{
"path": "index/index"
},
{
"path": "add/add"
},
{
"path": "cash/cash"
}
]
},
{
"root": "pages/share-team",
"pages": [{
"path": "share-team"
}]
},
{
"root": "pages/share-order",
"pages": [{
"path": "share-order"
}]
},
{
"root": "pages/share-qrcode",
"pages": [{
"path": "share-qrcode"
}]
},
{
"root": "pages/share-money",
"pages": [{
"path": "share-money"
}]
},
{
"root": "pages/coupon",
"pages": [{
"path": "list/list"
},
{
"path": "details/details"
},
{
"path": "index/index"
}
]
},
{
"root": "pages/order-submit",
"pages": [{
"path": "pay-success"
},
{
"path": "order-submit"
}
]
},
{
"root": "pages/address",
"pages": [{
"path": "address"
},
{
"path": "address_chosen"
},
{
"path": "AddAddress"
}
]
},
{
"root": "pages/order",
"pages": [{
"path": "index/index"
},
{
"path": "after-sale/refunds-list"
},
{
"path": "order-detail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "after-sale/refunds-detail"
},
{
"path": "after-sale/refunds"
},
{
"path": "after-sale/index"
},
{
"path": "index"
},
{
"path": "express"
}
]
}
],
"globalStyle": {
......
......@@ -231,7 +231,9 @@ export default {
isExsitGoods: true,
pageTitle: "商品详情",
setting:{},
prevPage:""
prevPage:"",
//自定义接手传递
opTionObj:{}
};
},
components: {
......@@ -241,12 +243,14 @@ export default {
auth,
},
onLoad(option) {
this.id = option.id ? option.id : 46942; //40887 59512 46942
console.log(option,'optionnnn');
this.opTionObj=option;
this.id = option.GoodsId ? option.GoodsId : 46942; //40887 59512 46942
this.init();
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.initPage();
this.setting = uni.getStorageSync("basedata").mall.setting
this.setting = uni.getStorageSync("basedata").setting
},
methods: {
initPage() {
......@@ -271,17 +275,16 @@ export default {
},
init() {
this.loading = true;
this.request(
this.request2(
{
url: "",
url: "/api/AppletGoods/GetAppletGoodsInfo",
data: {
r: "api/goods/detail",
id: this.id,
GoodsId: this.opTionObj.GoodsId
},
},
(res) => {
console.log(res);
if (res.code == 0) {
console.log(res,'详情');
if (res.resultCode == 1) {
this.g = res.data.goods;
this.g.pic_url.forEach((x) => {
this.imgs.push(x.pic_url);
......@@ -303,6 +306,7 @@ export default {
this.detailContent = richtext;
this.loading = false;
this.initComments();
this.initRecommend();
} else {
this.isExsitGoods = false;
}
......@@ -343,22 +347,20 @@ export default {
},
(res) => {
this.comments = res.data;
this.initRecommend();
// this.initRecommend();
}
);
},
initRecommend() {
this.request(
this.request2(
{
url: "",
url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
data: {
r: "api/goods/new-recommend",
goods_id: this.id,
type: "goods",
RecommendType: 1,
},
},
(res) => {
this.recommend = res.data.list;
this.recommend = res.data.List;
}
);
},
......
......@@ -329,21 +329,28 @@ export default {
},
(res) => {
console.log(res.data);
uni.showModal({
title: "下单提醒",
content:
"订单已经创建成功,等待后端实现支付调用,是否前往订单列表",
success: function (res) {
if (res.confirm) {
that.isLeave = true;
uni.navigateTo({
url: "/pages/order/index",
});
} else if (res.cancel) {
console.log("用户点击取消");
}
},
//TODO 未实现 支付 开始调起支付
uni.navigateTo({
url: '/pages/order-submit/pay-success'
});
// uni.showModal({
// title: "下单提醒",
// content:
// "订单已经创建成功,等待后端实现支付调用,是否前往订单列表",
// success: function (res) {
// if (res.confirm) {
// that.isLeave = true;
// uni.navigateTo({
// url: "/pages/order/index",
// });
// } else if (res.cancel) {
// console.log("用户点击取消");
// }
// },
// });
}
);
}
......
<template>
<view class="paySuccess">
<view style="background: #fff;">
<view class="img-box">
<img src="/static/images/icon/pay-success.png" class="img" />
</view>
<view class="title">订单支付成功</view>
<view class="price">实付 ¥119.00</view>
<view class="btn-box">
<u-button
style="display: inline-block;"
shape="circle"
:custom-style="customStyle"
@click="goHome"
>返回首页</u-button
>
<u-button
shape="circle"
style="margin-left: 60rpx; display: inline-block;"
:custom-style="themCustomStyle"
@click.stop="redictToOrders"
>查看订单</u-button
>
</view>
</view>
<u-divider :margin-top="20" :margin-bottom="20" bg-color="transparent">
<view style="display: flex;">
<u-icon name="like" size="20px" :color="mainColor"></u-icon>
<text style="margin-left: 5px;">为你推荐</text>
</view>
</u-divider>
<view style="padding: 12px;" v-if="recommend.length > 0">
<goodlist :list="recommend"></goodlist>
</view>
</view>
</template>
<script>
import goodlist from "@/components/goods/list";
export default {
components: {
goodlist,
},
data() {
return {
customStyle: {
marginLeft: "20px",
padding: "0 30rpx",
},
themCustomStyle: {
marginLeft: "20px",
padding: "0 30rpx",
},
mainColor: "",
recommend: [],
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: "支付成功",
});
this.mainColor = this.$uiConfig.mainColor;
this.themCustomStyle.color = this.mainColor;
this.themCustomStyle.borderColor = this.mainColor;
this.initRecommend();
},
methods: {
initRecommend() {
this.request(
{
url: "",
data: {
r: "api/goods/new-recommend",
goods_id: 0,
type: "goods",
},
},
(res) => {
this.recommend = res.data.list;
}
);
},
redictToOrders() {
uni.redirectTo({
url: "/pages/order/index/index",
});
},
goHome() {
uni.redirectTo({
url: "/pages/index/index",
});
},
},
};
</script>
<style>
.paySuccess {
min-height: 100vh;
padding-bottom: 40rpx;
background: #f5f5f5;
}
.paySuccess .img-box {
display: flex;
align-items: center;
justify-content: center;
}
.paySuccess .img-box .img {
width: 256rpx;
height: 256rpx;
padding: 60rpx 0 0 0;
}
.paySuccess .title {
padding: 40rpx 0 20rpx 0;
font-size: 32rpx;
color: #000;
font-weight: 600;
text-align: center;
}
.paySuccess .price {
font-size: 30rpx;
color: gray;
padding-bottom: 60rpx;
text-align: center;
}
.paySuccess .btn-box {
padding-bottom: 60rpx;
text-align: center;
}
</style>
<template>
<view class="express">
<view class="status-box">
<view class="item">
<view class="name">快递公司:</view>
<view class="val">{{ express }}</view>
</view>
<view class="item">
<view class="name">运单号:</view>
<view class="val">{{ express_no }}</view>
</view>
<view class="item">
<view class="name">运送状态:</view>
<view class="val" :style="{ color: mainColor }">{{
d.status_text
}}</view>
</view>
</view>
<view
style="
margin-top: 40rpx;
background: #fff;
padding: 40rpx;
border-radius: 20rpx;
"
>
<u-time-line>
<u-time-line-item nodeTop="2">
<template v-slot:node>
<view
class="u-node meudim"
:style="{ background: mainColor, color: '#FFF' }"
>收</view
>
</template>
<template v-slot:content>
<view>
<view
class="u-order-desc"
style="
padding-bottom: 60rpx;
margin-top: 5rpx;
font-size: 26rpx;
"
>收货地址:{{address}}</view
>
</view>
</template>
</u-time-line-item>
<u-time-line-item nodeTop="2" v-if="d.status == 3">
<template v-slot:node>
<view class="u-node" :style="{ background: mainColor }">
<u-icon name="success" color="#fff" :size="32"></u-icon>
</view>
</template>
<template v-slot:content>
<view style="padding-bottom: 30rpx;color:#000 !important;">
<view class="u-order-title">已签收</view>
<view class="u-order-desc">{{ last.desc }}</view>
<view class="u-order-time">{{ last.datetime }}</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item v-for="(x, i) in d.list" :key="i">
<!-- 此处没有自定义左边的内容,会默认显示一个点 -->
<template v-slot:content>
<view style="padding-bottom: 30rpx;" :style="{color:(i==0 && d.status!=3)?'#000 !important':'gray'}">
<view class="u-order-desc">{{ x.desc }}</view>
<view class="u-order-time">{{ x.datetime }}</view>
</view>
</template>
</u-time-line-item>
</u-time-line>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mainColor: "",
express: "",
express_no: "",
d: {},
loading: false,
address: "",
last: {},
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: "物流信息",
});
this.mainColor = this.$uiConfig.mainColor;
this.express = option.express || "圆通速递";
this.express_no = option.no || "YT2042624009816";
this.address = option.address || "四川成都市高新西区万景峰二期";
this.init();
},
methods: {
init() {
let h = this.apiheader();
this.request(
{
url: "",
header: h,
data: {
r: "api/order/express-detail",
express: this.express,
express_no: this.express_no,
customer_name: "",
},
},
(res) => {
this.loading = false;
this.d = res.data.express;
this.d.list = this.d.list.reverse();
if (this.d.status == 3) {
this.last = this.d.list[0];
this.d.list.splice(0, 1);
}
}
);
},
},
};
</script>
<style>
.express {
min-height: 100vh;
background: #f5f5f5;
font-family: "aaa";
}
.express .status-box {
background: #fff;
padding: 60rpx 40rpx;
padding-bottom: 0;
border-bottom-left-radius: 20rpx;
border-bottom-right-radius: 20rpx;
}
.express .status-box .item {
display: flex;
align-items: center;
padding-bottom: 40rpx;
}
.express .status-box .item .name {
font-size: 24rpx;
color: #888;
width: 120rpx;
margin-right: 40rpx;
}
.express .status-box .item .val {
font-family: "aaa";
font-size: 28rpx;
color: #000;
font-weight: 600;
width: 1rpx;
flex: 1;
}
.u-node {
width: 44rpx;
height: 44rpx;
border-radius: 100rpx;
display: flex;
justify-content: center;
align-items: center;
background: #d0d0d0;
}
.u-node.meudim {
width: 40rpx;
height: 40rpx;
font-size: 24rpx;
}
.u-order-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin-bottom: 20rpx;
}
.u-order-desc {
/* color: rgb(150, 150, 150); */
font-size: 28rpx;
margin-bottom: 10rpx;
}
.u-order-time {
/* color: rgb(200, 200, 200); */
font-size: 26rpx;
}
</style>
......@@ -8,8 +8,8 @@
<view style="padding: 10px 0; background: #fff;">
<u-tabs
:list="list"
:is-scroll="false"
:current="current"
name="Name"
@change="change"
:active-color="mainColor"
bg-color="#FFF"
......@@ -221,15 +221,7 @@ export default {
return {
pageTitle: "我的订单",
current: 0,
list: [
{ name: "全部" },
{ name: "待付款" },
{ name: "待发货" },
{ name: "待收货" },
{ name: "待评价" },
// { name: "已完成" },
// { name: "已取消" },
],
list: [],
mainColor: "",
contentHeight: 0,
page: 1,
......@@ -252,6 +244,17 @@ export default {
padding: "0 30rpx",
},
template_message: [],
msg:{
pageIndex:1,
pageSize:15,
OrderId:0,
OrderType:0,
DeliveryMethod:0,
StartTime:'',
EndTime:'',
OrderStatus:0,
OrderNo:'',
},
};
},
created() {
......@@ -280,8 +283,30 @@ export default {
this.current = option.status || -1;
this.loading = true;
this.init();
this.getOrderStatus();
},
methods: {
getOrderStatus() {
this.request2(
{
url: '/api/order/GetOrderStatusEnumList',
data: {}
},
res => {
uni.hideNavigationBarLoading();
if(res.resultCode==1){
this.isloading = false;
this.list = res.data;
let obj={
Name:'全部',
Id:0,
}
this.list.unshift(obj)
console.log("this.list",this.list)
}
}
);
},
redirectToDetail(id) {
uni.navigateTo({
url: "/pages/order/order-detail?id=" + id,
......@@ -315,43 +340,61 @@ export default {
});
},
change(index) {
this.current = index;
this.page = 1;
this.g = [];
this.loading = true;
this.init();
this.current = index;
this.msg.OrderStatus=this.list[index].Id;
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
},
init() {
this.isover = false;
let h = this.apiheader();
this.request(
{
url: "",
header: h,
data: {
r: "api/order/list",
status: this.current,
page: this.page,
},
},
(res) => {
this.loading = false;
this.g = this.g.concat(res.data.list);
this.template_message = res.data.template_message;
this.page_count = res.data.pagination.page_count;
if (this.page_count == 1) {
this.isover = true;
}
}
);
this.request2(
{
url: '/api/AppletOrder/GetAppletGoodsMyOrderPageList',
data: this.msg
},
res => {
uni.hideNavigationBarLoading();
if(res.resultCode==1){
this.loading = false;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.page_count;
if (this.page_count == 1) {
this.isover = true;
}
}
}
);
// this.request(
// {
// url: "",
// header: h,
// data: {
// r: "api/order/list",
// status: this.current,
// page: this.page,
// },
// },
// (res) => {
// this.loading = false;
// this.g = this.g.concat(res.data.list);
// this.template_message = res.data.template_message;
// this.page_count = res.data.pagination.page_count;
// if (this.page_count == 1) {
// this.isover = true;
// }
// }
// );
},
lower(e) {
if (this.page < this.page_count) {
this.page++;
this.init();
} else {
this.isover = true;
}
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.init();
} else {
this.isover = true;
}
},
cancel(e, index) {
this.showModal = true;
......
......@@ -74,6 +74,34 @@
<view class="good-price">{{ x.total_original_price }}</view>
</view>
</view>
<template v-for="(e, ei) in orders.detailExpress">
<view :key="ei" class="order-info-item peisong">
<template v-for="(ec, eci) in e.expressRelation">
<view
class="field"
:key="eci"
v-if="e.send_type == '2' && ec.order_detail_id == x.id"
>
<view class="label">配送方式</view>
<view class="content">{{ e.express_content }}</view>
</view>
<view
class="field"
:key="eci"
@click="goExpressHandler(e.express, e.express_no)"
v-if="e.send_type == '1' && ec.order_detail_id == x.id"
>
<view class="label">配送方式</view>
<view class="content"
>{{ e.express }} {{ e.express_no }}</view
>
<view style="margin-left: 10px;">
<u-icon name="arrow" size="32" color="#000"></u-icon>
</view>
</view>
</template>
</view>
</template>
<view
style="
margin-top: 20px;
......@@ -119,14 +147,14 @@
<view class="content">{{ orders.pay_time }}</view>
</view>
</view>
<view class="order-info-item">
<!-- <view class="order-info-item" v-if="orders.detailExpress[0].">
<view class="field">
<view class="label">配送方式:</view>
<view class="content">{{
orders.detailExpress[0].express_content
}}</view>
</view>
</view>
</view> -->
</view>
<view class="block">
<view class="order-info-item">
......@@ -188,22 +216,20 @@
>确认收货</u-button
>
</view>
<view
class="item"
v-if="orders.status_text == '待付款'"
>
<u-button
shape="circle"
size="medium"
:custom-style="themCustomStyle"
<view class="item" v-if="orders.status_text == '待付款'">
<u-button shape="circle" size="medium" :custom-style="themCustomStyle"
>立即支付</u-button
>
</view>
<view class="item" v-if="orders.status_text == '待收货'">
<u-button shape="circle" size="medium" :custom-style="customStyle"
<!-- <view class="item" v-if="orders.status_text == '待收货'">
<u-button
shape="circle"
@click=""
size="medium"
:custom-style="customStyle"
>查看物流</u-button
>
</view>
</view> -->
<view class="item" v-if="orders.status_text == '待收货'">
<u-button
shape="circle"
......@@ -273,9 +299,11 @@
<script>
import afterSale from "@/components/userorder/after-sale";
import goodlist from "@/components/goods/list";
export default {
components: {
afterSale,
goodlist,
},
data() {
return {
......@@ -322,6 +350,17 @@ export default {
shouhuoHandler() {
this.showReviceModal = true;
},
goExpressHandler(express, no) {
uni.navigateTo({
url:
"/pages/order/express?express=" +
express +
"&no=" +
no +
"&address=" +
this.orders.address,
});
},
submitReviceGoodHandler() {
let that = this;
let h = this.apiheader();
......@@ -602,6 +641,14 @@ export default {
margin-bottom: 15px;
display: flex;
}
.orderdetail .order-info-item.peisong {
border: none;
background: #f1f1f1;
border-radius: 5px;
padding: 10px;
margin: 15px 0 5px 0;
overflow: hidden;
}
.orderdetail .order-info-item .field:last-child {
margin-bottom: 0;
}
......
......@@ -166,18 +166,17 @@ export default {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
//为你推荐
initRecommend() {
this.request(
this.request2(
{
url: "",
url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
data: {
r: "api/goods/new-recommend",
goods_id: 0,
type: "goods",
RecommendType:1
},
},
(res) => {
this.recommedGoods = res.data.list;
this.recommedGoods = res.data.List;
}
);
},
......@@ -249,20 +248,23 @@ export default {
this.isover = false;
this.loading = true;
this.showLoading = this.page != 1;
this.request(
this.request2(
{
url: "",
url: "/api/AppletGoods/GetAppletGoodsPageListForZY",
data: {
r: "api/default/goods-list",
page: this.page,
keyword: this.searchKey,
sign: "",
pageIndex:1,
pageSize:20,
Name:this.searchKey,
GoodsType:0,
CategoryIds:'',
OrderBy:1
},
},
(res) => {
console.log(res,'搜索ress');
this.showLoading = true;
this.g = this.g.concat(res.data.list);
this.page_count = res.data.pagination.page_count;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.page_count;
if (this.page_count == 1) {
this.isover = true;
this.status = "nomore";
......
export default {
install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
Vue.prototype.host2 = "http://192.168.0.110:8200"
Vue.prototype.host2 = "http://192.168.2.16:8088"
//Vue.prototype.host2 = "http://mallapi.oytour.com"
Vue.prototype.request = function(param, success, failed) {
//网络请求
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment