This commit is contained in:
zhi
2026-01-07 10:16:49 +08:00
parent e0ff5ccdc7
commit 03ab44d2cb
29 changed files with 5092 additions and 1812 deletions

View File

@@ -0,0 +1,528 @@
<template>
<view class="claim-detail">
<uni-nav-bar :fixed="true" title="认植认养详情" backgroundColor="none" color="#FFFFFF"></uni-nav-bar>
<swiper class="banner-swiper" circular autoplay>
<swiper-item>
<image class="banner-img" mode="aspectFill" src="@/static/image/imgicon/banner.png"></image>
</swiper-item>
</swiper>
<view class="headr-wrap">
<view class="flex">
<view class="flex-1">
<view class="name">大鹅大鹅大鹅大鹅</view>
<view class="intro">已有178人参加</view>
</view>
<view class="money">
<text></text>
299
</view>
</view>
<view class="headr-info flex">
<view class="headr-info-item flex-1">
<text>品种</text>
</view>
<view class="headr-info-item flex-1">
<text>产量</text>
3kg
</view>
<view class="headr-info-item flex-1">
<text>周期</text>
365
</view>
</view>
</view>
<view class="title-item">
<view class="title">实时数据</view>
<view class="weather-wrap">
<view class="weather-item" v-for="i in 5">
<image class="icon" mode="aspectFit" src="@/static/image/imgicon/weather_icon1.png"></image>
<view class="flex-1">
<view class="label">湿度值</view>
<view class="count">
11.0
<text>%</text>
</view>
</view>
</view>
</view>
</view>
<view class="title-item">
<view class="title">认养收获</view>
</view>
<view class="title-item">
<view class="title">认养规则</view>
</view>
<view class="title-item">
<view class="title">认养详情</view>
</view>
<view class="space-max-footer"></view>
<view class="footer-btn fill-base fix">
<view class="footer-item flex-between">
<view class="flex-warp f-caption c-title">
<view @tap.stop="$util.goUrl({ url: detail.farmer_info.mobile, openType: 'call' })" class="min-but flex-center flex-column">
<image class="img-icon" mode="aspectFit" src="@/static/image/imgicon/kefu_icon.png"></image>
<view>客服</view>
</view>
</view>
<view class="flex-1 money-box">
<text class="old text-delete">399</text>
<text class="unit"></text>
<text>399</text>
</view>
<view class="flex-warp" v-if="detail.collage_data && detail.collage_data.id">
<view @tap.stop="toOrder" class="order-btn flex-center">单独认养</view>
<view @tap.stop="toOrder(1)" class="order-btn flex-center">去众筹</view>
</view>
<view @tap.stop="toOrder" class="order-btn flex-center" v-else>立即认养</view>
</view>
<view class="space-safe"></view>
</view>
</view>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
export default {
components: {},
data() {
return {
options: {},
detail: {},
bannerCurrent: 0,
bannerList: [],
typeList: [],
current: 0,
param: {
page: 1,
limit: 10
},
list: {
data: []
},
loading: true,
lockTap: false
};
},
computed: mapState({
primaryColor: (state) => state.config.configInfo.primaryColor,
subColor: (state) => state.config.configInfo.subColor,
configInfo: (state) => state.config.configInfo,
userInfo: (state) => state.user.userInfo,
haveOperItem: (state) => state.order.haveOperItem
}),
onLoad(options) {
this.$util.showLoading();
this.options = options;
this.updateOrderItem({
key: 'haveOperItem',
val: false
});
this.initIndex();
},
onUnload() {
if (!this.haveOperItem) return;
this.$util.back();
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading();
// #endif
this.initRefresh();
uni.stopPullDownRefresh();
},
onShareAppMessage(e) {
let { id: pid } = this.userInfo;
let { id, title, cover: imageUrl } = this.detail;
let path = `/claim/pages/detail?id=${id}&pid=${pid}`;
this.$util.log(path);
return {
title,
imageUrl,
path
};
},
methods: {
...mapMutations(['updateOrderItem']),
async initIndex(refresh = false) {
let { id } = this.options;
let data = await this.$api.claim.claimInfo({
id
});
data.markers = [
{
iconPath: 'https://lbqnyv2.migugu.com/images/12/2018/11/A33zQycihMM33y337LH23myTqTl3tl.png',
id: 0,
latitude: data.lat,
longitude: data.lng,
width: 28,
height: 28
}
];
let {
imgs = [],
monitor = [],
user_start_collage = {
id: 0
}
} = data;
let bannerList = [];
let typeList = [];
if (imgs && imgs.length > 0) {
imgs.map((item) => {
bannerList.push({
img: item,
link: '',
link_type: 'img'
});
});
typeList.push({
title: '图片',
type: 'img'
});
}
if (monitor && monitor.length > 0) {
monitor.map((item) => {
bannerList.push({
img: item.cover,
link: item.id,
link_type: 'monitor'
});
});
typeList.push({
title: '监控',
type: 'monitor'
});
}
this.typeList = typeList;
this.bannerList = bannerList;
this.detail = data;
this.$util.hideAll();
await this.getList();
if (user_start_collage && user_start_collage.id && !refresh) {
this.$refs.show_collage_share.open();
}
},
initRefresh() {
this.initIndex(true);
},
countEnd() {
this.$util.log('倒计时完了');
setTimeout(() => {
this.initRefresh();
}, 1000);
},
linkpress(res) {
console.log('linkpress', res);
// #ifdef APP-PLUS
this.$util.goUrl({
url: res.href,
openType: 'web'
});
// #endif
},
async getList() {
let { list: oldList } = this;
let { id: goods_id } = this.options;
let param = Object.assign({}, this.param, {
goods_id,
type: 1,
is_goods: 0
});
let newList = await this.$api.mine.goodsEvaluateList(param);
if (this.param.page == 1) {
this.list = newList;
} else {
newList.data = oldList.data.concat(newList.data);
this.list = newList;
}
this.loading = false;
this.$util.hideAll();
},
handerSwiperChange(e) {
let { current } = e.detail;
this.bannerCurrent = current;
},
handerBannerClick(index) {
let item = this.bannerList[index];
let { link_type: openType, link: id, img } = item;
if (openType == 'monitor') {
let url = `/home/pages/monitor/detail?id=${id}`;
this.$util.goUrl({
url
});
return;
}
uni.previewImage({
current: img,
urls: [img]
});
},
async toMap() {
let { lat, lng, address } = this.detail;
await this.$util.checkAuth({
type: 'userLocation'
});
await uni.getLocation({
type: 'gcj02'
});
await uni.openLocation({
latitude: lat * 1,
longitude: lng * 1,
name: address,
scale: 28
});
},
toPreviewImage(index, aindex) {
let { imgs: urls } = this.list.data[index];
this.$util.previewImage({
current: urls[aindex],
urls
});
},
toJoin(index) {
let { id: cid, claim_id, user_id, can_join } = this.detail.collage_list[index];
let { join_times } = this.detail.collage_data;
let { id: uid } = this.userInfo;
if (user_id == uid || !can_join) {
this.$util.showToast({
title: user_id == uid ? `不能参与自己发起的众筹哦` : `您已参与此众筹或已达到参与次数${join_times}`
});
return;
}
let url = `/claim/pages/order?id=${claim_id}&cid=${cid}&type=2`;
this.$util.goUrl({
url
});
},
toOrder(type = 0) {
let { id } = this.options;
let {
collage_data = {
id: 0
},
user_start_collage = {
id: 0
}
} = this.detail;
let { id: cid = 0, can_start, start_times } = collage_data;
if (type == 1 && user_start_collage && user_start_collage.id) {
this.$refs.show_collage_share.open();
return;
}
if (type == 1 && !can_start) {
this.$util.showToast({
title: `您已达到发起众筹次数${start_times}`
});
return;
}
let url = `/claim/pages/order?id=${id}&cid=${cid}&type=${type}`;
this.$util.goUrl({
url
});
}
}
};
</script>
<style lang="scss">
.claim-detail {
min-height: 100vh;
background: #ffffff;
}
.banner-swiper {
height: 480rpx;
width: 100%;
.banner-img {
display: block;
height: 100%;
width: 100%;
border-radius: 0 0 12rpx 12rpx;
}
}
.headr-wrap {
margin: -110rpx 28rpx 0;
padding: 20rpx 28rpx;
background: #ffffff;
box-shadow: 0rpx 8rpx 8rpx rgba(229, 229, 229, 0.25);
border-radius: 18rpx;
position: relative;
z-index: 1;
.name {
line-height: 40rpx;
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
.intro {
margin-top: 4rpx;
line-height: 34rpx;
font-weight: 500;
font-size: 24rpx;
color: #777777;
}
.money {
line-height: 56rpx;
font-weight: bold;
color: #ff0000;
font-size: 40rpx;
margin: 12rpx 0 0 20rpx;
text {
font-size: 24rpx;
vertical-align: baseline;
}
}
.headr-info {
margin-top: 46rpx;
}
.headr-info-item {
line-height: 40rpx;
font-weight: 500;
font-size: 28rpx;
color: #333333;
text {
color: #999999;
margin-right: 12rpx;
vertical-align: baseline;
}
}
}
.title-item {
margin: 0 28rpx;
padding: 28rpx 0 36rpx;
position: relative;
&::after {
content: ' ';
display: block;
border-top: 1px solid #f2f2f2;
width: 200%;
height: 0;
position: absolute;
left: 0;
top: 0;
transform: scale(0.5);
transform-origin: 0 0;
}
.title {
line-height: 40rpx;
font-weight: bold;
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
}
.weather-wrap {
display: flex;
flex-wrap: wrap;
.weather-item {
width: 214rpx;
background: rgba(19, 186, 231, 0.1);
border-radius: 12rpx;
margin: 0 28rpx 20rpx 0;
padding: 18rpx 0 16rpx 26rpx;
display: flex;
align-items: flex-start;
&:nth-child(3) {
margin-right: 0;
}
.icon {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
.label {
line-height: 34rpx;
font-weight: 500;
font-size: 24rpx;
color: #777777;
margin-bottom: 2rpx;
}
.count {
line-height: 44rpx;
font-weight: bold;
font-size: 32rpx;
color: #13bae7;
text {
font-size: 24rpx;
vertical-align: baseline;
}
}
}
}
}
.footer-btn {
bottom: 0;
.footer-item {
height: 96rpx;
padding: 0 30rpx;
.min-but {
line-height: 34rpx;
font-weight: 500;
font-size: 24rpx;
color: #777777;
text-align: center;
padding: 0 8rpx;
}
.img-icon {
width: 48rpx;
height: 48rpx;
display: block;
margin: 0 auto;
}
}
.money-box {
line-height: 56rpx;
font-weight: bold;
font-size: 40rpx;
color: #ff0000;
text-align: right;
padding: 0 6rpx;
padding: 16rpx 6rpx 0;
.old {
font-size: 28rpx;
color: #777777;
}
.unit {
font-size: 24rpx;
margin-left: 6rpx;
}
text {
vertical-align: baseline;
}
}
.order-btn {
width: 244rpx;
height: 72rpx;
background: linear-gradient(180deg, #43c5fe 0%, #358ffd 100%);
border-radius: 72rpx;
font-weight: bold;
font-size: 32rpx;
color: #ffffff;
}
}
</style>

View File

@@ -0,0 +1,776 @@
<template>
<view class="claim-detail" v-if="detail.id">
<view class='banner-info'>
<swiper class='banner-swiper' @change='handerSwiperChange' :autoplay="true">
<swiper-item v-for="(item,index) in bannerList" :key="index" @tap='handerBannerClick(index)'>
<image mode="aspectFill" class='banner-img' :src='item.img'></image>
<view class="banner-swiper img-bg c-base iconfont icon-zhibo abs flex-center"
v-if="bannerList[bannerCurrent].link_type == 'monitor'"></view>
</swiper-item>
</swiper>
<view class='banner-tagitem banner-tagitem_count'>{{bannerCurrent+1}}/{{bannerList.length}}</view>
<view class='banner-taglist'>
<view class='banner-tagitem'
:class="[{'banner-tagitem_active':item.type==bannerList[bannerCurrent].link_type},{'radius-10':typeList.length == 1},{'radius-left':typeList.length > 1 && index == 0},{'radius-right':typeList.length > 1 && index === typeList.length -1}]"
v-for="(item,index) in typeList" :key="index">
{{item.title}}
</view>
</view>
</view>
<view class="collage-info rel mb-md" v-if="detail.collage_data && detail.collage_data.id">
<image mode="aspectFill" class="collage-img abs" src="https://lbqny.migugu.com/admin/farm/collage.png">
</image>
<view class="collage-count abs">
<min-countdown :type="3" :targetTime="detail.collage_data.end_time * 1000" :color="primaryColor"
textColor="#fff" className="sm" @callback="countEnd">
</min-countdown>
<view class="flex-center f-icontext c-base mt-sm">距结束还剩</view>
</view>
<view class="collage-content pt-md pl-md f-icontext c-base abs">
<view class="f-lg-title"> ¥{{detail.collage_data.price}} </view>
<view class="flex-y-center">
<view class="f-caption text-delete">原价 ¥{{detail.price}} </view>
<view class="collage-num flex-center radius-4 ml-sm pl-sm pr-sm" :style="{color:primaryColor}">
{{detail.collage_data.success_num}}人团
</view>
</view>
</view>
</view>
<view class="pd-lg fill-base">
<view class="flex-center">
<!-- #ifdef MP-WEIXIN -->
<view class="max-566">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="flex-1">
<!-- #endif -->
<view class="f-title c-title">{{detail.title}}</view>
<view class="flex-y-baseline">
<view class="price c-warning">¥{{detail.price}}</view>
<view class="f-caption c-caption ml-sm">/{{detail.unit}}</view>
</view>
</view>
<!-- #ifdef MP-WEIXIN -->
<button open-type="share" class="clear-btn flex-center flex-column">
<i class="iconfont icon-share c-title"></i>
<view class="f-caption c-title">分享</view>
</button>
<!-- #endif -->
</view>
<view class="f-caption c-caption">
<text decode="emsp" style="word-break:break-all;">{{detail.desc}}</text>
</view>
</view>
<view class="fill-base pd-lg mt-md" v-if="detail.collage_list.length > 0">
<view class="flex-between">
<view class="f-paragraph c-title">不想自己开团? 可与下面小伙伴快速成团</view>
<view @tap="$util.goUrl({url:`/claim/pages/collage/more?id=${options.id}`})"
class="flex-y-center f-caption c-caption">
查看更多<i class="iconfont icon-right" style="font-size:24rpx"></i></view>
</view>
<view @tap="toJoin(index)" class="collage-item flex-center pt-lg pb-lg" :class="[{'b-1px-t':index!=0}]"
v-for="(item,index) in detail.collage_list" :key="index">
<image class="avatar radius" :src="item.user_info.avatarUrl"></image>
<view class="flex-1 flex-center ml-md">
<view class="flex-1 mr-md flex-between">
<view class="f-desc c-title max-150 ellipsis">{{item.user_info.nickName}}</view>
<view>
<view class="flex-between">
<view></view>
<view class="flex-y-center f-paragraph"><view class="c-warning">
{{item.surplus_num}}
</view>人成团
</view>
</view>
<view class="flex-y-center f-icontext c-caption">
<min-countdown :type="5" :targetTime="item.end_time * 1000" color="#999"
@callback="countEnd">
</min-countdown>结束
</view>
</view>
</view>
<view class="common-btn flex-center f-paragraph c-base" :style="{background:primaryColor}">去参与
</view>
</view>
</view>
</view>
<view class="count-list flex-y-center fill-base pd-lg mt-md">
<view class="count-item flex-center flex-column">
<view class="f-title c-title ellipsis">{{detail.breed}}</view>
<view class="f-caption c-caption">认养品种</view>
</view>
<view class="line"></view>
<view class="count-item flex-center flex-column">
<view class="f-title c-title ellipsis">{{detail.cycle}}</view>
<view class="f-caption c-caption">认养周期</view>
</view>
<view class="line"></view>
<view class="count-item flex-center flex-column">
<view class="f-title c-title">{{detail.output}}kg</view>
<view class="f-caption c-caption">产量</view>
</view>
</view>
<view class="mt-md pt-sm pl-lg pr-lg pb-lg fill-base f-paragraph c-title">
<view class="common-nav-title flex-center c-title">
<view class="common-line" :style="{background:primaryColor}"></view>
<view class="f-title text-bold flex-1">认养收获</view>
</view>
<view class="flex-center mt-md">
<image mode="aspectFill" lazy-load class="avatar lg box-shadow-mini radius-10"
:src="detail.harvest_cover">
</image>
<view class="flex-1 ml-lg f-paragraph c-title ellipsis">{{detail.harvest_text}}</view>
</view>
</view>
<view class="mt-md pt-sm pl-lg pr-lg pb-lg fill-base f-paragraph c-title"
v-if="detail.process && detail.process.length > 0">
<view class="common-nav-title flex-center c-title">
<view class="common-line" :style="{background:primaryColor}"></view>
<view class="f-title text-bold flex-1">认养流程</view>
</view>
<view class="flex-warp" :class="[{'mt-md':index==0},{'mt-lg':index!=0}]"
v-for="(item,index) in detail.process" :key="index">
<image mode="aspectFill" lazy-load class="avatar sm" :src="item.cover"></image>
<view class="flex-1 ml-lg">
<view class="f-paragraph c-title">{{item.title}}</view>
<view class="f-caption c-caption">{{item.time}}</view>
<view class="f-caption c-desc">{{item.sub_title}}</view>
</view>
</view>
</view>
<block v-if="list.all_count>0">
<view class="mt-md pt-sm pl-lg pr-lg fill-base f-paragraph c-title">
<view class="common-nav-title flex-center c-title">
<view class="common-line" :style="{background:primaryColor}"></view>
<view class="flex-1 flex-between">
<view class="f-title text-bold">评价{{list.all_count}}</view>
<view @tap.stop="$util.goUrl({url:`/mine/pages/evaluate/more?id=${options.id}&type=1`})"
class="flex-y-center f-paragraph c-caption">
<view>查看全部</view>
<i class="iconfont icon-right" style="font-size: 28rpx;"></i>
</view>
</view>
</view>
</view>
<block v-for="(item,index) in list.data" :key="index">
<view class="flex-warp fill-base pd-lg" :class="[{'b-1px-t':index!=0}]" v-if="index<2">
<image mode="aspectFill" lazy-load class="avatar sm radius" :src="item.user_info.avatarUrl">
</image>
<view class="flex-1 ml-lg">
<view class="flex-between">
<view class="f-paragraph c-title max-350 ellipsis">{{item.user_info.nickName}}</view>
<view class="f-icontext c-caption">{{item.create_time}}</view>
</view>
<view class="flex-warp">
<i class="iconfont icon-star-fill icon-font-color mr-sm"
:style="{backgroundImage: aindex < item.star ? '-webkit-linear-gradient(90deg, #FDCD47, #FFC000)' : '-webkit-linear-gradient(90deg, #eee, #eee)'}"
v-for="(aitem,aindex) in 5" :key="aindex"></i>
</view>
<view class="f-caption c-desc mt-md">
<text decode="emsp" style="word-break:break-all;">{{item.text || '该用户没有填写评价哦'}}</text>
</view>
<view class="flex-warp mt-md" v-if="item.imgs && item.imgs.length > 0">
<block v-for="(aitem,aindex) in item.imgs" :key="aindex">
<view class="eva-img sm radius-10 rel" v-if="aindex < 3">
<image @tap.stop="toPreviewImage(index,aindex)" mode="aspectFill"
class="eva-img sm radius-10" :src="aitem">
</image>
<view class="more f-caption c-base abs"
v-if="aindex == 2 && item.imgs.length > 3">
+{{item.imgs.length - 3}}</view>
</view>
</block>
</view>
</view>
</view>
</block>
</block>
<view class="mt-md pt-sm pl-lg pr-lg pb-lg fill-base f-paragraph c-title">
<view class="common-nav-title flex-center c-title">
<view class="common-line" :style="{background:primaryColor}"></view>
<view class="f-title text-bold flex-1">认养环境</view>
</view>
<view class="flex-center">
<image mode="aspectFill" lazy-load class="avatar mini radius" :src="detail.farmer_info.cover">
</image>
<view class="flex-1 ml-md">{{detail.farmer_info.title}}</view>
</view>
</view>
<view class="map-info rel">
<map :latitude="detail.lat" :longitude="detail.lng" :markers="detail.markers" :enable-satellite="true">
</map>
<view @tap.stop="toMap" class="farmer-title flex-center pl-md pr-sm c-base radius abs">
<view class="f-desc max-500 ellipsis">
{{detail.farmer_info.title}}
</view>
<i class="iconfont icon-right"></i>
</view>
</view>
<view class="order-count-info fill-base"
v-if="detail.machine_info.data && detail.machine_info.data.length > 0">
<view class="flex-between pt-lg pl-lg pr-lg">
<view class="flex-y-baseline f-paragraph c-caption">
<view class="c-title text-bold mr-sm">实时数据</view>
<!-- <view>更新于2021.09.10 16:24</view> -->
</view>
<!-- <i class="iconfont icon-shuaxin"></i> -->
</view>
<!-- <view class="pd-lg flex-center b-1px-b">
<view class="count-item flex-center flex-column">
<view class="f-paragraph c-title">28.7</view>
<view class="f-caption c-caption">热敏温度</view>
</view>
<view class="count-item flex-center flex-column b-1px-l b-1px-r">
<view class="f-paragraph c-title">28.7</view>
<view class="f-caption c-caption">噪声监测</view>
</view>
<view class="count-item flex-center flex-column">
<view class="f-paragraph c-title">28.7</view>
<view class="f-caption c-caption">移动监测</view>
</view>
</view> -->
<view class="pt-lg pl-lg pr-lg pb-md f-paragraph c-desc">
<view class="flex-y-baseline">
<view class="mr-md">无线温湿度</view>
<view>土壤电导率三合一</view>
</view>
<veiw class="flex-warp pb-md">
<view class="machine-item flex-warp f-desc c-caption mt-md"
v-for="(item,index) in detail.machine_info.data" :key="index">
<view class="num">{{`(${index*1+1})`}}</view>
<view class="text">{{item.text}}</view>
<view>{{item.value.length == 0 ? '无' : item.value}}</view>
</view>
</veiw>
<!-- <view class="flex-center pt-md"><i class="iconfont icon-down-bold" style="font-size: 28rpx;"></i></view> -->
</view>
</view>
<view class="mt-md pt-sm pl-lg pr-lg pb-lg fill-base f-paragraph c-title">
<view class="common-nav-title flex-center c-title">
<view class="common-line" :style="{background:primaryColor}"></view>
<view class="f-title text-bold flex-1">详细说明</view>
</view>
<view class="pt-sm" v-if="detail.text">
<parser :html="detail.text" @linkpress="linkpress" show-with-animation lazy-load>加载中...</parser>
</view>
</view>
<view class="space-max-footer"></view>
<view class="footer-btn fill-base fix">
<view class="footer-item flex-between pr-lg">
<view class="flex-warp f-caption c-title">
<view @tap.stop="$util.goUrl({url:`/pages/home`,openType:`switchTab`})"
class="flex-center flex-column pl-lg pr-lg">
<i class="iconfont icon-home"></i>
<view>首页</view>
</view>
<view @tap.stop="$util.goUrl({url:detail.farmer_info.mobile,openType:'call'})"
class="flex-center flex-column pl-md">
<i class="iconfont icon-dianhua text-bold"></i>
<view>客服</view>
</view>
</view>
<view class="flex-warp" v-if="detail.collage_data && detail.collage_data.id">
<view @tap.stop="toOrder" class="order-btn flex-center f-title c-base text-bold radius-20"
:style="{color:primaryColor,border:`1rpx solid ${primaryColor}`}">
单独认养
</view>
<view @tap.stop="toOrder(1)"
class="order-btn flex-center ml-md f-title c-base text-bold radius-20"
:style="{background:primaryColor,border:`1rpx solid ${primaryColor}`}">
去众筹
</view>
</view>
<view @tap.stop="toOrder" class="order-btn md flex-center f-title c-base text-bold radius-20"
:style="{background:primaryColor}" v-else>立即认养
</view>
</view>
<view class="space-safe"></view>
</view>
<uni-popup ref="show_collage_share" type="center">
<view class="show-collage-share">
<view class="flex-center flex-column fill-base pd-lg radius-24">
<view class="f-md-title text-bold pt-lg pb-lg" :style="{color:primaryColor}">您有一个拼团正在进行中</view>
<view class="user-list flex-center mt-lg mb-lg">
<block v-for="(item,index) in detail.user_start_collage.user_avatar" :key="index">
<view class="avatar-group lg"
v-if="index < detail.user_start_collage.success_num > 3 ? 3 : detail.user_start_collage.success_num -1">
<image mode="aspectFill" lazy-load class="abs avatar fill-body radius" :src="item">
</image>
</view>
</block>
<block v-if="detail.user_start_collage.surplus_num">
<i class="iconfont icon-more ml-sm pl-lg pr-lg"></i>
<view class="more-btn flex-center radius"><i class="iconfont icon-add"></i> </view>
</block>
</view>
<min-countdown :type="2" :targetTime="detail.user_start_collage.end_time * 1000" color="#333"
textColor="#999" bgColor="#F7F7F7" className="md" @callback="countEnd">
</min-countdown>
<view class="f-desc c-caption mt-md mb-lg">还差{{detail.user_start_collage.surplus_num}}人成团距离结束还剩
</view>
<view class="space-lg"></view>
<!-- #ifdef MP-WEIXIN -->
<button open-type="share" class="clear-btn share-btn flex-center f-sm-title"
:style="{background:primaryColor}">
邀请好友
</button>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view @click="toAppShare" class="share-btn flex-center f-sm-title"
:style="{background:primaryColor}">
邀请好友
</view>
<!-- #endif -->
<view class="space-lg"></view>
</view>
<i @tap="$refs.show_collage_share.close()" class="flex-center mt-lg iconfont icon-close c-base"></i>
</view>
</uni-popup>
</view>
</template>
<script>
import {
mapState,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
detail: {},
bannerCurrent: 0,
bannerList: [],
typeList: [],
current: 0,
param: {
page: 1,
limit: 10
},
list: {
data: []
},
loading: true,
lockTap: false,
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
haveOperItem: state => state.order.haveOperItem,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
this.updateOrderItem({
key: 'haveOperItem',
val: false
})
this.initIndex()
},
onUnload() {
if (!this.haveOperItem) return
this.$util.back()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onShareAppMessage(e) {
let {
id: pid
} = this.userInfo
let {
id,
title,
cover: imageUrl
} = this.detail
let path = `/claim/pages/detail?id=${id}&pid=${pid}`
this.$util.log(path)
return {
title,
imageUrl,
path,
}
},
methods: {
...mapMutations(['updateOrderItem']),
async initIndex(refresh = false) {
let {
id
} = this.options
let data = await this.$api.claim.claimInfo({
id
})
data.markers = [{
iconPath: "https://lbqnyv2.migugu.com/images/12/2018/11/A33zQycihMM33y337LH23myTqTl3tl.png",
id: 0,
latitude: data.lat,
longitude: data.lng,
width: 28,
height: 28
}]
let {
imgs = [],
monitor = [],
user_start_collage = {
id: 0
}
} = data
let bannerList = []
let typeList = []
if (imgs && imgs.length > 0) {
imgs.map((item) => {
bannerList.push({
img: item,
link: '',
link_type: "img"
})
})
typeList.push({
title: "图片",
type: "img"
})
}
if (monitor && monitor.length > 0) {
monitor.map((item) => {
bannerList.push({
img: item.cover,
link: item.id,
link_type: "monitor"
})
})
typeList.push({
title: "监控",
type: "monitor"
})
}
this.typeList = typeList
this.bannerList = bannerList
this.detail = data
this.$util.hideAll()
await this.getList()
if (user_start_collage && user_start_collage.id && !refresh) {
this.$refs.show_collage_share.open()
}
},
initRefresh() {
this.initIndex(true)
},
countEnd() {
this.$util.log("倒计时完了")
setTimeout(() => {
this.initRefresh()
}, 1000)
},
linkpress(res) {
console.log("linkpress", res);
// #ifdef APP-PLUS
this.$util.goUrl({
url: res.href,
openType: 'web'
})
// #endif
},
async getList() {
let {
list: oldList,
} = this
let {
id: goods_id,
} = this.options
let param = Object.assign({}, this.param, {
goods_id,
type: 1,
is_goods: 0
});
let newList = await this.$api.mine.goodsEvaluateList(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
handerSwiperChange(e) {
let {
current,
} = e.detail
this.bannerCurrent = current;
},
handerBannerClick(index) {
let item = this.bannerList[index];
let {
link_type: openType,
link: id,
img
} = item;
if (openType == 'monitor') {
let url = `/home/pages/monitor/detail?id=${id}`
this.$util.goUrl({
url
})
return
}
uni.previewImage({
current: img,
urls: [img]
})
},
async toMap() {
let {
lat,
lng,
address
} = this.detail
await this.$util.checkAuth({
type: 'userLocation'
})
await uni.getLocation({
type: 'gcj02',
})
await uni.openLocation({
latitude: lat * 1,
longitude: lng * 1,
name: address,
scale: 28
})
},
toPreviewImage(index, aindex) {
let {
imgs: urls
} = this.list.data[index]
this.$util.previewImage({
current: urls[aindex],
urls
})
},
toJoin(index) {
let {
id: cid,
claim_id,
user_id,
can_join,
} = this.detail.collage_list[index]
let {
join_times
} = this.detail.collage_data
let {
id: uid
} = this.userInfo
if (user_id == uid || !can_join) {
this.$util.showToast({
title: user_id == uid ? `不能参与自己发起的众筹哦` : `您已参与此众筹或已达到参与次数${join_times}`
})
return
}
let url = `/claim/pages/order?id=${claim_id}&cid=${cid}&type=2`
this.$util.goUrl({
url
})
},
toOrder(type = 0) {
let {
id
} = this.options
let {
collage_data = {
id: 0
},
user_start_collage = {
id: 0
}
} = this.detail
let {
id: cid = 0,
can_start,
start_times
} = collage_data
if (type == 1 && user_start_collage && user_start_collage.id) {
this.$refs.show_collage_share.open()
return
}
if (type == 1 && !can_start) {
this.$util.showToast({
title: `您已达到发起众筹次数${start_times}`
})
return
}
let url = `/claim/pages/order?id=${id}&cid=${cid}&type=${type}`
this.$util.goUrl({
url
})
}
}
}
</script>
<style lang="scss">
.claim-detail {
.collage-info {
width: 100%;
height: 143rpx;
.collage-img {
left: 0;
bottom: 0;
width: 100%;
height: 156rpx;
}
.collage-count {
right: 12rpx;
bottom: 30rpx;
}
.collage-content {
top: 0;
width: 300rpx;
height: 140rpx;
.collage-num {
min-width: 76rpx;
height: 28rpx;
background: #FFFB00;
}
}
}
.price,
.icon-share {
font-size: 42rpx;
}
.collage-item {
.avatar {
width: 68rpx;
height: 68rpx;
}
}
.count-list {
.count-item {
width: 249rpx;
.ellipsis {
max-width: 220rpx;
}
}
.line {
width: 1rpx;
height: 58rpx;
background: #CCCCCC;
opacity: 0.4;
}
}
.map-info {
map {
width: 100%;
height: 450rpx;
}
.farmer-title {
z-index: 9;
left: 15rpx;
bottom: 10rpx;
height: 50rpx;
background: rgba(0, 0, 0, 0.5);
.iconfont {
font-size: 24rpx;
}
}
}
.order-count-info {
.count-item {
width: 33.33%;
}
.machine-item {
width: 50%;
.num {
width: 50rpx;
}
.text {
width: 150rpx;
padding-right: 10rpx;
}
}
}
.footer-btn {
bottom: 0;
.footer-item {
height: 114rpx;
.iconfont {
font-size: 42rpx;
}
}
.order-btn {
width: 220rpx;
height: 78rpx;
transform: rotateZ(360deg);
}
.order-btn.md {
width: 444rpx;
}
}
.show-collage-share {
width: 640rpx;
.user-list {
.more-btn {
width: 92rpx;
height: 92rpx;
background: #F8F8F8;
border: 1px solid #DBDBDB;
.icon-add {
color: #D8D8D7
}
}
}
.share-btn {
width: 420rpx;
height: 94rpx;
color: #fff;
border-radius: 100rpx;
}
.icon-close {
font-size: 80rpx;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,709 @@
<template>
<view class="claim-order" v-if="orderInfo.claim_info.id">
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" color="#fff"
:backgroundColor="scrollTop < 20 ?``:primaryColor" leftIcon="icon-left" title="确认订单">
</uni-nav-bar>
<view :style="{height:`${configInfo.navBarHeight}px`}"></view>
<image mode="aspectFill" lazy-load class="common-bg abs" src="https://lbqny.migugu.com/admin/farm/bg-cash.png">
</image>
<view class="space-lg"></view>
<view class="fill-base mt-md ml-md mr-md pd-lg box-shadow radius-24">
<view class="f-title c-title pb-lg b-1px-b">{{orderInfo.farmer_info.title}}</view>
<view class="flex-warp pt-lg pb-lg">
<image mode="aspectFill" lazy-load class="avatar lg radius-10" :src="orderInfo.claim_info.cover">
</image>
<view class="flex-1 ml-lg">
<view class="f-paragraph max-520 ellipsis">{{orderInfo.claim_info.title}}</view>
<block v-if="options.type">
<view class="flex-y-center f-desc c-warning mt-sm">众筹价<view
class="flex-y-baseline f-caption ml-sm">
¥<view class="f-sm-title text-bold">
{{orderInfo.claim_info[orderType[options.type]].price}}
</view>
</view>
<view class="f-icontext c-caption text-delete ml-sm">原价 ¥{{orderInfo.claim_info.price}}
</view>
</view>
<view class="flex-center mt-md">
<view class="collage-tag flex-center f-caption c-base" :style="{background:primaryColor}">
{{orderInfo.claim_info[orderType[options.type]].success_num}}人团
</view>
<view class="flex-1"></view>
</view>
</block>
<view class="flex-y-baseline f-paragraph c-warning mt-sm" v-else>¥{{orderInfo.claim_info.price}}
<view class="f-caption c-caption ml-sm">
/{{orderInfo.claim_info.unit}}</view>
</view>
</view>
</view>
<view class="flex-between pt-lg pb-lg b-1px-tb">
<view class="f-paragraph c-black">认养数量</view>
<view v-if="options.type">{{subForm.num}}</view>
<view class="add-remove-item flex-center" v-else>
<i @tap.stop="changeNum(-1,index)" class="iconfont icon-remove-square c-caption"></i>
<view class="number flex-center f-desc pl-sm pr-sm">{{subForm.num}}</view>
<i @tap.stop="changeNum(1,index)" class="iconfont icon-add-square"
:style="{color:primaryColor}"></i>
</view>
</view>
<view class="pt-lg pb-lg f-paragraph c-black">认养收获</view>
<view class="flex-center">
<image mode="aspectFill" lazy-load class="avatar sm radius-10"
:src="orderInfo.claim_info.harvest_cover"></image>
<view class="flex-1 ml-lg ellipsis">{{orderInfo.claim_info.harvest_text}}</view>
</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-paragraph box-shadow radius-24">
<view class="flex-between pd-lg">
<view class="flex-y-center f-sm-title c-black"><i class="iconfont icon-peisong mr-sm"
:style="{color:primaryColor}"></i>配送周期</view>
<view class="f-paragraph">{{orderInfo.claim_info.send_cycle}}</view>
</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-paragraph box-shadow radius-24">
<view class="flex-between pd-lg f-sm-title c-title b-1px-b">
<view class="text-bold">配送方式</view>
<view class="send-list flex-center radius" :style="{width:sendList.length==1?'90rpx':''}">
<view @tap.stop="toChangeItem('sendInd',index)" class="send-item flex-center f-paragraph radius"
:class="[{'c-base':sendInd == index}]" :style="{background:sendInd==index?primaryColor:''}"
v-for="(item,index) in sendList" :key="index">{{item.title}}</view>
</view>
</view>
<view @tap.stop="toChooseAddr" class="pd-lg flex-center"
v-if="sendList[sendInd].id == 1 || orderInfo.address.id">
<view class="flex-1">
<view class="flex-warp">
<i class="iconfont icon-dingwei mr-sm" style="font-size: 28rpx;margin-top: 6rpx;"></i>
<view class="f-paragraph c-title flex-1" :class="[{'max-520':sendList[sendInd].id == 2}]">
{{sendList[sendInd].id == 1 ? `${orderInfo.farmer_info.address}` : orderInfo.address.id ? `${orderInfo.address.address} ${orderInfo.address.address_info}`:''}}
</view>
</view>
<view class="flex-y-baseline f-paragraph c-caption" style="margin:5rpx 0 0 38rpx;">
{{sendList[sendInd].id == 1 ? orderInfo.farmer_info.user_name : orderInfo.address.id ? orderInfo.address.user_name:'' }}
<view class="ml-lg">
{{sendList[sendInd].id == 1? orderInfo.farmer_info.mobile : orderInfo.address.id ? orderInfo.address.mobile : ''}}
</view>
</view>
</view>
<i class="iconfont"
:class="[{'icon-dingwei':sendList[sendInd].id == 1},{'icon-right':sendList[sendInd].id == 2}]"></i>
</view>
<block v-else>
<view class="space-lg"></view>
<view class="space-lg"></view>
<view @tap.stop="toChooseAddr" class="add-btn flex-center f-paragraph c-desc"><i
class="iconfont icon-add-circle-fill mr-sm"></i>添加地址
</view>
<view class="space-lg"></view>
<view class="space-lg"></view>
</block>
</view>
<view class="fill-base mt-md ml-md mr-md f-paragraph box-shadow radius-24" v-if="sendList[sendInd].id == 1">
<view class="flex-between ml-md mr-md pl-sm pt-lg pb-lg b-1px-b">
<view class="flex-y-center">
<i class="iconfont icon-required c-warning"></i>
<view class="item-text">姓名</view>
</view>
<input v-model="subForm.user_name" type="text" class="flex-1 f-paragraph"
placeholder-class="c-placeholder" :placeholder="rule[0].errorMsg" />
</view>
<view class="flex-between ml-md mr-md pl-sm pt-lg pb-lg">
<view class="flex-y-center">
<i class="iconfont icon-required c-warning"></i>
<view class="item-text">手机号</view>
</view>
<input v-model="subForm.mobile" type="text" class="flex-1 f-paragraph" placeholder-class="c-placeholder"
:placeholder="rule[1].errorMsg" />
<button open-type="getPhoneNumber" @getphonenumber="toAuthPhone"
class="clear-btn auth-phone-btn flex-center" :style="{color:primaryColor}">立即授权</button>
</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-paragraph box-shadow radius-24">
<view class="flex-between ml-md mr-md pl-sm pt-lg pb-lg b-1px-b">
<view class="flex-y-center">
<i class="iconfont icon-required c-warning"></i>
<view class="item-text">认养取名</view>
</view>
<input v-model="subForm.claim_name" type="text" class="flex-1 f-paragraph"
placeholder-class="c-placeholder" :placeholder="rule[2].errorMsg" />
</view>
<view class="flex-between ml-md mr-md pl-sm pt-lg pb-lg">
<view class="flex-y-center">
<i class="iconfont icon-required c-base"></i>
<view class="item-text">订单备注</view>
</view>
<input v-model="subForm.text" type="text" class="flex-1 f-paragraph" maxlength="100"
placeholder-class="c-placeholder" placeholder="请输入订单备注" />
</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-paragraph box-shadow radius-24" v-if="!options.type">
<view class="flex-between ml-md mr-md pl-sm pt-lg pb-lg">
<view class="item-text">卡券优惠</view>
<view
@tap.stop="$util.goUrl({url:`/mine/pages/coupon/use?claim_id=${options.id}&num=${subForm.num}&type=2`})"
class="flex-y-center">
<view class="flex-1 text-right">
{{ orderInfo.coupon_id ? `${orderInfo.coupon_discount}` : `${orderInfo.canUseCoupon}张可用` }}
</view>
<i class="iconfont icon-right"></i>
</view>
</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-sm-title box-shadow radius-24">
<view @tap.stop="toChangeItem('payInd',index)"
class="flex-between ml-md mr-md pl-sm pr-sm pt-lg pb-lg b-1px-b" v-for="(item,index) in payList"
:key="index">
<view class="pay-item flex-y-center"><i class="iconfont mr-md" :class="[item.icon]"
:style="{color:item.id==1?primaryColor:item.id==2?subColor:'#01AAF2'}"></i>
<view class="flex-y-baseline">{{item.title}}
<view class="f-paragraph c-caption ml-sm" v-if="item.id==2">余额{{userInfo.balance || 0}}
</view>
</view>
</view>
<i class="pay-icon iconfont c-caption"
:class="[{'icon-xuanze':payInd != index},{'icon-radio-fill':item.is_disabled || payInd == index}]"
:style="{color:payInd==index?primaryColor:''}"></i>
</view>
</view>
<view @tap.stop="toAgree" class="flex-warp f-paragraph mt-md pd-md"><i
class="agree-icon iconfont c-caption mr-sm"
:class="[{'icon-xuanze': !agree},{'icon-xuanze-fill': agree}]" style="margin-top: 3rpx;"
:style="{color:agree?primaryColor:''}"></i>
<view class="flex-y-center">购买代表您已同意<view @tap.stop="$util.goUrl({url:`/mine/pages/agreement?type=1`})"
:style="{color:primaryColor}">
{{agreement}}</view>
</view>
</view>
<view class="space-max-footer"></view>
<view class="footer-btn fill-base fix">
<view class="footer-item flex-between pl-lg pr-lg">
<view class="flex-y-baseline f-paragraph c-title">
合计<view class="f-sm-title c-warning text-bold">¥{{orderInfo.pay_price}}</view>
</view>
<!-- #ifdef APP-PLUS -->
<view @tap="toOrder" class="order-btn flex-center f-sm-title c-base text-bold radius-20"
:style="{background:primaryColor}">立即支付
</view>
<!-- #endif -->
<!-- #ifndef APP-PLUS -->
<auth :needAuth="userInfo && !userInfo.nickName" :must="true" type="userInfo" @go="toOrder">
<view class="order-btn flex-center f-sm-title c-base text-bold radius-20"
:style="{background:primaryColor}">立即支付
</view>
</auth>
<!-- #endif -->
</view>
<view class="space-safe"></view>
</view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
scrollTop: 0,
orderType: {
1: 'collage_start_data',
2: 'collage_join_data'
},
// 1微信支付2余额支付3支付宝支付
payList: [{
id: 1,
title: '微信支付',
icon: 'icon-wechat-pay',
is_disabled: false
}
// #ifdef APP-PLUS
, {
id: 3,
title: '支付宝支付',
icon: 'icon-alipay',
is_disabled: false
}
// #endif
, {
id: 2,
title: '余额支付',
icon: 'icon-qianbao',
is_disabled: false
}
],
payInd: 0,
// #ifdef APP-PLUS
balanceInd: 2,
// #endif
// #ifndef APP-PLUS
balanceInd: 1,
// #endif
sendList: [],
sendInd: 0,
agreement: '',
agree: false,
orderInfo: {
address: {},
farmer_info: {},
claim_info: {},
},
subForm: {
num: 1,
send_type: 1,
address_id: '',
user_name: '',
mobile: '',
claim_name: '',
text: ''
},
rule: [{
name: "user_name",
checkType: "isNotNull",
errorMsg: "请输入姓名",
regType: 2
}, {
name: "mobile",
checkType: "isMobile",
errorMsg: "请输入手机号"
}, {
name: "claim_name",
checkType: "isNotNull",
errorMsg: "快给你认养的小动物取个名吧"
}],
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
let {
type = 0
} = options
options.type = type * 1
this.options = options
this.initIndex()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop
},
methods: {
...mapActions(['getUserInfo', 'getAuthPhone']),
...mapMutations(['updateOrderItem']),
async initIndex(refresh = false) {
if (!refresh) {
let [, info] = await Promise.all([this.getUserInfo(), this.$api.home.aboutUsInfoType({
type: 1
})])
this.agreement = info.title
}
let {
id: claim_id,
type: order_type,
cid: collage_id
} = this.options
let {
phone
} = this.userInfo
let {
mobile = '',
num = 1
} = this.subForm
this.subForm.mobile = mobile || phone
let {
address = {}, coupon_id = 0
} = this.orderInfo
let {
id: address_id = 0
} = address
let param = {
claim_id,
coupon_id,
address_id,
num
}
// order_type 1发起众筹2参与众筹
if (order_type == 1) {
param.collage_start_id = collage_id
}
if (order_type == 2) {
param.collage_join_id = collage_id
}
let orderInfo = await this.$api.claim.claimPayOrderInfo(param)
if (!refresh) {
let {
is_self,
is_send
} = orderInfo.claim_info
let sendList = []
if (is_self) {
sendList.push({
id: 1,
title: '自提',
})
}
if (is_send) {
sendList.push({
id: 2,
title: '快递',
})
}
this.sendList = sendList
}
let {
balance
} = this.userInfo
let {
pay_price
} = orderInfo
let is_disabled = balance * 1 < pay_price * 1
let {
balanceInd
} = this
this.payList[balanceInd].is_disabled = is_disabled
if (pay_price * 1 == 0) {
this.payList[0].is_disabled = true
// #ifdef APP-PLUS
this.payList[1].is_disabled = true
// #endif
this.payInd = balanceInd
}
this.orderInfo = orderInfo
},
initRefresh() {
this.initIndex(true)
},
async changeNum(mod, index) {
let {
num: goods_num
} = this.subForm
let {
unit
} = this.orderInfo.claim_info
let num = goods_num + mod;
if (num < 1) {
this.$util.showToast({
title: `此动物最少购买1${unit}`
})
return;
}
this.subForm.num = num
this.initRefresh()
},
toChangeItem(key, index) {
if (key == 'payInd' && index === 2 && this.payList[index].is_disabled) return
this[key] = index
},
async toMap() {
let {
lat,
lng,
address
} = this.orderInfo.farmer_info
await this.$util.checkAuth({
type: 'userLocation'
})
await uni.getLocation({
type: 'gcj02',
})
await uni.openLocation({
latitude: lat * 1,
longitude: lng * 1,
name: address,
scale: 28
})
},
toChooseAddr() {
if (this.sendList[this.sendInd].id == 1) {
this.toMap()
return
}
this.$util.goUrl({
url: `/mine/pages/address/list?check=1`
})
},
// 授权手机号
async toAuthPhone(e) {
let phone = await this.getAuthPhone({
e,
})
if (!phone) return
this.$nextTick(() => {
this.subForm.mobile = phone
})
},
toAgree() {
this.agree = !this.agree
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
let arr = param.send_type == 1 ? ['user_name', 'mobile', 'claim_name'] : [
'claim_name'
]
this.rule.map(item => {
let {
name
} = item
if (!arr.includes(name)) return
validate.add(param[name], item);
})
let message = validate.start();
return message;
},
toOrder() {
let {
payList,
payInd,
sendList,
sendInd,
subForm,
agreement
} = this
let {
id: claim_id,
cid: collage_id,
type: order_type
} = this.options
let {
id: pay_model
} = payList[payInd]
let {
id: send_type
} = sendList[sendInd]
let {
address = {}, coupon_id = 0
} = this.orderInfo
let {
id: address_id = 0
} = address
if (!address_id && send_type == 2) {
this.$util.showToast({
title: `请选择收货地址`
})
return
}
let param = Object.assign({}, subForm, {
claim_id,
address_id,
coupon_id,
pay_model,
send_type
});
// order_type 1发起众筹2参与众筹
if (order_type == 1) {
param.collage_start_id = collage_id
}
if (order_type == 2) {
param.collage_join_id = collage_id
}
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
});
return;
}
if (!this.agree) {
this.$util.showToast({
title: `请勾选${agreement}`
})
return
}
this.toPay(param)
},
async toPay(param) {
// #ifdef MP-WEIXIN
let that = this
let {
tmp_list = []
} = that.orderInfo
let tmplIds = []
tmp_list.map(item => {
tmplIds.push(item.tmpl_id)
})
if (tmplIds && tmplIds.length > 0) {
uni.requestSubscribeMessage({
tmplIds,
complete(res) {
that.toConfirmPay(param)
console.log(res, "complete requestSubscribeMessage");
}
})
} else {
that.toConfirmPay(param)
}
// #endif
// #ifndef MP-WEIXIN
this.toConfirmPay(param)
// #endif
},
async toConfirmPay(param) {
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
let {
pay_list
} = await this.$api.claim.claimPayOrder(param)
this.$util.hideAll()
if (pay_list) {
if (param.pay_model == 3) {
pay_list = {
orderInfo: pay_list,
provider: 'alipay'
}
}
try {
await this.$util.pay(pay_list)
this.$util.showToast({
title: `支付成功`
})
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: '/mine/pages/pay-result?type=claim',
openType: 'redirectTo'
})
}, 1000)
this.lockTap = false
return
} catch (e) {
this.$util.showToast({
title: `支付失败`
})
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: `/claim/pages/order/list`,
openType: 'redirectTo'
})
}, 1000)
this.lockTap = false
return
}
}
this.$util.showToast({
title: `支付成功`
})
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: '/mine/pages/pay-result?type=claim',
openType: 'redirectTo'
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
.claim-order {
.collage-tag {
height: 36rpx;
padding: 0 10rpx;
}
.send-list {
width: 180rpx;
height: 52rpx;
border: 1rpx solid #CCCCCC;
transform: rotateZ(360deg);
overflow: hidden;
.send-item {
width: 90rpx;
height: 50rpx;
}
}
.add-btn {
width: 296rpx;
height: 72rpx;
background: #F6F6F6;
border-radius: 36rpx;
margin: 0 auto;
}
.pay-item {
.iconfont {
font-size: 50rpx;
}
}
.pay-icon {
font-size: 40rpx;
}
.icon-right {
font-size: 28rpx;
}
.icon-peisong,
.agree-icon {
font-size: 36rpx;
}
.item-text {
width: 150rpx;
}
.auth-phone-btn {
width: 106rpx;
height: 36rpx;
line-height: 36rpx;
margin-left: 15rpx;
font-size: 20rpx;
background: #F0F4EC;
border-radius: 10rpx;
}
.footer-btn {
bottom: 0;
.footer-item {
height: 114rpx;
.order-btn {
width: 332rpx;
height: 88rpx;
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff