|
@@ -1,23 +1,31 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<!-- #ifdef MP-ALIPAY -->
|
|
|
- <u-navbar :title="storeName" :border="true" bgColor="#fff" leftIconSize="0" />
|
|
|
+ <!-- <u-navbar :title="siteName" :border="true" :placeholder="true" bgColor="#fff" leftIconSize="0" /> -->
|
|
|
+ <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :title="siteName">
|
|
|
+ <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
+ <u-icon name="home" size="20" color="#333"></u-icon>
|
|
|
+ <view class="nav-left__code">首页</view>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifndef MP-ALIPAY -->
|
|
|
- <u-navbar :title="storeName" :border="true" leftIconSize="0" bgColor="#fff" />
|
|
|
+ <!-- <u-navbar :title="siteName" :border="true" :placeholder="true" leftIconSize="0" bgColor="#fff" /> -->
|
|
|
+ <u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :title="siteName">
|
|
|
+ <view class="nav-left flex" slot="left" @click="$toIndex()">
|
|
|
+ <u-icon name="home" size="20" color="#333"></u-icon>
|
|
|
+ <view class="nav-left__code">首页</view>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
<!-- #endif -->
|
|
|
|
|
|
<view class="list">
|
|
|
<view class="list-item" v-for="(item, index) in list" :key="index">
|
|
|
- <image :src="item.picUrl" mode="aspectFit"></image>
|
|
|
- <view class="list-item-content flex">
|
|
|
- <view class="top">
|
|
|
- <view class="top-title">{{ item.title }}</view>
|
|
|
- <view class="top-num">序列号:{{ item.serialNo }}</view>
|
|
|
- <view class="top-price" v-if="item.status != '2'">面值:¥{{ $numberFormat(item.facePrice) }}</view>
|
|
|
- </view>
|
|
|
+ <image :src="item.picUrl" mode="aspectFit" @click="toTicketBox(item)"></image>
|
|
|
+ <view class="list-item-content flex" @click="toTicketBox(item)">
|
|
|
+ <view class="top">{{ item.title }}</view>
|
|
|
<view class="bottom flex">
|
|
|
- <view class="bottom-price">面值:<text>¥{{ $numberFormat(item.facePrice) }}</text></view>
|
|
|
+ <view class="bottom-price">价格:<view style="font-size: 12px; display: inline-block;">¥</view>{{ $numberFormat(item.salePrice) }}<view class="view1">划线价:<text style="font-size: 10px; display: inline-block;">¥</text>{{ $numberFormat(item.originPrice) }}</view></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -33,50 +41,85 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import env from '../../config/env.js'
|
|
|
import $http from '@/utils/request.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- storeName: '哈哈',
|
|
|
- channelId: '',
|
|
|
status: 'nomore',//上拉刷新状态
|
|
|
pageNum: 1,
|
|
|
total: 0,
|
|
|
list: [],
|
|
|
pagesNum: '',
|
|
|
+
|
|
|
+ sceneArr: [],
|
|
|
+ channelId: '',
|
|
|
+ userId: '',
|
|
|
+ siteName: '门店',
|
|
|
}
|
|
|
},
|
|
|
|
|
|
onLoad(options) {
|
|
|
- // 当前页面参数
|
|
|
- this.channelId = options.channelId
|
|
|
+ // 测试用
|
|
|
+ if(options.channelId){
|
|
|
+ this.channelId = options.channelId
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 票赢天下小程序分享门店二维码跳转接收的参数
|
|
|
+ * channelId: 门店ID
|
|
|
+ * userId: 分享类型
|
|
|
+ * siteName: 门店名称
|
|
|
+ * */
|
|
|
+ if (options.scene) {
|
|
|
+ let sceneStr = decodeURIComponent(options.scene)
|
|
|
+ this.sceneArr = sceneStr.split('&')
|
|
|
+ this.channelId = this.sceneArr[0]
|
|
|
+ this.userId = this.sceneArr[1]
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
// 获取页面数据
|
|
|
this.pageList()
|
|
|
+ this.getSiteName()
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取门店名称
|
|
|
+ getSiteName() {
|
|
|
+ $http.post(`/api/v1/mp/channel/saleSite/info/${this.channelId}`,{}).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.siteName = res.data ? res.data : ('门店' + this.channelId)
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 获取页面数据
|
|
|
+ pageList() {
|
|
|
+ this.pageNum = 1
|
|
|
+ this.list = []
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
getList() {
|
|
|
$http.post(`/api/v1/mp/user/ticket/list/underChannel?pageNum=${this.pageNum}&pageSize=20`,{
|
|
|
channelId: this.channelId
|
|
|
}).then(res => {
|
|
|
- console.log('res',res);
|
|
|
- return
|
|
|
if (res.code == 0) {
|
|
|
res.rows.forEach(item => {
|
|
|
item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/170'
|
|
|
- })
|
|
|
+ })
|
|
|
this.total = res.total
|
|
|
this.list = this.list.concat(res.rows)
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
},
|
|
|
- pageList() {
|
|
|
- this.pageNum = 1
|
|
|
- this.list = []
|
|
|
- this.getList()
|
|
|
+
|
|
|
+ // 点击盲票,跳转盲票详情
|
|
|
+ toTicketBox(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/ticketBox/detail?boxId=${ item.boxId }&share=1&siteId=${ this.channelId }`
|
|
|
+ })
|
|
|
},
|
|
|
},
|
|
|
onReachBottom() {
|
|
@@ -90,6 +133,11 @@
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+ .nav-left {
|
|
|
+ &__code {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
// 状态
|
|
|
.state {
|
|
|
display: flex;
|
|
@@ -101,52 +149,43 @@
|
|
|
}
|
|
|
// 列表
|
|
|
.list {
|
|
|
- padding: 120rpx 0 100rpx;
|
|
|
+ padding: 20rpx 0 100rpx;
|
|
|
margin: 0 20rpx 0;
|
|
|
|
|
|
&-item {
|
|
|
display: flex;
|
|
|
background: #FFFFFF;
|
|
|
- border-radius: 11px;
|
|
|
- padding: 34rpx 10rpx;
|
|
|
- margin-bottom: 34rpx;
|
|
|
+ padding: 30rpx 20rpx;
|
|
|
+ border-radius: 1px;
|
|
|
+ box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.12);
|
|
|
+ margin-bottom: 28rpx;
|
|
|
|
|
|
image {
|
|
|
- width: 200rpx;
|
|
|
- height: 270rpx;
|
|
|
+ width: 140rpx;
|
|
|
+ height: 189rpx;
|
|
|
border-radius: 22rpx;
|
|
|
- margin-right: 15rpx;
|
|
|
+ margin-right: 60rpx;
|
|
|
}
|
|
|
|
|
|
&-content {
|
|
|
- flex: 1;
|
|
|
+ width: 70%;
|
|
|
+ // flex: 1;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-between;
|
|
|
- padding: 16rpx 0;
|
|
|
+ padding: 26rpx 0;
|
|
|
|
|
|
|
|
|
.top {
|
|
|
width: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
-
|
|
|
- &-title {
|
|
|
- font-size: 36rpx;
|
|
|
- line-height: 36rpx;
|
|
|
- font-weight: bold;
|
|
|
- margin-bottom: 46rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &-num {
|
|
|
- font-size: 26rpx;
|
|
|
- line-height: 26rpx;
|
|
|
- }
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 30rpx;
|
|
|
+ line-height: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 46rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
|
|
|
- &-price {
|
|
|
- margin-top: 30rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- line-height: 26rpx;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.bottom {
|
|
@@ -154,45 +193,21 @@
|
|
|
justify-content: space-between;
|
|
|
|
|
|
&-price {
|
|
|
- height: 26rpx;
|
|
|
+ height: 30rpx;
|
|
|
overflow: hidden;
|
|
|
- font-size: 26rpx;
|
|
|
- line-height: 26rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ line-height: 30rpx;
|
|
|
|
|
|
- text {
|
|
|
- color: #F9822C ;
|
|
|
- }
|
|
|
- }
|
|
|
- &-pricetwo {
|
|
|
- view {
|
|
|
+ .view1 {
|
|
|
+ color: #999;
|
|
|
display: inline-block;
|
|
|
- height: 26rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- line-height: 26rpx;
|
|
|
- vertical-align: top;
|
|
|
+ text-decoration: line-through;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ text {
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
}
|
|
|
- text {
|
|
|
- display: inline-block;
|
|
|
- color: #F9822C ;
|
|
|
- width: 350rpx;
|
|
|
- height: 26rpx;
|
|
|
- font-size: 26rpx;
|
|
|
- line-height: 26rpx;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-btn {
|
|
|
- width: 220rpx;
|
|
|
- height: 72rpx;
|
|
|
- line-height: 72rpx;
|
|
|
- text-align: center;
|
|
|
- background: #F9822C;
|
|
|
- border-radius: 36rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- font-size: 30rpx;
|
|
|
}
|
|
|
}
|
|
|
}
|