diff --git a/apis/interfaces/coupons.js b/apis/interfaces/coupons.js index 11ac44a..483d47d 100644 --- a/apis/interfaces/coupons.js +++ b/apis/interfaces/coupons.js @@ -56,11 +56,20 @@ const magCouponsRecommend = id => { }) } +// 优惠券删除 +const magCouponsDel = (coupon_id) => { + return request({ + url: 'coupons/tools/coupons/' + coupon_id, + method: 'DELETE' + }) +} + export { toolsCoupons, pushCoupons, couponsGoods, magCouponsInfo, magCouponsStatus, - magCouponsRecommend + magCouponsRecommend, + magCouponsDel } diff --git a/apis/interfaces/user.js b/apis/interfaces/user.js index 068aca7..ace7b25 100644 --- a/apis/interfaces/user.js +++ b/apis/interfaces/user.js @@ -58,6 +58,37 @@ const userPartne = (data) => { }) } +// 我的优惠券 +const userCoupon = (data) => { + return request({ + url: 'coupons/user/coupons', + data: data + }) +} + +// 我的优惠券-详情 +const couponsInfo = (coupon_grant_id) => { + return request({ + url: 'coupons/user/coupons/' + coupon_grant_id + }) +} + +// 我的优惠券-二维码 +const getQrcodeByGrantId = (data) => { + return request({ + url: 'coupons/user/coupons/qrcode', + data: data + }) +} + +// 我的优惠券-列表 +const userCouponList = (coupon_id, data) => { + return request({ + url: 'coupons/user/coupons/' + coupon_id + '/list', + data: data + }) +} + export { userIndex, userNotice, @@ -65,5 +96,9 @@ export { userHelp, userClause, userInvite, - userPartne + userPartne, + userCoupon, + couponsInfo, + getQrcodeByGrantId, + userCouponList } diff --git a/manifest.json b/manifest.json index 559b190..d365630 100644 --- a/manifest.json +++ b/manifest.json @@ -174,7 +174,12 @@ "uniStatistics" : { "enable" : false }, - "vueVersion" : "2" + "vueVersion" : "2", + "h5" : { + "router" : { + "mode" : "history" + } + } } /* SDK配置 */ diff --git a/node_modules/vuex/package.json b/node_modules/vuex/package.json index e3ddae5..68172f6 100644 --- a/node_modules/vuex/package.json +++ b/node_modules/vuex/package.json @@ -1,37 +1,59 @@ { - "_from": "vuex", - "_id": "vuex@3.6.2", - "_inBundle": false, - "_integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==", - "_location": "/vuex", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "vuex", - "name": "vuex", - "escapedName": "vuex", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" + "name": "vuex", + "version": "3.6.2", + "description": "state management for Vue.js", + "main": "dist/vuex.common.js", + "exports": { + ".": { + "module": "./dist/vuex.esm.js", + "require": "./dist/vuex.common.js", + "import": "./dist/vuex.mjs" + }, + "./": "./" }, - "_requiredBy": [ - "#USER", - "/" + "module": "dist/vuex.esm.js", + "unpkg": "dist/vuex.js", + "jsdelivr": "dist/vuex.js", + "typings": "types/index.d.ts", + "sideEffects": false, + "files": [ + "dist", + "types/index.d.ts", + "types/helpers.d.ts", + "types/logger.d.ts", + "types/vue.d.ts" ], - "_resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", - "_shasum": "236bc086a870c3ae79946f107f16de59d5895e71", - "_spec": "vuex", - "_where": "/Users/WebTmm/Desktop/BlockChainH5", - "author": { - "name": "Evan You" + "scripts": { + "dev": "node examples/server.js", + "build": "npm run build:main && npm run build:logger", + "build:main": "node scripts/build-main.js", + "build:logger": "node scripts/build-logger.js", + "lint": "eslint src test", + "test": "npm run lint && npm run test:types && npm run test:unit && npm run test:ssr && npm run test:e2e && npm run test:esm", + "test:unit": "jest --testPathIgnorePatterns test/e2e", + "test:e2e": "start-server-and-test dev http://localhost:8080 \"jest --testPathIgnorePatterns test/unit\"", + "test:ssr": "cross-env VUE_ENV=server jest --testPathIgnorePatterns test/e2e", + "test:types": "tsc -p types/test", + "test:esm": "node test/esm/esm-test.js", + "coverage": "jest --testPathIgnorePatterns test/e2e --coverage", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "release": "node scripts/release.js", + "docs": "vuepress dev docs", + "docs:build": "vuepress build docs" }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/vuex.git" + }, + "author": "Evan You", + "license": "MIT", "bugs": { "url": "https://github.com/vuejs/vuex/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "state management for Vue.js", + "homepage": "https://github.com/vuejs/vuex#readme", + "peerDependencies": { + "vue": "^2.0.0" + }, "devDependencies": { "@babel/core": "^7.12.10", "@babel/preset-env": "^7.12.11", @@ -70,55 +92,9 @@ "webpack": "^4.43.0", "webpack-dev-middleware": "^3.7.2", "webpack-hot-middleware": "^2.25.0" - }, - "exports": { - ".": { - "module": "./dist/vuex.esm.js", - "require": "./dist/vuex.common.js", - "import": "./dist/vuex.mjs" - }, - "./": "./" - }, - "files": [ - "dist", - "types/index.d.ts", - "types/helpers.d.ts", - "types/logger.d.ts", - "types/vue.d.ts" - ], - "homepage": "https://github.com/vuejs/vuex#readme", - "jsdelivr": "dist/vuex.js", - "license": "MIT", - "main": "dist/vuex.common.js", - "module": "dist/vuex.esm.js", - "name": "vuex", - "peerDependencies": { - "vue": "^2.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vuejs/vuex.git" - }, - "scripts": { - "build": "npm run build:main && npm run build:logger", - "build:logger": "node scripts/build-logger.js", - "build:main": "node scripts/build-main.js", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", - "coverage": "jest --testPathIgnorePatterns test/e2e --coverage", - "dev": "node examples/server.js", - "docs": "vuepress dev docs", - "docs:build": "vuepress build docs", - "lint": "eslint src test", - "release": "node scripts/release.js", - "test": "npm run lint && npm run test:types && npm run test:unit && npm run test:ssr && npm run test:e2e && npm run test:esm", - "test:e2e": "start-server-and-test dev http://localhost:8080 \"jest --testPathIgnorePatterns test/unit\"", - "test:esm": "node test/esm/esm-test.js", - "test:ssr": "cross-env VUE_ENV=server jest --testPathIgnorePatterns test/e2e", - "test:types": "tsc -p types/test", - "test:unit": "jest --testPathIgnorePatterns test/e2e" - }, - "sideEffects": false, - "typings": "types/index.d.ts", - "unpkg": "dist/vuex.js", - "version": "3.6.2" -} + } + +,"_resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz" +,"_integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==" +,"_from": "vuex@^3.6.2" +} \ No newline at end of file diff --git a/pages.json b/pages.json index ca5dd1e..890314c 100644 --- a/pages.json +++ b/pages.json @@ -303,6 +303,27 @@ "style": { "navigationBarTitleText": "关注公众号" } + }, { + "path": "pages/user/coupons", + "name": "myCoupons", + "auth": true, + "style": { + "navigationBarTitleText": "我的优惠券" + } + }, { + "path": "pages/user/couponsDte", + "name": "myCouponsDte", + "auth": true, + "style": { + "navigationBarTitleText": "我的优惠券" + } + }, { + "path": "pages/user/couponsList", + "name": "myCouponsList", + "auth": true, + "style": { + "navigationBarTitleText": "我的优惠券" + } }, { "path": "pages/vip/vip", "name": "vipIndex", diff --git a/pages/coupons/magDetails.vue b/pages/coupons/magDetails.vue index efbd3de..bd4e0b3 100644 --- a/pages/coupons/magDetails.vue +++ b/pages/coupons/magDetails.vue @@ -27,8 +27,8 @@ {{details.quantity}} - 已发放量 - {{details.grant_quantity}} + 已使用/已领取 + {{details.used_quantity}}/{{details.grant_quantity}} 每人限领 @@ -69,6 +69,11 @@ {{details.description || '-'}} + + + 删除优惠券 + + @@ -76,7 +81,7 @@ {{details.status.value == 4 ? '上架': '下架'}} - {{recommended ? '设为推荐': '已设为推荐'}} + {{recommended ? '设为推荐': '已设为推荐'}} @@ -84,7 +89,7 @@ @@ -164,6 +196,12 @@ border: none; } } + .item-btn { + color: #eca824; + &.active { + color: #9d9d9d; + } + } } } .details{ @@ -244,6 +282,18 @@ color: $text-gray; padding-top: $padding/3; } + .mian-del { + text-align: right; + width: 100%; + color: red; + padding-top: 20rpx; + .mian-del-btn { + padding: 10rpx 30rpx; + border-radius: 10rpx; + display: inline-block; + border: 2rpx #f3bbbb solid; + } + } .mian-goods{ padding-bottom: $padding; .item{ diff --git a/pages/coupons/management.vue b/pages/coupons/management.vue index 44b5bd5..424ad91 100644 --- a/pages/coupons/management.vue +++ b/pages/coupons/management.vue @@ -2,18 +2,18 @@ - 全部 - 服务券 - 代金券 - 提货券 - - - 全部 - 已上架 - 已下架 - 即将过期 - 已过期 + 全部 ({{ counts.all}}) + 服务券 ({{ counts.service}}) + 代金券 ({{ counts.reduction}}) + 提货券 ({{ counts.exchange}}) + + 全部 ({{ statusCount.all}}) + 已上架 ({{ statusCount.shown}}) + 已下架 ({{ statusCount.unshown}}) + 即将过期 ({{ statusCount.expire}}) + 已过期 ({{ statusCount.over}}) + @@ -36,6 +36,7 @@ {{item.goods_count}}商品可用 + @@ -55,6 +56,8 @@ export default { data() { return { + counts: '', + statusCount: '', listType: '', tabsType: '', coupons : [], @@ -86,8 +89,10 @@ type : this.listType, status : this.tabsType }).then(res => { - this.coupons = res.lists.data - this.pages = res.lists.page + this.coupons = res.lists.data + this.counts = res.type_count + this.statusCount = res.status_count + this.pages = res.lists.page }).catch(err => { uni.showToast({ title: err.message, @@ -126,9 +131,15 @@ // 类型 .tabs-type{ display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + box-sizing: border-box; + white-space: nowrap; padding: 20rpx 30rpx; background: white; .item{ + display: inline-block; font-size: $title-size-sm; height: 46rpx; line-height: 46rpx; @@ -163,6 +174,14 @@ justify-content: space-between; flex-wrap: wrap; padding: $padding 70rpx $padding 0; + .coupons-tips { + position: absolute; + top: 20rpx; + right: 20rpx; + width: 94rpx; + height: 94rpx; + z-index: 9; + } .item{ position: relative; padding: 0 $padding; diff --git a/pages/found/index.vue b/pages/found/index.vue index dc6bd12..324a282 100644 --- a/pages/found/index.vue +++ b/pages/found/index.vue @@ -39,7 +39,7 @@ - 再签到{{ sign.nextTask.day }}天额外赠送{{ sign.nextTask.diff }}个贡献值 + 再签到{{ sign.nextTask.diff }}天额外赠送{{ sign.nextTask.crystal }}个贡献值 @@ -64,9 +64,12 @@ @click="JumpUrl(item.url, item.title, item.is_finish)"> {{item.title}} - {{item.remark}} - {{item.is_finish ? '已完成' : item.tips}} - {{item.sub_title}} + + + {{item.is_finish ? '已完成' : item.tips}} + /人 + @@ -145,11 +148,11 @@ }, // 贡献值提示信息 - showHelp() { + showHelp(title, val) { uni.showModal({ - title: '贡献值', + title: title, confirmColor: '#8b64fd', - content: this.energyShard.description, + content: val, showCancel: false }) }, @@ -468,6 +471,11 @@ height: 34rpx; margin: 24rpx 0 0 20rpx; } + .task-label-img { + width: 24rpx; + height: 24rpx; + margin: 28rpx 0 0 8rpx; + } } } } diff --git a/pages/user/coupons.vue b/pages/user/coupons.vue new file mode 100644 index 0000000..6e129f3 --- /dev/null +++ b/pages/user/coupons.vue @@ -0,0 +1,324 @@ + + + + + + diff --git a/pages/user/couponsDte.vue b/pages/user/couponsDte.vue new file mode 100644 index 0000000..39faf74 --- /dev/null +++ b/pages/user/couponsDte.vue @@ -0,0 +1,312 @@ + + + + + diff --git a/pages/user/couponsList.vue b/pages/user/couponsList.vue new file mode 100644 index 0000000..0c0e3ae --- /dev/null +++ b/pages/user/couponsList.vue @@ -0,0 +1,236 @@ + + + + + diff --git a/pages/user/index.vue b/pages/user/index.vue index bb441d1..c001645 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -263,6 +263,10 @@ 我的服务 + + + 我的优惠券 + 专属客服 diff --git a/static/imgs/coupon_tips_00.png b/static/imgs/coupon_tips_00.png new file mode 100644 index 0000000..a8269ca Binary files /dev/null and b/static/imgs/coupon_tips_00.png differ diff --git a/static/imgs/coupon_tips_01.png b/static/imgs/coupon_tips_01.png new file mode 100644 index 0000000..321e9d9 Binary files /dev/null and b/static/imgs/coupon_tips_01.png differ diff --git a/static/user/userServe-05.png b/static/user/userServe-05.png new file mode 100644 index 0000000..b05f980 Binary files /dev/null and b/static/user/userServe-05.png differ