shish 7 месяцев назад
Родитель
Сommit
f20427f6fc
3 измененных файлов с 66 добавлено и 61 удалено
  1. 2 2
      mallApp/src/pages.json
  2. 59 46
      mallApp/src/pages/hb/list.vue
  3. 5 13
      mallApp/src/pages/home/recent.vue

+ 2 - 2
mallApp/src/pages.json

@@ -82,9 +82,9 @@
             ]
         },
         {
-            "root": "pages/coupon",
+            "root": "pages/hb",
             "pages": [
-                { "path": "list", "style": { "navigationBarTitleText": "优惠券", "enablePullDownRefresh": true } }
+                { "path": "list", "style": { "navigationBarTitleText": "红包", "enablePullDownRefresh": true } }
             ]
         },
         {

+ 59 - 46
mallApp/src/pages/hb/list.vue

@@ -1,12 +1,10 @@
 <template>
-	<div class="app-content coupon-list">
-		<!-- <div class="tabs-wrap"> -->
-		<app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="33.3333%" />
-		<!-- </div> -->
-		<div class="list-wrap" :class="{'expired' : tabIndex == 2}">
+	<view class="app-content coupon-list">
+		<AppTabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="33.3333%" />
+		<view class="list-wrap" :class="{'expired' : tabIndex == 2}">
 			<block v-if="!$util.isEmpty(list.data)">
-				<div class="list" v-for="(item, index) in list.data" :key="index">
-					<div class="list-img">
+				<view class="list" v-for="(item, index) in list.data" :key="index">
+					<view class="list-img">
 						<!-- 已过期 -->
 						<template v-if="tabIndex == 2">
 							<img :src="`${constant.imgUrl}/retail/coupon/expired.png`" alt mode="widthFix" />
@@ -14,54 +12,54 @@
 						<template v-else>
 							<img :src="`${constant.imgUrl}/retail/coupon/bg.png`" alt mode="widthFix" />
 						</template>
-					</div>
+					</view>
 					<!-- 列表 -->
-					<div class="list-det">
-						<div class="list-det-left">
-							<div class="price-wrap">
+					<view class="list-det">
+						<view class="list-det-left">
+							<view class="price-wrap">
 								<span>¥</span>
 								<span class="price">{{ item.amount }}</span>
-							</div>
-							<div class="full-reduc app-size-28">满{{ item.miniCost }}可使用</div>
-						</div>
-						<div class="list-det-right">
-							<div class="coupon-message">
-								<div class="app-color-2">优惠券</div>
-								<div>适用:全品类</div>
-								<div>有效至:{{ item.deadline | formatTime('YYYY-MM-DD') }}</div>
-							</div>
+							</view>
+							<view class="full-reduc app-size-28">满{{ item.miniCost }}可使用</view>
+						</view>
+						<view class="list-det-right">
+							<view class="coupon-message">
+								<view class="title">红包</view>
+								<view class="shop">门店:好运鲜花批发</view>
+								<view class="date">有效至:{{ item.deadline | formatTime('YYYY-MM-DD') }}</view>
+							</view>
 							<!-- 未使用 -->
-							<template v-if="tabIndex == 0">
-								<button class="button-com red" @click="goUserFn">去使用</button>
+							<template v-if="item.status == 0">
+								<button class="button-com red big" @click="goUserFn">去使用</button>
 							</template>
 							<!-- 已使用 -->
-							<template v-else-if="tabIndex == 1">
-								<div class="icon-wrap">
+							<template v-else-if="item.status == 1">
+								<view class="icon-wrap">
 									<i class="iconfont iconyishiyong"></i>
-								</div>
+								</view>
 							</template>
 							<!-- 已过期 -->
 							<template v-else>
-								<div class="icon-wrap">
+								<view class="icon-wrap">
 									<i class="iconfont iconyiguoqi"></i>
-								</div>
+								</view>
 							</template>
-						</div>
-					</div>
-				</div>
+						</view>
+					</view>
+				</view>
 			</block>
 			<block v-else>
 				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 			</block>
-		</div>
-	</div>
+		</view>
+	</view>
 </template>
 
 <script>
 import AppTabs from '@/components/plugin/tabs'
 import AppWrapperEmpty from '@/components/app-wrapper-empty'
 import { list } from '@/mixins'
-import { getList } from '@/api/coupon'
+import { getList } from '@/api/hb'
 export default {
 	name: 'tabs',
 	components: {
@@ -75,40 +73,48 @@ export default {
 			tabIndex: 0,
 			tabs: [
 				{
-					name: '未使用'
+					name: '未使用',
+					value: 0,
+					key: '0'
 				},
 				{
-					name: '使用记录'
+					name: '使用记录',
+					value: 0,
+					key: '0'
 				},
 				{
-					name: '已过期'
+					name: '已过期',
+					value: 0,
+					key: '0'
+				},
+				{
+					name: '全部',
+					value: 0,
+					key: '0'
 				}
 			]
 		}
 	},
 	onPullDownRefresh() {
 		this.resetList()
-		this._list().then(res => {
+		this.getHbList().then(res => {
 			uni.stopPullDownRefresh()
 		})
 	},
 	onReachBottom() {
 		if (this.list.moreData == 1) {
-			this._list().then(res => {
+			this.getHbList().then(res => {
 				uni.stopPullDownRefresh()
 			})
 		} else {
 			uni.stopPullDownRefresh()
 		}
 	},
-	onLoad: function() {
-		// this.init()
-	},
 	methods: {
 		async init() {
-			this._list()
+			this.getHbList()
 		},
-		_list() {
+		getHbList() {
 			return getList({ status: this.tabIndex }).then(res => {
 				console.log(res)
 				this.completes(res)
@@ -120,7 +126,7 @@ export default {
 			} else {
 				this.tabIndex = e.index
 				this.resetList()
-				this._list()
+				this.getHbList()
 			}
 		},
 		// 去使用
@@ -166,8 +172,15 @@ export default {
 						padding: 30upx 26upx 30upx 0;
 						.coupon-message {
 							color: $fontColor3;
-							& > div {
-								margin: 4upx 0;
+							font-size:28upx;
+							.title{
+								margin-bottom:5upx;
+								font-size:30upx;
+								font-weight:bold;
+								color:#333;
+							}
+							.shop{
+								margin-bottom: 5upx;
 							}
 						}
 						.button-com {

+ 5 - 13
mallApp/src/pages/home/recent.vue

@@ -6,7 +6,7 @@
         <view class="login-content">
           <text class="login-title">欢迎使用</text>
           <text class="login-subtitle">登录查看您的花店</text>
-          <button class="login-btn" @click="pageTo({ url: '/pages/login/index?needBack=1' })" > 立即登录 </button>
+          <button class="login-btn" @click="pageTo({ url: '/pages/login/index?needBack=1' })"> 立即登录 </button>
         </view>
       </view>
     </block>
@@ -18,16 +18,8 @@
         <view class="profile-section">
           <view class="profile-header">
             <view class="avatar-container">
-              <button
-                class="avatar-button"
-                open-type="chooseAvatar"
-                @chooseavatar="onChooseAvatar"
-              >
-                <image
-                  class="avatar"
-                  :src="user.smallAvatar"
-                  mode="aspectFill"
-                />
+              <button class="avatar-button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" >
+                <image class="avatar" :src="user.smallAvatar" mode="aspectFill" />
               </button>
             </view>
             <view class="user-info" @click="goEdit()">
@@ -52,8 +44,8 @@
               </view>
               <view v-if="unReadMsgNum > 0" class="message-badge">{{ unReadMsgNum > 9 ? '9+' : unReadMsgNum }}</view>
             </view>
-            <view class="function-item" @click="">
-              <text class="function-text">改号码</text>
+            <view class="function-item" @click="pageTo({ url: '/pages/hb/list' })">
+              <text class="function-text">红包</text>
             </view>
           </view>