Compare commits
3 Commits
eba5f59956
...
33368111c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33368111c0 | ||
|
|
4bc4b07628 | ||
|
|
324193a919 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,8 @@
|
|||||||
unpackage
|
unpackage
|
||||||
unpackage/*
|
unpackage/*
|
||||||
|
<<<<<<< HEAD
|
||||||
node_modules
|
node_modules
|
||||||
|
unpackage/*/**
|
||||||
|
=======
|
||||||
|
node_modules
|
||||||
|
>>>>>>> eba5f5995696e08f67df615fb32054bffa94ae34
|
||||||
|
|||||||
@@ -56,11 +56,20 @@ const magCouponsRecommend = id => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 优惠券删除
|
||||||
|
const magCouponsDel = (coupon_id) => {
|
||||||
|
return request({
|
||||||
|
url: 'coupons/tools/coupons/' + coupon_id,
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
toolsCoupons,
|
toolsCoupons,
|
||||||
pushCoupons,
|
pushCoupons,
|
||||||
couponsGoods,
|
couponsGoods,
|
||||||
magCouponsInfo,
|
magCouponsInfo,
|
||||||
magCouponsStatus,
|
magCouponsStatus,
|
||||||
magCouponsRecommend
|
magCouponsRecommend,
|
||||||
|
magCouponsDel
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
export {
|
||||||
userIndex,
|
userIndex,
|
||||||
userNotice,
|
userNotice,
|
||||||
@@ -65,5 +96,9 @@ export {
|
|||||||
userHelp,
|
userHelp,
|
||||||
userClause,
|
userClause,
|
||||||
userInvite,
|
userInvite,
|
||||||
userPartne
|
userPartne,
|
||||||
|
userCoupon,
|
||||||
|
couponsInfo,
|
||||||
|
getQrcodeByGrantId,
|
||||||
|
userCouponList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,12 @@
|
|||||||
"uniStatistics" : {
|
"uniStatistics" : {
|
||||||
"enable" : false
|
"enable" : false
|
||||||
},
|
},
|
||||||
"vueVersion" : "2"
|
"vueVersion" : "2",
|
||||||
|
"h5" : {
|
||||||
|
"router" : {
|
||||||
|
"mode" : "history"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
|
|
||||||
|
|||||||
132
node_modules/vuex/package.json
generated
vendored
132
node_modules/vuex/package.json
generated
vendored
@@ -1,37 +1,59 @@
|
|||||||
{
|
{
|
||||||
"_from": "vuex",
|
"name": "vuex",
|
||||||
"_id": "vuex@3.6.2",
|
"version": "3.6.2",
|
||||||
"_inBundle": false,
|
"description": "state management for Vue.js",
|
||||||
"_integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
|
"main": "dist/vuex.common.js",
|
||||||
"_location": "/vuex",
|
"exports": {
|
||||||
"_phantomChildren": {},
|
".": {
|
||||||
"_requested": {
|
"module": "./dist/vuex.esm.js",
|
||||||
"type": "tag",
|
"require": "./dist/vuex.common.js",
|
||||||
"registry": true,
|
"import": "./dist/vuex.mjs"
|
||||||
"raw": "vuex",
|
},
|
||||||
"name": "vuex",
|
"./": "./"
|
||||||
"escapedName": "vuex",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"module": "dist/vuex.esm.js",
|
||||||
"#USER",
|
"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",
|
"scripts": {
|
||||||
"_shasum": "236bc086a870c3ae79946f107f16de59d5895e71",
|
"dev": "node examples/server.js",
|
||||||
"_spec": "vuex",
|
"build": "npm run build:main && npm run build:logger",
|
||||||
"_where": "/Users/WebTmm/Desktop/BlockChainH5",
|
"build:main": "node scripts/build-main.js",
|
||||||
"author": {
|
"build:logger": "node scripts/build-logger.js",
|
||||||
"name": "Evan You"
|
"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": {
|
"bugs": {
|
||||||
"url": "https://github.com/vuejs/vuex/issues"
|
"url": "https://github.com/vuejs/vuex/issues"
|
||||||
},
|
},
|
||||||
"bundleDependencies": false,
|
"homepage": "https://github.com/vuejs/vuex#readme",
|
||||||
"deprecated": false,
|
"peerDependencies": {
|
||||||
"description": "state management for Vue.js",
|
"vue": "^2.0.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.12.10",
|
"@babel/core": "^7.12.10",
|
||||||
"@babel/preset-env": "^7.12.11",
|
"@babel/preset-env": "^7.12.11",
|
||||||
@@ -70,55 +92,9 @@
|
|||||||
"webpack": "^4.43.0",
|
"webpack": "^4.43.0",
|
||||||
"webpack-dev-middleware": "^3.7.2",
|
"webpack-dev-middleware": "^3.7.2",
|
||||||
"webpack-hot-middleware": "^2.25.0"
|
"webpack-hot-middleware": "^2.25.0"
|
||||||
},
|
}
|
||||||
"exports": {
|
|
||||||
".": {
|
,"_resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz"
|
||||||
"module": "./dist/vuex.esm.js",
|
,"_integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
|
||||||
"require": "./dist/vuex.common.js",
|
,"_from": "vuex@^3.6.2"
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
21
pages.json
21
pages.json
@@ -291,6 +291,27 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "帮助中心"
|
"navigationBarTitleText": "帮助中心"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/user/coupons",
|
||||||
|
"name": "myCoupons",
|
||||||
|
"auth": true,
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的优惠券"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/user/couponsList",
|
||||||
|
"name": "myCouponsList",
|
||||||
|
"auth": true,
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的优惠券"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/user/couponsDte",
|
||||||
|
"name": "myCouponsDte",
|
||||||
|
"auth": true,
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的优惠券"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/user/partner",
|
"path": "pages/user/partner",
|
||||||
"name": "userPartner",
|
"name": "userPartner",
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
<view class="info-item-text">{{details.quantity}}</view>
|
<view class="info-item-text">{{details.quantity}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<view class="info-item-title">已发放量</view>
|
<view class="info-item-title">已使用/已领取</view>
|
||||||
<view class="info-item-text">{{details.grant_quantity}}</view>
|
<view class="info-item-text">{{details.used_quantity}}/{{details.grant_quantity}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-item">
|
<view class="info-item">
|
||||||
<view class="info-item-title">每人限领</view>
|
<view class="info-item-title">每人限领</view>
|
||||||
@@ -69,6 +69,11 @@
|
|||||||
<view class="mian-text">
|
<view class="mian-text">
|
||||||
<text>{{details.description || '-'}}</text>
|
<text>{{details.description || '-'}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="mian-del" v-if="details.can">
|
||||||
|
<view class="mian-del-btn" v-if="details.can.delete" @click="mianDel(details.coupon_id)">
|
||||||
|
删除优惠券
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ios-bottom"></view>
|
<view class="ios-bottom"></view>
|
||||||
@@ -76,7 +81,7 @@
|
|||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view class="footer-flex">
|
<view class="footer-flex">
|
||||||
<view class="item" @click="putStatus">{{details.status.value == 4 ? '上架': '下架'}}</view>
|
<view class="item" @click="putStatus">{{details.status.value == 4 ? '上架': '下架'}}</view>
|
||||||
<view class="item" @click="onCouponsRecommend">{{recommended ? '设为推荐': '已设为推荐'}}</view>
|
<view class="item item-btn" @click="onCouponsRecommend" :class="{active: !recommended}">{{recommended ? '设为推荐': '已设为推荐'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ios-bottom"></view>
|
<view class="ios-bottom"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -84,7 +89,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { magCouponsInfo, magCouponsStatus, magCouponsRecommend } from '@/apis/interfaces/coupons'
|
import { magCouponsInfo, magCouponsStatus, magCouponsRecommend, magCouponsDel } from '@/apis/interfaces/coupons'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -130,7 +135,34 @@
|
|||||||
icon : 'none'
|
icon : 'none'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
|
||||||
|
mianDel(id){
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否删除此优惠券',
|
||||||
|
cancelColor: '#555',
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmColor: '#8b64fd',
|
||||||
|
confirmText: '确定',
|
||||||
|
success: res => {
|
||||||
|
if (res.confirm) {
|
||||||
|
magCouponsDel(id).then(res => {
|
||||||
|
this.$Router.push({name: 'couponsManagement'})
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -164,6 +196,12 @@
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.item-btn {
|
||||||
|
color: #eca824;
|
||||||
|
&.active {
|
||||||
|
color: #9d9d9d;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.details{
|
.details{
|
||||||
@@ -244,6 +282,18 @@
|
|||||||
color: $text-gray;
|
color: $text-gray;
|
||||||
padding-top: $padding/3;
|
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{
|
.mian-goods{
|
||||||
padding-bottom: $padding;
|
padding-bottom: $padding;
|
||||||
.item{
|
.item{
|
||||||
|
|||||||
@@ -2,18 +2,18 @@
|
|||||||
<view class="basics-content">
|
<view class="basics-content">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
<view class="item" :class="{'show': listType == ''}" @click="onTabs('')">全部</view>
|
<view class="item" :class="{'show': listType == ''}" @click="onTabs('')">全部 <block v-if="counts.all != 0">({{ counts.all}})</block></view>
|
||||||
<view class="item" :class="{'show': listType == '1'}" @click="onTabs('1')">服务券</view>
|
<view class="item" :class="{'show': listType == '1'}" @click="onTabs('1')">服务券 <block v-if="counts.service != 0">({{ counts.service}})</block></view>
|
||||||
<view class="item" :class="{'show': listType == '2'}" @click="onTabs('2')">代金券</view>
|
<view class="item" :class="{'show': listType == '2'}" @click="onTabs('2')">代金券 <block v-if="counts.reduction != 0">({{ counts.reduction}})</block></view>
|
||||||
<view class="item" :class="{'show': listType == '3'}" @click="onTabs('3')">提货券</view>
|
<view class="item" :class="{'show': listType == '3'}" @click="onTabs('3')">提货券 <block v-if="counts.exchange != 0">({{ counts.exchange}})</block></view>
|
||||||
</view>
|
|
||||||
<view class="tabs-type">
|
|
||||||
<view class="item" :class="{'show': tabsType == ''}" @click="onTabsType('')">全部</view>
|
|
||||||
<view class="item" :class="{'show': tabsType == 'shown'}" @click="onTabsType('shown')">已上架</view>
|
|
||||||
<view class="item" :class="{'show': tabsType == 'unshown'}" @click="onTabsType('unshown')">已下架</view>
|
|
||||||
<view class="item" :class="{'show': tabsType == 'expire'}" @click="onTabsType('expire')">即将过期</view>
|
|
||||||
<view class="item" :class="{'show': tabsType == 'over'}" @click="onTabsType('over')">已过期</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<scroll-view class="tabs-type" scroll-x="true" scroll-with-animation="true">
|
||||||
|
<view class="item" :class="{'show': tabsType == ''}" @click="onTabsType('')">全部 <block v-if="statusCount.all != 0">({{ statusCount.all}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == 'shown'}" @click="onTabsType('shown')">已上架 <block v-if="statusCount.shown != 0">({{ statusCount.shown}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == 'unshown'}" @click="onTabsType('unshown')">已下架 <block v-if="statusCount.unshown != 0">({{ statusCount.unshown}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == 'expire'}" @click="onTabsType('expire')">即将过期 <block v-if="statusCount.expire != 0">({{ statusCount.expire}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == 'over'}" @click="onTabsType('over')">已过期 <block v-if="statusCount.over != 0">({{ statusCount.over}})</block></view>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="coupons.length > 0">
|
<block v-if="coupons.length > 0">
|
||||||
<view class="coupons">
|
<view class="coupons">
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
<text>{{item.goods_count}}商品可用</text>
|
<text>{{item.goods_count}}商品可用</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<image class="coupons-tips" :src="item.status_remark" mode="aspectFill"></image>
|
||||||
<view class="arrowright">
|
<view class="arrowright">
|
||||||
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@@ -55,6 +56,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
counts: '',
|
||||||
|
statusCount: '',
|
||||||
listType: '',
|
listType: '',
|
||||||
tabsType: '',
|
tabsType: '',
|
||||||
coupons : [],
|
coupons : [],
|
||||||
@@ -86,8 +89,10 @@
|
|||||||
type : this.listType,
|
type : this.listType,
|
||||||
status : this.tabsType
|
status : this.tabsType
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.coupons = res.lists.data
|
this.coupons = res.lists.data
|
||||||
this.pages = res.lists.page
|
this.counts = res.type_count
|
||||||
|
this.statusCount = res.status_count
|
||||||
|
this.pages = res.lists.page
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
@@ -126,9 +131,15 @@
|
|||||||
// 类型
|
// 类型
|
||||||
.tabs-type{
|
.tabs-type{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
box-sizing: border-box;
|
||||||
|
white-space: nowrap;
|
||||||
padding: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
background: white;
|
background: white;
|
||||||
.item{
|
.item{
|
||||||
|
display: inline-block;
|
||||||
font-size: $title-size-sm;
|
font-size: $title-size-sm;
|
||||||
height: 46rpx;
|
height: 46rpx;
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
@@ -163,6 +174,14 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding: $padding 70rpx $padding 0;
|
padding: $padding 70rpx $padding 0;
|
||||||
|
.coupons-tips {
|
||||||
|
position: absolute;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
width: 94rpx;
|
||||||
|
height: 94rpx;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
.item{
|
.item{
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 $padding;
|
padding: 0 $padding;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sign-record">再签到{{ sign.nextTask.day }}天额外赠送{{ sign.nextTask.diff }}个贡献值</view>
|
<view class="sign-record">再签到{{ sign.nextTask.diff }}天额外赠送{{ sign.nextTask.crystal }}个贡献值</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="signBtn">
|
<view class="signBtn">
|
||||||
<block v-if="sign.signCan">
|
<block v-if="sign.signCan">
|
||||||
@@ -64,9 +64,12 @@
|
|||||||
@click="JumpUrl(item.url, item.title, item.is_finish)">
|
@click="JumpUrl(item.url, item.title, item.is_finish)">
|
||||||
<image class="task-icon" :src="item.ico" mode="aspectFill"></image>
|
<image class="task-icon" :src="item.ico" mode="aspectFill"></image>
|
||||||
<view class="task-title">{{item.title}}</view>
|
<view class="task-title">{{item.title}}</view>
|
||||||
<view class="task-subtitle">{{item.remark}}</view>
|
<view class="task-subtitle">{{item.sub_title}}</view>
|
||||||
<view class="task-label" :class="{'active' : item.is_finish}">{{item.is_finish ? '已完成' : item.tips}}
|
<view class="task-label" :class="{'active' : item.is_finish}">
|
||||||
<image @click.stop="showHelp" class="task-label-icon"
|
<image v-if="!item.is_finish" class="task-label-img" src="/static/icons/crystal-icon.png" mode="widthFix" />
|
||||||
|
{{item.is_finish ? '已完成' : item.tips}}
|
||||||
|
<block v-if="!item.is_finish">/人</block>
|
||||||
|
<image @click.stop="showHelp(item.title, item.remark)" class="task-label-icon"
|
||||||
src="@/static/imgs/user-crystalMark-grey.png"></image>
|
src="@/static/imgs/user-crystalMark-grey.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -145,11 +148,11 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 贡献值提示信息
|
// 贡献值提示信息
|
||||||
showHelp() {
|
showHelp(title, val) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '贡献值',
|
title: title,
|
||||||
confirmColor: '#8b64fd',
|
confirmColor: '#8b64fd',
|
||||||
content: this.energyShard.description,
|
content: val,
|
||||||
showCancel: false
|
showCancel: false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -468,6 +471,11 @@
|
|||||||
height: 34rpx;
|
height: 34rpx;
|
||||||
margin: 24rpx 0 0 20rpx;
|
margin: 24rpx 0 0 20rpx;
|
||||||
}
|
}
|
||||||
|
.task-label-img {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
margin: 28rpx 0 0 8rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
config.appendPadding = [10, 30, 10, 15]
|
config.appendPadding = [10, 30, 10, 15]
|
||||||
const chart = new F2.Chart(config);
|
const chart = new F2.Chart(config);
|
||||||
@@ -31,4 +32,39 @@ chart.line()
|
|||||||
return 'line';
|
return 'line';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
=======
|
||||||
|
|
||||||
|
config.appendPadding = [10, 30, 10, 15]
|
||||||
|
const chart = new F2.Chart(config);
|
||||||
|
chart.source(data, {
|
||||||
|
date: {
|
||||||
|
range: [0, 1],
|
||||||
|
type: 'timeCat',
|
||||||
|
mask: 'MM-DD'
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
tickCount: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
chart.legend({
|
||||||
|
position: 'bottom',
|
||||||
|
offsetY: 0,
|
||||||
|
offsetX: 30
|
||||||
|
});
|
||||||
|
chart.area()
|
||||||
|
.position('date*value')
|
||||||
|
.color('name', ['#5881d3', '#ca66e0'])
|
||||||
|
.shape('smooth')
|
||||||
|
chart.line()
|
||||||
|
.position('date*value')
|
||||||
|
.color('name', ['#5881d3', '#ca66e0'])
|
||||||
|
.shape('smooth', name => {
|
||||||
|
if (name === '预期收益率') {
|
||||||
|
return 'line';
|
||||||
|
}
|
||||||
|
if (name === '实际收益率') {
|
||||||
|
return 'line';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
>>>>>>> eba5f5995696e08f67df615fb32054bffa94ae34
|
||||||
chart.render();
|
chart.render();
|
||||||
324
pages/user/coupons.vue
Normal file
324
pages/user/coupons.vue
Normal file
@@ -0,0 +1,324 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 优惠券分类 -->
|
||||||
|
<view class="header">
|
||||||
|
<view class="tabs">
|
||||||
|
<view class="item" :class="{'show': tabsType == ''}" @click="onTabs('')">全部 <block v-if="counts.all != 0">({{ counts.all}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == '1'}" @click="onTabs('1')">服务券 <block v-if="counts.services != 0">({{ counts.services}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == '2'}" @click="onTabs('2')">代金券 <block v-if="counts.reductions != 0">({{ counts.reductions}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsType == '3'}" @click="onTabs('3')">提货券 <block v-if="counts.exchanges != 0">({{ counts.exchanges}})</block></view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="tabs-type" scroll-x="true" scroll-with-animation="true">
|
||||||
|
<view class="item" :class="{'show': tabsStatus == ''}" @click="onTabsType('')">全部 <block v-if="statusCount.all != 0">({{ statusCount.all}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsStatus == '1'}" @click="onTabsType('1')">未使用 <block v-if="statusCount.unused != 0">({{ statusCount.unused}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsStatus == '2'}" @click="onTabsType('2')">已使用 <block v-if="statusCount.used != 0">({{ statusCount.used}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsTime == 'expire'}" @click="onTabsTime('expire')">即将到期 <block v-if="statusCount.expire != 0">({{ statusCount.expire}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsTime == 'new'}" @click="onTabsTime('new')">新到 <block v-if="statusCount.new != 0">({{ statusCount.new}})</block></view>
|
||||||
|
<view class="item" :class="{'show': tabsStatus == '3'}" @click="onTabsType('3')">已过期 <block v-if="statusCount.over != 0">({{ statusCount.over}})</block></view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="couponsMargin" v-if="coupons.length > 0">
|
||||||
|
<view class="coupons" v-for="(item, index) in coupons" :key="index" @click="$Router.push({name: 'myCouponsDte', params: {couponId: item.coupon_grant_id}})">
|
||||||
|
<view class="coupons-flex" :class="{active : item.coupon_count > 1}">
|
||||||
|
<view class="item cover" v-if="item.type.value == 2">
|
||||||
|
<view class="cover-price" :class="{active : item.type.value == 2}">
|
||||||
|
{{ item.price }}
|
||||||
|
</view>
|
||||||
|
<view class="cover-text">
|
||||||
|
{{ item.type.text }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item cover" v-else-if="item.type.value == 1">
|
||||||
|
<image class="cover-tips" src="http://localhost:8081/static/images/coupon-fu.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="item cover" v-else>
|
||||||
|
<image class="cover-tips" src="http://localhost:8081/static/images/coupon-ti.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="item mian">
|
||||||
|
<view class="title nowrap">{{ item.title }}</view>
|
||||||
|
<view class="time nowrap" v-if="item.type.value == 2">
|
||||||
|
{{ item.price_text }}
|
||||||
|
</view>
|
||||||
|
<view class="time nowrap">
|
||||||
|
{{ item.time.interval }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image v-if="item.status.status == 2" class="coupons-tips" src="/static/imgs/coupon_tips_00.png" mode="aspectFill"></image>
|
||||||
|
<image v-else-if="item.status.status == 3" class="coupons-tips" src="/static/imgs/coupon_tips_01.png" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<view class="couponMore" v-if="item.coupon_count > 1">
|
||||||
|
<view class="couponMore-text" @click.stop="$Router.push({name: 'myCouponsList', params: {couponId: item.coupon_id, status: tabsStatus}})">
|
||||||
|
<view class="couponMore-title">查看全部{{ item.coupon_count }}张优惠券</view>
|
||||||
|
<view class="couponMore-arrow">
|
||||||
|
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<block v-else>
|
||||||
|
<view class="list-null">
|
||||||
|
<no-list name='no-counpon' txt="没有任何相关优惠券~" />
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { userCoupon } from '@/apis/interfaces/user'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
coupons : [] ,// 列表
|
||||||
|
counts : '',
|
||||||
|
tabsType : '',
|
||||||
|
tabsStatus : '',
|
||||||
|
tabsTime : '',
|
||||||
|
statusCount : '',
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
pages : {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getCoupons()
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 数据列表
|
||||||
|
getCoupons(){
|
||||||
|
userCoupon({
|
||||||
|
type : this.tabsType,
|
||||||
|
status : this.tabsStatus,
|
||||||
|
time : this.tabsTime
|
||||||
|
}).then(res => {
|
||||||
|
this.coupons = res.lists
|
||||||
|
this.counts = res.count.type
|
||||||
|
this.statusCount = res.count.status
|
||||||
|
this.pages = res.lists.page
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择类型
|
||||||
|
onTabs(value){
|
||||||
|
if(value == this.tabsType) return
|
||||||
|
this.tabsType = value
|
||||||
|
this.getCoupons()
|
||||||
|
},
|
||||||
|
// 状态筛选
|
||||||
|
onTabsType(val){
|
||||||
|
if(this.tabsStatus === val) return
|
||||||
|
this.tabsStatus = val
|
||||||
|
this.tabsTime = null
|
||||||
|
this.getCoupons()
|
||||||
|
},
|
||||||
|
// 新状态筛选
|
||||||
|
onTabsTime(val) {
|
||||||
|
if(this.tabsTime === val) return
|
||||||
|
this.tabsTime = val
|
||||||
|
this.tabsStatus = null
|
||||||
|
this.getCoupons()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// tabs
|
||||||
|
.header{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 99;
|
||||||
|
.tabs{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
background: white;
|
||||||
|
padding: 15rpx 0;
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
color: $text-gray;
|
||||||
|
.item{
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
&.show{
|
||||||
|
color: $mian-color;
|
||||||
|
border-bottom: solid 4rpx $mian-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 类型
|
||||||
|
.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;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: $title-size-sm;
|
||||||
|
height: 46rpx;
|
||||||
|
line-height: 46rpx;
|
||||||
|
border-radius: 23rpx;
|
||||||
|
background: white;
|
||||||
|
margin-right: $margin/2;
|
||||||
|
color: $text-gray;
|
||||||
|
&.show{
|
||||||
|
background-color: rgba($color: $mian-color, $alpha: .1);
|
||||||
|
color: $mian-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表
|
||||||
|
.couponsMargin {
|
||||||
|
padding: 200rpx 0 $padding;
|
||||||
|
}
|
||||||
|
.coupons {
|
||||||
|
padding: 0 $padding;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
@extend .ios-bottom;
|
||||||
|
.coupons-flex{
|
||||||
|
position: relative;
|
||||||
|
background: white;
|
||||||
|
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
|
||||||
|
border-radius: $radius;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: $padding 40rpx $padding 0;
|
||||||
|
&.active {
|
||||||
|
border-radius: $radius $radius 0 0;
|
||||||
|
}
|
||||||
|
.cover{
|
||||||
|
position: relative;
|
||||||
|
border-right: dashed 3rpx $border-color;
|
||||||
|
width: 160rpx;
|
||||||
|
text-align: center;
|
||||||
|
.cover-price {
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #ee4c47;
|
||||||
|
&.active {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cover-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
.cover-tips {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin-top: 15rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mian{
|
||||||
|
justify-content: center;
|
||||||
|
width: calc(100% - 190rpx);
|
||||||
|
box-sizing: border-box;
|
||||||
|
@extend .vertical;
|
||||||
|
.title{
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.time, .tags{
|
||||||
|
color: $text-gray-m;
|
||||||
|
font-size: $title-size-m - 4;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.tags{
|
||||||
|
margin-top: 10rpx;
|
||||||
|
text{
|
||||||
|
background: $border-color-lg;
|
||||||
|
color: $text-gray;
|
||||||
|
padding: 0 ($padding/2);
|
||||||
|
margin-right: ($margin/2);
|
||||||
|
&:last-child{
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupons-tips {
|
||||||
|
position: absolute;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
width: 94rpx;
|
||||||
|
height: 94rpx;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.couponMore {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #686868;
|
||||||
|
position: relative;
|
||||||
|
height: 120rpx;
|
||||||
|
&::after,
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
content: '';
|
||||||
|
height: 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
|
||||||
|
z-index: 1;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
top: 70rpx;
|
||||||
|
left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
width: calc(100% - 80rpx);
|
||||||
|
top: 90rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
}
|
||||||
|
.couponMore-text {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 0 0 10rpx 10rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 10rpx rgba(0, 0,0, .1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.couponMore-title {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.couponMore-arrow {
|
||||||
|
position: absolute;
|
||||||
|
right: $margin;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
@extend .vertical
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
312
pages/user/couponsDte.vue
Normal file
312
pages/user/couponsDte.vue
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content" v-if="!isLoding">
|
||||||
|
<view class="details">
|
||||||
|
<view class="header">
|
||||||
|
<view class="info-item">
|
||||||
|
<view class="info-item-title">优惠券标题</view>
|
||||||
|
<view class="info-item-text">{{details.title}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<view class="info-item-title">优惠券类型</view>
|
||||||
|
<view class="info-item-text">{{details.type.text}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<view class="info-item-title">优惠券状态</view>
|
||||||
|
<view class="info-item-text">{{details.status.text}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<view class="info-item-title">使用渠道</view>
|
||||||
|
<view class="info-item-text">{{details.use_way.text}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item" v-if="details.type.value === 2">
|
||||||
|
<view class="info-item-title">满减</view>
|
||||||
|
<view class="info-item-text">满{{details.full}}减{{details.price}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<view class="info-item-title">券有效期(起)</view>
|
||||||
|
<view class="info-item-text">{{details.time.start_at}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<view class="info-item-title">券有效期(止)</view>
|
||||||
|
<view class="info-item-text">{{details.time.end_at}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="mian">
|
||||||
|
<block v-if="details.goods.length > 0">
|
||||||
|
<view class="mian-title">关联商品</view>
|
||||||
|
<view class="mian-goods">
|
||||||
|
<view class="item" v-for="(item, index) in details.goods" :key="index">
|
||||||
|
<image class="item-img" :src="item.cover" mode=""></image>
|
||||||
|
<view class="item-cont">
|
||||||
|
<view class="item-title nowrap">{{item.name}}</view>
|
||||||
|
<view class="item-price nowrap">¥{{item.price}}</view>
|
||||||
|
</view>
|
||||||
|
<block v-if="details.use_way">
|
||||||
|
<view v-if="details.use_way.value == 1" class="item-apply" @click="$Router.push({name: 'goodsDetails', params: {id: item.goods_id}})">
|
||||||
|
去使用
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<view class="mian-title">使用说明</view>
|
||||||
|
<view class="mian-text">
|
||||||
|
<text>{{details.description || '-'}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="ios-bottom"></view>
|
||||||
|
|
||||||
|
<block v-if="details.use_way">
|
||||||
|
<view class="clickCodeBtn" v-if='details.use_way.value == 2' @click="clickCode(details.coupon_grant_id)">立即兑换</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- 二维码弹窗 -->
|
||||||
|
<view class="showCode " v-if="showCode">
|
||||||
|
<view class="showCodeBg" @click="showCode = false"></view>
|
||||||
|
<view :class="['showCodeContent', showCode?'showCodeContentSelect':'showCodeContentSelectNo']">
|
||||||
|
<view class="showCodeTitle">优惠券兑换码</view>
|
||||||
|
<image :src="code" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { couponsInfo, getQrcodeByGrantId } from '@/apis/interfaces/user'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isLoding : true,
|
||||||
|
details : {},
|
||||||
|
showCode : false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
couponsInfo(this.$Route.query.couponId).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.details = res
|
||||||
|
this.isLoding = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 点击二维码特效
|
||||||
|
clickCode(grantid) {
|
||||||
|
this.code = ''
|
||||||
|
if (grantid !== '') {
|
||||||
|
let data = {
|
||||||
|
coupon_grant_id: grantid
|
||||||
|
}
|
||||||
|
getQrcodeByGrantId(data).then(res => {
|
||||||
|
this.code = res.code
|
||||||
|
this.showCode = !this.showCode
|
||||||
|
}).catch(err => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: err.message,
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
// content
|
||||||
|
.content{
|
||||||
|
padding-bottom: $padding + 90;
|
||||||
|
}
|
||||||
|
|
||||||
|
.details{
|
||||||
|
margin: $margin;
|
||||||
|
background: white;
|
||||||
|
border-radius: $radius;
|
||||||
|
// 优惠券信息
|
||||||
|
.header{
|
||||||
|
position: relative;
|
||||||
|
border-bottom: dashed 2rpx $border-color;
|
||||||
|
padding: $padding;
|
||||||
|
&::after,&::before{
|
||||||
|
position: absolute;
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
background: #f8f8f8;
|
||||||
|
content: " ";
|
||||||
|
bottom: -16rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
&::after{
|
||||||
|
left: -16rpx;
|
||||||
|
}
|
||||||
|
&::before{
|
||||||
|
right: -16rpx;
|
||||||
|
}
|
||||||
|
.info{
|
||||||
|
padding: $padding 0;
|
||||||
|
text-align: center;
|
||||||
|
.info-cover{
|
||||||
|
width: 128rpx;
|
||||||
|
height: 128rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.info-title{
|
||||||
|
padding-top: $padding;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: $title-size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info-item{
|
||||||
|
position: relative;
|
||||||
|
padding-left: 200rpx;
|
||||||
|
min-height: 60rpx;
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
padding-bottom: $padding/3;
|
||||||
|
&:last-child{
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
.info-item-title{
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
line-height: 50rpx;
|
||||||
|
color: $text-color;
|
||||||
|
}
|
||||||
|
.info-item-text{
|
||||||
|
line-height: 50rpx;
|
||||||
|
color: $text-gray;
|
||||||
|
text-align: right;
|
||||||
|
@extend .nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 优惠券介绍
|
||||||
|
.mian{
|
||||||
|
padding: $padding;
|
||||||
|
.mian-title{
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 50rpx;
|
||||||
|
color: $text-color;
|
||||||
|
}
|
||||||
|
.mian-text{
|
||||||
|
font-size: $title-size-m;
|
||||||
|
color: $text-gray;
|
||||||
|
padding-top: $padding/3;
|
||||||
|
}
|
||||||
|
.mian-goods{
|
||||||
|
padding: $padding - 10 0 $padding;
|
||||||
|
.item{
|
||||||
|
font-size: $title-size-m;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.item-img {
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
.item-cont {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 90rpx;
|
||||||
|
padding: 0 140rpx 0 110rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: bold;
|
||||||
|
.item-title{
|
||||||
|
color: $text-gray;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
.item-price{
|
||||||
|
color: $text-price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.item-apply {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 20rpx;
|
||||||
|
border-radius: $radius - 10;
|
||||||
|
text-align: center;
|
||||||
|
border: #8b64fd 2rpx solid;
|
||||||
|
color: #8b64fd;
|
||||||
|
height: 54rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
width: 120rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动画效果
|
||||||
|
.showCode {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
z-index: 199999999999999993;
|
||||||
|
|
||||||
|
.showCodeBg {
|
||||||
|
background-color: rgba($color:#000, $alpha: 0.3);
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 199999999999999994;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showCodeContentSelect {
|
||||||
|
animation: sk-foldCubeAngle .6s linear both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showCodeContentSelectNo {
|
||||||
|
animation: sk-foldCubeAngleNo .6s linear both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showCodeContent {
|
||||||
|
width: 600rpx;
|
||||||
|
height: 500rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 30rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 199999999999999995;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showCodeTitle {
|
||||||
|
font-weight: 600;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickCodeBtn {
|
||||||
|
margin: $margin;
|
||||||
|
background: white;
|
||||||
|
border-radius: $radius - 10;
|
||||||
|
border: #8b64fd 2rpx solid;
|
||||||
|
color: #8b64fd;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
236
pages/user/couponsList.vue
Normal file
236
pages/user/couponsList.vue
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="couponsMargin" v-if="coupons.length > 0">
|
||||||
|
<view class="coupons" v-for="(item, index) in coupons" :key="index" @click="$Router.push({name: 'myCouponsDte', params: {couponId: item.coupon_grant_id}})">
|
||||||
|
<view class="coupons-flex">
|
||||||
|
<view class="item cover" v-if="item.type.value == 2">
|
||||||
|
<view class="cover-price" :class="{active : item.type.value == 2}">
|
||||||
|
{{ item.price }}
|
||||||
|
</view>
|
||||||
|
<view class="cover-text">
|
||||||
|
{{ item.type.text }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item cover" v-else-if="item.type.value == 1">
|
||||||
|
<image class="cover-tips" src="http://localhost:8081/static/images/coupon-fu.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="item cover" v-else>
|
||||||
|
<image class="cover-tips" src="http://localhost:8081/static/images/coupon-ti.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="item mian">
|
||||||
|
<view class="title nowrap">{{ item.title }}</view>
|
||||||
|
<view class="time nowrap" v-if="item.type.value == 2">
|
||||||
|
{{ item.price_text }}
|
||||||
|
</view>
|
||||||
|
<view class="time nowrap">
|
||||||
|
{{ item.time.interval }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image v-if="item.status.status == 2" class="coupons-tips" src="/static/imgs/coupon_tips_00.png" mode="aspectFill"></image>
|
||||||
|
<image v-else-if="item.status.status == 3" class="coupons-tips" src="/static/imgs/coupon_tips_01.png" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<block v-else>
|
||||||
|
<view class="list-null">
|
||||||
|
<no-list name='no-counpon' txt="没有任何相关优惠券~" />
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { userCouponList } from '@/apis/interfaces/user'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
coupons : [] ,// 列表
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
pages : {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getCoupons()
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 数据列表
|
||||||
|
getCoupons(){
|
||||||
|
userCouponList(this.$Route.query.couponId, {
|
||||||
|
status : this.$Route.query.status
|
||||||
|
}).then(res => {
|
||||||
|
this.coupons = res.data
|
||||||
|
this.pages = res.page
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon : 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择类型
|
||||||
|
onTabs(value){
|
||||||
|
if(value == this.tabsType) return
|
||||||
|
this.tabsType = value
|
||||||
|
this.getCoupons()
|
||||||
|
},
|
||||||
|
// 状态筛选
|
||||||
|
onTabsType(val){
|
||||||
|
if(this.tabsStatus === val) return
|
||||||
|
this.tabsStatus = val
|
||||||
|
this.tabsTime = '-'
|
||||||
|
this.getCoupons()
|
||||||
|
},
|
||||||
|
// 新状态筛选
|
||||||
|
onTabsTime(val) {
|
||||||
|
if(this.tabsTime === val) return
|
||||||
|
this.tabsTime = val
|
||||||
|
this.tabsStatus = '-'
|
||||||
|
this.getCoupons()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// 列表
|
||||||
|
.couponsMargin {
|
||||||
|
padding: 20rpx 0;
|
||||||
|
}
|
||||||
|
.coupons {
|
||||||
|
padding: 0 $padding;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
@extend .ios-bottom;
|
||||||
|
.coupons-flex{
|
||||||
|
position: relative;
|
||||||
|
background: white;
|
||||||
|
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
|
||||||
|
border-radius: $radius;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: $padding 40rpx $padding 0;
|
||||||
|
&.active {
|
||||||
|
border-radius: $radius $radius 0 0;
|
||||||
|
}
|
||||||
|
.cover{
|
||||||
|
position: relative;
|
||||||
|
border-right: dashed 3rpx $border-color;
|
||||||
|
width: 160rpx;
|
||||||
|
text-align: center;
|
||||||
|
.cover-price {
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #ee4c47;
|
||||||
|
&.active {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cover-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
.cover-tips {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin-top: 15rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mian{
|
||||||
|
justify-content: center;
|
||||||
|
width: calc(100% - 190rpx);
|
||||||
|
box-sizing: border-box;
|
||||||
|
@extend .vertical;
|
||||||
|
.title{
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
line-height: 50rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.time, .tags{
|
||||||
|
color: $text-gray-m;
|
||||||
|
font-size: $title-size-m - 4;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
.tags{
|
||||||
|
margin-top: 10rpx;
|
||||||
|
text{
|
||||||
|
background: $border-color-lg;
|
||||||
|
color: $text-gray;
|
||||||
|
padding: 0 ($padding/2);
|
||||||
|
margin-right: ($margin/2);
|
||||||
|
&:last-child{
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupons-tips {
|
||||||
|
position: absolute;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
|
width: 94rpx;
|
||||||
|
height: 94rpx;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.couponMore {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #686868;
|
||||||
|
position: relative;
|
||||||
|
height: 120rpx;
|
||||||
|
&::after,
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
content: '';
|
||||||
|
height: 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
|
||||||
|
z-index: 1;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
top: 70rpx;
|
||||||
|
left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
width: calc(100% - 80rpx);
|
||||||
|
top: 90rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
}
|
||||||
|
.couponMore-text {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 0 0 10rpx 10rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 10rpx rgba(0, 0,0, .1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.couponMore-title {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.couponMore-arrow {
|
||||||
|
position: absolute;
|
||||||
|
right: $margin;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
@extend .vertical
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -263,6 +263,10 @@
|
|||||||
我的服务
|
我的服务
|
||||||
</view>
|
</view>
|
||||||
<view class="tool-list">
|
<view class="tool-list">
|
||||||
|
<view class="tool-label" @click="$Router.push({name: 'myCoupons'})">
|
||||||
|
<image class="tool-label-img" src="/static/user/userServe-05.png" mode=""></image>
|
||||||
|
<view class="tool-label-name">我的优惠券</view>
|
||||||
|
</view>
|
||||||
<view class="tool-label" @click="custEject">
|
<view class="tool-label" @click="custEject">
|
||||||
<image class="tool-label-img" src="/static/user/userServe-00.png" mode=""></image>
|
<image class="tool-label-img" src="/static/user/userServe-00.png" mode=""></image>
|
||||||
<view class="tool-label-name">专属客服</view>
|
<view class="tool-label-name">专属客服</view>
|
||||||
|
|||||||
BIN
static/imgs/coupon_tips_00.png
Normal file
BIN
static/imgs/coupon_tips_00.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
static/imgs/coupon_tips_01.png
Normal file
BIN
static/imgs/coupon_tips_01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
BIN
static/user/userServe-05.png
Normal file
BIN
static/user/userServe-05.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
51575
unpackage/dist/dev/app-plus/app-service.js
vendored
51575
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user