Explorar o código

Merge branch 'li-yi'

dxz1228 %!s(int64=2) %!d(string=hai) anos
pai
achega
73b02e900a
Modificáronse 91 ficheiros con 4316 adicións e 1820 borrados
  1. 16 0
      .hbuilderx/launch.json
  2. 1 0
      components.d.ts
  3. 18 1
      src/apis/auth.api.ts
  4. 5 2
      src/apis/merchant.ts
  5. 1 0
      src/apis/model/dacang.model.ts
  6. 5 0
      src/apis/model/login.model.ts
  7. 10 0
      src/apis/model/order.model.ts
  8. 41 4
      src/apis/model/product.model.ts
  9. 1 1
      src/apis/model/shopping.model.ts
  10. 11 1
      src/apis/model/userInfoModel.ts
  11. 19 4
      src/apis/order.api.ts
  12. 29 17
      src/apis/product.ts
  13. 27 27
      src/apis/user.ts
  14. 0 1
      src/auto-imports.d.ts
  15. 74 0
      src/components/CXBBackTop/CXBBackTop.vue
  16. 15 13
      src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue
  17. 101 55
      src/components/CXBSkuPopup/CXBSkuPopup.vue
  18. 2 0
      src/components/FButton/FButton.vue
  19. 6 1
      src/components/FCell/FCell.vue
  20. 1 0
      src/components/FNavBar/FNavBar.vue
  21. 4 1
      src/components/FPopup/FPopup.vue
  22. 5 1
      src/components/FSearch/FSearch.vue
  23. 3 2
      src/config/app.ts
  24. 3 0
      src/constants/index.ts
  25. 10 10
      src/manifest.json
  26. 5 1
      src/pages.json
  27. 3 1
      src/pages/after-sales-order-list/index.vue
  28. 151 66
      src/pages/annuity/index.vue
  29. 4 0
      src/pages/article/detail.vue
  30. 28 27
      src/pages/dacang/list/components/dacang-header.vue
  31. 108 52
      src/pages/dacang/list/index.vue
  32. 45 26
      src/pages/home/components/header.vue
  33. 67 79
      src/pages/home/components/navs.vue
  34. 7 1
      src/pages/home/index.vue
  35. 100 27
      src/pages/immediate-withdrawal/index.vue
  36. 19 13
      src/pages/miaosha/index.vue
  37. 21 36
      src/pages/my-integral/index.vue
  38. 22 1
      src/pages/my-invitation/index.vue
  39. 238 152
      src/pages/my-rules/index.vue
  40. 15 4
      src/pages/order-confirm/index.vue
  41. 4 1
      src/pages/order/components/AllItemList.vue
  42. 87 37
      src/pages/order/components/OrderItem.vue
  43. 107 26
      src/pages/order/components/OrderObligationItem.vue
  44. 1 1
      src/pages/order/components/OtherOrderItem.vue
  45. 5 5
      src/pages/order/components/RefundOrderItem.vue
  46. 139 135
      src/pages/order/detail.vue
  47. 9 0
      src/pages/order/index.vue
  48. 1 1
      src/pages/order/logistics.vue
  49. 175 112
      src/pages/order/obligation-detail.vue
  50. 1 1
      src/pages/order_addcart/index-bak.vue
  51. 1 1
      src/pages/order_addcart/index-new.vue
  52. 277 103
      src/pages/order_addcart/index.vue
  53. 14 9
      src/pages/payment/index.vue
  54. 6 6
      src/pages/payment/success.vue
  55. 2 0
      src/pages/pension_account/index.vue
  56. 86 26
      src/pages/product/dingshenglianmeng.vue
  57. 2 2
      src/pages/real-name-authentication/index.vue
  58. 21 2
      src/pages/refund/drawback.vue
  59. 1 1
      src/pages/refund/option.vue
  60. 1 1
      src/pages/setting/index.vue
  61. 5 2
      src/pages/store/home/components/MerchantProductCard.vue
  62. 76 60
      src/pages/store/nearby/index.vue
  63. 615 221
      src/pages/store/product/detail.vue
  64. 384 155
      src/pages/store/product/other.vue
  65. 80 0
      src/pages/to-coupon/to-coupon.vue
  66. 1 1
      src/pages/user/address/index.vue
  67. 307 166
      src/pages/user/index.vue
  68. 11 5
      src/pages/user/login/index.vue
  69. 37 22
      src/pages/user/login/other-phone.vue
  70. 275 77
      src/pages/vip/index.vue
  71. 20 1
      src/pages/withdrawal-record/index.vue
  72. BIN=BIN
      src/static/icon/下拉.png
  73. BIN=BIN
      src/static/icon/返回顶部@2x.png
  74. BIN=BIN
      src/static/img-hy/DLqy.png
  75. BIN=BIN
      src/static/img-hy/QYDL.png
  76. BIN=BIN
      src/static/img-hy/city.png
  77. BIN=BIN
      src/static/img-hy/district.png
  78. BIN=BIN
      src/static/img-hy/会员.png
  79. BIN=BIN
      src/static/img-hy/关闭.png
  80. BIN=BIN
      src/static/img-hy/创始人.png
  81. BIN=BIN
      src/static/img-hy/合伙人.png
  82. BIN=BIN
      src/static/img-hy/用户.png
  83. BIN=BIN
      src/static/img-hy/联合创始人.png
  84. BIN=BIN
      src/static/img-hy/股东.png
  85. BIN=BIN
      src/static/img-hy/高级会员.png
  86. 3 6
      src/stores/dacangStore.ts
  87. 19 7
      src/stores/userStore.ts
  88. 111 0
      src/utils/http/detailhttp.ts
  89. 2 0
      src/utils/http/http.ts
  90. 78 0
      src/utils/http/index.ts
  91. 111 0
      src/utils/http/skuhttp.ts

+ 16 - 0
.hbuilderx/launch.json

@@ -0,0 +1,16 @@
1
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
2
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
3
+    "version": "0.0",
4
+    "configurations": [{
5
+     	"default" : 
6
+     	{
7
+     		"launchtype" : "local"
8
+     	},
9
+     	"mp-weixin" : 
10
+     	{
11
+     		"launchtype" : "local"
12
+     	},
13
+     	"type" : "uniCloud"
14
+     }
15
+    ]
16
+}

+ 1 - 0
components.d.ts

@@ -10,6 +10,7 @@ export {}
10 10
 declare module '@vue/runtime-core' {
11 11
   export interface GlobalComponents {
12 12
     CXBAuthorize: typeof import('./src/components/CXBAuthorize/CXBAuthorize.vue')['default']
13
+    CXBBackTop: typeof import('./src/components/CXBBackTop/CXBBackTop.vue')['default']
13 14
     CXBBanner: typeof import('./src/components/CXBBanner/CXBBanner.vue')['default']
14 15
     CXBBasePage: typeof import('./src/components/CXBBasePage/CXBBasePage.vue')['default']
15 16
     CXBButton: typeof import('./src/components/CXBButton/CXBButton.vue')['default']

+ 18 - 1
src/apis/auth.api.ts

@@ -1,5 +1,5 @@
1 1
 import {defHttp} from "~/utils/http";
2
-import type {LoginModel} from "~/apis/model/login.model";
2
+import type {AccountModel, LoginModel} from "~/apis/model/login.model";
3 3
 
4 4
 enum API {
5 5
     // 短信验证码
@@ -61,4 +61,21 @@ export function authSmsLogin(params: {
61 61
             ...params
62 62
         }
63 63
     })
64
+}
65
+
66
+/**
67
+ * 绑定提现账户
68
+ * 
69
+ */
70
+
71
+export function Accountbind(params: {
72
+    openid: string,
73
+    wx_type: string,
74
+}): Promise<AccountModel> {
75
+    return defHttp.post({
76
+        url: API.USER_EXTRACT_BAND_OPENID,
77
+        data: {
78
+            ...params
79
+        }
80
+    })
64 81
 }

+ 5 - 2
src/apis/merchant.ts

@@ -1,9 +1,12 @@
1
-import { defHttp } from '~/utils/http'
1
+import { defHttp} from '~/utils/http'
2 2
 import type {MerchantCategoryModel, MerchantDetailModel, StoreParams, StoreResult} from "~/apis/model/storeModel";
3 3
 import type {PageModel} from "~/apis/model/pageModel";
4 4
 import type {ZibubaojianResult} from "~/apis/model/zibubaojian.model";
5 5
 import type {VipAreaResult} from "~/apis/model/vip-area.model";
6 6
 
7
+import {detailHttp} from '~/utils/http'
8
+
9
+
7 10
 enum API {
8 11
     GET_SELECT_MERCHANT = '/gateway/wares_service/waresServiceMerchant/selectMerchant',
9 12
     GET_SELECT_MERCHANT_SORT = '/gateway/wares_service/waresServiceMerchant/selectMerchantSort',
@@ -79,7 +82,7 @@ export function getProductList(id: string,page=1,limit=10): Promise<ZibubaojianR
79 82
  * @param id
80 83
  */
81 84
 export function getProductDetail(id: string) {
82
-    return defHttp.get({
85
+    return detailHttp.get({
83 86
         url: API.GET_PRODUCT_DETAIL + `/${id}`,
84 87
     })
85 88
 }

+ 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//图片

+ 5 - 0
src/apis/model/login.model.ts

@@ -6,6 +6,11 @@ export interface LoginModel {
6 6
     // 用户信息
7 7
     user: LoginUserModel
8 8
 }
9
+export interface AccountModel {
10
+    
11
+    openid: string
12
+    wx_type: string
13
+}
9 14
 
10 15
 export interface LoginUserModel {
11 16
     uid: string//用户id

+ 10 - 0
src/apis/model/order.model.ts

@@ -275,6 +275,16 @@ export interface OrderCreateShoppingModel {
275 275
     cart_id: string
276 276
 }
277 277
 
278
+//
279
+export interface ProductSkustatusModel {
280
+   status:number
281
+   message:string
282
+}
283
+export interface ProductSkuModel {
284
+    cart_id: string,
285
+    unique : string
286
+}
287
+
278 288
 export interface OrderCheckModel {
279 289
     order_price: string
280 290
     total_price: string

+ 41 - 4
src/apis/model/product.model.ts

@@ -54,7 +54,7 @@ export interface IProductDetail {
54 54
     // 现价销售价格
55 55
     salePrice: number
56 56
     // 原价
57
-    price: number
57
+    price: string
58 58
     // 分销URL
59 59
     spreadUrl: string
60 60
     // 商品图
@@ -100,6 +100,12 @@ export interface HomeProduct {
100 100
         getEndTime: string
101 101
     }[]
102 102
 }
103
+//抖音商品状态+商品详情
104
+export interface DyProductDetailsModel{
105
+    status:number
106
+    message:string
107
+    data:DyProductDetailModel
108
+}
103 109
 
104 110
 /**
105 111
  * 抖音商品详情
@@ -268,7 +274,12 @@ export type PDDProductDetailModel = {
268 274
     yanglao: string//养老金
269 275
     pddlink: PddLink//链接
270 276
 }
271
-
277
+//附加状态
278
+export type  PDDProductDetailModels= {
279
+    message:string
280
+    status:number
281
+    data:PDDProductDetailModel
282
+}
272 283
 export type PddLink = {
273 284
     mobile_url: string
274 285
     url: string
@@ -319,6 +330,13 @@ export type VipProductModel = {
319 330
     price: string
320 331
 }
321 332
 
333
+//唯品会商品状态+商品详情
334
+export interface VipProductResults{
335
+    status:number
336
+    message:string
337
+    data:VipProductResult
338
+} 
339
+
322 340
 export interface VipProductResult {
323 341
     returnCode: string
324 342
     result: Array<VipProductDetailModel>
@@ -327,13 +345,16 @@ export interface VipProductResult {
327 345
     wphlink: WphlinkModel
328 346
 }
329 347
 
348
+
330 349
 export interface WphlinkModel {
331 350
     url: string
332 351
     longUrl: string
333 352
     ulUrl: string
334 353
     vipQuickAppUrl: string
335 354
 }
336
-
355
+/**
356
+ * 唯品会商品详情
357
+ */
337 358
 export interface VipProductDetailModel {
338 359
     // 商品原价
339 360
     marketPrice: string
@@ -414,6 +435,13 @@ export interface PrepayInfoModel {
414 435
     isPrepay: string
415 436
 }
416 437
 
438
+//苏宁商品状态+商品详情
439
+export interface SuNingProductDetailsModel {
440
+    status:number
441
+    data:SuNingProductDetailModel
442
+    message:string
443
+} 
444
+
417 445
 /**
418 446
  * 苏宁商品详情
419 447
  */
@@ -470,7 +498,11 @@ export type SuNingProductModel = {
470 498
  * 淘宝商品详情
471 499
  */
472 500
 export interface TaobaoProductDetailModel {
473
-    waresDetail: TaobaoWaresDetail
501
+    status:number
502
+    message:string
503
+    data: {
504
+        waresDetail:TaobaoWaresDetail
505
+    }
474 506
 }
475 507
 
476 508
 export interface TaobaoWaresDetail {
@@ -519,6 +551,11 @@ export type TaobaoProductThirdPartyWaresModel = {
519 551
     coupon_share_url: string
520 552
 }
521 553
 
554
+export interface JdgProductDetailModel{
555
+    status:number
556
+    message:string
557
+    data:JdProductDetailModel[]
558
+}
522 559
 export interface JdProductDetailModel {
523 560
     // 京东商品原标题
524 561
     goodsName: string

+ 1 - 1
src/apis/model/shopping.model.ts

@@ -1,5 +1,5 @@
1 1
 export interface ShoppingResult {
2
-    list: Array<ShopModel>
2
+    list?: Array<ShopModel>
3 3
 }
4 4
 
5 5
 export interface ShopModel {

+ 11 - 1
src/apis/model/userInfoModel.ts

@@ -7,10 +7,15 @@ export interface UpdateUserInfoRequestModel {
7 7
     avatar: string
8 8
     // addres: string
9 9
 }
10
-export interface UserInfoModel{
10
+export interface UserInfoModel {
11 11
     /** 用户id */
12 12
     uid: string
13 13
     /** 微信用户 id */
14
+    /** 市/县代理 */
15
+    area_manage_type: string
16
+    area_manage: manageModel
17
+    /**股东 id */
18
+    stockholder: number
14 19
     wechat_user_id: string
15 20
     /** 支付宝用户 id */
16 21
     ali_user_id: string
@@ -140,4 +145,9 @@ export interface UserInfoModel{
140 145
     /** 团队人数 */
141 146
     team_number: number
142 147
     is_bangfu: boolean
148
+}
149
+export interface manageModel {
150
+    area_name: []
151
+    code_list: string
152
+    type: string
143 153
 }

+ 19 - 4
src/apis/order.api.ts

@@ -1,8 +1,8 @@
1
-import {defHttp} from "~/utils/http"
1
+import {defHttp, detailHttp, skuhttp} from "~/utils/http"
2 2
 
3 3
 import type {
4 4
     IntegralOrderCreateModel, OrderCheckModel, OrderCreateModel,
5
-    OrderCreateShoppingModel, OrderListDataModel, OrderListObligationResult, OrderListResult, OrderQuantityModel
5
+    OrderCreateShoppingModel, ProductSkuModel, OrderListDataModel, OrderListObligationResult, OrderListResult, OrderQuantityModel, ProductSkustatusModel
6 6
 } from "~/apis/model/order.model"
7 7
 import type {ThirdOrderResult} from "~/apis/model/third-order.model";
8 8
 import type {CommentProductRequest} from "~/apis/model/comment-product";
@@ -33,6 +33,8 @@ enum API {
33 33
     ORDER_CHECK = '/api/order/check',
34 34
     // 修改购物车数量
35 35
     USER_CART_CHANGE = '/api/user/cart/change',
36
+    // 修改购物车商品的sku属性
37
+    CHANGE_PRODUCT_SKU = '/api/user/cart/changeUnique',
36 38
     // 创建订单 | 积分创建订单
37 39
     ORDER_CREATE = '/api/order/create',
38 40
     // 获取支付宝路径
@@ -75,7 +77,7 @@ enum API {
75 77
  * 申请退款
76 78
  */
77 79
 export function refundApply(id: string, request: RefundApplyRequest) {
78
-    return defHttp.post({
80
+    return detailHttp.post({
79 81
         url: API.REFUND_APPLY + `/${id}`,
80 82
         data: {
81 83
             ...request
@@ -206,6 +208,19 @@ export function createShopping(params: {
206 208
     })
207 209
 }
208 210
 
211
+/**
212
+ * 改变购物车商品sku
213
+ */
214
+export function changeProdoctSku(cart_id:string,unique:string): Promise<ProductSkustatusModel> {
215
+    console.log(unique,'order的api接收的unique')
216
+    console.log(cart_id,'order的api接收的unique')
217
+    return skuhttp.post({
218
+        url:API.CHANGE_PRODUCT_SKU + `/${cart_id}?`,
219
+        data:{
220
+            unique
221
+        }
222
+    })
223
+}
209 224
 
210 225
 /**
211 226
  * 选择订单商品
@@ -265,7 +280,7 @@ export function getIntegralOrderCreate(params: CreateOrderRequest): Promise<Inte
265 280
  */
266 281
 export function getOrderListFromStatus(params: {
267 282
     page: number
268
-    //   订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
283
+    //   订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付 6已取消
269 284
     status: number
270 285
     limit: number
271 286
 }): Promise<OrderListResult> {

+ 29 - 17
src/apis/product.ts

@@ -1,12 +1,13 @@
1
-import {defHttp} from "~/utils/http";
1
+import {defHttp, detailHttp} from "~/utils/http";
2 2
 import type {
3 3
     DyLiveModel, DyLiveProductModel, DyProductDetailModel,
4
+    DyProductDetailsModel,
4 5
     DyProductModel, JdProductDetailModel,
5
-    JdProductModel, PDDProductDetailModel, PDDProductModel, ProductDetailModel,
6
+    JdProductModel, JdgProductDetailModel, PDDProductDetailModel, PDDProductDetailModels, PDDProductModel, ProductDetailModel,
6 7
     ProductParams,
7 8
     SearchProductParams,
8
-    SearchProductResult, SuNingProductDetailModel, SuNingProductModel, TaobaoProductDetailModel,
9
-    TaobaoProductResult, VipProductModel, VipProductParams, VipProductResult
9
+    SearchProductResult, SuNingProductDetailModel, SuNingProductDetailsModel, SuNingProductModel, TaobaoProductDetailModel,
10
+    TaobaoProductResult, VipProductModel, VipProductParams, VipProductResult, VipProductResults
10 11
 } from "~/apis/model/product.model";
11 12
 import {resolveUnref} from "@vueuse/core";
12 13
 
@@ -52,7 +53,7 @@ enum API {
52 53
     // 拼多多商品列表
53 54
     PDD_LIST = '/api/pdd/list',
54 55
     // 拼多多商品搜索
55
-    PDD_SEARCH = '/api/pdd/search',
56
+    PDD_SEARCH = '/api/pdd/list',
56 57
     // 拼多多商品详情
57 58
     PDD_DETAIL = '/api/pdd/detail',
58 59
 
@@ -67,9 +68,20 @@ enum API {
67 68
     // 抖音商品列表搜索
68 69
     DY_SEARCH = '/api/dy/get_search',
69 70
     // 抖音商品详情
70
-    DY_DETAIL = '/api/dy/get_detail'
71
+    DY_DETAIL = '/api/dy/get_detail',
72
+    //大仓banner展示图片
73
+    DC_BANNER='/api/newhome/nologin/banner/da_cang'
71 74
 }
72 75
 
76
+
77
+/**获取大仓banner展示图片 */
78
+export function getBannerImg (){
79
+    return defHttp.get({
80
+        url:API.DC_BANNER
81
+    })
82
+}
83
+
84
+
73 85
 /**
74 86
  * 获取分享ID
75 87
  * @param params
@@ -123,8 +135,8 @@ export function searchProductList(params: SearchProductParams): Promise<SearchPr
123 135
  * 京东商品详情
124 136
  * @param skuId
125 137
  */
126
-export  function getJdProductDetail(skuId: string): Promise<Array<JdProductDetailModel>> {
127
-    return defHttp.get({
138
+export  function getJdProductDetail(skuId: string): Promise<JdgProductDetailModel> {
139
+    return detailHttp.get({
128 140
         url: API.JD_DETAIL,
129 141
         data: {
130 142
             skuId
@@ -187,8 +199,8 @@ export function searchVipProduct(params: ProductParams): Promise<Array<VipProduc
187 199
  * 唯品商品详情
188 200
  * @param params
189 201
  */
190
-export function getVipProductDetail(goodsId: string): Promise<VipProductResult> {
191
-    return defHttp.get({
202
+export function getVipProductDetail(goodsId: string): Promise<VipProductResults> {
203
+    return detailHttp.get({
192 204
         url: API.VIP_DETAIL,
193 205
         data: {
194 206
             goodsId
@@ -197,8 +209,8 @@ export function getVipProductDetail(goodsId: string): Promise<VipProductResult>
197 209
     })
198 210
 }
199 211
 
200
-export function getSuProductDetail(id: string): Promise<SuNingProductDetailModel> {
201
-    return defHttp.get({
212
+export function getSuProductDetail(id: string): Promise<SuNingProductDetailsModel> {
213
+    return detailHttp.get({
202 214
         url: `${API.SU_DETAIL}/${id}`,
203 215
 
204 216
     })
@@ -231,7 +243,7 @@ export function searchSuProduct(params: ProductParams): Promise<Array<SuNingProd
231 243
 }
232 244
 
233 245
 export function getTaobaoProductDetail(id: string): Promise<TaobaoProductDetailModel> {
234
-    return defHttp.post({
246
+    return detailHttp.post({
235 247
         url: API.TAOBAO_DETAIL,
236 248
         data: {
237 249
             id
@@ -276,8 +288,8 @@ export function getPddProductList(params: ProductParams): Promise<Array<PDDProdu
276 288
  * 拼多多商品详情
277 289
  * @param goodsId
278 290
  */
279
-export function getPddProductDetail(goodsId: string): Promise<PDDProductDetailModel> {
280
-    return defHttp.get({
291
+export function getPddProductDetail(goodsId: string): Promise<PDDProductDetailModels> {
292
+    return detailHttp.get({
281 293
         url: API.PDD_DETAIL,
282 294
         data: {
283 295
             goodsId
@@ -349,8 +361,8 @@ export function searchDyProduct(params: ProductParams):Promise<Array<DyProductMo
349 361
  * 抖音商品详情
350 362
  * @param goodsId
351 363
  */
352
-export function getDyProductDetail(goodsId: string): Promise<DyProductDetailModel> {
353
-    return defHttp.get({
364
+export function getDyProductDetail(goodsId: string): Promise<DyProductDetailsModel> {
365
+    return detailHttp.get({
354 366
         url: API.DY_DETAIL,
355 367
         data: {
356 368
             goodsId

+ 27 - 27
src/apis/user.ts

@@ -1,35 +1,35 @@
1
-import {defHttp} from '~/utils/http'
2
-import type {UserUnionParams, UserUnionResult} from "~/apis/model/userUnionModel";
1
+import { defHttp } from '~/utils/http'
2
+import type { UserUnionParams, UserUnionResult } from "~/apis/model/userUnionModel";
3 3
 import Cache from '~/utils/cache'
4
-import {EXPIRES_TIME, LOGIN_STATUS, STATE_R_KEY, USER_INFO} from "~/constants";
5
-import {useUserStore} from "~/stores/userStore";
6
-import type {YanglaoStatisticsResult} from "~/apis/model/yanglaoStatisticsModel";
7
-import type {UpdateUserInfoRequestModel, UserInfoModel} from "~/apis/model/userInfoModel";
8
-import type {InvitePartnerModel, UserInviteParams} from "~/apis/model/invitePartnerModel";
9
-import type {UserShareProductListModel, UserShareProductParams} from "~/apis/model/userShareProductModel";
10
-import type {RevenueSharingModel, RevenueSharingParams} from "~/apis/model/revenueSharingModel";
11
-import type {AccumulateIncomeModel, UserInviteProfitParams} from "~/apis/model/accumulateIncomeModel";
12
-import type {SpreadInfoModel} from "~/apis/model/spreadInfoModel";
13
-import type {WithdrawalParams, WithdrawalServiceModel} from "~/apis/model/withdrawalService";
14
-import type {UserYanglaoJinModel} from "~/apis/model/userYanglaoJinModel";
15
-import type {WithdrawalModel} from "~/apis/model/withdrawalModel";
16
-import type {MyRelationMerchantParams, MyRelationMerchantResult} from "~/apis/model/myRelationMerchantModel";
17
-import type {MyRelationProductPrams, MyRelationProductResult} from "~/apis/model/myRelationProductModel";
18
-import type {IntegralParams, IntegralResult} from "~/apis/model/integralModel";
4
+import { EXPIRES_TIME, LOGIN_STATUS, OPEN_ID, STATE_R_KEY, USER_INFO } from "~/constants";
5
+import { useUserStore } from "~/stores/userStore";
6
+import type { YanglaoStatisticsResult } from "~/apis/model/yanglaoStatisticsModel";
7
+import type { UpdateUserInfoRequestModel, UserInfoModel } from "~/apis/model/userInfoModel";
8
+import type { InvitePartnerModel, UserInviteParams } from "~/apis/model/invitePartnerModel";
9
+import type { UserShareProductListModel, UserShareProductParams } from "~/apis/model/userShareProductModel";
10
+import type { RevenueSharingModel, RevenueSharingParams } from "~/apis/model/revenueSharingModel";
11
+import type { AccumulateIncomeModel, UserInviteProfitParams } from "~/apis/model/accumulateIncomeModel";
12
+import type { SpreadInfoModel } from "~/apis/model/spreadInfoModel";
13
+import type { WithdrawalParams, WithdrawalServiceModel } from "~/apis/model/withdrawalService";
14
+import type { UserYanglaoJinModel } from "~/apis/model/userYanglaoJinModel";
15
+import type { WithdrawalModel } from "~/apis/model/withdrawalModel";
16
+import type { MyRelationMerchantParams, MyRelationMerchantResult } from "~/apis/model/myRelationMerchantModel";
17
+import type { MyRelationProductPrams, MyRelationProductResult } from "~/apis/model/myRelationProductModel";
18
+import type { IntegralParams, IntegralResult } from "~/apis/model/integralModel";
19 19
 import type {
20 20
     SharePosterClassifyResult,
21 21
     SharePosterImageResult,
22 22
     SharePostersImagesListParams,
23 23
 } from "~/apis/model/inviteFriendsModel";
24
-import type {ReplyParams, ReplyResult} from "~/apis/model/replyModel";
25
-import type {SignInInfoModel, SignInModel} from "~/apis/model/signIninfo.model";
26
-import type {ShoppingResult} from "~/apis/model/shopping.model";
27
-import type {AddressResult, OneAddressModel} from "~/apis/model/address.model";
28
-import type {UserVipInfoModel} from "~/apis/model/user-vip-info.model";
29
-import type {CertificationRequest} from "~/apis/model/certification.model";
30
-import type {RelationRequest} from "~/apis/model/relation.model";
31
-import type {YanglaoLogXsResult, YanglaoLogXxResult} from "~/apis/model/yanglao-log.model";
32
-import type {InvitePHPModel} from "~/apis/model/invite.model";
24
+import type { ReplyParams, ReplyResult } from "~/apis/model/replyModel";
25
+import type { SignInInfoModel, SignInModel } from "~/apis/model/signIninfo.model";
26
+import type { ShoppingResult } from "~/apis/model/shopping.model";
27
+import type { AddressResult, OneAddressModel } from "~/apis/model/address.model";
28
+import type { UserVipInfoModel } from "~/apis/model/user-vip-info.model";
29
+import type { CertificationRequest } from "~/apis/model/certification.model";
30
+import type { RelationRequest } from "~/apis/model/relation.model";
31
+import type { YanglaoLogXsResult, YanglaoLogXxResult } from "~/apis/model/yanglao-log.model";
32
+import type { InvitePHPModel } from "~/apis/model/invite.model";
33 33
 
34 34
 // 会员中心的提现
35 35
 // export function entropy(data) {
@@ -187,7 +187,7 @@ export function xcxBanding(params: { mer_id: string, share_id: string }) {
187 187
  * 生成用户图片
188 188
  * @param params
189 189
  */
190
-export function getGenerateImage(params: {uid: string, img_id: string}) {
190
+export function getGenerateImage(params: { uid: string, img_id: string }) {
191 191
     return defHttp.post({
192 192
         url: API.POSTER_SERVICE_IMAGES,
193 193
         data: {

+ 0 - 1
src/auto-imports.d.ts

@@ -96,7 +96,6 @@ declare global {
96 96
   const useCustomStyleProp: typeof import('./composables/useProps')['useCustomStyleProp']
97 97
   const useDacangStore: typeof import('./stores/dacangStore')['useDacangStore']
98 98
   const useDirectionProp: typeof import('./composables/useProps')['useDirectionProp']
99
-  const useOrderStore: typeof import('./stores/addressStore')['useOrderStore']
100 99
   const usePageStore: typeof import('./stores/page')['usePageStore']
101 100
   const usePageStoreWidthOut: typeof import('./stores/page')['usePageStoreWidthOut']
102 101
   const useSizeProp: typeof import('./composables/useProps')['useSizeProp']

+ 74 - 0
src/components/CXBBackTop/CXBBackTop.vue

@@ -0,0 +1,74 @@
1
+<template>
2
+<div v-show="flag" class="backtop1" v-if="isShow" >
3
+  <img @click="scrollToTop" class="backTopImg" src="../../static/icon/返回顶部@2x.png" alt="">
4
+</div>
5
+<div v-show="flag" class="backtop2" v-else >
6
+  <img @click="scrollToTop" class="backTopImg" src="../../static/icon/返回顶部@2x.png" alt="">
7
+</div>
8
+</template>
9
+
10
+<script setup lang='ts'>
11
+import { ref, reactive ,defineProps} from 'vue'
12
+
13
+let flag = ref(false)
14
+let isShow = ref(true)
15
+
16
+const props = defineProps({
17
+  Scroll_X: Number,
18
+  isCss:Number
19
+})
20
+
21
+watch(()=>props.Scroll_X,()=>{
22
+  if(props.Scroll_X as number > 400){
23
+    flag.value = true
24
+  }
25
+  if(props.Scroll_X as number < 400){
26
+    flag.value = false
27
+  }
28
+})
29
+watch(()=>props.isCss,()=>{
30
+  if(props.isCss as number ===1){
31
+    isShow.value = true
32
+  }
33
+  if(props.isCss as number ===2){
34
+    isShow.value = false
35
+  }
36
+},
37
+{immediate:true}
38
+)
39
+
40
+const scrollToTop = function () {
41
+  console.log('返回顶部');
42
+  
43
+    uni.pageScrollTo({
44
+        scrollTop: 0
45
+    });
46
+}
47
+
48
+</script>
49
+
50
+<style scoped>
51
+.backtop1{
52
+  width: 100rpx;
53
+  height: 100rpx;
54
+  position: fixed;
55
+  border-radius: 50%;
56
+  z-index: 999;
57
+  right: 1%;
58
+  bottom: 8%;
59
+}
60
+.backtop2{
61
+  width: 100rpx;
62
+  height: 100rpx;
63
+  position: fixed;
64
+  border-radius: 50%;
65
+  z-index: 999;
66
+  right: 1%;
67
+  bottom: 14%;
68
+}
69
+.backTopImg{
70
+  width: 100rpx;
71
+  height: 100rpx;
72
+  border-radius: 50%;
73
+}
74
+</style>

+ 15 - 13
src/components/CXBPhoneLoginButton/CXBPhoneLoginButton.vue

@@ -1,6 +1,6 @@
1 1
 <script lang="ts" setup>
2
-import {authAppletPhone, bindPhone, getUserUnionId} from "~/apis/user";
3
-import {useUserStore} from "~/stores/userStore";
2
+import { authAppletPhone, bindPhone, getUserUnionId } from "~/apis/user";
3
+import { useUserStore } from "~/stores/userStore";
4 4
 import Cache from "~/utils/cache";
5 5
 const userStore = useUserStore()
6 6
 const props = defineProps({
@@ -25,6 +25,10 @@ function getPhoneNumber(e) {
25 25
           code: result.code,
26 26
           source,
27 27
         }).then(unionRes => {
28
+          console.log(111111, unionRes)
29
+          // const shareId = Cache.get('SHARE_ID')
30
+          //存储openid
31
+          // userStore.setOpenid(unionRes.openid)
28 32
           // getShareId(shareI)
29 33
           const shareId = Cache.get('SHARE_ID')
30 34
 
@@ -37,7 +41,7 @@ function getPhoneNumber(e) {
37 41
             params.share_id = shareId
38 42
           }
39 43
 
40
-          let redirectPageObj: {page: string, type: 'page' | 'tab'}
44
+          let redirectPageObj: { page: string, type: 'page' | 'tab' }
41 45
           if (Cache.get('SHARE_REDIRECT_PAGE')) {
42 46
             redirectPageObj = JSON.parse(Cache.get('SHARE_REDIRECT_PAGE'))
43 47
           }
@@ -128,21 +132,18 @@ function getPhoneNumber(e) {
128 132
 }
129 133
 </script>
130 134
 <template>
131
-  <div class="bg-white border border-solid border-1 border-gray-300 rounded-md py-3 gap-2 flex justify-center items-center">
132
-    <image
133
-        src="https://test.bjtdba.com/applet/static/home/4879edf0b6e2b0ad29fa7d4053d676b.png" mode="widthFix"
134
-        class="w-4 h-4"
135
-    ></image>
136
-    <button
137
-        open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
138
-    >
135
+  <div
136
+    class="bg-white border border-solid border-1 border-gray-300 rounded-md py-3 gap-2 flex justify-center items-center">
137
+    <image src="https://test.bjtdba.com/applet/static/home/4879edf0b6e2b0ad29fa7d4053d676b.png" mode="widthFix"
138
+      class="w-4 h-4"></image>
139
+    <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
139 140
       {{ text }}
140 141
     </button>
141 142
   </div>
142 143
 </template>
143 144
 
144 145
 <style>
145
-button{
146
+button {
146 147
   margin: 0;
147 148
   padding: 0;
148 149
   outline: none;
@@ -150,7 +151,8 @@ button{
150 151
   background-color: transparent;
151 152
   line-height: inherit;
152 153
 }
153
-button::after{
154
+
155
+button::after {
154 156
   border: none;
155 157
 }
156 158
 </style>

+ 101 - 55
src/components/CXBSkuPopup/CXBSkuPopup.vue

@@ -1,14 +1,14 @@
1 1
 <script setup lang="ts">
2 2
 import FPopup from "~/components/FPopup/FPopup.vue";
3
-import {CANCEL_EVENT, CONFIRM_EVENT} from "~/constants/event";
3
+import { CANCEL_EVENT, CONFIRM_EVENT } from "~/constants/event";
4 4
 import FPrice from "~/components/FPrice/FPrice.vue";
5
-import {SkuModel} from "~/apis/model/product.model";
6
-import {computed} from "vue";
7
-import {PopupProps} from "~/components/FPopup";
8
-import {CLOSE_EVENT, OPEN_EVENT, UPDATE_SHOW_EVENT} from "~/components/constants";
5
+import { SkuModel } from "~/apis/model/product.model";
6
+import { computed } from "vue";
7
+import { PopupProps } from "~/components/FPopup";
8
+import { CLOSE_EVENT, OPEN_EVENT, UPDATE_SHOW_EVENT } from "~/components/constants";
9 9
 import CXBButton from "~/components/CXBButton/CXBButton.vue";
10 10
 import FButton from "~/components/FButton/FButton.vue";
11
-import {findLast} from "lodash-es";
11
+import { findLast } from "lodash-es";
12 12
 const emit = defineEmits()
13 13
 const props = defineProps({
14 14
   show: {
@@ -24,8 +24,15 @@ const props = defineProps({
24 24
     default: () => {
25 25
       return []
26 26
     }
27
+  },
28
+  isTo: {
29
+    type: Number,
30
+    required: true
27 31
   }
28 32
 })
33
+
34
+
35
+
29 36
 const show = ref(props.show || false)
30 37
 
31 38
 const showValue = computed<PopupProps['show']>({
@@ -47,6 +54,7 @@ const onConfirm = () => {
47 54
   emit(CONFIRM_EVENT)
48 55
 }
49 56
 
57
+
50 58
 const onCancel = () => {
51 59
   // show.value = false
52 60
   showValue.value = false
@@ -78,8 +86,12 @@ onMounted(() => {
78 86
 
79 87
 })
80 88
 
81
-function handleSelectedSku(skuItem) {
89
+function handleSelectedSku(skuItem: any) {
90
+  console.log(skuItem);
91
+
82 92
   currentSku.value = skuItem
93
+  console.log('我是数据', currentSku.value);
94
+
83 95
   emit('selected:item', currentSku)
84 96
 }
85 97
 function handleClose() {
@@ -91,9 +103,15 @@ function handleClose() {
91 103
 function handleAddCart() {
92 104
   emit('submit')
93 105
 }
94
-// function handleSelectedSku(item) {
95
-//
96
-// }
106
+function handleBuyNow() {
107
+  emit('subBuy')
108
+}
109
+function handleJiaCart() {
110
+  emit('subAdd')
111
+}
112
+function handleSubQg() {
113
+  emit('subQg')
114
+}
97 115
 
98 116
 function handleCountChange(value) {
99 117
   emit('count-change', value)
@@ -102,99 +120,127 @@ function handleCountChange(value) {
102 120
 </script>
103 121
 
104 122
 <template>
105
-  <FPopup
106
-      v-model:show="showValue"
107
-      @close="onCancel"
108
-      position="bottom"
109
-      exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe min-h-[70%] max-h-[80%] h-full"
110
-
111
-  >
123
+  <FPopup v-model:show="showValue" @close="onCancel" position="bottom"
124
+    exClass="rounded-rt-xl rounded-lt-xl flex flex-col pb-safe min-h-[70%] max-h-[80%] h-full">
112 125
     <div class="flex flex-col justify-between h-full">
113 126
       <div class="flex-1">
114 127
         <div class="p-3 flex flex-col gap-3">
115 128
           <div class="flex flex-row gap-3">
116
-            <image :src="detail.image"
117
-                   v-if="currentSku"
118
-                   mode="aspectFit" class="w-25 h-25 rounded"></image>
129
+            <image :src="currentSku.image" v-if="currentSku" mode="aspectFit" class="w-25 h-25 rounded"></image>
119 130
             <div class="flex flex-col w-full">
120 131
 
121 132
               <div class="flex gap-2 justify-between w-full">
122 133
                 <div class="text-overflow text-xs flex-1 line-clamp-2 h-fit" v-if="detail && detail.store_name">
123 134
                   {{ detail.store_name }}
124 135
                 </div>
125
-                <div
126
-                    @tap="handleClose"
127
-                    class="i-tabler-x w-5 h-5 text-gray-500"></div>
136
+                <div @tap="handleClose" class="i-tabler-x w-5 h-5 text-gray-500"></div>
128 137
               </div>
129 138
 
130 139
 
131 140
               <div class="flex flex-col" v-if="currentSku">
132 141
                 <div class="text-[12px] text-right text-gray-500 ">
133
-                  剩余库存{{currentSku.stock}}
142
+                  剩余库存{{ currentSku.stock }}
134 143
                 </div>
135 144
                 <div class="flex items-end gap-2" v-if="detail.mer_id === '148'">
136 145
                   {{ (currentSku.price * 30).toFixed(2) }} 积分
137 146
                 </div>
138 147
                 <div class="flex items-end gap-2" v-else>
148
+<<<<<<< HEAD
139 149
                   <FPrice :price="detail.dc_price" v-if="detail.seckill == 1"/>
140 150
 
141 151
                   <FPrice :price="currentSku.price" v-else/>
142 152
                   <FPrice v-if="currentSku.ot_price" :price="currentSku.ot_price" :ex-class="'!text-black text-xs font-bold'" need-symbol strike-through/>
153
+=======
154
+                  <FPrice :price="currentSku.price" />
155
+                  <FPrice v-if="currentSku.ot_price" :price="currentSku.ot_price"
156
+                    :ex-class="'!text-black text-xs font-bold'" need-symbol strike-through />
157
+>>>>>>> li-yi
143 158
                 </div>
144 159
               </div>
145 160
 
146 161
             </div>
147 162
           </div>
148 163
 
149
-<!--          <template v-if="skuList && skuList.length > 0"></template>-->
150
-<!--          <scroll-view-->
151
-<!--              :scroll-y="true"-->
152
-<!--              class="h-20"-->
153
-<!--          >-->
154
-
155
-            <div class="text-xs flex" v-if="skuList && skuList.length > 0">规格</div>
156
-            <div class="flex flex-row gap-2  flex-wrap ">
157
-              <div
158
-                  v-for="(item, index) in skuList"
159
-                  :key="index"
160
-                  @tap="handleSelectedSku(item)"
161
-
162
-              >
163
-                <div
164
-                    v-if="item.sku && item.sku !== ''"
165
-                    class="text-[11px] border border-solid rounded p-1 px-1 "
166
-                    :class="currentSku.unique === item.unique ? 'border-primary text-primary' : 'border-gray-500 text-gray-500'"
167
-                >
168
-                  {{ item.sku }}
164
+          <!--          <template v-if="skuList && skuList.length > 0"></template>-->
165
+          <!--          <scroll-view-->
166
+          <!--              :scroll-y="true"-->
167
+          <!--              class="h-20"-->
168
+          <!--          >-->
169
+
170
+          <div class="text-xs flex" v-if="skuList && skuList.length > 0">规格</div>
171
+          <div class="flex flex-row gap-2  flex-wrap ">
172
+            <div v-for="(item, index) in skuList" :key="index" @tap="handleSelectedSku(item)">
173
+              <div v-if="item.sku && item.sku !== ''" class="text-[11px] border border-solid rounded p-1 px-1 "
174
+                :class="currentSku.unique === item.unique ? 'border-primary text-primary' : 'border-gray-500 text-gray-500'">
175
+                {{ item.sku }}
169 176
 
170
-                </div>
171 177
               </div>
178
+
179
+
180
+
172 181
             </div>
182
+          </div>
173 183
 
174
-<!--          </scroll-view>-->
184
+          <!--          </scroll-view>-->
175 185
         </div>
176 186
         <div class="p-3">
177 187
           <div class="flex  justify-between text-sm">
178 188
             数量
179
-            <nut-input-number v-model="count" @change="handleCountChange"/>
189
+            <nut-input-number v-model="count" @change="handleCountChange" />
180 190
           </div>
181 191
 
182 192
 
183 193
         </div>
184 194
       </div>
185 195
 
186
-      <div class="px-3 pb-10">
187
-        <FButton
188
-            @click="handleAddCart"
189
-            size="small"
190
-            :exClass="['!bg-primary', 'rounded-full', 'text-white']"
191
-            block
192
-        >
196
+      <div class="px-3 pb-10" v-if="isTo == 1">
197
+        <FButton @click="handleAddCart" size="small" :exClass="['!bg-primary', 'rounded-full', 'text-white']" block>
193 198
           确定
194 199
         </FButton>
195 200
 
196 201
       </div>
202
+      <div class="px-3 pb-10" v-if="isTo == 4">
203
+        <FButton @click="handleSubQg" size="small" :exClass="['!bg-primary', 'rounded-full', 'text-white']" block>
204
+          立即抢购
205
+        </FButton>
206
+
207
+      </div>
208
+      <div class="px-3 pb-10" v-if="isTo == 5">
209
+        <FButton @click="handleAddCart" size="small" :exClass="['!bg-primary', 'rounded-full', 'text-white']" block>
210
+          立即抢购
211
+        </FButton>
212
+
213
+      </div>
214
+      <div class="px-3 pb-10" v-if="isTo == 3">
215
+        <FButton @click="handleAddCart" size="small" :exClass="['!bg-primary', 'rounded-full', 'text-white']" block>
216
+          立即兑换
217
+        </FButton>
218
+
219
+      </div>
220
+      <div class="flex box_1 flex-row justify-between text-sm text-white gap-3 " v-if="isTo == 2">
221
+        <button @click="handleJiaCart" size="small"
222
+          class="bg-[#FFA319] rounded-full w-60 flex justify-center items-center h-9 clor">
223
+          加入购物车
224
+        </button>
225
+        <button @click="handleBuyNow" size="small"
226
+          class="bg-[#F94032] rounded-full w-60 flex justify-center items-center h-9 clor ">
227
+          立即购买
228
+        </button>
229
+
230
+      </div>
197 231
     </div>
198 232
 
199 233
   </FPopup>
200
-</template>
234
+</template>
235
+<style scoped>
236
+.box_1 {
237
+  padding-top: 10rpx;
238
+  padding-bottom: 30rpx;
239
+  border-top: 1px solid rgba(182, 185, 192, 50%);
240
+}
241
+
242
+.clor {
243
+  color: aliceblue;
244
+  font-size: 28rpx;
245
+}
246
+</style>

+ 2 - 0
src/components/FButton/FButton.vue

@@ -6,6 +6,8 @@ const props = defineProps(buttonProps)
6 6
 const emit = defineEmits(buttonEmits)
7 7
 
8 8
 const { disabled, clickHandler } = useButton(props, emit)
9
+
10
+
9 11
 </script>
10 12
 
11 13
 <template>

+ 6 - 1
src/components/FCell/FCell.vue

@@ -4,7 +4,12 @@ import { useCell } from './use-cell'
4 4
 
5 5
 const props = defineProps(cellProps)
6 6
 const emit = defineEmits(cellEmits)
7
-
7
+onLoad(
8
+  (options)=>{
9
+    // console.log('我是点击options',options);
10
+    
11
+  }
12
+)
8 13
 const { arrow, classes, clickHandler } = useCell(props, emit)
9 14
 </script>
10 15
 

+ 1 - 0
src/components/FNavBar/FNavBar.vue

@@ -4,6 +4,7 @@ import { useNavBar } from './use-nav-bar'
4 4
 
5 5
 const props = defineProps(navBarProps)
6 6
 const emit = defineEmits(navBarEmits)
7
+console.log('props',props);
7 8
 
8 9
 const {
9 10
   navBarRef,

+ 4 - 1
src/components/FPopup/FPopup.vue

@@ -7,7 +7,10 @@ import { usePopup } from './use-popup'
7 7
 const props = defineProps(popupProps)
8 8
 const emit = defineEmits(popupEmits)
9 9
 const { showValue, classes } = usePopup(props, emit)
10
-
10
+onLoad(()=>{
11
+  // console.log(showValue, classes);
12
+  
13
+})
11 14
 const animationName = {
12 15
   center: 'fade',
13 16
   top: 'slide-down',

+ 5 - 1
src/components/FSearch/FSearch.vue

@@ -41,7 +41,7 @@ function handleClick() {
41 41
                  class="w-5 h-5  pl-2 py-1"
42 42
           ></image>
43 43
         <div class="flex flex-1 w-100%">
44
-          <div class="flex-1"></div>
44
+          <div class="flex-1  "></div>
45 45
           <div
46 46
               class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center p-1.5  mr-0.5 "
47 47
           >
@@ -53,3 +53,7 @@ function handleClick() {
53 53
       </div>
54 54
 
55 55
 </template>
56
+<style scoped>
57
+
58
+
59
+</style>

+ 3 - 2
src/config/app.ts

@@ -5,12 +5,13 @@ 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'
13 13
 export const CDN_URL = 'https://cdn.bjtdba.com/chuxubao'
14
+export const CDM_URL = 'https://cdn.bjtdba.com/vod'
14 15
 
15 16
 // 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
16 17
 let wsApi = ''

+ 3 - 0
src/constants/index.ts

@@ -9,6 +9,9 @@ export const  LOGIN_STATUS = 'LOGIN_STATUS_TOKEN'
9 9
     // uid
10 10
 export const UID = 'UID'
11 11
 export const USER_INFO = 'USER_INFO'
12
+export const  OPEN_ID= 'OPEN_ID'
13
+export const SHARE_REDIRECT_PAGE = 'SHARE_REDIRECT_PAGE'
14
+
12 15
     //token 过期时间
13 16
 export const  EXPIRES_TIME = 'EXPIRES_TIME'
14 17
     //�Ƿ���Ȩ

+ 10 - 10
src/manifest.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
     "name" : "储蓄保",
3
-    "appid" : "__UNI__BCDA501",
3
+    "appid" : "__UNI__26118FF",
4 4
     "description" : "",
5 5
     "versionName" : "1.0.0",
6 6
     "versionCode" : "100",
@@ -50,22 +50,22 @@
50 50
     "quickapp" : {},
51 51
     /* 小程序特有相关 */
52 52
     "mp-weixin" : {
53
-        "__usePrivacyCheck__": true, //隐私政策
53
+        "__usePrivacyCheck__" : true, //隐私政策
54 54
         "appid" : "wxfb755febdb800f23",
55 55
         "setting" : {
56 56
             "urlCheck" : false
57 57
         },
58 58
         "usingComponents" : true,
59 59
         "permission" : {
60
-            "scope.userLocation": {
61
-                "desc": "你的位置信息将用于小程序位置接口的效果展示"
60
+            "scope.userLocation" : {
61
+                "desc" : "你的位置信息将用于小程序位置接口的效果展示"
62 62
             },
63
-            "scope.userFuzzyLocation": {
64
-                "desc": "你的位置信息将用于小程序位置接口的效果展示"
63
+            "scope.userFuzzyLocation" : {
64
+                "desc" : "你的位置信息将用于小程序位置接口的效果展示"
65 65
             }
66 66
         },
67
-        "lazyCodeLoading": "requiredComponents",
68
-        "requiredPrivateInfos": [
67
+        "lazyCodeLoading" : "requiredComponents",
68
+        "requiredPrivateInfos" : [
69 69
             "chooseAddress",
70 70
             "chooseLocation",
71 71
             "choosePoi",
@@ -84,8 +84,8 @@
84 84
     "mp-toutiao" : {
85 85
         "usingComponents" : true
86 86
     },
87
-    "uniStatistics": {
88
-        "enable": false
87
+    "uniStatistics" : {
88
+        "enable" : false
89 89
     },
90 90
     "vueVersion" : "3"
91 91
 }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5 - 1
src/pages.json


+ 3 - 1
src/pages/after-sales-order-list/index.vue

@@ -109,13 +109,15 @@ function loadAllOrderList() {
109 109
     page: 1,
110 110
     limit: 10
111 111
   }).then(res => {
112
-    // console.log(res)
112
+    console.log('更新列表',res)
113 113
     state.allOrderTotal = res.total
114 114
     state.allOrderList = res.list
115 115
     // console.log(res)
116 116
   })
117 117
 }
118 118
 watch(() => state.tabvalue, (val) => {
119
+  console.log('我是val',val);
120
+  
119 121
   switch (val) {
120 122
     case '0': {
121 123
       loadAllOrderList()

+ 151 - 66
src/pages/annuity/index.vue

@@ -1,9 +1,18 @@
1 1
 <script setup lang="ts">
2
-import {getAmountFromGzc, getYanglaojinStatistics} from "~/apis/user";
3
-import {CDN_URL} from "~/config/app";
2
+import { getAmountFromGzc, getYanglaojinStatistics, getUserYangLaoJin } from "~/apis/user";
3
+import { CDN_URL, CDM_URL } from "~/config/app";
4
+import dayjs from "dayjs";
5
+
4 6
 const get_to_know_buttons_220713Image = CDN_URL + '/static/assets/get_to_know_buttons_220713.png'
5 7
 const ylj_fh_220914Image = CDN_URL + '/static/assets/ylj_fh_220914.png'
6 8
 
9
+
10
+const annuity_yuan_220713Image = CDN_URL + '/static/assets/annuity_yuan_220713.png'
11
+const agreement_checkedImage = CDN_URL + '/static/assets/agreement_checked.png'
12
+const yrzImg = CDM_URL + '/image/2023-12-04/20231204124659874.png'
13
+const smrzImg = CDM_URL + '/image/2023-12-04/20231204124635512.png'
14
+
15
+
7 16
 const userStore = useUserStore()
8 17
 const progress = [{
9 18
   type: 'item',
@@ -18,24 +27,24 @@ const progress = [{
18 27
   title: '绑定微信支付宝',
19 28
   icon: CDN_URL + '/static/assets/ylj_bd_220914.png'
20 29
 },
21
-  {
22
-    type: 'separator',
23
-    icon: CDN_URL + '/static/assets/ylj_fh_220914.png'
24
-  }, {
25
-    type: 'item',
26
-
27
-    title: '平台结算',
28
-    icon: CDN_URL + '/static/assets/ylj_js_220914.png'
29
-  },
30
-  {
31
-    type: 'separator',
32
-    icon: CDN_URL + '/static/assets/ylj_fh_220914.png'
33
-  }, {
34
-    type: 'item',
35
-
36
-    title: '计入账号开通',
37
-    icon: CDN_URL + '/static/assets/ylj_kt_220914.png'
38
-  }]
30
+{
31
+  type: 'separator',
32
+  icon: CDN_URL + '/static/assets/ylj_fh_220914.png'
33
+}, {
34
+  type: 'item',
35
+
36
+  title: '平台结算',
37
+  icon: CDN_URL + '/static/assets/ylj_js_220914.png'
38
+},
39
+{
40
+  type: 'separator',
41
+  icon: CDN_URL + '/static/assets/ylj_fh_220914.png'
42
+}, {
43
+  type: 'item',
44
+
45
+  title: '计入账号开通',
46
+  icon: CDN_URL + '/static/assets/ylj_kt_220914.png'
47
+}]
39 48
 
40 49
 const state = reactive({
41 50
   all_yanglao: 0,
@@ -44,11 +53,13 @@ const state = reactive({
44 53
     amount: 0
45 54
   }
46 55
 })
56
+const userYangLaoJin = ref({})
47 57
 
48 58
 const yanglaoStatistics = ref()
49 59
 onLoad(() => {
50 60
   getYanglaojinStatistics().then(res => {
51 61
     // state.all_yanglao = res.all_yanglao
62
+
52 63
     yanglaoStatistics.value = res
53 64
   }).catch(error => {
54 65
     if (error === '未登录') {
@@ -61,7 +72,45 @@ onLoad(() => {
61 72
   getAmountFromGzc().then(res => {
62 73
     state.amountFromGzc = res
63 74
   })
75
+  //养老金账户
76
+  console.log('页面显示了');
77
+  getUserYangLaoJin().then(res => {
78
+    console.log('养老保险', res);
79
+
80
+    if (res.birthday60 === "未实名认证") {
81
+      console.log('触发条件');
82
+
83
+      setTimeout(() => {
84
+        uni.showModal({
85
+          title: '温馨提示',
86
+          content: '实名认证后才可查看获得的养老金哦~',
87
+          cancelText: "取消", // 取消按钮的文字
88
+          confirmText: "去认证", // 确认按钮的文字
89
+          showCancel: true, // 是否显示取消按钮,默认为 true
90
+          confirmColor: '#f55850',
91
+          success: (res) => {
92
+            if (res.confirm) {
93
+              console.log('comfirm') //点击确定之后执行的代码
94
+              setTimeout(() => {
95
+                uni.navigateTo({
96
+                  url: '/pages/real-name-authentication/index'
97
+                })
98
+              }, 300);
99
+            } else {
100
+              console.log('cancel') //点击取消之后执行的代码
101
+            }
102
+          }
103
+        })
104
+      }, 300);
105
+    }
106
+    userYangLaoJin.value = res;
107
+  })
64 108
 })
109
+
110
+onShow(() => {
111
+
112
+})
113
+
65 114
 function handleThirdBind() {
66 115
   uni.navigateTo({
67 116
     url: '/pages/third_party_binding/index'
@@ -106,6 +155,22 @@ function handleShowAgreement(type) {
106 155
     url: '/pages/webview/agreement?type=' + type
107 156
   })
108 157
 }
158
+
159
+//展示图片
160
+const ImgType = computed(() => {
161
+  if (userStore.userInfo?.is_ertification) {
162
+    const img = userStore.userInfo.is_ertification
163
+    if (img == 1) {
164
+      return yrzImg
165
+    } else {
166
+      return smrzImg
167
+    }
168
+
169
+  }
170
+
171
+})
172
+
173
+
109 174
 </script>
110 175
 
111 176
 <template>
@@ -118,48 +183,37 @@ function handleShowAgreement(type) {
118 183
       </div>
119 184
       <div class="flex flex-col bg-white rounded  p-4">
120 185
         <div class="flex items-center w-full gap-2">
121
-          <image v-if="userStore.userInfo && userStore.userInfo.avatar"
122
-                 :src="userStore.userInfo.avatar"
123
-                 mode="widthFix"
124
-                 class="w-9 h-9 rounded-full"
125
-          />
126
-          <image
127
-              v-else
128
-              src="https://app.bjtdba.com/uploads/logo.jpg"
129
-              mode="widthFix"
130
-              class="w-9 h-9 rounded-full"
131
-          />
186
+          <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar" mode="widthFix"
187
+            class="w-9 h-9 rounded-full" />
188
+          <image v-else src="https://app.bjtdba.com/uploads/logo.jpg" mode="widthFix" class="w-9 h-9 rounded-full" />
132 189
           <div>
133 190
             {{ userStore.userInfo.nickname }}
134 191
           </div>
135
-          <div
136
-              @tap="handleRealName"
137
-              class="text-xs underline text-[#fe0032]"
138
-          >
139
-            {{userStore.userInfo.is_ertification == 1 ? '已认证' : '实名认证'}}
140
-
192
+          <div @tap="handleRealName" class="box_img">
193
+            <!-- {{ userStore.userInfo.is_ertification == 1 ? '已认证' : '实名认证' }} -->
194
+            <image lazy-load :src="ImgType" class="w-full h-full"></image>
141 195
           </div>
142 196
         </div>
143 197
         <div class="flex-1 flex flex-col justify-between items-center py-4 gap-4">
144 198
           <div class="flex flex-col justify-center items-center">
145 199
             <div class="text-xs">总养老金</div>
146
-            <div class="text-[#F94032] font-bold text-[28px]" v-if="yanglaoStatistics">¥{{yanglaoStatistics.all_yanglao}}</div>
200
+            <div class="text-[#F94032] font-bold text-[28px]" v-if="yanglaoStatistics">¥{{ yanglaoStatistics.all_yanglao
201
+            }}
202
+            </div>
147 203
           </div>
148 204
           <div class=" flex justify-around w-full">
149 205
             <div class="flex flex-col justify-center items-center " v-if="yanglaoStatistics">
150 206
               <div class="font-bold">
151
-                ¥ {{(yanglaoStatistics.all_yanglao - yanglaoStatistics.all_yanglao_a).toFixed(2)}}
207
+                ¥ {{ (yanglaoStatistics.all_yanglao - yanglaoStatistics.all_yanglao_a).toFixed(2) }}
152 208
               </div>
153 209
               <div class="text-xs text-gray-400">预估养老金</div>
154 210
             </div>
155 211
 
156 212
             <div class="flex flex-col justify-center items-center pl-3" v-if="yanglaoStatistics">
157
-              <div>¥ {{yanglaoStatistics.all_yanglao_a}}</div>
213
+              <div>¥ {{ (yanglaoStatistics.all_yanglao_a).toFixed(2) }}</div>
158 214
               <div class="text-xs text-gray-400">已结算</div>
159 215
             </div>
160
-            <div
161
-                @tap="handleToCitic"
162
-                class="flex flex-col justify-center items-center pl-3">
216
+            <div @tap="handleToCitic" class="flex flex-col justify-center items-center pl-3">
163 217
               <div>¥{{ state.amountFromGzc.amount }}</div>
164 218
               <div class="text-xs text-gray-400">中信公证处</div>
165 219
             </div>
@@ -173,47 +227,73 @@ function handleShowAgreement(type) {
173 227
         <div>养老金账号开通流程</div>
174 228
         <div class="flex flex-row justify-center items-center w-full h-full">
175 229
           <div v-for="(item, index) in progress" :key="index" class="flex flex-1 justify-center">
176
-            <div
177
-                v-if="item.type === 'item'"
178
-                class="flex flex-col justify-between items-center w-12 text-center ">
230
+            <div v-if="item.type === 'item'" class="flex flex-col justify-between items-center w-12 text-center ">
179 231
               <image :src="item.icon" mode="widthFix" class="w-10 h-10"></image>
180 232
               <div class="text-xs h-8 flex flex-col justify-center items-center">{{ item.title }}</div>
181 233
             </div>
182
-            <div
183
-                v-if="item.type === 'separator'"
184
-                class="flex flex-col justify-start items-start h-10"
185
-            >
186
-              <image
187
-                  :src="ylj_fh_220914Image" mode="widthFix" class="w-2 h-2"></image>
234
+            <div v-if="item.type === 'separator'" class="flex flex-col justify-start items-start h-10">
235
+              <image :src="ylj_fh_220914Image" mode="widthFix" class="w-2 h-2"></image>
188 236
             </div>
189 237
 
190 238
           </div>
191 239
 
192 240
         </div>
193 241
       </div>
242
+      <!-- 养老金账户 -->
243
+      <div class="flex flex-col bg-white rounded p-4 text-sm gap-3">
244
+        <div>养老金账号余额提取</div>
245
+
246
+        <div class="relative">
247
+          <div class="absolute top-0 left-0 mt-2 w-full  ">
248
+            <div class="px-9">
249
+              <div class="py-px bg-red"></div>
250
+            </div>
251
+          </div>
252
+          <div class="relative flex items-center justify-between">
253
+            <div class="text-center">
254
+              <div class="inline-block  rounded-full bg-white">
255
+                <image :src="annuity_yuan_220713Image" mode="widthFix" class="w-4 h-4"></image>
256
+              </div>
257
+              <div class="block mt-3">
258
+                <div>加入时间</div>
259
+                <div class="text-gray">
260
+                  {{ userYangLaoJin.create_time && dayjs(userYangLaoJin.create_time).format('YYYY-MM-DD') }}
261
+                </div>
262
+              </div>
263
+            </div>
264
+            <div class="text-center">
265
+              <div class="inline-block rounded-full bg-white">
266
+                <image :src="agreement_checkedImage" mode="widthFix" class="w-4 h-4"></image>
267
+              </div>
268
+              <div class="block mt-3">
269
+                <div>法定提取时间</div>
270
+                <div class="text-gray">
271
+                  {{ userYangLaoJin.birthday60 }}
272
+                </div>
273
+              </div>
274
+            </div>
275
+
276
+          </div>
277
+        </div>
278
+      </div>
194 279
 
195 280
       <div class="flex flex-col bg-white rounded text-sm px-3">
196
-        <div
197
-            @tap="handleThirdBind"
198
-            class="flex justify-between items-center border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b py-3">
281
+        <!-- <div @tap="handleThirdBind"
282
+          class="flex justify-between items-center border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b py-3">
199 283
           <div>支付平台绑定</div>
200 284
           <image :src="ylj_fh_220914Image" mode="widthFix" class="w-2 h-2"></image>
201
-        </div>
202
-        <div
203
-            @tap="handlePensionAccount"
204
-            class="flex justify-between items-center border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b py-3">
285
+        </div> -->
286
+        <!-- <div @tap="handlePensionAccount"
287
+          class="flex justify-between items-center border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b py-3">
205 288
           <div>养老金账户</div>
206 289
           <image :src="ylj_fh_220914Image" mode="widthFix" class="w-2 h-2"></image>
207
-        </div>
208
-        <div
209
-            @tap="handlePensionRecord"
210
-            class="flex justify-between items-center border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b py-3">
290
+        </div> -->
291
+        <div @tap="handlePensionRecord"
292
+          class="flex justify-between items-center border border-solid border-1 border-gray-100 border-x-0 border-t-0 !border-b py-3">
211 293
           <div>养老金记录</div>
212 294
           <image :src="ylj_fh_220914Image" mode="widthFix" class="w-2 h-2"></image>
213 295
         </div>
214
-        <div
215
-            @tap="handleToCitic"
216
-            class="flex justify-between items-center py-3">
296
+        <div @tap="handleToCitic" class="flex justify-between items-center py-3">
217 297
           <div>中信公证处查看</div>
218 298
           <image :src="ylj_fh_220914Image" mode="widthFix" class="w-2 h-2"></image>
219 299
         </div>
@@ -234,6 +314,11 @@ function handleShowAgreement(type) {
234 314
 page {
235 315
   background: #f8f8f8;
236 316
 }
317
+
318
+.box_img {
319
+  width: 144rpx;
320
+  height: 50rpx;
321
+}
237 322
 </style>
238 323
 <route lang="yaml">
239 324
 style:

+ 4 - 0
src/pages/article/detail.vue

@@ -7,7 +7,11 @@ const article: Ref<ArticleModel | undefined> = ref<ArticleModel>()
7 7
 onLoad((option: any) => {
8 8
   if (option.article_id) {
9 9
     getArticleDetail(option.article_id).then(res => {
10
+<<<<<<< HEAD
10 11
       // console.log(res)
12
+=======
13
+      console.log('~~~~~~~~',res)
14
+>>>>>>> li-yi
11 15
       uni.setNavigationBarTitle({
12 16
         title: res.title
13 17
       })

+ 28 - 27
src/pages/dacang/list/components/dacang-header.vue

@@ -1,9 +1,9 @@
1 1
 <script lang="ts" setup>
2
-import {computed, PropType} from "vue";
2
+import { computed, PropType } from "vue";
3 3
 import FSearch from "~/components/FSearch/FSearch.vue";
4
-import type {UserInfoModel} from "~/apis/model/userInfoModel";
5
-import {useUserStore} from "~/stores/userStore";
6
-import {useDacangStore} from "~/stores/dacangStore";
4
+import type { UserInfoModel } from "~/apis/model/userInfoModel";
5
+import { useUserStore } from "~/stores/userStore";
6
+import { useDacangStore } from "~/stores/dacangStore";
7 7
 // import {useUserStore} from "~/stores/userStore";
8 8
 const userStore = useUserStore()
9 9
 const dacangStore = useDacangStore()
@@ -74,7 +74,7 @@ function handleClick() {
74 74
 //
75 75
 // }
76 76
 const emit = defineEmits<{
77
-  (e: 'click:item', value:string): void
77
+  (e: 'click:item', value: string): void
78 78
 }>()
79 79
 function handleTabItemClick(currentTab) {
80 80
   emit('click:item', tabValue.value)
@@ -86,19 +86,15 @@ function handleShowSearchPage() {
86 86
 }
87 87
 </script>
88 88
 <template>
89
-  <div class="dacang-header fixed w-screen text-white z-10 w-full h-20"
90
-       :style="navBarStyle"
91
-       :class="exClass"
92
-  >
89
+  <div class="dacang-header fixed w-screen text-white z-10 w-full h-20" :style="navBarStyle" :class="exClass">
93 90
     <div class="pl-2 pt-2">
94
-      <div class="w-60% bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red">
91
+      <div
92
+        class="w-60% bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red">
95 93
 
96
-        <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png"
97
-               mode="widthFix"
98
-               class="w-4 h-4  pl-2 py-1"
99
-        ></image>
94
+        <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png" mode="widthFix"
95
+          class="w-4 h-4  pl-2 py-1"></image>
100 96
         <div class="flex flex-1 items-center w-100%" @tap.stop="handleShowSearchPage">
101
-          <div class="flex-1 pl-2 text-gray">搜索商品关键词</div>
97
+          <div class="flex-1 pl-2  font_size ">搜索商品关键词</div>
102 98
           <div class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center py-1 my-0.5 mr-0.5 ">
103 99
             搜索
104 100
           </div>
@@ -109,19 +105,17 @@ function handleShowSearchPage() {
109 105
 
110 106
     </div>
111 107
 
112
-<!--    <div class="p-3">-->
113
-      <div class=" ">
114
-       <nut-tabs v-model="tabValue" title-scroll title-gutter="10" name="catePanel" @change="handleTabItemClick">
115
-<!--         <nut-tab-panel :title="全部"></nut-tab-panel>-->
116
-          <nut-tab-pane v-for="item in tabs" :title="item.cate_name"
117
-                        :pane-key="item.store_category_id"
118
-                        :key="item.store_category_id"
119
-          >
120
-          </nut-tab-pane>
121
-       </nut-tabs>
108
+    <!--    <div class="p-3">-->
109
+    <div class=" ">
110
+      <nut-tabs v-model="tabValue" title-scroll title-gutter="10" name="catePanel" @change="handleTabItemClick">
111
+        <!--         <nut-tab-panel :title="全部"></nut-tab-panel>-->
112
+        <nut-tab-pane v-for="item in tabs" :title="item.cate_name" :pane-key="item.store_category_id"
113
+          :key="item.store_category_id">
114
+        </nut-tab-pane>
115
+      </nut-tabs>
122 116
 
123
-      </div>
124
-<!--    </div>-->
117
+    </div>
118
+    <!--    </div>-->
125 119
 
126 120
   </div>
127 121
 </template>
@@ -132,4 +126,11 @@ function handleShowSearchPage() {
132 126
   --nut-tabs-titles-item-color: #fff;
133 127
   --nut-tabs-titles-item-active-color: #fff;
134 128
 }
129
+
130
+
131
+.font_size {
132
+  font-size: 24rpx;
133
+  line-height: 42rpx;
134
+  color: #c0c5cc;
135
+}
135 136
 </style>

+ 108 - 52
src/pages/dacang/list/index.vue

@@ -1,44 +1,52 @@
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
-import {getProductShare} from "~/apis/common";
11
-import {useUserStore} from "~/stores/userStore";
10
+import CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
11
+import { getProductShare } from "~/apis/common";
12
+import { useUserStore } from "~/stores/userStore";
12 13
 import Cache from "~/utils/cache";
13
-const headerImage = CDN_URL + `/static/assets/banner-dacang.png`
14
+import { getBannerImg } from '~/apis/product'
15
+import Banner from "./components/banner.vue";
16
+
17
+
14 18
 const usePageStore = usePageStoreWidthOut()
15 19
 
16 20
 
17 21
 const state = reactive({
18
-  tabs: [{store_category_id: '-1', cate_name: '全部'}],
22
+  tabs: [],
23
+  lists: {},
19 24
   productList: <Array<DcProductModel>>[],
20
-
21
-  currentClassify: '',
25
+  currentClassify: '-1',
22 26
   keyword: '',
23
-
24 27
   status: 'noMore',
25
-
28
+  banner: '',
26 29
   currentPage: 1,
27 30
   pageSize: 10,
28 31
   totalPage: 1
29 32
 })
30 33
 
34
+// 距离顶部距离
35
+let Scroll_X = ref(0)
36
+
37
+let scrollPositions = reactive({})
31 38
 const dacangStore = useDacangStore()
32 39
 const userStore = useUserStore()
33 40
 
41
+
34 42
 onLoad(async (option) => {
35
-  state.tabs = [{store_category_id: '-1', cate_name: '全部'}]
43
+  state.tabs = [{ store_category_id: '-1', cate_name: '全部' }]
36 44
   const classifyRes = await getDcProductClassify()
37 45
   state.tabs.push(...classifyRes)
38 46
   usePageStore.setPageConfig({
39 47
     currentPage: {
40 48
       type: 'tab',
41
-      url:  '/pages/dacang/list/index'
49
+      url: '/pages/dacang/list/index'
42 50
     }
43 51
   })
44 52
 
@@ -50,10 +58,15 @@ onLoad(async (option) => {
50 58
       userStore.setShareId(res.share_id)
51 59
     }
52 60
   }).catch(message => {
53
-    // console.log(message)
61
+    console.log(message)
54 62
   })
55 63
   userStore.setRedirectPage(`/pages/dacang/list/index`, 'tab')
64
+  getBannerImg().then(res => {
65
+    console.log('banner', res);
66
+    state.banner = res[0].pic
67
+    console.log(state.banner);
56 68
 
69
+  })
57 70
 
58 71
 })
59 72
 
@@ -77,61 +90,100 @@ onShareTimeline(() => {
77 90
   }
78 91
 })
79 92
 
80
-onShow(async (options) => {
93
+onShow((options) => {
94
+
81 95
   usePageStore.setPageConfig({
82 96
     currentPage: {
83 97
       type: 'tab',
84
-      url:  '/pages/dacang/list/index'
98
+      url: '/pages/dacang/list/index'
85 99
     }
86 100
   })
87 101
   loadList('reload')
88 102
 })
89 103
 
90
-function loadList(action: 'page' | 'reload', callback?: (items) => void) {
91
-
104
+const loadList = async (action: 'page' | 'reload', callback?: (items) => void) => {
105
+  console.log(action);
92 106
   let params: any = {
93 107
     page: state.currentPage,
94 108
     limit: state.pageSize,
95 109
     keyword: state.keyword
96 110
   }
97
-  if (dacangStore.currentClassify !== '-1') {
98
-    params.classify = dacangStore.currentClassify
111
+  console.log(params);
112
+  if (state.currentClassify !== '-1') {
113
+    params.classify = state.currentClassify
114
+  }
115
+  let res = await getDcProductList({
116
+    ...params
117
+  })
118
+  console.log('res>>>>', res);
119
+  if (action === 'page') {
120
+    state.lists[state.currentClassify] = state.lists[state.currentClassify].concat(res)
99 121
   }
100
-
101 122
   if (action === 'reload') {
102
-    params.page = 1
123
+    state.lists[state.currentClassify] = res
124
+  }
125
+
126
+  if (callback) {
127
+    callback(res)
103 128
   }
104 129
 
105
-  getDcProductList({
106
-    ...params
107
-  }).then(res => {
108
-    if (action === 'page') {
109
-      state.productList = state.productList.concat(res)
110
-    }
111
-    if (action === 'reload') {
112
-      state.productList = res
113
-    }
114 130
 
115
-    if (callback) {
116
-      callback(res)
117
-    }
118
-  })
119 131
 }
120 132
 
121
-function handleTabItemClick(classifyId) {
133
+function handleTabItemClick(classifyId: string) {
122 134
   state.currentClassify = classifyId
123
-  dacangStore.setClassify(classifyId)
135
+  // uni.pageScrollTo({
136
+  //   scrollTop: 0
137
+  // });
138
+  state.currentPage = 1
139
+  state.pageSize = 10
140
+
124 141
   setTimeout(() => {
125 142
     loadList('reload')
126 143
   }, 300)
127
-  // }
144
+
128 145
 }
129 146
 
147
+// function handleTabItemClick(classifyId) {
148
+//   // 保存当前分类页的滚动位置
149
+//   scrollPositions[state.currentClassify] = Scroll_X.value;
150
+
151
+//   console.log(111, scrollPositions[classifyId]);
152
+
153
+//   // 切换当前分类页
154
+//   state.currentClassify = classifyId;
155
+
156
+//   // 检查当前分类页是否有保存的滚动位置
157
+//   if (scrollPositions[classifyId] !== undefined) {
158
+//     // 如果有保存的滚动位置,恢复滚动位置
159
+//     uni.pageScrollTo({
160
+//       scrollTop: scrollPositions[classifyId],
161
+//     });
162
+//   } else {
163
+//     // 如果没有保存的滚动位置,重新加载数据
164
+//     state.currentPage = 1;
165
+//     state.pageSize = 10;
166
+//     loadList('reload');
167
+//   }
168
+// }
169
+
170
+function toHuiyuan() {
171
+  
172
+  uni.navigateTo({
173
+    url: `/pages/guest_member_new/index?is_merchant=${userStore.userInfo.is_merchant}`
174
+  })
175
+}
176
+
177
+
130 178
 const headerClass = ref('')
131 179
 
132 180
 onPageScroll((page) => {
181
+
182
+
183
+  Scroll_X.value = Number(page.scrollTop.toFixed())
184
+
133 185
   // page.scrollTop
134
-  if (page.scrollTop >= 76 ) {
186
+  if (page.scrollTop >= 76) {
135 187
     headerClass.value = '!bg-primary !text-white'
136 188
   } else {
137 189
     headerClass.value = ''
@@ -145,7 +197,7 @@ onReachBottom(() => {
145 197
   state.currentPage += 1
146 198
   loadList('page', (items) => {
147 199
     uni.hideLoading()
148
-    // console.log(items)
200
+    console.log(items)
149 201
     if (!items.length > 0) {
150 202
       // console.log('没有更多了')
151 203
       state.status = 'noMore'
@@ -153,23 +205,29 @@ onReachBottom(() => {
153 205
   })
154 206
 })
155 207
 onPullDownRefresh(() => {
156
-  uni.showLoading()
157
-  loadList('reload', (items) => {
158
-    uni.hideLoading()
159
-    uni.stopPullDownRefresh()
160
-  })
208
+  // uni.showLoading()
209
+  // state.currentPage = 1
210
+  // state.pageSize = 10
211
+  // loadList('reload', (items) => {
212
+  //   uni.hideLoading()
213
+  //   uni.stopPullDownRefresh()
214
+  // })
161 215
 })
162 216
 
163 217
 
164 218
 </script>
165 219
 <template>
166 220
   <div class="h-screen">
167
-    <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick"/>
221
+    <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick" />
168 222
 
169 223
     <div class="flex flex-col gap-2 ">
170
-      <image :src="headerImage" mode="widthFix" class="w-full h-50"></image>
171
-    <ProductList :list="state.productList" />
172
-      <div class="pb-safe flex justify-center items-center text-[12px] text-gray-500" v-if="state.productList.length > 0">
224
+      <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
225
+      <image lazy-load :src="state.banner" mode="widthFix" @click="toHuiyuan" class="w-full h-50"></image>
226
+      <div>
227
+        <ProductList :list="state.lists[state.currentClassify]" />
228
+      </div>
229
+      <div class="pb-safe flex justify-center items-center text-[12px] text-gray-500"
230
+        v-if="state.lists[state.currentClassify]?.length > 0">
173 231
         <div v-if="state.status === 'loading'">
174 232
           加载中...
175 233
         </div>
@@ -189,8 +247,6 @@ page {
189 247
 .nut-tab-pane {
190 248
   display: none !important;
191 249
 }
192
-
193
-
194 250
 </style>
195 251
 <route lang="yaml" >
196 252
 style:

+ 45 - 26
src/pages/home/components/header.vue

@@ -1,8 +1,8 @@
1 1
 <script lang="ts" setup>
2
-import {computed, PropType} from "vue";
2
+import { computed, PropType } from "vue";
3 3
 import FSearch from "~/components/FSearch/FSearch.vue";
4
-import type {UserInfoModel} from "~/apis/model/userInfoModel";
5
-import {useUserStore} from "~/stores/userStore";
4
+import type { UserInfoModel } from "~/apis/model/userInfoModel";
5
+import { useUserStore } from "~/stores/userStore";
6 6
 // import {useUserStore} from "~/stores/userStore";
7 7
 const userStore = useUserStore()
8 8
 
@@ -68,30 +68,22 @@ function handleShowMessage() {
68 68
     url: '/pages/message/index'
69 69
   })
70 70
 }
71
+function handleClickser() {
72
+  uni.navigateTo({
73
+    url: '/pages/search/index'
74
+  })
75
+}
71 76
 </script>
72 77
 <template>
73
-  <div class="home-header fixed w-screen text-white z-10"
74
-       :style="navBarStyle"
75
-       :class="exClass"
76
-  >
78
+  <div class="home-header fixed w-screen text-white z-10" :style="navBarStyle" :class="exClass">
77 79
     <div class="flex">
78
-      <div
79
-          @click="handleClick"
80
-          class="flex gap-2 mb-2 pl-2 flex-1"
81
-      >
82
-        <image v-if="userStore && userStore.userInfo && userStore.userInfo.avatar"
83
-               :src="userStore.userInfo.avatar"
84
-               mode="widthFix"
85
-               class="w-9 h-9 rounded-full"
86
-        />
87
-        <image
88
-            v-else
89
-            src="https://app.bjtdba.com/uploads/logo.jpg"
90
-            mode="widthFix"
91
-            class="w-9 h-9 rounded-full"
92
-        />
80
+      <div @click="handleClick" class="flex gap-2 mb-2 pl-2 flex-1">
81
+        <image v-if="userStore && userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar"
82
+          mode="widthFix" class="w-9 h-9 rounded-full" />
83
+        <image v-else src="https://app.bjtdba.com/uploads/logo.jpg" mode="widthFix" class="w-9 h-9 rounded-full" />
93 84
         <div class="flex flex-col ">
94
-          <div class="text-sm" v-if="userStore.userInfo && userStore.userInfo.nickname">{{ userStore.userInfo.nickname ? userStore.userInfo.nickname : '登录'}}</div>
85
+          <div class="text-sm" v-if="userStore.userInfo && userStore.userInfo.nickname">{{ userStore.userInfo.nickname ?
86
+            userStore.userInfo.nickname : '登录' }}</div>
95 87
           <div class="text-sm" v-else>登录</div>
96 88
           <div class="text-xs" v-if="!isNaN(yanglaojin) && userStore.userInfo">{{ yanglaojin }}元养老金</div>
97 89
           <div v-else class="text-xs">
@@ -100,7 +92,8 @@ function handleShowMessage() {
100 92
         </div>
101 93
 
102 94
       </div>
103
-      <div class=" right-26 flex flex-col text-[10px] justify-center items-center " @tap.stop="handleShowMessage" :style="{marginRight: `${menuButtonInfo.width + 15}px`}">
95
+      <div class=" right-26 flex flex-col text-[10px] justify-center items-center " @tap.stop="handleShowMessage"
96
+        :style="{ marginRight: `${menuButtonInfo.width + 15}px` }">
104 97
         <image src="/static/icon/message-dark.png" mode="widthFix" class="w-4 h-4" v-if="exClass"></image>
105 98
         <image src="/static/icon/message.png" mode="widthFix" class="w-4 h-4" v-else></image>
106 99
         <div>消息</div>
@@ -108,10 +101,36 @@ function handleShowMessage() {
108 101
 
109 102
 
110 103
     </div>
111
-    <div class="p-3">
112
-      <FSearch />
104
+    <div class="p_3">
105
+      <!-- 搜索 -->
106
+      <div @click="handleClickser"
107
+        class="w-full bg-white rounded-full flex flex-row justify-between items-center border-solid border-1 border-red h-8">
108
+
109
+        <image src="https://cdn.bjtdba.com/vod/image/2023-02-15/20230215112840149.png" mode="widthFix"
110
+          class="w-5 h-5  pl-2 py-1"></image>
111
+        <div class="flex flex-1 w-100%">
112
+          <div class="flex-1 guand ">输入商品关键字</div>
113
+          <div class="bg-[#D71608] text-white text-xs w-11 rounded-full text-center p-1.5  mr-0.5 ">
114
+            搜索
115
+          </div>
116
+        </div>
117
+
118
+
119
+      </div>
113 120
 
114 121
     </div>
115 122
 
116 123
   </div>
117 124
 </template>
125
+<style  scoped>
126
+.p_3 {
127
+  padding-left: 24rpx;
128
+  padding-right: 24rpx;
129
+}
130
+
131
+.guand {
132
+  padding-left: 10rpx;
133
+  line-height: 56rpx;
134
+  color: #9ca3af
135
+}
136
+</style>

+ 67 - 79
src/pages/home/components/navs.vue

@@ -1,40 +1,45 @@
1 1
 <script lang="ts" setup>
2
-import {getHomeQuickLink} from "~/apis/common";
3
-import {PLATFORM_NAME} from "~/apis/model/common.model";
4
-import {useDacangStore} from "~/stores/dacangStore";
5
-import {CDN_URL} from "~/config/app";
2
+import { getHomeQuickLink } from "~/apis/common";
3
+import { PLATFORM_NAME } from "~/apis/model/common.model";
4
+import { useDacangStore } from "~/stores/dacangStore";
5
+import { CDN_URL, CDM_URL } from "~/config/app";
6 6
 
7 7
 const navList = ref([{
8
-  image: CDN_URL + '/static/home-nav/home_dacang_220614.png',
9
-  title: '精品大仓',
8
+  image: CDM_URL + '/image/2023-11-20/20231120155257975.png',
9
+  title: '精品商城',
10 10
   key: 'jingpin'
11 11
 }, {
12 12
   image: CDN_URL + '/static/home-nav/home_xianshimiaosha_220614.png',
13 13
   title: '限时秒杀',
14 14
   key: 'miaosha'
15
-}, {
16
-  image: CDN_URL + '/static/home-nav/jingdongshengqian_220920.png',
17
-  title: '京东',
18
-  key: PLATFORM_NAME.JD
19
-}, {
15
+},{
16
+  image: CDM_URL + '/image/2023-11-30/20231130092625318.png',
17
+  title: '会员专区',
18
+  key: 'user',
19
+},{
20 20
   image: '',
21 21
   title: '鼎盛联盟',
22 22
   key: 'dingsheng',
23
-  // categoryId: '430'
24
-  // 测试库
23
+  // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092553801.png  gc
24
+  // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092625318.png  会员
25 25
   // categoryId: '149'
26 26
 },{
27
-  image: CDN_URL + '/static/home-nav/pinduoduo_x.png',
28
-  title: '拼多多',
29
-  key: PLATFORM_NAME.PDD
27
+  image: CDN_URL + '/static/home-nav/icon_hmyh_221014.png',
28
+  title: '惠民专区',
29
+  key: PLATFORM_NAME.DC,
30
+  categoryId: '567',
31
+},{
32
+  image: CDN_URL + '/static/home-nav/jingdongshengqian_220920.png',
33
+  title: '京东',
34
+  key: PLATFORM_NAME.JD
30 35
 }, {
31 36
   image: CDN_URL + '/static/home-nav/home_taobaoyanglao_220920.png',
32 37
   title: '淘宝',
33 38
   key: PLATFORM_NAME.TB
34 39
 }, {
35
-  image: CDN_URL + '/static/home-nav/douyin_logo_230317.png',
36
-  title: '抖音',
37
-  key: PLATFORM_NAME.DY
40
+  image: CDM_URL + '/image/2023-11-24/20231124150424710.png',
41
+  title: '拼多多',
42
+  key: PLATFORM_NAME.PDD
38 43
 }, {
39 44
   image: CDN_URL + '/static/home-nav/home_weipinhui_220920.png',
40 45
   title: '唯品会',
@@ -43,43 +48,25 @@ const navList = ref([{
43 48
   image: CDN_URL + '/static/home-nav/home_suningyigou_220920.png',
44 49
   title: '苏宁易购',
45 50
   key: PLATFORM_NAME.SU
51
+},{
52
+  image: CDN_URL + '/static/home-nav/douyin_logo_230317.png',
53
+  title: '抖音',
54
+  key: PLATFORM_NAME.DY
46 55
 }, {
47
-  image: CDN_URL + '/static/home-nav/home_jinfentongdui_220615.png',
48
-  title: '积分通兑',
49
-  key: 'integral'
50
-}, {
51
-  image: CDN_URL + '/static/home-nav/elderly_zone_220920.png',
52
-  title: '老年专区',
53
-  key: PLATFORM_NAME.DC,
56
+  image: CDM_URL + '/image/2023-11-30/20231130092553801.png',
57
+  title: '工厂直供',
58
+  key: 'gongchang',
54 59
   categoryId: '571'
55
-}, 
56
- {
60
+},
61
+{
57 62
   image: '',
58
-  title: '滋补保健',
63
+  title: '滋补养生',
59 64
   key: 'zibu',
60 65
   categoryId: '430'
61
-  // 测试库
62
-  // categoryId: '149'
63
-},
64
-
65
-// {
66
-//   image: CDN_URL + '/static/home-nav/the_student_zone_220920.png',
67
-//   title: '学生专区',
68
-//   key: PLATFORM_NAME.DC,
69
-//   categoryId: '576'
70
-// }, 
71
-{
72
-  image: CDN_URL + '/static/home-nav/vip_img.png',
73
-  title: '会员专区',
74
-  key: 'member',
75
-  // key: PLATFORM_NAME.DC,
76
-  // categoryId: '567',
77 66
 }, {
78
-  image: CDN_URL + '/static/home-nav/icon_hmyh_221014.png',
79
-  title: '惠民专区',
80
-  key: PLATFORM_NAME.DC,
81
-  categoryId: '567',
82
-
67
+  image: CDN_URL + '/static/home-nav/home_jinfentongdui_220615.png',
68
+  title: '积分通兑',
69
+  key: 'integral'
83 70
 }, {
84 71
   image: CDN_URL + '/static/home-nav/home_gengduo.png',
85 72
   title: '更多',
@@ -88,10 +75,12 @@ const navList = ref([{
88 75
 
89 76
 onBeforeMount(() => {
90 77
   getHomeQuickLink().then(res => {
78
+    console.log('res>>>>>', res);
79
+
91 80
     if (res) {
92
-		navList.value[11] = res[0]
93
-		navList.value[3] = res[1]
94
-		// navList.value[3] = res[0]
81
+      navList.value[12] = res[0]
82
+      navList.value[3] = res[1]
83
+      // navList.value[3] = res[0]
95 84
       // console.log(res)
96 85
     }
97 86
   })
@@ -108,15 +97,12 @@ function handleItemClick(item: any) {
108 97
       uni.switchTab({
109 98
         url: '/pages/dacang/list/index'
110 99
       })
111
-      // uni.navigateTo({
112
-      //   url: '/pagesC/goods_details/index?id=4858'
113
-      // })
114 100
       break;
115 101
     }
116 102
     // 会员专区
117
-    case 'member': {
103
+    case 'user': {
118 104
       uni.navigateTo({
119
-        url: '/pages/vip/index'
105
+        url: `/pages/vip/index?type=`+item.key
120 106
       })
121 107
       break;
122 108
     }
@@ -135,18 +121,25 @@ function handleItemClick(item: any) {
135 121
       })
136 122
       break;
137 123
     }
138
-	case 'dingsheng': {
139
-	  uni.navigateTo({
140
-	    url: `/pages/product/dingshenglianmeng?type=`+item.key
141
-	  })
142
-	  break;
143
-	}
144
-	case 'jingpin': {
145
-	  uni.navigateTo({
146
-	    url: `/pages/product/dingshenglianmeng?type=`+item.key
147
-	  })
148
-	  break;
149
-	}
124
+    case 'dingsheng': {
125
+      uni.navigateTo({
126
+        url: `/pages/product/dingshenglianmeng?type=` + item.key
127
+      })
128
+      break;
129
+    }
130
+    //工厂直供
131
+    case 'gongchang': {
132
+      uni.navigateTo({
133
+        url: `/pages/vip/index?type=`+item.key
134
+      })
135
+      break;
136
+    }
137
+    case 'jingpin': {
138
+      uni.navigateTo({
139
+        url: `/pages/product/dingshenglianmeng?type=` + item.key
140
+      })
141
+      break;
142
+    }
150 143
     // 积分通兑
151 144
     case 'integral': {
152 145
       uni.navigateTo({
@@ -178,16 +171,11 @@ function handleItemClick(item: any) {
178 171
   <div class="">
179 172
     <div class="rounded bg-white pt-4 pb-2 px-5">
180 173
       <div class="flex justify-around flex-wrap ">
181
-        <div
182
-            @tap="handleItemClick(navItem)"
183
-            class="flex flex-col items-center justify-center gap-y-1 mb-2 flex-[0_0_20%]"
184
-             v-for="(navItem, index) in navList" :key="index">
185
-          <image :src="navItem.image"
186
-                 mode="widthFix"
187
-                 class="w-10 h-10"
188
-          ></image>
174
+        <div @tap="handleItemClick(navItem)" class="flex flex-col items-center justify-center gap-y-1 mb-2 flex-[0_0_20%]"
175
+          v-for="(navItem, index) in navList" :key="index">
176
+          <image :src="navItem.image" mode="widthFix" class="w-10 h-10"></image>
189 177
           <div class="text-xs">
190
-            {{navItem.title}}
178
+            {{ navItem.title }}
191 179
           </div>
192 180
         </div>
193 181
       </div>

+ 7 - 1
src/pages/home/index.vue

@@ -18,6 +18,7 @@ import {getShareId} from "~/apis/product";
18 18
 // import CXBDialogSIgnInSucceed from "~/components/CXBDialogSignInSucceed/CXBDialogSIgnInSucceed.vue";
19 19
 import Cache from "~/utils/cache";
20 20
 
21
+import CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
21 22
 const userStore = useUserStore()
22 23
 const usePageStore = usePageStoreWidthOut()
23 24
 usePageStore.setPageConfig({
@@ -54,6 +55,8 @@ const state = reactive({
54 55
   duration: 500,
55 56
   currents: "0",
56 57
 })
58
+// 距离顶部距离
59
+let Scroll_X = ref(0)
57 60
 onShow(() => {
58 61
   usePageStore.setPageConfig({
59 62
     currentPage: {
@@ -161,6 +164,8 @@ watch(() => state.isShowSignIn, (val) => {
161 164
 const headerClass = ref('')
162 165
 
163 166
 onPageScroll((page) => {
167
+  // console.log(page.scrollTop.toFixed(),'距离顶部的距离')
168
+  Scroll_X.value = Number(page.scrollTop.toFixed())
164 169
   // page.scrollTop
165 170
   if (page.scrollTop >= 76 ) {
166 171
     headerClass.value = 'bg-white !text-gray-900'
@@ -205,7 +210,7 @@ const homeBanner = CDN_URL + '/static/assets/home-banner.png'
205 210
 function handleBannerClick(item) {
206 211
   if(item.url == 'rich') {
207 212
     uni.navigateTo({
208
-      url: '/pages/vip/index'
213
+      url: '/pages/vip/index?type=user'
209 214
     })
210 215
   }
211 216
 }
@@ -246,6 +251,7 @@ function getIsShow(){
246 251
 </script>
247 252
 <template>
248 253
   <div class="h-screen ">
254
+    <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
249 255
     <Header :yanglaojin="state.all_yanglao"
250 256
             :exClass="headerClass"
251 257
     />

+ 100 - 27
src/pages/immediate-withdrawal/index.vue

@@ -7,16 +7,18 @@ import {
7 7
   getWithdrawalConfig,
8 8
   getWithdrawalService
9 9
 } from "~/apis/user";
10
-import {SpreadInfoModel} from "~/apis/model/spreadInfoModel";
11
-import type {UserYanglaoJinModel} from "~/apis/model/userYanglaoJinModel";
12
-import {CDN_URL} from "~/config/app";
13
-import {isNumber} from "~/utils";
10
+import { SpreadInfoModel } from "~/apis/model/spreadInfoModel";
11
+import type { UserYanglaoJinModel } from "~/apis/model/userYanglaoJinModel";
12
+import { CDN_URL } from "~/config/app";
13
+import { isNumber } from "~/utils";
14
+import { Accountbind } from "~/apis/auth.api";
14 15
 
15 16
 const zfb_logoImage = CDN_URL + '/static/assets/zfb_logo.png'
16 17
 const wx_logoImage = CDN_URL + '/static/assets/wx_logo.png'
17 18
 const userStore = useUserStore()
18 19
 const userSpreadInfo = ref<SpreadInfoModel>()
19
-
20
+//微信绑定标识
21
+const iswxshow = ref(false)
20 22
 const withdrawalCal = ref({})
21 23
 const yanglaojin = ref<UserYanglaoJinModel>()
22 24
 
@@ -27,7 +29,46 @@ const cashWithdrawalAmount = ref()
27 29
 const isDisabled = ref(true)
28 30
 const userBrokeragePrice = ref(0)
29 31
 // userSpreadInfo.value.brokerage_price
30
-onLoad(async () => {
32
+onShow(async () => {
33
+  cashWithdrawalAmount.value = null
34
+  getBandAccountInfo({ type: '1' }).then(res => {
35
+    iswxshow.value = true
36
+
37
+  }).catch((error) => {
38
+    setTimeout(() => {
39
+      uni.showModal({
40
+        title: '温馨提示',
41
+        content: '您还未绑定提现账号,是否绑定?',
42
+        cancelText: "取消", // 取消按钮的文字
43
+        confirmText: "确认绑定", // 确认按钮的文字
44
+        showCancel: true, // 是否显示取消按钮,默认为 true
45
+        confirmColor: '#f55850',
46
+        success: (res) => {
47
+          if (res.confirm) {
48
+            console.log('comfirm') //点击确定之后执行的代码
49
+            Accountbind({ openid: userStore.openid, wx_type: '1' }).then(resg => {
50
+              console.log('我是resg', resg);
51
+
52
+              uni.showToast({
53
+                title: '绑定成功',
54
+                icon: 'none'
55
+              })
56
+              iswxshow.value = true
57
+            }).catch((error) => {
58
+              uni.showToast({
59
+                title: error,
60
+                icon: 'none'
61
+              })
62
+            })
63
+          } else {
64
+            console.log('cancel') //点击取消之后执行的代码
65
+            iswxshow.value = false
66
+          }
67
+        }
68
+      })
69
+    }, 300);
70
+
71
+  })
31 72
   await userStore.getUserInfo()
32 73
   // 佣金信息
33 74
   userSpreadInfo.value = await getUserSpreadInfo()
@@ -48,6 +89,7 @@ onLoad(async () => {
48 89
       icon: 'none'
49 90
     })
50 91
   }
92
+
51 93
   // }
52 94
 })
53 95
 
@@ -65,6 +107,37 @@ watch(() => cashWithdrawalAmount.value, (val) => {
65 107
   }
66 108
 })
67 109
 
110
+function Tochecked() {
111
+  iswxshow.value = !iswxshow.value
112
+  console.log(iswxshow.value);
113
+  if (iswxshow.value == true) {
114
+    Accountbind({ openid: userStore.openid, wx_type: '1' }).then(resg => {
115
+      console.log('我是resg', resg);
116
+
117
+      uni.showToast({
118
+        title: '绑定成功',
119
+        icon: 'none'
120
+      })
121
+      iswxshow.value = true
122
+    }).catch((error) => {
123
+      uni.showToast({
124
+        title: error,
125
+        icon: 'none'
126
+      })
127
+      if(error=='此微信已绑定其他账户'){
128
+        iswxshow.value=false
129
+      }
130
+    })
131
+  }else{
132
+    console.log(111);
133
+    
134
+  }
135
+}
136
+
137
+
138
+
139
+
140
+
68 141
 function handleInputAll() {
69 142
   // console.log(userSpreadInfo.value?.brokerage_price)
70 143
   if (userSpreadInfo.value && userSpreadInfo.value.brokerage_price && userSpreadInfo.value?.brokerage_price >= widthdrawalConfig.value.withdrawal_money) {
@@ -81,6 +154,7 @@ function handleInputAll() {
81 154
  * 立即提现
82 155
  */
83 156
 function handleImmediateWithdrawal() {
157
+  
84 158
   if (isDisabled.value) {
85 159
     return
86 160
   }
@@ -139,20 +213,25 @@ function handleImmediateWithdrawal() {
139 213
     })
140 214
   }
141 215
 
216
+  if(iswxshow.value==false){
217
+    uni.showToast({
218
+      title: '请先勾选提现方式',
219
+      icon: 'none'
220
+    })
221
+    return
222
+  }
223
+
224
+  getApplicationWithdrawal({ extract_price: cashWithdrawalAmount.value, extract_type: 1 }).then(res => {
142 225
 
143
-  getApplicationWithdrawal({extract_price: cashWithdrawalAmount.value, extract_type: 1}).then(res => {
144
-    // uni.showToast({
145
-    //   title: res,
146
-    //   icon: 'none'
147
-    // })
148 226
     uni.showToast({
149
-      title: '提现成功',
227
+      title: '提现已申请',
150 228
       icon: 'none'
151
-    }).then(res => {
229
+    })
230
+    setTimeout(() => {
152 231
       uni.navigateTo({
153
-        url: '/pages/immediate-withdrawal/index'
232
+        url: '/pages/withdrawal-record/index'
154 233
       })
155
-    })
234
+    }, 300)
156 235
   }).catch(error => {
157 236
     uni.showToast({
158 237
       title: error,
@@ -190,10 +269,7 @@ function handleShowAgreement(type) {
190 269
       <div class="flex justify-center items-center pt-4 f-hairline-bottom">
191 270
         <div class="text-lg font-bold">¥</div>
192 271
         <div class="flex-1">
193
-          <input placeholder="请输入金额" class="w-full"
194
-                 type="number"
195
-                 v-model="cashWithdrawalAmount"
196
-          />
272
+          <input placeholder="请输入金额" class="w-full" type="digit" v-model="cashWithdrawalAmount" />
197 273
         </div>
198 274
         <div class="text-xs text-red" @click="handleInputAll">全部提现</div>
199 275
       </div>
@@ -215,10 +291,11 @@ function handleShowAgreement(type) {
215 291
         <div class="flex items-center justify-between py-3">
216 292
           <div class="flex items-center gap-2">
217 293
             <image :src="wx_logoImage" mode="widthFix" class="w-8 h-8"></image>
218
-            <div>微信支付</div>
294
+            <div>微信</div>
219 295
           </div>
220 296
           <div>
221
-            <radio checked/>
297
+            <radio :checked="true" v-if="iswxshow==true" />
298
+            <radio :checked="false"  v-if="iswxshow==false" @click="Tochecked"  />
222 299
           </div>
223 300
         </div>
224 301
 
@@ -236,11 +313,8 @@ function handleShowAgreement(type) {
236 313
 
237 314
     <div class="flex flex-col">
238 315
       <div class=" flex rounded-full bg-red-300">
239
-        <nut-button type="primary" block
240
-                    :disabled="isDisabled"
241
-                    :class="isDisabled && 'bg-gray-800'"
242
-                    @tap="handleImmediateWithdrawal"
243
-        >
316
+        <nut-button type="primary" block :disabled="isDisabled" :class="isDisabled && 'bg-gray-800'"
317
+          @tap="handleImmediateWithdrawal">
244 318
           立即提现
245 319
         </nut-button>
246 320
       </div>
@@ -267,7 +341,6 @@ page {
267 341
   height: 16px !important;
268 342
   width: 16px !important;
269 343
 }
270
-
271 344
 </style>
272 345
 <route lang="yaml">
273 346
 style:

+ 19 - 13
src/pages/miaosha/index.vue

@@ -12,7 +12,7 @@ const currentSeckillDate = ref()
12 12
 const status1Icon = CDN_URL + '/static/assets/mashangqiang.png'
13 13
 const status2Icon = CDN_URL + '/static/assets/jijiangkaiqiang.png'
14 14
 const status3Icon = CDN_URL + '/static/assets/miaosha_yijieshu_220908.png'
15
-
15
+const userStore = useUserStore()
16 16
 // const list = ref<Array<DcSeckillModel>>()
17 17
 const currentProductList = ref([])
18 18
 
@@ -24,6 +24,7 @@ const state = reactive({
24 24
 
25 25
   list: []
26 26
 })
27
+
27 28
 onLoad((options) => {
28 29
   loadList('reload')
29 30
 })
@@ -43,33 +44,38 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
43 44
   }).then( res => {
44 45
     if (action === 'reload') {
45 46
       if (res && res.length > 0) {
47
+<<<<<<< HEAD
46 48
         // console.log(res)
49
+=======
50
+        console.log('秒杀>>>',res)
51
+>>>>>>> li-yi
47 52
         const resList = res
48 53
         // const status3List = orderBy(list.value, (val) => {
49 54
         //   return val.status == 3
50 55
         // })
51
-        let status3FilterList = filter(resList, (val) => {
52
-          return val.status == 3
53
-        })
56
+        //val.status 1 开始抢 2 即将开始 3 已结束
57
+        // let status3FilterList = filter(resList, (val) => {
58
+        //   return val.status == 3
59
+        // })
54 60
         let status2FilterList = filter(resList, (val) => {
55 61
           return val.status == 2
56 62
         })
57 63
         let status1FilterList = filter(resList, (val) => {
58 64
           return val.status == 1
59 65
         })
60
-        if (status3FilterList.length >= 3) {
61
-          status3FilterList = orderBy(status3FilterList,  ['ctime'], ['desc'])
62
-          console.log(status3FilterList)
63
-          state.list.push(...status3FilterList[0])
64
-          console.log(state.list)
65
-        } else {
66
-          state.list.push(...status3FilterList)
67
-        }
66
+        // if (status3FilterList.length >= 3) {
67
+        //   status3FilterList = orderBy(status3FilterList,  ['ctime'], ['desc'])
68
+        //   console.log(status3FilterList)
69
+        //   state.list.push(...status3FilterList[0])
70
+        //   console.log(state.list)
71
+        // } else {
72
+        //   state.list.push(...status3FilterList)
73
+        // }
68 74
         if (status2FilterList.length > 0) {
69 75
           state.list.push(...status2FilterList)
70 76
         }
71 77
         if (status1FilterList.length > 0) {
72
-          state.list.push(...status1FilterList)
78
+          state.list.unshift(...status1FilterList)
73 79
         }
74 80
 
75 81
         if (state.list.length > 0) {

+ 21 - 36
src/pages/my-integral/index.vue

@@ -1,6 +1,6 @@
1 1
 <script setup lang="ts">
2
-import {useUserStore} from "~/stores/userStore";
3
-import {getNewSignInInfo, getUserInfo} from "~/apis/user";
2
+import { useUserStore } from "~/stores/userStore";
3
+import { getNewSignInInfo, getUserInfo } from "~/apis/user";
4 4
 import FButton from "~/components/FButton/FButton.vue";
5 5
 import CXBButton from "~/components/CXBButton/CXBButton.vue";
6 6
 import CXBDialogSIgnIn from "~/components/CXBDialogSignIn/CXBDialogSIgnIn.vue";
@@ -26,8 +26,13 @@ onShow(() => {
26 26
 function loadSignInInfo() {
27 27
   // 2 检查用户签到信息
28 28
   getNewSignInInfo().then(res => {
29
+<<<<<<< HEAD
29 30
     // console.log(res)
30 31
     const {today, day} = res
32
+=======
33
+    console.log(res)
34
+    const { today, day } = res
35
+>>>>>>> li-yi
31 36
     state.signToday = today
32 37
     // console.log(res)
33 38
     if (today == 0) {
@@ -68,7 +73,7 @@ if (userStore.userInfo) {
68 73
 function handleSign() {
69 74
   // console.log(state.signToday)
70 75
   // if (state.signToday == 0)  {
71
-    state.isShowSignIn = true
76
+  state.isShowSignIn = true
72 77
   // } else {
73 78
   //   return uni.showToast({
74 79
   //     title: '今日已签到过',
@@ -117,27 +122,19 @@ function handleShowAgreement() {
117 122
         {{ userStore.userInfo.score }}
118 123
       </div>
119 124
     </div>
120
-
125
+    <div @tap="handleShowIntegralDetail" class="bg-white rounded-md text-sm flex justify-between p-3">
126
+      <div class="">积分明细</div>
127
+      <div class="f-text-color-2 i-tabler-chevron-right transform transition-300" />
128
+    </div>
121 129
     <div class="bg-white rounded-md text-sm flex justify-between p-3">
122 130
       <div class="">积分通兑</div>
123
-      <FButton
124
-          @tap="handleToZibuyangsheng"
125
-          size="mini"
126
-          :exClass="['rounded-full','!text-[12px]', 'text-white', `bg-primary`, 'w-full']"
127
-
128
-      >
131
+      <FButton @tap="handleToZibuyangsheng" size="mini"
132
+        :exClass="['rounded-full', '!text-[12px]', 'text-white', `bg-primary`, 'w-full']">
129 133
         去兑换
130 134
       </FButton>
131 135
     </div>
132 136
 
133
-    <div
134
-        @tap="handleShowIntegralDetail"
135
-        class="bg-white rounded-md text-sm flex justify-between p-3">
136
-      <div class="">积分明细</div>
137
-      <div
138
-          class="f-text-color-2 i-tabler-chevron-right transform transition-300"
139
-      />
140
-    </div>
137
+
141 138
 
142 139
     <div class="bg-white rounded-md text-sm flex flex-col p-3">
143 140
       <div class="f-hairline-bottom pb-3">积分任务</div>
@@ -147,11 +144,8 @@ function handleShowAgreement() {
147 144
             <div class="text-xs">每日签到</div>
148 145
             <div class="text-xs text-gray-500">每日签到得奖励</div>
149 146
           </div>
150
-          <FButton
151
-              @click="handleSign"
152
-              size="mini"
153
-              :exClass="['rounded-full','!text-[12px]', 'text-white', `${state.signToday === 0 ? 'bg-primary' : 'bg-gray' }`, 'w-full']"
154
-          >
147
+          <FButton @click="handleSign" size="mini"
148
+            :exClass="['rounded-full', '!text-[12px]', 'text-white', `${state.signToday === 0 ? 'bg-primary' : 'bg-gray'}`, 'w-full']">
155 149
             {{ state.signToday === 0 ? '去签到' : '已签到' }}
156 150
           </FButton>
157 151
         </div>
@@ -160,12 +154,8 @@ function handleShowAgreement() {
160 154
             <div class="text-xs">邀请好友得积分</div>
161 155
             <div class="text-xs text-gray-500">邀请好友赚奖励</div>
162 156
           </div>
163
-          <FButton
164
-              @tap="handleToPoster"
165
-              size="mini"
166
-              :exClass="['rounded-full','!text-[12px]', 'text-white', `bg-primary`, 'w-full']"
167
-
168
-          >
157
+          <FButton @tap="handleToPoster" size="mini"
158
+            :exClass="['rounded-full', '!text-[12px]', 'text-white', `bg-primary`, 'w-full']">
169 159
             去邀请
170 160
 
171 161
           </FButton>
@@ -176,13 +166,8 @@ function handleShowAgreement() {
176 166
     </div>
177 167
   </div>
178 168
 
179
-  <CXBDialogSIgnIn
180
-      :show="state.isShowSignIn"
181
-      :today="state.signToday"
182
-      :day="state.day"
183
-      @confirm="state.isShowSignIn = false"
184
-      @close="state.isShowSignIn = false"
185
-  />
169
+  <CXBDialogSIgnIn :show="state.isShowSignIn" :today="state.signToday" :day="state.day"
170
+    @confirm="state.isShowSignIn = false" @close="state.isShowSignIn = false" />
186 171
 </template>
187 172
 
188 173
 <style>

+ 22 - 1
src/pages/my-invitation/index.vue

@@ -1,7 +1,7 @@
1 1
 <script setup lang="ts">
2 2
 import FCellGroup from "~/components/FCellGroup/FCellGroup.vue";
3 3
 import FCell from "~/components/FCell/FCell.vue";
4
-import {getAgentInfo, getSelectUserInviteProfit} from "~/apis/user";
4
+import {getAgentInfo, getSelectUserInviteProfit, getUserUnionId} from "~/apis/user";
5 5
 const userStore = useUserStore()
6 6
 const list = [{
7 7
   title: '邀请伙伴',
@@ -18,6 +18,9 @@ const list = [{
18 18
 }, {
19 19
   title: '去提现',
20 20
   url: '/pages/immediate-withdrawal/index'
21
+},{
22
+  title: '支付平台绑定',
23
+  url: '/pages/third_party_binding/index'
21 24
 }]
22 25
 
23 26
 
@@ -43,6 +46,24 @@ const userInviteProfit = reactive({
43 46
 })
44 47
 onLoad(() => {
45 48
   console.log('load...')
49
+  uni.login({
50
+    provider: 'weixin',
51
+    univerifyStyle: {
52
+      fullScreen: true
53
+    },
54
+    success: result => {
55
+      // console.log(result)
56
+      getUserUnionId({
57
+        code: result.code,
58
+        source: 'cxb'
59
+      }).then(unionRes => {
60
+        console.log(111111, unionRes)
61
+        // const shareId = Cache.get('SHARE_ID')
62
+        //存储openid
63
+        userStore.setOpenid(unionRes.openid)
64
+      })
65
+    }
66
+  })
46 67
   getSelectUserInviteProfit({ uid: userStore.uid }).then(res => {
47 68
     // console.log(res)
48 69
     const inviteData = res.data

+ 238 - 152
src/pages/my-rules/index.vue

@@ -2,8 +2,8 @@
2 2
 // import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
3 3
 import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
4 4
 
5
-import {encodePhone} from "../../utils";
6
-import {getAgentInfo, getRules, getUserInfo} from "~/apis/user";
5
+import { encodePhone } from "../../utils";
6
+import { getAgentInfo, getRules, getUserInfo } from "~/apis/user";
7 7
 
8 8
 const userStore = useUserStore()
9 9
 const ruleDetail = ref<{
@@ -19,119 +19,205 @@ const ruleDetail = ref<{
19 19
 const currentType = ref<any>([])
20 20
 
21 21
 const showUpgradeInfo = ref(false)
22
+
23
+// const userType = computed(() => {
24
+//   const userRichType = userStore.userInfo?.user_rich_type
25
+//   // console.log(userStore.userInfo)
26
+//   const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
27
+//   // 创始人
28
+//   if (userRichType == 3) {
29
+//     if (bangfu) {
30
+//       return ['创始人', bangfu]
31
+//     }
32
+//     return ['创始人']
33
+//     // return [].push()
34
+//   }
35
+//   // 普通用户
36
+//   if (userRichType == 0) {
37
+//     if (bangfu) {
38
+//       return ['用户', bangfu]
39
+//     }
40
+//     return ['用户']
41
+//   }
42
+//   // 会员
43
+//   if (userRichType == 1) {
44
+//     if (bangfu) {
45
+//       return ['会员', bangfu]
46
+//     }
47
+//     return ['会员']
48
+
49
+//   }
50
+//   if (userRichType == 3) {
51
+//     if (bangfu) {
52
+//       return ['创始人', bangfu]
53
+//     }
54
+//     return ['创始人']
55
+//   }
56
+//   // 合伙人
57
+//   if (userRichType == 4) {
58
+//     // return '高级会员'
59
+//     if (bangfu) {
60
+//       return ['VIP', bangfu]
61
+//     }
62
+//     return ['VIP']
63
+//   }
64
+//   if (userRichType == 5) {
65
+//     if (bangfu) {
66
+//       return ['初始级合伙人', bangfu]
67
+//     }
68
+//     return ['初始级合伙人']
69
+//   }
70
+//   if (userRichType == 6) {
71
+//     if (bangfu) {
72
+//       return ['中级合伙人', bangfu]
73
+//     }
74
+//     return ['中级合伙人']
75
+//   }
76
+//   if (userRichType == 7) {
77
+//     if (bangfu) {
78
+//       return ['高级合伙人', bangfu]
79
+//     }
80
+//     return ['高级合伙人']
81
+//   }
82
+//   if (!userRichType) {
83
+//     if (bangfu) {
84
+//       return ['用户', bangfu]
85
+//     }
86
+//     return ['用户']
87
+//   }
88
+// })
89
+// /*
90
+// const userType = computed(() => {
91
+//   const userRichType = userStore.userInfo?.user_rich_type
92
+
93
+//   // 创始人
94
+//   if (userRichType == 3) {
95
+//     return '创始人'
96
+//   }
97
+//   // 普通用户
98
+//   if (userRichType == 0) {
99
+//     return '用户'
100
+//   }
101
+//   // 会员
102
+//   if (userRichType == 1) {
103
+//     return '会员'
104
+//   }
105
+//   if (userRichType == 3) {
106
+//     return '创始人'
107
+//   }
108
+//   // 合伙人
109
+//   if (userRichType == 4) {
110
+//     // return '合伙人(VIP)'
111
+//     return 'VIP'
112
+//   }
113
+//   if (userRichType == 5) {
114
+//     return '初始级合伙人'
115
+//   }
116
+//   if (userRichType == 6) {
117
+//     return '中级合伙人'
118
+//   }
119
+//   if (userRichType == 7) {
120
+//     return '高级合伙人'
121
+//   }
122
+//   if (!userRichType) {
123
+//     return '用户'
124
+//   }
125
+// })
126
+// */
127
+
128
+//0:普通用户 1:会员  3:创始人 4:高级会员  8合伙人 9联合创始人
22 129
 const userType = computed(() => {
23 130
   const userRichType = userStore.userInfo?.user_rich_type
24
-  // console.log(userStore.userInfo)
131
+  // console.log('我是大哥',userStore.userInfo)
25 132
   const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
26
-  // 创始人
27
-  if (userRichType == 3) {
28
-    if (bangfu) {
29
-      return ['创始人', bangfu]
30
-    }
31
-    return ['创始人']
32
-    // return [].push()
33
-  }
133
+  // console.log('我是帮扶',bangfu);
134
+  
34 135
   // 普通用户
35 136
   if (userRichType == 0) {
36
-    if (bangfu) {
37
-      return ['用户', bangfu]
38
-    }
39
-    return ['用户']
137
+    // if (bangfu) {
138
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
139
+    // }
140
+    return ['../../static/img-hy/用户.png']
40 141
   }
41 142
   // 会员
42 143
   if (userRichType == 1) {
43
-    if (bangfu) {
44
-      return ['会员', bangfu]
45
-    }
46
-    return ['会员']
144
+    // if (bangfu) {
145
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
146
+    // }
147
+    return ['../../static/img-hy/会员.png']
47 148
 
48 149
   }
150
+    // 创始人
49 151
   if (userRichType == 3) {
50
-    if (bangfu) {
51
-      return ['创始人', bangfu]
52
-    }
53
-    return ['创始人']
152
+    // if (bangfu) {
153
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
154
+    // }
155
+    return ['../../static/img-hy/创始人.png']
54 156
   }
55 157
   // 合伙人
56 158
   if (userRichType == 4) {
57 159
     // return '高级会员'
58
-    if (bangfu) {
59
-      return ['VIP', bangfu]
60
-    }
61
-    return ['VIP']
62
-  }
63
-  if (userRichType == 5) {
64
-    if (bangfu) {
65
-      return ['初始级合伙人', bangfu]
66
-    }
67
-    return ['初始级合伙人']
68
-  }
69
-  if (userRichType == 6) {
70
-    if (bangfu) {
71
-      return ['中级合伙人', bangfu]
72
-    }
73
-    return ['中级合伙人']
74
-  }
75
-  if (userRichType == 7) {
76
-    if (bangfu) {
77
-      return ['高级合伙人', bangfu]
78
-    }
79
-    return ['高级合伙人']
80
-  }
81
-  if (!userRichType) {
82
-    if (bangfu) {
83
-      return ['用户', bangfu]
84
-    }
85
-    return ['用户']
86
-  }
87
-})
88
-/*
89
-const userType = computed(() => {
90
-  const userRichType = userStore.userInfo?.user_rich_type
91
-
92
-  // 创始人
93
-  if (userRichType == 3) {
94
-    return '创始人'
95
-  }
96
-  // 普通用户
97
-  if (userRichType == 0) {
98
-    return '用户'
99
-  }
100
-  // 会员
101
-  if (userRichType == 1) {
102
-    return '会员'
103
-  }
104
-  if (userRichType == 3) {
105
-    return '创始人'
106
-  }
107
-  // 合伙人
108
-  if (userRichType == 4) {
109
-    // return '合伙人(VIP)'
110
-    return 'VIP'
111
-  }
112
-  if (userRichType == 5) {
113
-    return '初始级合伙人'
160
+    // if (bangfu) {
161
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
162
+    // }
163
+    return ['../../static/img-hy/高级会员.png']
114 164
   }
115
-  if (userRichType == 6) {
116
-    return '中级合伙人'
165
+  if (userRichType == 8) {
166
+    // if (bangfu) {
167
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
168
+    // }
169
+    return ['../../static/img-hy/合伙人.png']
117 170
   }
118
-  if (userRichType == 7) {
119
-    return '高级合伙人'
171
+  if (userRichType == 9) {
172
+    // if (bangfu) {
173
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
174
+    // }
175
+    return ['../../static/img-hy/联合创始人.png']
120 176
   }
121 177
   if (!userRichType) {
122
-    return '用户'
178
+    // if (bangfu) {
179
+    //   return ['../../static/img-hy/帮扶中心.png', bangfu]
180
+    // }
181
+    return ['']
123 182
   }
124 183
 })
125
-*/
126
-
184
+//0:普通用户 1:股东
185
+// const AlholderType = computed(() => {
186
+//   const stockholder = userStore.userInfo?.stockholder
187
+//   console.log('我是stockholder',userStore.userInfo.stockholder)
188
+//   // 普通用户
189
+//   if (stockholder == 0) {
190
+//     return ['']
191
+//   }
192
+//   // 股东
193
+//   if (stockholder == 1) {
194
+//     return ['../../static/img-hy/股东.png']
195
+//   }
196
+  
197
+// })
198
+// '':普通用户 district-区/县代 city-市代',
199
+// const areaType = computed(() => {
200
+//   const areamanage = userStore.userInfo?.area_manage_type
201
+//   console.log('我是area_manage_type',userStore.userInfo.area_manage_type)
202
+//   // 县/区代理
203
+//   if (areamanage == 'district') {
204
+//     return ['../../static/img-hy/district.png']
205
+//   }
206
+//   // 市代理
207
+//   if (areamanage == 'city') {
208
+//     return ['../../static/img-hy/city.png']
209
+//   }
210
+//   //普通用户
211
+//   if(!areamanage){
212
+//     return['']
213
+//   }
214
+  
215
+// })
216
+
217
+
218
+
219
+onLoad(async () => {
127 220
 
128
-onLoad(async (option) => {
129
-  // console.log(option)
130
-  if (option && option.userType) {
131
-    currentType.value = [option.userType]
132
-  } else {
133
-    currentType.value = userType
134
-  }
135 221
   await userStore.getUserInfo()
136 222
   await userStore.getUserYanglaoJin()
137 223
 })
@@ -166,25 +252,32 @@ function handleShowAnnuityDetail() {
166 252
 const ruleId = computed(() => {
167 253
   const userRichType = userStore.userInfo?.user_rich_type
168 254
 
169
-  // console.log(userRichType)
255
+  console.log('我是》》》',userRichType)
170 256
   // 创始人
171
-  if (userRichType === 3) {
257
+  if (userRichType == 3) {
172 258
     return 21
173 259
   }
174 260
   // 用户
175
-  if (userRichType === 0) {
261
+  if (userRichType == 0) {
176 262
     return 18
177 263
   }
178 264
   // 会员
179
-  if (userRichType === 1) {
265
+  if (userRichType ==1) {
180 266
     return 19
181 267
   }
182
-  // 合伙人
183
-  if (userRichType === 2 || userRichType == 4) {
268
+  // 高级会员
269
+  if (userRichType == 4) {
184 270
     return 20
185 271
   }
186
-
187
-  return 18
272
+  // 合伙人
273
+  if (userRichType == 8 ) {
274
+    return 24
275
+  }
276
+  //联合创始人
277
+  if (userRichType == 9 ) {
278
+    return 22
279
+  }
280
+  
188 281
 })
189 282
 const agentInfo = ref({})
190 283
 
@@ -193,6 +286,8 @@ onShow(() => {
193 286
   if (ruleId.value) {
194 287
     // console.log(ruleId.value)
195 288
     getRules(ruleId.value).then(res => {
289
+      console.log(1111111222,res);
290
+      
196 291
       ruleDetail.value = res
197 292
     }).catch(error => {
198 293
       uni.showToast({
@@ -208,9 +303,21 @@ onShow(() => {
208 303
 })
209 304
 
210 305
 function handleUserUpgrade() {
211
-  if (ruleId.value < 21) {
306
+  console.log('ruleid',ruleId.value);
307
+  
308
+  if (ruleId.value < 20) {
212 309
     const id = ruleId.value + 1
213 310
     getRules(id).then(res => {
311
+      console.log('woshi111',res);
312
+      
313
+      ruleDetail.value = res
314
+      showUpgradeInfo.value = true
315
+    })
316
+  }else if(ruleId.value = 20){
317
+    const id = ruleId.value + 4
318
+    getRules(id).then(res => {
319
+      console.log('我是合伙人',res);
320
+      
214 321
       ruleDetail.value = res
215 322
       showUpgradeInfo.value = true
216 323
     })
@@ -229,10 +336,8 @@ function handleToVipPage() {
229 336
     <div class="flex flex-col gap-4 relative px-3 pb-safe">
230 337
       <div class="pt-5 ">
231 338
         <div class="flex gap-2 mb-2 text-white mb-6">
232
-          <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar"
233
-                 mode="widthFix"
234
-                 class="w-9 h-9 rounded-full"
235
-          ></image>
339
+          <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar" mode="widthFix"
340
+            class="w-9 h-9 rounded-full"></image>
236 341
 
237 342
           <div class="flex">
238 343
             <div class="flex flex-col">
@@ -246,51 +351,38 @@ function handleToVipPage() {
246 351
               </div>
247 352
             </div>
248 353
             <div class="flex gap-1 items-center px-1">
249
-              <div
250
-                  v-for="(item, index) in currentType"
251
-                  :key="index"
252
-                  class="flex rounded-full border border-solid border-1px border-yellow text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">
253
-                {{ item }}
354
+              <div class="flex rounded-full  text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">
355
+                <image class="vip_img" :src="userType" v-if="userType"></image>
356
+                <!-- <image class="vip_img" :src="AlholderType" v-if="AlholderType
357
+                  "></image>
358
+                <image class="vip_img" :src="areaType" v-if="areaType"></image> -->
254 359
               </div>
255 360
             </div>
256
-<!--            <div-->
257
-<!--                class="flex rounded-full border border-solid border-1px border-yellow text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">-->
258
-<!--              {{ userType }}-->
259
-<!--            </div>-->
361
+            <!--            <div-->
362
+            <!--                class="flex rounded-full border border-solid border-1px border-yellow text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">-->
363
+            <!--              {{ userType }}-->
364
+            <!--            </div>-->
260 365
           </div>
261 366
 
262 367
 
263 368
         </div>
264 369
         <div class="bg-white rounded flex flex-col gap-6 py-4 text-xl">
265
-          <div
266
-              v-if="userStore.userInfo"
267
-              class="flex flex-wrap">
268
-            <div
269
-                @tap="handleShowAnnuityDetail"
270
-                class="w-1/3 flex flex-col justify-center items-center"
271
-            >
370
+          <div v-if="userStore.userInfo" class="flex flex-wrap">
371
+            <div @tap="handleShowAnnuityDetail" class="w-1/3 flex flex-col justify-center items-center">
272 372
               <div>{{ userStore.yanglao.all_yanglao }}</div>
273 373
               <div class="text-xs">养老金</div>
274 374
             </div>
275
-            <div
276
-                @tap="handleShowMyInvitation"
277
-                class="w-1/3  flex flex-col justify-center items-center">
375
+            <div @tap="handleShowMyInvitation" class="w-1/3  flex flex-col justify-center items-center">
278 376
               <div>{{ agentInfo.brokerage_price ? agentInfo.brokerage_price : '0' }}</div>
279 377
               <div class="text-xs">我的佣金</div>
280 378
             </div>
281
-            <div
282
-                @tap="handleShowMyIntegral"
283
-                class="w-1/3  flex flex-col justify-center items-center">
379
+            <div @tap="handleShowMyIntegral" class="w-1/3  flex flex-col justify-center items-center">
284 380
               <div>{{ userStore.userInfo.score }}</div>
285 381
               <div class="text-xs">我的积分</div>
286 382
             </div>
287 383
           </div>
288
-          <div
289
-              v-if="userStore.userInfo"
290
-              class="flex">
291
-            <div
292
-                @click="handleToRedIntegral"
293
-                class="w-1/2 flex flex-col justify-center items-center">
384
+          <div v-if="userStore.userInfo" class="flex">
385
+            <div @click="handleToRedIntegral" class="w-1/2 flex flex-col justify-center items-center">
294 386
               <div>{{ userStore.userInfo.red }}</div>
295 387
               <div class="text-xs">红积分提现</div>
296 388
             </div>
@@ -304,22 +396,14 @@ function handleToVipPage() {
304 396
 
305 397
       </div>
306 398
 
307
-      <div
308
-          v-if="ruleDetail && ruleDetail.content && !showUpgradeInfo"
309
-          class="p-3 bg-white text-sm text-gray-500"
310
-      >
399
+      <div v-if="ruleDetail && ruleDetail.content && !showUpgradeInfo" class="p-3 bg-white text-sm text-gray-500">
311 400
         <mpHtml :content="ruleDetail.content"></mpHtml>
312 401
       </div>
313
-      <div
314
-          v-else
315
-          class="p-3 bg-white text-sm text-gray-500"
316
-      >
402
+      <div v-else class="p-3 bg-white text-sm text-gray-500">
317 403
         <mpHtml :content="ruleDetail.content" v-if="ruleDetail && ruleDetail.content"></mpHtml>
318 404
 
319 405
         <div class="flex justify-center items-center">
320
-          <nut-button
321
-              @click="handleToVipPage"
322
-              type="primary" size="small">立即开通</nut-button>
406
+          <nut-button @click="handleToVipPage" type="primary" size="small">立即开通</nut-button>
323 407
 
324 408
         </div>
325 409
       </div>
@@ -330,10 +414,8 @@ function handleToVipPage() {
330 414
         <div class="font-bold">还有更多奖励权益</div>
331 415
         <div class="flex justify-end">
332 416
 
333
-          <div
334
-              @click="handleUserUpgrade"
335
-              class="text-[12px] border border-solid border-1px rounded px-1 border-gray text-gray-600"
336
-          >了解更多奖励</div>
417
+          <div @click="handleUserUpgrade"
418
+            class="text-[12px] border border-solid border-1px rounded px-1 border-gray text-gray-600">了解更多奖励</div>
337 419
         </div>
338 420
       </div>
339 421
 
@@ -341,8 +423,6 @@ function handleToVipPage() {
341 423
 
342 424
     </div>
343 425
   </div>
344
-
345
-
346 426
 </template>
347 427
 
348 428
 <route lang="yaml">
@@ -355,7 +435,13 @@ style:
355 435
 </route>
356 436
 
357 437
 <style>
358
-page{
438
+page {
359 439
   background: #f5f5f5;
360 440
 }
441
+
442
+.vip_img {
443
+  width: 48px;
444
+  height: 24px;
445
+  margin-left: 2px;
446
+}
361 447
 </style>

+ 15 - 4
src/pages/order-confirm/index.vue

@@ -60,6 +60,7 @@ onLoad(async (options) => {
60 60
   //   })
61 61
   // }
62 62
   const res = await getUserAddressList()
63
+  console.log('我可是res啊',res)
63 64
   if (res.list && res.list.length > 0) {
64 65
     data.addressInfo = res.list[0]
65 66
     data.addressId = res.list[0].address_id
@@ -226,6 +227,11 @@ function handleAddressSelect() {
226 227
     url: '/pages/user/address/index?from=order'
227 228
   })
228 229
 }
230
+function gotoCoupon() {
231
+  uni.navigateTo({
232
+    url: '/pages/to-coupon/to-coupon'
233
+  })
234
+}
229 235
 function handleNumberChange(num, goodItem) {
230 236
   console.log(goodItem)
231 237
   uni.showLoading()
@@ -241,9 +247,12 @@ function reTotal() {
241 247
     cart_id: data.cartId.split(','),
242 248
     address_id: data.addressId
243 249
   }).then(res => {
244
-    console.log(res)
250
+    console.log('我可是res啊',res)
245 251
     data.is_dacang_vip_product = res.is_dacang_vip_product
246 252
     data.cartOrder = res.order
253
+    console.log('data.cartOrder',data.cartOrder);
254
+    
255
+    
247 256
     data.totalPrice = res.order_price
248 257
     data.orderStatus = res.status
249 258
     // data.proPrice = res.proPrice
@@ -331,7 +340,7 @@ function reTotal() {
331 340
               </div>
332 341
               <div class="flex flex-col w-full">
333 342
                 <div class="flex flex-col ">
334
-                  <div class="line-clamp-2 text-xs">
343
+                  <div class="line-clamp-1 text-xs">
335 344
                     {{ orderProductItem.product.store_name }}
336 345
                   </div>
337 346
                   <div class="text-[11px] text-gray-500">{{ orderProductItem.productAttr.sku }}</div>
@@ -352,16 +361,18 @@ function reTotal() {
352 361
 
353 362
           </div>
354 363
           <div>
364
+            <!-- 优惠券数据 先写死 -->
355 365
             <FCell
356 366
                 v-if="item.mer_id != '148'"
357 367
                 title="优惠劵"
358
-                :value="item.order.coupon_price ? item.order.coupon_price : '暂无优惠券'"
368
+                :value="item.order.youhui_price!=0 ? item.order.youhui_price : '暂无优惠券'"
359 369
                 arrow
370
+                @click="gotoCoupon"
360 371
             ></FCell>
361 372
             <FCell
362 373
                 v-if="item.mer_id == '148'"
363 374
                 title="积分"
364
-                :value="userStore.userInfo.score ? userStore.userInfo.score : '暂无积分'"
375
+                :value="userStore.userInfo.score!='0' ? userStore.userInfo.score : '暂无积分'"
365 376
                 arrow
366 377
             ></FCell>
367 378
             <FCell

+ 4 - 1
src/pages/order/components/AllItemList.vue

@@ -14,7 +14,6 @@ const state = reactive({
14 14
   currentPage: 1,
15 15
   pageSize: 10,
16 16
   totalPage: 1,
17
-
18 17
   list: []
19 18
 })
20 19
 
@@ -35,7 +34,11 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
35 34
     page: state.currentPage,
36 35
     limit: state.pageSize
37 36
   }).then(res => {
37
+<<<<<<< HEAD
38 38
     // console.log(res)
39
+=======
40
+    console.log('>>>>>',res)
41
+>>>>>>> li-yi
39 42
     if (action === 'page') {
40 43
       state.list = state.list.concat(res.list)
41 44
     }

+ 87 - 37
src/pages/order/components/OrderItem.vue

@@ -1,16 +1,17 @@
1 1
 <script setup lang="ts">
2 2
 import FPrice from "~/components/FPrice/FPrice.vue";
3
-import {OrderListModel} from "~/apis/model/order.model";
4
-import {cancelOrder, takeOrder} from "~/apis/order.api";
5
-import {encodeBase64} from "~/utils/http/helper";
6
-import {deleteAddress} from "~/apis/user";
3
+import { OrderListModel } from "~/apis/model/order.model";
4
+import { cancelOrder, takeOrder } from "~/apis/order.api";
5
+import { encodeBase64 } from "~/utils/http/helper";
6
+import { deleteAddress } from "~/apis/user";
7 7
 import {
8 8
   DyProductModel,
9 9
   JdProductModel,
10 10
   SuNingProductModel,
11 11
   TaobaoProductThirdPartyWaresModel, VipProductModel
12 12
 } from "~/apis/model/product.model";
13
-import {DcProductModel} from "~/apis/model/dacang.model";
13
+import { DcProductModel } from "~/apis/model/dacang.model";
14
+import { error } from "console";
14 15
 const props = defineProps({
15 16
   orderItem: {
16 17
     type: Object,
@@ -38,7 +39,10 @@ const props = defineProps({
38 39
 //     }
39 40
 //   }
40 41
 // })
42
+//全部订单页面
41 43
 function getStatusText(orderItem: OrderListModel) {
44
+  // console.log('我是》',orderItem.status);
45
+
42 46
   // if (props.status === 5) {
43 47
   //   return '未支付'
44 48
   // }
@@ -65,7 +69,14 @@ function getStatusText(orderItem: OrderListModel) {
65 69
   if (orderItem.status == 4) {
66 70
     return '已申请退款'
67 71
   }
72
+<<<<<<< HEAD
68 73
   if (orderItem.status == 5) {
74
+=======
75
+  if (orderItem.status === 5) {
76
+    return '已取消订单'
77
+  }
78
+  if (orderItem.status === '5') {
79
+>>>>>>> li-yi
69 80
     return '待付款'
70 81
   }
71 82
 }
@@ -79,23 +90,39 @@ function handleHeaderClick() {
79 90
 /**
80 91
  * 取消订单
81 92
  */
82
-function handleCancelOrder() {
83
-  console.log('取消订单操作')
84
-  cancelOrder(props.orderItem.group_order_id).then(res => {
85
-    setTimeout(() => {
86
-      uni.showToast({
87
-        title: '取消成功',
88
-        icon: 'none'
89
-      })
90
-
91
-      // if (props.tabValue)
92
-      uni.$emit('orderCancelFromList', props.tabValue)
93
-
94
-    }, 300)
95 93
 
96
-  })
94
+function handleCancelOrder() {
95
+  uni.showModal({
96
+    title: '取消订单',
97
+    content: '您确定要取消订单吗?',
98
+    confirmColor: '#FE0032',
99
+    success: function (modalRes) {
100
+      if (modalRes.confirm) {
101
+        console.log('用户点击确定', props.orderItem.group_order_id);
102
+        cancelOrder(props.orderItem.group_order_id)
103
+          .then(res => {
104
+            uni.showToast({
105
+              title: '取消成功',
106
+              icon: 'none'
107
+            });
108
+            // 如果需要刷新订单列表,可以触发事件
109
+            // if (props.tabValue)
110
+            uni.$emit('orderCancelFromList', props.tabValue);
111
+          })
112
+          .catch(error => {
113
+            uni.showToast({
114
+              title: error, // 或者使用 error 信息
115
+              icon: 'none'
116
+            });
117
+          });
118
+      } else if (modalRes.cancel) {
119
+        console.log('用户点击取消', props.orderItem.group_order_id);
120
+      }
121
+    }
122
+  });
97 123
 }
98 124
 
125
+
99 126
 function handlePayment() {
100 127
   const { orderItem } = props
101 128
   uni.navigateTo({
@@ -159,7 +186,7 @@ function handleComment(orderItem) {
159 186
 }
160 187
 
161 188
 function handleProductItemClick(
162
-    item
189
+  item
163 190
 ) {
164 191
   // function navigateToDetail(params) {
165 192
   //   let otherDetailUrl = `/pages/store/product/other`
@@ -167,15 +194,17 @@ function handleProductItemClick(
167 194
   //     url: `${otherDetailUrl}?params=${params}`
168 195
   //   })
169 196
   // }
170
-  // console.log(item)
197
+  console.log('我是item', item)
171 198
   // 大仓
172 199
   uni.navigateTo({
173
-    url: `/pages/store/product/detail?id=${item.orderProduct[0].product_id}`
200
+    url: `/pages/store/product/detail?id=${(item.orderProduct[0])?.product_id}`
174 201
   })
175 202
 }
176 203
 
177 204
 
178 205
 function handeRefund(orderItem) {
206
+  console.log('申请售后', orderItem);
207
+
179 208
   uni.navigateTo({
180 209
     // url: `/pages/refund/drawback?detail=${encodeBase64(orderItem)}`
181 210
     url: `/pages/refund/option?detail=${encodeBase64(orderItem)}&from=${props.tabValue}`
@@ -191,9 +220,7 @@ function handleShowObligationOrderDetail(orderItem) {
191 220
 
192 221
 <template>
193 222
   <div class="bg-white rounded p-3">
194
-    <div
195
-        @tap.stop="handleHeaderClick"
196
-        class="flex items-center justify-between f-hairline-bottom pb-3">
223
+    <div @tap.stop="handleHeaderClick" class="flex items-center justify-between f-hairline-bottom pb-3">
197 224
       <div class="flex items-center font-bold gap-2 text-sm justify-between">
198 225
         <div class="flex-1 flex items-center gap-2">
199 226
           <image :src="orderItem.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
@@ -237,18 +264,23 @@ function handleShowObligationOrderDetail(orderItem) {
237 264
 
238 265
             </div>
239 266
             <div class="flex justify-end gap-2" v-if="orderProduct.type == 5">
240
-              <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
267
+              <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
268
+                <div class="text-black">取消订单</div>
269
+              </nut-button>
241 270
               <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
242 271
 
243 272
             </div>
244 273
             <div class="flex justify-end gap-2" v-if="orderProduct.type == 0">
245
-              <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery"><div class="text-black">提醒发货</div></nut-button>
274
+              <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery">
275
+                <div class="text-black">提醒发货</div>
276
+              </nut-button>
246 277
               <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderProduct)">申请售后</nut-button>
247 278
             </div>
248 279
 
249 280
 
250 281
             <div class="flex justify-end gap-2" v-if="orderProduct.type == 1">
251
-              <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics(orderProduct)">查看物流</nut-button>
282
+              <nut-button size="small" plain type="default"
283
+                @tap.stop="handleShowLogistics(orderProduct)">查看物流</nut-button>
252 284
               <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderProduct)">申请售后</nut-button>
253 285
 
254 286
               <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder(orderProduct)">确认收货</nut-button>
@@ -256,7 +288,8 @@ function handleShowObligationOrderDetail(orderItem) {
256 288
             </div>
257 289
 
258 290
             <div class="flex justify-end gap-2" v-if="orderProduct.status == 2">
259
-              <nut-button size="small" plain type="default" @tap.stop="handleProductItemClick(orderProduct)">再次购买</nut-button>
291
+              <nut-button size="small" plain type="default"
292
+                @tap.stop="handleProductItemClick(orderProduct)">再次购买</nut-button>
260 293
               <nut-button size="small" plain type="primary" @tap.stop="handleComment(orderProduct)">去评价</nut-button>
261 294
 
262 295
             </div>
@@ -265,8 +298,9 @@ function handleShowObligationOrderDetail(orderItem) {
265 298
 
266 299
       </div>
267 300
 
268
-      <div v-else  @tap.stop="handleShowOrderDetail(orderItem)">
269
-        <div v-for="(orderProduct, orderProductIndex) in orderItem.orderProduct" :key="orderProductIndex" class="flex flex-col gap-3">
301
+      <div v-else @tap.stop="handleShowOrderDetail(orderItem)">
302
+        <div v-for="(orderProduct, orderProductIndex) in orderItem.orderProduct" :key="orderProductIndex"
303
+          class="flex flex-col gap-3">
270 304
           <div class="flex py-2 gap-3">
271 305
             <div class="flex-1 flex gap-2">
272 306
               <div class="flex w-20">
@@ -284,7 +318,7 @@ function handleShowObligationOrderDetail(orderItem) {
284 318
             </div>
285 319
 
286 320
             <div class="flex flex-col justify-center items-center">
287
-<!--              <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>-->
321
+              <!--              <FPrice :price="orderProduct.cart_info.product.price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>-->
288 322
               <FPrice :price="orderProduct.product_price" ex-class="font-bold text-[12px] !text-[#000]"></FPrice>
289 323
               <div class="text-gray-500 text-[11px]">共{{ orderProduct.product_num }}件</div>
290 324
             </div>
@@ -293,13 +327,22 @@ function handleShowObligationOrderDetail(orderItem) {
293 327
 
294 328
         </div>
295 329
 
296
-        <div class="flex justify-end gap-2" v-if="orderItem.status == 5">
297
-          <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
330
+        <div class="flex justify-end gap-2" v-if="orderItem.status === '5'">
331
+          <!-- <div class="title-line">09:02:00后订单将关闭</div> -->
332
+          <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
333
+            <div class="text-black">取消订单</div>
334
+          </nut-button>
298 335
           <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
299 336
 
300 337
         </div>
338
+        <div class="flex justify-end gap-2" v-if="orderItem.status === 5">
339
+
340
+
341
+        </div>
301 342
         <div class="flex justify-end gap-2" v-if="orderItem.status == 0">
302
-          <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery"><div class="text-black">提醒发货</div></nut-button>
343
+          <nut-button size="small" type="default" @tap.stop="handleRemindTheDelivery">
344
+            <div class="text-black">提醒发货</div>
345
+          </nut-button>
303 346
           <nut-button size="small" plain type="default" @tap.stop="handeRefund(orderItem)">申请售后</nut-button>
304 347
         </div>
305 348
 
@@ -320,6 +363,13 @@ function handleShowObligationOrderDetail(orderItem) {
320 363
     </div>
321 364
 
322 365
   </div>
323
-
324
-
325 366
 </template>
367
+<style  scoped>
368
+.title-line {
369
+  font-size: 24rpx;
370
+  /* 字体大小 */
371
+  color: #333;
372
+  line-height: 56rpx;
373
+  margin-right: 80rpx;
374
+}
375
+</style> 

+ 107 - 26
src/pages/order/components/OrderObligationItem.vue

@@ -1,16 +1,16 @@
1 1
 <script setup lang="ts">
2 2
 import FPrice from "~/components/FPrice/FPrice.vue";
3
-import {OrderListModel} from "~/apis/model/order.model";
4
-import {cancelOrder, takeOrder} from "~/apis/order.api";
5
-import {encodeBase64} from "~/utils/http/helper";
6
-import {deleteAddress} from "~/apis/user";
3
+import { OrderListModel } from "~/apis/model/order.model";
4
+import { cancelOrder, takeOrder } from "~/apis/order.api";
5
+import { encodeBase64 } from "~/utils/http/helper";
6
+import { deleteAddress } from "~/apis/user";
7 7
 import {
8 8
   DyProductModel,
9 9
   JdProductModel,
10 10
   SuNingProductModel,
11 11
   TaobaoProductThirdPartyWaresModel, VipProductModel
12 12
 } from "~/apis/model/product.model";
13
-import {DcProductModel} from "~/apis/model/dacang.model";
13
+import { DcProductModel } from "~/apis/model/dacang.model";
14 14
 const props = defineProps({
15 15
   orderItem: {
16 16
     type: Object,
@@ -24,6 +24,9 @@ const props = defineProps({
24 24
   }
25 25
 })
26 26
 
27
+
28
+
29
+
27 30
 // function detailOrderList(p) {}
28 31
 // const dealOrderList =computed(() => {
29 32
 //   if (props.orderItem) {
@@ -63,8 +66,16 @@ function getStatusText(orderItem: OrderListModel) {
63 66
   if (orderItem.status == 4) {
64 67
     return '已申请退款'
65 68
   }
69
+<<<<<<< HEAD
66 70
   if (orderItem.status == 5) {
67 71
     return '待付款'
72
+=======
73
+  if (orderItem.status === 5) {
74
+    return '待付款'
75
+  }
76
+  if (orderItem.status === '5') {
77
+    return '已取消'
78
+>>>>>>> li-yi
68 79
   }
69 80
 }
70 81
 
@@ -78,19 +89,34 @@ function handleHeaderClick() {
78 89
  * 取消订单
79 90
  */
80 91
 function handleCancelOrder() {
81
-  console.log('取消订单操作')
82
-  cancelOrder(props.orderItem.group_order_id).then(res => {
83
-    setTimeout(() => {
84
-      uni.showToast({
85
-        title: '取消成功',
86
-        icon: 'none'
87
-      })
88
-
89
-      uni.$emit('orderCancelFromList')
90
-
91
-    }, 300)
92
-
93
-  })
92
+  uni.showModal({
93
+    title: '取消订单',
94
+    content: '您确定要取消订单吗?',
95
+    confirmColor: '#FE0032',
96
+    success: function (modalRes) {
97
+      if (modalRes.confirm) {
98
+        console.log('用户点击确定', props.orderItem.group_order_id);
99
+        cancelOrder(props.orderItem.group_order_id)
100
+          .then(res => {
101
+            uni.showToast({
102
+              title: '取消成功',
103
+              icon: 'none'
104
+            });
105
+            // 如果需要刷新订单列表,可以触发事件
106
+            // if (props.tabValue)
107
+            uni.$emit('orderCancelFromList', props.tabValue);
108
+          })
109
+          .catch(error => {
110
+            uni.showToast({
111
+              title: error, // 或者使用 error 信息
112
+              icon: 'none'
113
+            });
114
+          });
115
+      } else if (modalRes.cancel) {
116
+        console.log('用户点击取消', props.orderItem.group_order_id);
117
+      }
118
+    }
119
+  });
94 120
 }
95 121
 
96 122
 function handlePayment() {
@@ -156,7 +182,7 @@ function handleComment(orderItem) {
156 182
 }
157 183
 
158 184
 function handleProductItemClick(
159
-    item
185
+  item
160 186
 ) {
161 187
   // function navigateToDetail(params) {
162 188
   //   let otherDetailUrl = `/pages/store/product/other`
@@ -184,13 +210,56 @@ function handleShowObligationOrderDetail(orderItem) {
184 210
     url: '/pages/order/obligation-detail?detail=' + `${encodeBase64(orderItem)}&type=1`
185 211
   })
186 212
 }
213
+
214
+
215
+
216
+// const remainingTime: any = ref({
217
+//   hours: 0,
218
+//   minutes: 0,
219
+//   seconds: 0
220
+// })
221
+// //计算取消时间
222
+// function updateRemainingTime(detail: any) {
223
+//   const currentTime = new Date().getTime();
224
+//   const endTime = new Date(detail.close_time).getTime();
225
+//   const timeDifference = endTime - currentTime;
226
+
227
+//   // 计算剩余时间
228
+//   const hours = Math.floor(timeDifference / (1000 * 60 * 60));
229
+//   const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
230
+//   const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
231
+
232
+//   // 更新数据
233
+//   remainingTime.value = {
234
+//     hours: hours < 10 ? '0' + hours : hours,
235
+//     minutes: minutes < 10 ? '0' + minutes : minutes,
236
+//     seconds: seconds < 10 ? '0' + seconds : seconds
237
+//   }
238
+// }
239
+
240
+
241
+// // 每秒更新剩余时间
242
+// const timer = setInterval(() => {
243
+//   if (remainingTime.hours <= 0 && remainingTime.minutes <= 0) {
244
+//     // 达到设定时间,执行关闭操作,你可以在这里添加你的关闭逻辑
245
+//     clearInterval(timer);
246
+//     console.log('自动关闭');
247
+//   }
248
+//   updateRemainingTime(props.orderItem)
249
+// }, 1000);
250
+
251
+// onUnload(() => {
252
+//   clearInterval(timer);
253
+//   console.log('卸载关闭');
254
+// })
255
+
256
+
257
+
187 258
 </script>
188 259
 
189 260
 <template>
190 261
   <div class="mb-3 bg-white rounded p-3">
191
-    <div
192
-        @click.stop="handleHeaderClick"
193
-        class="flex items-center justify-between f-hairline-bottom pb-3">
262
+    <div @click.stop="handleHeaderClick" class="flex items-center justify-between f-hairline-bottom pb-3">
194 263
       <div class="flex items-center font-bold gap-2 text-sm justify-between">
195 264
         <div class="flex-1 flex items-center gap-2">
196 265
           <image :src="orderItem.merchant.mer_avatar" mode="widthFix" class="w-4 h-4"></image>
@@ -214,7 +283,7 @@ function handleShowObligationOrderDetail(orderItem) {
214 283
               <div class="flex-1 flex gap-2">
215 284
                 <div class="flex w-20 h-20">
216 285
 
217
-                <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
286
+                  <image :src="orderProduct.cart_info.product.image" class="w-20 h-20" mode="widthFix"></image>
218 287
                 </div>
219 288
                 <div class="flex flex-col">
220 289
                   <div class="line-clamp-2 text-[12px]">
@@ -236,7 +305,11 @@ function handleShowObligationOrderDetail(orderItem) {
236 305
           </div>
237 306
         </div>
238 307
         <div class="flex justify-end gap-2">
239
-          <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
308
+          <!-- <div class="title-line">{{ remainingTime.hours }}:{{ remainingTime.minutes }}:{{ remainingTime.seconds }}后订单将关闭
309
+          </div> -->
310
+          <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
311
+            <div class="text-black">取消订单</div>
312
+          </nut-button>
240 313
           <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
241 314
 
242 315
         </div>
@@ -245,6 +318,14 @@ function handleShowObligationOrderDetail(orderItem) {
245 318
     </div>
246 319
 
247 320
   </div>
248
-
249
-
250 321
 </template>
322
+
323
+<style scoped>
324
+.title-line {
325
+  font-size: 24rpx;
326
+  /* 字体大小 */
327
+  color: #333;
328
+  line-height: 56rpx;
329
+  margin-right: 80rpx;
330
+}
331
+</style>

+ 1 - 1
src/pages/order/components/OtherOrderItem.vue

@@ -51,7 +51,7 @@ function handleClick() {
51 51
   //   id: product.goods_id,
52 52
   //   featured: [product.goods_img]
53 53
   // })
54
-  console.log(product)
54
+  console.log('woshi111',product)
55 55
   // if (product.source == '6') {
56 56
   const productId = props.item.source == '1' ? product.goods_sign : product.goods_id
57 57
   // console.log(productId)

+ 5 - 5
src/pages/order/components/RefundOrderItem.vue

@@ -48,14 +48,14 @@ function getStatusText(orderItem) {
48 48
   }
49 49
   if (orderItem.status == 0) {
50 50
     // return '待审核'
51
-    return '退款中'
51
+    return '审核中'
52 52
   }
53 53
   if (orderItem.status == 1) {
54 54
     // return '待退货'
55
-    return '退款中'
55
+    return '审核中'
56 56
   }
57 57
   if (orderItem.status == 2) {
58
-    return '退款中'
58
+    return '审核中'
59 59
     // return '待收货'
60 60
   }
61 61
   if (orderItem.status == 3) {
@@ -192,8 +192,8 @@ function handleShowDetail(orderItem) {
192 192
           <div class="f-text-color-2 i-tabler-chevron-right"></div>
193 193
 
194 194
       </div>
195
-      <div class=" text-xs flex w-15 justify-end"
196
-           :class="(orderItem.status == 3 || orderItem.status == -1) ? 'text-gray' : 'text-primary'"
195
+      <div class=" text-xs flex w-15 justify-end  'text-primary'"
196
+           
197 197
       >
198 198
         {{ getStatusText(orderItem) }}
199 199
       </div>

+ 139 - 135
src/pages/order/detail.vue

@@ -1,11 +1,11 @@
1 1
 <script setup lang="ts">
2 2
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
3
-import {encodePhone} from "~/utils";
4
-import {CDN_URL} from "~/config/app";
5
-import {useAddressStore} from "~/stores/addressStore";
3
+import { encodePhone } from "~/utils";
4
+import { CDN_URL } from "~/config/app";
5
+import { useAddressStore } from "~/stores/addressStore";
6 6
 import FPrice from "~/components/FPrice/FPrice.vue";
7
-import {cancelOrder, takeOrder} from "~/apis/order.api";
8
-import {decodeBase64, encodeBase64} from "~/utils/http/helper";
7
+import { cancelOrder, takeOrder } from "~/apis/order.api";
8
+import { decodeBase64, encodeBase64 } from "~/utils/http/helper";
9 9
 
10 10
 const addressIcon = CDN_URL + '/static/assets/dingwi_220624.png'
11 11
 const addressStore = useAddressStore()
@@ -25,7 +25,7 @@ onLoad((options) => {
25 25
   // console.log(options.detail)
26 26
   if (options.detail) {
27 27
     detail.value = JSON.parse(decodeBase64(options.detail))
28
-  // detail.value = JSON.parse(decodeBase64(base64Json))
28
+    // detail.value = JSON.parse(decodeBase64(base64Json))
29 29
   }
30 30
   if (options.type) {
31 31
     state.type = options.type
@@ -64,6 +64,8 @@ onLoad((options) => {
64 64
 function handleCancelOrder() {
65 65
   console.log('取消订单操作')
66 66
   cancelOrder(detail.value.group_order_id).then(res => {
67
+    console.log('RES',res);
68
+    
67 69
     uni.showToast({
68 70
       title: '取消成功',
69 71
       icon: 'none'
@@ -73,11 +75,15 @@ function handleCancelOrder() {
73 75
       uni.navigateBack()
74 76
     }, 300)
75 77
 
76
-  }).catch(error => {
77
-
78
-    uni.navigateTo({
79
-      url: '/pages/user/login/index?key=30'
80
-    })
78
+  })
79
+  .catch(error => {
80
+    // uni.showToast({
81
+    //   title: error,
82
+    //   icon: 'none'
83
+    // })
84
+    // uni.navigateTo({
85
+    //   url: '/pages/user/login/index?key=30'
86
+    // })
81 87
   })
82 88
 }
83 89
 
@@ -86,7 +92,7 @@ function handlePayment() {
86 92
   // const { orderItem } = detail.value
87 93
   // console.log(orderItem)
88 94
   uni.navigateTo({
89
-    url: '/pages/payment/index?' + `pay_price=${ detail.value.pay_price}&order_id=${ detail.value.group_order_id}&OrderList=${JSON.stringify( detail.value)}`
95
+    url: '/pages/payment/index?' + `pay_price=${detail.value.pay_price}&order_id=${detail.value.group_order_id}&OrderList=${JSON.stringify(detail.value)}`
90 96
     // url: `/pages/payment/index`
91 97
   })
92 98
 }
@@ -181,14 +187,14 @@ const payType = computed(() => {
181 187
 })
182 188
 
183 189
 const getSymbol = (pay_type: string) => {
184
-    if (pay_type === '5') {
185
-      return '积分'
186
-    } else {
187
-      return '¥'
188
-    }
190
+  if (pay_type === '5') {
191
+    return '积分'
192
+  } else {
193
+    return '¥'
194
+  }
189 195
 }
190 196
 function handleProductItemClick(
191
-    item
197
+  item
192 198
 ) {
193 199
   console.log(item.product_id)
194 200
   // 大仓
@@ -200,167 +206,165 @@ function handleProductItemClick(
200 206
 
201 207
 </script>
202 208
 <template>
203
-    <div class="p-3 flex flex-col gap-3 pb-safe text-[12px]" v-if="detail">
204
-      <div
205
-          class="rounded bg-white p-3 flex">
206
-        <div class="flex flex-col flex-1 gap-2">
207
-          <div class="flex items-center gap-2">
208
-            <div class="flex text-sm text-gray-500 justify-between items-center w-full">
209
-              <div class="flex-1 flex items-center gap-2">
210
-                <div class="w-fit flex">
211
-                  <image :src="addressIcon" mode="widthFix" class="w-4 h-4"></image>
212
-                </div>
213
-                <div class="flex-1 flex">
214
-                  {{ detail.user_address }}
215
-                </div>
209
+  <div class="p-3 flex flex-col gap-3 pb-safe text-[12px]" v-if="detail">
210
+    <div class="rounded bg-white p-3 flex">
211
+      <div class="flex flex-col flex-1 gap-2">
212
+        <div class="flex items-center gap-2">
213
+          <div class="flex text-sm text-gray-500 justify-between items-center w-full">
214
+            <div class="flex-1 flex items-center gap-2">
215
+              <div class="w-fit flex">
216
+                <image :src="addressIcon" mode="widthFix" class="w-4 h-4"></image>
217
+              </div>
218
+              <div class="flex-1 flex">
219
+                {{ detail.user_address }}
216 220
               </div>
221
+            </div>
217 222
 
218
-              <div class="w-4 flex i-tabler-chevron-right text-gray"></div>
223
+            <div class="w-4 flex i-tabler-chevron-right text-gray"></div>
219 224
 
220
-            </div>
221 225
           </div>
222
-          <!--          <div class="flex text-sm font-bold">{{ data.addressInfo.detail }}</div>-->
223
-          <div class="flex gap-2 items-center text-xs text-gray-500">
224
-            <div>
225
-              {{ detail.real_name }}
226
-            </div>
227
-            <div v-if="detail.user_phone">
228
-              {{ encodePhone(detail.user_phone) }}
229
-            </div>
226
+        </div>
227
+        <!--          <div class="flex text-sm font-bold">{{ data.addressInfo.detail }}</div>-->
228
+        <div class="flex gap-2 items-center text-xs text-gray-500">
229
+          <div>
230
+            {{ detail.real_name }}
231
+          </div>
232
+          <div v-if="detail.user_phone">
233
+            {{ encodePhone(detail.user_phone) }}
230 234
           </div>
231 235
         </div>
232 236
       </div>
237
+    </div>
233 238
 
234
-      <div class="bg-white rounded">
235
-        <div class="flex items-center gap-2 text-sm font-bold f-hairline-bottom p-3" v-if="detail.merchant">
236
-          <image :src="detail.merchant.mer_avatar" mode="widthFix" class="w-5 h-5"></image>
237
-          <div>{{ detail.merchant.mer_name }}</div>
238
-        </div>
239
+    <div class="bg-white rounded">
240
+      <div class="flex items-center gap-2 text-sm font-bold f-hairline-bottom p-3" v-if="detail.merchant">
241
+        <image :src="detail.merchant.mer_avatar" mode="widthFix" class="w-5 h-5"></image>
242
+        <div>{{ detail.merchant.mer_name }}</div>
243
+      </div>
239 244
 
240
-        <div v-for="(productItem, productIndex) in detail.orderProduct" :key="productIndex" class="p-3">
241
-          <div class="flex gap-2">
242
-            <div  @tap.stop="handleProductItemClick(productItem)">
243
-              <image :src="productItem.cart_info.product.image" mode="widthFix" class="rounded w-20 h-20"></image>
245
+      <div v-for="(productItem, productIndex) in detail.orderProduct" :key="productIndex" class="p-3">
246
+        <div class="flex gap-2">
247
+          <div @tap.stop="handleProductItemClick(productItem)">
248
+            <image :src="productItem.cart_info.product.image" mode="widthFix" class="rounded w-20 h-20"></image>
244 249
 
245
-            </div>
246
-            <div class="flex flex-col w-full">
247
-              <div class="flex flex-col text-sm ">
248
-                <div class="flex justify-between" @tap.stop="handleProductItemClick(productItem)">
249
-                  <div class="flex">
250
-                    {{ productItem.cart_info.product.store_name }}
251
-                  </div>
252
-                  <div class="flex">¥{{ productItem.product_price }}</div>
250
+          </div>
251
+          <div class="flex flex-col w-full">
252
+            <div class="flex flex-col text-sm ">
253
+              <div class="flex justify-between" @tap.stop="handleProductItemClick(productItem)">
254
+                <div class="flex">
255
+                  {{ productItem.cart_info.product.store_name }}
253 256
                 </div>
257
+                <div class="flex">¥{{ productItem.product_price }}</div>
258
+              </div>
254 259
 
255 260
 
256
-                <div class="text-[11px] text-gray-500 flex justify-between">
257
-                  <div class="">{{ productItem.cart_info.productAttr.sku }}</div>
258
-                  <div class="">共{{ productItem.product_num }}件</div>
259
-                </div>
260
-
261
+              <div class="text-[11px] text-gray-500 flex justify-between">
262
+                <div class="">{{ productItem.cart_info.productAttr.sku }}</div>
263
+                <div class="">共{{ productItem.product_num }}件</div>
261 264
               </div>
265
+
262 266
             </div>
263 267
           </div>
264 268
         </div>
269
+      </div>
265 270
 
266 271
 
267
-        <div class=" flex flex-col gap-3 p-3">
268
-          <div class="flex justify-end" v-if="detail.status == 1 || detail.status == 2 || detail.status == 3 || detail.status == 0">
269
-            <nut-button size="small" plain type="default" @tap.stop="handeRefund">申请售后</nut-button>
270
-          </div>
271
-<!--          <div class="flex justify-end" v-if="detail.status == 0">-->
272
-<!--            <nut-button size="small" plain type="default" @tap.stop="handeRefund">申请退款</nut-button>-->
273
-<!--          </div>-->
272
+      <div class=" flex flex-col gap-3 p-3">
273
+        <div class="flex justify-end"
274
+          v-if="detail.status == 1 || detail.status == 2 || detail.status == 3 || detail.status == 0">
275
+          <nut-button size="small" plain type="default" @tap.stop="handeRefund">申请售后</nut-button>
276
+        </div>
277
+        <!--          <div class="flex justify-end" v-if="detail.status == 0">-->
278
+        <!--            <nut-button size="small" plain type="default" @tap.stop="handeRefund">申请退款</nut-button>-->
279
+        <!--          </div>-->
274 280
 
275
-          <div class="flex justify-between">
276
-            <div>商品总额</div>
277
-            <div class="text-gray">{{getSymbol(detail.pay_type)}}{{ detail.total_price }}</div>
278
-          </div>
279
-          <div class="flex justify-between">
280
-            <div>优惠金额</div>
281
-            <div class="text-gray">{{getSymbol(detail.pay_type)}}{{ detail.coupon_price }}</div>
282
-          </div>
283
-          <div class="flex justify-between">
284
-            <div>运费</div>
285
-            <div class="text-gray">
286
-              {{getSymbol(detail.pay_type)}}{{ detail.pay_postage }}
287
-            </div>
281
+        <div class="flex justify-between">
282
+          <div>商品总额</div>
283
+          <div class="text-gray">{{ getSymbol(detail.pay_type) }}{{ detail.total_price }}</div>
284
+        </div>
285
+        <div class="flex justify-between">
286
+          <div>优惠金额</div>
287
+          <div class="text-gray">{{ getSymbol(detail.pay_type) }}{{ detail.coupon_price }}</div>
288
+        </div>
289
+        <div class="flex justify-between">
290
+          <div>运费</div>
291
+          <div class="text-gray">
292
+            {{ getSymbol(detail.pay_type) }}{{ detail.pay_postage }}
288 293
           </div>
289
-          <div class="flex justify-between">
294
+        </div>
295
+        <div class="flex justify-between">
290 296
 
291
-            <div>实付款</div>
292
-            <div class="text-gray">
293
-              <FPrice :price="detail.pay_price" ex-class="font-bold text-xl" symbol="积分" v-if="detail.pay_type == 5"></FPrice>
294
-              <FPrice :price="detail.pay_price" ex-class="font-bold text-xl" v-else></FPrice>
295
-            </div>
297
+          <div>实付款</div>
298
+          <div class="text-gray">
299
+            <FPrice :price="detail.pay_price" ex-class="font-bold text-xl" symbol="积分" v-if="detail.pay_type == 5">
300
+            </FPrice>
301
+            <FPrice :price="detail.pay_price" ex-class="font-bold text-xl" v-else></FPrice>
296 302
           </div>
303
+        </div>
297 304
 
298
-          <div class="h-0.2 bg-gray-100 my-2"></div>
305
+        <div class="h-0.2 bg-gray-100 my-2"></div>
299 306
 
300
-<!--          <div class="flex justify-between">-->
307
+        <!--          <div class="flex justify-between">-->
301 308
 
302
-<!--            <div>订单编号</div>-->
303
-<!--            <div class="text-gray">{{ detail.order_sn }}</div>-->
304
-<!--          </div>-->
305
-          <div class="flex justify-between">
306
-            <div>订单编号</div>
307
-            <div class="flex gap-2">
308
-              <div class="text-gray-400">{{ detail.order_sn }}</div>
309
-              <div @click="handleClipboard">复制</div>
310
-            </div>
309
+        <!--            <div>订单编号</div>-->
310
+        <!--            <div class="text-gray">{{ detail.order_sn }}</div>-->
311
+        <!--          </div>-->
312
+        <div class="flex justify-between">
313
+          <div>订单编号</div>
314
+          <div class="flex gap-2">
315
+            <div class="text-gray-400">{{ detail.order_sn }}</div>
316
+            <div @click="handleClipboard">复制</div>
311 317
           </div>
312
-          <div class="flex justify-between">
318
+        </div>
319
+        <div class="flex justify-between">
313 320
 
314
-            <div>支付方式</div>
321
+          <div>支付方式</div>
315 322
 
316
-            <div class="text-gray">{{ payType }}</div>
317
-<!--            <div class="text-gray">{{ detail.pay_type === '0' ? '微信' : '支付宝' }}</div>-->
318
-          </div>
323
+          <div class="text-gray">{{ payType }}</div>
324
+          <!--            <div class="text-gray">{{ detail.pay_type === '0' ? '微信' : '支付宝' }}</div>-->
325
+        </div>
319 326
 
320
-          <div class="flex justify-between">
327
+        <div class="flex justify-between">
321 328
 
322
-            <div>下单时间</div>
323
-            <div class="text-gray">{{ detail.create_time }}</div>
324
-          </div>
329
+          <div>下单时间</div>
330
+          <div class="text-gray">{{ detail.create_time }}</div>
331
+        </div>
325 332
 
326
-          <div class="flex justify-between" v-if="detail.status != 5">
333
+        <div class="flex justify-between" v-if="detail.status != 5">
327 334
 
328
-            <div>支付时间</div>
329
-            <div class="text-gray">{{ detail.pay_time }}</div>
330
-            <!--            <div class="text-gray">{{ detail.pay_type === '0' ? '微信' : '支付宝' }}</div>-->
331
-          </div>
335
+          <div>支付时间</div>
336
+          <div class="text-gray">{{ detail.pay_time }}</div>
337
+          <!--            <div class="text-gray">{{ detail.pay_type === '0' ? '微信' : '支付宝' }}</div>-->
332 338
         </div>
333
-
334 339
       </div>
340
+
335 341
     </div>
342
+  </div>
336 343
 
337
-    <div class="fixed bottom-0 bg-white p-safe items-center  w-full">
338
-      <div class="flex justify-end gap-2 p-3"
339
-           v-if="detail.status == 5 || detail.type == 5"
340
-      >
341
-        <nut-button size="small" type="default" @tap.stop="handleCancelOrder"><div class="text-black">取消订单</div></nut-button>
342
-        <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
344
+  <div class="fixed bottom-0 bg-white p-safe items-center  w-full">
345
+    <div class="flex justify-end gap-2 p-3" v-if="detail.status == 5 || detail.type == 5">
346
+      <nut-button size="small" type="default" @tap.stop="handleCancelOrder">
347
+        <div class="text-black">取消订单</div>
348
+      </nut-button>
349
+      <nut-button size="small" plain type="primary" @tap.stop="handlePayment">立即支付</nut-button>
343 350
 
344
-      </div>
345
-      <div class="flex justify-end gap-2 p-3"
346
-           v-if="detail.status == 0 || detail.type == 0"
347
-      >
348
-        <nut-button size="small" type="primary" plain
349
-                    @tap.stop="handleRemindTheDelivery">提醒发货</nut-button>
351
+    </div>
352
+    <div class="flex justify-end gap-2 p-3" v-if="detail.status == 0 || detail.type == 0">
353
+      <nut-button size="small" type="primary" plain @tap.stop="handleRemindTheDelivery">提醒发货</nut-button>
350 354
 
351
-      </div>
352
-      <div class="flex justify-end gap-2 p-3" v-if="detail.status == 1 || detail.type == 1">
353
-        <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics">查看物流</nut-button>
355
+    </div>
356
+    <div class="flex justify-end gap-2 p-3" v-if="detail.status == 1 || detail.type == 1">
357
+      <nut-button size="small" plain type="default" @tap.stop="handleShowLogistics">查看物流</nut-button>
354 358
 
355
-        <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder">确认收货</nut-button>
359
+      <nut-button size="small" plain type="primary" @tap.stop="handleTakeOrder">确认收货</nut-button>
356 360
 
357
-      </div>
361
+    </div>
358 362
 
359
-      <div class="flex justify-end gap-2 p-3" v-if="detail.status == 2 || detail.type == 2">
360
-        <nut-button size="small" plain type="primary" @tap.stop="handleComment">去评价</nut-button>
363
+    <div class="flex justify-end gap-2 p-3" v-if="detail.status == 2 || detail.type == 2">
364
+      <nut-button size="small" plain type="primary" @tap.stop="handleComment">去评价</nut-button>
361 365
 
362
-      </div>
363 366
     </div>
367
+  </div>
364 368
 </template>
365 369
 
366 370
 <route lang="yaml">

+ 9 - 0
src/pages/order/index.vue

@@ -80,6 +80,7 @@ const getStatusVal = () => {
80 80
   }
81 81
 }
82 82
 onLoad(options => {
83
+<<<<<<< HEAD
83 84
   // console.log(options)
84 85
   if (uni.getStorageSync('UID')) {
85 86
     if (options && options.tabIndex) {
@@ -96,6 +97,14 @@ onLoad(options => {
96 97
         url: '/pages/user/login/index'
97 98
       })
98 99
     })
100
+=======
101
+  console.log('我是options》》',options)
102
+  if (options && options.tabIndex) {
103
+    state.tabvalue = options.tabIndex
104
+  }
105
+  if (options && options.from) {
106
+    state.from = options.from
107
+>>>>>>> li-yi
99 108
   }
100 109
   // loadAllOrderList()
101 110
 

+ 1 - 1
src/pages/order/logistics.vue

@@ -196,7 +196,7 @@ function handleMakePhoneCall() {
196 196
       <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3">
197 197
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
198 198
         <div>
199
-          大家都在买
199
+          精品推荐
200 200
         </div>
201 201
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
202 202
       </div>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 175 - 112
src/pages/order/obligation-detail.vue


+ 1 - 1
src/pages/order_addcart/index-bak.vue

@@ -569,7 +569,7 @@ function handleNumberChange(num, goodItem) {
569 569
       <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
570 570
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
571 571
         <div>
572
-          猜你喜欢
572
+      精品推荐
573 573
         </div>
574 574
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
575 575
       </div>

+ 1 - 1
src/pages/order_addcart/index-new.vue

@@ -439,7 +439,7 @@ function handleNumberChange(num, goodItem) {
439 439
       <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
440 440
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
441 441
         <div>
442
-          猜你喜欢
442
+          精品推荐
443 443
         </div>
444 444
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
445 445
       </div>

+ 277 - 103
src/pages/order_addcart/index.vue

@@ -1,8 +1,8 @@
1 1
 <script lang="ts" setup>
2
-import {getRecommendList} from "~/apis/merchant";
2
+import { getRecommendList, getProductDetail } from "~/apis/merchant";
3 3
 import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
4
-import {deleteCartItem, getCartCount, getCartList} from "~/apis/user";
5
-import type {ShoppingResult} from "~/apis/model/shopping.model";
4
+import { deleteCartItem, getCartCount, getCartList, xcxBanding } from "~/apis/user";
5
+import type { ShoppingResult } from "~/apis/model/shopping.model";
6 6
 import FPrice from "~/components/FPrice/FPrice.vue";
7 7
 import FButton from "~/components/FButton/FButton.vue";
8 8
 import CXBYaojinTag from "~/components/CXBYaojinTag/CXBYaojinTag.vue";
@@ -12,11 +12,14 @@ import {
12 12
   SuNingProductModel,
13 13
   TaobaoProductThirdPartyWaresModel, VipProductModel
14 14
 } from "~/apis/model/product.model";
15
-import {DcProductModel} from "~/apis/model/dacang.model";
16
-import {encodeBase64} from "~/utils/http/helper";
17
-import {CDN_URL} from "~/config/app";
18
-import {uniq} from "lodash-es";
19
-import {cartChange} from "~/apis/order.api";
15
+import { DcProductModel } from "~/apis/model/dacang.model";
16
+import { createShopping, changeProdoctSku } from "~/apis/order.api";
17
+import { encodeBase64 } from "~/utils/http/helper";
18
+import { CDN_URL } from "~/config/app";
19
+import { uniq } from "lodash-es";
20
+import { cartChange } from "~/apis/order.api";
21
+import type CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
22
+import CXBSkuPopup from "~/components/CXBSkuPopup/CXBSkuPopup.vue";
20 23
 const gouwucheImage = CDN_URL + '/static/assets/gouwuche.png'
21 24
 const like_adorn_220628Image = CDN_URL + '/static/assets/like_adorn_220628.png'
22 25
 const pageStore = usePageStoreWidthOut()
@@ -31,18 +34,99 @@ const state = reactive({
31 34
 
32 35
 
33 36
   totalCartCount: 0,
34
-  totalPrice: 0,
37
+  totalPrice: '',
35 38
   selectAllIndeterminate: false,
36 39
 
37 40
   cart_id: [],
41
+  changeSkuCart_id: '0',
38 42
   isManage: true,
39 43
 
40 44
   currentType: '',
45
+
46
+  isShowSku: false,
47
+  cartNum: 1,
48
+  currentSku: {
49
+    unique: ''
50
+  },
51
+  //新增
52
+  shareImage: '',
53
+  isRelation: '',
54
+  shareId: '',
55
+  status: '',
41 56
 })
57
+let uniqueclone = ref('')
58
+const detail: any = ref(null)
42 59
 
43
-const shopping = ref<ShoppingResult>()
44 60
 
61
+function onSelectedSku(currentSku: any) {
62
+  console.log("item", currentSku);
63
+
64
+  state.currentSku = currentSku
65
+
66
+}
67
+
68
+
69
+function handleCreateShopping() {
70
+  // console.log(state.flag)
71
+  console.log(state.currentSku.unique, '切换sku展示的商品', state.changeSkuCart_id)
72
+  uniqueclone.value = state.currentSku.unique
73
+  changeProdoctSku(
74
+    // product_attr_unique: JSON.stringify(state.currentSku),
75
+    // detail.value.unique
76
+    state.changeSkuCart_id,
77
+    state.currentSku.unique
78
+  ).then(res => {
79
+    console.log('我是res123', res)
80
+
81
+    // if (res.cart_id) {
82
+    //   // console.log(state.flag)
83
+    //   if (state.flag == '1' || state.flag == '3') {
84
+    //     uni.navigateTo({
85
+    //       url: `/pages/order-confirm/index?cartId=${res.cart_id}&type=${state.flag}&product_id=${detail.value.product_id}`
86
+    //     })
87
+    //   } else {
88
+    //     uni.$emit('cart-reload')
89
+    //     uni.showToast({
90
+    //       title: '添加购物车成功',
91
+    //       icon: 'none'
92
+    //     })
93
+    //     loadCartCount()
94
+    //     state.isShowSku = false
95
+    //   }
96
+    // }
97
+
98
+    if (res.status === 200) {
99
+      state.isShowSku = false
100
+      console.log("修改后", state.currentSku);
101
+      console.log('我是uniqueclone', uniqueclone);
102
+      detail.value.unique = uniqueclone.value
103
+    }
104
+
105
+    uni.$on('cart-reload', () => {
106
+      // console.log('新商品添加...')
107
+      state.cart_id = []
108
+      loadCartList()
109
+    })
110
+
111
+    state.cart_id = []
112
+    loadCartList()
113
+  })
114
+}
115
+
116
+function handleCountChange(val) {
117
+  // console.log(val)
118
+  // detail.value.
119
+  // if (val > 0) {
120
+  state.cartNum = val
121
+  // }
122
+}
123
+
124
+// 距离顶部距离
125
+let Scroll_X = ref(0)
126
+
127
+const shopping = ref<ShoppingResult>()
45 128
 onBeforeMount(() => {
129
+<<<<<<< HEAD
46 130
 
47 131
   if (!userStore.uid) {
48 132
 
@@ -50,17 +134,30 @@ onBeforeMount(() => {
50 134
       url: '/user/login/index'
51 135
     })
52 136
   }
137
+=======
138
+  userStore.setRedirectPage(`/pages/order_addcart/index`, 'tab')
139
+>>>>>>> li-yi
53 140
 })
54 141
 
55 142
 // nextTick(() => {
56 143
 //   loadCartList()
57 144
 // })
58 145
 onLoad((options) => {
146
+<<<<<<< HEAD
59 147
   userStore.setRedirectPage(`/pages/order_addcart/index`, "tab");
60 148
 
61 149
 
150
+=======
151
+
152
+  if (!userStore.uid) {
153
+    return uni.redirectTo({
154
+      url: '/pages/user/login/index'
155
+    })
156
+  }
157
+>>>>>>> li-yi
62 158
   uni.$on('cart-reload', () => {
63 159
     // console.log('新商品添加...')
160
+    state.recommendList = []
64 161
     state.cart_id = []
65 162
     loadCartList()
66 163
   })
@@ -82,6 +179,7 @@ onShow(() => {
82 179
     state.isManage = true
83 180
   }
84 181
   loadCartCount()
182
+  loadCartList()
85 183
   loadList('reload')
86 184
 })
87 185
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
@@ -130,8 +228,21 @@ onReachBottom(() => {
130 228
 
131 229
 })
132 230
 
231
+//监视用户变化
232
+// watch(() => userStore.uid, (newUid, oldUid) => {
233
+//   // 在这里处理 uid 变化的逻辑
234
+//   console.log('uid 变化了,新值:', newUid, '旧值:', oldUid);
235
+//   if (newUid != oldUid && newUid != null) {
236
+//     loadCartList()
237
+//   }
238
+
239
+//   // 你可以在这里执行其他操作,例如发起网络请求等
240
+// })
241
+
242
+
133 243
 // 加载购物车数据
134 244
 function loadCartList() {
245
+
135 246
   uni.showLoading({
136 247
     title: '加载中',
137 248
     icon: 'none'
@@ -139,9 +250,11 @@ function loadCartList() {
139 250
   // state.totalCartCount = 0
140 251
   getCartList().then(res => {
141 252
     uni.hideLoading()
253
+    console.log('我是初始化gwc数据', res);
254
+
142 255
     shopping.value = res
143 256
 
144
-    // console.log(res)
257
+    // console.log('shoping',res)
145 258
     shopping.value?.list.forEach((shopItem, index) => {
146 259
       // shopItem.allCheck = true
147 260
 
@@ -212,14 +325,16 @@ function shopCheck(shopItem) {
212 325
 }
213 326
 
214 327
 function handleShopTitleClick(shopItem) {
328
+  console.log('shopItem', shopItem);
329
+
215 330
   if (shopItem.allCheck) {
216
-        shopItem.list.forEach((good, index) => {
217
-          good.check = true
218
-        })
331
+    shopItem.list.forEach((good, index) => {
332
+      good.check = true
333
+    })
219 334
   } else {
220
-        shopItem.list.forEach((good, index) => {
221
-          good.check = false
222
-        })
335
+    shopItem.list.forEach((good, index) => {
336
+      good.check = false
337
+    })
223 338
   }
224 339
 }
225 340
 function cartAllCheck(type: 'single' | 'all') {
@@ -359,7 +474,7 @@ function handleSubmit() {
359 474
   }
360 475
 
361 476
 }
362
-
477
+//删除功能
363 478
 function handleDelete() {
364 479
   // const cart_id = <any>[]
365 480
   shopping.value?.list.forEach(shopItem => {
@@ -402,13 +517,13 @@ function handleDelete() {
402 517
 
403 518
 
404 519
 function handleProductItemClick(
405
-    item:
406
-        JdProductModel
407
-        & DcProductModel
408
-        & DyProductModel
409
-        & SuNingProductModel
410
-        & TaobaoProductThirdPartyWaresModel
411
-        & VipProductModel
520
+  item:
521
+    JdProductModel
522
+    & DcProductModel
523
+    & DyProductModel
524
+    & SuNingProductModel
525
+    & TaobaoProductThirdPartyWaresModel
526
+    & VipProductModel
412 527
 ) {
413 528
   // function navigateToDetail(params) {
414 529
   //   let otherDetailUrl = `/pages/store/product/other`
@@ -436,24 +551,76 @@ function handleNumberChange(num, goodItem) {
436 551
   // goodItem.productAttr.price = goodItem.productAttr.price * num
437 552
   // goodItem.productAttr.price = goodItem.productAttr.price * goodItem.cart_num
438 553
 }
554
+const headerClass = ref('')
555
+onPageScroll((page) => {
556
+  // console.log('滚轮事件触发了',page.scrollTop.toFixed());
557
+
558
+  // console.log(page.scrollTop.toFixed(),'距离顶部的距离')
559
+  Scroll_X.value = Number(page.scrollTop.toFixed())
560
+  if (page.scrollTop >= 76) {
561
+    headerClass.value = 'bg-white !text-gray-900'
562
+  } else {
563
+    headerClass.value = ''
564
+  }
565
+})
566
+
567
+function openTestLog(element) {
568
+  state.isShowSku = true
569
+  state.changeSkuCart_id = element.cart_id
570
+  console.log('用户点击sku', element.product_attr_unique)
571
+  uniqueclone.value = ''
572
+  getProductDetail(element.product_id).then(res => {
573
+    console.log('res>>>', res);
574
+    uniqueclone.value = element.product_attr_unique
575
+    detail.value = res.data
576
+    detail.value.unique = uniqueclone.value
577
+    console.log(detail.value, '点击sku获取的商品信息,存储的detail')
578
+    state.shareImage = detail.value.image
579
+    if (res && res.mer_id && res.mer_id === '148') {
580
+      if (detail.value && detail.value.price) {
581
+        detail.value.price = detail.value.price * 30
582
+      }
583
+    }
584
+    state.isRelation = res.isRelation
585
+    if (res.merchant_type == 2) {
586
+      xcxBanding({
587
+        mer_id: res.mer_id,
588
+        share_id: state.shareId
589
+      }).then(res => {
590
+        console.info(res)
591
+      })
592
+    }
593
+    uni.hideLoading()
594
+  }).catch(error => {
595
+    uni.showToast({
596
+      icon: "none",
597
+      title: error
598
+    }).then(() => {
599
+      setTimeout(() => {
600
+        uni.navigateBack()
601
+      }, 500)
602
+    })
603
+  })
604
+}
605
+
606
+//卸载
607
+onUnload(() => {
608
+  state.recommendList = []
609
+  state.cart_id = []
610
+})
611
+
439 612
 </script>
440 613
 <template>
441 614
   <div class="">
442
-    <div
443
-        v-if="hasShopping"
444
-        class="bg-white h-10 fixed top-0 w-full z-1 flex justify-end "
445
-    >
615
+    <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
616
+    <div v-if="hasShopping" class="bg-white h-10 fixed top-0 w-full z-1 flex justify-end ">
446 617
       <div class="pr-3">
447
-        <FButton size="small"
448
-                 @click="handleManageCart"
449
-        >
450
-          <div>{{ state.isManage ? '管理' : '完成'}}</div>
618
+        <FButton size="small" @click="handleManageCart">
619
+          <div>{{ state.isManage ? '管理' : '完成' }}</div>
451 620
         </FButton>
452 621
       </div>
453 622
     </div>
454
-    <div
455
-        v-if="!hasShopping"
456
-        class="flex flex-col justify-center items-center bg-white rounded-lg gap-3 text-xs py-8">
623
+    <div v-if="!hasShopping" class="flex flex-col justify-center items-center bg-white rounded-lg gap-3 text-xs py-8">
457 624
       <div>
458 625
         <image :src="gouwucheImage" mode="widthFix" class="w-20 h-20"></image>
459 626
       </div>
@@ -461,68 +628,52 @@ function handleNumberChange(num, goodItem) {
461 628
         暂无商品,去添加喜欢的商品
462 629
       </div>
463 630
     </div>
464
-    <div v-else class="mt-10">
465
-
466
-      <div
467
-          v-if="shopping && shopping.list"
468
-          class="flex flex-col gap-4 p-3"
469
-      >
470
-        <div
471
-            v-for="(shopItem, index) in shopping.list"
472
-            :key="index"
473
-            class="bg-white rounded-lg  "
474
-        >
475
-          <div
476
-              class="f-hairline-bottom flex  items-center font-bold p-3"
477
-          >
631
+    <div v-else class="mt-10 pb-10 ">
632
+
633
+      <div v-if="shopping && shopping.list" class="flex flex-col gap-4 px-3 pt-3 pb-8 ">
634
+        <div v-for="(shopItem, index) in shopping.list" :key="index" class="bg-white rounded-lg  ">
635
+          <div class="f-hairline-bottom flex  items-center font-bold p-3">
478 636
             <div @tap.stop="handleShopTitleClick(shopItem)">
479 637
 
480
-            <nut-checkbox v-model="shopItem.allCheck"
481
-                          @change="(checked) => shopCheck( shopItem)"
482
-                          label="全选"
483
-                          class="!text-primary"
484
-            >
485
-              {{ shopItem.mer_name }}
486
-            </nut-checkbox>
638
+              <nut-checkbox v-model="shopItem.allCheck" @change="(checked) => shopCheck(shopItem)" label="全选"
639
+                class="!text-primary">
640
+                {{ shopItem.mer_name }}
641
+              </nut-checkbox>
487 642
             </div>
488 643
 
489 644
           </div>
490
-          <div v-for="(goodItem, goodIndex) in shopItem.list"
491
-               :key="goodIndex"
492
-               class="flex f-hairline-bottom p-3 gap-2"
493
-          >
645
+          <div v-for="(goodItem, goodIndex) in shopItem.list" :key="goodIndex" class="flex f-hairline-bottom p-3 gap-2">
494 646
             <div class="flex">
495
-              <nut-checkbox v-model="goodItem.check"
496
-                            @change="handleGoodsItemCheck"
497
-                            label="单选"
498
-                            class="!text-primary"
499
-              ></nut-checkbox>
500
-              <image
501
-                  @click="handleProductItemClick(goodItem)"
502
-                  :src="goodItem.product.image"
503
-                  mode="aspectFill" class="w-18 h-18 rounded"
504
-              ></image>
647
+              <nut-checkbox v-model="goodItem.check" @change="handleGoodsItemCheck" label="单选"
648
+                class="!text-primary"></nut-checkbox>
649
+              <image @click="handleProductItemClick(goodItem)" :src="goodItem.productAttr.image" mode="aspectFill"
650
+                class="w-18 h-18 rounded"></image>
505 651
             </div>
506 652
 
507 653
             <div class="flex flex-col gap-1 w-full">
508
-              <div
509
-                  @click="handleProductItemClick(goodItem)"
510
-                  class="text-overflow line-clamp-2 text-xs">{{ goodItem.product.store_name }}</div>
654
+              <div @click="handleProductItemClick(goodItem)" class="  text-overflow line-clamp-1 text-xs">{{
655
+                goodItem.product.store_name }}</div>
511 656
               <div class="flex flex-col justify-start gap-1">
512
-                <div
513
-                    class="text-[10px] text-gray min-w-5  p-1  items-center flex">
514
-                  {{ goodItem.productAttr.sku }}
657
+                <div class="text-[10px] text-gray min-w-5  p-1  items-center flex " v-if="goodItem.productAttr.sku"
658
+                  @click="openTestLog(goodItem)">
659
+                  <div class="skushadow">
660
+                    <span class="m-live">
661
+                      {{ goodItem.productAttr.sku }}
662
+                    </span>
663
+                    <span class="m-lift">
664
+                      <img class="thumbnail_1" referrerpolicy="no-referrer" src="../../static/icon/下拉.png" />
665
+                    </span>
666
+                  </div>
515 667
                 </div>
516 668
                 <div class="flex">
517
-                  <CXBYaojinTag :amount="goodItem.yanglao"/>
669
+                  <CXBYaojinTag :amount="goodItem.yanglao" />
518 670
 
519 671
                 </div>
520 672
               </div>
521 673
               <div class="flex  justify-between ">
522
-                <FPrice :price="goodItem.productAttr.price"
523
-                        ex-class="font-bold text-dark"
524
-                />
525
-                <nut-input-number v-model="goodItem.cart_num" @change="(num) => handleNumberChange(num, goodItem)"/>
674
+                <!-- <FPrice :price="goodItem.productAttr.price" ex-class="font-bold text-dark" /> -->
675
+                <div class="font-bold text-dark" >¥{{ goodItem.productAttr.price }}</div>
676
+                <nut-input-number v-model="goodItem.cart_num" @change="(num) => handleNumberChange(num, goodItem)" />
526 677
               </div>
527 678
             </div>
528 679
           </div>
@@ -531,28 +682,24 @@ function handleNumberChange(num, goodItem) {
531 682
       </div>
532 683
     </div>
533 684
 
534
-    <div class="pb-12">
685
+    <div class="pb-12" v-if="!hasShopping">
535 686
       <div class="flex flex-row justify-center items-center gap-3 font-bold text-sm p-3 ">
536 687
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
537 688
         <div>
538
-          猜你喜欢
689
+          精品推荐
539 690
         </div>
540 691
         <image :src="like_adorn_220628Image" mode="widthFix" class="w-6 h-6"></image>
541 692
       </div>
542 693
 
543 694
       <div class="pb-3 px-3" v-if="state.recommendList">
544 695
         <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
545
-          <div v-for="(item, index) in state.recommendList"
546
-               :key="index"
547
-               @click="handleProductItemClick(item)"
548
-          >
696
+          <div v-for="(item, index) in state.recommendList" :key="index" @click="handleProductItemClick(item)">
549 697
             <MerchantProductCard :item="item" />
550 698
 
551 699
           </div>
552 700
         </grid-view>
553 701
 
554
-        <div class=" flex justify-center items-center text-[12px] text-gray-500"
555
-        >
702
+        <div class=" flex justify-center items-center text-[12px] text-gray-500">
556 703
           <div v-if="state.status === 'loading'">
557 704
             加载中...
558 705
           </div>
@@ -564,15 +711,12 @@ function handleNumberChange(num, goodItem) {
564 711
       </div>
565 712
     </div>
566 713
   </div>
567
-
568
-  <div v-if="hasShopping"
569
-       class="fixed bottom-0 w-full z-3">
714
+  <CXBSkuPopup :isTo=1 v-model:show="state.isShowSku" :detail="detail" @selected:item="onSelectedSku"
715
+    @submit="handleCreateShopping" @count-change="handleCountChange" />
716
+  <div v-if="hasShopping" class="fixed bottom-0 w-full z-3">
570 717
     <div class="bg-white h-10 flex justify-between" v-if="shopping && shopping.list">
571 718
       <div class="flex justify-center items-center gap-2 pl-3" @tap.stop="handleSelectAll">
572
-        <nut-checkbox v-model="isAllSelect"
573
-                      label="全选"
574
-                      class="!text-primary"
575
-        >全选
719
+        <nut-checkbox v-model="isAllSelect" label="全选" class="!text-primary">全选
576 720
         </nut-checkbox>
577 721
         <div class="text-xs text-gray">共 {{ state.totalCartCount }} 件</div>
578 722
       </div>
@@ -583,12 +727,9 @@ function handleNumberChange(num, goodItem) {
583 727
           <FPrice :price="state.totalPrice"></FPrice>
584 728
           <!--          {{totalCartInfo.totalPrice}}-->
585 729
         </div>
586
-        <FButton
587
-            @click="handleSubmit"
588
-            size="small"
589
-            :exClass="['rounded-full','!text-[14px]', 'text-white', 'bg-primary', 'w-full']"
590
-        >
591
-          {{ state.isManage? '去结算' : '删除'}}
730
+        <FButton @click="handleSubmit" size="small"
731
+          :exClass="['rounded-full', '!text-[14px]', 'text-white', 'bg-primary', 'w-full']">
732
+          {{ state.isManage ? '去结算' : '删除' }}
592 733
         </FButton>
593 734
       </div>
594 735
     </div>
@@ -598,6 +739,39 @@ function handleNumberChange(num, goodItem) {
598 739
 page {
599 740
   background-color: #f8f8f8;
600 741
 }
742
+
743
+.skushadow {
744
+  background-color: rgb(240, 240, 240);
745
+  border-radius: 10px;
746
+  height: 38rpx;
747
+  line-height: 38rpx;
748
+  font-size: 24rpx;
749
+  color: #919191;
750
+  display: flex;
751
+}
752
+
753
+.m-live {
754
+  max-width: 350rpx;
755
+  margin-left: 8rpx;
756
+  margin-right: 4rpx;
757
+  overflow: hidden;
758
+  /* 溢出内容隐藏 */
759
+  white-space: nowrap;
760
+  /* 不换行 */
761
+  text-overflow: ellipsis;
762
+  /* 超出部分显示省略号 */
763
+}
764
+
765
+.m-lift {
766
+  margin-left: 8rpx;
767
+  margin-right: 8rpx;
768
+}
769
+
770
+.thumbnail_1 {
771
+  width: 12rpx;
772
+  height: 7rpx;
773
+  margin-bottom: 6rpx;
774
+}
601 775
 </style>
602 776
 <route lang="yaml">
603 777
 style:

+ 14 - 9
src/pages/payment/index.vue

@@ -27,7 +27,7 @@
27 27
 
28 28
 
29 29
     <div class="fixed bottom-0 pb-safe  w-full">
30
-      <div class="px-3">
30
+      <div class="p-4">
31 31
         <nut-button block type="primary" @click="handleConfirm">立即支付</nut-button>
32 32
       </div>
33 33
 
@@ -61,6 +61,7 @@ const state = reactive({
61 61
   tabIndex: NaN,
62 62
 })
63 63
 onLoad((options) => {
64
+	// console.log('我是options',options)
64 65
   if (options) {
65 66
     state.orderList = options.OrderList
66 67
     state.payPrice = options.pay_price
@@ -71,15 +72,15 @@ onLoad((options) => {
71 72
       state.tabIndex = options.tabIndex
72 73
     }
73 74
 
74
-    // uni.login({
75
-    //   success: (res) => {
76
-    //     state.code = res.code
77
-    //   }
78
-    // })
75
+    uni.login({
76
+      success: (res) => {
77
+        state.code = res.code
78
+      }
79
+    })
79 80
 
80
-    // checkGroupOrder(state.orderId).then(res => {
81
-    //   state.memberType = res.message
82
-    // })
81
+    checkGroupOrder(state.orderId).then(res => {
82
+      state.memberType = res.message
83
+    })
83 84
   }
84 85
 })
85 86
 
@@ -101,7 +102,11 @@ function handleConfirm() {
101 102
       OrderLists: state.orderList,
102 103
       type: 'tdbaspzf'
103 104
     },
105
+<<<<<<< HEAD
104 106
     envVersion: 'trial', // develop(开发版),trial(体验版) release(正式版)
107
+=======
108
+    envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
109
+>>>>>>> li-yi
105 110
     // envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
106 111
     success(res) {
107 112
       // 打开成功

+ 6 - 6
src/pages/payment/success.vue

@@ -18,12 +18,12 @@ function goHome() {
18 18
 </script>
19 19
 
20 20
 <template>
21
-<!--<CXBBasePage>-->
22
-<!--  <FNavBar-->
23
-<!--      title="我的订单" :left-arrow="true" fixed placeholder z-index="999"-->
24
-<!--      ex-class="bg-white w-screen"-->
25
-<!--      @click-left="onClickLeft"-->
26
-<!--  />-->
21
+<!-- <CXBBasePage> -->
22
+ <FNavBar
23
+     title="支付成功" :left-arrow="false" fixed placeholder z-index="999"
24
+     ex-class="bg-white w-screen"
25
+     @click-left="onClickLeft"
26
+ />
27 27
 
28 28
 
29 29
   <div class="flex flex-col h-screen w-screen items-center mt-20 pt-20">

+ 2 - 0
src/pages/pension_account/index.vue

@@ -10,6 +10,8 @@ const userYangLaoJin = ref({})
10 10
 
11 11
 onLoad(() => {
12 12
   getUserYangLaoJin().then(res => {
13
+    console.log('养老保险',res);
14
+    
13 15
     userYangLaoJin.value = res
14 16
   })
15 17
 })

+ 86 - 26
src/pages/product/dingshenglianmeng.vue

@@ -1,6 +1,7 @@
1 1
 <template>
2 2
 
3 3
     <scroll-view>
4
+<<<<<<< HEAD
4 5
 		<div class="h-45">
5 6
 		  <swiper
6 7
 		      v-if="state.banners"
@@ -18,15 +19,25 @@
18 19
 		  </swiper>
19 20
 		</div>
20 21
       <div class="p-3" v-if="list && list.length > 0">
22
+=======
23
+      <div class="h-45">
24
+        <swiper v-if="state.banners" :indicator-dots="state.indicatorDots" indicator-active-color="#e93323"
25
+          :autoplay="state.autoplay" :circular="state.circular" :interval="state.interval" :duration="state.duration"
26
+          class=" h-full">
27
+          <swiper-item v-for="(item, index) in state.banners" :key="index">
28
+            <image :src="item.pic" class="!w-full !h-full" mode="aspectFill" />
29
+          </swiper-item>
30
+        </swiper>
31
+      </div>
32
+      <div class="p-3">
33
+        <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
34
+>>>>>>> li-yi
21 35
         <div>
22
-          <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
23
-            <div v-for="(item, index) in list"
24
-                 @tap="handleItemClick(item)"
25
-                 :key="index"
26
-            >
36
+          <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
37
+            <div v-for="(item, index) in list" @tap="handleItemClick(item)" :key="index">
27 38
 
28 39
               <div class="bg-white rounded-lg">
29
-                <image :src="item.image" mode="widthFix" 	:fade-in="true" class="rounded-t-lg  !w-full aspect-square" />
40
+                <image :src="item.image" mode="widthFix" :fade-in="true" class="rounded-t-lg  !w-full aspect-square" />
30 41
                 <div class="text-sm p-2 flex flex-col gap-2">
31 42
                   <div class="line-clamp-2">
32 43
                     {{ item.store_name }}
@@ -37,7 +48,7 @@
37 48
                   </div>
38 49
                   <div class="line-through text-xs font-bold text-gray-400 flex ">
39 50
                     <div>
40
-                      ¥ {{item.ot_price}}
51
+                      ¥ {{ item.ot_price }}
41 52
                     </div>
42 53
                   </div>
43 54
                 </div>
@@ -61,15 +72,15 @@
61 72
 
62 73
 <script setup lang="ts">
63 74
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
64
-import {getTypeProductList} from "~/apis/merchant";
65
-import {getHomeBanner} from "~/apis/common";
66
-
75
+import { getTypeProductList } from "~/apis/merchant";
76
+import { getHomeBanner } from "~/apis/common";
77
+import type CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
67 78
 const state = reactive({
68 79
   currentPage: 1,
69 80
   pageSize: 10,
70 81
   totalPage: 1,
71 82
   banners: [],
72
-  keyword: '' ,
83
+  keyword: '',
73 84
   status: 'noMore',
74 85
   indicatorDots: false,
75 86
   circular: true,
@@ -77,35 +88,43 @@ const state = reactive({
77 88
   interval: 5000,
78 89
   duration: 500,
79 90
   currents: "0",
80
-  title:'',
81
-  type:'',
91
+  title: '',
92
+  type: '',
82 93
 })
83
-const list = ref()
94
+const list = ref([])
84 95
 
85 96
 function handleItemClick(item) {
86 97
   uni.navigateTo({
87
-    url: `/pages/store/product/detail?id=`+item.product_id
98
+    url: `/pages/store/product/detail?id=` + item.product_id
88 99
   })
89 100
 }
90 101
 
91 102
 onLoad((option) => {
92
-	state.type=option.type;	//获取url参数
93
-	if(state.type=='jingpin'){
94
-		state.title='精品大仓'
95
-	}else if(state.type=='dingsheng'){
96
-		state.title='鼎盛联盟'
97
-	}
103
+  state.type = option.type;	//获取url参数
104
+  if (state.type == 'jingpin') {
105
+    state.title = '精品商城'
106
+  } else if (state.type == 'dingsheng') {
107
+    state.title = '鼎盛联盟'
108
+  } 
98 109
 
99 110
 
111
+<<<<<<< HEAD
100 112
 	getHomeBanner(state.type+"_banner").then(res => {
101 113
 		state.banners = res
102 114
 	})
103 115
 	loadList('reload')
116
+=======
117
+  getHomeBanner(state.type + "_banner").then(res => {
118
+    state.banners = res
119
+  })
120
+  loadList('reload')
121
+>>>>>>> li-yi
104 122
 
105 123
 })
106 124
 
107 125
 
108 126
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
127
+<<<<<<< HEAD
109 128
 	if (action === 'reload') {
110 129
 	  state.currentPage = 1
111 130
 	}
@@ -132,6 +151,34 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
132 151
 			}
133 152
 		}
134 153
 	})
154
+=======
155
+  if (action === 'reload') {
156
+    state.currentPage = 1
157
+  }
158
+
159
+  const params = {
160
+    type: state.type,
161
+    page: state.currentPage,
162
+    limit: state.pageSize
163
+  }
164
+  getTypeProductList({
165
+    ...params
166
+  }).then(res => {
167
+    if (res) {
168
+      if (action === 'reload') {
169
+        list.value = res.list
170
+      } else if (action === 'page') {
171
+        list.value = list.value.concat(res.list)
172
+      }
173
+      state.totalPage = Math.ceil(res.count / state.pageSize);
174
+      state.status = 'more'
175
+
176
+      if (callback) {
177
+        callback(res.list)
178
+      }
179
+    }
180
+  })
181
+>>>>>>> li-yi
135 182
 }
136 183
 
137 184
 
@@ -158,20 +205,33 @@ onReachBottom(() => {
158 205
 })
159 206
 
160 207
 onPullDownRefresh(() => {
161
-  loadList('reload', function() {
208
+  loadList('reload', function () {
162 209
     setTimeout(() => {
163 210
       uni.stopPullDownRefresh()
164 211
     }, 300)
165 212
   })
166 213
 })
167 214
 
168
-onShow(() =>{
169
-    uni.setNavigationBarTitle({
170
-      title: state.title // 设置新的导航栏标题
171
-    });
215
+onShow(() => {
216
+  uni.setNavigationBarTitle({
217
+    title: state.title // 设置新的导航栏标题
218
+  });
172 219
 })
173 220
 
174 221
 
222
+// 距离顶部距离
223
+let Scroll_X = ref(0)
224
+const headerClass = ref('')
225
+onPageScroll((page) => {
226
+  Scroll_X.value = Number(page.scrollTop.toFixed())
227
+  // page.scrollTop
228
+  if (page.scrollTop >= 76) {
229
+    headerClass.value = '!bg-primary !text-white'
230
+  } else {
231
+    headerClass.value = ''
232
+  }
233
+})
234
+
175 235
 </script>
176 236
 
177 237
 <route lang="yaml">

+ 2 - 2
src/pages/real-name-authentication/index.vue

@@ -263,7 +263,7 @@ function formatName (str) {
263 263
           <image  v-if="formData.card_positive && !state.isCertified"
264 264
                   :src="formData.card_positive"
265 265
                   @tap="handleUploadImg('positive')"
266
-                  mode="aspectFit" class="w-60 h-40"></image>
266
+                  mode="scaleToFill" class="w-60 h-40"></image>
267 267
           <image v-else
268 268
                  :src="front_220714Image"
269 269
                  @tap="handleUploadImg('positive')"
@@ -279,7 +279,7 @@ function formatName (str) {
279 279
           <image  v-if="formData.card_reverse && !state.isCertified"
280 280
                   :src="formData.card_reverse"
281 281
                   @tap="handleUploadImg('reverse')"
282
-                  mode="widthFix" class="w-60"></image>
282
+                  mode="scaleToFill" class="w-60 h-40 "></image>
283 283
           <image v-else
284 284
                  :src="verso_220714Image"
285 285
                  @tap="handleUploadImg('reverse')"

+ 21 - 2
src/pages/refund/drawback.vue

@@ -90,7 +90,10 @@ function handleSubmit() {
90 90
       if (res.confirm) {
91 91
         refundApply(state.orderId.toString(), formData).then(res => {
92 92
           // {"status":200,"message":"申请退款成功","data":{"refund_order_id":"671"}}
93
-          uni.showToast({
93
+          console.log('申请退款成功',res);
94
+          
95
+          if(res.status===200){
96
+             uni.showToast({
94 97
             title: '申请退款成功',
95 98
             icon: 'none'
96 99
           })
@@ -99,10 +102,26 @@ function handleSubmit() {
99 102
               url: `/pages/refund/index?from=${state.from}`
100 103
             })
101 104
           }, 300)
105
+          }else{
106
+            uni.showToast({
107
+            title: res.message,
108
+            icon: 'none'
109
+          })
110
+          setTimeout(() => {
111
+            uni.navigateTo({
112
+              url: `/pages/refund/index?from=${state.from}`
113
+            })
114
+          }, 300)
115
+          }
116
+         
102 117
         })
103 118
 
104 119
       }
105
-    }
120
+    },
121
+    fail: function (error) {
122
+    // 模态框显示失败,可能是因为参数不合法等原因
123
+    console.log('模态框显示失败', error);
124
+  }
106 125
   })
107 126
   // if (state.orderId) {
108 127
   // }

+ 1 - 1
src/pages/refund/option.vue

@@ -91,7 +91,7 @@ function handleChooseType(refund_type) {
91 91
             <image :src="woyaotuihuotuikuanIcon" mode="widthFix" class="w-5 h-5"></image>
92 92
             <div>
93 93
               <div class="font-bold">我要退货退款</div>
94
-              <div class="text-gray-500">已收到货,需要退还已收到饿货物</div>
94
+              <div class="text-gray-500">已收到货,需要退还已收到货物</div>
95 95
             </div>
96 96
           </div>
97 97
         </div>

+ 1 - 1
src/pages/setting/index.vue

@@ -64,7 +64,7 @@ function onOk() {
64 64
     </div>
65 65
 
66 66
     <div class="fixed bottom-0 pb-safe w-full">
67
-      <div class="px-10 ">
67
+      <div class="px-10 py-4 ">
68 68
         <div
69 69
             @tap="handleLogout"
70 70
             class="text-center text-white bg-primary rounded-full text-sm p-2"

+ 5 - 2
src/pages/store/home/components/MerchantProductCard.vue

@@ -57,15 +57,18 @@ const is148Merchant = computed(() => {
57 57
       <div class="line-clamp-2">
58 58
         {{item.store_name}}
59 59
       </div>
60
-      <div v-if="!is148Merchant" class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
60
+      <div v-if="item.type!=15" >
61
+        <div v-if="!is148Merchant" class="border border-solid border-1 border-red rounded flex text-auto items-center text-[#FE0032] w-fit">
61 62
         <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png"
62 63
                mode="widthFix" class="!w-8.5"></image>
63
-        <div class="px-2 flex items-center jusitify-center text-xs">
64
+        <div class="px-2 flex items-center jusitify-center text-xs"  >
64 65
           <div>
65 66
             养老金 ¥{{item.yanglao || item.yanglao_price}}
66 67
           </div>
67 68
         </div>
68 69
       </div>
70
+      </div>
71
+      
69 72
       <div class="flex flex-row items-center gap-2">
70 73
         <div v-if="is148Merchant && item.price" class="flex justify-end items-end gap-2 text-[#FE0032]">
71 74
           <div class="!text-[24px]">{{ Number.parseFloat(item.price * 30).toFixed(2) }} </div>

+ 76 - 60
src/pages/store/nearby/index.vue

@@ -1,11 +1,11 @@
1 1
 <script lang="ts" setup>
2
-import {getMerchantCategory, getSelectMerchant, getSelectMerchantSort} from "~/apis/merchant";
3
-import type {StoreResult} from "~/apis/model/storeModel";
4
-import {StoreParams} from "~/apis/model/storeModel";
2
+import { getMerchantCategory, getSelectMerchant, getSelectMerchantSort } from "~/apis/merchant";
3
+import type { StoreResult } from "~/apis/model/storeModel";
4
+import { StoreParams } from "~/apis/model/storeModel";
5 5
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
6
-import {USER_LATITUDE, USER_LONGITUDE} from "~/constants";
7
-import {getProductShare} from "~/apis/common";
8
-import {useUserStore} from "~/stores/userStore";
6
+import { USER_LATITUDE, USER_LONGITUDE } from "~/constants";
7
+import { getProductShare } from "~/apis/common";
8
+import { useUserStore } from "~/stores/userStore";
9 9
 import Cache from "~/utils/cache";
10 10
 const usePageStore = usePageStoreWidthOut()
11 11
 const userStore = useUserStore()
@@ -48,9 +48,12 @@ const state = reactive({
48 48
   menuDefaultValue: 1
49 49
   // merchantPageInfo: {}
50 50
 })
51
+//返回顶部标识
52
+let flag = ref(false)
53
+
51 54
 const searchValue = ref('')
52 55
 
53
-const {windowHeight} = uni.getSystemInfoSync()
56
+const { windowHeight } = uni.getSystemInfoSync()
54 57
 state.scrollHeight = windowHeight - 45
55 58
 
56 59
 onLoad((option) => {
@@ -99,7 +102,7 @@ onShow(() => {
99 102
   usePageStore.setPageConfig({
100 103
     currentPage: {
101 104
       type: 'tab',
102
-      url:  '/pages/store/nearby/index'
105
+      url: '/pages/store/nearby/index'
103 106
     }
104 107
   })
105 108
   // console.log('onshow...')
@@ -206,6 +209,11 @@ const onRefresherRefresh = e => {
206 209
   loadSelectMerchant('reload')
207 210
 };
208 211
 
212
+//小火箭滚动事件
213
+const onscroll = e => {
214
+  state.scrollTop = e.detail.scrollTop
215
+}
216
+
209 217
 function handleScrollToLower() {
210 218
   state.status = 'loading';
211 219
   state.currentPage += 1;
@@ -217,6 +225,24 @@ function handleScrollToLower() {
217 225
   }
218 226
 }
219 227
 
228
+//返回顶部事件
229
+const scrollToTop = function () {
230
+  console.log('返回顶部');
231
+  state.scrollTop = 0
232
+
233
+}
234
+//监视
235
+watch(() => state.scrollTop, () => {
236
+  if (state.scrollTop as number > 400) {
237
+    flag.value = true
238
+  }
239
+  if (state.scrollTop as number < 400) {
240
+    flag.value = false
241
+  }
242
+})
243
+
244
+
245
+
220 246
 </script>
221 247
 <template>
222 248
   <!--  <nut-category :category="state.merchantCategory" @change="change">-->
@@ -225,8 +251,7 @@ function handleScrollToLower() {
225 251
   <!--  </nut-category>-->
226 252
   <div class="flex flex-col  fixed  top-0 left-0  h-fit z-1 bg-white w-full">
227 253
 
228
-    <nut-searchbar
229
-        v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant( 'reload')">
254
+    <nut-searchbar v-model="searchValue" @search="loadSelectMerchant('reload')" @clear="loadSelectMerchant('reload')">
230 255
       <template v-slot:rightout>
231 256
         <div @tap="loadSelectMerchant('reload')">
232 257
           搜索
@@ -236,30 +261,22 @@ function handleScrollToLower() {
236 261
 
237 262
 
238 263
   </div>
239
-  <div class="flex pt-10 "
240
-  >
264
+  <div class="flex pt-10 ">
241 265
     <!-- 左侧 一级分类 -->
242 266
     <div class="w-1/4">
243
-      <scroll-view
244
-          :scroll-y="true"
245
-          :style="{ height: `${state.scrollHeight}px` }"
246
-          class="w-full h-full bg-[#f8f8f8]"
247
-      >
248
-        <div
249
-            @tap="loadAll()"
250
-            :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''"
251
-            class="relative w-25 h-12 block text-sm flex justify-center items-center">
267
+      <scroll-view ref="ToTop" :scroll-y="true" :style="{ height: `${state.scrollHeight}px` }"
268
+        class="w-full h-full bg-[#f8f8f8]">
269
+        <div @tap="loadAll()" :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''"
270
+          class="relative w-25 h-12 block text-sm flex justify-center items-center">
252 271
           <div class="flex items-center gap-1">
253 272
             <div class="h-4 bg-primary w-1" v-if="state.currentMerchantCategoryId == 0"></div>
254 273
             <div>全部</div>
255 274
           </div>
256 275
 
257 276
         </div>
258
-        <div v-for="(item, index) in state.merchantCategory" :key="index"
259
-             @tap="handleCategoryChange(item)"
260
-             :class="state.currentMerchantCategoryId == item.merchant_category_id ? 'bg-white font-bold' : ''"
261
-             class="relative h-12 block text-sm flex justify-center items-center gap-1 w-25"
262
-        >
277
+        <div v-for="(item, index) in state.merchantCategory" :key="index" @tap="handleCategoryChange(item)"
278
+          :class="state.currentMerchantCategoryId == item.merchant_category_id ? 'bg-white font-bold' : ''"
279
+          class="relative h-12 block text-sm flex justify-center items-center gap-1 w-25">
263 280
           <div class="h-4 bg-primary w-1" v-if="state.currentMerchantCategoryId == item.merchant_category_id"></div>
264 281
 
265 282
           <div>
@@ -276,42 +293,25 @@ function handleScrollToLower() {
276 293
     <div class="w-3/4 ">
277 294
       <div class="fixed z-3 flex flex-col justify-center h-10 pl-3 top-10">
278 295
         <nut-menu>
279
-          <nut-menu-item v-model="state.menuDefaultValue"
280
-                         :options="state.options"
281
-                         @change="loadSelectMerchant('reload')"
282
-          >
296
+          <nut-menu-item v-model="state.menuDefaultValue" :options="state.options" @change="loadSelectMerchant('reload')">
283 297
 
284 298
           </nut-menu-item>
285 299
         </nut-menu>
286 300
       </div>
287
-
288
-      <scroll-view
289
-          :scroll-y="true"
290
-          :style="{ height: `${state.scrollHeight -60}px` }"
291
-          scroll-with-animation
292
-          class="flex flex-1  flex-col   p-3 gap-3 mt-10"
293
-          :refresher-enabled="true"
294
-          refresher-background="#f5f5f5"
295
-          refresher-default-style="black"
296
-          :refresher-triggered="state.triggered"
297
-          @scrolltolower="handleScrollToLower"
298
-          @refresherpulling="onRefresherPulling"
299
-          @refresherRestore="onRefresherRestore"
300
-          @refresherAbort="onRefresherAbort"
301
-          @refresherrefresh="onRefresherRefresh"
302
-          v-if="state.merchantList && state.merchantList.length > 0"
303
-
304
-      >
305
-        <div
306
-            v-for="(item, index) in state.merchantList" :key="index"
307
-            @click="handleShowMerchant(item)"
308
-            class="mb-3 ">
301
+      <!-- 返回顶部 -->
302
+      <div v-show="flag" class="back-top">
303
+        <img @click="scrollToTop" class="back-TopImg" src="../../static/icon/返回顶部@2x.png" alt="">
304
+      </div>
305
+      <scroll-view :scroll-y="true" :style="{ height: `${state.scrollHeight - 60}px` }" :scroll-top="state.scrollTop"
306
+        class="flex flex-1  flex-col   p-3 gap-3 mt-10" :refresher-enabled="true" refresher-background="#f5f5f5"
307
+        refresher-default-style="black" :refresher-triggered="state.triggered" @scrolltolower="handleScrollToLower"
308
+        @refresherpulling="onRefresherPulling" @refresherRestore="onRefresherRestore" @refresherAbort="onRefresherAbort"
309
+        @refresherrefresh="onRefresherRefresh" v-if="state.merchantList && state.merchantList.length > 0"
310
+        @scroll="onscroll">
311
+        <div v-for="(item, index) in state.merchantList" :key="index" @click="handleShowMerchant(item)" class="mb-3 ">
309 312
           <div class="flex">
310 313
             <div class="flex ">
311
-              <image :src="item.mer_avatar"
312
-                     mode="aspectFill"
313
-                     class="w-20 h-20 rounded-lg"
314
-              ></image>
314
+              <image :src="item.mer_avatar" mode="aspectFill" class="w-20 h-20 rounded-lg"></image>
315 315
             </div>
316 316
 
317 317
             <div class="flex flex-col justify-between px-2">
@@ -329,9 +329,7 @@ function handleScrollToLower() {
329 329
 
330 330
           </div>
331 331
         </div>
332
-
333
-        <div class=" flex justify-center items-center text-[12px] text-gray-500"
334
-        >
332
+        <div class=" flex justify-center items-center text-[12px] text-gray-500">
335 333
           <div v-if="state.status === 'loading'">
336 334
             加载中...
337 335
           </div>
@@ -341,7 +339,7 @@ function handleScrollToLower() {
341 339
         </div>
342 340
       </scroll-view>
343 341
       <div class="flex justify-center items-center w-full h-[60%]" v-else>
344
-        <CXBEmpty/>
342
+        <CXBEmpty />
345 343
 
346 344
       </div>
347 345
     </div>
@@ -356,15 +354,33 @@ style:
356 354
 
357 355
 <style lang="scss">
358 356
 page {
357
+  height: 100%;
359 358
   overflow: hidden;
360 359
   --nut-menu-item-font-size: 14px;
361 360
   --nut-menu-bar-line-height: 24px;
362 361
   --nut-menu-bar-box-shadow: none;
363 362
   --nut-menu-item-active-text-color: #FE0032;
364 363
 
364
+  .back-top {
365
+    width: 100rpx;
366
+    height: 100rpx;
367
+    position: fixed;
368
+    border-radius: 50%;
369
+    z-index: 999;
370
+    right: 1%;
371
+    bottom: 60px;
372
+  }
373
+
374
+  .back-TopImg {
375
+    width: 100rpx;
376
+    height: 100rpx;
377
+    border-radius: 50%;
378
+  }
379
+
365 380
   .nut-menu {
366 381
     background: none !important;
367 382
   }
383
+
368 384
   .nut-menu__bar {
369 385
     box-shadow: none !important;
370 386
     border: 1px solid #FE0032;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 615 - 221
src/pages/store/product/detail.vue


+ 384 - 155
src/pages/store/product/other.vue

@@ -9,26 +9,40 @@ import {
9 9
   getVipProductDetail
10 10
 } from "~/apis/product";
11 11
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
12
+import MerchantProductCard from "~/pages/store/home/components/MerchantProductCard.vue";
12 13
 import type {
14
+  DyProductModel,
13 15
   IProductDetail,
14 16
   JdProductDetailModel,
17
+  JdProductModel,
18
+  SuNingProductModel,
15 19
   TaobaoProductThirdPartyWaresModel,
16
-  TaobaoWaresDetail
20
+  TaobaoWaresDetail,
21
+  VipProductModel
17 22
 } from "~/apis/model/product.model";
18 23
 import FPrice from "~/components/FPrice/FPrice.vue";
19 24
 import FButton from "~/components/FButton/FButton.vue";
20 25
 import CXBButton from "~/components/CXBButton/CXBButton.vue";
21
-import {debounce, merge} from "lodash-es";
22
-
23
-import {useDebounceFn} from '@vueuse/core';
26
+import CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
27
+import { debounce, merge } from "lodash-es";
24 28
 
29
+import { useDebounceFn } from '@vueuse/core';
25 30
 import dayjs from "dayjs";
26
-import {decodeBase64} from "~/utils/http/helper";
27
-import {CDN_URL} from "~/config/app";
31
+import { decodeBase64 } from "~/utils/http/helper";
32
+import { CDN_URL, CDM_URL } from "~/config/app";
33
+import { getRecommendList } from "~/apis/merchant";
34
+import type { DcProductModel } from "~/apis/model/dacang.model";
28 35
 
29 36
 const discount_coupon_bg_220804Image = CDN_URL + '/static/assets/discount_coupon_bg_220804.png'
30 37
 const productId = ref('')
31
-//
38
+//推荐商品列表
39
+let skuInfo = reactive({
40
+  recommendList: [],
41
+  totalPage: 0,
42
+  pageSize: 10,
43
+  status: '',
44
+  currentPage: 1
45
+})
32 46
 
33 47
 const userStore = useUserStore()
34 48
 const isSubmit = ref(false)
@@ -54,149 +68,226 @@ const state = reactive({
54 68
   data: {},
55 69
   shareId: ''
56 70
 })
71
+const isShow = ref(false)
57 72
 const detail = ref<IProductDetail>()
73
+const detailclone = ref<IProductDetail>()
58 74
 onLoad((options: any) => {
59 75
 
60 76
   const data: Partial<IProductDetail> = JSON.parse(decodeBase64(options.params))
61
-  // console.log(data)
62
-  mergeProductDetail(data)
77
+  // console.log('我是options数据', data)
78
+
63 79
   // if (options.platform && options.id) {
64 80
   uni.showLoading({
65 81
     title: '数据加载中',
66 82
     icon: 'none'
67 83
   })
84
+  mergeProductDetail(data)
68 85
   loadProductDetail(data)
69 86
   // }
70 87
 })
88
+
71 89
 onShow(() => {
72 90
   isSubmit.value = false
73 91
 })
74 92
 
93
+//精品推荐
94
+function YouLike() {
95
+  getRecommendList({
96
+    page: 1,
97
+    limit: 10
98
+  }).then(res => {
99
+    skuInfo.recommendList = res.list
100
+    // console.log(skuInfo.recommendList);
101
+
102
+  })
103
+}
75 104
 
105
+//商品不存在详情
106
+function soldOut() {
107
+  isShow.value = true
108
+  uni.setNavigationBarTitle({
109
+    title: '商品下架不存在'
110
+  })
111
+  loadList('reload')
112
+  uni.hideLoading()
113
+}
76 114
 
77 115
 function mergeProductDetail(data: Partial<IProductDetail> = {}) {
78
-  detail.value = merge(detail.value, data)
116
+  detailclone.value = merge(detailclone.value, data)
117
+
118
+}
119
+function mergeProductDetailclone(data: Partial<IProductDetail> = {}) {
120
+  detail.value = merge(detailclone.value, data)
121
+  // console.log(detail.value);
122
+
79 123
 }
80 124
 
81 125
 function loadProductDetail(product: Partial<IProductDetail>) {
82
-  // console.log('产品id')
83
-  // console.log(product.id)
126
+  // console.log('产品id')  // console.log(product.id)
127
+
84 128
   // 京东
85 129
   if (product.platform == 6) {
86 130
     getJdProductDetail(product.id).then(res => {
87
-      const jdProduct = res[0]
88
-      // console.log(jdProduct)
89
-      mergeProductDetail({
90
-        images: jdProduct.detail,
91
-        coupon: {
92
-          amount: jdProduct.couMoney
93
-        },
94
-        ...jdProduct
95
-      })
131
+      console.log(res);
132
+      let { data, status } = res
133
+      if (status === 200) {
134
+        const jdProduct = data[0]
135
+        // console.log(jdProduct)
136
+        mergeProductDetailclone({
137
+          images: jdProduct.detail,
138
+          coupon: {
139
+            amount: jdProduct.couMoney
140
+          },
141
+          ...jdProduct
142
+        })
96 143
 
97
-      uni.hideLoading()
144
+        uni.hideLoading()
145
+      } else {
146
+        soldOut()
147
+      }
98 148
     })
99 149
   }
100
-  // 淘宝
150
+  // 淘宝 *
101 151
   if (product.platform === 5) {
102 152
     getTaobaoProductDetail(product.id).then(res => {
103
-      const product = res.waresDetail
104
-      mergeProductDetail({
105
-        images: product.small_images,
106
-        coupon: {
107
-          startTime: product.couponStartTime,
108
-          endTime: product.couponEndTime
109
-        },
110
-        ...product
111
-      })
112
-      uni.hideLoading()
153
+      // console.log('taobao>>>',res);
154
+      let { status, data } = res
155
+      if (status === 200) {
156
+        const product = data.waresDetail
157
+        mergeProductDetailclone({
158
+          images: product.small_images,
159
+          coupon: {
160
+            startTime: product.couponStartTime,
161
+            endTime: product.couponEndTime
162
+          },
163
+          ...product
164
+        })
165
+        uni.hideLoading()
166
+      } else {
167
+        soldOut()
168
+      }
169
+
113 170
 
114 171
     })
115 172
   }
116 173
 
117
-  // 拼多多
174
+  // 拼多多 *
118 175
   if (product.platform == 1) {
119 176
     getPddProductDetail(product.id).then(res => {
177
+      // console.log(res);
178
+      let { status, data } = res
120 179
       // detail.value = res
121
-      mergeProductDetail({
122
-        spreadUrl: res.pddlink.url,
123
-        images: res.goods_gallery_urls,
124
-        featured: res.goods_gallery_urls,
125
-        mallName: res.mall_name,
126
-        ...res
127
-        // allowance:
128
-      })
129
-
130
-      if (res.coupon_start_time > 0) {
131
-        mergeProductDetail({
132
-          coupon: {
133
-            // amount: (res.extra_coupon_amount / 100).toString(),
134
-            startTime: dayjs.unix(res.coupon_start_time).format('YYYY-MM-DD'),
135
-            endTime: dayjs.unix(res.coupon_end_time).format('YYYY-MM-DD')
136
-          },
137
-        })
180
+      if (status !== 200) {
181
+        soldOut()
138 182
       } else {
139
-        mergeProductDetail({
140
-          coupon: null
183
+        mergeProductDetailclone({
184
+          spreadUrl: data.pddlink.url,
185
+          images: data.goods_gallery_urls,
186
+          featured: data.goods_gallery_urls,
187
+          mallName: data.mall_name,
188
+          ...data
189
+          // allowance:
141 190
         })
191
+
192
+        if (data.coupon_start_time > 0) {
193
+          mergeProductDetailclone({
194
+            coupon: {
195
+              // amount: (res.extra_coupon_amount / 100).toString(),
196
+              startTime: dayjs.unix(data.coupon_start_time).format('YYYY-MM-DD'),
197
+              endTime: dayjs.unix(data.coupon_end_time).format('YYYY-MM-DD')
198
+            },
199
+          })
200
+        } else {
201
+          mergeProductDetailclone({
202
+            coupon: null
203
+          })
204
+        }
205
+
206
+        uni.hideLoading()
142 207
       }
143 208
 
144
-      uni.hideLoading()
145 209
 
146 210
     })
147 211
   }
148 212
 
149
-  // 唯品会
213
+  // 唯品会 *
150 214
   if (product.platform == 2) {
151 215
     getVipProductDetail(product.id).then(res => {
152 216
       // console.log(res.result[0])
153
-      const product = res.result[0]
154
-      // detail.value = product
155
-      mergeProductDetail({
156
-        featured: product.goodsCarouselPictures,
157
-        images: product.goodsDetailPictures,
158
-        mallName: '唯品自营',
159
-        ...product,
160
-        ...res
161
-      })
162
-      if (product.couponInfo) {
163
-        mergeProductDetail({
164
-          coupon: {
165
-            amount: product.couponInfo.activedAmount,
166
-            startTime: product.couponInfo.useBeginTime,
167
-            endTime: product.couponInfo.useEndTime
168
-          }
217
+      let { data, status } = res
218
+      if (status === 200) {
219
+        const product = data.result[0]
220
+        // detail.value = product
221
+        mergeProductDetailclone({
222
+          featured: product.goodsCarouselPictures,
223
+          images: product.goodsDetailPictures,
224
+          mallName: '唯品自营',
225
+          ...product,
226
+          ...res
169 227
         })
228
+        if (product.couponInfo) {
229
+          mergeProductDetailclone({
230
+            coupon: {
231
+              amount: product.couponInfo.activedAmount,
232
+              startTime: product.couponInfo.useBeginTime,
233
+              endTime: product.couponInfo.useEndTime
234
+            }
235
+          })
236
+        }
237
+
238
+        uni.hideLoading()
239
+      } else {
240
+        soldOut()
170 241
       }
171 242
 
172
-      uni.hideLoading()
173 243
 
174 244
     })
175 245
   }
176
-  // 苏宁
246
+  // 苏宁 *
177 247
   if (product.platform == 3) {
178 248
     getSuProductDetail(product.id).then(res => {
179 249
       // const product = res
180
-      mergeProductDetail({
181
-        images: res.detail,
182
-        ...res
183
-      })
250
+      let { status, data } = res
251
+      if (status === 200) {
252
+        mergeProductDetailclone({
253
+          images: data.detail,
254
+          ...data
255
+        })
184 256
 
185
-      uni.hideLoading()
257
+        uni.hideLoading()
258
+
259
+      } else {
260
+        soldOut()
261
+      }
186 262
 
187 263
     })
188 264
   }
189
-  // 抖音
265
+  // 抖音 *
190 266
   if (product.platform == 9) {
191 267
     getDyProductDetail(product.id).then(res => {
268
+<<<<<<< HEAD
192 269
       // console.log(res)
193 270
       mergeProductDetail({
194 271
         mallName: res.shopName,
195 272
         images: res.imgs,
196 273
         ...res
197 274
       })
275
+=======
276
+      console.log(res)
277
+      let { status, data } = res
278
+      if (status === 200) {
279
+        mergeProductDetailclone({
280
+          mallName: data.shopName,
281
+          images: data.imgs,
282
+          ...data
283
+        })
284
+
285
+        uni.hideLoading()
286
+      } else {
287
+        soldOut()
288
+      }
289
+>>>>>>> li-yi
198 290
 
199
-      uni.hideLoading()
200 291
 
201 292
     })
202 293
 
@@ -270,39 +361,39 @@ function handleBuyNow() {
270 361
       // console.log(detail.value.pddlink)
271 362
       // console.log(pddWx)
272 363
     } else {
273
-/*      let platformName = ''
274
-      let clipboardData = ''
275
-      if (detail.value?.platform == 5) {
276
-        platformName = '淘宝'
277
-        clipboardData = detail.value?.spreadUrl
278
-      }
279
-      if (detail.value?.platform == 9) {
280
-        platformName = '抖音'
281
-        clipboardData = detail.value?.dyZlink
282
-      }
283
-      if (detail.value?.platform == 2) {
284
-        platformName = '唯品会'
285
-        clipboardData = detail.value?.destUrl
286
-      }
287
-      if (detail.value?.platform == 3) {
288
-        platformName = '苏宁易购'
289
-        clipboardData = detail.value?.productUrlWap
290
-      }
291
-      return uni.setClipboardData({
292
-        data: clipboardData,
293
-        success(res) {
294
-          return uni.showToast({
295
-            title: `链接已复制,去【${platformName}】打开即可。`,
296
-            icon: 'none'
297
-          })
298
-        },
299
-        fail(res) {
300
-          return uni.showToast({
301
-            title: '请更新隐私协议',
302
-            icon: 'none'
303
-          })
304
-        }
305
-      })*/
364
+      /*      let platformName = ''
365
+            let clipboardData = ''
366
+            if (detail.value?.platform == 5) {
367
+              platformName = '淘宝'
368
+              clipboardData = detail.value?.spreadUrl
369
+            }
370
+            if (detail.value?.platform == 9) {
371
+              platformName = '抖音'
372
+              clipboardData = detail.value?.dyZlink
373
+            }
374
+            if (detail.value?.platform == 2) {
375
+              platformName = '唯品会'
376
+              clipboardData = detail.value?.destUrl
377
+            }
378
+            if (detail.value?.platform == 3) {
379
+              platformName = '苏宁易购'
380
+              clipboardData = detail.value?.productUrlWap
381
+            }
382
+            return uni.setClipboardData({
383
+              data: clipboardData,
384
+              success(res) {
385
+                return uni.showToast({
386
+                  title: `链接已复制,去【${platformName}】打开即可。`,
387
+                  icon: 'none'
388
+                })
389
+              },
390
+              fail(res) {
391
+                return uni.showToast({
392
+                  title: '请更新隐私协议',
393
+                  icon: 'none'
394
+                })
395
+              }
396
+            })*/
306 397
 
307 398
       // }
308 399
       return uni.showToast({
@@ -369,7 +460,7 @@ function handleBuyNow() {
369 460
 
370 461
     return {
371 462
       title: `${detail.value.store_name}`,
372
-      imageUrl:  state.shareImage,
463
+      imageUrl: state.shareImage,
373 464
       query: `id=${state.id}&from=share&shareID=${state.shareId}`
374 465
     }
375 466
 
@@ -383,56 +474,127 @@ function handleBuyNow() {
383 474
 const hasCoupon = computed(() => {
384 475
   return detail.value?.coupon && detail.value?.coupon.startTime
385 476
 })
477
+
478
+//跳转大仓商品详情
479
+function handleProductItemClick(
480
+  item:
481
+    JdProductModel
482
+    & DcProductModel
483
+    & DyProductModel
484
+    & SuNingProductModel
485
+    & TaobaoProductThirdPartyWaresModel
486
+    & VipProductModel
487
+) {
488
+  // function navigateToDetail(params) {
489
+  //   let otherDetailUrl = `/pages/store/product/other`
490
+  //   return uni.navigateTo({
491
+  //     url: `${otherDetailUrl}?params=${params}`
492
+  //   })
493
+  // }
494
+  // 大仓
495
+  uni.navigateTo({
496
+    url: `/pages/store/product/detail?id=${item.product_id}`
497
+  })
498
+}
499
+
500
+const outImg = computed(() => {
501
+  if (isShow) {
502
+    return CDM_URL + '/image/2023-11-24/20231124182002679.png'
503
+  }
504
+
505
+})
506
+
507
+// 距离顶部距离
508
+let Scroll_X = ref(0)
509
+
510
+const headerClass = ref('')
511
+onPageScroll((page) => {
512
+  // console.log('滚轮事件触发了',page.scrollTop.toFixed());
513
+
514
+  // console.log(page.scrollTop.toFixed(),'距离顶部的距离')
515
+  Scroll_X.value = Number(page.scrollTop.toFixed())
516
+  if (page.scrollTop >= 76) {
517
+    headerClass.value = 'bg-white !text-gray-900'
518
+  } else {
519
+    headerClass.value = ''
520
+  }
521
+})
522
+
523
+
524
+//列表加载
525
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
526
+  const params = {
527
+    page: skuInfo.currentPage,
528
+    limit: skuInfo.pageSize
529
+  }
530
+
531
+  if (action === 'reload') {
532
+    params.page = 1
533
+  }
534
+
535
+  getRecommendList({
536
+    ...params
537
+  }).then(res => {
538
+    if (action === 'page') {
539
+      skuInfo.recommendList = skuInfo.recommendList.concat(res.list)
540
+    }
541
+    if (action === 'reload') {
542
+      // state.list = state.list.concat(res.list)
543
+      skuInfo.recommendList = res.list
544
+    }
545
+    skuInfo.totalPage = Math.ceil(res.count / skuInfo.pageSize);
546
+    skuInfo.status = 'more'
547
+    if (callback) {
548
+      callback(res.list)
549
+    }
550
+  })
551
+}
552
+
553
+function handleScrollToLower() {
554
+  skuInfo.status = 'loading';
555
+  skuInfo.currentPage += 1;
556
+  // console.log(state.totalPage)
557
+  if (skuInfo.currentPage > skuInfo.totalPage) {
558
+    skuInfo.status = 'noMore';
559
+  } else {
560
+    setTimeout(() => {
561
+      loadList('page')
562
+    }, 300)
563
+  }
564
+}
565
+
566
+onReachBottom(() => {
567
+  handleScrollToLower()
568
+
569
+})
570
+
571
+
386 572
 </script>
387 573
 <template>
388 574
   <CXBBasePage>
389 575
     <div class="relative w-screen " v-if="detail">
390
-      <swiper
391
-          v-if="detail.featured"
392
-          :indicator-dots="false"
393
-          :circular="true"
394
-          :autoplay="true"
395
-          :interval="5000"
396
-          :duration="500"
397
-          class="h-95"
398
-      >
399
-        <swiper-item
400
-            v-for="(item, index) in detail.featured"
401
-            :key="index"
402
-        >
403
-          <image
404
-              :key="index"
405
-              :src="item"
406
-              mode="aspectFill" class="h-full w-full"
407
-          />
576
+      <swiper v-if="detail.featured" :indicator-dots="false" :circular="true" :autoplay="true" :interval="5000"
577
+        :duration="500" class="h-95">
578
+        <swiper-item v-for="(item, index) in detail.featured" :key="index">
579
+          <image :key="index" :src="item" mode="aspectFill" class="h-full w-full" />
408 580
         </swiper-item>
409 581
       </swiper>
410 582
       <div>
411 583
         <div class="relative p-3 bg-white">
412 584
           <div class="flex gap-2 items-end">
413 585
             <FPrice v-if="detail && detail.salePrice" :price="detail.salePrice" need-symbol :size="'large'"
414
-                    ex-class="!text-[24px]"/>
586
+              ex-class="!text-[24px]" />
415 587
             <FPrice v-if="detail && detail.price" :price="detail.price" :ex-class="'!text-gray'" need-symbol
416
-                    strike-through/>
588
+              strike-through />
417 589
           </div>
418 590
 
419 591
           <div class="font-bold py-2">{{ detail.title }}</div>
420 592
         </div>
421 593
 
422
-        <div class="relative"
423
-             v-if="hasCoupon"
424
-
425
-        >
426
-          <div
427
-              class="px-3 relative"
428
-              @tap="handleBuyNow"
429
-          >
430
-            <image :src="discount_coupon_bg_220804Image"
431
-                   mode="widthFix"
432
-                   class="w-full"
433
-            ></image>
434
-            <div class="absolute top-2 left-15 h-full w-fit text-white"
435
-            >
594
+        <div class="relative" v-if="hasCoupon">
595
+          <div class="px-3 relative" @tap="handleBuyNow">
596
+            <image lazy-load :src="discount_coupon_bg_220804Image" mode="widthFix" class="w-full"></image>
597
+            <div class="absolute top-2 left-15 h-full w-fit text-white">
436 598
               <div class=" inline-flex justify-center items-end w-full py-2">
437 599
                 <div class="text-[28px]">{{ detail.coupon.amount }}</div>
438 600
                 元代金劵
@@ -448,12 +610,8 @@ const hasCoupon = computed(() => {
448 610
             {{ detail.mallName }}
449 611
           </div>
450 612
           <!--          <mpHtml :content=""></mpHtml>-->
451
-          <image v-for="(imgItem, index) in detail.images"
452
-                 :key="index"
453
-                 mode="widthFix"
454
-                 :src="imgItem"
455
-                 class="w-full h-full"
456
-          ></image>
613
+          <image v-for="(imgItem, index) in detail.images" :key="index" mode="widthFix" :src="imgItem"
614
+            class="w-full h-full"></image>
457 615
         </div>
458 616
       </div>
459 617
       <div class="fixed bottom-0  w-full h-15 shadow">
@@ -461,7 +619,7 @@ const hasCoupon = computed(() => {
461 619
           <div class="flex justify-between items-center p-3">
462 620
             <div class="inline-flex items-center">
463 621
               <div class="text-sm">预估养老金</div>
464
-              <FPrice :price="detail.yanglao || detail.commission" need-symbol ex-class="text-[20px] font-bold"/>
622
+              <FPrice :price="detail.yanglao || detail.commission" need-symbol ex-class="text-[20px] font-bold" />
465 623
             </div>
466 624
             <div>
467 625
               <nut-button type="primary" @tap="handleBuyNow" :disabled="isSubmit">
@@ -472,10 +630,81 @@ const hasCoupon = computed(() => {
472 630
         </div>
473 631
       </div>
474 632
     </div>
633
+    <!-- 商品下架展示 -->
634
+    <div class="relative w-screen " v-if="isShow">
635
+      <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
636
+      <div class="box-out">
637
+        <div class="flex-box pb-3 px-3 ">
638
+          <div class="img-div">
639
+            <image lazy-load :src="outImg" mode="widthFix" class=" top-0 right-0 sold-out ">
640
+            </image>
641
+          </div>
642
+          <div class="out-conter">该商品下架不存在</div>
643
+        </div>
644
+
645
+      </div>
646
+      <div class="flex flex-col pb-safe gap-3">
647
+        <div class="p-3 bg-white">
648
+          <div
649
+            class="before:content-[''] before:block before:absolute before:w-1 before:h-full before:bg-gradient-to-b from-red-500 to-red-600 before:rounded relative inline-block">
650
+            <div class="pl-2">
651
+              精品推荐
652
+            </div>
653
+          </div>
654
+        </div>
655
+        <div class="pb-3 px-3" v-if="skuInfo.recommendList.length != 0">
656
+          <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
657
+            <div v-for="(item, index) in skuInfo.recommendList" :key="index" @click="handleProductItemClick(item)">
658
+              <MerchantProductCard :item="item" />
659
+
660
+            </div>
661
+          </grid-view>
662
+          <div class=" flex justify-center items-center text-[12px] text-gray-500">
663
+            <div v-if="skuInfo.status === 'loading'">
664
+              加载中...
665
+            </div>
666
+            <div v-if="skuInfo.status === 'noMore'">
667
+              没有更多了~
668
+            </div>
669
+          </div>
670
+        </div>
671
+
672
+      </div>
673
+    </div>
475 674
 
476 675
   </CXBBasePage>
477 676
 </template>
677
+<style scoped>
678
+.box-out {
679
+  background: #f8f8f8;
680
+  height: 200px;
681
+}
478 682
 
683
+.flex-box {
684
+  background: #ffffff;
685
+  box-shadow: 3px;
686
+  height: 80%;
687
+  display: flex;
688
+  flex-direction: column;
689
+  justify-content: space-evenly;
690
+}
691
+
692
+.img-div {
693
+  width: 100%;
694
+
695
+}
696
+
697
+.sold-out {
698
+  display: block;
699
+  width: 120px;
700
+  height: 120px;
701
+  margin: 0 auto;
702
+}
703
+
704
+.out-conter {
705
+  text-align: center;
706
+}
707
+</style>
479 708
 <route lang="yaml">
480 709
 style:
481 710
   navigationBarTitleText: 商品详情

+ 80 - 0
src/pages/to-coupon/to-coupon.vue

@@ -0,0 +1,80 @@
1
+<template>
2
+	<div class="box_2 flex-col" v-if="isShow" >
3
+		<div class="block_1 flex-col"></div>
4
+		<div class="flex-box">
5
+			<div class="img-div">
6
+				<image lazy-load class="image_2" mode="widthFix" :src="outImg" />
7
+			</div>
8
+
9
+			<div class="text_3">暂无可用优惠券</div>
10
+		</div>
11
+
12
+	</div>
13
+</template>
14
+
15
+<script lang="ts" setup >
16
+
17
+import { ref, reactive } from 'vue'
18
+import { CDN_URL,CDM_URL } from "~/config/app";
19
+const isShow = ref(true)
20
+
21
+const outImg = computed(() => {
22
+  if(isShow){
23
+    return  CDM_URL+'/image/2023-11-24/20231124181903347.png'
24
+  }
25
+
26
+})
27
+
28
+</script>
29
+
30
+<style>
31
+.box_2 {
32
+	height: 100%;
33
+}
34
+
35
+.block_1 {
36
+	width: 100%;
37
+	height: 18rpx;
38
+	background-size: 100% 100%;
39
+}
40
+
41
+.image_2 {
42
+	width:206rpx;
43
+	height:206rpx;
44
+	display: block;
45
+	margin-top: 400rpx;
46
+	margin-bottom: 40rpx;
47
+}
48
+
49
+.text_3 {
50
+	height: 30rpx;
51
+	overflow-wrap: break-word;
52
+	color: rgba(51, 51, 51, 1);
53
+	font-size: 30rpx;
54
+	font-weight: NaN;
55
+	text-align: center;
56
+	white-space: nowrap;
57
+	line-height: 30rpx;
58
+	
59
+}
60
+
61
+.flex-box {
62
+	width: 100%;
63
+	height: 100%;
64
+	display: flex;
65
+	flex-direction: column;
66
+	justify-content: space-evenly;
67
+}
68
+
69
+.img-div {
70
+	width: 100%;
71
+	display: flex;
72
+	justify-content: space-evenly;
73
+}
74
+
75
+</style>
76
+<route lang="yaml">
77
+style:
78
+  navigationBarTitleText: 优惠券
79
+  enablePullDownRefresh: false
80
+</route>

+ 1 - 1
src/pages/user/address/index.vue

@@ -37,7 +37,7 @@
37 37
       <CXBEmpty text="您还没有收货地址" type="address" v-else/>
38 38
 
39 39
       <div class="fixed bottom-0 p-safe w-full bg-white ">
40
-        <div class="px-3">
40
+        <div class="p-3">
41 41
           <nut-button block type="primary" @click="handleCreateAddress">新建收货地址</nut-button>
42 42
         </div>
43 43
       </div>

+ 307 - 166
src/pages/user/index.vue

@@ -1,12 +1,14 @@
1 1
 <script lang="ts" setup>
2
-import {useUserStore} from "~/stores/userStore";
2
+import { useUserStore } from "~/stores/userStore";
3 3
 import CXBAuthorize from "~/components/CXBAuthorize/CXBAuthorize.vue";
4
-import {getAgentInfo, getUserInfo} from "~/apis/user";
5
-import {CDN_URL} from "~/config/app";
4
+import { getAgentInfo, getUserInfo } from "~/apis/user";
5
+import { CDN_URL,CDM_URL } from "~/config/app";
6 6
 import Routine from "~/libs/routine";
7
-import {totalOrderNumber} from "~/apis/order.api";
8
-import type {OrderQuantityModel} from "~/apis/model/order.model";
9
-import type {Ref} from "vue";
7
+import { totalOrderNumber } from "~/apis/order.api";
8
+import type { OrderQuantityModel } from "~/apis/model/order.model";
9
+import FPopup from "~/components/FPopup/FPopup.vue";
10
+import { CANCEL_EVENT, OPEN_EVENT } from "~/constants/event";
11
+import type { Ref } from "vue";
10 12
 const pageStore = usePageStoreWidthOut()
11 13
 const currentType = ref('')
12 14
 const myOrderList = [{
@@ -42,13 +44,22 @@ const contactUsList = [{
42 44
   icon: '/static/icon/kefu_icon.png',
43 45
   text: '联系客服',
44 46
   url: 'https://work.weixin.qq.com/kfid/kfce29f31a08fd53ee0'
45
-},{
47
+}, {
46 48
   type: 'link',
47 49
   icon: CDN_URL + '/static/assets/bangzhuzhongxin_220620.png',
48 50
   text: '帮助中心',
49 51
   url: '/pages/help-center/index'
50 52
 }]
51 53
 
54
+
55
+//市/区代表弹框标识
56
+const showValue = ref(false)
57
+
58
+//https://cdn.bjtdba.com/vod/image/2023-11-24/20231124154421388.png
59
+
60
+
61
+//https://cdn.bjtdba.com/vod/image/2023-11-24/20231124154612477.png
62
+
52 63
 const myServiceList = [{
53 64
   icon: CDN_URL + '/static/assets/wodeyaoqing_220620.png',
54 65
   text: '我的邀请',
@@ -81,11 +92,7 @@ const myServiceList = [{
81 92
   icon: CDN_URL + '/static/assets/dianpuruzhu_220620.png',
82 93
   text: '商铺入驻',
83 94
   url: ''
84
-}, {
85
-  icon: '/static/icon/bangfu.png',
86
-  text: '帮扶中心',
87
-  url: '/pages/bangfuzhongxin/index'
88
-}, {
95
+},  {
89 96
   icon: CDN_URL + '/static/assets/mine_setting_220620.png',
90 97
   text: '设置',
91 98
   url: '/pages/setting/index'
@@ -194,9 +201,7 @@ function handleService(item: {
194 201
   })
195 202
 }
196 203
 
197
-// onShow(async () => {
198
-// await userStore.getUserInfo()
199
-// })
204
+
200 205
 
201 206
 function encodePhone(phone: string) {
202 207
   // let tel = '13600136000';
@@ -236,71 +241,111 @@ function handleShowMyAllOrder(tab?: number) {
236 241
 
237 242
 const userType = computed(() => {
238 243
   const userRichType = userStore.userInfo?.user_rich_type
244
+ 
239 245
   // console.log(userStore.userInfo)
240
-  const bangfu = userStore.userInfo?.is_bangfu ? '帮扶中心 ' : ''
241
-  // 创始人
242
-  if (userRichType == 3) {
243
-    if (bangfu) {
244
-      return ['创始人', bangfu]
245
-    }
246
-    return ['创始人']
247
-    // return [].push()
248
-  }
249 246
   // 普通用户
250 247
   if (userRichType == 0) {
251
-    if (bangfu) {
252
-      return ['用户', bangfu]
253
-    }
254
-    return ['用户']
248
+
249
+    return '../../static/img-hy/用户.png'
255 250
   }
256 251
   // 会员
257 252
   if (userRichType == 1) {
258
-    if (bangfu) {
259
-      return ['会员', bangfu]
260
-    }
261
-    return ['会员']
253
+
254
+    return '../../static/img-hy/会员.png'
262 255
 
263 256
   }
264 257
   if (userRichType == 3) {
265
-    if (bangfu) {
266
-      return ['创始人', bangfu]
267
-    }
268
-    return ['创始人']
258
+
259
+    return '../../static/img-hy/创始人.png'
269 260
   }
270
-  // 合伙人
261
+  // 高级会员
271 262
   if (userRichType == 4) {
272
-    // return '高级会员'
273
-    if (bangfu) {
274
-      return ['VIP', bangfu]
275
-    }
276
-    return ['VIP']
263
+
264
+    return '../../static/img-hy/高级会员.png'
277 265
   }
278
-  if (userRichType == 5) {
279
-    if (bangfu) {
280
-      return ['初始级合伙人', bangfu]
281
-    }
282
-    return ['初始级合伙人']
266
+  if (userRichType == 8) {
267
+
268
+    return '../../static/img-hy/合伙人.png'
283 269
   }
284
-  if (userRichType == 6) {
285
-    if (bangfu) {
286
-      return ['中级合伙人', bangfu]
287
-    }
288
-    return ['中级合伙人']
270
+  if (userRichType == 9) {
271
+
272
+    return '../../static/img-hy/联合创始人.png'
289 273
   }
290
-  if (userRichType == 7) {
291
-    if (bangfu) {
292
-      return ['高级合伙人', bangfu]
274
+  if (!userRichType) {
275
+
276
+    return ''
277
+  }
278
+})
279
+
280
+//0:普通用户 1:股东
281
+const AlholderType = computed(() => {
282
+  const stockholder = userStore.userInfo?.stockholder
283
+  // 普通用户
284
+  if (stockholder == 0) {
285
+    return ''
286
+  }
287
+  // 股东
288
+  if (stockholder == 1) {
289
+    return '../../static/img-hy/股东.png'
290
+  }
291
+
292
+})
293
+// '':普通用户 district-区/县代 city-市代',
294
+const areaType = computed(() => {
295
+  if (userStore.userInfo?.area_manage?.area_name) {
296
+    const areamanage = userStore.userInfo?.area_manage_type
297
+    // 县/区代理
298
+    if (areamanage == 'district') {
299
+      return '../../static/img-hy/district.png'
300
+    }
301
+    // 市代理
302
+    if (areamanage == 'city') {
303
+      return '../../static/img-hy/city.png'
304
+    }
305
+    //普通用户
306
+    if (!areamanage) {
307
+      return ''
293 308
     }
294
-    return ['高级合伙人']
309
+
295 310
   }
296
-  if (!userRichType) {
297
-    if (bangfu) {
298
-      return ['用户', bangfu]
311
+
312
+})
313
+
314
+//弹框展示
315
+function openPopup() {
316
+  showValue.value = true
317
+}
318
+//关闭弹框
319
+const onCancel = () => {
320
+  // show.value = false
321
+  showValue.value = false
322
+}
323
+
324
+//计算市区县展示图片
325
+const backImg = computed(() => {
326
+  if (userStore.userInfo?.area_manage_type) {
327
+    const areamanage = userStore.userInfo?.area_manage_type
328
+    // 县/区代理
329
+    if (areamanage == 'district') {
330
+      return CDM_URL+'/image/2023-11-24/20231124154421388.png'
331
+    }
332
+    // 市代理
333
+    if (areamanage == 'city') {
334
+      return CDM_URL+'/image/2023-11-24/20231124154612477.png'
299 335
     }
300
-    return ['用户']
301 336
   }
337
+
338
+})
339
+const textType = computed(() => {
340
+  if (userStore.userInfo?.area_manage?.area_name) {
341
+    const areamanage = userStore.userInfo?.area_manage.area_name
342
+    let res = areamanage.join("");
343
+    return res
344
+  }
345
+
302 346
 })
303 347
 
348
+
304 349
 function handleToRedIntegral() {
305 350
   uni.navigateTo({
306 351
     url: '/pages/red-integral/index'
@@ -335,9 +380,9 @@ function handleShowMyProfile() {
335 380
   })
336 381
 }
337 382
 
338
-function handleShowMyRulePage(item) {
383
+function handleShowMyRulePage() {
339 384
   uni.navigateTo({
340
-    url: `/pages/my-rules/index?userType=${item}`
385
+    url: `/pages/my-rules/index`
341 386
   })
342 387
 }
343 388
 </script>
@@ -348,72 +393,91 @@ function handleShowMyRulePage(item) {
348 393
       <div class="pt-15 ">
349 394
         <div class="flex gap-2 mb-2 text-white mb-6">
350 395
           <image v-if="userStore.userInfo && userStore.userInfo.avatar" :src="userStore.userInfo.avatar"
351
-                 @click="handleShowMyProfile"
352
-                 mode="widthFix"
353
-                 class="w-9 h-9 rounded-full"
354
-          ></image>
355
-          <image
356
-              v-else
357
-              @click="checkAuth"
358
-              src="https://app.bjtdba.com/uploads/logo.jpg"
359
-              mode="widthFix"
360
-              class="w-9 h-9 rounded-full"
361
-          />
362
-          <div class="flex">
363
-            <div class="flex flex-col">
396
+            @click="handleShowMyProfile" mode="widthFix" class="w-9 h-9 rounded-full"></image>
397
+          <image v-else @click="checkAuth" src="https://app.bjtdba.com/uploads/logo.jpg" mode="widthFix"
398
+            class="w-9 h-9 rounded-full" />
399
+          <div class="flex flex-col">
400
+            <div class="flex">
364 401
               <div class="text-sm">
365 402
                 <div class="text-sm" v-if="userStore.userInfo">
366 403
                   {{ userStore.userInfo.nickname ? userStore.userInfo.nickname : '登录' }}
367 404
                 </div>
368 405
               </div>
369
-              <div class="text-xs" v-if="userStore.userInfo && userStore.userInfo.phone">
406
+              <div class="text-sm flex-height " v-if="userStore.userInfo && userStore.userInfo.phone">
370 407
                 {{ encodePhone(userStore.userInfo.phone) }}
371 408
               </div>
372 409
             </div>
373
-            <div class="flex gap-1 items-center px-1">
374
-            <div
375
-                v-for="(item, index) in userType"
376
-                :key="index"
377
-                @click="handleShowMyRulePage(item)"
378
-                class="flex rounded-full border border-solid border-1px border-yellow text-[12px] text-white w-12 h-5 justify-center items-center w-fit px-1">
379
-              {{ item }}
380
-            </div>
410
+            <div class="btm flex gap-1 ">
411
+              <!-- 用户 -->
412
+              <div v-if="userType" @click="handleShowMyRulePage()"
413
+                class="flex rounded-full  text-[12px] text-white w-12 h-5  w-fit ">
414
+                <image mode="heightFix" lazy-load class="vip_img" :src="userType"></image>
415
+              </div>
416
+              <!-- 市区县代理 -->
417
+              <div @click="openPopup" v-if="areaType"
418
+                class="flex rounded-full  text-[12px] text-white w-12 h-5  w-fit ">
419
+                <image mode="heightFix" lazy-load class="vip_img" :src="areaType"></image>
420
+              </div>
421
+              <!-- 股东 -->
422
+              <div v-if="AlholderType" 
423
+                class="flex rounded-full  text-[12px] text-white w-12 h-5   w-fit">
424
+                <image mode="heightFix" lazy-load class="vip_img" :src="AlholderType"></image>
425
+              </div>
381 426
             </div>
382 427
           </div>
383
-
428
+          <FPopup v-model:show="showValue" position="center" exClass="box_2 ">
429
+            <div class="box_2 flex-row">
430
+              <div class="box_2" v-if="backImg" >
431
+                <image  lazy-load class="img_1" :src="backImg"></image>
432
+              </div>
433
+              <div class="group_2 flex-col lolr ">
434
+                <div class="div_box pong1 ">
435
+                  <div class="blue_1">
436
+                    <image lazy-load class="off_3" src="../../static/img-hy/DLqy.png" />
437
+                    <span class="pan">代理区域</span>
438
+                  </div>
439
+                  <div class="blue_2 height1 ">
440
+                    {{ textType }}
441
+                  </div>
442
+                </div>
443
+                <div class="div_box pong2 ">
444
+                  <div class="blue_1">
445
+                    <image lazy-load class="off_3" src="../../static/img-hy/QYDL.png" />
446
+                    <span class="pan">代理权益</span>
447
+                  </div>
448
+                  <div class="block_1 flex-col blue_2 height2 ">
449
+                    <div class="text-group_4 flex-col justify-between">
450
+                      <div class=" pend">所辖区域的区域管理分红</div>
451
+                      <div class="text_5 pand ">(参照会员系统佣金逻辑)</div>
452
+                    </div>
453
+                  </div>
454
+                </div>
455
+              </div>
456
+            </div>
457
+            <div @click="onCancel" class="off_1">
458
+              <image lazy-load class="off_2" src="../../static/img-hy/关闭.png" />
459
+            </div>
460
+          </FPopup>
384 461
 
385 462
         </div>
386 463
         <div class="bg-white rounded flex flex-col gap-6 py-4 text-xl">
387
-          <div
388
-              v-if="userStore.userInfo"
389
-              class="flex flex-wrap">
390
-            <div
391
-                @tap="handleShowAnnuityDetail"
392
-                class="w-1/3 flex flex-col justify-center items-center"
393
-            >
464
+          <div v-if="userStore.userInfo" class="flex flex-wrap">
465
+            <div @tap="handleShowAnnuityDetail" class="w-1/3 flex flex-col justify-center items-center">
394 466
               <div>{{ userStore.yanglao.all_yanglao }}</div>
395 467
               <div class="text-xs">养老金</div>
396 468
             </div>
397
-            <div
398
-                @tap="handleShowMyInvitation"
399
-                class="w-1/3  flex flex-col justify-center items-center">
400
-              <div>{{ agentInfo.brokerage_price ? agentInfo.brokerage_price : '0.00'}}</div>
469
+            <div @tap="handleShowMyInvitation" class="w-1/3  flex flex-col justify-center items-center">
470
+              <div>{{ agentInfo.brokerage_price}}</div>
401 471
               <div class="text-xs">我的佣金</div>
402 472
             </div>
403
-            <div
404
-                @tap="handleShowMyIntegral"
405
-                class="w-1/3  flex flex-col justify-center items-center">
473
+            <div @tap="handleShowMyIntegral" class="w-1/3  flex flex-col justify-center items-center">
406 474
               <div>{{ userStore.userInfo.score }}</div>
407 475
               <div class="text-xs">我的积分</div>
408 476
             </div>
409 477
           </div>
410
-          <div
411
-              v-if="userStore.userInfo"
412
-              class="flex">
413
-            <div
414
-                @click="handleToRedIntegral"
415
-                class="w-1/2 flex flex-col justify-center items-center">
416
-              <div>{{ userStore.userInfo.red }}</div>
478
+          <div v-if="userStore.userInfo" class="flex">
479
+            <div @click="handleToRedIntegral" class="w-1/2 flex flex-col justify-center items-center">
480
+              <div>{{ userStore.userInfo.member_brokerage_price}}</div>
417 481
               <div class="text-xs">红积分提现</div>
418 482
             </div>
419 483
             <div class="w-1/2 flex flex-col  justify-center items-center">
@@ -430,9 +494,7 @@ function handleShowMyRulePage(item) {
430 494
         <div class="flex justify-between pt-4 mb-4">
431 495
           <div>我的订单</div>
432 496
           <div class="flex items-center">
433
-            <div
434
-                @click="handleShowMyAllOrder(0)"
435
-                class="text-sm text-gray">查看全部
497
+            <div @click="handleShowMyAllOrder(0)" class="text-sm text-gray">查看全部
436 498
             </div>
437 499
             <div class="f-text-color-2 i-tabler-chevron-right"></div>
438 500
           </div>
@@ -440,51 +502,35 @@ function handleShowMyRulePage(item) {
440 502
 
441 503
         </div>
442 504
         <div class="flex pb-4">
443
-          <div
444
-              @click="handleShowMyAllOrder(index + 1)"
445
-              v-for="(item, index) in myOrderList" :key="index"
446
-              class="flex flex-col justify-center items-center w-1/5 gap-3"
447
-          >
505
+          <div @click="handleShowMyAllOrder(index + 1)" v-for="(item, index) in myOrderList" :key="index"
506
+            class="flex flex-col justify-center items-center w-1/5 gap-3">
448 507
             <div class="relative">
449
-              <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
450
-                   v-if="
451
-                   item.id == 'noPay' && orderQuantity &&  orderQuantity.noPay != '0'"
452
-
453
-              >
454
-                {{ orderQuantity.noPay}}
508
+              <div
509
+                class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
510
+                v-if="item.id == 'noPay' && orderQuantity && orderQuantity.noPay != '0'">
511
+                {{ orderQuantity.noPay }}
455 512
               </div>
456
-              <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
457
-                   v-if="
458
-                   item.id == 'refund' && orderQuantity && orderQuantity.refund != '0'"
459
-
460
-              >
461
-                {{ orderQuantity.refund}}
513
+              <div
514
+                class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
515
+                v-if="item.id == 'refund' && orderQuantity && orderQuantity.refund != '0'">
516
+                {{ orderQuantity.refund }}
462 517
               </div>
463
-              <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
464
-                   v-if="
465
-                   item.id == 'noDeliver' && orderQuantity && orderQuantity.noDeliver != '0'"
466
-
467
-              >
468
-                {{ orderQuantity.noDeliver}}
518
+              <div
519
+                class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
520
+                v-if="item.id == 'noDeliver' && orderQuantity && orderQuantity.noDeliver != '0'">
521
+                {{ orderQuantity.noDeliver }}
469 522
               </div>
470
-              <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
471
-                   v-if="
472
-                   item.id == 'noPostage' && orderQuantity && orderQuantity.noPostage != '0'"
473
-
474
-              >
475
-                {{ orderQuantity.noPostage}}
523
+              <div
524
+                class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
525
+                v-if="item.id == 'noPostage' && orderQuantity && orderQuantity.noPostage != '0'">
526
+                {{ orderQuantity.noPostage }}
476 527
               </div>
477
-              <div class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
478
-                   v-if="
479
-                   item.id == 'noComment' && orderQuantity && orderQuantity.noComment != '0'"
480
-
481
-              >
482
-                {{ orderQuantity.noComment}}
528
+              <div
529
+                class="bg-primary rounded-full w-3 h-3 text-[9px] text-white flex justify-center items-center absolute top--1 right--2 text-center"
530
+                v-if="item.id == 'noComment' && orderQuantity && orderQuantity.noComment != '0'">
531
+                {{ orderQuantity.noComment }}
483 532
               </div>
484
-              <image :src="item.icon"
485
-                     mode="widthFix"
486
-                     class="w-7 h-7 "
487
-              />
533
+              <image :src="item.icon" mode="widthFix" class="w-7 h-7 " />
488 534
             </div>
489 535
 
490 536
             <div class="text-xs">{{ item.text }}</div>
@@ -497,15 +543,9 @@ function handleShowMyRulePage(item) {
497 543
           <div>我的服务</div>
498 544
         </div>
499 545
         <div class="flex flex-wrap ">
500
-          <div
501
-              v-for="(item, index) in myServiceList" :key="index"
502
-              @tap="handleService(item)"
503
-              class="flex flex-col justify-center items-center w-1/4 gap-2 mb-4"
504
-          >
505
-            <image :src="item.icon"
506
-                   mode="widthFix"
507
-                   class="w-6 h-6 "
508
-            />
546
+          <div v-for="(item, index) in myServiceList" :key="index" @tap="handleService(item)"
547
+            class="flex flex-col justify-center items-center w-1/4 gap-2 mb-4">
548
+            <image :src="item.icon" mode="widthFix" class="w-6 h-6 " />
509 549
             <div class="text-xs">{{ item.text }}</div>
510 550
           </div>
511 551
         </div>
@@ -517,15 +557,9 @@ function handleShowMyRulePage(item) {
517 557
           <div>联系我们</div>
518 558
         </div>
519 559
         <div class="flex flex-wrap ">
520
-          <div
521
-              v-for="(item, index) in contactUsList" :key="index"
522
-              @tap="handleToContact(item)"
523
-              class="flex flex-col justify-center items-center w-1/4 gap-2 mb-4"
524
-          >
525
-            <image :src="item.icon"
526
-                   mode="widthFix"
527
-                   class="w-6 h-6 "
528
-            />
560
+          <div v-for="(item, index) in contactUsList" :key="index" @tap="handleToContact(item)"
561
+            class="flex flex-col justify-center items-center w-1/4 gap-2 mb-4">
562
+            <image :src="item.icon" mode="widthFix" class="w-6 h-6 " />
529 563
             <div class="text-xs">{{ item.text }}</div>
530 564
           </div>
531 565
         </div>
@@ -541,6 +575,113 @@ function handleShowMyRulePage(item) {
541 575
 page {
542 576
   background-color: #f8f8f8;
543 577
 }
578
+
579
+.flex-height {
580
+  margin-left: 3px;
581
+}
582
+
583
+.btm {
584
+  margin-top: 1px;
585
+}
586
+
587
+.vip_img {
588
+  height: 56rpx;
589
+}
590
+
591
+.box_2 {
592
+  background-color: #ffffff00;
593
+}
594
+
595
+.img_1 {
596
+  width: 560rpx;
597
+  height: 660rpx;
598
+}
599
+
600
+.off_1 {
601
+  width: 72rpx;
602
+  height: 72rpx;
603
+  position: absolute;
604
+  margin-top: 40rpx;
605
+  left: 50%;
606
+  margin-left: -36rpx;
607
+}
608
+
609
+.off_2 {
610
+  width: 100%;
611
+  height: 100%;
612
+}
613
+
614
+.off_3 {
615
+  width: 34rpx;
616
+  height: 34rpx;
617
+}
618
+
619
+.div_box {
620
+  width: 496rpx;
621
+  height: 152rpx;
622
+  background: #E5F9FF;
623
+  border-radius: 16rpx;
624
+  margin-left: 32rpx;
625
+}
626
+
627
+.blue_1 {
628
+  height: 80rpx;
629
+  line-height: 80rpx;
630
+}
631
+
632
+.blue_1 image {
633
+  margin-left: 26rpx;
634
+  margin-top: 14rpx;
635
+}
636
+
637
+.pan {
638
+  font-size: 28rpx;
639
+  margin-left: 10rpx;
640
+  font-family: SourceHanSansCN, SourceHanSansCN;
641
+  font-weight: 500;
642
+  color: #4D4D69;
643
+
644
+}
645
+
646
+.blue_2 {
647
+  font-size: 30rpx;
648
+  font-family: SourceHanSansCN, SourceHanSansCN;
649
+  font-weight: bold;
650
+  color: #4D4D69;
651
+  background: #C2F0FF;
652
+  padding-left: 26rpx;
653
+}
654
+
655
+.pand {
656
+  font-size: 22rpx;
657
+  font-family: SourceHanSansCN, SourceHanSansCN;
658
+  font-weight: bold;
659
+  color: black;
660
+}
661
+
662
+.height1 {
663
+  height: 74rpx;
664
+  line-height: 74rpx;
665
+}
666
+
667
+.pend {
668
+  padding-top: 14rpx
669
+}
670
+
671
+.height2 {
672
+  height: 90rpx;
673
+  border-radius: 0rpx 0rpx 16rpx 16rpx;
674
+}
675
+
676
+.pong1 {
677
+  position: absolute;
678
+  top: 255rpx
679
+}
680
+
681
+.pong2 {
682
+  position: absolute;
683
+  top: 447rpx
684
+}
544 685
 </style>
545 686
 <route lang="yaml">
546 687
 style:

+ 11 - 5
src/pages/user/login/index.vue

@@ -54,8 +54,10 @@ async function handleWexinLogin() {
54 54
         code: result.code,
55 55
         source: 'cxb'
56 56
       }).then(unionRes => {
57
-        // console.log(unionRes)
57
+        console.log(111111,unionRes)
58 58
         // const shareId = Cache.get('SHARE_ID')
59
+        //存储openid
60
+        // userStore.setOpenid(unionRes.openid)
59 61
         let redirectPageObj: {page: string, type: 'page' | 'tab'}
60 62
         if (Cache.get('SHARE_REDIRECT_PAGE')) {
61 63
           redirectPageObj = JSON.parse(Cache.get('SHARE_REDIRECT_PAGE'))
@@ -66,19 +68,21 @@ async function handleWexinLogin() {
66 68
           // params = Object.assign({}, params, { shareId })
67 69
         // }
68 70
         wechatCheck(unionRes.unionid).then(checkRes => {
69
-          // console.log(checkRes)
71
+          
70 72
           userStore.login(checkRes.token, checkRes.exp)
71 73
           userStore.setUID(checkRes.user.uid)
72 74
           userStore.setUserInfo(checkRes.user)
73 75
           // console.log(checkRes)
74 76
           uni.hideLoading();
75
-
77
+          console.log('我存在吗111',redirectPageObj);
76 78
             uni.showToast({
77 79
               title: '登录成功'
78 80
             }).then(() => {
79 81
               setTimeout(() => {
80
-
82
+                console.log('我存在吗222',redirectPageObj);
83
+                
81 84
                 if (redirectPageObj) {
85
+                  console.log('我存在吗333',redirectPageObj);
82 86
                   if (redirectPageObj.type === 'page') {
83 87
                     return uni.redirectTo({
84 88
                       url: redirectPageObj.page
@@ -90,6 +94,8 @@ async function handleWexinLogin() {
90 94
                     })
91 95
                   }
92 96
                 } else {
97
+                  console.log('我是key>>>aaa',state.key);
98
+                  
93 99
                   switch (state.key) {
94 100
                     case '10': {
95 101
                       uni.switchTab({
@@ -105,7 +111,7 @@ async function handleWexinLogin() {
105 111
                     }
106 112
                     case '1': {
107 113
                       uni.switchTab({
108
-                        url: '/pages/order_addcart/order_addcart'
114
+                        url: '/pages/order_addcart/index'
109 115
                       })
110 116
                       break;
111 117
                     }

+ 37 - 22
src/pages/user/login/other-phone.vue

@@ -1,33 +1,26 @@
1 1
 <template>
2 2
   <div>
3
-    <CXBBanner/>
3
+    <CXBBanner />
4 4
 
5
-    <nut-input
6
-        v-model="state.phone"
7
-        placeholder="请输入手机号"
8
-    >
5
+    <nut-input v-model="state.phone" placeholder="请输入手机号" type="number">
9 6
       <template #right>
10 7
         <nut-button type='primary' size="small" @click="handleGetCode" :loading="state.isAuthVerify">
11
-        {{ state.buttonText }}
12
-      </nut-button>
8
+          {{ state.buttonText }}
9
+        </nut-button>
13 10
       </template>
14 11
     </nut-input>
15
-    <nut-input
16
-        v-model="state.code"
17
-        placeholder="请输入验证码"
18
-        clearable
19
-    >
12
+    <nut-input v-model="state.code" placeholder="请输入验证码" clearable type="number">
20 13
     </nut-input>
21 14
 
22 15
     <div class="flex w-full">
23 16
       <div class="p-3 w-full">
24 17
         <nut-button type="primary" @click="handleLogin" block :disabled="!isFormVerify">登录</nut-button>
25
-<!--        <div class="text-xs text-gray flex flex-col justify-center items-center p-3">-->
26
-<!--          <div>-->
27
-<!--            我已阅读并同意<span class="text-red text-xs" @click="handleViewXieyi(2)">《注册协议》</span>和<span-->
28
-<!--              class="text-red text-xs" @click="handleViewXieyi(1)">《隐私协议》</span>-->
29
-<!--          </div>-->
30
-<!--        </div>-->
18
+        <!--        <div class="text-xs text-gray flex flex-col justify-center items-center p-3">-->
19
+        <!--          <div>-->
20
+        <!--            我已阅读并同意<span class="text-red text-xs" @click="handleViewXieyi(2)">《注册协议》</span>和<span-->
21
+        <!--              class="text-red text-xs" @click="handleViewXieyi(1)">《隐私协议》</span>-->
22
+        <!--          </div>-->
23
+        <!--        </div>-->
31 24
 
32 25
       </div>
33 26
 
@@ -38,8 +31,9 @@
38 31
 <script setup lang="ts">
39 32
 import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
40 33
 import CXBBanner from "~/components/CXBBanner/CXBBanner.vue";
41
-import {authSmsLogin, authVerify} from "~/apis/auth.api";
34
+import { authSmsLogin, authVerify } from "~/apis/auth.api";
42 35
 import Cache from "~/utils/cache";
36
+import { getUserUnionId } from "~/apis/user";
43 37
 const userStore = useUserStore()
44 38
 
45 39
 const state = reactive({
@@ -104,8 +98,28 @@ function handleViewXieyi(type: number) {
104 98
 }
105 99
 
106 100
 function handleLogin() {
101
+  uni.showLoading({
102
+    title: '登录中'
103
+  });
107 104
   const shareId = Cache.get('SHARE_ID')
108
-
105
+  // uni.login({
106
+  //   provider: 'weixin',
107
+  //   univerifyStyle: {
108
+  //     fullScreen: true
109
+  //   },
110
+  //   success: result => {
111
+  //     // console.log(result)
112
+  //     getUserUnionId({
113
+  //       code: result.code,
114
+  //       source: 'cxb'
115
+  //     }).then(unionRes => {
116
+  //       console.log(111111, unionRes)
117
+  //       // const shareId = Cache.get('SHARE_ID')
118
+  //       //存储openid
119
+  //       userStore.setOpenid(unionRes.openid)
120
+  //     })
121
+  //   }
122
+  // })
109 123
   let params = {
110 124
     phone: state.phone,
111 125
     sms_code: state.code,
@@ -118,17 +132,18 @@ function handleLogin() {
118 132
   authSmsLogin({
119 133
     ...params
120 134
   }).then(authRes => {
121
-    console.log(authRes)
135
+    console.log(111111, authRes)
122 136
     userStore.login(authRes.token, authRes.exp)
123 137
     userStore.setUID(authRes.user.uid)
124 138
     userStore.setUserInfo(authRes.user)
139
+    uni.hideLoading();
125 140
     uni.showToast({
126 141
       title: '登录成功',
127 142
       icon: 'none'
128 143
     })
129 144
     Cache.clear('SHARE_ID')
130 145
     state.isAuthVerify = false
131
-    let redirectPageObj: {page: string, type: 'page' | 'tab'}
146
+    let redirectPageObj: { page: string, type: 'page' | 'tab' }
132 147
     if (Cache.get('SHARE_REDIRECT_PAGE')) {
133 148
       redirectPageObj = JSON.parse(Cache.get('SHARE_REDIRECT_PAGE'))
134 149
     }

+ 275 - 77
src/pages/vip/index.vue

@@ -1,4 +1,5 @@
1 1
 <template>
2
+<<<<<<< HEAD
2 3
 <!--  <CXBBasePage :show="true" title="">-->
3 4
   <div
4 5
       class="overflow-hidden fixed  w-full z-10 f-nav-bar-base"
@@ -28,101 +29,123 @@
28 29
 
29 30
     <div class="flex flex-col gap-3 ">
30 31
 <!--      <image :src="homeBanner" mode="widthFix" class="h-10 w-full "></image>-->
32
+=======
33
+  <!--  <CXBBasePage :show="true" title="">-->
34
+
35
+  <div class="flex flex-col gap-3 ">
36
+    <div style="height: 80rpx;">
37
+      <div style="background-color: transparent  " class="overflow-hidden fixed top-0 w-full z-10">
38
+        <nut-searchbar v-model="state.keyword" @search="searchkwd" @clear="clearSearch">
39
+          <!--      <template v-slot:leftout>-->
40
+          <!--        <div @tap="navBack">-->
41
+          <!--          <nut-icon name="left"></nut-icon>-->
42
+          <!--        </div>-->
43
+          <!--      </template>-->
44
+          <template v-slot:rightout>
45
+            <div @tap="searchkwd">
46
+              搜索
47
+            </div>
48
+          </template>
49
+        </nut-searchbar>
50
+      </div>
51
+    </div>
52
+>>>>>>> li-yi
53
+
54
+
55
+    <!--      <image :src="homeBanner" mode="widthFix" class="h-10 w-full "></image>-->
31 56
 
32
-      <div class="w-screen h-65">
33
-        <swiper
34
-            v-if="state.banners"
35
-            :indicator-dots="state.indicatorDots"
36
-            indicator-active-color="#e93323"
37
-            :autoplay="state.autoplay"
38
-            :circular="state.circular"
39
-            :interval="state.interval"
40
-            :duration="state.duration"
41
-            class="w-full h-full"
42
-        >
57
+    <div class="w-screen h-32">
58
+      <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
59
+      <div class="px-3 h-32">
60
+        <swiper v-if="state.banners" :indicator-dots="state.indicatorDots" indicator-active-color="#e93323"
61
+          :autoplay="state.autoplay" :circular="state.circular" :interval="state.interval" :duration="state.duration"
62
+          class="w-full h-full rounded-md overflow-hidden ">
43 63
           <swiper-item v-for="(item, index) in state.banners" :key="index">
44
-            <image :src="item.pic" class="!w-full !h-full" mode="aspectFill"/>
64
+            <image :src="item.pic" class="w-full h-full object-cover" mode="aspectFill" />
45 65
           </swiper-item>
46 66
         </swiper>
47 67
       </div>
68
+    </div>
48 69
 
49
-      <div class="flex px-3">
50
-        会员专区
51
-      </div>
52
-      <div  class="px-3" v-if="list && list.length > 0">
53
-        <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
54
-          <div v-for="(item, index) in list"
55
-               :key="index"
56
-               @click="handleItemClick(item)"
57
-          >
58
-            <div
59
-                class="bg-white rounded-lg"
60
-            >
61
-              <image :src="item.image" mode="widthFix" 	:fade-in="true" class="rounded-t-lg  !w-full aspect-square"></image>
62
-
63
-              <div class="text-sm p-2 flex flex-col gap-1">
64
-                <div class="line-clamp-1">
65
-                  {{item.store_name}}
66
-                </div>
67
-                <div class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
68
-                  <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png"
69
-                         mode="widthFix" class="!w-8 "></image>
70
-                  <div class="px-2 flex items-center jusitify-center">
71
-                    <div>
72
-                      养老金 ¥{{item.yanglao}}
73
-                    </div>
70
+
71
+    <div class="flex px-3" v-if="state.type == 'user'">
72
+      会员专区
73
+    </div>
74
+    <div class="px-3" v-if="list && list.length > 0">
75
+      <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
76
+        <div v-for="(item, index) in list" :key="index" @click="handleItemClick(item)">
77
+          <div class="bg-white rounded-lg">
78
+            <image :src="item.image" mode="widthFix" :fade-in="true" class="rounded-t-lg  !w-full aspect-square"></image>
79
+
80
+            <div class="text-sm p-2 flex flex-col gap-1">
81
+              <div class="line-clamp-1">
82
+                {{ item.store_name }}
83
+              </div>
84
+              <div v-if="item.type != 15"
85
+                class="border border-solid border-1 border-red rounded flex text-xs items-center text-[#FE0032] w-fit">
86
+                <image src="https://cdn.bjtdba.com/vod/image/2023-09-15/20230915160858609.png" mode="widthFix"
87
+                  class="!w-8 "></image>
88
+                <div class="px-2 flex items-center jusitify-center">
89
+                  <div>
90
+                    养老金 ¥{{ item.yanglao }}
74 91
                   </div>
75 92
                 </div>
76
-                <div class="flex flex-row items-center gap-2">
77
-                  <div class="flex text-[#FE0032] font-bold text-lg">
78
-                    <div>
79
-                      ¥
80
-                    </div>
81
-                    <div>
82
-                      {{ item.price }}
83
-                    </div>
84
-
93
+              </div>
94
+              <div class="flex flex-row items-center gap-2">
95
+                <div class="flex text-[#FE0032] font-bold text-lg">
96
+                  <div>
97
+                    ¥
85 98
                   </div>
86
-
87
-                  <div class="bg-[#202020] text-[#FFDD99] rounded-t-lg rounded-br-lg text-10px leading-none px-1 flex items-center justify-center h-4">
88
-
89
-                    <div>
90
-                      大仓
91
-                    </div>
99
+                  <div>
100
+                    {{ item.price }}
92 101
                   </div>
93 102
 
94 103
                 </div>
95 104
 
96
-                <div class="line-through text-xs font-bold flex ">
97
-                  <div>
98
-                    ¥ {{item.ot_price}}
99
-                  </div>
105
+              </div>
106
+
107
+              <div class="line-through text-xs font-bold flex ">
108
+                <div>
109
+                  ¥ {{ item.ot_price }}
100 110
                 </div>
101 111
               </div>
102 112
             </div>
103
-
104
-          </div>
105
-        </grid-view>
106
-        <div class="pb-safe flex justify-center items-center text-[12px] text-gray-500" >
107
-          <div v-if="state.status === 'loading'">
108
-            加载中...
109
-          </div>
110
-          <div v-if="state.status === 'noMore'">
111
-            没有更多了~
112 113
           </div>
114
+
115
+        </div>
116
+      </grid-view>
117
+      <div class="pb-safe flex justify-center items-center text-[12px] text-gray-500">
118
+        <div v-if="state.status === 'loading'">
119
+          加载中...
120
+        </div>
121
+        <div v-if="state.status === 'noMore'">
122
+          没有更多了~
113 123
         </div>
114 124
       </div>
115
-      <CXBEmpty v-else/>
116 125
     </div>
126
+    <CXBEmpty v-else />
127
+  </div>
117 128
 
118
-<!--  </CXBBasePage>-->
129
+  <!--  </CXBBasePage>-->
119 130
 </template>
120 131
 
121 132
 <script setup lang="ts">
133
+<<<<<<< HEAD
122 134
 import {computed} from "vue";
123 135
 import {getVipAreaList} from "~/apis/merchant";
124 136
 import {getHomeBanner, getProductShare} from "~/apis/common";
125 137
 import {useUserStore} from "~/stores/userStore";
138
+=======
139
+import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
140
+import FSearch from "~/components/FSearch/FSearch.vue";
141
+import { computed } from "vue";
142
+import type CXBBackTop from "~/components/CXBBackTop/CXBBackTop.vue";
143
+import { getTypeProductList, getVipAreaList } from "~/apis/merchant";
144
+import { CDN_URL } from "~/config/app";
145
+import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
146
+import { getHomeBanner, getProductShare } from "~/apis/common";
147
+import { useUserStore } from "~/stores/userStore";
148
+>>>>>>> li-yi
126 149
 import Cache from "~/utils/cache";
127 150
 
128 151
 
@@ -141,8 +164,8 @@ const state = reactive({
141 164
   pageSize: 10,
142 165
   totalPage: 1,
143 166
   banners: [],
144
-
145
-  keyword: '' ,
167
+  count: 0,
168
+  keyword: '',
146 169
   status: 'noMore',
147 170
   indicatorDots: false,
148 171
   circular: true,
@@ -150,10 +173,20 @@ const state = reactive({
150 173
   interval: 5000,
151 174
   duration: 500,
152 175
   currents: "0",
176
+  title: '',
177
+  type: '',
153 178
 })
154
-const list = ref()
179
+const list = ref([])
180
+const count = ref()
155 181
 
156 182
 onLoad((option) => {
183
+
184
+  state.type = option.type
185
+  if (state.type == 'user') {
186
+    state.title = '一壶茶会员中心'
187
+  } else if (state.type == 'gongchang') {
188
+    state.title = '工厂直供'
189
+  }
157 190
   if (option && option.shareId) {
158 191
     userStore.setShareId(option.shareId)
159 192
   }
@@ -162,12 +195,22 @@ onLoad((option) => {
162 195
       userStore.setShareId(res.share_id)
163 196
     }
164 197
   }).catch(message => {
165
-    // console.log(message)
198
+    console.log(message)
199
+    // if (message == '请登录') {
200
+    //   uni.navigateTo({
201
+    //     url: '/pages/user/login/index'
202
+    //   })
203
+    // }
166 204
   })
167
-  userStore.setRedirectPage(`/pages/vip/index`, 'page')
205
+  userStore.setRedirectPage(`/pages/vip/index?type` + state.type, 'page')
168 206
 
207
+<<<<<<< HEAD
169 208
   getHomeBanner("user_banner").then(res => {
170 209
     // console.log(res)
210
+=======
211
+  getHomeBanner(state.type + "_banner").then(res => {
212
+    console.log(state.type + "_banner>>", res)
213
+>>>>>>> li-yi
171 214
     state.banners = res
172 215
   })
173 216
   loadList('reload')
@@ -175,6 +218,20 @@ onLoad((option) => {
175 218
 
176 219
 })
177 220
 
221
+//搜索全部筛选
222
+function searchkwd() {
223
+  if (!state.keyword) {
224
+    return uni.showToast({
225
+      title: '请输入搜索关键字',
226
+      icon: 'none'
227
+    })
228
+  }
229
+  state.currentPage = 1
230
+  state.pageSize = 10
231
+  state.pageSize = state.count
232
+  console.log("1111111111", state.currentPage, state.pageSize);
233
+  loadList('reload')
234
+}
178 235
 
179 236
 onShareAppMessage(() => {
180 237
   const shareId = Cache.get('SHARE_ID')
@@ -211,6 +268,7 @@ onPageScroll((page) => {
211 268
 
212 269
 
213 270
 function loadList(action: 'page' | 'reload', callback?: (items) => void) {
271
+<<<<<<< HEAD
214 272
   if (action === 'reload') {
215 273
     state.currentPage=1;
216 274
   }
@@ -243,7 +301,85 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
243 301
     }
244 302
 
245 303
   })
304
+=======
305
+  if (state.type == 'user') {
306
+    const params = {
307
+      page: state.currentPage,
308
+      limit: state.pageSize
309
+    }
310
+    if (state.keyword) {
311
+      params.keyword = state.keyword
312
+    }
313
+    console.log('我是会员params>>', params)
314
+    getVipAreaList({
315
+      ...params
316
+    }).then(res => {
317
+      console.log(res.count)
318
+      // console.log(res.list)
319
+      count.value = res.count
320
+      console.log(action);
321
+      if (action === 'page') {
322
+        list.value = list.value.concat(res.list)
323
+      }
324
+      if (action === 'reload') {
325
+        list.value = res.list
326
+      }
327
+      if (callback) {
328
+        callback(res)
329
+      }
330
+    })
331
+  } else if (state.type == 'gongchang') {
332
+    if (action === 'reload') {
333
+      state.currentPage = 1
334
+    }
335
+
336
+    const params = {
337
+      type: state.type,
338
+      page: state.currentPage,
339
+      limit: state.pageSize
340
+    }
341
+    if (state.keyword) {
342
+      params.keyword = state.keyword
343
+    }
344
+    getTypeProductList({
345
+      ...params
346
+    }).then(res => {
347
+      if (res) {
348
+        if (action === 'reload') {
349
+          list.value = res.list
350
+        } else if (action === 'page') {
351
+          list.value = list.value.concat(res.list)
352
+        }
353
+        state.totalPage = Math.ceil(res.count / state.pageSize);
354
+        state.status = 'more'
355
+
356
+        if (callback) {
357
+          callback(res.list)
358
+        }
359
+      }
360
+    })
361
+
362
+  }
363
+  // getVipAreaList({
364
+  //   ...params
365
+  // }).then(res => {
366
+  //   console.log(res.count)
367
+  //   // console.log(res.list)
368
+  //   count.value = res.count
369
+  //   console.log(action);
370
+  //   if (action === 'page') {
371
+  //     list.value = list.value.concat(res.list)
372
+  //   }
373
+  //   if (action === 'reload') {
374
+  //     list.value = res.list
375
+  //   }
376
+  //   if (callback) {
377
+  //     callback(res)
378
+  //   }
379
+  // })
380
+>>>>>>> li-yi
246 381
 }
382
+
247 383
 function handleItemClick(item) {
248 384
   uni.navigateTo({
249 385
     url: `/pages/store/product/detail?id=${item.product_id}`
@@ -253,6 +389,7 @@ function handleItemClick(item) {
253 389
 function handleScrollToLower() {
254 390
   state.status = 'loading';
255 391
   state.currentPage += 1;
392
+<<<<<<< HEAD
256 393
   // console.log(state.totalPage)
257 394
   if (state.currentPage > state.totalPage) {
258 395
     state.status = 'noMore';
@@ -261,31 +398,83 @@ function handleScrollToLower() {
261 398
       loadList('page')
262 399
     }, 300)
263 400
   }
401
+=======
402
+  loadList('page', (items) => {
403
+    console.log('items', items);
404
+    if (!items.length > 0) {
405
+      // console.log('没有更多了')
406
+      state.status = 'noMore'
407
+    }
408
+  })
409
+>>>>>>> li-yi
264 410
 }
265 411
 
266 412
 onReachBottom(() => {
267 413
   console.log('到底了。。。')
268 414
   handleScrollToLower()
269
-
270 415
 })
271 416
 
417
+//关闭搜索重新加载页面
418
+function clearSearch() {
419
+  console.log(222);
420
+  uni.showLoading()
421
+  state.currentPage = 1
422
+  state.pageSize = 10
423
+  loadList('reload', (items) => {
424
+    uni.hideLoading()
425
+    // uni.stopPullDownRefresh()
426
+  })
427
+
428
+}
429
+
272 430
 onPullDownRefresh(() => {
273
-  loadList('reload', items => {
274
-    setTimeout(() => {
275
-      uni.stopPullDownRefresh()
276
-    }, 300)
431
+  console.log(111);
432
+  uni.showLoading()
433
+  state.currentPage = 1
434
+  state.pageSize = 10
435
+  loadList('reload', (items) => {
436
+    uni.hideLoading()
437
+    uni.stopPullDownRefresh()
277 438
   })
278 439
 })
279 440
 
441
+<<<<<<< HEAD
280 442
 function clickLeftHandler() {
281 443
   uni.navigateBack()
282 444
 }
445
+=======
446
+
447
+// 距离顶部距离
448
+let Scroll_X = ref(0)
449
+const headerClass = ref('')
450
+onPageScroll((page) => {
451
+  Scroll_X.value = Number(page.scrollTop.toFixed())
452
+  // page.scrollTop
453
+  if (page.scrollTop >= 76) {
454
+    headerClass.value = '!bg-primary !text-white'
455
+  } else {
456
+    headerClass.value = ''
457
+  }
458
+})
459
+
460
+
461
+onShow(() => {
462
+  uni.setNavigationBarTitle({
463
+    title: state.title // 设置新的导航栏标题
464
+  });
465
+})
466
+
467
+>>>>>>> li-yi
283 468
 </script>
284 469
 
285 470
 <route lang="yaml">
286 471
 style:
472
+<<<<<<< HEAD
287 473
   navigationStyle: custom
288 474
   navigationBarTitleText: 储蓄保会员
475
+=======
476
+  navigationBarTitleText: 储蓄保
477
+>>>>>>> li-yi
289 478
   enablePullDownRefresh: true
290 479
 </route>
291 480
 <style lang="scss">
@@ -299,6 +488,7 @@ page {
299 488
 //var(--nut-searchbar-width, 100%)
300 489
   --nut-searchbar-input-box-shadow: none;
301 490
 }
491
+<<<<<<< HEAD
302 492
 .nut-searchbar {
303 493
   background: transparent !important;
304 494
 
@@ -310,3 +500,11 @@ page {
310 500
   --at-apply: 'text-lg'
311 501
 }
312 502
 </style>
503
+=======
504
+
505
+
506
+.box_y {
507
+  border-radius: 20rpx;
508
+}
509
+</style>
510
+>>>>>>> li-yi

+ 20 - 1
src/pages/withdrawal-record/index.vue

@@ -16,7 +16,7 @@ onLoad((option) => {
16 16
 </script>
17 17
 <template>
18 18
   <CXBBasePage>
19
-    <div v-if="list.length > 0" class="flex flex-col gap-3  p-3">
19
+    <!-- <div v-if="list.length > 0" class="flex flex-col gap-3  p-3">
20 20
       <div v-for="(item, index) in list" :key="index" class="flex-1 text-xs f-hairline-bottom bg-white p-3">
21 21
         <div class="flex justify-between">
22 22
           <div>
@@ -33,6 +33,25 @@ onLoad((option) => {
33 33
 
34 34
 
35 35
       </div>
36
+    </div> -->
37
+    <!-- 提现日期添加时分秒  -->
38
+    <div v-if="list.length > 0" class="flex flex-col gap-3  p-3">
39
+      <div v-for="(item, index) in list" :key="index" class="flex-1 text-xs f-hairline-bottom bg-white p-3">
40
+        <div class="flex justify-between">
41
+          <div>
42
+            <div>{{item.title}}</div>
43
+            <div class="text-gray text-[11px]">{{ dayjs(item.create_time).format('YYYY-MM-DD HH:mm:ss') }}</div>
44
+          </div>
45
+          <div>
46
+            <div>-{{ item.extract_price }}</div>
47
+            <div class="text-[11px]"
48
+                 :class="item.status === '0' ? 'text-primary' : 'text-gray'"
49
+            >{{ item.status === '-1' ? '已失败' : item.status === '0' ? '提现中' : item.status === '1'? '已到账' : ''}}</div>
50
+          </div>
51
+        </div>
52
+
53
+
54
+      </div>
36 55
     </div>
37 56
     <div v-else>
38 57
       <CXBEmpty />

BIN=BIN
src/static/icon/下拉.png


BIN=BIN
src/static/icon/返回顶部@2x.png


BIN=BIN
src/static/img-hy/DLqy.png


BIN=BIN
src/static/img-hy/QYDL.png


BIN=BIN
src/static/img-hy/city.png


BIN=BIN
src/static/img-hy/district.png


BIN=BIN
src/static/img-hy/会员.png


BIN=BIN
src/static/img-hy/关闭.png


BIN=BIN
src/static/img-hy/创始人.png


BIN=BIN
src/static/img-hy/合伙人.png


BIN=BIN
src/static/img-hy/用户.png


BIN=BIN
src/static/img-hy/联合创始人.png


BIN=BIN
src/static/img-hy/股东.png


BIN=BIN
src/static/img-hy/高级会员.png


+ 3 - 6
src/stores/dacangStore.ts

@@ -1,16 +1,13 @@
1
-import {defineStore} from "pinia";
1
+import { defineStore } from "pinia";
2 2
 
3 3
 export const useDacangStore = defineStore('dacangStore', {
4 4
     state: () => ({
5
-        currentClassify: '-1'
5
+        currentClassify: '-1',
6 6
     }),
7 7
     actions: {
8 8
         setClassify(classify: string) {
9 9
             // console.log('class' + classify)
10 10
             this.currentClassify = classify
11
-        },
12
-        loadList() {
13
-
14
-        }
11
+        },  
15 12
     }
16 13
 })

+ 19 - 7
src/stores/userStore.ts

@@ -1,8 +1,8 @@
1
-import {defineStore} from "pinia";
2
-import {getUserInfo, getYanglaojinStatistics} from "~/apis/user";
1
+import { defineStore } from "pinia";
2
+import { getUserInfo, getYanglaojinStatistics } from "~/apis/user";
3 3
 import Cache from '~/utils/cache'
4
-import {LOGIN_STATUS, UID, USER_INFO} from "~/constants";
5
-import type {UserInfoModel} from "~/apis/model/userInfoModel";
4
+import { LOGIN_STATUS, SHARE_REDIRECT_PAGE, UID, USER_INFO,OPEN_ID } from "~/constants";
5
+import type { UserInfoModel } from "~/apis/model/userInfoModel";
6 6
 
7 7
 interface UserStoreState {
8 8
     userInfo: UserInfoModel
@@ -14,6 +14,7 @@ interface UserStoreState {
14 14
     yanglao: number,
15 15
     redirectPage: string | null,
16 16
     shareId: string | null
17
+    openid:string
17 18
 }
18 19
 
19 20
 export const useUserStore = defineStore('userStore', {
@@ -27,7 +28,8 @@ export const useUserStore = defineStore('userStore', {
27 28
         yanglao: 0,
28 29
         shareId: null,
29 30
         redirectPage: null,
30
-        permissionList: null // 权限列表
31
+        permissionList: null, // 权限列表
32
+        openid:Cache.get(OPEN_ID) || null
31 33
     }) as UserStoreState,
32 34
     actions: {
33 35
         // getYanglaojinStatistics().then(res => {
@@ -35,7 +37,7 @@ export const useUserStore = defineStore('userStore', {
35 37
         // })
36 38
         setRedirectPage(page: string, type: 'page' | 'tab') {
37 39
             this.redirectPage = page
38
-            Cache.set('SHARE_REDIRECT_PAGE', JSON.stringify({page, type}))
40
+            Cache.set('SHARE_REDIRECT_PAGE', JSON.stringify({ page, type }))
39 41
         },
40 42
         setShareId(shareId: string) {
41 43
             this.shareId = shareId
@@ -70,8 +72,12 @@ export const useUserStore = defineStore('userStore', {
70 72
             this.token = null
71 73
             this.uid = null
72 74
             this.userInfo = null
75
+            //清空登录信息
76
+            Cache.clear(USER_INFO);
77
+            Cache.clear(OPEN_ID);
73 78
             Cache.clear(LOGIN_STATUS)
74 79
             Cache.clear(UID)
80
+            Cache.clear(SHARE_REDIRECT_PAGE)
75 81
         },
76 82
         setUID(uid: string) {
77 83
             this.uid = uid
@@ -80,7 +86,13 @@ export const useUserStore = defineStore('userStore', {
80 86
         setUserInfo(userInfo: UserInfoModel) {
81 87
             this.userInfo = userInfo
82 88
             // 这个是存储的对象数据
83
-            Cache.set('USERINFO', userInfo)
89
+            Cache.set('USER_INFO', userInfo)
90
+            // Cache.set(USER_INFO, JSON.stringify(userInfo))
91
+        },
92
+        setOpenid(openid: string) {
93
+            this.openid = openid
94
+            // 这个是存储的对象数据
95
+            Cache.set('OPEN_ID', openid)
84 96
             // Cache.set(USER_INFO, JSON.stringify(userInfo))
85 97
         },
86 98
         setToken(token: string) {

+ 111 - 0
src/utils/http/detailhttp.ts

@@ -0,0 +1,111 @@
1
+import { cloneDeep } from 'lodash-es'
2
+import { joinTimestamp } from './helper'
3
+import { checkStatus } from './checkStatus'
4
+import type { RequestOptions, Result } from './types'
5
+import { isString } from '~/utils/is'
6
+import { getToken } from '~/utils/auth'
7
+import { RequestEnum, ResultEnum } from '~/enums/httpEnum'
8
+import { setObjToUrlParams } from '~/utils'
9
+
10
+// const { showNotify } = usePageStoreWidthOut()
11
+
12
+type UniRequestOptions = UniApp.RequestOptions & { params?: any }
13
+
14
+export interface CreateRequestOptions extends UniRequestOptions {
15
+    authenticationScheme?: string
16
+    authenticationHeader: string
17
+    urlPrefix?: string
18
+    requestOptions?: RequestOptions
19
+}
20
+
21
+export class vRequest {
22
+    private readonly options: CreateRequestOptions
23
+
24
+    constructor(options: CreateRequestOptions) {
25
+        this.options = options
26
+    }
27
+
28
+    request<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
29
+        const configTemp: CreateRequestOptions = cloneDeep(Object.assign({}, this.options, config))
30
+        const optionsTemp: RequestOptions = Object.assign({}, this.options.requestOptions, options)
31
+
32
+        const {
33
+            urlPrefix, apiUrl, joinPrefix, joinTime = true, withToken, joinParamsToUrl,
34
+            isReturnNativeResponse, isTransformResponse,
35
+        } = optionsTemp
36
+
37
+        // token header
38
+        const token = getToken()
39
+        if (token && withToken !== false) {
40
+            // jwt token
41
+            Object.assign(configTemp.header, {
42
+                [configTemp.authenticationHeader]: configTemp.authenticationScheme
43
+                    ? `${configTemp.authenticationScheme} ${token}`
44
+                    : token,
45
+            })
46
+        }
47
+
48
+        // add prefix
49
+        if (joinPrefix)
50
+            configTemp.url = `${urlPrefix}${configTemp.url}`
51
+
52
+        const params = configTemp.params || {}
53
+        if (params) {
54
+            if (configTemp.method?.toUpperCase() === RequestEnum.GET) {
55
+                // add timestamp avoid cache
56
+                if (!isString(params)) {
57
+                    configTemp.params = Object.assign(params || {}, joinTimestamp(joinTime, false))
58
+                    if (joinParamsToUrl && configTemp.params) {
59
+                        configTemp.url = setObjToUrlParams(
60
+                            configTemp.url,
61
+                            Object.assign({}, configTemp.params, configTemp.data))
62
+                        configTemp.params = undefined
63
+                    }
64
+                }
65
+                else {
66
+                    // compatible with restful style
67
+                    configTemp.url = `${config.url + params}${joinTimestamp(joinTime, true)}`
68
+                    configTemp.params = undefined
69
+                }
70
+            }
71
+        }
72
+
73
+        if (apiUrl && isString(apiUrl))
74
+            configTemp.url = `${apiUrl}${configTemp.url}`
75
+
76
+        return new Promise((resolve, reject) => {
77
+            uni.request({
78
+                url: configTemp.url,
79
+                data: configTemp.data || {},
80
+                method: configTemp.method?.toUpperCase() as UniApp.RequestOptions['method'],
81
+                header: configTemp.header || {},
82
+                success: (res) => {
83
+                    // console.log('我是商品res啊', res);
84
+
85
+                    resolve(res.data as any)
86
+
87
+                },
88
+                fail: (e) => {
89
+                    reject(e.errMsg)
90
+                },
91
+                complete() { },
92
+            })
93
+        })
94
+    }
95
+
96
+    post<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
97
+        return this.request({ ...config, method: 'POST' }, options)
98
+    }
99
+
100
+    get<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
101
+        return this.request({ ...config, method: 'GET' }, options)
102
+    }
103
+
104
+    put<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
105
+        return this.request({ ...config, method: 'PUT' }, options)
106
+    }
107
+
108
+    delete<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
109
+        return this.request({ ...config, method: 'DELETE' }, options)
110
+    }
111
+}

+ 2 - 0
src/utils/http/http.ts

@@ -80,6 +80,8 @@ export class VRequest {
80 80
                 method: configTemp.method?.toUpperCase() as UniApp.RequestOptions['method'],
81 81
                 header: configTemp.header || {},
82 82
                 success: (res) => {
83
+                    // console.log('我是res数据',res);
84
+                    
83 85
                     const data = res.data as Result
84 86
                     const _message: string = data?.message ?? ''
85 87
                     if (res.statusCode && res.statusCode !== 200) {

+ 78 - 0
src/utils/http/index.ts

@@ -1,4 +1,6 @@
1 1
 import { VRequest } from './http'
2
+import { vRequest } from './detailhttp'
3
+import { kRequest } from './skuhttp'
2 4
 import { deepMerge } from '~/utils'
3 5
 import { ContentTypeEnum } from '~/enums/httpEnum'
4 6
 
@@ -41,6 +43,82 @@ function createRequest(options?: any) {
41 43
 
42 44
 export const defHttp = createRequest()
43 45
 
46
+
47
+//商品下架
48
+function onRequest(options?: any) {
49
+    return new vRequest(deepMerge(
50
+        {
51
+            url: '',
52
+            timeout: 5 * 1000,
53
+            authenticationScheme: 'Bearer',
54
+            authenticationHeader: 'X-Token',
55
+            // authenticationHeader: 'Authorization',
56
+            // authenticationScheme: '',
57
+
58
+            header: { 'Content-Type': ContentTypeEnum.JSON },
59
+            // 配置项,下面的选项都可以在独立的接口请求中覆盖
60
+            requestOptions: {
61
+                urlPrefix: '',
62
+                joinPrefix: false,
63
+                // 接口地址
64
+                apiUrl,
65
+                // 消息提示类型
66
+                errorMessageMode: 'message',
67
+                // 请求参数拼接到url
68
+                joinParamsToUrl: true,
69
+                //  是否加入时间戳
70
+                joinTime: true,
71
+                // 请求头是否携带token
72
+                withToken: true,
73
+                // 是否返回原生响应头 比如:需要获取响应头时使用该属性
74
+                isReturnNativeResponse: false,
75
+                // 需要对返回数据进行处理
76
+                isTransformResponse: true,
77
+            },
78
+        },
79
+        options || {},
80
+    ))
81
+}
82
+
83
+export const detailHttp = onRequest()
84
+//sku
85
+function skuRequest(options?: any) {
86
+    return new vRequest(deepMerge(
87
+        {
88
+            url: '',
89
+            timeout: 5 * 1000,
90
+            authenticationScheme: 'Bearer',
91
+            authenticationHeader: 'X-Token',
92
+            // authenticationHeader: 'Authorization',
93
+            // authenticationScheme: '',
94
+
95
+            header: { 'Content-Type': ContentTypeEnum.JSON },
96
+            // 配置项,下面的选项都可以在独立的接口请求中覆盖
97
+            requestOptions: {
98
+                urlPrefix: '',
99
+                joinPrefix: false,
100
+                // 接口地址
101
+                apiUrl,
102
+                // 消息提示类型
103
+                errorMessageMode: 'message',
104
+                // 请求参数拼接到url
105
+                joinParamsToUrl: true,
106
+                //  是否加入时间戳
107
+                joinTime: true,
108
+                // 请求头是否携带token
109
+                withToken: true,
110
+                // 是否返回原生响应头 比如:需要获取响应头时使用该属性
111
+                isReturnNativeResponse: false,
112
+                // 需要对返回数据进行处理
113
+                isTransformResponse: true,
114
+            },
115
+        },
116
+        options || {},
117
+    ))
118
+}
119
+
120
+export const skuhttp = skuRequest()
121
+
44 122
 // other api url
45 123
 // export const otherHttp = createRequest({
46 124
 //   requestOptions: {

+ 111 - 0
src/utils/http/skuhttp.ts

@@ -0,0 +1,111 @@
1
+import { cloneDeep } from 'lodash-es'
2
+import { joinTimestamp } from './helper'
3
+import { checkStatus } from './checkStatus'
4
+import type { RequestOptions, Result } from './types'
5
+import { isString } from '~/utils/is'
6
+import { getToken } from '~/utils/auth'
7
+import { RequestEnum, ResultEnum } from '~/enums/httpEnum'
8
+import { setObjToUrlParams } from '~/utils'
9
+
10
+// const { showNotify } = usePageStoreWidthOut()
11
+
12
+type UniRequestOptions = UniApp.RequestOptions & { params?: any }
13
+
14
+export interface CreateRequestOptions extends UniRequestOptions {
15
+    authenticationScheme?: string
16
+    authenticationHeader: string
17
+    urlPrefix?: string
18
+    requestOptions?: RequestOptions
19
+}
20
+
21
+export class vRequest {
22
+    private readonly options: CreateRequestOptions
23
+
24
+    constructor(options: CreateRequestOptions) {
25
+        this.options = options
26
+    }
27
+
28
+    request<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
29
+        const configTemp: CreateRequestOptions = cloneDeep(Object.assign({}, this.options, config))
30
+        const optionsTemp: RequestOptions = Object.assign({}, this.options.requestOptions, options)
31
+
32
+        const {
33
+            urlPrefix, apiUrl, joinPrefix, joinTime = true, withToken, joinParamsToUrl,
34
+            isReturnNativeResponse, isTransformResponse,
35
+        } = optionsTemp
36
+
37
+        // token header
38
+        const token = getToken()
39
+        if (token && withToken !== false) {
40
+            // jwt token
41
+            Object.assign(configTemp.header, {
42
+                [configTemp.authenticationHeader]: configTemp.authenticationScheme
43
+                    ? `${configTemp.authenticationScheme} ${token}`
44
+                    : token,
45
+            })
46
+        }
47
+
48
+        // add prefix
49
+        if (joinPrefix)
50
+            configTemp.url = `${urlPrefix}${configTemp.url}`
51
+
52
+        const params = configTemp.params || {}
53
+        if (params) {
54
+            if (configTemp.method?.toUpperCase() === RequestEnum.GET) {
55
+                // add timestamp avoid cache
56
+                if (!isString(params)) {
57
+                    configTemp.params = Object.assign(params || {}, joinTimestamp(joinTime, false))
58
+                    if (joinParamsToUrl && configTemp.params) {
59
+                        configTemp.url = setObjToUrlParams(
60
+                            configTemp.url,
61
+                            Object.assign({}, configTemp.params, configTemp.data))
62
+                        configTemp.params = undefined
63
+                    }
64
+                }
65
+                else {
66
+                    // compatible with restful style
67
+                    configTemp.url = `${config.url + params}${joinTimestamp(joinTime, true)}`
68
+                    configTemp.params = undefined
69
+                }
70
+            }
71
+        }
72
+
73
+        if (apiUrl && isString(apiUrl))
74
+            configTemp.url = `${apiUrl}${configTemp.url}`
75
+
76
+        return new Promise((resolve, reject) => {
77
+            uni.request({
78
+                url: configTemp.url,
79
+                data: configTemp.data || {},
80
+                method: configTemp.method?.toUpperCase() as UniApp.RequestOptions['method'],
81
+                header: configTemp.header || {},
82
+                success: (res) => {
83
+                    // console.log('我是商品res啊', res);
84
+
85
+                    resolve(res as any)
86
+
87
+                },
88
+                fail: (e) => {
89
+                    reject(e.errMsg)
90
+                },
91
+                complete() { },
92
+            })
93
+        })
94
+    }
95
+
96
+    post<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
97
+        return this.request({ ...config, method: 'POST' }, options)
98
+    }
99
+
100
+    get<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
101
+        return this.request({ ...config, method: 'GET' }, options)
102
+    }
103
+
104
+    put<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
105
+        return this.request({ ...config, method: 'PUT' }, options)
106
+    }
107
+
108
+    delete<T = any>(config: UniRequestOptions, options?: RequestOptions): Promise<T> {
109
+        return this.request({ ...config, method: 'DELETE' }, options)
110
+    }
111
+}