7.17(优化

This commit is contained in:
Hong
2024-07-17 18:53:18 +08:00
parent 2febfcd87c
commit 8c0ef6bfb7
12 changed files with 194 additions and 134 deletions

View File

@@ -344,4 +344,14 @@ export function getAddressList(params) {
'method': 'get',
params
})
}
/**
* 获取未参加任务
*/
export function getJoinNum() {
return request({
'url': '/api/front/task/join/num',
'method': 'get'
})
}

View File

@@ -33,7 +33,8 @@
<view class="home-income-top-left f-26 c666">
本月预估收益
</view>
<view class="home-income-top-right f-28" @click="$tab.navigateTo('/pages/welfare/invite/invite_commission')">
<view class="home-income-top-right f-28"
@click="$tab.navigateTo('/pages/welfare/invite/invite_commission')">
我的收益
</view>
<view class="home-income-center flex justify-center align-center">
@@ -55,6 +56,7 @@
<view class="function-list flex justify-around flex-wrap">
<view class="function-list-cont" v-for="(item,index) in functionList" :key="index"
@click="navigatorFn(item)">
<text v-if="index==5" class="subscript">{{subscriptNum}}</text>
<image style="width: 68rpx;height: 68rpx;" :src="item.imgae" mode=""></image>
<view class="f-24 c333">{{item.title}}</view>
</view>
@@ -133,9 +135,12 @@
mapGetters
} from 'vuex'
import {
brannerList
brannerList,
getJoinNum
} from '@/api/system/config'
import {getLocationFn} from "@/utils/index.js"
import {
getLocationFn
} from "@/utils/index.js"
export default {
computed: {
...mapGetters(['citySave'])
@@ -156,6 +161,8 @@
name: '玩转滴友',
type: 2
}],
//角标数
subscriptNum: 0
};
},
methods: {
@@ -224,16 +231,23 @@
this.brannerList = res.data.list
})
},
//获取未参加任务
getJoinNumFn() {
getJoinNum().then(res => {
this.subscriptNum = res.data
console.log(res);
})
},
// 点击轮播图
brannerClick(e) {
if (this.brannerList[e].linkType == 0 || this.brannerList[e].linkType == 2 ||
this.brannerList[e].linkType == 3) {
if (this.brannerList[e].linkType == 0 || this.brannerList[e].linkType == 2 ||
this.brannerList[e].linkType == 3) {
let linkObj = this.brannerList[e].minLinkUrl
uni.navigateTo({
url: linkObj
})
}else if(this.brannerList[e].linkType == 1){
let linkObj = this.brannerList[e].minLinkUrl
} else if (this.brannerList[e].linkType == 1) {
let linkObj = this.brannerList[e].minLinkUrl
uni.navigateTo({
url: `/pagesA/rebate/rebate_web?contract=${linkObj}`
})
@@ -258,10 +272,13 @@
}
},
onLoad() {
//获取角标数
this.getJoinNumFn()
//获取轮播图
this.getBrannerList()
//获取社区分类
this.categoryTypeListFn()
//获取当前位置
getLocationFn()
},
@@ -364,6 +381,21 @@
.function-list-cont {
width: 170rpx;
margin-bottom: 34rpx;
position: relative;
.subscript {
min-width: 32rpx;
height: 32rpx;
line-height: 32rpx;
position: absolute;
top: -16rpx;
right: 32rpx;
padding: 4rpx;
background-color: red;
border-radius: 15px;
color: #ffffff;
z-index: 999;
}
}
}
@@ -384,8 +416,8 @@
position: relative;
top: 0rpx;
width: 750rpx;
.brand-name {
height: 68rpx;
max-width: 180rpx;

View File

@@ -52,7 +52,7 @@
{{ detail.stopTime }}
</view>
</view>
<view class="user-list flex-wrap justify-between mt-3">
<view class="user-list flex-wrap mt-3">
<view :class="['image-box', 'mt-2',index%5 == 4 && 'image-box_1' ]"
v-for="(item,index) in templateData.helpNum" :key="index">
<image class="img" v-if="detail.helpList[index]" :src="detail.helpList[index].avatar" mode="">
@@ -62,12 +62,15 @@
</view>
</view>
<view class="mt-4 mb-4" v-if="detail.isJoin">
<u-button shape="circle" color="linear-gradient(90deg, #0BCBC2 0%, #0090FA 100%)"
<u-button v-if="(templateData.helpNum - detail.userHelpNum)>0" shape="circle" color="linear-gradient(90deg, #0BCBC2 0%, #0090FA 100%)"
@click="sureBtn(1)">继续邀请
<text v-if="helpGenre==2">{{detail.title}}</text>
<text v-else-if="helpGenre==0">{{detail.name}}</text>
<text v-else>{{detail.title}}</text>
</u-button>
<u-button v-else @click="navActivity" shape="circle"
color="linear-gradient(90deg, #0BCBC2 0%, #0090FA 100%)">助力完成
</u-button>
</view>
</view>
<view v-else class="activity-time flex align-center justify-between">
@@ -358,7 +361,13 @@
// this.content=res.data.content
// this.joinNum=res.data.joinNum
})
}
},
//我的活动
navActivity(){
uni.navigateTo({
url:'/pages/mine/my_activity/my_activity'
})
},
},
onLoad(option) {
this.id = option.id

View File

@@ -1,16 +1,17 @@
<template>
<z-paging ref="paging" v-model="cardProductList" @query="queryList" :fixed="false" use-page-scroll auto-full-height >
<z-paging ref="paging" v-model="cardProductList" @query="queryList" :fixed="false" use-page-scroll auto-full-height>
<view class="coupons">
<!-- 城市 搜索 -->
<view class="positioningcity">
<view class="posi_l"@click="$tab.navigateTo('/pagesA/serve/repair/re_create/select_city')">
<view class="posi_l" @click="$tab.navigateTo('/pagesA/serve/repair/re_create/select_city')">
<view class="l_txt">{{selectCity||'杭州'}}</view>
<!-- <u-icon name="arrow-down-fill" color="#444444 " size="10"></u-icon> -->
<image style="width: 14rpx;height: 10rpx;" :src="`${config.aliyunOssUrl}/static/images/app/serve/com_down.png`" mode=""></image>
<image style="width: 14rpx;height: 10rpx;"
:src="`${config.aliyunOssUrl}/static/images/app/serve/com_down.png`" mode=""></image>
</view>
<u-search placeholder="搜索" v-model="keyword" height="32" searchIconSize='16' :showAction='false'
:searchIcon="`${config.aliyunOssUrl}/static/images/app/serve/searc.png`"
placeholderColor='#AAAAAA' searchIconColor='#999999' @clickIcon='searchBtn' @search="searchBtn" @clear='clearBtn'></u-search>
<u-search placeholder="搜索" v-model="keyword" height="32" searchIconSize='16' :showAction='false'
:searchIcon="`${config.aliyunOssUrl}/static/images/app/serve/searc.png`" placeholderColor='#AAAAAA'
searchIconColor='#999999' @clickIcon='searchBtn' @search="searchBtn" @clear='clearBtn'></u-search>
</view>
<!-- Tabs 标签 itemStyle="display: flex; align-content: center; justify-content: space-around" -->
<!-- <view class="tabs_view">
@@ -19,18 +20,19 @@
:inactiveStyle="{color: '#666666',transform: 'scale(1)'}"
></u-tabs>
</view> -->
<view class="tab-box" style="background: '#fff'">
<view :class="['tab-item', actTabType==item.value && 'tab-item-active']"
v-for="(item,index) in tabsList8" @click="tabClick(item)">
v-for="(item,index) in tabsList8" @click="tabClick(item)">
<view class="">{{item.name}}</view>
<view v-if="item.active" class="line"></view>
</view>
</view>
<!-- 内容 -->
<view class="coupons_con">
<view class="con_view" v-for="(item,index) in cardProductList " :key="item.id" @click="toDetailPages(item)">
<view class="con_view" v-for="(item,index) in cardProductList " :key="item.id"
@click="toDetailPages(item)">
<!-- <image :class="cardType == 3?'view_img_mini':'view_img'" :src="cardType == 3?item.cover:item.image" mode=""></image> -->
<!-- cover => 封面图 image => 图片 -->
<image class="view_img" :src="item.cover" mode=""></image>
@@ -45,25 +47,33 @@
</template>
<script>
import { tabsList8 } from "@/data/tabsData.js"
import { getCardProductListAPI } from '@/api/serve/coupons'
import { getActivityListAPI } from '@/api/serve/index'
import { mapGetters } from 'vuex'
import {
tabsList8
} from "@/data/tabsData.js"
import {
getCardProductListAPI
} from '@/api/serve/coupons'
import {
getActivityListAPI
} from '@/api/serve/index'
import {
mapGetters
} from 'vuex'
import config from '@/config';
export default {
data(){
data() {
return {
config,
tabsList8,
current:0, // 区别tabs
cardData:{
limit:20,
page:1,
name:''
current: 0, // 区别tabs
cardData: {
limit: 20,
page: 1,
name: ''
},
keyword:'', // 搜索
cardType:'', // 卡券类型
cardProductList:[] ,// 卡券列表
keyword: '', // 搜索
cardType: '', // 卡券类型
cardProductList: [], // 卡券列表
//当前tab
actTabType: 1,
}
@@ -72,104 +82,91 @@
...mapGetters(['selectCity'])
},
onLoad(query) {
// console.log(query,'qeqwrewrwewe');
// console.log(Number(query.num),'qeqwrewrwewe111111');
this.current=query.num
this.current = query.num
this.actTabType = query.num
this.tabsList8.forEach(tab => {
tab.active= tab.value === Number(query.num) ? true : false
});
if(query.num==2){
this.cardType=2
}else{
this.cardType=''
}
tab.active = tab.value === Number(query.num) ? true : false
});
if (query.num == 1) {
this.cardType = 2
this.actType = 2
}
},
methods:{
onShow() {
if (this.$refs.paging) {
this.$refs.paging.reload()
}
},
methods: {
//tab
tabClick(e) {
// console.log(e,'eeeeeeeeeeeeee');
this.actTabType = e.value
this.tabsList8.forEach(tab => {
this.tabsList8.forEach(tab => {
tab.active = tab.value === this.actTabType ? true : false
});
});
if (e.value == 1) {
this.cardType=''
}else{
this.cardType=e.value
this.cardType = ''
} else {
this.cardType = e.value
}
this.$refs.paging.reload()
},
clickTabs(item){
clickTabs(item) {
// console.log(item,'tabs点击');
// item.name => 名字 item.value => 1,2,3 item.index => 0,1,2
if(item.value==1){
this.cardType=''
}else{
this.cardType=item.value
if (item.value == 1) {
this.cardType = ''
} else {
this.cardType = item.value
}
this.$refs.paging.reload()
},
// 搜索
searchBtn(){
searchBtn() {
this.$refs.paging.reload()
},
clearBtn(){
this.keyword=''
clearBtn() {
this.keyword = ''
this.$refs.paging.reload()
},
// 卡券商品
queryList(pageNo, pageSize) {
// 助力
// if(this.cardType==3){
// getActivityListAPI({
// limit:pageSize,
// page:pageNo
// }).then(res=>{
// this.$refs.paging.complete(res.data.list)
// }).catch(err=>{
// this.$refs.paging.complete(false)
// })
// }else {
// 卡券 全部和秒杀
// console.log(this.cardType,'卡券类型');
// type => 1普通2秒杀3助力
getCardProductListAPI({
limit:pageSize,
page:pageNo,
name:this.keyword,
type:this.cardType,
city:this.selectCity
}).then(res=>{
// console.log(res,'卡券商品分页列表 ');
this.$refs.paging.complete(res.data.list)
}).catch(err=>{
this.$refs.paging.complete(false)
})
// }
// 卡券 全部和秒杀
let obj = {
limit: pageSize,
page: pageNo,
name: this.keyword,
type: this.cardType,
city: this.selectCity,
}
console.log(obj);
getCardProductListAPI(obj).then(res => {
console.log(res, '卡券商品分页列表 ');
this.$refs.paging.complete(res.data.list)
}).catch(err => {
this.$refs.paging.complete(false)
})
},
// 详情页
toDetailPages(item){
toDetailPages(item) {
this.$store.dispatch('CardId', item.id)
if(this.cardType==3){
if (this.cardType == 3) {
uni.navigateTo({
url: `/pages/mine/my_activity/detail?id=${item.id}`
})
}else{
} else {
uni.navigateTo({
url:`/pages/serve/coupons/cou_detail?id=${item.id}`
url: `/pages/serve/coupons/cou_detail?id=${item.id}`
})
}
},
}
}
</script>
<style lang="scss">
.tab-box {
display: flex;
justify-content: space-between;
@@ -180,8 +177,8 @@
// margin-left: 32rpx;
// margin-bottom: 24rpx;
// margin-top: 14rpx;
// border: 1px solid red;
// border: 1px solid red;
.tab-item {
font-size: 30rpx;
color: #666;
@@ -192,14 +189,14 @@
align-items: center;
// transform: scale(1)
}
.tab-item-active {
font-size: 30rpx;
color: #111;
font-weight: bold;
// transform: scale(1.02)
}
.line {
width: 58rpx;
height: 4rpx;
@@ -208,8 +205,8 @@
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
}
.coupons_con {
// border: 1px solid;
display: flex;
@@ -217,21 +214,25 @@
align-content: flex-start;
justify-content: space-between;
padding-bottom: 40rpx;
// align-items: center;
// margin-top: 16rpx;
.con_view {
// border: 1px solid blue;
margin-top: 32rpx;
.view_img {
width: 340rpx;
height: 340rpx;
border-radius: 8rpx;
}
.view_img_mini {
width: 340rpx;
height: 184rpx;
border-radius: 8rpx;
}
.view_txt {
// border: 1px solid red;
width: 340rpx;
@@ -246,7 +247,7 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.view_price {
font-size: 32rpx;
font-family: Roboto, Roboto;
@@ -256,17 +257,18 @@
}
}
}
.positioningcity {
display: flex;
justify-content: space-between;
padding-bottom: 24rpx;
.posi_l {
display: flex;
justify-content: space-between;
align-items: center;
margin-right: 20rpx;
.l_txt {
margin-right: 12rpx;
font-size: 36rpx;
@@ -275,7 +277,7 @@
}
}
}
.coupons {
// border: 1px solid red;
padding: 24rpx;

View File

@@ -38,13 +38,13 @@
<swiper class="swiper" circular previousMargin='0rpx' nextMargin="0rpx" :indicator-dots="false"
:autoplay="false" interval="4000" duration="500" @change="actTrimChengFn" :current="colorIndex">
<swiper-item v-for="(item,index) in couponList3" :key="index">
<view id="showimage1" class="swiper-item flex">
<view id="showimage1" class="swiper-item flex" @click="toHotPages('help', item)">
<image class="swiper-item-image" :src="item.cover" mode="aspectFill"></image>
<view class="swiper-item-cont flex flex-column justify-between">
<view class="swiper-item-cont-name">{{item.name}}</view>
<view class="swiper-item-cont-num flex justify-between align-center">
<view>已助力<text class="cont-num">{{item.helpNum}}</text></view>
<view>仅差<text class="cont-num">{{item.joinNum - item.helpNum}}</text></view>
<view>仅差<text class="cont-num">{{(item.joinNum - item.helpNum)<0?0:(item.joinNum - item.helpNum)}}</text></view>
</view>
<view class="swiper-item-cont-schedule">
<view class="schedule-num" :style="{width:item.widthNum+'rpx' }"></view>
@@ -52,12 +52,9 @@
<view class="swiper-item-cont-down flex justify-center align-center">
<count-down :type="1" :stopTime="item.stopTime"></count-down> 后结束
</view>
<!-- <u-count-down :time="item.stopTime" format="DD:HH:mm:ss" autoStart millisecond
@change="onChange">
</u-count-down> -->
<view class="flex align-center justify-center" @click="toHotPages('help', item)">
<view class="swiper-item-cont-butt">立即助力</view>
<view class="flex align-center justify-center" >
<view v-if="item.joinNum - item.helpNum>0" @click.stop="toHotPages('help', item)" class="swiper-item-cont-butt">立即助力</view>
<view v-else @click.stop="navActivity" class="swiper-item-cont-butt">助力完成</view>
</view>
</view>
</view>
@@ -128,7 +125,7 @@
mode="aspectFill"></image>
</view>
<view class="integral-list-butt " @click="navParticularsFn(item)">
<text class="f-20 fff">{{parseInt(item.price)}}</text>
<text class="f-20 fff">{{item.price*1}}</text>
<text class="f-24 fff ml-2">{{item.integralNum}}积分</text>
</view>
<view class="integral-list-name c666 f-28"> {{item.name}}</view>
@@ -373,6 +370,12 @@
url: `/pages/serve/repair/repair`
})
},
//我的活动
navActivity(){
uni.navigateTo({
url:'/pages/mine/my_activity/my_activity'
})
},
// 点击轮播图
brannerClick(e) {
if (this.branner[e].linkType == 0 || this.branner[e].linkType == 2 ||

View File

@@ -67,7 +67,7 @@
<!-- <view v-if="showType ==3" style="height: 108rpx;" /> -->
<!-- 外观 内饰 -->
<view class="out-box" v-if="colorList.length&&showType == 2 || showType == 3">
<u-swiper v-if="showType==2||showType==3" circular :current="colorIndex" :autoplay="false" imgMode="aspectFit"
<u-swiper v-if="showType==2||showType==3" circular :current="colorIndex" :autoplay="false" imgMode="widthFix"
bgColor="transparent" width="750rpx" height="476rpx" keyName="image" :list="colorList" @change="actTrimChengFn"
radius='0'>
</u-swiper>

View File

@@ -212,7 +212,7 @@
copyNum(type, e) {
if (type == 1) {
uni.setClipboardData({
data: '#小程序://滴友/wCVymJEiWqUKm0A',
data: `https://cms.diyouzhijia.com/car_h5/#/pages/index?uId=${e}`,
success() {
}
});

View File

@@ -222,8 +222,13 @@
// console.log(res, '海报');
this.userInfo = res.data
this.imageBg = this.userInfo.posterList[0].image
let url =`https://cms.diyouzhijia.com/car_h5/#/pages/index?uId=${this.userInfo.id}`
// let base64Data = uni.arrayBufferToBase64([url])
this.verificationImage =
`https://wxapp.nianxiang-tech.com/prod-api/ums/login/qrcode?content=${this.userInfo.id}`
`https://wxapp.nianxiang-tech.com/prod-api/ums/login/qrcode?content=${url}`
// this.verificationImage =
// `https://wxapp.nianxiang-tech.com/prod-api/ums/login/qrcode/base64?content=${base64Data}`
// console.log(`https://wxapp.nianxiang-tech.com/prod-api/ums/login/qrcode?content=${url}`);
})
}
}

View File

@@ -234,6 +234,7 @@
padding: 16rpx 0;
width: 136rpx;
line-height: 1;
border-radius: 8rpx;
}
}
}

View File

@@ -487,23 +487,21 @@
})
})
} else {
// uni.showToast({
// title: '目前不支持微信支付宝',
// duration: 2000,
// icon: 'none'
// });
this.payData.payChannel='mini'
this.payData.payType='weixin'
prepay(this.payData).then(res => {
// console.log(res.data,'1112233');
this.topUpTypeShow = false
// this.$refs.paging.refresh();
let jsConfig = res.data.jsConfig
wxpayPaymentFn(jsConfig).then(wxpayRes=>{
uni.navigateTo({
url: `/pages/serve/coupons/payresult?resultType=res`
uni.showToast({
icon: 'success',
title: '支付成功'
})
this.topUpTypeShow = false
// uni.hideLoading()
this.$refs.paging.refresh();
}).catch(wxpayErr=>{
uni.navigateTo({
url: `/pages/serve/coupons/payresult?resultType=err`

View File

@@ -266,15 +266,11 @@
...mapGetters(['selectCity'])
},
onLoad(option) {
// console.log(option);
this.type = option.type
this.brandId = option.brandId
// this.brandId = option.brandId
//获取品牌列表
modelBrandList().then(res => {
// console.log(res,'品牌');
// this.brandList = [res.data]
this.brandList = res.data
// this.brandList.unshift({ id: -1, name: "全部"});
res.data.forEach(item => {
if (this.brandId == item.id) {
this.brandName = item.name
@@ -283,10 +279,13 @@
}
})
})
//获取当前位置
// getLocationFn()
},
onShow() {
//获取车商列表
this.getCarDealerListFn()
if (this.$refs.paging) {
this.$refs.paging.reload()
}
},
methods: {
//获取车商列表
@@ -369,9 +368,10 @@
priceType: this.priceId,
monthRent: this.tenancyId,
carAge: this.carAgeId,
carDealerId: this.carDealerId,
carDealerId: this.carDealerId == -1 ? '' : this.carDealerId,
city:this.selectCity
}
console.log(this.carDealerId);
if (this.type == 2) {
getInformationList(obj).then(res => {
this.allNum = res.data.total

View File

@@ -44,7 +44,7 @@ export function getLocationFn() {
longitude: res.longitude
},
success: res1 => {
console.log(res1.result.address_component.city);
console.log('当前位置',res1.result.address_component.city);
uni.setStorageSync('current_city',res1.result.address_component.city)
store.dispatch('SelectCity', res1.result.address_component.city)
},