1.修改首页中石化码券跳转

master
杨杰 3 years ago
parent 980f062981
commit 87ea64fcad
  1. 709
      high-unionPay/pages/goods/goods-list/goods-list.vue
  2. 2
      high-unionPay/subPages/brand-classification/brand-classification.vue

@ -1,350 +1,361 @@
<template> <template>
<view> <view>
<view class="input-box"> <view class="input-box">
<view class="icon search"></view> <view class="icon search"></view>
<input placeholder="搜索卡券" v-model="couponName" placeholder-style="color:#c0c0c0;" @input="toSearch()" /> <input placeholder="搜索卡券" v-model="couponName" placeholder-style="color:#c0c0c0;" @input="toSearch()" />
</view> </view>
<view class="swiper"> <view class="swiper">
<view class="swiper-box"> <view class="swiper-box">
<swiper circular="true" autoplay="true" @change="swiperChange"> <swiper circular="true" autoplay="true" @change="swiperChange">
<swiper-item v-for="swiper in swiperList" :key="swiper.id"> <swiper-item v-for="swiper in swiperList" :key="swiper.id">
<image :src="imageUrl+swiper.imgData" ></image> <image :src="imageUrl+swiper.imgData"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="indicator"> <view class="indicator">
<view class="dots" v-for="(swiper, index) in swiperList" <view class="dots" v-for="(swiper, index) in swiperList"
:class="[currentSwiper >= index ? 'on' : '']" :key="index"></view> :class="[currentSwiper >= index ? 'on' : '']" :key="index"></view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="goodsList == '' " class="mart60 fotct font14 fcor666"> <view v-if="goodsList == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view> </view>
<view class="width90 height110 mart5" v-for="(row, index) in goodsList" :key="index" @click="toGoods(row.id)"> <view class="width90 height110 mart5" v-for="(row, index) in goodsList" :key="index" @click="toGoods(row.id)">
<image class="goodsimg flleft mart5" mode="widthFix" :src="imageUrl+row.couponImg"></image> <image class="goodsimg flleft mart5" mode="widthFix" :src="imageUrl+row.couponImg"></image>
<view class="goodsli "> <view class="goodsli ">
<view class="text2 fcor333 font14 fontwig6">{{row.couponName}}</view> <view class="text2 fcor333 font14 fontwig6">{{row.couponName}}</view>
<view class="goodsxg font12 fotct">限购{{row.limitNumber}}</view> <view class="goodsxg font12 fotct">限购{{row.limitNumber}}</view>
<view class="info mart10"> <view class="info mart10">
<view class="price" v-if="row.payType != 1"> <view class="price" v-if="row.payType != 1">
<image style="width: 15px;height: 15px;vertical-align: sub;" <image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfx.png">
src="../../../static/img/jfx.png"> </image> {{ row.discountPrice*100}}
</image> {{ row.discountPrice*100}} </view>
</view> <view class="price" v-else>
<view class="price" v-else> {{ row.discountPrice}}
{{ row.discountPrice}} </view>
</view> <!-- v-if="product.discountPrice !== product.salesPrice" -->
<!-- v-if="product.discountPrice !== product.salesPrice" --> <view class="slogan" v-if="row.discountPrice !== row.salesPrice">
<view class="slogan" v-if="row.discountPrice !== row.salesPrice"> <!-- <image v-if="row.payType != 1" style="width: 15px;height: 15px;vertical-align: sub;"
<image v-if="row.payType != 1" style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfh.png">
src="../../../static/img/jfh.png"> </image>{{ row.salesPrice*100}} <text v-else></text>{{row.salesPrice}} -->
</image> <text v-else></text>{{ row.salesPrice*100}} <view v-if="row.payType != 1">
</view> <image style="width: 15px;height: 15px;vertical-align: sub;"
</view> src="../../../static/img/jfh.png">
</view> </image>{{ row.salesPrice*100}}
</view> </view>
<view v-else>{{ row.salesPrice}}</view>
</view> </view>
</template> </view>
</view>
<script> </view>
import {
getCouponList, </view>
getCmsContent, </template>
getBrandCouponList
} from '../../../Utils/Api.js'; <script>
let app = getApp(); import {
export default { getCouponList,
data() { getCmsContent,
return { getBrandCouponList
goodsList: [], } from '../../../Utils/Api.js';
imagewxUrl: app.globalData.imageWxImg, let app = getApp();
imgadres:'noorder.png', export default {
imageUrl: app.globalData.imgUrl, data() {
// return {
swiperList: [{ goodsList: [],
id: 1, imagewxUrl: app.globalData.imageWxImg,
src: 'url1', imgadres: 'noorder.png',
img: 'banner2.png' imageUrl: app.globalData.imgUrl,
}, //
{ swiperList: [{
id: 2, id: 1,
src: 'url2', src: 'url1',
img: 'banner3.png' img: 'banner2.png'
} },
], {
currentSwiper: 0, id: 2,
pageNum: 1, src: 'url2',
pageSize: 10, img: 'banner3.png'
isNoMoreData: false, }
typeId: '', ],
couponName: '', currentSwiper: 0,
brandid : '', pageNum: 1,
goodtyid: '' pageSize: 10,
}; isNoMoreData: false,
}, typeId: '',
couponName: '',
onLoad: function(option) { //optionobject brandid: '',
this.typeId = option.id; goodtyid: ''
this.brandid = option.brandId; };
this.goodtyid = option.goodsId; },
if (option.id == 1) {
uni.setNavigationBarTitle({ onLoad: function(option) { //optionobject
title: '商品列表' this.typeId = option.id;
}); this.brandid = option.brandId;
this.getCouponListArea(); this.goodtyid = option.goodsId;
this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST'); if (option.id == 1) {
} uni.setNavigationBarTitle({
if (option.id == 2) { title: '商品列表'
uni.setNavigationBarTitle({ });
title: '积分列表' this.getCouponListArea();
}); this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST');
this.getCouponListArea(); }
this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST'); if (option.id == 2) {
} uni.setNavigationBarTitle({
if (option.id == 3) { title: '积分列表'
uni.setNavigationBarTitle({ });
title: '优选商品' this.getCouponListArea();
}); this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST');
this.getCmsContent('CMS_PRE_LIST'); }
this.getBrandCouponList(); if (option.id == 3) {
} uni.setNavigationBarTitle({
}, title: '中石化码列表'
onPageScroll(e) { });
this.getCouponListArea();
}, this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST');
//page.json"onReachBottomDistance" }
onReachBottom() { if (option.id == 4) {
this.getCouponListArea(); uni.setNavigationBarTitle({
}, title: '优选商品'
methods: { });
// this.getCmsContent('CMS_PRE_LIST');
getCmsContent() { this.getBrandCouponList();
let params = { }
regionId: app.globalData.cityId, },
categoryCode: 'CMS_WX_APPLETS_GOODS_LIST' onPageScroll(e) {
}
getCmsContent(params).then(res => { },
if (res.return_code == '000000') { //page.json"onReachBottomDistance"
this.swiperList = res.return_data; onReachBottom() {
} this.getCouponListArea();
}); },
}, methods: {
// //
swiperChange(event) { getCmsContent() {
this.currentSwiper = event.detail.current; let params = {
}, regionId: app.globalData.cityId,
// categoryCode: 'CMS_WX_APPLETS_GOODS_LIST'
getCouponListArea() { }
uni.showLoading({ getCmsContent(params).then(res => {
title: '加载中...' if (res.return_code == '000000') {
}) this.swiperList = res.return_data;
if (this.isNoMoreData) { }
uni.hideLoading() });
return false; },
} //
let pagenum = this.pageNum; swiperChange(event) {
let params = { this.currentSwiper = event.detail.current;
regionId: app.globalData.cityId, },
// regionId: '510000', //
pageNum: pagenum, getCouponListArea() {
pageSize: this.pageSize, uni.showLoading({
displayArea: this.typeId, title: '加载中...'
couponName: this.couponName })
} if (this.isNoMoreData) {
getCouponList(params).then(res => { uni.hideLoading()
if (res.return_code == '000000') { return false;
uni.hideLoading(); }
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; let pagenum = this.pageNum;
this.goodsList = this.goodsList.concat(res.return_data.list); let params = {
if (res.return_data.total == (this.pageNum * this.pageSize)) { regionId: app.globalData.cityId,
this.isNoMoreData = true; pageNum: pagenum,
} pageSize: this.pageSize,
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; displayArea: this.typeId,
} else { couponName: this.couponName
this.goodsList = []; }
} getCouponList(params).then(res => {
}) if (res.return_code == '000000') {
}, uni.hideLoading();
// this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
getBrandCouponList() { this.goodsList = this.goodsList.concat(res.return_data.list);
uni.showLoading({ if (res.return_data.total == (this.pageNum * this.pageSize)) {
title: '加载中...' this.isNoMoreData = true;
}) }
if (this.isNoMoreData) { this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
uni.hideLoading() } else {
return false; this.goodsList = [];
} }
let pagenum = this.pageNum; })
let params = { },
regionId: app.globalData.cityId, //
pageNum: pagenum, getBrandCouponList() {
pageSize: this.pageSize, uni.showLoading({
brandId: this.brandid, title: '加载中...'
goodsTypeId: this.goodtyid, })
couponName: this.couponName if (this.isNoMoreData) {
} uni.hideLoading()
getBrandCouponList(params).then(res => { return false;
uni.hideLoading(); }
if (res.return_code == '000000') { let pagenum = this.pageNum;
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; let params = {
this.goodsList = this.goodsList.concat(res.return_data.list); regionId: app.globalData.cityId,
if (res.return_data.total == (this.pageNum * this.pageSize)) { pageNum: pagenum,
this.isNoMoreData = true; pageSize: this.pageSize,
} brandId: this.brandid,
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; goodsTypeId: this.goodtyid,
} else { couponName: this.couponName
this.goodsList = []; }
} getBrandCouponList(params).then(res => {
}) uni.hideLoading();
}, if (res.return_code == '000000') {
toSearch() { this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.pageNum = 1; this.goodsList = this.goodsList.concat(res.return_data.list);
this.pageSize = 10; if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = false; this.isNoMoreData = true;
this.goodsList = []; }
if(this.typeId == 3){ this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
this.getBrandCouponList(); } else {
}else{ this.goodsList = [];
this.getCouponListArea(); }
} })
}, },
// toSearch() {
toGoods(e) { this.pageNum = 1;
uni.navigateTo({ this.pageSize = 10;
url: '../../goods/goods?id=' + e this.isNoMoreData = false;
}); this.goodsList = [];
}, if (this.typeId == 4) {
} this.getBrandCouponList();
} else {
} this.getCouponListArea();
</script> }
},
<style lang="scss"> //
.input-box { toGoods(e) {
width: 90%; uni.navigateTo({
margin-left: 5%; url: '../../goods/goods?id=' + e
margin-top: 15px; });
height: 70rpx; },
background-color: #f5f5f5; }
border-radius: 10rpx;
position: relative; }
display: flex; </script>
align-items: center;
<style lang="scss">
.icon { .input-box {
display: flex; width: 90%;
align-items: center; margin-left: 5%;
position: absolute; margin-top: 15px;
top: 2px; height: 70rpx;
left: 5px; background-color: #f5f5f5;
width: 60upx; border-radius: 10rpx;
height: 60upx; position: relative;
font-size: 34upx; display: flex;
color: #c0c0c0; align-items: center;
}
.icon {
input { display: flex;
padding-left: 50upx; align-items: center;
height: 28upx; position: absolute;
font-size: 28upx; top: 2px;
width: 100%; left: 5px;
} width: 60upx;
} height: 60upx;
font-size: 34upx;
.swiper { color: #c0c0c0;
width: 100%; }
display: flex;
justify-content: center; input {
margin-top: 20px; padding-left: 50upx;
margin-bottom: 20px; height: 28upx;
font-size: 28upx;
.swiper-box { width: 100%;
width: 92%; }
height: 150px; }
overflow: hidden;
border-radius: 15upx; .swiper {
box-shadow: 0upx 8upx 25upx rgba(0, 0, 0, 0.2); width: 100%;
//ios display: flex;
position: relative; justify-content: center;
z-index: 1; margin-top: 20px;
margin-bottom: 20px;
swiper {
width: 100%; .swiper-box {
height: 150px; width: 92%;
height: 150px;
swiper-item { overflow: hidden;
image { border-radius: 15upx;
width: 100%; box-shadow: 0upx 8upx 25upx rgba(0, 0, 0, 0.2);
height: 150px; //ios
} position: relative;
} z-index: 1;
}
swiper {
.indicator { width: 100%;
position: absolute; height: 150px;
bottom: 20upx;
left: 20upx; swiper-item {
background-color: rgba(255, 255, 255, 0.4); image {
width: 150upx; width: 100%;
height: 5upx; height: 150px;
border-radius: 3upx; }
overflow: hidden; }
display: flex; }
.dots { .indicator {
width: 0upx; position: absolute;
background-color: rgba(255, 255, 255, 1); bottom: 20upx;
transition: all 0.3s ease-out; left: 20upx;
background-color: rgba(255, 255, 255, 0.4);
&.on { width: 150upx;
width: (100%/3); height: 5upx;
} border-radius: 3upx;
} overflow: hidden;
} display: flex;
}
} .dots {
width: 0upx;
.goodsimg { background-color: rgba(255, 255, 255, 1);
width: 90px; transition: all 0.3s ease-out;
height: 90px;
} &.on {
width: (100%/3);
.goodsli { }
margin-left: 100px; }
padding-top: 5px; }
} }
}
.goodsxg {
margin-top: 5px; .goodsimg {
border: 1px solid #eb5823; width: 90px;
border-radius: 5px; height: 90px;
color: #eb5823; }
width: 55px;
padding: 3px; .goodsli {
} margin-left: 100px;
padding-top: 5px;
.info { }
display: flex;
justify-content: space-between; .goodsxg {
align-items: flex-end; margin-top: 5px;
width: 100%; border: 1px solid #eb5823;
border-radius: 5px;
.price { color: #eb5823;
color: #e65339; width: 55px;
font-size: 30upx; padding: 3px;
font-weight: 600; }
width: 50%;
} .info {
display: flex;
.slogan { justify-content: space-between;
width: 50%; align-items: flex-end;
color: #807c87; width: 100%;
font-size: 24upx;
text-decoration: line-through; .price {
} color: #e65339;
} font-size: 30upx;
font-weight: 600;
width: 50%;
}
.slogan {
width: 50%;
color: #807c87;
font-size: 24upx;
text-decoration: line-through;
}
}
</style> </style>

@ -77,7 +77,7 @@
// //
jumpgoods(item){ jumpgoods(item){
uni.navigateTo({ uni.navigateTo({
url:'../../pages/goods/goods-list/goods-list?id=3'+'&goodsId='+this.desId+'&brandId='+item url:'../../pages/goods/goods-list/goods-list?id=4'+'&goodsId='+this.desId+'&brandId='+item
}) })
} }
} }

Loading…
Cancel
Save