持续集成分支

This commit is contained in:
aixianling
2024-10-31 14:34:57 +08:00
parent 6a833be062
commit 8c56cf808b
2165 changed files with 4116 additions and 8716 deletions

View File

@@ -0,0 +1,471 @@
<template>
<div class="AppSupermarket">
<AiTopFixed>
<!-- <div class="area-content">
<AiAreaPicker :areaId="user.areaId" :value="areaId" @select="areaSelect" :name.sync="areaName">
<img src="./components/img/local-icon.png" alt="">
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="24"/>
</AiAreaPicker>
</div> -->
<div class="header-top">
<div>区域选择</div>
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" selectRoot>
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-right" color="#666" size="24" style="margin-left:4px;" />
</AiAreaPicker>
</div>
</AiTopFixed>
<div class="goods-list" v-if="numList.length">
<div class="left">
<div :class="numIndex == index ? 'item active' : 'item'" v-for="(item, index) in numList" :key="index" @click="numClick(index)">
<span v-show="item.total > 0">{{ item.total }}</span>
{{ 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="./components/img/cut.png"/>
<input v-show="item.num > 0" v-model="item.num" />
<image src="./components/img/add.png" @click="add(numIndex, index)" />
</div>
</div>
</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据,请选择到村/社区" v-if="!isAreaId && !numList.length"/>
<AiEmpty description="暂无数据" v-if="isAreaId && !numList.length" />
<div class="goods-footer" v-if="numList.length">
<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>
</template>
<script>
import { mapState } from "vuex";
export default {
name: "AppSuperMarket",
appName: '积分兑换',
data() {
return {
numList: [],
numIndex: 0,
goodsList: [],
areaId: "",
areaName: "",
userInfo: {},
propAreaId: "",
isAreaId: false
};
},
computed: {
...mapState(["user"]),
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.areaId = this.user.areaId
if(/[^0]0{0,2}$/.test(this.areaId)) {
this.isAreaId = true
this.getList()
}else {
this.isAreaId = false
}
this.areaName = this.user.areaName || ''
},
onShow() {
document.title = '积分超市'
},
methods: {
toOrder() {
if (!this.total) {
return this.$u.toast("请选择商品");
}
let goods = [];
this.goodsList.forEach((arr) => {
arr.forEach((item) => {
if (item.num) {
goods.push(item);
}
});
});
uni.navigateTo({ url: `./SubmitOrder?goods=${JSON.stringify(goods)}&total=${this.total}&money=${this.money}&areaId=${this.areaId}` })
},
areaSelect(e) {
if(/[^0]0{0,2}$/.test(e)) {
this.areaId = e
this.isAreaId = true
this.getList()
}else {
this.numList = []
this.isAreaId = false
}
},
getList() {
this.$http.post(`/app/appvillagerintegralmerchandise/listByIntegral?areaId=${this.areaId}`).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;
if(items.photo) {
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">
uni-page-body{
height: 100%;
background-color: #fff;
}
.header-top {
display: flex;
background: #fff;
justify-content: space-between;
align-items: center;
padding-top: 16px;
}
.area-content {
width: 100%;
line-height: 64px;
img {
width: 42px;
vertical-align: middle;
margin-right: 16px;
}
.u-icon {
margin-left: 6px;
}
}
.item-bottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 28rpx;
.item-bottom__right {
display: flex;
align-items: center;
height: 60rpx;
}
image {
width: 27rpx;
height: 27rpx;
}
input {
width: 90rpx;
height: 60rpx;
padding: 0 20rpx;
margin: 0 10rpx;
background: #f6f6f6;
border-radius: 10rpx;
font-size: 26rpx;
color: #666;
text-align: center;
}
}
.goods-footer {
position: fixed;
left: 0;
bottom: 0;
z-index: 1;
width: 100%;
background: #fff;
.goods-footer__top {
display: flex;
align-items: center;
justify-content: space-between;
height: 80rpx;
padding: 0 30rpx;
background: #eff4ff;
color: #333333;
font-size: 32px;
}
.goods-footer__bottom--btn {
width: 212rpx;
height: 104rpx;
line-height: 104rpx;
font-size: 36rpx;
color: #fff;
text-align: center;
background: #197df0;
}
.goods-footer__bottom__left {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
padding: 0 32rpx;
h3 {
color: #f94246;
font-size: 32rpx;
}
.goods-footer__bottom--middle {
display: flex;
align-items: baseline;
span {
color: #f94246;
font-size: 32rpx;
}
i {
position: relative;
top: 2rpx;
margin-right: 12px;
color: #fa444b;
font-size: 40rpx;
}
em {
color: #f94246;
font-size: 24rpx;
}
}
}
.goods-footer__bottom {
display: flex;
align-items: center;
justify-content: space-between;
height: 104rpx;
}
}
.AppSupermarket {
height: 100%;
overflow-y: hidden;
.title {
width: 100%;
height: 80rpx;
line-height: 80rpx;
background: #eff4ff;
padding-left: 30rpx;
color: #3a7ee2;
font-size: 28rpx;
}
.goods-list {
// padding-top: 80rpx;
padding-bottom: 184px;
height: 100%;
box-sizing: border-box;
overflow-y: hidden;
.left {
width: 168rpx;
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: 104rpx;
line-height: 1.1;
border-bottom: 2rpx solid #d8e5ff;
text-align: center;
color: #333;
font-size: 28rpx;
border-left: 6rpx solid #faf9fb;
span {
position: absolute;
right: 8rpx;
top: 8rpx;
// width: 28px;;
height: 28px;
line-height: 28px;
padding: 0 9px;
text-align: center;
color: #fff;
font-size: 10px;
border-radius: 14px;
background: #fb4e44;
}
}
.active {
border-left: 6rpx solid #1d58fe;
background: linear-gradient(
270deg,
#ffffff 0%,
#ffffff 77%,
#e7eafa 100%
);
}
}
.right {
float: left;
width: calc(100% - 168rpx);
height: 100%;
overflow-y: scroll;
.item {
width: 100%;
padding: 28rpx 30rpx 44rpx;
box-sizing: border-box;
img {
width: 192rpx;
height: 192rpx;
border: 2rpx solid #d7d5d5;
}
.item-info {
display: inline-block;
width: 276rpx;
padding-left: 30rpx;
vertical-align: top;
.item-name {
width: 100%;
word-break: break-all;
line-height: 42rpx;
margin-bottom: 30rpx;
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
.item-point {
color: #fa4a51;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
line-height: 34rpx;
.num {
font-size: 40rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-right: 8rpx;
}
}
}
}
}
}
}
i{
font-style: normal;
}
</style>

View File

@@ -0,0 +1,82 @@
<template>
<div class="Search">
<AiTopFixed>
<u-search placeholder="请输入手机号或身份证号码搜索" :show-action="false" search-icon-color="#ccc" v-model="phone" @search="getList()"/>
</AiTopFixed>
<div class="family-list" v-if="familyInfo.familyId">
<div class="item" @click="goBack">
<div class="name">{{familyInfo.familyName}}</div>
<div class="num">剩余积分:{{familyInfo.familyIntegral}}</div>
</div>
</div>
<p class="text" v-else>请通过搜索<span>手机号或身份证号</span>后选择结算对象</p>
</div>
</template>
<script>
export default {
name: 'Search',
data() {
return {
phone: '',
familyInfo: {},
areaId: ''
};
},
onLoad(options) {
this.areaId = options.areaId
},
onShow() {
document.title = '搜索'
},
methods: {
getList() {
this.$http.post(`/app/appresident/queryFamilyByPhone?phone=${this.phone}&areaId=${this.areaId}`).then(res => {
if (res.code === 0 && res.data) {
this.familyInfo = res.data
}
}).catch((err) => {
this.$confirm(err, '温馨提示').then()
})
},
goBack() {
uni.$emit('selectFamily', this.familyInfo)
uni.navigateBack()
}
},
};
</script>
<style scoped lang="scss">
uni-page-body{
height: 100%;
background-color: #fff;
}
.Search {
::v-deep .u-search{
margin-bottom: 0!important;
}
.text{
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
margin-top: 120px;
text-align: center;
span{
color: #135AB8;
}
}
.item{
line-height: 44px;
padding: 34px 56px;
background: #FFF;
border-bottom: 1px solid #D8DDE6;
display: flex;
justify-content: space-between;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
}
}
</style>

View File

@@ -0,0 +1,278 @@
<template>
<div class="order">
<div class="order-info">
<div><span class="tips">*</span>结算对象</div>
<div class="family-name" @click="toSearch">
<span v-if="familyInfo.familyId" class="name">{{familyInfo.familyName}} 剩余积分:{{familyInfo.familyIntegral}}</span>
<span v-else class="name">请选择</span>
<u-icon name="arrow-right" color="#666" size="24" style="margin-left:4px;" />
</div>
</div>
<image class="line" src="./components/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: [],
areaId: '',
familyInfo: {}
}
},
onLoad (options) {
this.total = options.total
this.money = options.money
this.goods = JSON.parse(options.goods)
this.areaId = options.areaId
uni.$on('selectFamily', res => {
console.log(res)
this.familyInfo = res
})
},
onShow() {
document.title = '结算'
},
methods: {
toSearch() {
uni.navigateTo({url: `./Search?areaId=${this.areaId}`})
},
submit() {
if(!this.familyInfo.familyId) {
return this.$u.toast('请选择结算对象')
}
this.$http.post(`/app/appvillagerintegralshoporder/createOrderForWx`, {
memberId: this.familyInfo.memberId,
familyId: this.familyInfo.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.navigateTo({url: `./Success?status=1`})
}
}).catch((err) => {
this.$u.toast(err)
})
}
},
}
</script>
<style lang="scss" scoped>
.order {
min-height: 100%;
background: #fff;
.line {
width: 100%;
height: 8rpx;
}
.order-item {
display: flex;
padding: 28rpx 30rpx 44rpx;
.order-item__right{
width: calc(100% - 230rpx);
}
.order-item__right--info {
display: flex;
align-items: baseline;
span {
margin-right: 8rpx;
color: #FA4A51;
font-size: 40rpx;
}
i {
color: #FA4A51;
font-size: 24rpx;
}
}
h2 {
margin-top: 2rpx;
margin-bottom: 30rpx;
color: #333333;
font-size: 30rpx;
text-align: justify;
}
& > image {
width: 192rpx;
height: 192rpx;
margin-right: 30rpx;
}
}
.order-list {
margin-top: 20rpx;
padding-bottom: 110rpx;
}
.order-info {
display: flex;
justify-content: space-between;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
padding: 40px 30px 20px 30px;
.tips{
display: inline-block;
width: 16px;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #FF4466;
margin-right: 4px;
}
.family-name{
color: #666;
width: calc(100% - 170px);
.name{
display: inline-block;
width: calc(100% - 40px);
word-break: break-all;
text-align: right;
}
}
}
.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: 212rpx;
height: 104rpx;
line-height: 104rpx;
font-size: 36rpx;
color: #fff;
text-align: center;
background: #197DF0;
}
.goods-footer__bottom__left {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
padding: 0 32rpx;
h3 {
color: #F94246;
font-size: 32rpx;
font-weight: normal;
}
.goods-footer__bottom--middle {
display: flex;
align-items: baseline;
span {
color: #F94246;
font-size: 32rpx;
}
i {
position: relative;
top: 2rpx;
margin-right: 6px;
color: #FA444B;
font-size: 40rpx;
}
em {
color: #F94246;
font-size: 24rpx;
}
}
}
.goods-footer__bottom {
display: flex;
align-items: center;
justify-content: space-between;
height: 104rpx;
}
}
.item-bottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 28rpx;
.item-bottom__right {
display: flex;
align-items: center;
color: #666;
}
image {
width: 40rpx;
height: 40rpx;
}
input {
width: 90rpx;
height: 60rpx;
padding: 0 20rpx;
margin: 0 10rpx;
background: #F6F6F6;
border-radius: 10rpx;
font-size: 26rpx;
color: #666;
}
}
}
i{
font-style: normal;
}
</style>

View File

@@ -0,0 +1,69 @@
<template>
<div class="success">
<img src="./components/img/success.png" alt="" v-if="status == 1">
<img src="./components/img/fail.png" alt="" v-else>
<p>{{status == 1 ? '领取成功!' : '领取失败!请联系管理员处理'}}</p>
<div class="footer" @click="back">{{status == 1 ? '确定' : '我知道了'}}</div>
<AiBack @click="back" />
</div>
</template>
<script>
export default {
data() {
return {
status: 1
}
},
onShow() {
document.title = '结算提交'
},
onLoad(option) {
console.log(option)
this.status = option.status
},
methods: {
back() {
uni.navigateBack({delta: 2})
}
},
}
</script>
<style lang="scss" scoped>
uni-page-body{
height: 100%;
background-color: #fff;
}
.success {
text-align: center;
img{
width: 192px;
height: 192px;
margin: 96px 0 16px 0;
}
p{
line-height: 50px;
color: #333;
font-size: 36px;
font-weight: 500;
text-align: center;
margin-bottom: 72px;
}
.footer{
width: calc(100% - 96px);
height: 88px;
line-height: 88px;
background: #1365DD;
box-shadow: inset 0px 1px 0px 0px #EEEEEE;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
text-align: center;
border-radius: 8px;
margin-left: 48px;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB