Merge branch 'dev' of http://42.193.1.25:9521/r/lmk-shop-wx into dev
| New file |
| | |
| | | /** |
| | | * 活动相关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 |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 获得我的收藏按传入类型 video,activity,store |
| | | * @param {Object} param |
| | | */ |
| | | export function getMyCollectList(param){ |
| | | return http.request({ |
| | | url: "/lmk/my-collect/getMyCollectList", |
| | | method: Method.GET, |
| | | needToken: true, |
| | | params: param |
| | | }); |
| | | } |
| New file |
| | |
| | | /** |
| | | * 用户权限管理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 |
| | | }) |
| | | } |
| | |
| | | { |
| | | "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(仅wifi下预下载) |
| | | "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(仅wifi下预下载) |
| | | "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" // 隐藏顶部导航栏 |
| | | } |
| | | }, |
| | |
| | | "navigationBarTitleText": "首页", |
| | | "navigationStyle": "custom", // 隐藏系统导航栏 |
| | | "navigationBarTextStyle": "black", |
| | | "enablePullDownRefresh":true |
| | | "enablePullDownRefresh": true |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | "path": "pages/tabbar/home/title", |
| | | "style": { |
| | |
| | | "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", |
| | |
| | | "contentAdjust": "false", |
| | | "bounce": "none", |
| | | "safearea": { |
| | | "bottom": "none" |
| | | "bottom": "none" |
| | | } |
| | | }, |
| | | "componentPlaceholder": { |
| | |
| | | "contentAdjust": "false", |
| | | "bounce": "none", |
| | | "safearea": { |
| | | "bottom": "none" |
| | | "bottom": "none" |
| | | } |
| | | }, |
| | | "componentPlaceholder": { |
| | |
| | | "contentAdjust": "false", |
| | | "bounce": "none", |
| | | "safearea": { |
| | | "bottom": "none" |
| | | "bottom": "none" |
| | | } |
| | | }, |
| | | "componentPlaceholder": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | { |
| | | "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", |
| | |
| | | } |
| | | }, |
| | | { |
| | | "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", // 必须与preloadRule中的名称完全一致 |
| | | "name": "uview-components", |
| | | "pages": [ |
| | | { |
| | | "path": "pages/empty-page/empty-page", |
| | | "style": { |
| | | "navigationBarTitleText": "", |
| | | "disableScroll": true |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | "subPackages": [{ |
| | | "root": "uview-components", // 必须与preloadRule中的名称完全一致 |
| | | "name": "uview-components", |
| | | "pages": [{ |
| | | "path": "pages/empty-page/empty-page", |
| | | "style": { |
| | | "navigationBarTitleText": "", |
| | | "disableScroll": true |
| | | } |
| | | }] |
| | | }, |
| | | { |
| | | "root": "pages/mine", |
| | | "pages": [ |
| | | |
| | | |
| | | { |
| | | "path": "signIn", |
| | | "style": { |
| | |
| | | |
| | | } |
| | | }, |
| | | |
| | | { |
| | | "path": "deposit/info", |
| | | "style": { |
| | | "navigationBarTitleText": "预存款详情" |
| | | |
| | | } |
| | | }, |
| | | { |
| | | { |
| | | "path": "deposit/info", |
| | | "style": { |
| | | "navigationBarTitleText": "预存款详情" |
| | | |
| | | } |
| | | }, |
| | | { |
| | | "path": "address/address", |
| | | "style": { |
| | | "enablePullDownRefresh": true, |
| | |
| | | "navigationBarTitleText": "面容登录" |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | "path": "set/securityCenter/editPassword", |
| | | "style": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | { |
| | | "path": "set/securityCenter/bindMobile", |
| | | "style": { |
| | | "navigationBarTitleText": "绑定手机号", |
| | | "app-plus": { |
| | | |
| | | |
| | | } |
| | | } |
| | | }, |
| | |
| | | "style": { |
| | | "navigationStyle": "custom", // 隐藏系统导航栏 |
| | | "enablePullDownRefresh": true, |
| | | "app-plus": { |
| | | } |
| | | |
| | | "app-plus": {} |
| | | |
| | | } |
| | | }, |
| | | { |
| | |
| | | "style": { |
| | | "navigationStyle": "custom", // 隐藏系统导航栏 |
| | | "enablePullDownRefresh": true, |
| | | "app-plus": { |
| | | } |
| | | |
| | | "app-plus": {} |
| | | |
| | | } |
| | | }, |
| | | { |
| | |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | { |
| | | "path": "msgTips/main", |
| | | "style": { |
| | | "navigationBarTitleText": "消息中心" |
| | |
| | | "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" |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | ] |
| | |
| | | { |
| | | "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 |
| | | } |
| | | } |
| | | } |
| | | |
| | | ] |
| | | |
| | |
| | | "animationType": "slide-in-bottom", |
| | | "scrollIndicator": "none", |
| | | "safearea": { |
| | | "bottom": { |
| | | "offset": "none" |
| | | } |
| | | } |
| | | "bottom": { |
| | | "offset": "none" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | { |
| | | "path": "entry/seller/index", |
| | | "style": { |
| | |
| | | |
| | | { |
| | | "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": "砍价记录", |
| | |
| | | "u-empty": "view" |
| | | } |
| | | } |
| | | },{ |
| | | }, { |
| | | "path": "point/detail", |
| | | "style": { |
| | | "navigationStyle": "custom", |
| | | "navigationBarTextStyle": "white" |
| | | |
| | | } |
| | | },{ |
| | | }, { |
| | | "path": "point/pointList", |
| | | "style": { |
| | | "navigationBarTitleText": "积分商城" |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | "navigationBarTitleText": "优惠券" |
| | | } |
| | | }, |
| | | |
| | | |
| | | { |
| | | "path": "coupon/couponCenter", |
| | | "style": { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | ] |
| | | |
| | | }, |
| | |
| | | "navigationBarTitleText": "评价详情" |
| | | } |
| | | }, |
| | | |
| | | |
| | | { |
| | | "path": "evaluate/releaseEvaluate", |
| | | "style": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | { |
| | | "path": "afterSales/applyProgress", |
| | | "style": { |
| | |
| | | // "query": "" //启动参数,在页面的onLoad函数里面得到 |
| | | // }] |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <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: '正在加载', |
| | | 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> |
| New file |
| | |
| | | <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, //报名接口默认我false |
| | | }, |
| | | 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', // 图标类型(success/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', // 图标类型(success/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> |
| New file |
| | |
| | | <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, // 当前选中的tab索引 |
| | | 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> |
| New file |
| | |
| | | <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: '正在加载', |
| | | 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, // 是否正在加载 |
| | | 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; |
| | | |
| | | // 延迟执行让UI有反应时间 |
| | | 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); // 将rpx转换为px |
| | | 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> |
| New file |
| | |
| | | <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: '正在加载', |
| | | 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: '正在加载', |
| | | 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: '正在加载', |
| | | 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, // 当前选中的tab索引 |
| | | tabs: ['视频', '商品', '活动'], |
| | | // |
| | | videoCollects: [], // 收藏视频列表 |
| | | goodsCollects: [], // 收藏商品列表 |
| | | activityCollects: [], // 收藏活动列表 |
| | | collectForm: { |
| | | collectType: '', |
| | | refId: '', |
| | | }, |
| | | query: { |
| | | type: 'video', |
| | | pageNumber: 1, |
| | | pageSize: 5, |
| | | } |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.currentTab = 0; |
| | | //TODO 未登录需要id,测试用写死\ |
| | | 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; |
| | | // 延迟执行让UI有反应时间 |
| | | 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', // 图标类型(success/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> |
| | |
| | | <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: "您的信息正在审核", |
| | | 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: "您的信息正在审核", |
| | | 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> |
| New file |
| | |
| | | <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; |
| | | // 解析角色数组 |
| | | 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', // 图标类型(success/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', // 图标类型(success/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> |
| New file |
| | |
| | | <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: '正在加载', |
| | | 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', // 图标类型(success/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> |