From 7f899b5f769d1646fa85d191263a9df563fa005c Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 23 七月 2024 14:22:45 +0800
Subject: [PATCH] ‘’
---
wechat_jiaxuan/pages/userinfo/collect.js | 2
wechat_staff/project.private.config.json | 2
wechat_staff/pages/index/index.js | 5 +
wechat_staff/pages/sets/protocol.wxml | 2
wechat_staff/pages/index/index.wxml | 2
wechat_staff/pages/userinfo/collect.js | 80 +++++++++++++++++++++-----
wechat_staff/pages/userinfo/collect.wxml | 48 +++------------
wechat_staff/api/index.js | 9 ++
wechat_staff/pages/sets/protocol.json | 4 +
wechat_staff/pages/promotion/index.json | 2
10 files changed, 96 insertions(+), 60 deletions(-)
diff --git a/wechat_jiaxuan/pages/userinfo/collect.js b/wechat_jiaxuan/pages/userinfo/collect.js
index 2ff7453..da9ee29 100644
--- a/wechat_jiaxuan/pages/userinfo/collect.js
+++ b/wechat_jiaxuan/pages/userinfo/collect.js
@@ -11,7 +11,7 @@
dataList: [],
total: 0,
- pageNum: 1,
+ pageNum: 1,
pageSize: 10,
},
onLoad(options) {
diff --git a/wechat_staff/api/index.js b/wechat_staff/api/index.js
index a8c1d52..78224b6 100644
--- a/wechat_staff/api/index.js
+++ b/wechat_staff/api/index.js
@@ -143,7 +143,14 @@
data
})
}
-
+// 鎴戠殑 鏀惰棌/鍠滄鍒楄〃
+export const collectLikePage = (data) => {
+ return request({
+ url: '/web/customer/collectLikePage',
+ method: 'POST',
+ data
+ })
+}
// 0鍏冨畾鍒朵俊鎭�
export const saveFreeCustomizationApply = (data) => {
return request({
diff --git a/wechat_staff/pages/index/index.js b/wechat_staff/pages/index/index.js
index 4d44bd6..3af582f 100644
--- a/wechat_staff/pages/index/index.js
+++ b/wechat_staff/pages/index/index.js
@@ -66,6 +66,11 @@
this.setData({ HOME_CLASS_C: res.data.code })
})
},
+ promotionClick() {
+ wx.navigateTo({
+ url: '/pages/promotion/index',
+ })
+ },
changeStrategy(e) {
let item = e.currentTarget.dataset.item
wx.navigateTo({
diff --git a/wechat_staff/pages/index/index.wxml b/wechat_staff/pages/index/index.wxml
index 0ba4ce2..4014420 100644
--- a/wechat_staff/pages/index/index.wxml
+++ b/wechat_staff/pages/index/index.wxml
@@ -5,7 +5,7 @@
<input model:value="{{ searchValue }}" placeholder="鎼滅储" type="text"/>
</view>
<view class="everyday">
- <view class="header">
+ <view class="header" bindtap="promotionClick">
<view class="title">姣忔棩涓婃柊</view>
<view class="more">
<text class="placeholder9">鏌ョ湅鏇村</text>
diff --git a/wechat_staff/pages/promotion/index.json b/wechat_staff/pages/promotion/index.json
index 6f63117..1d39d80 100644
--- a/wechat_staff/pages/promotion/index.json
+++ b/wechat_staff/pages/promotion/index.json
@@ -1,4 +1,4 @@
{
"usingComponents": {},
- "navigationBarTitleText": "鏈�鏂版帹骞垮挩璇�"
+ "navigationBarTitleText": "鏈�鏂版帹骞胯祫璁�"
}
\ No newline at end of file
diff --git a/wechat_staff/pages/sets/protocol.json b/wechat_staff/pages/sets/protocol.json
index 8835af0..accdbe5 100644
--- a/wechat_staff/pages/sets/protocol.json
+++ b/wechat_staff/pages/sets/protocol.json
@@ -1,3 +1,5 @@
{
- "usingComponents": {}
+ "usingComponents": {
+ "mp-html": "mp-html"
+ }
}
\ No newline at end of file
diff --git a/wechat_staff/pages/sets/protocol.wxml b/wechat_staff/pages/sets/protocol.wxml
index 6cb36d0..e816cce 100644
--- a/wechat_staff/pages/sets/protocol.wxml
+++ b/wechat_staff/pages/sets/protocol.wxml
@@ -1,2 +1,2 @@
<!--pages/sets/protocol.wxml-->
-<rich-text nodes="{{content}}"> </rich-text>
+<mp-html content="{{content}}"> </mp-html>
diff --git a/wechat_staff/pages/userinfo/collect.js b/wechat_staff/pages/userinfo/collect.js
index 633951c..2ff7453 100644
--- a/wechat_staff/pages/userinfo/collect.js
+++ b/wechat_staff/pages/userinfo/collect.js
@@ -1,24 +1,77 @@
-// pages/userinfo/collect.js
+import {
+ collectLikePage
+} from '../../api/index'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- activeTabs: '0'
- },
+ activeTabs: 'product_intro',
- tabsChange(e) {
- const activeTabs = e.currentTarget.dataset.val
- this.setData({ activeTabs })
- },
- handleDetail(e) {
- wx.navigateTo({
- url: '/pages/detailDis/product',
- })
+ dataList: [],
+ total: 0,
+ pageNum: 1,
+ pageSize: 10,
},
onLoad(options) {
-
+ this.getList()
+ },
+ onReachBottom() {
+ console.log('瑙﹀簳浜嬩欢');
+ const { total, dataList, pageNum } = this.data
+ if(total > dataList.length){
+ this.setData({ pageNum: pageNum + 1 })
+ this.getList()
+ }else{
+ wx.showToast({
+ title: '鏆傛棤鏇村鏁版嵁',
+ icon: 'none'
+ })
+ }
+ },
+ tabsChange(e) {
+ const activeTabs = e.currentTarget.dataset.val
+ this.setData({
+ activeTabs,
+ dataList: [],total: 0,pageNum: 1
+ })
+ this.getList()
+ },
+ handleDetail(e) {
+ const id = e.currentTarget.dataset.id
+ const { activeTabs } = this.data
+ let url = ''
+ if(activeTabs == 'product_intro'){
+ url = '/pages/detailDis/product'
+ }else if(activeTabs == 'whole_case'){
+ url = '/pages/detailDis/case'
+ }else{
+ url = '/pages/detailDis/realpic'
+ }
+ wx.navigateTo({
+ url: `${url}?id=${id}`,
+ })
+ },
+ getList() {
+ const {
+ pageSize,
+ pageNum,
+ activeTabs
+ } = this.data
+ collectLikePage({
+ businessCategory: 'collect',
+ businessType: activeTabs,
+ pageSize,
+ pageNum
+ }).then(res => {
+ if (res.data) {
+ this.setData({
+ dataList: [...this.data.dataList, ...res.data.records || []],
+ total: res.data.total
+ })
+ }
+ })
},
/**
@@ -59,9 +112,6 @@
/**
* 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
*/
- onReachBottom() {
-
- },
/**
* 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
diff --git a/wechat_staff/pages/userinfo/collect.wxml b/wechat_staff/pages/userinfo/collect.wxml
index bbce2ec..2193266 100644
--- a/wechat_staff/pages/userinfo/collect.wxml
+++ b/wechat_staff/pages/userinfo/collect.wxml
@@ -1,59 +1,31 @@
<view class="container">
<view class="tabs">
- <view class="item {{ activeTabs == '0' ? 'active' : '' }}" data-val="0" bindtap="tabsChange">
+ <view class="item {{ activeTabs == 'product_intro' ? 'active' : '' }}" data-val="product_intro" bindtap="tabsChange">
<view class="name">浜у搧</view>
<view class="border"></view>
</view>
- <view class="item {{ activeTabs == '1' ? 'active' : '' }}" data-val="1" bindtap="tabsChange">
+ <view class="item {{ activeTabs == 'whole_case' ? 'active' : '' }}" data-val="whole_case" bindtap="tabsChange">
<view class="name">妗堜緥</view>
<view class="border"></view>
</view>
- <view class="item {{ activeTabs == '2' ? 'active' : '' }}" data-val="2" bindtap="tabsChange">
+ <view class="item {{ activeTabs == 'real_case' ? 'active' : '' }}" data-val="real_case" bindtap="tabsChange">
<view class="name">瀹炴櫙</view>
<view class="border"></view>
</view>
</view>
<view class="list">
- <view class="item" bindtap="handleDetail">
+ <view data-id="{{ item.id }}" wx:for="{{ dataList }}" class="item" bindtap="handleDetail">
<view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ true }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
+ <image src="{{ item.thumbnailUrl }}" class="img"></image>
+ <image wx:if="{{ false }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
</view>
- <view class="name">閽㈢惔鏇�</view>
+ <view class="name">{{ item.displayName }}</view>
<view class="info">
<image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
+ <image wx:else class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
+ <text class="num {{true ? 'primary' : ''}}">{{ item.collectCount }}</text>
<image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- <view class="item" bindtap="handleDetail">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ true }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="name">閽㈢惔鏇�</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
- </view>
- </view>
- <view class="item" bindtap="handleDetail">
- <view class="img_wrap">
- <image src="../../static/icon/test.png" class="img"></image>
- <image wx:if="{{ true }}" class="new" src="../../static/icon/chanpin_ic_new@2x.png" mode="widthFix"></image>
- </view>
- <view class="name">閽㈢惔鏇�</view>
- <view class="info">
- <image wx:if="{{ false }}" class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image>
- <image wx:else="" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image>
- <text class="num {{true ? 'primary' : ''}}">34</text>
- <image class="icon" src="../../static/icon/zixun_ic_liulan.png" mode="widthFix"></image>
- <text>1000</text>
+ <text>{{ item.viewCount }}</text>
</view>
</view>
</view>
diff --git a/wechat_staff/project.private.config.json b/wechat_staff/project.private.config.json
index 119a266..a0755f8 100644
--- a/wechat_staff/project.private.config.json
+++ b/wechat_staff/project.private.config.json
@@ -38,7 +38,7 @@
},
{
"name": "",
- "pathName": "pages/userinfo/index",
+ "pathName": "pages/promotion/index",
"query": "",
"launchMode": "default",
"scene": null
--
Gitblit v1.9.3