曲靖复制郫都 积分申请,积分兑换
This commit is contained in:
137
src/project/qujing/AppPointsApply/AppPointsApply.vue
Normal file
137
src/project/qujing/AppPointsApply/AppPointsApply.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<div class="AppPointsApply">
|
||||
<div class="points_img" @click="toAdd">
|
||||
<img src="./imgs/points.png" alt="">
|
||||
</div>
|
||||
<h3>申请记录</h3>
|
||||
<div v-if="list.length">
|
||||
<div class="card" v-for="(item,index) in list" :key="index" >
|
||||
<div class="top">
|
||||
<div class="top_title">{{ item.applyItem }}</div>
|
||||
<div><span class="top_status" :class="item.status==0? 'status0' : item.status==1? 'status1': 'status2'">{{ $dict.getLabel('integralDeclareStatus',item.status) }}</span></div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="bottom_points">积分+{{ item.applyIntegral }}</div>
|
||||
<div class="bottom_time">{{ item.createTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AppPointsApply',
|
||||
appName: '积分申请',
|
||||
data() {
|
||||
return {
|
||||
current: 1,
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$dict.load('integralDeclareStatus').then(() => {
|
||||
this.getPointsList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
toAdd() {
|
||||
uni.navigateTo({url: './addPoints'})
|
||||
},
|
||||
getPointsList() {
|
||||
this.$http.post(`/app/appintegralmemberapply/listByGirdMember`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
}
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records]: res.data.records
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getPointsList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppPointsApply {
|
||||
padding: 250px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.points_img {
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: #F5F5F5;
|
||||
z-index: 9;
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
h3 {
|
||||
margin-top: 48px;
|
||||
}
|
||||
.card {
|
||||
margin-top: 24px;
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.02);
|
||||
border-radius: 16px;
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.top_title {
|
||||
width: 450px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
.top_status {
|
||||
padding: 6px 16px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 8px;
|
||||
text-align: right;
|
||||
width: calc(100% - 450px);
|
||||
}
|
||||
.status0 {
|
||||
background: #FFEDE2;
|
||||
color: #FF883C;
|
||||
}
|
||||
|
||||
.status1 {
|
||||
background: #E2F6E1;
|
||||
color: #3BBC37;
|
||||
}
|
||||
|
||||
.status2 {
|
||||
background: #FAE2E2;
|
||||
color: #E23C3C;
|
||||
}
|
||||
}
|
||||
.bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 24px;
|
||||
.bottom_points {
|
||||
color: #FF6900;
|
||||
}
|
||||
.bottom_time {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
173
src/project/qujing/AppPointsApply/addPoints.vue
Normal file
173
src/project/qujing/AppPointsApply/addPoints.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div class="addPoints">
|
||||
<div class="item">
|
||||
<div class="item_left"><span class="red">*</span><span class="color-666">事件类型</span></div>
|
||||
<AiSelect dict="integralApplyEventType" v-model="form.eventType"/>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item_left"><span class="red">*</span><span class="color-666">申请事项</span></div>
|
||||
<div class="input"><u-input v-model="form.applyItem" type="text" placeholder="请输入" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="item_left"><span class="red">*</span><span class="color-666">积分数量</span></div>
|
||||
<div class="input"><u-input v-model="form.applyIntegral" type="number" disabled placeholder="请输入"/></div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<div><span class="red">*</span><span class="color-666">上传图片</span></div>
|
||||
<AiUploader style="margin-top: 12px;" :def.sync="form.files" :limit="1" action="/admin/file/add2"></AiUploader>
|
||||
</div>
|
||||
|
||||
<div class="btn">
|
||||
<div class="subBtn" @click="submit">提交</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'addPoints',
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
form: {
|
||||
eventType: '',
|
||||
applyItem: '',
|
||||
applyIntegral: '',
|
||||
voucherImageUrl: '',
|
||||
files: []
|
||||
},
|
||||
flag: false,
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
document.title = '积分申请'
|
||||
if(opt) {
|
||||
this.getDetail(opt.id)
|
||||
}
|
||||
this.$dict.load('integralApplyEventType')
|
||||
},
|
||||
watch: {
|
||||
'form.eventType'(val) {
|
||||
if(val==0 || val == 1 || val == 5) {
|
||||
this.form.applyIntegral = 2
|
||||
} else if(val == 2 || val == 3 || val == 4) {
|
||||
this.form.applyIntegral = 5
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail(id) {
|
||||
this.$http.post(`/app/appintegralmemberapply/queryDetailById?id=${id}`).then(res=> {
|
||||
if(res?.data) {
|
||||
this.form = res.data
|
||||
this.form.files = [{url:res.data.voucherImageUrl}]
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
if(this.flag) return
|
||||
|
||||
if(!this.form.eventType) {
|
||||
return this.$u.toast('请选择事件类型')
|
||||
}
|
||||
|
||||
if(!this.form.applyItem) {
|
||||
return this.$u.toast('请输入申请事项')
|
||||
}
|
||||
|
||||
if(!this.form.applyIntegral) {
|
||||
return this.$u.toast('请输入积分数量')
|
||||
}
|
||||
|
||||
if(this.form.files.length) {
|
||||
this.form.voucherImageUrl = this.form.files[0].url
|
||||
}
|
||||
|
||||
this.flag = true
|
||||
this.$http.post(`/app/appintegralmemberapply/addOrUpdate`,{...this.form}).then(res=> {
|
||||
if(res.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 400)
|
||||
}
|
||||
}).catch(err=> {
|
||||
this.$u.toast(err.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.addPoints {
|
||||
padding: 0 16px 120px;
|
||||
box-sizing: border-box;
|
||||
font-size: 32px;
|
||||
.item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 24px;
|
||||
background: #FFF;
|
||||
box-shadow: inset 0 0 0 0 #EEEEEE;
|
||||
border-radius: 32px;
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
.item_left {
|
||||
font-size: 32px;
|
||||
.red {
|
||||
color: #E64A4A;
|
||||
}
|
||||
.color-666 {
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
.input {
|
||||
width: calc(100% - 200px);
|
||||
}
|
||||
::v-deep .uni-input-input,
|
||||
.uni-input-placeholder {
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.items {
|
||||
margin-top: 24px;
|
||||
background: #FFF;
|
||||
box-shadow: inset 0 0 0 0 #EEEEEE;
|
||||
border-radius: 32px;
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
.red {
|
||||
color: #E64A4A;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: #F5F5F5;
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
.subBtn {
|
||||
text-align: center;
|
||||
color: #FFF;
|
||||
background: #3975C6;
|
||||
border-radius: 44px;
|
||||
width: 100%;
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
font-style: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/qujing/AppPointsApply/imgs/points.png
Normal file
BIN
src/project/qujing/AppPointsApply/imgs/points.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 548 KiB |
354
src/project/qujing/AppPointsChange/AppPointsChange.vue
Normal file
354
src/project/qujing/AppPointsChange/AppPointsChange.vue
Normal file
@@ -0,0 +1,354 @@
|
||||
<template>
|
||||
<div class="AppPointsChange">
|
||||
<AiTopFixed>
|
||||
<div class="header">
|
||||
<div class="header-left">
|
||||
<span>★</span>
|
||||
积分余额:{{userIntegral}}
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<div @click="toMyOrder">我的订单</div>
|
||||
</div>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="list-content">
|
||||
<div class="select">
|
||||
<div :class="search.newestSort === 0 ? 'active' : ''" @click="clickNew()">最新上架</div>
|
||||
<div class="price" :class="search.priceSort !== '' ? 'active' : ''" @click="clickPrice()">价格
|
||||
<span class="top mar-l8" :class="search.priceSort === 0 ? 'active' : ''">⏶</span>
|
||||
<span class="bottom mar-l8" :class="search.priceSort === 1 ? 'active' : ''">⏷</span>
|
||||
</div>
|
||||
<div class="sure" :class="search.isExchange == 1 ? 'active' : ''" @click="clickStatus()">可兑换的
|
||||
<img src="./components/imgs/check-icon.png" alt="" v-if="search.isExchange == 1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="type">
|
||||
<div class="type-item" :class="index == typeIndex ? 'active' : ''" v-for="(item, index) in typeList" :key="index" @click="typeClick(index)">{{item}}</div>
|
||||
</div>
|
||||
<div class="item" :class="item.status != 0 ? 'lack-item' : ''" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<div class="left">
|
||||
<img :src="item.imageUrl" alt="">
|
||||
</div>
|
||||
<div class="right">
|
||||
<p>{{item.merchandiseName}}</p>
|
||||
<h3>{{item.merchandiseIntegral}}<span>积分</span></h3>
|
||||
</div>
|
||||
<img src="./components/imgs/lack-icon.png" alt="" class="status" v-if="item.status != 0"/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <AiEmpty v-else></AiEmpty> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'AppPointsChange',
|
||||
appName: '积分兑换',
|
||||
data() {
|
||||
return {
|
||||
current: 1,
|
||||
list: [],
|
||||
typeList: ['全部', '100分以下', '500分以下', '1000分以下', '5000分以下'],
|
||||
typeIndex: 0,
|
||||
search: {
|
||||
newestSort: '0',
|
||||
priceSort: '',
|
||||
isExchange: ''
|
||||
},
|
||||
userIntegral: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
this.getIntegral()
|
||||
uni.$on('updateList', () => {
|
||||
this.getIntegral()
|
||||
this.getListInit()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
document.title = '积分兑换'
|
||||
},
|
||||
methods: {
|
||||
getIntegral() {
|
||||
this.$http.post('/app/appintegraluser/appGirdIntegral?current=1&size=1').then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.userIntegral = res.data.nowIntegral
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.$http.post('/app/appintegralmerchandise/listByGirdMember', null, {
|
||||
params: {
|
||||
...this.search,
|
||||
size: 20,
|
||||
current: this.current,
|
||||
queryIntegralType: this.typeIndex,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res?.data) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
getListInit() {
|
||||
this.current = 1
|
||||
this.datas = []
|
||||
this.getList()
|
||||
},
|
||||
typeClick(index) {
|
||||
this.typeIndex = index
|
||||
this.getListInit()
|
||||
},
|
||||
toDetail(item) {
|
||||
uni.navigateTo({url:`./detail?id=${item.id}&userIntegral=${this.userIntegral}`})
|
||||
},
|
||||
toMyOrder() {
|
||||
uni.navigateTo({url:`./myOrder`})
|
||||
},
|
||||
clickStatus() {
|
||||
this.search.isExchange = this.search.isExchange == 1 ? '' : 1
|
||||
this.getListInit()
|
||||
},
|
||||
clickNew() {
|
||||
this.search.newestSort = this.search.newestSort === 0 ? '' : 0
|
||||
if(this.search.newestSort == 0) {
|
||||
this.search.priceSort = ''
|
||||
}
|
||||
this.getListInit()
|
||||
},
|
||||
clickPrice() {
|
||||
this.search.priceSort = this.search.priceSort == 1 ? 0 : 1
|
||||
this.search.newestSort = ''
|
||||
this.getListInit()
|
||||
},
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppPointsChange {
|
||||
min-height: 100%;
|
||||
::v-deep .AiTopFixed .content {
|
||||
background: #F2F2F2 !important;
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 28px 24px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background: #FFF;
|
||||
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.02);
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 28px;
|
||||
color: #CA906A;
|
||||
.header-left {
|
||||
line-height: 56px;
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
background: #CA906A;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 30px;
|
||||
margin-right: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.header-right {
|
||||
div {
|
||||
width: 176px;
|
||||
height: 56px;
|
||||
text-align: center;
|
||||
line-height: 56px;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #CA906A;
|
||||
border-radius: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-content{
|
||||
padding: 4px 32px 16px;
|
||||
background-color: #fff;
|
||||
border-top-left-radius: 16px;
|
||||
border-top-right-radius: 16px;
|
||||
.select {
|
||||
display: flex;
|
||||
div {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28px;
|
||||
color: #666;
|
||||
}
|
||||
.active {
|
||||
color: #CA906A;
|
||||
}
|
||||
.price {
|
||||
position: relative;
|
||||
span {
|
||||
position: absolute;
|
||||
left: 140px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
color: #999;
|
||||
}
|
||||
.top {
|
||||
top: -10px;
|
||||
}
|
||||
.bottom {
|
||||
top: 6px;
|
||||
}
|
||||
.active {
|
||||
color: #CA906A;
|
||||
}
|
||||
.mar-l8 {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
.sure {
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
.type {
|
||||
width: 100%;
|
||||
padding: 16px 0;
|
||||
box-sizing: border-box;
|
||||
overflow-x: scroll;
|
||||
display: flex;
|
||||
word-break: keep-all;
|
||||
.type-item{
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
background: #F2F2F2;
|
||||
border-radius: 24px;
|
||||
padding: 0 16px;
|
||||
margin-right: 16px;
|
||||
font-size: 26px;
|
||||
color: #333;
|
||||
border: 1px solid #F2F2F2;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.active {
|
||||
color: #CA906A;
|
||||
background-color: #fff;
|
||||
border: 1px solid #CA906A;
|
||||
}
|
||||
}
|
||||
.item{
|
||||
width: 100%;
|
||||
padding: 32px 0 40px 0;
|
||||
display: flex;
|
||||
position: relative;
|
||||
border-bottom: 1px solid #eee;
|
||||
.left {
|
||||
img {
|
||||
width: 168px;
|
||||
height: 176px;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
width: calc(100% - 168px);
|
||||
padding-left: 24px;
|
||||
box-sizing: border-box;
|
||||
p {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
line-height: 40px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
h3 {
|
||||
line-height: 60px;
|
||||
font-family: PingFangSC-SNaNpxibold;
|
||||
font-weight: 600;
|
||||
font-size: 44px;
|
||||
color: #FF6900;
|
||||
span {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.status {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
}
|
||||
.item:nth-last-of-type(1) {
|
||||
border-bottom: none;
|
||||
}
|
||||
.lack-item {
|
||||
opacity: 0.5;
|
||||
.right {
|
||||
h3 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.height-144{
|
||||
height: 144px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
background: #3975C6;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1012 B |
BIN
src/project/qujing/AppPointsChange/components/imgs/lack-icon.png
Normal file
BIN
src/project/qujing/AppPointsChange/components/imgs/lack-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
143
src/project/qujing/AppPointsChange/detail.vue
Normal file
143
src/project/qujing/AppPointsChange/detail.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<div class="goods-img">
|
||||
<u-swiper :list="list" mode="none" img-mode="aspectFit" height="750" bg-color="#fff" @click="imgClick"></u-swiper>
|
||||
</div>
|
||||
<div class="goods-title">{{goodsInfo.merchandiseName}}</div>
|
||||
<div class="goods-point">
|
||||
<h3>{{goodsInfo.merchandiseIntegral}}<span>积分</span></h3>
|
||||
<div>库存:{{goodsInfo.merchandiseNumber}}</div>
|
||||
</div>
|
||||
<div class="goods-btn status-lack">
|
||||
<div class="text">积分余额:{{userIntegral}}</div>
|
||||
<div class="btn" @click="toOrder()" v-if="goodsInfo.status == 0 && userIntegral >= goodsInfo.merchandiseIntegral">立即兑换</div>
|
||||
<div class="btn lack-btn" v-if="goodsInfo.status == 0 && userIntegral < goodsInfo.merchandiseIntegral">积分不足</div>
|
||||
<div class="btn lack-btn" v-if="goodsInfo.status != 0">缺货</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'detail',
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
userIntegral: '',
|
||||
id: '',
|
||||
goodsInfo: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userIntegral = option.userIntegral
|
||||
this.id = option.id
|
||||
this.getDetail()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '商品详情'
|
||||
},
|
||||
methods: {
|
||||
toOrder() {
|
||||
uni.navigateTo({url:`./order?userIntegral=${this.userIntegral}&id=${this.id}`})
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appintegralmerchandise/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.goodsInfo = res.data
|
||||
this.list = [{image: res.data.imageUrl}]
|
||||
}
|
||||
})
|
||||
},
|
||||
imgClick(index) {
|
||||
this.previewImages(this.list, this.list[index].image)
|
||||
},
|
||||
previewImages(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map(v => v.image),
|
||||
current: img
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body {
|
||||
background-color: #fff;
|
||||
}
|
||||
.detail {
|
||||
.goods-img {
|
||||
width: 100%;
|
||||
}
|
||||
.goods-title {
|
||||
padding: 32px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
}
|
||||
.goods-point{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 32px;
|
||||
h3 {
|
||||
line-height: 60px;
|
||||
font-family: PingFangSC-SNaNpxibold;
|
||||
font-weight: 600;
|
||||
font-size: 44px;
|
||||
color: #FF6900;
|
||||
span {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
div {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 26px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.goods-btn {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #FFF;
|
||||
border-top: 1px solid #ddd;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 32px;
|
||||
box-sizing: border-box;
|
||||
.text {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 28px;
|
||||
color: #CA906A;
|
||||
}
|
||||
.btn {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
width: 224px;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(90deg, #FFA044 0%, #FF8436 100%);
|
||||
border-radius: 52px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: #FFF;
|
||||
margin-top: 16px;
|
||||
}
|
||||
.lack-btn {
|
||||
background-image: linear-gradient(90deg, #ddd 0%, #ddd 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
260
src/project/qujing/AppPointsChange/myOrder.vue
Normal file
260
src/project/qujing/AppPointsChange/myOrder.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div class="myOrder">
|
||||
|
||||
<div class="tab-select">
|
||||
<div class="item" :class="tabIndex == index? 'active': ''" v-for="(item,index) in tabList" :key="index" @click="toCheck(index)">{{ item }}<span></span></div>
|
||||
</div>
|
||||
<div class="card-List" v-if="orderList.length">
|
||||
<div class="item" v-for="(item,index) in orderList" :key="index">
|
||||
<!-- @click="$linkTo(`./detail?id=${item.id}`)" -->
|
||||
<div>
|
||||
<div class="title">
|
||||
<div>{{ item.createTime }}</div>
|
||||
<div><span class="status_all" :class="item.orderStatus==0?'status0':item.orderStatus==1?'status1':'status2'">{{ $dict.getLabel('merchandiseOrderStatus', item.orderStatus) }}</span></div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="list-item">
|
||||
<div class="picture">
|
||||
<img :src="item.imageUrl" alt="">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">{{ item.merchandiseName }}</div>
|
||||
<div class="info-num">
|
||||
<div class="num">数量:<span>{{ item.merchandiseNumber }}</span></div>
|
||||
<div class="integral">共<span>{{ item.merchandiseNumber * item.merchandiseIntegral}}</span>积分</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="remark" v-if="item.remark.length">备注:{{ item.remark }}</div>
|
||||
<div class="btn" v-if="item.orderStatus==0">
|
||||
<div class="cancel" @click="cancelBtn(item.id)">取消订单</div>
|
||||
<div class="confirm">核销码:<span>{{ item.auditCode }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "myOrder",
|
||||
data() {
|
||||
return {
|
||||
tabIndex: 0,
|
||||
tabList: ['全部','待收货','已完成','已取消'],
|
||||
orderList: [],
|
||||
current: 1,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
document.title = '我的订单'
|
||||
this.$dict.load('merchandiseOrderStatus').then(() => {
|
||||
this.getOrderList()
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
toCheck(index) {
|
||||
this.orderList = []
|
||||
this.current = 1
|
||||
this.tabIndex = index
|
||||
this.getOrderList()
|
||||
},
|
||||
getOrderList() {
|
||||
this.$http.post('/app/appintegralmerchandiseorder/listByGirdMember',null,{
|
||||
params: {
|
||||
current: this.current,
|
||||
orderStatus: this.tabIndex == 0 ? '' : this.tabIndex == 1? 0 : this.tabIndex ==2? 1:2
|
||||
}
|
||||
}).then(res=>{
|
||||
if(res?.data) {
|
||||
this.orderList = this.current == 1? res.data.records : [...this.orderList,...res.data.records]
|
||||
}
|
||||
})
|
||||
},
|
||||
cancelBtn(id) {
|
||||
this.$confirm('确定要取消该订单吗?\n 取消订单后,积分将退回至剩余积分').then(() => {
|
||||
this.$http.post('/app/appintegralmerchandiseorder/cancelOrder',null,{
|
||||
params: {
|
||||
id: id
|
||||
}
|
||||
}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.$u.toast('取消成功')
|
||||
setTimeout(() => {
|
||||
this.getOrderList()
|
||||
},400)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getOrderList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.myOrder {
|
||||
.tab-select {
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
line-height: 96px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #3975C6;
|
||||
display: flex;
|
||||
z-index: 999;
|
||||
.item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.active {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
span {
|
||||
width: 50px;
|
||||
height: 6px;
|
||||
background: #FFFFFF;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 14px;
|
||||
margin-left: -24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.card-List {
|
||||
font-size: 28px;
|
||||
box-sizing: border-box;
|
||||
padding: 128px 32px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
.item {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.04);
|
||||
border-radius: 16px;
|
||||
margin-bottom: 16px;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 104px;
|
||||
line-height: 104px;
|
||||
padding: 0 32px;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
|
||||
.status_all {
|
||||
padding: 3px 10px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.status0 {
|
||||
background: #FFEDE2;
|
||||
color: #FF883C;
|
||||
}
|
||||
|
||||
.status1 {
|
||||
background: #E2F6E1;
|
||||
color: #42D784;
|
||||
}
|
||||
|
||||
.status2 {
|
||||
background: #EEEEEE;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.list {
|
||||
padding: 0 32px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 16px;
|
||||
height: 100%;
|
||||
.list-item {
|
||||
display: flex;
|
||||
padding: 32px 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.picture {
|
||||
width: 176px;
|
||||
height: 176px;
|
||||
margin-right: 16px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.info {
|
||||
width: calc(100% - 192px);
|
||||
.name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
.info-num {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.num {
|
||||
color: #999999;
|
||||
}
|
||||
.integral {
|
||||
color: #FF6900;
|
||||
span {
|
||||
font-size: 44px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.remark {
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
border-top: 1px solid #EEEEEE;
|
||||
|
||||
}
|
||||
.btn {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
border-top: 1px solid #EEEEEE;
|
||||
div {
|
||||
margin-top: 14px;
|
||||
width: 176px;
|
||||
height: 64px;
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
}
|
||||
div:first-child {
|
||||
margin-right: 32px;
|
||||
color: #687DA6;
|
||||
}
|
||||
div:last-child {
|
||||
color: #999999;
|
||||
width: calc(100% - 200px);
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .emptyWrap .emptyImg {
|
||||
margin-top: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
215
src/project/qujing/AppPointsChange/order.vue
Normal file
215
src/project/qujing/AppPointsChange/order.vue
Normal file
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div class="order">
|
||||
<div class="goods">
|
||||
<div class="left">
|
||||
<img :src="goodsInfo.imageUrl" alt="">
|
||||
</div>
|
||||
<div class="right">
|
||||
<p>{{goodsInfo.merchandiseName}}</p>
|
||||
<div class="flex">
|
||||
<h3>{{goodsInfo.merchandiseIntegral}}<span>积分</span></h3>
|
||||
<div class="num">
|
||||
<u-number-box v-model="number" @change="valChange" :min="1" :max="max"></u-number-box>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item item-mar-b24">
|
||||
<div class="label">备注</div>
|
||||
<div class="value">
|
||||
<u-input v-model="remark" type="text" maxlength="20" input-align="right" placeholder="0/20" height="44" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item border">
|
||||
<div class="label">积分余额</div>
|
||||
<div class="value color-333">{{userIntegral}}</div>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<div class="label">支付积分</div>
|
||||
<div class="value color-ff6900">-{{total}}</div>
|
||||
</div>
|
||||
<div class="footer" @click="submit">
|
||||
<div>提交订单</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'order',
|
||||
data() {
|
||||
return {
|
||||
number: 1,
|
||||
remark: '',
|
||||
userIntegral: '',
|
||||
id: '',
|
||||
goodsInfo: {},
|
||||
max: 1,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
total() {
|
||||
return (this.number*10*this.goodsInfo.merchandiseIntegral)/10
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userIntegral = option.userIntegral
|
||||
this.id = option.id
|
||||
this.getDetail()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '提交订单'
|
||||
},
|
||||
methods: {
|
||||
valChange(e) {
|
||||
this.number = e.value
|
||||
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appintegralmerchandise/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.goodsInfo = res.data
|
||||
this.max = parseInt(this.userIntegral/this.goodsInfo.merchandiseIntegral)
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$confirm('是否确认提交订单?').then(() => {
|
||||
this.$http.post(`/app/appintegralmerchandiseorder/addOrUpdate`, {
|
||||
merchandiseId: this.id,
|
||||
merchandiseNumber: this.number,
|
||||
remark: this.remark
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('updateList')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({delta: 2})
|
||||
}, 600)
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body {
|
||||
background-color: #f5f6f7;
|
||||
}
|
||||
.order {
|
||||
.goods {
|
||||
width: calc(100% - 32px);
|
||||
background-color: #fff;
|
||||
margin: 16px 0 16px 16px;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
border-radius: 32px;
|
||||
.left {
|
||||
img {
|
||||
width: 176px;
|
||||
height: 176px;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
width: calc(100% - 176px);
|
||||
padding-left: 24px;
|
||||
box-sizing: border-box;
|
||||
p {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
line-height: 40px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.num {
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
h3 {
|
||||
line-height: 60px;
|
||||
font-family: PingFangSC-SNaNpxibold;
|
||||
font-weight: 600;
|
||||
font-size: 44px;
|
||||
color: #FF6900;
|
||||
span {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.flex-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: calc(100% - 32px);
|
||||
padding: 44px 32px;
|
||||
line-height: 42px;
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
margin-left: 16px;
|
||||
.label {
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 30px;
|
||||
color: #666;
|
||||
}
|
||||
.color-333{
|
||||
color: #333;
|
||||
}
|
||||
.color-ff6900 {
|
||||
color: #FF6900;
|
||||
}
|
||||
}
|
||||
.item-mar-b24 {
|
||||
border-radius: 32px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.border {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.footer{
|
||||
width: 100%;
|
||||
background: #FFF;
|
||||
border-top: 1px solid #ddd;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16px 32px;
|
||||
box-sizing: border-box;
|
||||
div {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(90deg, #FFA044 0%, #FF8436 100%);
|
||||
border-radius: 52px;
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user