123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- <template>
- <view class="container">
- <view class="cate-nav">
- <view class="name">优惠券:{{ couponName }}</view>
- </view>
- <view class="cate-item">
- <view class="b">
- <navigator :class="'item ' + ((iindex + 1) % 2 == 0 ? 'item-b' : '')" :url="'/pages/goods/goods?id=' + iitem.id" v-for="(iitem, iindex) in goodsList" :key="iindex">
- <image class="img" :src="iitem.picUrl" background-size="cover"></image>
- <!-- <text wx:if="{{iitem.type=='2'}}">起</text> -->
- <!-- <view class="price">
- <view class="retailPrice">¥{{iitem.retailPrice}}</view>
- <view class="memberPrice">¥{{iitem.memberPrice}}</view>
- <view class="member-price-tag">会员价</view>
- </view>
-
- <text class="name">{{iitem.name}}</text> -->
- <view style="display: flex; margin-top: 10rpx; height: 71rpx">
- <!-- <image wx:if="{{iitem.activited}}"
- src="https://7a68-zhaijieshi-3guecm78383ca692-1307626841.tcb.qcloud.la/activity/618.png"
- style="width: 39px;height:16px;margin-right: 2px;" /> -->
- <text class="name">{{ iitem.name }}</text>
- </view>
- <view class="price">
- <!-- <view class="retailPrice">¥{{iitem.retailPrice}}</view>
- <view class="memberPrice">¥{{iitem.memberPrice}}</view>
- <view class="member-price-tag">会员价</view> -->
- <view v-if="iitem.activited" class="retailPrice">
- <text class="price-unit">¥</text>
- {{ iitem.activityPrice }}
- </view>
- <view v-else class="retailPrice">
- <text class="price-unit">¥</text>
- {{ iitem.retailPrice }}
- </view>
- <view v-if="iitem.activited || iitem.counterPrice != iitem.retailPrice" class="counterPrice">原价¥{{ iitem.counterPrice }}</view>
- </view>
- </navigator>
- </view>
- </view>
- </view>
- </template>
- <script>
- var util = require('../../../utils/util.js');
- var api = require('../../../config/api.js');
- var user = require('../../../utils/user.js');
- export default {
- data() {
- return {
- couponName: '',
- goodsList: [],
- couponId: 0,
- addressInfo: {},
- code: '',
- iindex: 0,
- iitem: {
- id: '',
- picUrl: '',
- name: '',
- activited: '',
- counterPrice: '',
- retailPrice: ''
- }
- };
- }
- /**
- * 生命周期函数--监听页面加载
- */,
- onLoad: function (options) {
- if (options.id) {
- this.setData({
- couponId: options.id
- });
- }
- this.getGoodsList();
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {},
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {},
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {},
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {},
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {},
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {},
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {},
- methods: {
- getGoodsList: function () {
- var that = this;
- util.request(api.GoodsCoupon, {
- couponId: that.couponId
- }).then(function (res) {
- that.setData({
- goodsList: res.data.list,
- couponName: res.data.couponName
- });
- //如果只有一个商品 直接跳转商详页
- if (res.data.list.length == 1) {
- uni.redirectTo({
- url: '/pages/goods/goods?id=' + res.data.list[0].id
- });
- }
- else if(res.data.list.length == 0){//表示全场通用,直接跳转到商品列表页
- uni.switchTab({
- url: '/pages/tabBar/catalog/catalog'
- });
-
- }
- });
- }
- }
- };
- </script>
- <style>
- .container {
- background: #f9f9f9;
- }
- .counterPrice {
- text-decoration: line-through;
- font-size: 24rpx;
- margin: 0 0 0 20rpx;
- color: #c7c7c7;
- }
- .cate-nav {
- text-align: center;
- z-index: 1000;
- padding: 20rpx 0;
- font-size: 32rpx;
- border-bottom: 2rpx solid #e4e4e4;
- }
- .price-unit {
- font-size: 23rpx;
- font-weight: 400;
- color: #202020;
- }
- .cate-nav-body {
- height: 84rpx;
- white-space: nowrap;
- background: #fff;
- border-top: 1px solid rgba(0, 0, 0, 0.15);
- overflow: hidden;
- }
- .cate-nav .item {
- display: inline-block;
- height: 84rpx;
- min-width: 130rpx;
- padding: 0 15rpx;
- }
- .cate-nav .item .name {
- display: block;
- height: 84rpx;
- padding: 0 20rpx;
- line-height: 84rpx;
- color: #333;
- font-size: 30rpx;
- width: auto;
- }
- .cate-nav .item.active .name {
- color: #09afff;
- border-bottom: 2px solid #09afff;
- }
- .cate-item {
- height: auto;
- overflow: hidden;
- }
- .cate-item .h {
- height: 145rpx;
- width: 750rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .cate-item .h .name {
- display: block;
- height: 35rpx;
- margin-bottom: 18rpx;
- font-size: 30rpx;
- color: #333;
- }
- .cate-item .h .desc {
- display: block;
- height: 24rpx;
- font-size: 24rpx;
- color: #999;
- }
- .cate-item .b {
- width: 750rpx;
- padding: 0 6.25rpx;
- height: auto;
- overflow: hidden;
- }
- .cate-item .b .item {
- float: left;
- background: #fff;
- width: 342rpx;
- height: auto;
- overflow: hidden;
- padding: 15rpx;
- border-radius: 15rpx;
- margin: 16.5rpx 16.5rpx 8.5rpx 16.5rpx;
- }
- .cate-item .b .item-b {
- margin-left: 6.25rpx;
- }
- .cate-item .item .img {
- width: 362rpx;
- height: 362rpx;
- }
- .cate-item .b .item .mark {
- width: 122rpx;
- height: 100rpx;
- margin-top: -20rpx;
- margin-left: 0rpx;
- }
- .cate-item .item .name {
- display: block;
- width: 365.625rpx;
- margin: 0 0 5rpx 0;
- overflow: hidden;
- padding: 0 20rpx;
- font-size: 26rpx;
- color: #1c1c1c;
- line-height: 1.3em;
- padding-left: 0rpx;
- text-align: left;
- }
- .cate-item .item .brand {
- display: block;
- width: 365.625rpx;
- height: 22rpx;
- font-size: 22rpx;
- color: #ab956d;
- margin-top: 10rpx;
- margin-left: 22rpx;
- }
- .cate-item .item .price {
- height: 40rpx;
- display: flex;
- margin-top: 20rpx;
- align-items: flex-end;
- }
- .retailPrice {
- font-size: 30rpx;
- height: 30rpx;
- line-height: 30rpx;
- }
- .memberPrice {
- font-size: 22rpx;
- color: #dd483e;
- margin: 0 10rpx 0 20rpx;
- }
- .member-price-tag {
- width: 88rpx;
- height: 26rpx;
- line-height: 26rpx;
- background: url('https://mall.zhaijieshi.cc/file/jzmall/weixin/member/member-price-bg.png') no-repeat center center;
- background-size: 100% 100%;
- color: #5e3a11;
- font-size: 16rpx;
- padding: 0 8rpx 0 0;
- text-align: right;
- margin: 0 0 6rpx 0;
- }
- </style>
|