From 78685131317e9a08a05895c899ebea9970be52c8 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期一, 09 六月 2025 11:20:31 +0800 Subject: [PATCH] Merge branch 'dev' of http://42.193.1.25:9521/r/lmk-shop-wx into dev --- pages/tabbar/user/utils/tool.vue | 472 ++++--- pages/userPermissions/addStoreMember.vue | 287 ++++ pages.json | 659 ++++++---- api/collect.js | 13 pages/mine/activity/reportActivity.vue | 388 ++++++ pages/customerManager/customerManager.vue | 86 + pages/mine/activity/myActivity.vue | 465 +++++++ api/activity.js | 76 + api/userPermissions.js | 69 + pages/mine/activity/detail.vue | 318 +++++ api/customerManager.js | 0 pages/userPermissions/userPermissions.vue | 287 ++++ pages/mine/myCollect/myCollect.vue | 595 +++++++++ 13 files changed, 3,229 insertions(+), 486 deletions(-) diff --git a/api/activity.js b/api/activity.js new file mode 100644 index 0000000..1557181 --- /dev/null +++ b/api/activity.js @@ -0,0 +1,76 @@ +/** + * 娲诲姩鐩稿叧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 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(param) { + return http.request({ + url: "/lmk/activityReport", + method: Method.GET, + needToken: true, + params:param + }); +} + + + diff --git a/api/collect.js b/api/collect.js index 4a12dec..ed4b199 100644 --- a/api/collect.js +++ b/api/collect.js @@ -20,3 +20,16 @@ data: data }); } + +/** + * 鑾峰緱鎴戠殑鏀惰棌鎸変紶鍏ョ被鍨� video锛宎ctivity锛宻tore + * @param {Object} param + */ +export function getMyCollectList(param){ + return http.request({ + url: "/lmk/my-collect/getMyCollectList", + method: Method.GET, + needToken: true, + params: param + }); +} \ No newline at end of file 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..63e3d92 --- /dev/null +++ b/api/userPermissions.js @@ -0,0 +1,69 @@ +/** + * 鐢ㄦ埛鏉冮檺绠$悊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 + }) + +} + +export function restPassword(param){ + return http.request({ + url:'/lmk/lmk-user-permissions/restPassword/'+param, + method: Method.PUT, + needToken: true + }) +} \ No newline at end of file diff --git a/pages.json b/pages.json index fd6db8b..aeed599 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,92 @@ } }, { - "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", + "u-checkbox": "view", + "u-checkbox-group": "view", + "u-navbar": "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 +453,15 @@ } }, - - { - "path": "deposit/info", - "style": { - "navigationBarTitleText": "棰勫瓨娆捐鎯�" - } - }, - { + { + "path": "deposit/info", + "style": { + "navigationBarTitleText": "棰勫瓨娆捐鎯�" + + } + }, + { "path": "address/address", "style": { "enablePullDownRefresh": true, @@ -471,8 +520,8 @@ "navigationBarTitleText": "闈㈠鐧诲綍" } }, - - + + { "path": "set/securityCenter/editPassword", "style": { @@ -482,13 +531,13 @@ } } }, - + { "path": "set/securityCenter/bindMobile", "style": { "navigationBarTitleText": "缁戝畾鎵嬫満鍙�", "app-plus": { - + } } }, @@ -498,9 +547,8 @@ "style": { "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� "enablePullDownRefresh": true, - "app-plus": { - } - + "app-plus": {} + } }, { @@ -508,9 +556,8 @@ "style": { "navigationStyle": "custom", // 闅愯棌绯荤粺瀵艰埅鏍� "enablePullDownRefresh": true, - "app-plus": { - } - + "app-plus": {} + } }, { @@ -594,7 +641,7 @@ } } }, - { + { "path": "msgTips/main", "style": { "navigationBarTitleText": "娑堟伅涓績" @@ -623,6 +670,82 @@ "style": { "navigationBarTitleText": "璁㈠崟璺熻釜" } + }, { + "path": "activity/detail", + "style": { + "navigationBarTitleText": "娲诲姩璇︽儏", + "enablePullDownRefresh": true, //涓嬫媺鍒锋柊 + "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", + "u-button": "view", + "u-image": "view" + } + } + }, { + "path": "activity/myActivity", + "style": { + "navigationBarTitleText": "鎴戠殑娲诲姩", + "enablePullDownRefresh": true, //涓嬫媺鍒锋柊 + "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", + "u-button": "view", + "u-image": "view" + } + } + }, { + "path": "activity/reportActivity", + "style": { + "navigationBarTitleText": "娲诲姩", + "enablePullDownRefresh": true, //涓嬫媺鍒锋柊 + "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", + "u-button": "view", + "u-image": "view", + "u-loadmore": "view" + } + } + }, { + "path": "myCollect/myCollect", + "style": { + "navigationBarTitleText": "鎴戠殑鏀惰棌", + "enablePullDownRefresh": true, //涓嬫媺鍒锋柊 + "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", + "u-image": "view", + "u-loadmore": "view" + + } + + } } ] @@ -633,161 +756,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 - } - } - } ] @@ -842,14 +965,14 @@ "animationType": "slide-in-bottom", "scrollIndicator": "none", "safearea": { - "bottom": { - "offset": "none" - } - } + "bottom": { + "offset": "none" + } + } } } }, - + { "path": "entry/seller/index", "style": { @@ -942,53 +1065,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": "鐮嶄环璁板綍", @@ -997,18 +1120,18 @@ "u-empty": "view" } } - },{ + }, { "path": "point/detail", "style": { "navigationStyle": "custom", "navigationBarTextStyle": "white" } - },{ + }, { "path": "point/pointList", "style": { "navigationBarTitleText": "绉垎鍟嗗煄" - + } } @@ -1043,7 +1166,7 @@ "navigationBarTitleText": "浼樻儬鍒�" } }, - + { "path": "coupon/couponCenter", "style": { @@ -1085,7 +1208,7 @@ } } } - + ] }, @@ -1161,7 +1284,7 @@ "navigationBarTitleText": "璇勪环璇︽儏" } }, - + { "path": "evaluate/releaseEvaluate", "style": { @@ -1181,7 +1304,7 @@ } } }, - + { "path": "afterSales/applyProgress", "style": { @@ -1314,4 +1437,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..f2e7aa5 --- /dev/null +++ b/pages/customerManager/customerManager.vue @@ -0,0 +1,86 @@ +<template> + <view > + <!-- 鍐呭鍖哄煙 --> + <scroll-view scroll-y style="height: 100vh;" @scrolltolower="loadMore" class="user-list" + :lower-threshold="100" + > + <view > + <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="restPassword(user.memberId)" class="edit-btn">閲嶇疆瀵嗙爜</u-button> + <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> + + <!-- 鏀硅繘鐨勫姞杞芥洿澶氭彁绀� --> + <view > + <u-loadmore class="load-more" + v-if="mockData.length > 0" + :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'" + :load-text="{ + loadmore: '涓婃媺鍔犺浇鏇村', + loading: '姝e湪鍔犺浇', + nomore: '娌℃湁鏇村浜�' + }" + /> + </view> + <view style="height:150rpx"> + + </view> + </scroll-view> + + + + </view> +</template> + +<script> + 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 { + + } + }, + methods: { + + } + } +</script> + +<style> +.load-more { + padding: 20rpx 0; + text-align: center; + color: #999; + font-size: 26rpx; + background-color: #f7f8fa; + } +</style> diff --git a/pages/mine/activity/detail.vue b/pages/mine/activity/detail.vue new file mode 100644 index 0000000..fb61737 --- /dev/null +++ b/pages/mine/activity/detail.vue @@ -0,0 +1,318 @@ +<template> + <view class="container"> + <!-- 椤堕儴娴锋姤鍥� --> + <!-- 鍔ㄦ�佸皝闈㈠尯鍩� --> + <view class="cover-container"> + <!-- 鍥剧墖绫诲瀷 --> + <block v-if="activityInfo.coverType === '鍥剧墖'"> + <image :src="getUrl(activityInfo.cover)" class="activity-cover" /> + </block> + <block v-if=" activityInfo.coverType === '瑙嗛'"> + <video :src="getUrl(item.cover)" + @play="handleVideoPlay" class="activity-cover"></video> + </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 }"> + <u-button class="signup-btn" @click.stop="activityReport()" :disabled="reportBtn" >{{ reportBtn ? '宸叉姤鍚�': '绔嬪嵆鎶ュ悕'}}</u-button> + <u-button class="signup-btn" @click.stop="collect()">{{ isCollect ? '鍙栨秷鏀惰棌' : '鏀惰棌' }}</u-button> + </view> + </view> +</template> + +<script> + import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue'; + import {changeCollect} from '@/api/collect.js' + import {getFilePreviewUrl} from '@/api/common.js' + import { + getActivityDetail, + activityReport + } from '@/api/activity.js'; + export default { + components: { + UButton + }, + data() { + return { + activityInfo: { + coverType: '', + cover: '', + activityName: '', + startTime: '', // 鏃堕棿鎴� + endTime: '', + activityLocation: '', + tags: [], + activityContent: '', + activityType: '', + limitUserNum:'', + }, + isCollect:false, + reportBtn:false, + detailId: null, // 瀛樺偍鎺ユ敹鐨勫弬鏁� + reportFrom: { + activityId: '', + cancel: false, //鎶ュ悕鎺ュ彛榛樿鎴慺alse + }, + collectForm:{ + collectType:'', + refId:'', + }, + }; + }, + onLoad(options) { + // 鎺ユ敹 URL 鍙傛暟 + if (options.id) { + this.detailId = options.id; + // 鍙湪姝ゅ鍙戣捣璇锋眰锛屾牴鎹� ID 鍔犺浇璇︽儏鏁版嵁 + this.loadDetailData(); + } + }, + methods: { + collect(){ + this.collectForm.collectType = 'activity' + this.collectForm.refId = this.detailId + changeCollect(this.collectForm).then(res=>{ + if (res.statusCode === 200) { + this.isCollect = true; + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'success', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + } + }) + }, + //鎶ュ悕 + 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 // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + } + + }) + }, + getUrl(params){ + getFilePreviewUrl(params).then(res =>{ + return res.data.data + }) + }, + getActivityDetail(id) { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + getActivityDetail(id).then(res => { + uni.hideLoading(); + console.log(res.data) + 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; + this.isCollect = res.data.data.isCollect; + } + }) + }, + 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; + } + .btn-container { + display: flex; + justify-content: center; + align-items: center; + margin-top: 8px; /* 涓庝笂鏂规爣棰樹繚鎸侀棿璺� */ + } +</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..c977479 --- /dev/null +++ b/pages/mine/activity/myActivity.vue @@ -0,0 +1,465 @@ +<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 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="getUrl(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="getUrl(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="getUrl(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 {getFilePreviewUrl} 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); + } + }); + } + }) + }, + getUrl(params){ + getFilePreviewUrl(params).then(res =>{ + return res.data.data + }) + }, + 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..26f3407 --- /dev/null +++ b/pages/mine/activity/reportActivity.vue @@ -0,0 +1,388 @@ +<template> + <view class="wrapper"> + <!-- 鍐呭鍖哄煙 --> + <scroll-view scroll-y class="content" style="height: 100vh;" @scrolltolower="loadMore" + :lower-threshold="100" + > + <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="getUrl(item.cover)" mode="widthFix" class="media" + @load="imageLoad" :data-item="item" :style="{ height: item.height + 'px' }" /> + + <!-- 瑙嗛绫诲瀷 --> + <video v-if="item.type === '瑙嗛'" :src="getUrl(item.cover)" class="media" controls + :poster="item.poster" @play="handleVideoPlay" + :style="{ height: item.height + 'px' }"></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> + <!-- <view style="height: 150rpx;"></view> --> + <!-- 鏀硅繘鐨勫姞杞芥洿澶氭彁绀� --> + <view class="load-more"> + <u-loadmore + v-if="mockData.length > 0" + :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'" + :load-text="{ + loadmore: '涓婃媺鍔犺浇鏇村', + loading: '姝e湪鍔犺浇', + nomore: '娌℃湁鏇村浜�' + }" + /> + </view> + <view style="height:150rpx"> + + </view> + </scroll-view> + + + + </view> +</template> + +<script> + import { + changeCollect + } from '@/api/collect.js' + import { + getFilePreviewUrl + } from '@/api/common.js' + import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue'; + import UImage from '@/uview-components/uview-ui/components/u-image/u-image.vue'; + import ULoadmore from '@/uview-components/uview-ui/components/u-loadmore/u-loadmore.vue' + import { + getActivityReportList, + } from '@/api/activity.js'; + export default { + components: { + UImage, + UButton, + ULoadmore + }, + data() { + return { + columns: [ + [], + [] + ], // 鍙屽垪甯冨眬 + mockData: [], + colHeight: [0, 0], // 璁板綍鍚勫垪楂樺害 + baseImageHeight: 300, // 鍥剧墖鍩虹楂樺害 + baseVideoHeight: 350, // 瑙嗛鍩虹楂樺害 + baseTextHeight: 120, // 鏂囧瓧鍩虹楂樺害 + query: { + pageNumber: 1, + pageSize: 8, + }, + loading: false, // 鏄惁姝e湪鍔犺浇 + noMore: false, // 鏄惁娌℃湁鏇村鏁版嵁 + total: 0 // 鎬绘暟鎹噺 + }; + }, + onLoad() { + this.getActivityList(); + }, + methods: { + getUrl(params) { + getFilePreviewUrl(params).then(res => { + return res.data.data + }) + }, + + /** + * 涓嬫媺鍒锋柊鏃� + */ + onPullDownRefresh() { + this.query.pageNumber = 1; // 閲嶇疆椤电爜 + this.noMore = false; + this.mockData = []; // 娓呯┖鏁版嵁 + this.getActivityList(); + }, + loadMore() { + + // 鏄剧ず鍔犺浇鐘舵�� + this.loading = true; + + // 寤惰繜鎵ц璁︰I鏈夊弽搴旀椂闂� + setTimeout(() => { + this.query.pageNumber += 1; + this.getActivityList(); + }, 300); + }, + async getActivityList() { + + try { + + const res = await getActivityReportList(this.query); + this.loading = false; + if (res.statusCode === 200) { + const newData = res.data.data.map(value => ({ + id: value.id, + type: value.coverType, + cover: value.cover, + height: value.coverType === '鍥剧墖' ? this.baseImageHeight : + value.coverType === '瑙嗛' ? this.baseVideoHeight : this.baseTextHeight, + title: value.activityName, + content: value.activityContent, + poster: '', + })); + + // 鏇存柊鎬绘暟鎹噺 + this.total = res.data.total || 0; + + // 杩藉姞鎴栨浛鎹㈡暟鎹� + this.mockData = this.query.pageNumber === 1 + ? newData + : [...this.mockData, ...newData]; + + // 鍒ゆ柇鏄惁杩樻湁鏇村鏁版嵁 + this.noMore = newData.length < this.query.pageSize || + this.mockData.length >= this.total; + + // 甯冨眬鏇存柊 + this.$nextTick(() => { + this.layoutItems(); + }); + } + } catch (error) { + console.error('鍔犺浇澶辫触:', error); + // 澶辫触鏃跺洖閫�椤电爜 + if (this.query.pageNumber > 1) { + this.query.pageNumber -= 1; + } + } finally { + this.loading = false; + uni.hideLoading(); + uni.stopPullDownRefresh(); + } + }, + // 鍥剧墖鍔犺浇瀹屾垚鍥炶皟 + 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); //鑾峰緱楂樺害鏇村皬鐨� 鏀惧叆鍏冪礌 + this.colHeight[minIndex] += item.height + 40; // 40涓洪棿璺� + }); + }, + // 鍥剧墖鍔犺浇鍥炶皟 + imageLoad(e) { + const { + height, + width + } = e.detail; + const ratio = height / width; + const item = e.currentTarget.dataset.item; + + // 閲嶆柊璁$畻瀹為檯鏄剧ず楂樺害 + const viewWidth = uni.upx2px(345); // 灏唕px杞崲涓簆x + const viewHeight = viewWidth * ratio; + + // 鏇存柊item楂樺害 + item.height = viewHeight; + + // 閲嶆柊璁$畻鍒楅珮搴� + this.recalculateColumns(); + }, + // 閲嶆柊璁$畻鍒楅珮搴� + recalculateColumns() { + this.colHeight = [0, 0]; + this.columns.forEach((column, colIndex) => { + column.forEach(item => { + this.colHeight[colIndex] += item.height + 40; // 40涓洪棿璺� + }); + }); + }, + handleItemClick(item) { + console.log(item) + uni.navigateTo({ + url: `/pages/mine/activity/detail?id=${item.id}` // 鍙傛暟閫氳繃 URL 浼犻�� + }); + } + } + } +</script> + +<style lang="scss"> + /* 鏂板鍔犺浇鏇村鏍峰紡 */ + .load-more { + padding: 20rpx 0; + text-align: center; + color: #999; + font-size: 26rpx; + background-color: #f7f8fa; + } + .btn-container { + display: flex; + justify-content: center; + align-items: center; + margin-top: 8px; + /* 涓庝笂鏂规爣棰樹繚鎸侀棿璺� */ + } + + /* 鍏ㄥ眬鏍峰紡浼樺寲 */ + .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; + /* 纭繚鍙互婊氬姩 */ + -webkit-overflow-scrolling: touch; + } + + /* 鐎戝竷娴佸竷灞�浼樺寲 */ + .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..7251419 --- /dev/null +++ b/pages/mine/myCollect/myCollect.vue @@ -0,0 +1,595 @@ +<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"> + <scroll-view scroll-y class="activity-list" style="height: 100vh;" @scrolltolower="loadMore" + :lower-threshold="100"> + <view v-if="videoCollects.length > 0"> + <view v-for="(item, idx) in videoCollects" :key="idx" class="video-item"> + <!-- 瑙嗛灏侀潰+鎾斁鎸夐挳 --> + <view class="video-cover-container"> + <image :src="item.coverUrl" mode="aspectFill" class="video-cover" /> + <view class="play-icon"> + <u-icon name="play-circle-fill" size="60" color="#fff"></u-icon> + </view> + <view class="video-duration" v-if="item.duration">{{ item.duration }}</view> + </view> + + <!-- 瑙嗛淇℃伅 --> + <view class="video-info"> + <view class="video-title">{{ item.authorName || '鏈煡浣滆��' }}</view> + <view class="video-meta"> + <text class="video-weight" v-if="item.weight > 0"> + <u-icon name="thumb-up-fill" size="24" color="#999"></u-icon> + {{ item.weight }} + </text> + </view> + </view> + + <!-- 鎿嶄綔鎸夐挳 --> + <view class="video-actions"> + <button class="cancel-btn" @click.stop="handleCancelCollection(item,'video')"> + 鍙栨秷鏀惰棌 + </button> + </view> + </view> + </view> + <view v-else class="empty-tip"> + <text>鏆傛棤鏀惰棌瑙嗛</text> + </view> + <view class="load-more"> + <u-loadmore v-if="videoCollects.length > 0" + :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'" :load-text="{ + loadmore: '涓婃媺鍔犺浇鏇村', + loading: '姝e湪鍔犺浇', + nomore: '娌℃湁鏇村浜�' + }" /> + </view> + </scroll-view> + + + + </view> + + <view v-if="currentTab === 1"> + <scroll-view scroll-y class="activity-list" style="height: 100vh;" @scrolltolower="loadMore" + :lower-threshold="100"> + <view v-if="goodsCollects.length > 0"> + <view v-for="(item, idx) in goodsCollects" :key="idx" class="activity-item"> + <!-- 灏侀潰鍖哄煙 --> + <block> + <image :src="item.original" mode="aspectFill" class="activity-cover" /> + </block> + + <!-- 娲诲姩淇℃伅 --> + <view class="activity-info"> + <view class="activity-title">{{ item.goodsName }}</view> + <view class="activity-meta"> + <text class="activity-time">浠锋牸:{{ item.price }}鍏�</text> + <text class="activity-location">{{ item.storeName || '鏆傛棤' }}</text> + </view> + </view> + + <!-- 鎿嶄綔鍖哄煙 --> + <view class="action-container"> + <button class="cancel-btn" @click="handleCancelCollection(item,'goods')" + hover-class="cancel-btn-hover"> + 鍙栨秷鏀惰棌 + </button> + </view> + + </view> + </view> + <view v-else class="empty-tip"> + + <text>鏆傛棤鏀惰棌鍟嗗搧</text> + </view> + <view class="load-more"> + <u-loadmore v-if="goodsCollects.length > 0" + :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'" :load-text="{ + loadmore: '涓婃媺鍔犺浇鏇村', + loading: '姝e湪鍔犺浇', + nomore: '娌℃湁鏇村浜�' + }" /> + </view> + </scroll-view> + </view> + + <view v-if="currentTab === 2"> + <scroll-view scroll-y class="activity-list" style="height: 80vh;" @scrolltolower="loadMore" + :lower-threshold="100"> + <view v-if="activityCollects.length > 0"> + <view v-for="(item, idx) in activityCollects" :key="idx" class="activity-item"> + <!-- 灏侀潰鍖哄煙 --> + <block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'"> + <image :src="item.cover" mode="aspectFill" class="activity-cover" /> + </block> + <block v-if="item.coverType === '鏂囧瓧'"> + <view class="activity-cover text-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 }}</text> + <text class="activity-time"> {{ item.endTime }}</text> + <text class="activity-location">{{ item.activityLocation || '鏆傛棤' }}</text> + </view> + </view> + <!-- 鎿嶄綔鍖哄煙 --> + <view class="action-container"> + <button class="cancel-btn" @click="handleCancelCollection(item,'activity')" + hover-class="cancel-btn-hover"> + 鍙栨秷鏀惰棌 + </button> + </view> + + </view> + + + </view> + <view v-else class="empty-tip"> + <text>鏆傛棤鏀惰棌娲诲姩</text> + </view> + <view class="load-more"> + <u-loadmore v-if="activityCollects.length > 0" + :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'" :load-text="{ + loadmore: '涓婃媺鍔犺浇鏇村', + loading: '姝e湪鍔犺浇', + nomore: '娌℃湁鏇村浜�' + }" /> + </view> + <view style="height: 150rpx"></view> + </scroll-view> + + </view> + + + + </view> + + + </view> + +</template> + +<script> + import ULoadmore from '@/uview-components/uview-ui/components/u-loadmore/u-loadmore.vue' + import UImage from '@/uview-components/uview-ui/components/u-image/u-image.vue'; + import { + getFilePreviewUrl + } from '@/api/common.js' + import { + changeCollect, + getMyCollectList + } from '@/api/collect.js' + import { + ifError + } from 'assert' + export default { + components: { + UImage, + ULoadmore + }, + data() { + return { + total: 0, + loading: false, + noMore: { + video: false, + goods: false, + activity: false + }, + currentTab: 0, // 褰撳墠閫変腑鐨則ab绱㈠紩 + tabs: ['瑙嗛', '鍟嗗搧', '娲诲姩'], + // + videoCollects: [], // 鏀惰棌瑙嗛鍒楄〃 + goodsCollects: [], // 鏀惰棌鍟嗗搧鍒楄〃 + activityCollects: [], // 鏀惰棌娲诲姩鍒楄〃 + collectForm: { + collectType: '', + refId: '', + }, + query: { + type: 'video', + pageNumber: 1, + pageSize: 5, + } + } + }, + onLoad() { + this.currentTab = 0; + //TODO 鏈櫥褰曢渶瑕乮d锛屾祴璇曠敤鍐欐\ + this.getintit() + }, + methods: { + + /** + * 涓嬫媺鍒锋柊鏃� + */ + onPullDownRefresh() { + this.currentTab = 0; + this.query.pageNumber = 1; // 閲嶇疆椤电爜 + this.noMore = false; + this.videoCollects = []; + this.goodsCollects = []; // 鏀惰棌鍟嗗搧鍒楄〃 + this.activityCollects = []; // 鏀惰棌娲诲姩鍒楄〃// 娓呯┖鏁版嵁 + this.getintit(); + }, + loadMore() { + this.loading = true; + this.query.pageNumber += 1; + // 寤惰繜鎵ц璁︰I鏈夊弽搴旀椂闂� + setTimeout(() => { + this.query.pageNumber += 1; + this.getintit(); + }, 300); + }, + handleCancelCollection(item, type) { + console.log(item) + this.collectForm.collectType = type; + this.collectForm.refId = item.id; + changeCollect(this.collectForm).then(res => { + if (res.statusCode === 200) { + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'none', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + this.getintit(); + } + + }) + }, + getUrl(params) { + getFilePreviewUrl(params).then(res => { + return res.data.data + }) + }, + // 鍒囨崲tab + switchTab(index) { + if (this.currentTab !== index) { + this.currentTab = index + //鍒囨崲鏃堕〉鐮佸綊0 + this.query.pageNumber = 0; + // 娓呯┖鏁版嵁 + this.videoCollects = []; + this.goodsCollects = []; + this.activityCollects = []; + // 瀹為檯椤圭洰涓彲浠ュ湪杩欓噷娣诲姞鍔犺浇鏁版嵁鐨勯�昏緫 + this.getintit() + } + }, + async getintit() { + uni.showLoading({ + title: '鍔犺浇涓�' + }); + if (this.currentTab === 0) { + this.query.type = 'video'; + getMyCollectList(this.query).then(res => { + uni.hideLoading(); + this.loading = false; + + if (res.statusCode === 200) { + const newData = res.data.data + this.total = res.data.total || 0; + // 杩藉姞鎴栨浛鎹㈡暟鎹� + this.videoCollects = this.query.pageNumber === 1 ? + newData : + [...this.videoCollects, ...newData]; + // 鍒ゆ柇鏄惁杩樻湁鏇村鏁版嵁 + this.noMore = newData.length < this.query.pageSize || + this.videoCollects.length >= this.total; + + } + }) + } else if (this.currentTab === 1) { + this.query.type = 'goods'; + getMyCollectList(this.query).then(res => { + uni.hideLoading(); + this.loading = false; + if (res.statusCode === 200) { + const newData = res.data.data + this.total = res.data.total || 0; + + this.goodsCollects = this.query.pageNumber === 1 ? + newData : + [...this.goodsCollects, ...newData]; + // 鍒ゆ柇鏄惁杩樻湁鏇村鏁版嵁 + this.noMore = newData.length < this.query.pageSize || + this.goodsCollects.length >= this.total; + } + }) + } else if (this.currentTab === 2) { + this.query.type = 'activity'; + getMyCollectList(this.query).then(res => { + uni.hideLoading(); + this.loading = false; + if (res.statusCode === 200) { + const newData = res.data.data + this.total = res.data.total || 0; + + this.activityCollects = this.query.pageNumber === 1 ? + newData : + [...this.activityCollects, ...newData]; + this.noMore = newData.length < this.query.pageSize || + this.activityCollects.length >= this.total; + } + }) + } + + } + } + } +</script> + +<style lang="scss"> + .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; + } + + /* 瑙嗛鍒楄〃涓撶敤鏍峰紡 */ + .video-item { + display: flex; + padding: 24rpx 0; + border-bottom: 1rpx solid #f5f5f5; + align-items: center; + + &:last-child { + border-bottom: none; + } + } + + .video-cover-container { + position: relative; + width: 240rpx; + height: 160rpx; + border-radius: 12rpx; + overflow: hidden; + margin-right: 24rpx; + flex-shrink: 0; + + .video-cover { + width: 100%; + height: 100%; + } + + .play-icon { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + opacity: 0.9; + } + + .video-duration { + position: absolute; + right: 8rpx; + bottom: 8rpx; + background: rgba(0, 0, 0, 0.6); + color: #fff; + font-size: 20rpx; + padding: 4rpx 12rpx; + border-radius: 20rpx; + } + } + + .video-info { + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-between; + height: 160rpx; + + .video-title { + font-size: 30rpx; + color: #333; + font-weight: bold; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + } + + .video-meta { + display: flex; + justify-content: space-between; + font-size: 24rpx; + color: #999; + + + + .video-weight { + display: flex; + align-items: center; + } + } + } + + .video-actions { + margin-left: 20rpx; + flex-shrink: 0; + + .cancel-btn { + background: #f5f5f5; + color: #666; + border: none; + font-size: 24rpx; + padding: 8rpx 20rpx; + border-radius: 20rpx; + + &:active { + background: #eee; + } + } + } + + .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; + } + } + + .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..26c68da --- /dev/null +++ b/pages/userPermissions/addStoreMember.vue @@ -0,0 +1,287 @@ +<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="!form.id"> + <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..c13d57d --- /dev/null +++ b/pages/userPermissions/userPermissions.vue @@ -0,0 +1,287 @@ +<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="restPassword(user.memberId)" class="edit-btn">閲嶇疆瀵嗙爜</u-button> + <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"> + <u-loadmore + v-if="mockData.length > 0" + :status="loading ? 'loading' : noMore ? 'nomore' : 'loadmore'" + :load-text="{ + loadmore: '涓婃媺鍔犺浇鏇村', + loading: '姝e湪鍔犺浇', + nomore: '娌℃湁鏇村浜�' + }" + /> + </view> + <view style="height:150rpx"> + + </view> + </scroll-view> + + + </view> +</template> + +<script> + import { + getPage, + del, + add, + update, + restPassword + } 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: { + restPassword(id){ + restPassword(id).then(res=>{ + if(res.statusCode === 200){ + uni.showToast({ + title: res.data.msg, // 鎻愮ず鏂囧瓧 + icon: 'none', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛� + mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級 + }); + } + }) + }, + 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 0; + text-align: center; + color: #999; + font-size: 26rpx; + background-color: #f7f8fa; + } + +</style> \ No newline at end of file -- Gitblit v1.8.0