小程序产品库完成
This commit is contained in:
424
src/mods/AppCreditPoints/AppCreditPoints.vue
Normal file
424
src/mods/AppCreditPoints/AppCreditPoints.vue
Normal file
@@ -0,0 +1,424 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="credit-points">
|
||||
<div class="fixed-top">
|
||||
<div class="header-tab" style="background-color:#197DF0;">
|
||||
<div class="tab-item" v-for="(item, index) in tabList" :key="index" @click="tabClick(index)">{{ item }}<span
|
||||
class="active-line" v-if="tabIndex == index"></span></div>
|
||||
</div>
|
||||
<div class="bg-blue"></div>
|
||||
<div class="header-content">
|
||||
<div class="item">
|
||||
<div class="num color-5AAD6A">{{ tabIndex == 0 ? info['家庭积分'] || '0' : Number(info['个人积分']) || '0' }}</div>
|
||||
<div class="label">{{ tabIndex == 0 ? '家庭' : '个人' }}总分</div>
|
||||
</div>
|
||||
<div class="item" v-if="tabIndex != 1">
|
||||
<div class="num color-4185F5">{{ tabIndex == 0 ? info['剩余总分'] || '0' : info['个人积分'] || '0' }}</div>
|
||||
<div class="label">剩余总分</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="num color-CD413A">{{ tabIndex == 0 ? info['家庭排行'] || '0' : info['个人排行'] || '0' }}</div>
|
||||
<div class="label">{{ tabIndex == 0 ? '家庭' : '个人' }}排名</div>
|
||||
</div>
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/credit/head.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!showDetail" style="padding-top:432rpx;">
|
||||
<div class="ranking-content" v-if="info['列表'] && info['列表'].length">
|
||||
<div class="item" v-if="info['列表'].length > 1">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/credit/2.png" alt="" class="top-img">
|
||||
<img :src="info['列表'][1].photo" alt="" class="user-img mar-b4" v-if="info['列表'][1].photo">
|
||||
<div class="user-name-bg mar-b4" v-else>{{ $formatName(info['列表'][1].name) }}</div>
|
||||
<p class="user-name mar-b8">{{ info['列表'][1].name }}{{ tabIndex == 0 ? '家' : '' }}</p>
|
||||
<p class="item-num">{{ info['列表'][1].integral }}</p>
|
||||
</div>
|
||||
<div class="item-top item" v-if="info['列表'].length > 0">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/credit/1.png" alt="" class="top-img-one">
|
||||
<img :src="info['列表'][0].photo" alt="" class="user-img mar-b4" v-if="info['列表'][0].photo">
|
||||
<div class="user-name-bg mar-b4" v-else>{{ $formatName(info['列表'][0].name) }}</div>
|
||||
<p class="user-name mar-b8">{{ info['列表'][0].name }}{{ tabIndex == 0 ? '家' : '' }}</p>
|
||||
<p class="item-num">{{ info['列表'][0].integral }}</p>
|
||||
</div>
|
||||
<div class="item" v-if="info['列表'].length > 2">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/credit/3.png" alt="" class="top-img">
|
||||
<img :src="info['列表'][2].photo" alt="" class="user-img mar-b4" v-if="info['列表'][2].photo">
|
||||
<div class="user-name-bg mar-b4" v-else>{{ $formatName(info['列表'][2].name) }}</div>
|
||||
<p class="user-name mar-b8">{{ info['列表'][2].name }}{{ tabIndex == 0 ? '家' : '' }}</p>
|
||||
<p class="item-num">{{ info['列表'][2].integral }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ranking-list" v-if="info['列表'] && info['列表'].length">
|
||||
<div class="item" v-for="(item, index) in info['列表']" :key="index" v-if="index > 2">
|
||||
<span class="item-num">{{ index + 1 }}</span>
|
||||
<img :src="item.photo" alt="" class="user-img mar-b4" v-if="item.photo">
|
||||
<div class="user-name-bg mar-b4 mar-r24" v-else>{{ $formatName(item.name) }}</div>
|
||||
<span class="item-name">{{ item.name }}{{ tabIndex == 0 ? '家' : '' }}</span>
|
||||
<span class="item-point">{{ item.integral }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-content" v-if="showDetail && list.length">
|
||||
<div class="title">积分明细</div>
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="item-info">
|
||||
<p>{{ tabIndex == 0 ? item.residentName + ':' : '' }}{{ item.description }}</p>
|
||||
<span> {{ item.doTime }}</span>
|
||||
</div>
|
||||
<div class="item-num" :class="'color-'+ (item.changeIntegral >= 0 ? 0 : 1)">
|
||||
{{ item.changeIntegral > 0 ? '+' + item.changeIntegral : item.changeIntegral }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "AppCreditPoints",
|
||||
appName: "信用积分",
|
||||
computed: {
|
||||
...mapState(['user', 'token'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabList: ['家庭积分', '个人积分'],
|
||||
tabIndex: 0,
|
||||
showDetail: false, //是否显示积分明细
|
||||
info: {},
|
||||
current: 1,
|
||||
list: [],
|
||||
areaId: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (uni.getStorageSync('areaId')) {
|
||||
this.areaId = uni.getStorageSync('areaId')
|
||||
} else {
|
||||
this.areaId = this.$areaId
|
||||
}
|
||||
if (options.type == 'detail') {
|
||||
this.showDetail = true
|
||||
this.getList()
|
||||
}
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.title
|
||||
})
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
tabClick(index) {
|
||||
this.tabIndex = index
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
},
|
||||
// 积分排行
|
||||
getInfo() {
|
||||
this.info = {}
|
||||
// var url = `/app/appresident/rank?id=00255e188d1225f3fe022cb4eed44a84&type=${this.tabIndex}` //积分排行
|
||||
var url = `/app/appresident/rank?id=${this.user.residentId}&type=${this.tabIndex}&areaId=${this.areaId}` //积分排行
|
||||
this.$instance.post(url).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 积分明细列表
|
||||
getList() {
|
||||
// var url = `/app/appvillagerintegraldetail/IntegralList?residentId=00255e188d1225f3fe022cb4eed44a84&type=${this.tabIndex}¤t=${this.current}&size=10` //积分明细
|
||||
var url = `/app/appvillagerintegraldetail/IntegralList?residentId=${this.user.residentId}&type=${this.tabIndex}¤t=${this.current}&size=10` //积分明细
|
||||
this.$instance.post(url).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (this.current > res.data.pages) {
|
||||
return
|
||||
}
|
||||
const records = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records;
|
||||
this.list = records
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
onReachBottom() {
|
||||
if (!this.showDetail) return
|
||||
this.current = this.current + 1;
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #f3f6f9;
|
||||
|
||||
.credit-points {
|
||||
.bg-blue {
|
||||
width: 100%;
|
||||
height: 176px;
|
||||
background-color: #197DF0;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
width: 690px;
|
||||
height: 256px;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
margin: -130px 0 40px 30px;
|
||||
padding: 100px 60px 40px 60px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
|
||||
.item {
|
||||
text-align: center;
|
||||
z-index: 99;
|
||||
|
||||
.num {
|
||||
font-family: DIN;
|
||||
font-size: 52px;
|
||||
font-weight: bold;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 40px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.color-5AAD6A {
|
||||
color: #5AAD6A;
|
||||
}
|
||||
|
||||
.color-4185F5 {
|
||||
color: #4185F5;
|
||||
}
|
||||
|
||||
.color-CD413A {
|
||||
color: #CD413A;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
width: 360px;
|
||||
height: 250px;
|
||||
top: -40px;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.ranking-content {
|
||||
padding: 94px 30px 0;
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
width: 216px;
|
||||
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.12);
|
||||
border-radius: 12px;
|
||||
padding: 40px 0 76px 0;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.user-name {
|
||||
font-size: 30px;
|
||||
font-family: PingFang-SC-Medium, PingFang-SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 42px;
|
||||
}
|
||||
|
||||
.item-num {
|
||||
font-size: 46px;
|
||||
font-weight: 6000;
|
||||
color: #2C51CE;
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.top-img {
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
position: absolute;
|
||||
top: -11px;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-top {
|
||||
margin: -46px 20px 0;
|
||||
|
||||
.user-img {
|
||||
width: 104px;
|
||||
height: 104px;
|
||||
}
|
||||
|
||||
.user-name-bg {
|
||||
width: 104px;
|
||||
height: 104px;
|
||||
border-radius: 50%;
|
||||
background-color: #4E8EEE;
|
||||
font-size: 28px;
|
||||
line-height: 104px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.top-img-one {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: -22px;
|
||||
left: 0;
|
||||
height: 46px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ranking-list {
|
||||
background-color: #fff;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
background: #FFF;
|
||||
padding: 0 64px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.item-num {
|
||||
display: inline-block;
|
||||
width: 68px;
|
||||
color: #858594;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.user-img {
|
||||
margin-right: 24px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
color: #333;
|
||||
font-size: 30px;
|
||||
display: inline-block;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
.item-point {
|
||||
display: inline-block;
|
||||
width: 210px;
|
||||
text-align: right;
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.mar-r24 {
|
||||
margin-right: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user-img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-name-bg {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
background-color: #4E8EEE;
|
||||
font-size: 28px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mar-b4 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mar-b8 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
width: 690px;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
margin: 432px 0 0 32px;
|
||||
padding: 30px 30px 94px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
font-size: 34px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 48px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 34px 0 32px 0;
|
||||
border-bottom: 2px solid #ddd;
|
||||
display: flex;
|
||||
|
||||
.item-info {
|
||||
width: 500px;
|
||||
|
||||
p {
|
||||
word-break: break-all;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
margin-top: 8px;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
line-height: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-num {
|
||||
width: calc(100% - 500px);
|
||||
text-align: right;
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
line-height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.color-0 {
|
||||
color: #2C51CE !important;
|
||||
}
|
||||
|
||||
.color-1 {
|
||||
color: #E6736E !important;
|
||||
}
|
||||
|
||||
.fixed-top {
|
||||
z-index: 999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
70
src/mods/AppCreditPoints/result.vue
Normal file
70
src/mods/AppCreditPoints/result.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="service-result">
|
||||
<image :src="type === '0' ? '/static/img/service-success.png' : '/static/img/error.png'"/>
|
||||
<h2>{{ type === '1' ? '领取失败!请联系管理员处理' : '提交成功!' }}</h2>
|
||||
<div class="text" v-if="type === '0'">请等待信用好超市管理员与您联系</div>
|
||||
<div class="service-btn" hover-class="text-hover" @click="back">确定</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: '0'
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.type = query.type
|
||||
},
|
||||
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.service-result {
|
||||
min-height: 100vh;
|
||||
padding-top: 96px;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
|
||||
.service-btn {
|
||||
width: 558px;
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
margin: 64px auto 0;
|
||||
text-align: center;
|
||||
background: #197DF0;
|
||||
font-size: 36px;
|
||||
color: #fff;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.02);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 8px;
|
||||
color: #333333;
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 32px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 192px;
|
||||
height: 192px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
243
src/mods/AppCreditPoints/submitOrder.vue
Normal file
243
src/mods/AppCreditPoints/submitOrder.vue
Normal file
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<div class="order">
|
||||
<div class="order-info">
|
||||
<h2>{{ userName }}家</h2>
|
||||
<span>剩余积分:{{ familyIntegral }}分</span>
|
||||
</div>
|
||||
<image class="line" src="/static/img/line.png"/>
|
||||
<div class="order-list">
|
||||
<div class="order-item" v-for="(item, index) in goods" :key="index">
|
||||
<image :src="item.photo[0].url"/>
|
||||
<div class="order-item__right flex1">
|
||||
<h2>{{ item.merchandiseName }}</h2>
|
||||
<div class="order-item__right--info">
|
||||
<span>{{ item.costIntegral }}</span>
|
||||
<i>积分</i>
|
||||
</div>
|
||||
<div class="item-bottom">
|
||||
<div></div>
|
||||
<div class="item-bottom__right">
|
||||
<span>x {{ item.num }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-footer">
|
||||
<div class="goods-footer__bottom">
|
||||
<div class="goods-footer__bottom__left">
|
||||
<h3>共{{ total }}件商品</h3>
|
||||
<div class="goods-footer__bottom--middle">
|
||||
<span>合计 :</span>
|
||||
<i>{{ money }}</i>
|
||||
<em>积分</em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-footer__bottom--btn" @click="submit" hover-class="text-hover">确认提交</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
money: 0,
|
||||
goods: [],
|
||||
memberId: '',
|
||||
userName: '',
|
||||
familyId: '',
|
||||
familyIntegral: 0
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.userName = query.userName
|
||||
this.total = query.total
|
||||
this.familyIntegral = query.familyIntegral
|
||||
this.money = query.money
|
||||
this.memberId = query.memberId
|
||||
this.familyId = query.familyId
|
||||
this.goods = JSON.parse(query.goods)
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.$loading()
|
||||
this.$instance.post(`/app/appvillagerintegralshoporder/createOrderForWx`, {
|
||||
memberId: this.memberId,
|
||||
familyId: this.familyId,
|
||||
orderIntegral: this.money,
|
||||
shopId: this.goods[0].shopId,
|
||||
merchandiseList: this.goods.map(item => {
|
||||
return {
|
||||
merchandiseId: item.id,
|
||||
merchandiseNumber: item.num
|
||||
}
|
||||
})
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.$emit('update')
|
||||
this.$linkTo('./result?type=0')
|
||||
} else {
|
||||
this.$linkTo('./result?type=1')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order {
|
||||
min-height: 100%;
|
||||
background: #fff;
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
.order-item {
|
||||
display: flex;
|
||||
padding: 28px 30px 44px;
|
||||
|
||||
.order-item__right--info {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
span {
|
||||
margin-right: 8px;
|
||||
color: #FA4A51;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
i {
|
||||
color: #FA4A51;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 2px;
|
||||
margin-bottom: 30px;
|
||||
color: #333333;
|
||||
font-size: 30px;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
& > image {
|
||||
width: 192px;
|
||||
height: 192px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
margin-top: 20px;
|
||||
padding-bottom: 110px;
|
||||
}
|
||||
|
||||
.order-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 128px;
|
||||
padding: 030px;
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.goods-footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 11;
|
||||
width: 100%;
|
||||
box-shadow: 0px -1px 4px 0px rgba(214, 214, 214, 0.5);
|
||||
background: #fff;
|
||||
|
||||
.goods-footer__bottom--btn {
|
||||
width: 212px;
|
||||
height: 104px;
|
||||
line-height: 104px;
|
||||
font-size: 36px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: #197DF0;
|
||||
}
|
||||
|
||||
.goods-footer__bottom__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
padding: 032px h3 {
|
||||
color: #F94246;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.goods-footer__bottom--middle {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
span {
|
||||
color: #F94246;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
i {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
margin-right: 6px;
|
||||
color: #FA444B;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
em {
|
||||
color: #F94246;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-footer__bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 104px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 28px;
|
||||
|
||||
.item-bottom__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 90px;
|
||||
height: 60px;
|
||||
padding: 020px;
|
||||
margin: 010px;
|
||||
background: #F6F6F6;
|
||||
border-radius: 10px;
|
||||
font-size: 26px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
450
src/mods/AppCreditPoints/supermarket.vue
Normal file
450
src/mods/AppCreditPoints/supermarket.vue
Normal file
@@ -0,0 +1,450 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="supermarket">
|
||||
<div class="fixed-top title" @click="$linkTo(`./system?areaName=${areaName}`)"
|
||||
v-if="propAreaId == '341021104000'">{{ areaName }}信用好超市管理制度,点击查看 >>
|
||||
</div>
|
||||
<div class="goods-list" v-if="numList.length"
|
||||
:style="propAreaId == '341021104000' ? 'padding-top:80px' : 'padding-top: 0;'">
|
||||
<div class="left">
|
||||
<div
|
||||
:class="numIndex == index ? 'item active' : 'item'"
|
||||
v-for="(item, index) in numList"
|
||||
:key="index"
|
||||
@click="numClick(index)">
|
||||
<i v-show="item.total > 0">{{ item.total }}</i>
|
||||
{{ item.type }}分区
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="item" v-for="(item, index) in goodsList[numIndex]" :key="index">
|
||||
<img :src="item.photo[0].url" alt="">
|
||||
<div class="item-info">
|
||||
<p class="item-name">{{ item.merchandiseName }}</p>
|
||||
<div class="item-point"><span class="num">{{ item.costIntegral }}</span>积分</div>
|
||||
<div class="item-bottom">
|
||||
<div></div>
|
||||
<div class="item-bottom__right">
|
||||
<image v-show="item.num > 0" @click="cut(numIndex, index)" src="/static/img/cut.png"/>
|
||||
<input v-show="item.num > 0" v-model="item.num">
|
||||
<image src="/static/img/add.png" @click="add(numIndex, index)"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-else/>
|
||||
<div class="goods-footer" v-if="numList.length">
|
||||
<div class="goods-footer__top">
|
||||
<h2>{{ userInfo.familyName || user.nickName }}{{ userInfo.familyName ? '家' : '' }}</h2>
|
||||
<span>剩余积分:{{ userInfo.familyIntegral || 0 }}分</span>
|
||||
</div>
|
||||
<div class="goods-footer__bottom">
|
||||
<div class="goods-footer__bottom__left">
|
||||
<h3>共{{ total }}件商品</h3>
|
||||
<div class="goods-footer__bottom--middle">
|
||||
<span>合计 :</span>
|
||||
<i>{{ money }}</i>
|
||||
<em>积分</em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-footer__bottom--btn" @click="toOrder" hover-class="text-hover">去结算</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'supermarket',
|
||||
|
||||
data() {
|
||||
return {
|
||||
numList: [],
|
||||
numIndex: 0,
|
||||
goodsList: [],
|
||||
areaId: '',
|
||||
userInfo: {},
|
||||
areaName: '',
|
||||
propAreaId: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['global', 'user', 'token']),
|
||||
|
||||
total() {
|
||||
let total = 0
|
||||
if (!this.numList.length) {
|
||||
return total
|
||||
}
|
||||
|
||||
this.numList.forEach(item => {
|
||||
total = item.total + total
|
||||
})
|
||||
|
||||
return total
|
||||
},
|
||||
|
||||
money() {
|
||||
let money = 0
|
||||
if (!this.goodsList.length) {
|
||||
return money
|
||||
}
|
||||
|
||||
this.goodsList.forEach(arr => {
|
||||
arr.forEach(item => {
|
||||
money = money + Number(item.num) * item.costIntegral
|
||||
})
|
||||
})
|
||||
|
||||
return money
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.propAreaId = this.$areaId
|
||||
uni.$on('update', () => {
|
||||
this.getInfo()
|
||||
})
|
||||
|
||||
if (uni.getStorageSync('areaId')) {
|
||||
this.areaId = uni.getStorageSync('areaId')
|
||||
}
|
||||
this.getUserInfo()
|
||||
this.getInfo()
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
this.$instance.post(`/admin/area/queryAreaByAreaid?id=${this.areaId}`, null, {}).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.data) {
|
||||
this.areaName = res.data.name
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getUserInfo() {
|
||||
this.$instance.post(`/app/appresident/queryFamilyById?id=${this.user.residentId}`, null, {}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.userInfo = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toOrder() {
|
||||
if (this.user.status == 0) {
|
||||
if (!this.user.phone) {
|
||||
return this.$linkTo('/pages/phone/bingPhoneNumber?from=auth')
|
||||
} else {
|
||||
return this.$linkTo('/pages/auth/authenticationInfo')
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.total) {
|
||||
return this.$toast('请选择商品')
|
||||
}
|
||||
|
||||
if (this.money > this.userInfo.familyIntegral) {
|
||||
return this.$toast('积分不足')
|
||||
}
|
||||
|
||||
let goods = []
|
||||
|
||||
this.goodsList.forEach(arr => {
|
||||
arr.forEach(item => {
|
||||
if (item.num) {
|
||||
goods.push(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.$linkTo(`./submitOrder?familyId=${this.userInfo.familyId}&userName=${this.userInfo.familyName}&memberId=${this.userInfo.memberId}&goods=${JSON.stringify(goods)}&total=${this.total}&money=${this.money}&familyIntegral=${this.userInfo.familyIntegral}`)
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.$instance.post(`/app/appvillagerintegralmerchandise/listByIntegral?areaId=${this.areaId}`, null, {}).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.data) {
|
||||
this.numList = Object.keys(res.data).map(item => {
|
||||
return {
|
||||
type: item,
|
||||
total: 0
|
||||
}
|
||||
})
|
||||
this.goodsList = Object.values(res.data).map((item) => {
|
||||
item.map((items) => {
|
||||
items.num = 0
|
||||
items.photo = JSON.parse(items.photo)
|
||||
|
||||
return items
|
||||
})
|
||||
|
||||
return item
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
add(index, i) {
|
||||
this.$set(this.goodsList[index][i], 'num', Number(this.goodsList[index][i].num) + 1)
|
||||
|
||||
let total = 0
|
||||
this.goodsList[index].forEach(item => {
|
||||
total = total + item.num
|
||||
})
|
||||
|
||||
this.$set(this.numList[index], 'total', total)
|
||||
},
|
||||
|
||||
cut(index, i) {
|
||||
this.$set(this.goodsList[index][i], 'num', Number(this.goodsList[index][i].num) - 1)
|
||||
|
||||
let total = 0
|
||||
this.goodsList[index].forEach(item => {
|
||||
total = total + item.num
|
||||
})
|
||||
|
||||
this.$set(this.numList[index], 'total', total)
|
||||
},
|
||||
|
||||
numClick(index) {
|
||||
this.numIndex = index
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.item-bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 28px;
|
||||
|
||||
.item-bottom__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 90px;
|
||||
height: 60px;
|
||||
padding: 020px;
|
||||
margin: 010px;
|
||||
background: #F6F6F6;
|
||||
border-radius: 10px;
|
||||
font-size: 26px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 111;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
|
||||
.goods-footer__top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 80px;
|
||||
padding: 030px;
|
||||
background: #EFF4FF;
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.goods-footer__bottom--btn {
|
||||
width: 212px;
|
||||
height: 104px;
|
||||
line-height: 104px;
|
||||
font-size: 36px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: #197DF0;
|
||||
}
|
||||
|
||||
.goods-footer__bottom__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
padding: 032px h3 {
|
||||
color: #F94246;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.goods-footer__bottom--middle {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
span {
|
||||
color: #F94246;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
i {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
margin-right: 12px;
|
||||
color: #FA444B;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
em {
|
||||
color: #F94246;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-footer__bottom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 104px;
|
||||
}
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
|
||||
.supermarket {
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
background: #EFF4FF;
|
||||
padding-left: 30px;
|
||||
color: #3A7EE2;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
// padding-top:80px; padding-bottom: 184px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow-y: hidden;
|
||||
|
||||
.left {
|
||||
width: 168px;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
float: left;
|
||||
background: #FAF9FB;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 104px;
|
||||
line-height: 1.1;
|
||||
border-bottom: 2px solid #D8E5FF;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
font-size: 28px;
|
||||
border-left: 6px solid #FAF9FB;
|
||||
|
||||
i {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 8px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
padding: 012px;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
border-radius: 13px;
|
||||
background: #FB4E44;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
border-left: 6px solid #1D58FE;
|
||||
background: linear-gradient(270deg, #FFFFFF 0%, #FFFFFF 77%, #E7EAFA 100%);
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
float: left;
|
||||
width: calc(100% - 168px);
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
padding: 28px 30px 44px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 192px;
|
||||
height: 192px;
|
||||
border: 2px solid #D7D5D5;
|
||||
}
|
||||
|
||||
.item-info {
|
||||
display: inline-block;
|
||||
width: 276px;
|
||||
padding-left: 30px;
|
||||
vertical-align: top;
|
||||
|
||||
.item-name {
|
||||
width: 100%;
|
||||
word-break: break-all;
|
||||
line-height: 42px;
|
||||
margin-bottom: 30px;
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.item-point {
|
||||
color: #FA4A51;;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FA4A51;
|
||||
line-height: 34px;
|
||||
|
||||
.num {
|
||||
font-size: 40px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
76
src/mods/AppCreditPoints/system.vue
Normal file
76
src/mods/AppCreditPoints/system.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="system">
|
||||
<div class="title">信用好超市管理制度</div>
|
||||
<p class="mini-title underline">为规范信用好超市管理流程,保证信用好超市正常运行,结合{{ areaName }}实际,特制定本制度。</p>
|
||||
<p class="text">1、每月15日、30日各开放1次,时间分别为<span class="underline">上午9:00-11:00;下午14:30-16:30。</span></p>
|
||||
<p class="text">2、信用好超市每月清点兑换物品,及时补充兑换货物,确保货物充足,品类丰富。</p>
|
||||
<p class="text">3、本超市管理人员应严格按照信用券兑换标准执行兑换并及时记录信用户的积分兑换记录。</p>
|
||||
<p class="text">4、超市开放时间段管理员必须在岗在位,热情开展兑换服务,确保公平公正,严禁态度蛮横、弄虚作假。</p>
|
||||
<p class="text">5、信用户凭借信用券根据自己的实际需要,在本超市内自主选择所需的物品,并由管理员登记确认。</p>
|
||||
<p class="text">6、信用好超市内环境卫生干净整洁,超市内禁止吸烟等其他不文明行为。</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "my",
|
||||
computed: {
|
||||
...mapState(['user', 'token'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
areaName: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.areaName = options.areaName
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../../common/common.scss";
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
|
||||
.system {
|
||||
padding: 030px;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
font-size: 34px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
}
|
||||
|
||||
.mini-title {
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #222;
|
||||
line-height: 48px;
|
||||
margin-bottom: 32px;
|
||||
width: 100%;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.text {
|
||||
width: 100%;
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
margin-bottom: 20px;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user