From b62daf4aaca5fcb8eea7bfd4149dbb92b10f50de Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 04 六月 2025 11:40:06 +0800 Subject: [PATCH] 我的活动,活动,用户管理页面, --- pages/tabbar/user/utils/tool.vue | 472 ++++--- api/common.js | 9 pages/userPermissions/addStoreMember.vue | 291 +++++ pages.json | 634 ++++++---- pages/mine/activity/reportActivity.vue | 299 +++++ pages/customerManager/customerManager.vue | 22 pages/mine/activity/myActivity.vue | 464 ++++++++ api/activity.js | 103 + api/userPermissions.js | 61 + pages/mine/activity/detail.vue | 280 +++++ api/customerManager.js | 0 pages/userPermissions/userPermissions.vue | 286 +++++ pages/mine/myCollect/myCollect.vue | 339 ++++++ 13 files changed, 2,776 insertions(+), 484 deletions(-) diff --git a/api/activity.js b/api/activity.js new file mode 100644 index 0000000..11a43ba --- /dev/null +++ b/api/activity.js @@ -0,0 +1,103 @@ +/** + * 娲诲姩鐩稿叧API + */ +import { http, Method } from "@/utils/request.js"; + +import api from "@/config/api.js"; + +/** + * 鏌ヨ鐢ㄦ埛鎶ュ悕娲诲姩鍒楄〃 + * + * @param params + */ + export function getMyActivityList(params) { + return http.request({ + url: "/lmk/my-activity/getMyActivityList", + method: Method.GET, + needToken: true, + params: params, + }); +} +/** + * 鐢ㄦ埛娲诲姩鏀惰棌鍒楄〃 + * @param {Object} param + */ +export function getActivityCollectList(param){ + +} +/** + * 鏀惰棌娲诲姩 + * @param {Object} param + */ + +export function activityCollection(param){ + +} + +/** + * 鍙栨秷鏀惰棌 + * + */ +export function collectCancel(param){ + return http.request({ + url: "/lmk/my-activity/collectCancel", + method: Method.POST, + needToken: true, + data:param + }); +} + +/** + * 鍙栨秷鎶ュ悕 + * + * @param params + */ + export function activityCancel(params) { + return http.request({ + url: "/lmk/my-activity/activityCancel/"+ params, + method: Method.PUT, + needToken: true, + }); +} + +/** + * 鑾峰緱娲诲姩璇︽儏 + * @param params + */ +export function getActivityDetail(params){ + return http.request({ + url: "/lmk/activityReport/getDetail/" + params, + method: Method.GET, + needToken: true, + }); +} + + +/** + * 鎶ュ悕娲诲姩 + * @param param + */ +export function activityReport(param){ + return http.request({ + url: "/lmk/activityReport", + method: Method.POST, + needToken: true, + data:param + }); +} + +/** + * 鑾峰緱鎵�鏈夊彲鎶ュ悕鐨勬椿鍔ㄥ垪琛� + * + * @param params + */ + export function getActivityReportList() { + return http.request({ + url: "/lmk/activityReport", + method: Method.GET, + needToken: true + }); +} + + + diff --git a/api/common.js b/api/common.js index ad25f22..0117fad 100644 --- a/api/common.js +++ b/api/common.js @@ -35,6 +35,15 @@ }); } +export function getPreviewUrl(params){ + return http.request({ + url: `${api.common}/lmk/file/preview`, + method: Method.POST, + data:params + }); +} + + /** * 鏂囦欢涓婁紶鍦板潃 * @type {string} diff --git a/api/customerManager.js b/api/customerManager.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/api/customerManager.js diff --git a/api/userPermissions.js b/api/userPermissions.js new file mode 100644 index 0000000..513068a --- /dev/null +++ b/api/userPermissions.js @@ -0,0 +1,61 @@ +/** + * 鐢ㄦ埛鏉冮檺绠$悊API + */ +import { http, Method } from "@/utils/request.js"; + +import api from "@/config/api.js"; + +/** + * 鑾峰緱鐢ㄦ埛鍒楄〃锛堝晢鎴凤級 + * @param {Object} param + */ +export function getPage(param){ + return http.request({ + url: "/lmk/lmk-user-permissions/page", + method: Method.GET, + needToken: true, + params: param + }); +} + +/** + * 鍒犻櫎鐢ㄦ埛锛堝晢鎴凤級 + */ +export function del(param){ + return http.request({ + url: "/lmk/lmk-user-permissions/" + param, + method: Method.DELETE, + needToken: true, + }); +} +/** + * 鏂板鐢ㄦ埛锛堝晢鎴凤級 + */ +export function add(param){ + return http.request({ + url: "/lmk/lmk-user-permissions", + method: Method.POST, + needToken: true, + data: param + }); +} +/** + * 淇敼鐢ㄦ埛锛堝晢鎴凤級 + */ +export function update(param){ + return http.request({ + url: "/lmk/lmk-user-permissions", + method: Method.PUT, + needToken: true, + data: param + }); +} + +export function getDetail(param){ + return http.request({ + url: "/lmk/lmk-user-permissions/" +param, + methode: Method.GET, + needToken: true + }) + +} \ No newline at end of file diff --git a/pages.json b/pages.json index d7c60c8..eb9d53e 100644 --- a/pages.json +++ b/pages.json @@ -1,27 +1,26 @@ { - "easycom": { - "autoscan": true, - "custom": { - "^u-(.*)": "@/uview-components/uview-ui/components/u-$1/u-$1.vue",//uview, - "^uni-(.*)": "@/uni_modules/uni-$1/components/uni-$1/uni-$1.vue" // uniapp缁勪欢 - } - }, - "preloadRule": { - "pages/tabbar/index/home": // 椤甸潰璺緞 - // 椤甸潰鐨勯涓嬭浇閰嶇疆 - { - "network": "all", // all(涓嶉檺缃戠粶) wifi(浠厀ifi涓嬮涓嬭浇) - "packages": ["uview-components"] // 棰勪笅杞藉垎鍖呯殑 root 鎴� name銆俖_APP__ 琛ㄧず涓诲寘 - } - }, + "easycom": { + "autoscan": true, + "custom": { + "^u-(.*)": "@/uview-components/uview-ui/components/u-$1/u-$1.vue", //uview, + "^uni-(.*)": "@/uni_modules/uni-$1/components/uni-$1/uni-$1.vue" // uniapp缁勪欢 + } + }, + "preloadRule": { + "pages/tabbar/index/home": // 椤甸潰璺緞 + // 椤甸潰鐨勯涓嬭浇閰嶇疆 + { + "network": "all", // all(涓嶉檺缃戠粶) wifi(浠厀ifi涓嬮涓嬭浇) + "packages": ["uview-components"] // 棰勪笅杞藉垎鍖呯殑 root 鎴� name銆俖_APP__ 琛ㄧず涓诲寘 + } + }, "pages": [ // 绗竴涓氨鏄椤� { - "path" : "pages/tabbar/index/home", - "style" : - { + "path": "pages/tabbar/index/home", + "style": { // "navigationBarTitleText" : "瑙嗛", - "enablePullDownRefresh" : false, + "enablePullDownRefresh": false, "navigationStyle": "custom" // 闅愯棌椤堕儴瀵艰埅鏍� } }, @@ -31,9 +30,9 @@ "navigationBarTitleText": "棣栭〉", "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� "navigationBarTextStyle": "black", - "enablePullDownRefresh":true + "enablePullDownRefresh": true } - }, + }, { "path": "pages/tabbar/home/title", "style": { @@ -46,19 +45,19 @@ "navigationBarTitleText": "璐墿杞�", "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� "navigationBarBackgroundColor": "#fff", - "enablePullDownRefresh":true, //瀹炵幇涓嬫媺鍒锋柊鏍峰紡 + "enablePullDownRefresh": true, //瀹炵幇涓嬫媺鍒锋柊鏍峰紡 "componentPlaceholder": { - "u-navbar": "view", - "u-checkbox-group": "view", - "u-checkbox": "view", - "u-swipe-action": "view", - "u-image": "view", - "u-icon": "view", - "u-count-down": "view", - "u-modal": "view", - "u-popup": "view", - "u-toast": "view" - } + "u-navbar": "view", + "u-checkbox-group": "view", + "u-checkbox": "view", + "u-swipe-action": "view", + "u-image": "view", + "u-icon": "view", + "u-count-down": "view", + "u-modal": "view", + "u-popup": "view", + "u-toast": "view" + } } }, { "path": "pages/tabbar/category/category", @@ -88,7 +87,7 @@ "contentAdjust": "false", "bounce": "none", "safearea": { - "bottom": "none" + "bottom": "none" } }, "componentPlaceholder": { @@ -108,7 +107,7 @@ "contentAdjust": "false", "bounce": "none", "safearea": { - "bottom": "none" + "bottom": "none" } }, "componentPlaceholder": { @@ -162,7 +161,7 @@ "contentAdjust": "false", "bounce": "none", "safearea": { - "bottom": "none" + "bottom": "none" } }, "componentPlaceholder": { @@ -185,25 +184,24 @@ } } }, - + { "path": "pages/tabbar/home/web-view", "style": { - + } }, - { - "path": "pages/tabbar/special/special", - "style": { - "navigationBarTitleText": "涓撻" - } + { + "path": "pages/tabbar/special/special", + "style": { + "navigationBarTitleText": "涓撻" + } }, { - "path" : "pages/tabbar/video/video", - "style" : - { - "navigationBarTitleText" : "鍙戝竷瑙嗛", - "enablePullDownRefresh" : false, + "path": "pages/tabbar/video/video", + "style": { + "navigationBarTitleText": "鍙戝竷瑙嗛", + "enablePullDownRefresh": false, "componentPlaceholder": { "u-icon": "view", "u-button": "view", @@ -216,41 +214,91 @@ } }, { - "path" : "pages/goods-manager/goodsList/goodsList", - "style" : - { - "enablePullDownRefresh" : true, - "navigationBarTitleText" : "鍟嗗搧鍒楄〃" + "path": "pages/goods-manager/goodsList/goodsList", + "style": { + "enablePullDownRefresh": true, + "navigationBarTitleText": "鍟嗗搧鍒楄〃" } }, { - "path" : "pages/goods-manager/addGoods/addGoods", - "style" : - { - "navigationBarTitleText" : "" + "path": "pages/goods-manager/addGoods/addGoods", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/userPermissions/userPermissions", + "style": { + "navigationBarTitleText": "鐢ㄦ埛鏉冮檺", + "componentPlaceholder": { + "u-icon": "view", + "u-button": "view", + "u-form": "view", + "u-form-item": "view", + "u-input": "view", + "u-popup": "view", + "u-search": "view", + "u-loading": "view", + "u-navbar": "view" + } + + } + }, + + { + "path": "pages/customerManager/customerManager", + "style": { + "navigationBarTitleText": "瀹㈡埛绠$悊", + "componentPlaceholder": { + "u-icon": "view", + "u-button": "view", + "u-form": "view", + "u-form-item": "view", + "u-input": "view", + "u-popup": "view", + "u-search": "view", + "u-loading": "view" + } + } + }, + { + "path": "pages/userPermissions/addStoreMember", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", // 闅愯棌椤堕儴瀵艰埅鏍� + "componentPlaceholder": { + "u-icon": "view", + "u-button": "view", + "u-form": "view", + "u-form-item": "view", + "u-input": "view", + "u-popup": "view", + "u-search": "view", + "u-loading": "view", + "u-checkbox": "view", + "u-checkbox-group": "view", + "u-navbar": "view" + } } } ], - "subPackages": [ - { - "root": "uview-components", // 蹇呴』涓巔reloadRule涓殑鍚嶇О瀹屽叏涓�鑷� - "name": "uview-components", - "pages": [ - { - "path": "pages/empty-page/empty-page", - "style": { - "navigationBarTitleText": "", - "disableScroll": true - } - } - ] - }, + "subPackages": [{ + "root": "uview-components", // 蹇呴』涓巔reloadRule涓殑鍚嶇О瀹屽叏涓�鑷� + "name": "uview-components", + "pages": [{ + "path": "pages/empty-page/empty-page", + "style": { + "navigationBarTitleText": "", + "disableScroll": true + } + }] + }, { "root": "pages/mine", "pages": [ - + { "path": "signIn", "style": { @@ -404,15 +452,15 @@ } }, - - { - "path": "deposit/info", - "style": { - "navigationBarTitleText": "棰勫瓨娆捐鎯�" - } - }, - { + { + "path": "deposit/info", + "style": { + "navigationBarTitleText": "棰勫瓨娆捐鎯�" + + } + }, + { "path": "address/address", "style": { "enablePullDownRefresh": true, @@ -471,8 +519,8 @@ "navigationBarTitleText": "闈㈠鐧诲綍" } }, - - + + { "path": "set/securityCenter/editPassword", "style": { @@ -482,13 +530,13 @@ } } }, - + { "path": "set/securityCenter/bindMobile", "style": { "navigationBarTitleText": "缁戝畾鎵嬫満鍙�", "app-plus": { - + } } }, @@ -498,9 +546,8 @@ "style": { "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� "enablePullDownRefresh": true, - "app-plus": { - } - + "app-plus": {} + } }, { @@ -508,9 +555,8 @@ "style": { "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� "enablePullDownRefresh": true, - "app-plus": { - } - + "app-plus": {} + } }, { @@ -594,7 +640,7 @@ } } }, - { + { "path": "msgTips/main", "style": { "navigationBarTitleText": "娑堟伅涓績" @@ -623,6 +669,62 @@ "style": { "navigationBarTitleText": "璁㈠崟璺熻釜" } + }, { + "path": "activity/detail", + "style": { + "navigationBarTitleText": "娲诲姩璇︽儏" + } + }, { + "path": "activity/myActivity", + "style": { + "navigationBarTitleText": "鎴戠殑娲诲姩", + "enablePullDownRefresh": true, //涓嬫媺鍒锋柊 + "navigationStyle": "custom", + "componentPlaceholder": { + "u-form": "view", + "u-form-item": "view", + "u-input": "view", + "u-icon": "view", + "u-action-sheet": "view", + "u-checkbox-group": "view", + "u-checkbox": "view", + "u-navbar": "view" + } + } + }, { + "path": "activity/reportActivity", + "style": { + "navigationBarTitleText": "娲诲姩", + "enablePullDownRefresh": true, //涓嬫媺鍒锋柊 + "navigationStyle": "custom", + "componentPlaceholder": { + "u-form": "view", + "u-form-item": "view", + "u-input": "view", + "u-icon": "view", + "u-action-sheet": "view", + "u-checkbox-group": "view", + "u-checkbox": "view", + "u-navbar": "view" + } + } + }, { + "path": "myCollect/myCollect", + "style": { + "navigationBarTitleText": "鎴戠殑鏀惰棌", + "componentPlaceholder": { + "u-icon": "view", + "u-button": "view", + "u-form": "view", + "u-form-item": "view", + "u-input": "view", + "u-popup": "view", + "u-search": "view", + "u-loading": "view", + "u-navbar": "view" + } + + } } ] @@ -633,161 +735,161 @@ { "root": "pages/product", "pages": [{ - "path": "shopPage", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - },{ - "path": "shopList", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - },{ - "path": "licencePhoto", - "style": { - "navigationBarTitleText": "钀ヤ笟鎵х収" - } - },{ - "path": "shopPageGoods", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "goods", - "style": { - "backgroundColor": "#fff", + "path": "shopPage", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, { + "path": "shopList", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, { + "path": "licencePhoto", + "style": { + "navigationBarTitleText": "钀ヤ笟鎵х収" + } + }, { + "path": "shopPageGoods", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "goods", + "style": { + "backgroundColor": "#fff", + "navigationStyle": "custom", + "app-plus": { + // 灏嗗洖寮瑰睘鎬у叧鎺� + "bounce": "none", + // 绂佹椤甸潰婊氬姩 + "scrollIndicator": "none", + "safearea": { + "bottom": { + "offset": "none" + } + } + }, + "componentPlaceholder": { + "u-icon": "view", + "u-navbar": "view", + "u-popup": "view" + } + } + }, + { + "path": "askList", + "style": { + "navigationBarTitleText": "闂瓟涓撳尯" + } + }, + { + "path": "product/promotion/-promotion-details", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-tag": "view" + } + } + }, + { + "path": "product/promotion/-promotion-assemble-promotions", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-tag": "view", + "u-count-down": "view" + } + } + }, + { + "path": "product/promotion/-promotion-assemble-list", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-image": "view", + "u-button": "view", + "u-empty": "view" + } + } + }, + { + "path": "product/goods/-goods-intro", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-empty": "view", + "u-parse": "view" + } + } + }, + { + "path": "product/shop/-shop", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-image": "view", + "u-loading": "view" + } + } + }, + { + "path": "product/evaluation/-evaluation", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-avatar": "view", + "u-read-more": "view", + "u-image": "view", + "u-empty": "view" + } + } + }, + { + "path": "product/goods/-goods-swiper", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-loading": "view", + "u-image": "view" + } + } + }, + { + "path": "product/popup/address", + "style": { + "navigationBarTitleText": "", + "componentPlaceholder": { + "u-popup": "view", + "u-icon": "view", + "u-empty": "view" + } + } + }, + { //鍟嗗搧璇勪环 + "path": "comment", "navigationStyle": "custom", - "app-plus": { - // 灏嗗洖寮瑰睘鎬у叧鎺� - "bounce": "none", - // 绂佹椤甸潰婊氬姩 - "scrollIndicator": "none", - "safearea": { - "bottom": { - "offset": "none" - } - } - }, - "componentPlaceholder": { - "u-icon": "view", - "u-navbar": "view", - "u-popup": "view" + "style": { + "navigationBarTitleText": "鍟嗗搧璇勪环", + //app椤甸潰涓嶆樉绀烘粴鍔ㄦ潯 + "scrollIndicator": "none" + } + }, + { // 瀹㈡湇 + "path": "customerservice/index", + "style": { + "navigationBarTitleText": "瀹㈡湇", + "usingComponents": { + // #ifdef MP-WEIXIN + "chat": "plugin://myPlugin/chat" + // #endif + } } } - }, - { - "path": "askList", - "style": { - "navigationBarTitleText": "闂瓟涓撳尯" - } - }, - { - "path": "product/promotion/-promotion-details", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-tag": "view" - } - } - }, - { - "path": "product/promotion/-promotion-assemble-promotions", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-tag": "view", - "u-count-down": "view" - } - } - }, - { - "path": "product/promotion/-promotion-assemble-list", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-image": "view", - "u-button": "view", - "u-empty": "view" - } - } - }, - { - "path": "product/goods/-goods-intro", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-empty": "view", - "u-parse": "view" - } - } - }, - { - "path": "product/shop/-shop", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-image": "view", - "u-loading": "view" - } - } - }, - { - "path": "product/evaluation/-evaluation", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-avatar": "view", - "u-read-more": "view", - "u-image": "view", - "u-empty": "view" - } - } - }, - { - "path": "product/goods/-goods-swiper", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-loading": "view", - "u-image": "view" - } - } - }, - { - "path": "product/popup/address", - "style": { - "navigationBarTitleText": "", - "componentPlaceholder": { - "u-popup": "view", - "u-icon": "view", - "u-empty": "view" - } - } - }, - { //鍟嗗搧璇勪环 - "path": "comment", - "navigationStyle": "custom", - "style": { - "navigationBarTitleText": "鍟嗗搧璇勪环", - //app椤甸潰涓嶆樉绀烘粴鍔ㄦ潯 - "scrollIndicator": "none" - } - }, - { // 瀹㈡湇 - "path": "customerservice/index", - "style": { - "navigationBarTitleText": "瀹㈡湇", - "usingComponents": { - // #ifdef MP-WEIXIN - "chat": "plugin://myPlugin/chat" - // #endif - } - } - } ] @@ -811,14 +913,14 @@ "animationType": "slide-in-bottom", "scrollIndicator": "none", "safearea": { - "bottom": { - "offset": "none" - } - } + "bottom": { + "offset": "none" + } + } } } }, - + { "path": "entry/seller/index", "style": { @@ -911,53 +1013,53 @@ { "root": "pages/promotion", - "pages": [ { + "pages": [{ "path": "seckill", "style": { "navigationBarTitleText": "闄愭椂鎶㈣喘", "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� - "navigationBarTextStyle": "black" , + "navigationBarTextStyle": "black", "app-plus": { "titleNView": { - "homeButton":true + "homeButton": true } } } }, - - { + + { "path": "joinGroup", "style": { "navigationBarTitleText": "鎷煎洟娲诲姩", "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� - "navigationBarTextStyle": "black" , + "navigationBarTextStyle": "black", "app-plus": { // 灏嗗洖寮瑰睘鎬у叧鎺� "bounce": "none" } } - },{ + }, { "path": "lives", "style": { "navigationStyle": "custom", "navigationBarTextStyle": "black" } - },{ + }, { "path": "bargain/list", "style": { "navigationStyle": "custom", "navigationBarTextStyle": "white" } - },{ + }, { "path": "bargain/detail", "style": { "navigationStyle": "custom", "navigationBarTextStyle": "white" } - },{ + }, { "path": "bargain/log", "style": { "navigationBarTitleText": "鐮嶄环璁板綍", @@ -966,18 +1068,18 @@ "u-empty": "view" } } - },{ + }, { "path": "point/detail", "style": { "navigationStyle": "custom", "navigationBarTextStyle": "white" } - },{ + }, { "path": "point/pointList", "style": { "navigationBarTitleText": "绉垎鍟嗗煄" - + } } @@ -1012,7 +1114,7 @@ "navigationBarTitleText": "浼樻儬鍒�" } }, - + { "path": "coupon/couponCenter", "style": { @@ -1054,7 +1156,7 @@ } } } - + ] }, @@ -1130,7 +1232,7 @@ "navigationBarTitleText": "璇勪环璇︽儏" } }, - + { "path": "evaluate/releaseEvaluate", "style": { @@ -1150,7 +1252,7 @@ } } }, - + { "path": "afterSales/applyProgress", "style": { @@ -1283,4 +1385,4 @@ // "query": "" //鍚姩鍙傛暟锛屽湪椤甸潰鐨刼nLoad鍑芥暟閲岄潰寰楀埌 // }] } -} +} \ No newline at end of file diff --git a/pages/customerManager/customerManager.vue b/pages/customerManager/customerManager.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/pages/customerManager/customerManager.vue @@ -0,0 +1,22 @@ +<template> + <view> + + </view> +</template> + +<script> + export default { + data() { + return { + + } + }, + methods: { + + } + } +</script> + +<style> + +</style> diff --git a/pages/mine/activity/detail.vue b/pages/mine/activity/detail.vue new file mode 100644 index 0000000..4c5bb5b --- /dev/null +++ b/pages/mine/activity/detail.vue @@ -0,0 +1,280 @@ +<template> + <view class="container"> + <!-- 椤堕儴娴锋姤鍥� --> + <!-- 鍔ㄦ�佸皝闈㈠尯鍩� --> + <view class="cover-container"> + <!-- 鍥剧墖绫诲瀷 --> + <block v-if="activityInfo.coverType === '鍥剧墖' || activityInfo.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(activityInfo.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <!-- 鏂囧瓧绫诲瀷 --> + <block v-if="activityInfo.coverType === '鏂囧瓧'"> + <view class="text-cover"> + <text class="cover-text">{{ activityInfo.cover }}</text> + </view> + </block> + </view> + + <!-- 娲诲姩鍩烘湰淇℃伅 --> + <view class="info-section"> + <text class="title">{{ activityInfo.activityName }}</text> + <view class="meta-info"> + <view> + <text class="time"> + 寮�濮嬫椂闂达細{{ activityInfo.startTime }} + </text> + + </view> + <view> + <text class="time"> + 缁撴潫鏃堕棿锛歿{ activityInfo.endTime }} + </text> + </view> + <view> + <text class="location">鍦扮偣锛歿{ activityInfo.activityLocation || '鏆傛棤' }}</text> + </view> + <view> + <text class="location">鏈�澶т汉鏁帮細{{ activityInfo.limitUserNum || '鏆傛棤' }}</text> + </view> + <view> + <text class="location">娲诲姩绫诲瀷锛歿{ activityInfo.activityType || '鏆傛棤' }}</text> + </view> + </view> + <view class="tags"> + <text v-for="(tag, index) in activityInfo.tags" :key="index" class="tag">{{ tag }}</text> + </view> + </view> + + + + <!-- 娲诲姩璇︽儏鍐呭 --> + <view class="content-section"> + <rich-text :nodes="activityInfo.activityContent"></rich-text> + </view> + <!-- 鎶ュ悕鐘舵�� --> + <view class="status-bar" :style="{ backgroundColor: statusBarColor }"> + <button class="signup-btn" @click="activityReport()" :disabled="reportBtn" >{{ reportBtn ? '宸叉姤鍚�': '绔嬪嵆鎶ュ悕'}}</button> + </view> + </view> +</template> + +<script> + import {getPreviewUrl} from '@/api/common.js' + import { + getActivityDetail, + activityReport + } from '@/api/activity.js'; + export default { + data() { + return { + activityInfo: { + coverType: '', + cover: '', + activityName: '', + startTime: '', // 鏃堕棿鎴� + endTime: '', + activityLocation: '', + tags: [], + activityContent: '', + activityType: '', + limitUserNum:'', + }, + reportBtn:false, + detailId: null, // 瀛樺偍鎺ユ敹鐨勫弬鏁� + reportFrom: { + activityId: '', + cancel: false, //鎶ュ悕鎺ュ彛榛樿鎴慺alse + } + }; + }, + onLoad(options) { + // 鎺ユ敹 URL 鍙傛暟 + if (options.id) { + this.detailId = options.id; + // 鍙湪姝ゅ鍙戣捣璇锋眰锛屾牴鎹� ID 鍔犺浇璇︽儏鏁版嵁 + this.loadDetailData(); + } + }, + methods: { + //鎶ュ悕 + activityReport() { + this.reportFrom.activityId = this.detailId + activityReport(this.reportFrom).then(res => { + if (res.statusCode === 200) { + this.reportBtn = true; + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'success', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + } + + }) + }, + getPreviewUrl(params){ + return getPreviewUrl(params); + }, + getActivityDetail(id) { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + getActivityDetail(id).then(res => { + uni.hideLoading(); + if (res.statusCode === 200) { + //璧嬪�� + this.activityInfo.coverType = res.data.data.coverType; + this.activityInfo.cover = res.data.data.cover; + this.activityInfo.activityName = res.data.data.activityName; + this.activityInfo.startTime = res.data.data.startTime; + this.activityInfo.endTime = res.data.data.endTime; + this.activityInfo.activityLocation = res.data.data.activityLocation; + this.activityInfo.activityContent = '<h2>娲诲姩浠嬬粛</h2>' + '<p>' + res.data.data.activityContent + '</p>'; + this.activityInfo.activityType = res.data.data.activityType; + this.activityInfo.limitUserNum = res.data.data.limitUserNum; + this.reportBtn = res.data.data.isReport; + + } + }) + }, + loadDetailData() { + + //鑾峰緱璇︽儏鎺ュ彛 + this.getActivityDetail(this.detailId); + + + + } + } + }; +</script> +<style lang="scss"> + /* 灏侀潰瀹瑰櫒 */ + .cover-container { + position: relative; + width: 100%; + height: 400rpx; + overflow: hidden; + background-color: #f5f5f5; + } + + /* 鍥剧墖/瑙嗛灏侀潰鏍峰紡 */ + .activity-cover { + width: 100%; + height: 100%; + border-radius: 0; /* 涓庡垪琛ㄩ〉淇濇寔涓�鑷� */ + } + + /* 鏂囧瓧灏侀潰鏍峰紡 - 涓庡垪琛ㄩ〉淇濇寔涓�鑷� */ + .text-cover { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); + padding: 40rpx; + } + + .cover-text { + color: #fff; + font-size: 36rpx; + font-weight: bold; + text-align: center; + line-height: 1.4; + text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.2); + } + .header-image { + width: 100%; + height: 400rpx; + } + + .info-section { + padding: 30rpx; + background: #fff; + margin-top: 20rpx; + } + + .title { + font-size: 40rpx; + font-weight: bold; + color: #333; + display: block; + margin-bottom: 20rpx; + } + + .meta-info { + margin-bottom: 20rpx; + color: #666; + } + + .time { + margin-right: 30rpx; + } + + .tags { + display: flex; + flex-wrap: wrap; + margin-top: 20rpx; + } + + .tag { + font-size: 24rpx; + padding: 8rpx 20rpx; + background: #f0f0f0; + border-radius: 30rpx; + margin-right: 15rpx; + margin-bottom: 15rpx; + } + + .status-bar { + padding: 25rpx 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + color: #fff; + font-size: 28rpx; + margin: 20rpx 0; + } + + .signup-btn { + background: #fff; + color: #2196F3; + padding: 10rpx 30rpx; + border-radius: 50rpx; + font-size: 28rpx; + } + + .content-section { + padding: 30rpx; + background: #fff; + margin-top: 20rpx; + } + + .footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 100rpx; + background: #fff; + display: flex; + justify-content: space-around; + align-items: center; + border-top: 1rpx solid #eee; + padding: 20rpx 0; + } + + .footer-item { + display: flex; + flex-direction: column; + align-items: center; + font-size: 24rpx; + color: #666; + } + + .footer-icon { + width: 40rpx; + height: 40rpx; + margin-bottom: 10rpx; + } +</style> \ No newline at end of file diff --git a/pages/mine/activity/myActivity.vue b/pages/mine/activity/myActivity.vue new file mode 100644 index 0000000..12902c1 --- /dev/null +++ b/pages/mine/activity/myActivity.vue @@ -0,0 +1,464 @@ +<template> + <view class="activity-container"> + <u-navbar :is-back="true" title="鎴戠殑娲诲姩" title-color="#333" back-icon-color="#333"></u-navbar> + + <!-- 椤堕儴 Tab 瀵艰埅 --> + <view class="tab-nav"> + <view + v-for="(tab, index) in tabs" + :key="index" + class="tab-item" + :class="{active: currentTab === index}" + @click="switchTab(index)" + > + {{tab}} + <view class="tab-indicator" v-if="currentTab === index"></view> + </view> + </view> + + <!-- 娲诲姩鍒楄〃 --> + <view class="activity-list"> + <!-- 宸叉姤鍚嶆椿鍔� --> + <view v-if="currentTab === 0"> + <view v-if="signedActivities.length > 0"> + <view + v-for="(item, idx) in signedActivities" + :key="idx" + class="activity-item card" + > + <!-- 灏侀潰鍖哄煙 --> + <view class="cover-container"> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(item.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover text-cover">{{ item.cover }}</view> + </block> + </view> + + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="info-header"> + <view class="activity-title">{{ item.activityName }}</view> + <view class="activity-status signed">宸叉姤鍚�</view> + </view> + + <view class="activity-meta"> + <view class="meta-item"> + <u-icon name="calendar" size="16" color="#999"></u-icon> + <text class="activity-time">{{ item.startTime }} - {{ item.endTime }}</text> + </view> + <view class="meta-item"> + <u-icon name="map" size="16" color="#999"></u-icon> + <text class="activity-location">{{ item.activityLocation || '寰呭畾' }}</text> + </view> + </view> + + <view class="action-container"> + <button + class="cancel-btn" + @click="handleActivityCancel(item.id)" + hover-class="cancel-btn-hover" + > + 鍙栨秷鎶ュ悕 + </button> + </view> + </view> + </view> + </view> + <view v-else class="empty-state"> + + <text class="empty-text">鏆傛棤宸叉姤鍚嶆椿鍔�</text> + </view> + </view> + + <!-- 宸茬粨鏉熸椿鍔� --> + <view v-if="currentTab === 1"> + <view v-if="endedActivities.length > 0"> + <view + v-for="(item, idx) in endedActivities" + :key="idx" + class="activity-item card" + > + <view class="cover-container"> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(item.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover text-cover">{{ item.cover }}</view> + </block> + </view> + + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="info-header"> + <view class="activity-title">{{ item.activityName }}</view> + <view class="activity-status ended">宸茬粨鏉�</view> + </view> + + <view class="activity-meta"> + <view class="meta-item"> + <u-icon name="calendar" size="16" color="#999"></u-icon> + <text class="activity-time">{{ item.startTime }} - {{ item.endTime }}</text> + </view> + <view class="meta-item"> + <u-icon name="map" size="16" color="#999"></u-icon> + <text class="activity-location">{{ item.activityLocation || '寰呭畾' }}</text> + </view> + </view> + </view> + </view> + </view> + <view v-else class="empty-state"> + + <text class="empty-text">鏆傛棤宸茬粨鏉熸椿鍔�</text> + </view> + </view> + + <!-- 宸插彇娑堟椿鍔� --> + <view v-if="currentTab === 2"> + <view v-if="canceledActivities.length > 0"> + <view + v-for="(item, idx) in canceledActivities" + :key="idx" + class="activity-item card" + > + <view class="cover-container"> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(item.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover text-cover">{{ item.cover }}</view> + </block> + </view> + + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="info-header"> + <view class="activity-title">{{ item.activityName }}</view> + <view class="activity-status canceled">宸插彇娑�</view> + </view> + + <view class="activity-meta"> + <view class="meta-item"> + <u-icon name="calendar" size="16" color="#999"></u-icon> + <text class="activity-time">{{ item.startTime }} - {{ item.endTime }}</text> + </view> + <view class="meta-item"> + <u-icon name="map" size="16" color="#999"></u-icon> + <text class="activity-location">{{ item.activityLocation || '寰呭畾' }}</text> + </view> + </view> + </view> + </view> + </view> + <view v-else class="empty-state"> + <text class="empty-text">鏆傛棤宸插彇娑堟椿鍔�</text> + </view> + </view> + </view> + </view> +</template> + +<script> +import {getMyActivityList,collectCancel,activityCancel} from '@/api/activity.js' +import {getPreviewUrl} from '@/api/common.js' +export default { + data() { + return { + currentTab: 0, // 褰撳墠閫変腑鐨則ab绱㈠紩 + tabs: ['宸叉姤鍚�', '宸茬粨鏉�', '宸插彇娑�'], + signedActivities: [], // 宸叉姤鍚嶅垪琛� + endedActivities: [],// 宸茬粨鏉熷垪琛� + canceledActivities: [],//宸插彇娑堝垪琛� + query:{ + status:'', + cancel:false, + }, + } + }, + onLoad(){ + this.currentTab = 0; + this.getMyActivityList(this.currentTab); + }, + methods: { + handleActivityCancel(activityId){ + activityCancel(activityId).then(res =>{ + if(res.statusCode == 200){ + uni.showToast({ + title: res.data.msg, + icon: 'success', + mask: true, + duration: 2000, + success: () => { + setTimeout(() => { + this.getMyActivityList(this.currentTab); + }, 2000); + } + }); + } + }) + }, + getPreviewUrl(params){ + return getPreviewUrl(params); + }, + switchTab(index) { + if (this.currentTab !== index) { + this.currentTab = index; + this.getMyActivityList(index) + } + }, + getMyActivityList(index){ + uni.showLoading({ + title: '鍔犺浇涓�' + }); + if(index === 0){ + this.query.cancel = false; + getMyActivityList(this.query).then(res =>{ + uni.hideLoading(); + if(res.statusCode === 200){ + this.signedActivities = res.data.data + } + }) + }else if(index === 1){ + this.query.status = '宸茬粨鏉�'; + this.query.cancel = false; + getMyActivityList(this.query).then(res =>{ + uni.hideLoading(); + if(res.statusCode === 200){ + this.endedActivities = res.data.data + } + }) + }else if(index === 2){ + this.query.cancel = true; + getMyActivityList(this.query).then(res =>{ + uni.hideLoading(); + if(res.statusCode === 200){ + this.canceledActivities = res.data.data + } + }) + } + this.query.status = ''; + this.query.cancel= false; + }, + } +} +</script> + +<style lang="scss"> +.activity-container { + padding: 0; + background-color: #f7f8fa; + min-height: 100vh; +} + +/* Tab 瀵艰埅鏍峰紡 */ +.tab-nav { + display: flex; + background-color: #fff; + margin-bottom: 16rpx; + position: sticky; + top: 0; + z-index: 10; + box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); +} + +.tab-item { + flex: 1; + text-align: center; + padding: 28rpx 0; + font-size: 30rpx; + color: #666; + position: relative; + transition: all 0.3s ease; + + &.active { + color: #2979ff; + font-weight: 500; + } + + .tab-indicator { + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 80rpx; + height: 6rpx; + background-color: #2979ff; + border-radius: 3rpx; + animation: scaleIn 0.3s ease; + } +} + +@keyframes scaleIn { + from { transform: translateX(-50%) scaleX(0); } + to { transform: translateX(-50%) scaleX(1); } +} + +/* 娲诲姩鍒楄〃鏍峰紡 */ +.activity-list { + padding: 20rpx 24rpx; +} + +.card { + background: #fff; + border-radius: 16rpx; + margin-bottom: 24rpx; + overflow: hidden; + box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04); + transition: transform 0.2s ease, box-shadow 0.2s ease; + + &:active { + transform: scale(0.98); + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08); + } +} + +.activity-item { + display: flex; + padding: 24rpx; +} + +.cover-container { + position: relative; + width: 200rpx; + height: 200rpx; + border-radius: 12rpx; + overflow: hidden; + margin-right: 24rpx; + flex-shrink: 0; +} + +.activity-cover { + width: 100%; + height: 100%; + border-radius: 12rpx; +} + +.text-cover { + display: flex; + align-items: center; + justify-content: center; + background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); + color: #fff; + font-size: 28rpx; + padding: 16rpx; + line-height: 1.4; +} + +.activity-info { + flex: 1; + display: flex; + flex-direction: column; +} + +.info-header { + display: flex; + justify-content: space-between; + align-items: flex-start; + margin-bottom: 16rpx; +} + +.activity-title { + flex: 1; + font-size: 32rpx; + color: #333; + font-weight: 500; + margin-right: 16rpx; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + line-height: 1.4; +} + +.activity-meta { + font-size: 24rpx; + color: #999; + margin-bottom: 16rpx; +} + +.meta-item { + display: flex; + align-items: center; + margin-bottom: 12rpx; + + .u-icon { + margin-right: 8rpx; + } +} + +.activity-status { + font-size: 24rpx; + padding: 6rpx 16rpx; + border-radius: 20rpx; + flex-shrink: 0; + + &.signed { + color: #2979ff; + background-color: rgba(41, 121, 255, 0.1); + } + + &.ended { + color: #909399; + background-color: rgba(144, 147, 153, 0.1); + } + + &.canceled { + color: #fa3534; + background-color: rgba(250, 53, 52, 0.1); + } +} + +/* 鎿嶄綔鎸夐挳 */ +.action-container { + display: flex; + justify-content: flex-end; + margin-top: auto; + padding-top: 16rpx; +} + +.cancel-btn { + background: #fef0f0; + color: #fa3534; + border: none; + border-radius: 40rpx; + padding: 0 32rpx; + height: 64rpx; + line-height: 64rpx; + font-size: 26rpx; + transition: all 0.3s ease; + + &::after { + border: none; + } + + &.cancel-btn-hover { + background: #fde2e2; + transform: scale(0.98); + } +} + +/* 绌虹姸鎬� */ +.empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 100rpx 0; + text-align: center; + + .empty-image { + width: 300rpx; + height: 300rpx; + opacity: 0.6; + margin-bottom: 40rpx; + } + + .empty-text { + font-size: 28rpx; + color: #999; + margin-top: 20rpx; + } +} +</style> \ No newline at end of file diff --git a/pages/mine/activity/reportActivity.vue b/pages/mine/activity/reportActivity.vue new file mode 100644 index 0000000..2f34778 --- /dev/null +++ b/pages/mine/activity/reportActivity.vue @@ -0,0 +1,299 @@ +<template> + <view class="wrapper"> + <u-navbar :is-back="true" title="娲诲姩"> + </u-navbar> + <!-- 鍐呭鍖哄煙 --> + <scroll-view scroll-y class="content" :style="{ paddingBottom: safeAreaInsets.bottom + 'px' }"> + <view class="waterfall"> + <view class="column" v-for="(column, index) in columns" :key="index"> + <!-- 閬嶅巻姣忓垪鍐呭 --> + <view class="item" v-for="(item, idx) in column" :key="item.id" @click="handleItemClick(item)"> + <!-- 鍥剧墖绫诲瀷 --> + <image v-if="item.type === '鍥剧墖'" :src="item.content" mode="widthFix" class="media" + @load="imageLoad" :data-item="item" /> + + <!-- 瑙嗛绫诲瀷 --> + <video v-if="item.type === '瑙嗛'" :src="item.content" class="media" controls + :poster="item.poster" @play="handleVideoPlay"></video> + + <!-- 鏂囧瓧绫诲瀷 --> + <view v-if="item.type === '鏂囧瓧'" class="text-content"> + <text class="title">{{ item.cover }}</text> + </view> + <text class="title">{{ item.title }}</text> + </view> + </view> + </view> + </scroll-view> + + + + <custom-tabbar bgColor="#ffffff" selected="activity"></custom-tabbar> + + + + </view> + + +</template> + +<script> + import { + getActivityReportList, + } from '@/api/activity.js'; + export default { + data() { + return { + columns: [ + [], + [] + ], // 鍙屽垪甯冨眬 + mockData: [], + colHeight: [0, 0], // 璁板綍鍚勫垪楂樺害 + + }; + }, + onLoad() { + this.getActivityList(); + //鑾峰緱userId + }, + methods: { + /** + * 涓嬫媺鍒锋柊鏃� + */ + onPullDownRefresh() { + this.getActivityList(); + }, + getActivityList() { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + const mock = []; + getActivityReportList().then(res => { + uni.hideLoading(); + if (res.statusCode === 200) { + for (const value of res.data.data) { + const type = value.coverType; + const baseHeight = type === '鏂囧瓧' ? 120 : 350; + mock.push({ + id: value.id, + type: type, + cover: value.cover, + height: baseHeight, + title: value.activityName, + content: value.activityContent, + poster: '', + }); + } + } + this.mockData = mock; + this.layoutItems(); + }) + }, + // 鍥剧墖鍔犺浇瀹屾垚鍥炶皟 + layoutItems() { + this.columns = [ + [], + [] + ]; + this.colHeight = [0, 0]; + + this.mockData.forEach(item => { + const minIndex = this.colHeight.indexOf(Math.min(...this.colHeight)); + this.columns[minIndex].push(item); + + // 鏂囧瓧绫诲瀷涓嶉渶瑕佽绠楀浘鐗囬珮搴� + if (item.type !== 'text') { + this.colHeight[minIndex] += item.height + 40; // 40涓洪棿璺� + } else { + // 鏂囧瓧绫诲瀷鍥哄畾楂樺害璁$畻锛堟牴鎹瓧浣撳ぇ灏忓拰琛屾暟锛� + const lineHeight = 40; // 鍋囪姣忚40rpx + const lines = Math.ceil(uni.getSystemInfoSync().windowWidth / 345 * 0.8); // 鍝嶅簲寮忚鏁� + this.colHeight[minIndex] += lineHeight * lines + 40; + } + }); + console.log(this.colHeight) + }, + // 鍥剧墖鍔犺浇鍥炶皟 + imageLoad(e) { + const { + height, + width + } = e.detail; + const ratio = height / width; + const item = e.currentTarget.dataset.item; + + // 閲嶆柊璁$畻瀹為檯鏄剧ず楂樺害 + const viewWidth = 345; + const viewHeight = viewWidth * ratio; + const index = this.columns[0].findIndex(i => i.id === item.id) || + this.columns[1].findIndex(i => i.id === item.id); + + if (index !== -1) { + const colIndex = this.colHeight[0] < this.colHeight[1] ? 0 : 1; + this.colHeight[colIndex] -= item.height; + this.colHeight[colIndex] += viewHeight; + item.height = viewHeight; + } + }, + handleItemClick(item) { + console.log(item) + uni.navigateTo({ + url: `/pages/mine/activity/detail?id=${item.id}` // 鍙傛暟閫氳繃 URL 浼犻�� + }); + + } + }, + } +</script> + +<style lang="scss"> + /* 鍏ㄥ眬鏍峰紡浼樺寲 */ + .wrapper { + height: 100vh; + display: flex; + flex-direction: column; + background-color: #f7f8fa; + } + + /* 瀵艰埅鏍忎紭鍖� */ + .u-navbar { + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + } + + /* 鍐呭鍖哄煙浼樺寲 */ + .content { + flex: 1; + overflow: hidden; + padding: 0 20rpx; + box-sizing: border-box; + } + + /* 鐎戝竷娴佸竷灞�浼樺寲 */ + .waterfall { + display: flex; + padding: 20rpx 0; + gap: 20rpx; + } + + .column { + flex: 1; + display: flex; + flex-direction: column; + gap: 20rpx; + } + + /* 鍗$墖椤逛紭鍖� */ + .item { + background: #fff; + border-radius: 16rpx; + overflow: hidden; + box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08); + transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); + + &:active { + transform: scale(0.98); + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.12); + } + } + + /* 濯掍綋鍐呭鏍峰紡 */ + .media { + width: 100%; + display: block; + border-radius: 16rpx 16rpx 0 0; + background-color: #f5f5f5; + + &[mode="widthFix"] { + height: auto; + } + } + + /* 瑙嗛鐗规畩鏍峰紡 */ + video.media { + object-fit: cover; + } + + /* 鏂囧瓧鍐呭鏍峰紡 */ + .text-content { + padding: 24rpx; + background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); + min-height: 160rpx; + display: flex; + align-items: center; + justify-content: center; + + .title { + color: #fff; + font-size: 32rpx; + font-weight: 500; + line-height: 1.4; + text-align: center; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; + } + } + + /* 鏍囬鏍峰紡浼樺寲 */ + .title { + padding: 20rpx 24rpx; + font-size: 28rpx; + color: #333; + line-height: 1.5; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + font-weight: 500; + + &:not(.text-content .title) { + border-top: 1rpx solid #f0f0f0; + } + } + + /* 鍔犺浇鍔ㄧ敾 */ + @keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(20rpx); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + .item { + animation: fadeInUp 0.4s ease forwards; + opacity: 0; + + @for $i from 1 through 10 { + &:nth-child(#{$i}) { + animation-delay: $i * 0.05s; + } + } + } + + /* 绌虹姸鎬佹牱寮� */ + .empty-state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 60vh; + text-align: center; + + image { + width: 240rpx; + opacity: 0.6; + margin-bottom: 30rpx; + } + + text { + color: #c0c4cc; + font-size: 28rpx; + } + } +</style> \ No newline at end of file diff --git a/pages/mine/myCollect/myCollect.vue b/pages/mine/myCollect/myCollect.vue new file mode 100644 index 0000000..4b0fd27 --- /dev/null +++ b/pages/mine/myCollect/myCollect.vue @@ -0,0 +1,339 @@ +<template> + + <view class="activity-container"> + <!-- 椤堕儴 Tab 瀵艰埅 --> + <view class="tab-nav"> + <view v-for="(tab, index) in tabs" :key="index" class="tab-item" :class="{active: currentTab === index}" + @click="switchTab(index)"> + {{tab}} + </view> + </view> + + <!-- 瑙嗛鍒楄〃 --> + <view class="activity-list" > + <view v-if="currentTab === 0"> + <view v-if="signedActivities.length > 0"> + <view v-for="(item, idx) in signedActivities" :key="idx" class="activity-item"> + <!-- 灏侀潰鍖哄煙 --> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(item.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover">{{ item.cover }}</view> + </block> + + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="activity-title">{{ item.activityName }}</view> + <view class="activity-meta"> + <text class="activity-time">{{ item.startTime }} - {{ item.endTime }}</text> + <text class="activity-location">{{ item.activityLocation || '鏆傛棤' }}</text> + </view> + </view> + + <!-- 鎿嶄綔鍖哄煙 --> + <view class="action-container"> + <button class="cancel-btn" @click="handleCancelCollection(item)" + hover-class="cancel-btn-hover"> + 鍙栨秷鏀惰棌 + </button> + </view> + + </view> + </view> + </view> + + <view v-if="currentTab === 1"> + <!-- 宸茬粨鏉熸椿鍔ㄥ垪琛� --> + <view v-if="endedActivities.length > 0"> + <view v-for="(item, idx) in endedActivities" :key="idx" class="activity-item"> + <!-- 灏侀潰鍖哄煙 --> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(item.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover">{{ item.cover }}</view> + </block> + + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="activity-title">{{ item.activityName }}</view> + <view class="activity-meta"> + <text class="activity-time">{{ item.startTime }} - {{ item.endTime }}</text> + <text class="activity-location">{{ item.activityLocation || '鏆傛棤' }}</text> + </view> + </view> + + <!-- 鎿嶄綔鍖哄煙 --> + <view class="action-container"> + <button class="cancel-btn" @click="handleCancelCollection(item)" + hover-class="cancel-btn-hover"> + 鍙栨秷鏀惰棌 + </button> + </view> + + </view> + </view> + </view> + + <view v-if="currentTab === 2"> + <!-- 宸插彇娑堟椿鍔ㄥ垪琛� --> + <view v-if="canceledActivities.length > 0"> + <view v-for="(item, idx) in endedActivities" :key="idx" class="activity-item"> + <!-- 灏侀潰鍖哄煙 --> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="getPreviewUrl(item.cover)" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover">{{ item.cover }}</view> + </block> + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="activity-title">{{ item.activityName }}</view> + <view class="activity-meta"> + <text class="activity-time">{{ item.startTime }} - {{ item.endTime }}</text> + <text class="activity-location">{{ item.activityLocation || '鏆傛棤' }}</text> + </view> + </view> + <!-- 鎿嶄綔鍖哄煙 --> + <view class="action-container"> + <button class="cancel-btn" @click="handleCancelCollection(item)" + hover-class="cancel-btn-hover"> + 鍙栨秷鏀惰棌 + </button> + </view> + + </view> + + + </view> + + </view> + + + + </view> + + + </view> + +</template> + +<script> + import { + getMyActivityList, + activityCancel + } from '@/api/activity.js' + import { + getPreviewUrl + } from '@/api/common.js' + export default { + data() { + return { + currentTab: 0, // 褰撳墠閫変腑鐨則ab绱㈠紩 + tabs: ['瑙嗛', '鍟嗗搧', '娲诲姩'], + // + videoCollects: [], // 鏀惰棌瑙嗛鍒楄〃 + storeCollects: [], // 鏀惰棌鍟嗗搧鍒楄〃 + activityCollects: [], // 鏀惰棌娲诲姩鍒楄〃 + query: { + id: '', + status: '', + cancel: false, + }, + } + }, + onLoad(){ + this.currentTab = 0; + //TODO 鏈櫥褰曢渶瑕乮d锛屾祴璇曠敤鍐欐\ + this.switchTab(this.currentTab); + }, + methods: { + handleCancelCollection(id) { + + }, + getPreviewUrl(params) { + // return getPreviewUrl(params); + return ''; + }, + // 鍒囨崲tab + switchTab(index) { + + if (this.currentTab !== index) { + this.currentTab = index + // 瀹為檯椤圭洰涓彲浠ュ湪杩欓噷娣诲姞鍔犺浇鏁版嵁鐨勯�昏緫 + if (this.currentTab === 0) { + //鍔犺浇瑙嗛鍒楄〃 + this.getMyCollectionVideoList(); + } else if (this.currentTab === 1) { + //鍔犺浇鍟嗗搧鍒楄〃 + this.getMyCollectionStoreList(); + } else if (this.currentTab === 2) { + //鍔犺浇娲诲姩鍒楄〃 + this.getMyCollectActivityList(); + } + + } + + }, + getMyCollectionStoreList() { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + + uni.hideLoading(); + }, + getMyCollectionVideoList() { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + + uni.hideLoading(); + }, + getMyCollectActivityList() { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + + uni.hideLoading(); + }, + } + } +</script> + +<style lang="scss"> + .activity-container { + padding: 20rpx; + background-color: #f5f5f5; + min-height: 100vh; + } + + /* Tab 瀵艰埅鏍峰紡 */ + .tab-nav { + display: flex; + background-color: #fff; + border-radius: 12rpx; + margin-bottom: 20rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); + } + + .tab-item { + flex: 1; + text-align: center; + padding: 24rpx 0; + font-size: 28rpx; + color: #666; + position: relative; + + &.active { + color: #007AFF; + font-weight: bold; + + &::after { + content: ''; + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 80rpx; + height: 6rpx; + background-color: #007AFF; + border-radius: 3rpx; + } + } + } + + /* 娲诲姩鍒楄〃鏍峰紡 */ + .activity-list { + background-color: #fff; + border-radius: 12rpx; + padding: 20rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); + } + + .activity-item { + display: flex; + padding: 20rpx 0; + border-bottom: 1rpx solid #eee; + + &:last-child { + border-bottom: none; + } + } + + .activity-cover { + width: 200rpx; + height: 140rpx; + border-radius: 8rpx; + margin-right: 20rpx; + } + + .activity-info { + flex: 1; + position: relative; + } + + .activity-title { + font-size: 32rpx; + color: #333; + font-weight: bold; + margin-bottom: 12rpx; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + } + + .activity-meta { + font-size: 24rpx; + color: #999; + margin-bottom: 16rpx; + + text { + display: block; + margin-bottom: 8rpx; + } + } + + .activity-status { + position: absolute; + right: 0; + top: 0; + font-size: 24rpx; + padding: 4rpx 12rpx; + border-radius: 20rpx; + + &.signed { + color: #007AFF; + background-color: rgba(0, 122, 255, 0.1); + } + + &.ended { + color: #999; + background-color: rgba(153, 153, 153, 0.1); + } + + &.canceled { + color: #ff3b30; + background-color: rgba(255, 59, 48, 0.1); + } + } + + /* 绌虹姸鎬佹彁绀� */ + .empty-tip { + text-align: center; + padding: 100rpx 0; + + image { + width: 300rpx; + margin-bottom: 30rpx; + opacity: 0.6; + } + + text { + display: block; + font-size: 28rpx; + color: #999; + } + } +</style> \ No newline at end of file diff --git a/pages/tabbar/user/utils/tool.vue b/pages/tabbar/user/utils/tool.vue index 447b221..21aa150 100644 --- a/pages/tabbar/user/utils/tool.vue +++ b/pages/tabbar/user/utils/tool.vue @@ -1,239 +1,275 @@ <template> - <view> - <!-- 甯哥敤宸ュ叿 --> - <view class="interact-tools" style="margin-bottom: 15px"> + <view> + <!-- 甯哥敤宸ュ叿 --> + <view class="interact-tools" style="margin-bottom: 15px"> - <div class="paddingBox"> - <view class="interact-container"> - <view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')"> - <image src="/static/mine/myaddress.png" mode=""></image> - <view>鍦板潃绠$悊</view> - </view> - - <view class="interact-item" @click="navigateTo('/pages/mine/myTracks')"> - <image src="/static/mine/logistics.png" mode=""></image> - <view>鎴戠殑瓒宠抗</view> - </view> - - <view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')"> - <image src="/static/mine/feedback.png" mode=""></image> - <view>鎴戠殑璇勪环</view> - </view> - <!-- <view class="interact-item" @click="linkMsgDetail()"> + <div class="paddingBox"> + <view class="interact-container"> + <view class="interact-item" @click="navigateTo('/pages/mine/address/addressManage')"> + <image src="/static/mine/myaddress.png" mode=""></image> + <view>鍦板潃绠$悊</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/mine/myTracks')"> + <image src="/static/mine/logistics.png" mode=""></image> + <view>鎴戠殑瓒宠抗</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')"> + <image src="/static/mine/feedback.png" mode=""></image> + <view>鎴戠殑璇勪环</view> + </view> + <!-- <view class="interact-item" @click="linkMsgDetail()"> <image src="/static/mine/mycommit.png" mode=""></image> <view>鎴戠殑娑堟伅</view> </view> --> - - - <view class="interact-item" @click="navigateTo('/pages/mine/myCollect')"> - <image src="/static/mine/myfavorite.png" mode=""></image> - <view>鎴戠殑鍏虫敞</view> - </view> - - - - <view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')"> - <image src="/static/mine/mypoint.png" mode=""></image> - <view>鎴戠殑绉垎</view> - </view> - - <view class="interact-item" @click="distribution"> + + + <view class="interact-item" @click="navigateTo('/pages/mine/myCollect')"> + <image src="/static/mine/myfavorite.png" mode=""></image> + <view>鎴戠殑鍏虫敞</view> + </view> + + + + <view class="interact-item" @click="navigateTo('/pages/mine/point/myPoint')"> + <image src="/static/mine/mypoint.png" mode=""></image> + <view>鎴戠殑绉垎</view> + </view> + + <!-- <view class="interact-item" @click="distribution"> <image src="/static/mine/distribution.png" mode=""></image> <view>鎴戠殑鍒嗛攢</view> - </view> - - - - <view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')"> - <image src="/static/mine/shensu.png" mode=""></image> - <view>鎴戠殑鎶曡瘔</view> - </view> - - <view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')"> - <image src="/static/mine/mycoupon.png" mode=""></image> - <view>浼樻儬鍒�</view> - </view> - - - - - <view class="interact-item" @click="navigateTo('/pages/mine/signIn')"> - <image src="/static/mine/sign.png" mode=""></image> - <view>姣忔棩绛惧埌</view> - </view> - - - - + </view> --> - - <view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')"> - <image src="/static/mine/couponcenter.png" mode=""></image> - <view>棰嗗埜涓績</view> - </view> - - - - <view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')"> - <image src="/static/mine/kanjia.png" mode=""></image> - <view>鐮嶄环璁板綍</view> - </view> - - - - <view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')"> - <image src="/static/mine/feedback.png" mode=""></image> - <view>鎰忚鍙嶉</view> - </view> - - <view class="interact-item" @click="navigateTo('/pages/mine/set/editionIntro')"> - <image src="/static/mine/pointgift.png" mode=""></image> - <view>鍏充簬</view> - </view> - - <view class="interact-item" @click="navigateTo('/pages/passport/entry/seller/index')"> - <image src="/static/mine/feedback.png" mode=""></image> - <view>搴楅摵鍏ラ┗</view> - </view> - - - <view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')"> - <image src="/static/mine/setting.png" mode=""></image> - <view>璁剧疆</view> - </view> - <view class="interact-item" @click="navigateTo('/pages/goods-manager/goodsList/goodsList')"> - <image src="/static/mine/setting.png" mode=""></image> - <view>鍟嗗搧绠$悊</view> - </view> - - - </view> - </div> - </view> - </view> + <view class="interact-item" @click="navigateTo('/pages/mine/myCollect')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>鎴戠殑鏀惰棌</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/mine/activity/myActivity')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>鎴戠殑娲诲姩</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/mine/activity/reportActivity')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>娲诲姩</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/mine/myCollect/myCollect')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>鎴戠殑鏀惰棌</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/userPermissions/userPermissions')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>鐢ㄦ埛鏉冮檺</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/customerManager/customerManager')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>瀹㈡埛绠$悊</view> + </view> + <view class="interact-item" @click="navigateTo('/pages/order/complain/complainList')"> + <image src="/static/mine/shensu.png" mode=""></image> + <view>鎴戠殑鎶曡瘔</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/cart/coupon/myCoupon')"> + <image src="/static/mine/mycoupon.png" mode=""></image> + <view>浼樻儬鍒�</view> + </view> + + + + + <view class="interact-item" @click="navigateTo('/pages/mine/signIn')"> + <image src="/static/mine/sign.png" mode=""></image> + <view>姣忔棩绛惧埌</view> + </view> + + + + + + + <view class="interact-item" @click="navigateTo('/pages/cart/coupon/couponCenter')"> + <image src="/static/mine/couponcenter.png" mode=""></image> + <view>棰嗗埜涓績</view> + </view> + + + + <view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')"> + <image src="/static/mine/kanjia.png" mode=""></image> + <view>鐮嶄环璁板綍</view> + </view> + + + + <view class="interact-item" @click="navigateTo('/pages/mine/set/feedBack')"> + <image src="/static/mine/feedback.png" mode=""></image> + <view>鎰忚鍙嶉</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/mine/set/editionIntro')"> + <image src="/static/mine/pointgift.png" mode=""></image> + <view>鍏充簬</view> + </view> + + <view class="interact-item" @click="navigateTo('/pages/passport/entry/seller/index')"> + <image src="/static/mine/feedback.png" mode=""></image> + <view>搴楅摵鍏ラ┗</view> + </view> + + + <view class="interact-item" @click="navigateTo('/pages/mine/set/setUp')"> + <image src="/static/mine/setting.png" mode=""></image> + <view>璁剧疆</view> + </view> + <view class="interact-item" @click="navigateTo('/pages/goods-manager/goodsList/goodsList')"> + <image src="/static/mine/setting.png" mode=""></image> + <view>鍟嗗搧绠$悊</view> + </view> + + + </view> + </div> + </view> + </view> </template> <script> -import { distribution } from "@/api/goods"; -import configs from "@/config/config"; -import storage from "@/utils/storage"; + import { + distribution + } from "@/api/goods"; + import configs from "@/config/config"; + import storage from "@/utils/storage"; -export default { - data() { - return { - configs, - storage - } - }, - - methods: { - handleNavigate(url) { - uni.navigateTo({ - url, - }); + export default { + data() { + return { + configs, + storage + } }, - navigateTo(url) { - const ignores = [ - '/pages/mine/set/setUp', - '/pages/mine/set/editionIntro', - '/pages/mine/set/feedBack', - '/pages/goods-manager/goodsList/goodsList' - ] - if (!ignores.includes(url)) { - if (this.$options.filters.tipsToLogin('normal')) { + + methods: { + handleNavigate(url) { + uni.navigateTo({ + url, + }); + }, + navigateTo(url) { + const ignores = [ + '/pages/mine/set/setUp', + '/pages/mine/set/editionIntro', + '/pages/mine/set/feedBack', + '/pages/goods-manager/goodsList/goodsList', + '/pages/mine/set/feedBack', + '/pages/mine/activity/myActivity', + '/pages/mine/myCollect/myCollect', + '/pages/mine/myCollect' + ] + if (!ignores.includes(url)) { + if (this.$options.filters.tipsToLogin('normal')) { + this.handleNavigate(url) + } + } else { this.handleNavigate(url) } - } - else { - this.handleNavigate(url) - } - }, - - linkMsgDetail(){ - uni.navigateTo({ - url: `/pages/mine/im/list`, - }); - }, - - distribution() { - distribution().then((res) => { - if (res.data.result) { - let type = res.data.result.distributionStatus; - if (type == "PASS") { - uni.navigateTo({ - url: "/pages/mine/distribution/home", - }); - } else if (type == "REFUSE") { - uni.navigateTo({ - url: "/pages/mine/distribution/auth", - }); - } else if (type == "RETREAT") { - uni.showToast({ - title: "鎮ㄧ殑鍒嗛攢璧勬牸宸茶娓呴��銆傝鑱旂郴绠$悊鍛橈紒", - duration: 2000, - icon: "none", - }); - } else { - uni.showToast({ - title: "鎮ㄧ殑淇℃伅姝e湪瀹℃牳", - duration: 2000, - icon: "none", - }); - } - } else if (!res.data.success && res.data.code == 22000) { - uni.showToast({ - title: "鍒嗛攢鍔熻兘鏆傛湭寮�鍚�", - duration: 2000, - icon: "none", - }); - } else { - // 娌℃湁璧勬牸鐢宠 鍏堝幓瀹炲悕璁よ瘉 - uni.navigateTo({ - url: "/pages/mine/distribution/auth", - }); - } - }); - }, - }, -}; + }, + + linkMsgDetail() { + uni.navigateTo({ + url: `/pages/mine/im/list`, + }); + }, + + distribution() { + distribution().then((res) => { + if (res.data.result) { + let type = res.data.result.distributionStatus; + if (type == "PASS") { + uni.navigateTo({ + url: "/pages/mine/distribution/home", + }); + } else if (type == "REFUSE") { + uni.navigateTo({ + url: "/pages/mine/distribution/auth", + }); + } else if (type == "RETREAT") { + uni.showToast({ + title: "鎮ㄧ殑鍒嗛攢璧勬牸宸茶娓呴��銆傝鑱旂郴绠$悊鍛橈紒", + duration: 2000, + icon: "none", + }); + } else { + uni.showToast({ + title: "鎮ㄧ殑淇℃伅姝e湪瀹℃牳", + duration: 2000, + icon: "none", + }); + } + } else if (!res.data.success && res.data.code == 22000) { + uni.showToast({ + title: "鍒嗛攢鍔熻兘鏆傛湭寮�鍚�", + duration: 2000, + icon: "none", + }); + } else { + // 娌℃湁璧勬牸鐢宠 鍏堝幓瀹炲悕璁よ瘉 + uni.navigateTo({ + url: "/pages/mine/distribution/auth", + }); + } + }); + }, + }, + }; </script> <style lang="scss" scoped> -.interact-tools { - border-left: none; - border-right: none; + .interact-tools { + border-left: none; + border-right: none; - .interactBox { - height: 156rpx; - } - .interact-container { - margin: 0 20rpx; - background: #fff; - border-radius: 20rpx; - box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1); - .interact-item-img { - width: 52rpx !important; - height: 52rpx !important; - // margin-bottom: !important; - margin: 0 auto 6rpx auto !important; - } - image { - width: 52rpx; - height: 52rpx; - margin-bottom: 6rpx; - } - display: flex; - align-items: center; - flex-wrap: wrap; - text-align: center; + .interactBox { + height: 156rpx; + } - .interact-item { - font-size: $font-sm; - width: 25%; - height: 160rpx; - padding: 30rpx; - } - } -} -</style> + .interact-container { + margin: 0 20rpx; + background: #fff; + border-radius: 20rpx; + box-shadow: 0 4rpx 24rpx 0 rgba($color: #f6f6f6, $alpha: 1); + + .interact-item-img { + width: 52rpx !important; + height: 52rpx !important; + // margin-bottom: !important; + margin: 0 auto 6rpx auto !important; + } + + image { + width: 52rpx; + height: 52rpx; + margin-bottom: 6rpx; + } + + display: flex; + align-items: center; + flex-wrap: wrap; + text-align: center; + + .interact-item { + font-size: $font-sm; + width: 25%; + height: 160rpx; + padding: 30rpx; + } + } + } +</style> \ No newline at end of file diff --git a/pages/userPermissions/addStoreMember.vue b/pages/userPermissions/addStoreMember.vue new file mode 100644 index 0000000..265e0fc --- /dev/null +++ b/pages/userPermissions/addStoreMember.vue @@ -0,0 +1,291 @@ +<template> + <view class="add-user-container"> + <u-navbar :is-back="true" :title="title" title-color="#333" back-icon-color="#333"></u-navbar> + <!-- 琛ㄥ崟鍖哄煙 --> + <view class="form-card"> + <u-form :model="form" ref="uForm1" label-width="150rpx"> + + <!-- 鐪熷疄濮撳悕 --> + <u-form-item label="鐪熷疄濮撳悕" prop="realName" borderBottom required="true"> + <u-input v-model="form.realName" placeholder="璇疯緭鍏ョ湡瀹炲鍚�" border="none" /> + </u-form-item> + + <!-- 鐢佃瘽 --> + <u-form-item label="鐢佃瘽" prop="mobile" borderBottom required="true"> + <u-input v-model="form.mobile" placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" border="none" type="number" /> + </u-form-item> + <!-- 鏃у瘑鐮� --> + <u-form-item label="鏃у瘑鐮�" prop="password" borderBottom required="true" v-if="false"> + <u-input v-model="form.oldPassword" placeholder="璇疯緭鍏ュ瘑鐮�" border="none" type="password" /> + </u-form-item> + <!-- 瀵嗙爜 --> + <u-form-item label="鏂板瘑鐮�" prop="password" borderBottom required="true"> + <u-input v-model="form.password" placeholder="璇疯緭鍏ュ瘑鐮�" border="none" type="password" /> + </u-form-item> + + <!-- 瑙掕壊閫夋嫨 --> + <u-form-item label="瑙掕壊" prop="role" borderBottom required="true"> + <!-- 澶嶉�夋缁勶紝澧炲姞甯冨眬鍜岄棿璺� --> + <u-checkbox-group @change="checkboxGroupChange" class="checkbox-group"> + <u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" + :key="index" :name="item.name" class="custom-checkbox"> + <span class="checkbox-label">{{ item.name }}</span> + </u-checkbox> + + </u-checkbox-group> + <!-- 鍏ㄩ�夋寜閽紝澧炲姞闂磋窛鍜屾牱寮� --> + <!-- <u-button type="text" @click="checkedAll" class="select-all-btn"> + 鍏ㄩ�� + </u-button> --> + </u-form-item> + + </u-form> + + <!-- 鎻愪氦鎸夐挳 --> + <view class="submit-btn"> + <u-button type="primary" shape="circle" @click="submitForm()" :loading="loading">鎻愪氦</u-button> + </view> + </view> + </view> +</template> + +<script> + import { + add, + update, + getDetail + } from "@/api/userPermissions.js" + import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue'; + import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue'; + import UForm from '@/uview-components/uview-ui/components/u-form/u-form.vue'; + import UFormItem from '@/uview-components/uview-ui/components/u-form-item/u-form-item.vue'; + import UInput from '@/uview-components/uview-ui/components/u-input/u-input.vue'; + import USearch from '@/uview-components/uview-ui/components/u-search/u-search.vue'; + import UPopup from '@/uview-components/uview-ui/components/u-popup/u-popup.vue'; + import ULoading from '@/uview-components/uview-ui/components/u-loading/u-loading.vue'; + + import UCheckbox from '@/uview-components/uview-ui/components/u-checkbox/u-checkbox.vue'; + import UCheckboxGroup from '@/uview-components/uview-ui/components/u-checkbox-group/u-checkbox-group.vue'; + + export default { + components: { + UIcon, + UButton, + UForm, + UFormItem, + UInput, + USearch, + UPopup, + ULoading, + UCheckbox, + UCheckboxGroup + }, + data() { + return { + title: '', + // 琛ㄥ崟鏁版嵁 + form: { + id: '', + mobile: '', + realName: '', + password: '', + role: '', + oldPassword: '' + }, + + role: [], + // 鍔犺浇鐘舵�� + loading: false, + // 瑙掕壊閫夐」 + list: [{ + name: '绠$悊鍛�', + checked: false, + disabled: false + }, + { + name: '绠$悊鍛�2', + checked: false, + disabled: false + }, + { + name: '绠$悊鍛�3', + checked: false, + disabled: false + } + ], + + }; + }, + onLoad(options) { + // 鎺ユ敹 URL 鍙傛暟 + if (options.id) { + this.form.id = options.id; + // 鍙湪姝ゅ鍙戣捣璇锋眰锛屾牴鎹� ID 鍔犺浇璇︽儏鏁版嵁 + this.title = '淇敼鐢ㄦ埛'; + this.getDetail(); + } else { + this.title = '鏂板鐢ㄦ埛'; + } + }, + methods: { + //鑾峰緱璇︽儏 + getDetail() { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + getDetail(this.form.id).then(res => { + uni.hideLoading(); + if (res.statusCode === 200) { + this.form.mobile = res.data.data.mobile; + this.form.realName = res.data.data.realName; + this.form.password = res.data.data.password; + // 瑙f瀽瑙掕壊鏁扮粍 + const roles = JSON.parse(res.data.data.role); + + // 鏇存柊澶嶉�夋閫変腑鐘舵�� + this.list = this.list.map(item => { + return { + ...item, + checked: roles.includes(item.name) + }; + }); + + + this.form.role = roles; + } + }) + }, + // 瑙掕壊閫夋嫨鍙樺寲 + checkboxChange(e) { + // console.log(e); + }, + checkboxGroupChange(e) { + this.role = e; + }, + // 鍏ㄩ�� + checkedAll() { + this.list.map(val => { + val.checked = true; + }) + }, + // 鎻愪氦琛ㄥ崟 + async submitForm() { + // 1. 鎵嬪姩瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.uForm1.validate(valid => { + if (valid) { + this.loading = true; + // 2. 澶勭悊瑙掕壊鏁版嵁锛堝皢 checked=true 鐨勯」杞负 role 鏁扮粍锛� + + this.form.role = JSON.stringify(this.role); + console.log(this.form) + if (this.form.id) { + update(this.form).then(res => { + this.loading = false; + if (res.statusCode === 200) { + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'none', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + + setTimeout(() => uni.navigateBack(), 1500); + } + }) + } else { + add(this.form).then(res => { + this.loading = false; + if (res.statusCode === 200) { + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'none', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + + setTimeout(() => uni.navigateBack(), 1500); + } + }) + } + + } + }); + + + + } + } + }; +</script> + +<style lang="scss" scoped> + .checkbox-group { + display: flex; + flex-wrap: wrap; + gap: 16px; + /* 閫夐」闂磋窛 */ + margin-bottom: 16px; + /* 涓庢寜閽殑闂磋窛 */ + } + + /* 鍗曚釜澶嶉�夋鏍峰紡 */ + .custom-checkbox { + /deep/ .u-checkbox__icon-wrap { + border-radius: 4px; + /* 鍦嗚 */ + border: 1px solid #dcdfe6; + /* 杈规 */ + } + + /deep/ .u-checkbox__icon--checked { + background-color: #2979ff; + /* 閫変腑鑳屾櫙鑹� */ + border-color: #2979ff; + } + } + + /* 澶嶉�夋鏂囧瓧鏍峰紡 */ + .checkbox-label { + margin-left: 8px; + /* 鏂囧瓧涓庡浘鏍囩殑闂磋窛 */ + font-size: 14px; + color: #606266; + } + + /* 鍏ㄩ�夋寜閽牱寮� */ + .select-all-btn { + width: 40rpx; + margin-top: 8px; + } + + .add-user-container { + padding: 30rpx; + min-height: 100vh; + background-color: #f5f7fa; + + .form-card { + background-color: #fff; + border-radius: 16rpx; + padding: 30rpx; + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); + } + + .submit-btn { + margin-top: 60rpx; + padding: 0 30rpx; + } + + // 璋冩暣uView琛ㄥ崟鏍峰紡 + ::v-deep .u-form-item { + padding: 24rpx 0; + + &__body { + padding: 0; + } + } + + // 澶嶉�夋鏍峰紡璋冩暣 + ::v-deep .u-checkbox-group { + width: 100%; + padding: 16rpx 0; + } + } +</style> \ No newline at end of file diff --git a/pages/userPermissions/userPermissions.vue b/pages/userPermissions/userPermissions.vue new file mode 100644 index 0000000..12cf83f --- /dev/null +++ b/pages/userPermissions/userPermissions.vue @@ -0,0 +1,286 @@ +<template> + <view class="container"> + <!-- 鏍囬 --> + <view class="header"> + <text class="title">鐢ㄦ埛鍒楄〃</text> + + </view> + <view> + <button class="add-btn" @click="navigateToAdd()">鏂板鐢ㄦ埛</button> + </view> + <!-- 鎼滅储妗� --> + <view class="search-box"> + <u-search v-model="query.realName" placeholder="鎼滅储濮撳悕" :showAction="false" @change="searchUser()"></u-search> + </view> + + <!-- 鐢ㄦ埛鍒楄〃 --> + <scroll-view scroll-y class="user-list" @scrolltolower="loadMore" v-if="userList.length > 0"> + <view class="user-item" v-for="(user, index) in userList" :key="user.id" > + + <view class="user-info"> + <text class="realName">{{ user.realName }}</text> + <text class="mobile">{{ user.mobile }}</text> + </view> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <view class="action-buttons"> + <u-button type="primary" size="mini" @click.stop="navigateToDetail(user.id)" class="edit-btn">淇敼</u-button> + <u-button type="error" size="mini" @click.stop="deleteUser(user.id)" + class="delete-btn">鍒犻櫎</u-button> + </view> + + </view> + + <!-- 鍔犺浇鏇村鎻愮ず --> + <view class="load-more" v-if="loading"> + <u-loading :show="loading"></u-loading> + </view> + <view class="load-more" v-if="noMoreData"> + <text>娌℃湁鏇村鏁版嵁浜�</text> + </view> + </scroll-view> + + <!-- 绌虹姸鎬� --> + <view class="empty" v-else> + <text>鏆傛棤鐢ㄦ埛鏁版嵁</text> + </view> + </view> +</template> + +<script> + import { + getPage, + del, + add, + update + } from "@/api/userPermissions.js" + import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue'; + import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue'; + import UForm from '@/uview-components/uview-ui/components/u-form/u-form.vue'; + import UFormItem from '@/uview-components/uview-ui/components/u-form-item/u-form-item.vue'; + import UInput from '@/uview-components/uview-ui/components/u-input/u-input.vue'; + import USearch from '@/uview-components/uview-ui/components/u-search/u-search.vue'; + import UPopup from '@/uview-components/uview-ui/components/u-popup/u-popup.vue'; + import ULoading from '@/uview-components/uview-ui/components/u-loading/u-loading.vue' + + + export default { + components: { + UIcon, + UButton, + UForm, + UFormItem, + UInput, + USearch, + UPopup, + ULoading + }, + data() { + return { + userList: [], // 鐢ㄦ埛鍒楄〃鏁版嵁 + loading: false, // 鍔犺浇鐘舵�� + noMoreData: false, // 鏄惁娌℃湁鏇村鏁版嵁 + query: { + realName: '', + page: 1, + pageSize: 10, + } + + + } + }, + onShow() { + this.getPage() + }, + onLoad() { + this.getPage() + }, + methods: { + async getPage() { + // + uni.showLoading({ + title: '鍔犺浇涓�' + }); + getPage(this.query).then(res => { + uni.hideLoading(); + if (res.statusCode === 200) { + const data = res.data.data; + if (this.query.page === 1) { + this.userList = data || []; + } else { + // 鍚﹀垯杩藉姞鏁版嵁 + this.userList = [...this.userList, ...(data || [])]; + + } + } + }) + + + }, + + // 鎼滅储鐢ㄦ埛 + searchUser() { + this.query.page = 1 + this.noMoreData = false + this.userList = [] + this.getPage() + }, + + // 鍔犺浇鏇村 + loadMore() { + if (!this.noMoreData) { + this.query.page++ + this.getPage() + } + }, + // 璺宠浆鍒版柊澧炵敤鎴� + navigateToAdd() { + uni.navigateTo({ + url: `/pages/userPermissions/addStoreMember` + }) + }, + // 璺宠浆鍒扮敤鎴疯鎯� + navigateToDetail(id) { + uni.navigateTo({ + url: `/pages/userPermissions/addStoreMember?id=${id}` + }) + }, + deleteUser(id){ + del(id).then(res =>{ + if (res.statusCode === 200) { + this.getPage(); + } + }) + } + } + } +</script> + +<style lang="scss" scoped> + .user-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20rpx; + border-bottom: 1rpx solid #f5f5f5; + } + + .user-info { + flex: 1; + display: flex; + flex-direction: column; + } + + .action-buttons { + display: flex; + margin-left: 20rpx; + } + + .edit-btn { + margin-right: 10rpx; + } + .container { + padding: 20rpx; + height: 100vh; + display: flex; + flex-direction: column; + background-color: #f5f5f5; + } + + .header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20rpx 0; + margin-bottom: 20rpx; + + .title { + font-size: 36rpx; + font-weight: bold; + color: #333; + } + + + } + + .add-btn { + width: 50%; + background-color: #2979ff; + color: white; + border-radius: 40rpx; + padding: 0 50rpx; + height: 60rpx; + line-height: 60rpx; + font-size: 26rpx; + box-shadow: 0 2rpx 10rpx rgba(41, 121, 255, 0.3); + margin-bottom: 20rpx; + } + + .search-box { + margin-bottom: 20rpx; + } + + .user-list { + flex: 1; + overflow: hidden; + } + + .user-item { + display: flex; + align-items: center; + padding: 20rpx; + margin-bottom: 20rpx; + background-color: #fff; + border-radius: 12rpx; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); + + .avatar { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + margin-right: 20rpx; + } + + .user-info { + flex: 1; + display: flex; + flex-direction: column; + + .realName { + font-size: 32rpx; + color: #333; + margin-bottom: 8rpx; + } + + .mobile { + font-size: 24rpx; + color: #999; + } + } + } + + .load-more { + padding: 20rpx; + text-align: center; + color: #999; + font-size: 28rpx; + } + + .empty { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 40rpx; + + image { + width: 200rpx; + margin-bottom: 20rpx; + } + + text { + color: #999; + font-size: 28rpx; + } + } +</style> \ No newline at end of file -- Gitblit v1.8.0