dxz1228 2 lat temu
rodzic
commit
397ee4adf5

+ 1 - 0
src/apis/model/dacang.model.ts

@@ -17,6 +17,7 @@ export interface QueryDcHomeParams {
17 17
 }
18 18
 // 大仓商品
19 19
 export type DcProductModel = {
20
+     banner:string
20 21
      product_id: string
21 22
      mer_id: string
22 23
      image: string//图片

+ 12 - 1
src/apis/product.ts

@@ -68,9 +68,20 @@ enum API {
68 68
     // 抖音商品列表搜索
69 69
     DY_SEARCH = '/api/dy/get_search',
70 70
     // 抖音商品详情
71
-    DY_DETAIL = '/api/dy/get_detail'
71
+    DY_DETAIL = '/api/dy/get_detail',
72
+    //大仓banner展示图片
73
+    DC_BANNER='/api/newhome/nologin/banner/da_cang'
72 74
 }
73 75
 
76
+
77
+/**获取大仓banner展示图片 */
78
+export function getBannerImg (){
79
+    return defHttp.get({
80
+        url:API.DC_BANNER
81
+    })
82
+}
83
+
84
+
74 85
 /**
75 86
  * 获取分享ID
76 87
  * @param params

+ 2 - 2
src/config/app.ts

@@ -5,8 +5,8 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
5 5
 // 网络接口修改此字符 小程序域名要求https
6 6
 
7 7
 // let httpApi = 'https://mer1.crmeb.net'
8
-// let httpApi = 'https://test.bjtdba.com'
9
-let httpApi = 'https://app.bjtdba.com'
8
+let httpApi = 'https://test.bjtdba.com'
9
+// let httpApi = 'https://app.bjtdba.com'
10 10
 // let httpApi = 'https://test.bjtdba.com'
11 11
 
12 12
 // let httpApi = 'http://192.168.1.77:8324'

+ 32 - 27
src/pages/dacang/list/index.vue

@@ -1,29 +1,30 @@
1 1
 <script lang="ts" setup>
2 2
 import FNavBar from "~/components/FNavBar/FNavBar.vue";
3
-import {getDcProductClassify, getDcProductList} from "~/apis/dacang";
3
+import { getDcProductClassify, getDcProductList } from "~/apis/dacang";
4 4
 import FTabs from "~/components/FTabs/FTabs.vue";
5 5
 import ProductList from "~/components/ProductList/ProductList.vue";
6
-import type {DcProductModel} from "~/apis/model/dacang.model";
7
-import {useDacangStore} from "~/stores/dacangStore";
8
-import {CDN_URL} from "~/config/app";
6
+import type { DcProductModel } from "~/apis/model/dacang.model";
7
+import { useDacangStore } from "~/stores/dacangStore";
8
+import { CDN_URL } from "~/config/app";
9 9
 import DacangHeader from "~/pages/dacang/list/components/dacang-header.vue";
10 10
 import CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
11
-import {getProductShare} from "~/apis/common";
12
-import {useUserStore} from "~/stores/userStore";
11
+import { getProductShare } from "~/apis/common";
12
+import { useUserStore } from "~/stores/userStore";
13 13
 import Cache from "~/utils/cache";
14
-const headerImage = CDN_URL + `/static/assets/banner-dacang.png`
14
+import { getBannerImg } from '~/apis/product'
15
+import Banner from "./components/banner.vue";
16
+
17
+
15 18
 const usePageStore = usePageStoreWidthOut()
16 19
 
17 20
 
18 21
 const state = reactive({
19
-  tabs: [{store_category_id: '-1', cate_name: '全部'}],
22
+  tabs: [{ store_category_id: '-1', cate_name: '全部' }],
20 23
   productList: <Array<DcProductModel>>[],
21
-
22 24
   currentClassify: '',
23 25
   keyword: '',
24
-
25 26
   status: 'noMore',
26
-
27
+  banner:'',
27 28
   currentPage: 1,
28 29
   pageSize: 10,
29 30
   totalPage: 1
@@ -35,14 +36,16 @@ let Scroll_X = ref(0)
35 36
 const dacangStore = useDacangStore()
36 37
 const userStore = useUserStore()
37 38
 
39
+
38 40
 onLoad(async (option) => {
39
-  state.tabs = [{store_category_id: '-1', cate_name: '全部'}]
41
+  state.tabs = [{ store_category_id: '-1', cate_name: '全部' }]
40 42
   const classifyRes = await getDcProductClassify()
43
+
41 44
   state.tabs.push(...classifyRes)
42 45
   usePageStore.setPageConfig({
43 46
     currentPage: {
44 47
       type: 'tab',
45
-      url:  '/pages/dacang/list/index'
48
+      url: '/pages/dacang/list/index'
46 49
     }
47 50
   })
48 51
 
@@ -57,7 +60,12 @@ onLoad(async (option) => {
57 60
     // console.log(message)
58 61
   })
59 62
   userStore.setRedirectPage(`/pages/dacang/list/index`, 'tab')
60
-
63
+  getBannerImg().then(res=>{
64
+    console.log('banner',res);
65
+    state.banner=res[0].pic
66
+    console.log(state.banner);
67
+    
68
+  })
61 69
 
62 70
 })
63 71
 
@@ -85,26 +93,25 @@ onShow(async (options) => {
85 93
   usePageStore.setPageConfig({
86 94
     currentPage: {
87 95
       type: 'tab',
88
-      url:  '/pages/dacang/list/index'
96
+      url: '/pages/dacang/list/index'
89 97
     }
90 98
   })
91 99
   loadList('reload')
92 100
 })
93 101
 
94 102
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
95
-
103
+  console.log(action);
96 104
   let params: any = {
97 105
     page: state.currentPage,
98 106
     limit: state.pageSize,
99 107
     keyword: state.keyword
100 108
   }
109
+  console.log(params);
101 110
   if (dacangStore.currentClassify !== '-1') {
102 111
     params.classify = dacangStore.currentClassify
103 112
   }
104 113
 
105
-  if (action === 'reload') {
106
-    params.page = 1
107
-  }
114
+
108 115
 
109 116
   getDcProductList({
110 117
     ...params
@@ -136,7 +143,7 @@ const headerClass = ref('')
136 143
 onPageScroll((page) => {
137 144
   Scroll_X.value = Number(page.scrollTop.toFixed())
138 145
   // page.scrollTop
139
-  if (page.scrollTop >= 76 ) {
146
+  if (page.scrollTop >= 76) {
140 147
     headerClass.value = '!bg-primary !text-white'
141 148
   } else {
142 149
     headerClass.value = ''
@@ -150,7 +157,7 @@ onReachBottom(() => {
150 157
   state.currentPage += 1
151 158
   loadList('page', (items) => {
152 159
     uni.hideLoading()
153
-    // console.log(items)
160
+    console.log(items)
154 161
     if (!items.length > 0) {
155 162
       // console.log('没有更多了')
156 163
       state.status = 'noMore'
@@ -169,12 +176,12 @@ onPullDownRefresh(() => {
169 176
 </script>
170 177
 <template>
171 178
   <div class="h-screen">
172
-    <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick"/>
179
+    <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick" />
173 180
 
174 181
     <div class="flex flex-col gap-2 ">
175
-      <CXBBackTop :Scroll_X="Scroll_X"/>
176
-      <image :src="headerImage" mode="widthFix" class="w-full h-50"></image>
177
-    <ProductList :list="state.productList" />
182
+      <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
183
+      <image lazy-load :src="state.banner" mode="widthFix" class="w-full h-50"></image>
184
+      <ProductList :list="state.productList" />
178 185
       <div class="pb-safe flex justify-center items-center text-[12px] text-gray-500" v-if="state.productList.length > 0">
179 186
         <div v-if="state.status === 'loading'">
180 187
           加载中...
@@ -195,8 +202,6 @@ page {
195 202
 .nut-tab-pane {
196 203
   display: none !important;
197 204
 }
198
-
199
-
200 205
 </style>
201 206
 <route lang="yaml" >
202 207
 style:

+ 2 - 2
src/pages/payment/index.vue

@@ -102,8 +102,8 @@ function handleConfirm() {
102 102
       OrderLists: state.orderList,
103 103
       type: 'tdbaspzf'
104 104
     },
105
-    // envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
106
-    envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
105
+    envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
106
+    // envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
107 107
     success(res) {
108 108
       // 打开成功
109 109
       uni.showToast({

+ 55 - 35
src/pages/vip/index.vue

@@ -2,27 +2,27 @@
2 2
   <!--  <CXBBasePage :show="true" title="">-->
3 3
 
4 4
   <div class="flex flex-col gap-3 ">
5
-    <div style="height: 80rpx;" >
6
- <div style="background-color: transparent  " class="overflow-hidden fixed top-0 w-full z-10">
7
-      <nut-searchbar v-model="state.keyword" @search="loadList('reload')" @clear="loadList('reload')">
8
-        <!--      <template v-slot:leftout>-->
9
-        <!--        <div @tap="navBack">-->
10
-        <!--          <nut-icon name="left"></nut-icon>-->
11
-        <!--        </div>-->
12
-        <!--      </template>-->
13
-        <template v-slot:rightout>
14
-          <div @tap="loadList('reload')">
15
-            搜索
16
-          </div>
17
-        </template>
18
-      </nut-searchbar>
19
-    </div>
5
+    <div style="height: 80rpx;">
6
+      <div style="background-color: transparent  " class="overflow-hidden fixed top-0 w-full z-10">
7
+        <nut-searchbar v-model="state.keyword" @search="loadList('reload')" @clear="loadList('reload')">
8
+          <!--      <template v-slot:leftout>-->
9
+          <!--        <div @tap="navBack">-->
10
+          <!--          <nut-icon name="left"></nut-icon>-->
11
+          <!--        </div>-->
12
+          <!--      </template>-->
13
+          <template v-slot:rightout>
14
+            <div @tap="loadList('reload')">
15
+              搜索
16
+            </div>
17
+          </template>
18
+        </nut-searchbar>
19
+      </div>
20 20
     </div>
21
-   
22
-    
21
+
22
+
23 23
     <!--      <image :src="homeBanner" mode="widthFix" class="h-10 w-full "></image>-->
24 24
 
25
-    <div class="w-screen h-45"  >
25
+    <div class="w-screen h-45">
26 26
       <swiper v-if="state.banners" :indicator-dots="state.indicatorDots" indicator-active-color="#e93323"
27 27
         :autoplay="state.autoplay" :circular="state.circular" :interval="state.interval" :duration="state.duration"
28 28
         class="w-full h-full">
@@ -45,10 +45,11 @@
45 45
               <div class="line-clamp-1">
46 46
                 {{ item.store_name }}
47 47
               </div>
48
-              <div  v-if="item.type!=15" class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
48
+              <div v-if="item.type != 15"
49
+                class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
49 50
                 <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png" mode="widthFix"
50 51
                   class="!w-8 "></image>
51
-                <div  class="px-2 flex items-center jusitify-center">
52
+                <div class="px-2 flex items-center jusitify-center">
52 53
                   <div>
53 54
                     养老金 ¥{{ item.yanglao }}
54 55
                   </div>
@@ -120,7 +121,7 @@ const state = reactive({
120 121
   pageSize: 10,
121 122
   totalPage: 1,
122 123
   banners: [],
123
-
124
+  count: 0,
124 125
   keyword: '',
125 126
   status: 'noMore',
126 127
   indicatorDots: true,
@@ -130,7 +131,8 @@ const state = reactive({
130 131
   duration: 500,
131 132
   currents: "0",
132 133
 })
133
-const list = ref()
134
+const list = ref([])
135
+const count = ref()
134 136
 
135 137
 onLoad((option) => {
136 138
   if (option && option.shareId) {
@@ -179,6 +181,8 @@ onShareTimeline(() => {
179 181
 
180 182
 
181 183
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
184
+
185
+
182 186
   // console.log(state.keyword)
183 187
   const params = {
184 188
     page: state.currentPage,
@@ -188,16 +192,25 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
188 192
     params.keyword = state.keyword
189 193
   }
190 194
   console.log(params)
195
+
191 196
   getVipAreaList({
192 197
     // page: state.currentPage,
193 198
     // limit: state.pageSize
194 199
     ...params
195 200
   }).then(res => {
201
+    // console.log(res.count)
196 202
     // console.log(res.list)
197
-    console.log(res.list)
198
-    if (res) {
203
+    count.value = res.count
204
+    console.log(action);
205
+    if (action === 'page') {
206
+      list.value = list.value.concat(res.list)
207
+    }
208
+    if (action === 'reload') {
199 209
       list.value = res.list
200 210
     }
211
+    if(callback){
212
+      callback(res)
213
+    }
201 214
   })
202 215
 }
203 216
 function handleItemClick(item) {
@@ -209,21 +222,28 @@ function handleItemClick(item) {
209 222
 function handleScrollToLower() {
210 223
   state.status = 'loading';
211 224
   state.currentPage += 1;
212
-  console.log(state.totalPage)
213
-  if (state.currentPage > state.totalPage) {
214
-    state.status = 'noMore';
215
-  } else {
216
-    setTimeout(() => {
217
-      loadList('page')
218
-    }, 300)
219
-  }
225
+  // console.log(state.currentPage)
226
+  // console.log(state.totalPage)
227
+  // if (count.value > (state.currentPage*state.pageSize)) {
228
+  //   loadList('page')
229
+  // } else {
230
+  //   state.status = 'noMore';
231
+  //   setTimeout(() => {
232
+  //     loadList('page')
233
+  //   }, 300)
234
+  // }
235
+  loadList('page', (items) => {
236
+    console.log('items', items);
237
+    if (!items.length > 0) {
238
+      // console.log('没有更多了')
239
+      state.status = 'noMore'
240
+    }
241
+  })
220 242
 }
221 243
 
222 244
 onReachBottom(() => {
223
-  console.log('到底了。。。')
224
-
245
+  // console.log('到底了。。。')
225 246
   handleScrollToLower()
226
-
227 247
 })
228 248
 
229 249
 onPullDownRefresh(() => {

+ 1 - 1
src/stores/userStore.ts

@@ -27,7 +27,7 @@ export const useUserStore = defineStore('userStore', {
27 27
         yanglao: 0,
28 28
         shareId: null,
29 29
         redirectPage: null,
30
-        permissionList: null // 权限列表
30
+        permissionList: null, // 权限列表
31 31
     }) as UserStoreState,
32 32
     actions: {
33 33
         // getYanglaojinStatistics().then(res => {