第一次提交
This commit is contained in:
521
Product/pages/list.vue
Normal file
521
Product/pages/list.vue
Normal file
@@ -0,0 +1,521 @@
|
||||
<template>
|
||||
<view class="content" :style="{paddingTop:item?'366rpx':''}">
|
||||
<!-- <view>商品分类</view> -->
|
||||
<view style="position: fixed;top: 0; width: 100%; background-color: #F2F2F2;" class="header">
|
||||
<view v-if="item">
|
||||
<stationItem :item="item">
|
||||
<template #button>
|
||||
<view class="navigation">导航</view>
|
||||
</template>
|
||||
</stationItem>
|
||||
</view>
|
||||
<view class="navbar">
|
||||
<view class="nav-item" :class="{current: filterIndex === 0}" @click="tabClick(0)">
|
||||
综合排序
|
||||
</view>
|
||||
<!-- <view class="nav-item" :class="{current: filterIndex === 1}" @click="tabClick(1)">
|
||||
销量优先
|
||||
</view> -->
|
||||
<view class="nav-item" :class="{current: filterIndex === 2}" @click="tabClick(2)">
|
||||
<text>价格</text>
|
||||
<view class="p-box">
|
||||
<view :class="{selectTriangle: page.sorted.price === 'desc' && filterIndex === 2}"
|
||||
class="triangle">
|
||||
</view>
|
||||
<view :class="{selectTriangle2: page.sorted.price === 'asc' && filterIndex === 2}"
|
||||
class="triangle2">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nav-item" :class="{current: filterIndex === 3}" @click="tabClick(3)">
|
||||
新品
|
||||
</view>
|
||||
<view v-if="apiName!=='more'" class="cate-item" @click="toggleCateMask('show')">
|
||||
<uni-icons type="bars" size="20"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-list">
|
||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
|
||||
<view class="image-wrapper">
|
||||
<image :src="item.url" mode="aspectFill"></image>
|
||||
</view>
|
||||
<text class="title clamp">{{item.productName}}</text>
|
||||
<view class="price-box">
|
||||
<text class="price">{{item.price}}</text>
|
||||
<text>库存 {{item.stock}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more :status="loadingType"></uni-load-more>
|
||||
<view class="cate-mask" :class="cateMaskState===0 ? 'none' : cateMaskState===1 ? 'show' : ''"
|
||||
@click="toggleCateMask">
|
||||
<view class="cate-content" @click.stop.prevent="stopPrevent" @touchmove.stop.prevent="stopPrevent">
|
||||
<scroll-view scroll-y class="cate-list">
|
||||
<view v-for="(item,index) in cateList" :key="item.id">
|
||||
<view :class="{active: item.id==page.params.categoryOneId}" class="cate-item b-b two">
|
||||
{{item.categoryName}}
|
||||
</view>
|
||||
<view v-for="tItem in item.classificationTwoList" :key="tItem.id"
|
||||
:class="{active: tItem.id==page.params.categoryTwoId}" class="cate-item b-b"
|
||||
@click="changeCate(item,tItem)">
|
||||
{{tItem.categoryName}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import stationItem from '@/components/stationItem/stationItem.vue'
|
||||
import productApi from '@/api/product.js'
|
||||
export default {
|
||||
components: {
|
||||
stationItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
apiName: 'classificationByPage',
|
||||
model: "classify",
|
||||
page: {
|
||||
"pageSize": 10,
|
||||
"currentPage": 1,
|
||||
"params": {
|
||||
"type": "",
|
||||
"categoryOneId": "", // 一级分类id
|
||||
"categoryTwoId": "", // 二级分类id
|
||||
},
|
||||
"sorted": {
|
||||
"price": "", // 降序 从大往小 desc asc
|
||||
"new_mark": "" // 新品 asc写死
|
||||
},
|
||||
"columns": []
|
||||
},
|
||||
item: null,
|
||||
cateMaskState: 0, //分类面板展开状态
|
||||
headerPosition: "fixed",
|
||||
headerTop: "",
|
||||
loadingType: 'more', //加载更多状态
|
||||
filterIndex: 0,
|
||||
cateId: 0, //已选三级分类id
|
||||
priceOrder: 0, //1 价格从低到高 2价格从高到低
|
||||
cateList: [],
|
||||
goodsList: []
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
if (options.item) {
|
||||
this.item = JSON.parse(decodeURIComponent(options.item));
|
||||
this.page.params['siteId'] = this.item.siteId;
|
||||
this.apiName = 'nearbySiteInfo'
|
||||
}
|
||||
if (options.categoryOneId) {
|
||||
this.page.params.categoryOneId = options.categoryOneId;
|
||||
}
|
||||
if (options.type) {
|
||||
this.page.params.type = options.type;
|
||||
this.apiName = 'more';
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.page.params.type == '1' ? '新鲜好物' : this.page.params.type == '2' ? '人气推荐' : this
|
||||
.page.params.type == '3' ? '猜你喜欢' : "分类商品",
|
||||
})
|
||||
}
|
||||
this.loadCateList(options.fid, options.sid);
|
||||
this.loadData();
|
||||
},
|
||||
onPageScroll(e) {
|
||||
//兼容iOS端下拉时顶部漂移
|
||||
if (e.scrollTop >= 0) {
|
||||
this.headerPosition = "fixed";
|
||||
} else {
|
||||
this.headerPosition = "absolute";
|
||||
}
|
||||
},
|
||||
//下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.page.currentPage = 1;
|
||||
this.loadData('refresh');
|
||||
this.loadCateList();
|
||||
},
|
||||
//加载更多
|
||||
onReachBottom() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
getDom(className = '.header') {
|
||||
// select中的参数就如css选择器一样选择元素
|
||||
let info = uni.createSelectorQuery().in(this).select(className);
|
||||
info.boundingClientRect(function(data) {
|
||||
this.headerTop = `${data.height}px`
|
||||
console.log(this.headerTop, 'headerTop')
|
||||
}).exec(function(res) {
|
||||
// 注意:exec方法必须执行,即便什么也不做,否则不会获取到任何数据
|
||||
})
|
||||
},
|
||||
getClassification() {
|
||||
|
||||
},
|
||||
//加载分类
|
||||
async loadCateList(fid, sid) {
|
||||
let list = [];
|
||||
await productApi.classification().then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.cateList = res.data.filter(item => item.classificationTwoList.length)
|
||||
}
|
||||
});
|
||||
},
|
||||
//加载商品 ,带下拉刷新和上滑加载
|
||||
async loadData(type = 'add', loading) {
|
||||
//没有更多直接返回
|
||||
if (type === 'add') {
|
||||
if (this.loadingType === 'nomore') {
|
||||
return;
|
||||
};
|
||||
this.goodsList.length && (this.page.currentPage += 1);
|
||||
this.loadingType = 'loading';
|
||||
} else {
|
||||
this.page.currentPage = 1;
|
||||
this.loadingType = 'more'
|
||||
}
|
||||
let goodsList = [];
|
||||
|
||||
await productApi[this.apiName](this.page).then(res => {
|
||||
goodsList = res.data.list
|
||||
})
|
||||
if (type === 'refresh') {
|
||||
this.goodsList = [];
|
||||
}
|
||||
this.goodsList = this.goodsList.concat(goodsList);
|
||||
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了)
|
||||
this.loadingType = goodsList.length < this.page.pageSize ? 'nomore' : 'more';
|
||||
if (type === 'refresh') {
|
||||
if (loading == 1) {
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
},
|
||||
//筛选点击
|
||||
tabClick(index) {
|
||||
if (this.filterIndex === index && index !== 2) {
|
||||
return;
|
||||
}
|
||||
this.filterIndex = index;
|
||||
if (index === 2) {
|
||||
this.page.sorted.price = this.page.sorted.price === 'desc' ? 'asc' : 'desc';
|
||||
} else {
|
||||
this.page.sorted.price = ''
|
||||
}
|
||||
if (index == 3) {
|
||||
this.page.sorted.new_mark = 'asc'
|
||||
} else {
|
||||
this.page.sorted.new_mark = ''
|
||||
}
|
||||
uni.pageScrollTo({
|
||||
duration: 300,
|
||||
scrollTop: 0
|
||||
});
|
||||
this.loadData('refresh', 1);
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
},
|
||||
//显示分类面板
|
||||
toggleCateMask(type) {
|
||||
let timer = type === 'show' ? 10 : 300;
|
||||
let state = type === 'show' ? 1 : 0;
|
||||
this.cateMaskState = 2;
|
||||
setTimeout(() => {
|
||||
this.cateMaskState = state;
|
||||
}, timer)
|
||||
},
|
||||
//分类点击
|
||||
changeCate(parentItem = {}, item = {}) {
|
||||
let {
|
||||
id: categoryOneId = ''
|
||||
} = parentItem;
|
||||
let {
|
||||
id: categoryTwoId = ''
|
||||
} = item;
|
||||
Object.assign(this.page.params, {
|
||||
categoryOneId,
|
||||
categoryTwoId
|
||||
});
|
||||
// this.cateId = item.id;
|
||||
this.toggleCateMask();
|
||||
uni.pageScrollTo({
|
||||
duration: 300,
|
||||
scrollTop: 0
|
||||
})
|
||||
this.loadData('refresh', 1);
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
},
|
||||
//详情
|
||||
navToDetailPage(item) {
|
||||
//测试数据没有写id,用title代替
|
||||
let id = item.id;
|
||||
uni.navigateTo({
|
||||
url: `/Product/pages/product?id=${id}`
|
||||
})
|
||||
},
|
||||
stopPrevent() {}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.navigation {
|
||||
|
||||
font-size: 28rpx;
|
||||
color: #F83D3D;
|
||||
padding: 5rpx 20rpx;
|
||||
border: solid 1rpx #F83D3D;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.site-list-item {
|
||||
margin: 20rpx auto !important;
|
||||
}
|
||||
|
||||
.selectTriangle {
|
||||
border-bottom: 4px solid $base-color !important;
|
||||
}
|
||||
|
||||
.selectTriangle2 {
|
||||
border-top: 4px solid $base-color !important;
|
||||
}
|
||||
|
||||
.triangle {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-bottom: 4px solid #bbbbbb;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.triangle2 {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-top: 4px solid #bbbbbb;
|
||||
}
|
||||
|
||||
page,
|
||||
.content {
|
||||
background: $page-color-base;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-top: 96upx;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
// position: fixed;
|
||||
left: 0;
|
||||
// top: var(--window-top);
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 80upx;
|
||||
background: #fff;
|
||||
box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
|
||||
z-index: 10;
|
||||
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
font-size: 30upx;
|
||||
color: $font-color-dark;
|
||||
position: relative;
|
||||
|
||||
&.current {
|
||||
color: $base-color;
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
transform: translateX(-50%);
|
||||
width: 120upx;
|
||||
height: 0;
|
||||
border-bottom: 4upx solid $base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-box {
|
||||
margin-left: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.yticon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30upx;
|
||||
height: 14upx;
|
||||
line-height: 1;
|
||||
margin-left: 4upx;
|
||||
font-size: 26upx;
|
||||
color: #888;
|
||||
|
||||
&.active {
|
||||
color: $base-color;
|
||||
}
|
||||
}
|
||||
|
||||
.xia {
|
||||
transform: scaleY(-1);
|
||||
}
|
||||
}
|
||||
|
||||
.cate-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 80upx;
|
||||
position: relative;
|
||||
font-size: 44upx;
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border-left: 1px solid #ddd;
|
||||
width: 0;
|
||||
height: 36upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 分类 */
|
||||
.cate-mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: var(--window-top);
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: rgba(0, 0, 0, 0);
|
||||
z-index: 95;
|
||||
transition: .3s;
|
||||
|
||||
.cate-content {
|
||||
width: 630upx;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
float: right;
|
||||
transform: translateX(100%);
|
||||
transition: .3s;
|
||||
}
|
||||
|
||||
&.none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.show {
|
||||
background: rgba(0, 0, 0, .4);
|
||||
|
||||
.cate-content {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cate-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
.cate-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 90upx;
|
||||
padding-left: 30upx;
|
||||
font-size: 28upx;
|
||||
color: #555;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.two {
|
||||
height: 64upx;
|
||||
color: #303133;
|
||||
font-size: 30upx;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: $base-color;
|
||||
}
|
||||
}
|
||||
|
||||
/* 商品列表 */
|
||||
.goods-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0 30upx;
|
||||
background: #fff;
|
||||
|
||||
.goods-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 48%;
|
||||
padding-bottom: 40upx;
|
||||
|
||||
&:nth-child(2n+1) {
|
||||
margin-right: 4%;
|
||||
}
|
||||
}
|
||||
|
||||
.image-wrapper {
|
||||
width: 100%;
|
||||
height: 330upx;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: $font-lg;
|
||||
color: $font-color-dark;
|
||||
line-height: 80upx;
|
||||
}
|
||||
|
||||
.price-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-right: 10upx;
|
||||
font-size: 24upx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: $font-lg;
|
||||
color: $base-color;
|
||||
line-height: 1;
|
||||
|
||||
&:before {
|
||||
content: '¥';
|
||||
font-size: 26upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
73
Product/pages/paySuccess.vue
Normal file
73
Product/pages/paySuccess.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view
|
||||
style="width: 122rpx; height: 122rpx; background-color: #09BB07; border-radius: 80rpx;overflow: hidden; margin-bottom: 25rpx;"
|
||||
class="flex ac jc">
|
||||
<uni-icons type="checkmarkempty" color="#ffffff" size="30"></uni-icons>
|
||||
</view>
|
||||
<text style=" font-weight: 700; font-size: 36rpx;" class="tit">支付成功</text>
|
||||
<text style="margin-top: 50rpx; color: #666666; font-size: 26rpx;">自提订单请尽快到自提油站提货,感谢您的使用!</text>
|
||||
<view class="btn-group">
|
||||
<navigator url="/Order/pages/index/index" open-type="redirect" class="mix-btn">查看订单</navigator>
|
||||
<navigator url="/pages/home/index" open-type="switchTab" class="mix-btn hollow">返回首页</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.success-icon {
|
||||
font-size: 160upx;
|
||||
color: #fa436a;
|
||||
margin-top: 100upx;
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-size: 38upx;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
padding-top: 100upx;
|
||||
}
|
||||
|
||||
.mix-btn {
|
||||
margin-top: 30upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 600upx;
|
||||
height: 80upx;
|
||||
font-size: $font-lg;
|
||||
color: #fff;
|
||||
background-color: $base-color;
|
||||
border-radius: 50rpx;
|
||||
|
||||
&.hollow {
|
||||
background: #fff;
|
||||
color: #303133;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
698
Product/pages/placeOrder.vue
Normal file
698
Product/pages/placeOrder.vue
Normal file
@@ -0,0 +1,698 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-for="(item,index) in payData.purchaseInfoList" :key="item" class="goods-section">
|
||||
<view class="g-header b-b ">
|
||||
<!-- <radio color='#F83D3D' style="transform:scale(0.7)" :checked="false"></radio> -->
|
||||
<view style=" font-size: 32rpx; font-weight: 600;margin-bottom: 5rpx ; margin-top: 10rpx;">{{item.siteName}}</view>
|
||||
<view class="name textov">{{item.siteAddress}}</view>
|
||||
<view style="margin-top: 18rpx;" class="name">距离:{{ Number(item.juli / 1000).toFixed(2) }}KM</view>
|
||||
<view class="order-details">
|
||||
<view class="order-details-item flex">
|
||||
<text class="oneflex">自提时间:</text>
|
||||
<uni-datetime-picker v-model="single">
|
||||
<view style="width: 100%;text-align: right;">
|
||||
{{single?single:'请选择自提时间'}}
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
<view style="margin: 10rpx 0;" class="order-details-item flex">
|
||||
<text class="oneflex">商品合计:</text>
|
||||
<text>¥{{Number(item.productPrice).toFixed(2)}}</text>
|
||||
</view>
|
||||
<view class="order-details-item flex">
|
||||
<text class="oneflex">支付积分:</text>
|
||||
<text>{{Number(item.integral).toFixed(2)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin: 0 30rpx; padding: 20rpx 0; border-bottom: solid 1rpx #D7D7D7;">商品列表:</view>
|
||||
<!-- 商品列表 -->
|
||||
<view v-for="product in item.purchaseDetailList" :key="product.id" class="g-item flex ac">
|
||||
<!-- <radio color='#F83D3D' style="transform:scale(0.7)" :checked="false"></radio> -->
|
||||
<image mode="aspectFit" :src="product.url">
|
||||
</image>
|
||||
<view class="right">
|
||||
<view class="title textov">{{product.productName}}</view>
|
||||
<view class="spec"> 规格:{{product.attributeJson|specifications}} </view>
|
||||
<view class="price-box">
|
||||
<text class="price">¥{{Number(product.sellPrice).toFixed(2)}}</text>
|
||||
<text class="number">x {{product.number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <uni-swipe-action>
|
||||
<uni-swipe-action-item :right-options="actionOptions" :threshold="0">
|
||||
<view class="g-item flex ac">
|
||||
<radio color='#F83D3D' style="transform:scale(0.7)" :checked="false"></radio>
|
||||
<image
|
||||
src="https://img13.360buyimg.com/n1/s450x450_jfs/t1/245491/8/2547/95290/65acb1d5F39cddbdf/3586a70a96d5468d.jpg.avif">
|
||||
</image>
|
||||
<view class="right">
|
||||
<view class="title textov">古黛妃 短袖t恤女夏装2019新款 古黛妃 短袖t恤女夏装2019新款古黛妃 短袖t恤女夏装2019新款</view>
|
||||
<view class="spec">春装款 L</view>
|
||||
<view class="price-box">
|
||||
<text class="price">¥17.8</text>
|
||||
<text class="number">x 1</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action> -->
|
||||
</view>
|
||||
|
||||
<!-- 金额明细 -->
|
||||
<!-- <view class="yt-list">
|
||||
<view class="yt-list-cell b-b">
|
||||
<text class="cell-tit clamp">商品金额</text>
|
||||
<text class="cell-tip">¥179.88</text>
|
||||
</view>
|
||||
<view class="yt-list-cell b-b">
|
||||
<text class="cell-tit clamp">优惠金额</text>
|
||||
<text class="cell-tip red">-¥35</text>
|
||||
</view>
|
||||
<view class="yt-list-cell b-b">
|
||||
<text class="cell-tit clamp">运费</text>
|
||||
<text class="cell-tip">免运费</text>
|
||||
</view>
|
||||
<view class="yt-list-cell desc-cell">
|
||||
<text class="cell-tit clamp">备注</text>
|
||||
<input class="desc" type="text" v-model="desc" placeholder="请填写备注信息" placeholder-class="placeholder" />
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 底部 -->
|
||||
<view class="footer">
|
||||
<view class="price-content">
|
||||
<text>实付积分</text>
|
||||
<text class="price-tip">¥</text>
|
||||
<text class="price">{{Number(payData.payBalance).toFixed(2)}}</text>
|
||||
</view>
|
||||
<text class="submit" @click="submit">提交订单</text>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券面板 -->
|
||||
<view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
|
||||
<view class="mask-content" @click.stop.prevent="stopPrevent">
|
||||
<!-- 优惠券页面,仿mt -->
|
||||
<view class="coupon-item" v-for="(item,index) in couponList" :key="index">
|
||||
<view class="con">
|
||||
<view class="left">
|
||||
<text class="title">{{item.title}}</text>
|
||||
<text class="time">有效期至2019-06-30</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="price">{{item.price}}</text>
|
||||
<text>满30可用</text>
|
||||
</view>
|
||||
|
||||
<view class="circle l"></view>
|
||||
<view class="circle r"></view>
|
||||
</view>
|
||||
<text class="tips">限新用户使用</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import productApi from '@/api/product.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
single:"",
|
||||
pageType:0,
|
||||
user: uni.getStorageSync('user'),
|
||||
payData:{
|
||||
purchaseInfoList:[]
|
||||
},
|
||||
actionOptions: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#F83D3D'
|
||||
}
|
||||
}],
|
||||
maskState: 0, //优惠券面板显示状态
|
||||
desc: '', //备注
|
||||
payType: 1, //1微信 2支付宝
|
||||
couponList: [{
|
||||
title: '新用户专享优惠券',
|
||||
price: 5,
|
||||
},
|
||||
{
|
||||
title: '庆五一发一波优惠券',
|
||||
price: 10,
|
||||
},
|
||||
{
|
||||
title: '优惠券优惠券优惠券优惠券',
|
||||
price: 15,
|
||||
}
|
||||
],
|
||||
addressData: {
|
||||
name: '许小星',
|
||||
mobile: '13853989563',
|
||||
addressName: '金九大道',
|
||||
address: '山东省济南市历城区',
|
||||
area: '149号',
|
||||
default: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option?.pageType){
|
||||
this.pageType = option.pageType;
|
||||
console.log(this.pageType)
|
||||
}
|
||||
if (option.data) {
|
||||
//商品数据
|
||||
let data = JSON.parse(decodeURIComponent(option.data));
|
||||
this.getOrder(data)
|
||||
}
|
||||
|
||||
},
|
||||
filters:{
|
||||
specifications(e){
|
||||
let data = JSON.parse(e);
|
||||
let strArr = Object.values(data);
|
||||
console.log(strArr);
|
||||
return strArr.length? strArr.join(' ') : '暂无规格'
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
single(n){
|
||||
console.log(n,"6666666666666666")
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getOrder(data){
|
||||
productApi[this.pageType? 'selectProductInfo':'immediately'](data).then(res=>{
|
||||
if(res.code==20000){
|
||||
this.payData = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
//显示优惠券面板
|
||||
toggleMask(type) {
|
||||
let timer = type === 'show' ? 10 : 300;
|
||||
let state = type === 'show' ? 1 : 0;
|
||||
this.maskState = 2;
|
||||
setTimeout(() => {
|
||||
this.maskState = state;
|
||||
}, timer)
|
||||
},
|
||||
numberChange(data) {
|
||||
this.number = data.number;
|
||||
},
|
||||
changePayType(type) {
|
||||
this.payType = type;
|
||||
},
|
||||
submit() {
|
||||
if(!this.single){
|
||||
uni.showToast({
|
||||
title:'请选择自提时间',
|
||||
icon:"none"
|
||||
});
|
||||
return
|
||||
}
|
||||
let { id:customerId ,userPhone:customerPhone,name:customerName} = this.user;
|
||||
let {id:acctId} = this.user.oilCustomerIntegralAccount;
|
||||
let formData = {
|
||||
planTakeTime:this.single,
|
||||
customerId,
|
||||
acctId,
|
||||
integral:this.payData.payBalance,
|
||||
"createSource":"MALL_COMS_MINI" //用户端【必填】 MALL_COMS_MINI 小程序 ,MALL_COMS_WEB WEB 端
|
||||
};
|
||||
let productData = this.payData.purchaseInfoList.map(item=>{
|
||||
let { siteId:takeSiteId,siteName:takeSiteName,siteAddress:takeSiteAddress} = item;
|
||||
return {
|
||||
...formData,
|
||||
takeSiteId,
|
||||
takeSiteName,
|
||||
takeSiteAddress,
|
||||
mallOrderInfoDetails:item.purchaseDetailList.map(item=> {
|
||||
return { ...item,orderNum:item.number,oderDetailImg:item.url,shoppingId:item.id}
|
||||
})
|
||||
}
|
||||
});
|
||||
console.log(productData,"mallOrderInfoDetailsmallOrderInfoDetailsmallOrderInfoDetails")
|
||||
productApi[this.pageType? 'saveMore': 'save'](this.pageType?productData:productData[0]).then(res=>{
|
||||
if(res.code==20000){
|
||||
uni.redirectTo({
|
||||
url:'/Product/pages/paySuccess'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
stopPrevent() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.order-details {
|
||||
margin-top: 30rpx;
|
||||
color: #000000;
|
||||
font-size: 28rpx;
|
||||
|
||||
.order-details-item {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
page {
|
||||
background: $page-color-base;
|
||||
padding-bottom: 100upx;
|
||||
}
|
||||
|
||||
.address-section {
|
||||
padding: 30upx 0;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
|
||||
.order-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-shouhuodizhi {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 90upx;
|
||||
color: #888;
|
||||
font-size: 44upx;
|
||||
}
|
||||
|
||||
.cen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
font-size: 28upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 34upx;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.address {
|
||||
margin-top: 16upx;
|
||||
margin-right: 20upx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.icon-you {
|
||||
font-size: 32upx;
|
||||
color: $font-color-light;
|
||||
margin-right: 30upx;
|
||||
}
|
||||
|
||||
.a-bg {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 5upx;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-section {
|
||||
margin-top: 16upx;
|
||||
background: #fff;
|
||||
padding-bottom: 1px;
|
||||
|
||||
.g-header {
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// height: 84upx;
|
||||
padding: 10upx 30upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
width: 50upx;
|
||||
height: 50upx;
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 30upx;
|
||||
color: $font-color-base;
|
||||
}
|
||||
|
||||
.g-item {
|
||||
display: flex;
|
||||
margin: 20upx 30upx;
|
||||
|
||||
image {
|
||||
flex-shrink: 0;
|
||||
display: block;
|
||||
width: 140upx;
|
||||
height: 140upx;
|
||||
border-radius: 4upx;
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
padding-left: 24upx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 30upx;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
|
||||
.spec {
|
||||
font-size: 26upx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.price-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 32upx;
|
||||
color: $font-color-dark;
|
||||
padding-top: 10upx;
|
||||
|
||||
.price {
|
||||
margin-bottom: 4upx;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 26upx;
|
||||
color: $font-color-base;
|
||||
margin-left: 20upx;
|
||||
}
|
||||
}
|
||||
|
||||
.step-box {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.yt-list {
|
||||
margin-top: 16upx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.yt-list-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10upx 30upx 10upx 40upx;
|
||||
line-height: 70upx;
|
||||
position: relative;
|
||||
|
||||
&.cell-hover {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
&.b-b:after {
|
||||
left: 30upx;
|
||||
}
|
||||
|
||||
.cell-icon {
|
||||
height: 32upx;
|
||||
width: 32upx;
|
||||
font-size: 22upx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 32upx;
|
||||
background: #f85e52;
|
||||
border-radius: 4upx;
|
||||
margin-right: 12upx;
|
||||
|
||||
&.hb {
|
||||
background: #ffaa0e;
|
||||
}
|
||||
|
||||
&.lpk {
|
||||
background: #3ab54a;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
align-self: center;
|
||||
font-size: 24upx;
|
||||
color: $font-color-light;
|
||||
margin-left: 8upx;
|
||||
margin-right: -10upx;
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
flex: 1;
|
||||
font-size: 26upx;
|
||||
color: $font-color-light;
|
||||
margin-right: 10upx;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
font-size: 26upx;
|
||||
color: $font-color-dark;
|
||||
|
||||
&.disabled {
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: $base-color;
|
||||
}
|
||||
|
||||
&.red {
|
||||
color: $base-color;
|
||||
}
|
||||
}
|
||||
|
||||
&.desc-cell {
|
||||
.cell-tit {
|
||||
max-width: 90upx;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
flex: 1;
|
||||
font-size: $font-base;
|
||||
color: $font-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
/* 支付列表 */
|
||||
.pay-list {
|
||||
padding-left: 40upx;
|
||||
margin-top: 16upx;
|
||||
background: #fff;
|
||||
|
||||
.pay-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-right: 20upx;
|
||||
line-height: 1;
|
||||
height: 110upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-weixinzhifu {
|
||||
width: 80upx;
|
||||
font-size: 40upx;
|
||||
color: #6BCC03;
|
||||
}
|
||||
|
||||
.icon-alipay {
|
||||
width: 80upx;
|
||||
font-size: 40upx;
|
||||
color: #06B4FD;
|
||||
}
|
||||
|
||||
.icon-xuanzhong2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 60upx;
|
||||
height: 60upx;
|
||||
font-size: 40upx;
|
||||
color: $base-color;
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-size: 32upx;
|
||||
color: $font-color-dark;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
// z-index: 995;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 90upx;
|
||||
justify-content: space-between;
|
||||
font-size: 30upx;
|
||||
background-color: #fff;
|
||||
// z-index: 99;
|
||||
color: $font-color-base;
|
||||
box-shadow: 0 -1px 5px rgba(0, 0, 0, .1);
|
||||
|
||||
.price-content {
|
||||
padding-left: 30upx;
|
||||
}
|
||||
|
||||
.price-tip {
|
||||
color: $base-color;
|
||||
margin-left: 8upx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 36upx;
|
||||
color: $base-color;
|
||||
}
|
||||
|
||||
.submit {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 280upx;
|
||||
height: 100%;
|
||||
color: #fff;
|
||||
font-size: 32upx;
|
||||
background-color: $base-color;
|
||||
}
|
||||
}
|
||||
|
||||
/* 优惠券面板 */
|
||||
.mask {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: var(--window-top);
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: rgba(0, 0, 0, 0);
|
||||
z-index: 9995;
|
||||
transition: .3s;
|
||||
|
||||
.mask-content {
|
||||
width: 100%;
|
||||
min-height: 30vh;
|
||||
max-height: 70vh;
|
||||
background: #f3f3f3;
|
||||
transform: translateY(100%);
|
||||
transition: .3s;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
&.none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.show {
|
||||
background: rgba(0, 0, 0, .4);
|
||||
|
||||
.mask-content {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 优惠券列表 */
|
||||
.coupon-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 20upx 24upx;
|
||||
background: #fff;
|
||||
|
||||
.con {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 120upx;
|
||||
padding: 0 30upx;
|
||||
|
||||
&:after {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 0;
|
||||
border-bottom: 1px dashed #f3f3f3;
|
||||
transform: scaleY(50%);
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
height: 100upx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32upx;
|
||||
color: $font-color-dark;
|
||||
margin-bottom: 10upx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 24upx;
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 26upx;
|
||||
color: $font-color-base;
|
||||
height: 100upx;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 44upx;
|
||||
color: $base-color;
|
||||
|
||||
&:before {
|
||||
content: '¥';
|
||||
font-size: 34upx;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 24upx;
|
||||
color: $font-color-light;
|
||||
line-height: 60upx;
|
||||
padding-left: 30upx;
|
||||
}
|
||||
|
||||
.circle {
|
||||
position: absolute;
|
||||
left: -6upx;
|
||||
bottom: -10upx;
|
||||
z-index: 10;
|
||||
width: 20upx;
|
||||
height: 20upx;
|
||||
background: #f3f3f3;
|
||||
border-radius: 100px;
|
||||
|
||||
&.r {
|
||||
left: auto;
|
||||
right: -6upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1220
Product/pages/product.vue
Normal file
1220
Product/pages/product.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user