Browse Source

上传

master
前端-胡立永 3 months ago
parent
commit
672b78150f
6 changed files with 69 additions and 30 deletions
  1. +7
    -0
      api/model/info.js
  2. +3
    -0
      components/couponList/couponList.vue
  3. +10
    -5
      components/couponPopup/couponPopup.vue
  4. +1
    -1
      config.js
  5. +41
    -22
      pages/index/category.vue
  6. +7
    -2
      pages/index/order.vue

+ 7
- 0
api/model/info.js View File

@ -103,6 +103,13 @@ const api = {
url: '/info_common/getCartPageList', url: '/info_common/getCartPageList',
method: 'GET', method: 'GET',
}, },
// 领取新人优惠券
getRiceCoupon: {
url: '/info_common/getRiceCoupon',
method: 'GET',
limit: 500,
auth: true,
},
} }
export default api export default api

+ 3
- 0
components/couponList/couponList.vue View File

@ -83,6 +83,9 @@
// //
formatDate(date) { formatDate(date) {
if(!date){
return ''
}
date = new Date(date.replace(/-/g,'/')); date = new Date(date.replace(/-/g,'/'));
// const year = date.getFullYear(); // const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 01 const month = String(date.getMonth() + 1).padStart(2, '0'); // 01


+ 10
- 5
components/couponPopup/couponPopup.vue View File

@ -5,10 +5,11 @@
customStyle="background-color: transparent;" customStyle="background-color: transparent;"
:z-index="999999"> :z-index="999999">
<view class="couponPopup-wrapper"> <view class="couponPopup-wrapper">
<view class="main-container">
<view class="main-container"
@click="toCoupon">
<view class="body"> <view class="body">
<image :src="configList.wx_image" mode="widthFix" class="coupon-bg"></image> <image :src="configList.wx_image" mode="widthFix" class="coupon-bg"></image>
<image @click="close" src="@/static/image/coupon/close-btn.png" mode="widthFix"
<image @click.stop="close" src="@/static/image/coupon/close-btn.png" mode="widthFix"
class="close-btn"> class="close-btn">
</image> </image>
<view class="coupon-money"> <view class="coupon-money">
@ -20,7 +21,7 @@
<image :src="configList.qd_image" mode="widthFix" class="register-success"></image> <image :src="configList.qd_image" mode="widthFix" class="register-success"></image>
<view class="shopping">购物即可抵扣</view> <view class="shopping">购物即可抵扣</view>
</view> </view>
<image @click="close"
<image
:src="configList.down_image" mode="widthFix" :src="configList.down_image" mode="widthFix"
class="examine"></image> class="examine"></image>
</view> </view>
@ -48,8 +49,12 @@
// //
toCoupon() { toCoupon() {
this.$refs.couponPopup.close() this.$refs.couponPopup.close()
uni.navigateTo({
url: "/pages_order/mine/coupon"
this.$api('getRiceCoupon', res => {
if(res.code == 200){
uni.navigateTo({
url: "/pages_order/mine/coupon"
})
}
}) })
}, },
close(){ close(){


+ 1
- 1
config.js View File

@ -6,7 +6,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置 // 环境配置


+ 41
- 22
pages/index/category.vue View File

@ -25,27 +25,41 @@
<!-- 分类商品列表 --> <!-- 分类商品列表 -->
<view class="category" <view class="category"
v-else> v-else>
<view class="tabs">
<uv-tabs
:list="category"
:activeStyle="{color : '#f00', fontWeight : 600}"
lineColor="#f00"
:inactiveStyle="{color: 'rgba(0,0,0,.8)'}"
lineHeight="8rpx"
lineWidth="50rpx"
:current="current"
@click="clickTabs"></uv-tabs>
</view>
<uv-vtabs <uv-vtabs
:list="category"
:current="current"
:list="category[current].children"
:current="currentChildren"
keyName="name" keyName="name"
:chain="true"
@change="change"> @change="change">
<view class="list">
<uv-vtabs-item>
<view class="category-item"
v-for="(item, index) in category[current].children" :key="index">
<view class="category-title">
{{ item.name }}
</view>
<productItem :item="pro"
v-for="(pro, i) in item.shopList" :key="i"
@click="$utils.navigateTo(`/pages_order/product/productDetail?id=${pro.id}`)" />
</view>
<uv-empty mode="list" v-if="category[current].children.length == 0"></uv-empty>
</uv-vtabs-item>
</view>
<!-- <view class="list"> -->
<template v-for="(item, index) in category[current].children">
<uv-vtabs-item :index="index" :key="index">
<view class="category-item">
<view class="category-title">
{{ item.name }}
</view>
<productItem :item="pro"
v-for="(pro, i) in item.shopList" :key="i"
@click="$utils.navigateTo(`/pages_order/product/productDetail?id=${pro.id}`)" />
</view>
</uv-vtabs-item>
</template>
<uv-empty mode="list" v-if="category[current].children.length == 0"></uv-empty>
<!-- </view> -->
</uv-vtabs> </uv-vtabs>
</view> </view>
@ -73,6 +87,7 @@
return { return {
mixinsListApi: 'getClassShopPageList', mixinsListApi: 'getClassShopPageList',
current : 0, current : 0,
currentChildren : 0,
} }
}, },
computed: { computed: {
@ -100,7 +115,11 @@
methods: { methods: {
change(e) { change(e) {
// this.queryParams.classId = this.category[e].id // this.queryParams.classId = this.category[e].id
this.current = e
this.currentChildren = e
},
clickTabs({index}){
this.current = index
this.currentChildren = 0
}, },
search(){ search(){
for(let i = 0;i < 10;i++){ for(let i = 0;i < 10;i++){
@ -116,15 +135,15 @@
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
/deep/ .uv-vtabs { /deep/ .uv-vtabs {
height: calc(100vh - 470rpx) !important;
height: calc(100vh - 600rpx) !important;
} }
/deep/ .uv-vtabs__bar { /deep/ .uv-vtabs__bar {
height: calc(100vh - 470rpx) !important;
height: calc(100vh - 600rpx) !important;
} }
/deep/ .uv-vtabs__content { /deep/ .uv-vtabs__content {
height: calc(100vh - 470rpx) !important;
height: calc(100vh - 600rpx) !important;
} }
.search { .search {


+ 7
- 2
pages/index/order.vue View File

@ -5,8 +5,13 @@
<!-- 订单筛选 --> <!-- 订单筛选 -->
<view class="tabs"> <view class="tabs">
<uv-tabs :list="tabs" :activeStyle="{color : '#fff', fontWeight : 600}" lineColor="#fff"
:inactiveStyle="{color: 'rgba(255,255,255,.8)'}" lineHeight="8rpx" lineWidth="50rpx" :current="current"
<uv-tabs :list="tabs"
:activeStyle="{color : '#fff', fontWeight : 600}"
lineColor="#fff"
:inactiveStyle="{color: 'rgba(255,255,255,.8)'}"
lineHeight="8rpx"
lineWidth="50rpx"
:current="current"
@click="clickTabs"></uv-tabs> @click="clickTabs"></uv-tabs>
</view> </view>


Loading…
Cancel
Save