初始化代码
This commit is contained in:
170
uniapp/uni-app/claim/pages/order/breed/detail.vue
Normal file
170
uniapp/uni-app/claim/pages/order/breed/detail.vue
Normal file
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<view class="claim-order-detail" v-if="detail.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="order-item fill-base mg-big pd-lg radius-16 box-shadow" :class="[{'mt-md':index!=0}]">
|
||||
<view class="flex-center" :class="[{'mt-md':aindex!=0}]" v-for="(aitem,aindex) in detail.order_goods"
|
||||
:key="aindex">
|
||||
<image mode="aspectFill" lazy-load class="avatar radius-16" :src="aitem.goods_cover"></image>
|
||||
<view class="flex-1 ml-lg">
|
||||
<view class="f-paragraph c-title text-bold ellipsis" style="max-width: 498rpx;">
|
||||
{{aitem.goods_name}}
|
||||
</view>
|
||||
<view class="flex-between f-desc c-caption mt-md">
|
||||
<view class="f-paragraph c-warning"> ¥{{aitem.goods_price}} </view>
|
||||
<view>x{{aitem.goods_num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fill-base mg-md pd-lg radius-24" v-if="detail.text">
|
||||
<view class="f-paragraph c-title">
|
||||
<view class="c-desc">订单备注</view>
|
||||
<view class="mt-sm">
|
||||
<text decode="emsp" style="word-break:break-all;">{{detail.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fill-base mg-md pd-lg radius-24">
|
||||
<view class="flex-between f-paragraph c-title">
|
||||
<view class="c-desc">订单编号</view>
|
||||
<view class="flex-warp">
|
||||
<view class="max-400 ellipsis">{{detail.order_code}}</view>
|
||||
<view @tap="$util.goUrl( {url:`${detail.order_code}`,openType:'copy'})"
|
||||
class="copy-btn flex-center fill-body" :style="{color:primaryColor}">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between f-paragraph c-title mt-lg">
|
||||
<view class="c-desc">付款单号</view>
|
||||
<view class="flex-warp">
|
||||
<view class="max-400 ellipsis">{{detail.transaction_id}}</view>
|
||||
<view @tap="$util.goUrl( {url:`${detail.transaction_id}`,openType:'copy'})"
|
||||
class="copy-btn flex-center fill-body" :style="{color:primaryColor}">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between f-paragraph c-title mt-lg">
|
||||
<view class="c-desc">下单时间</view>
|
||||
<view>{{detail.create_time}}</view>
|
||||
</view>
|
||||
<view class="flex-between f-paragraph c-title mt-lg" v-if="detail.pay_time">
|
||||
<view class="c-desc">支付时间</view>
|
||||
<view>{{detail.pay_time}}</view>
|
||||
</view>
|
||||
<view class="flex-between f-paragraph c-title mt-lg">
|
||||
<view class="c-desc">实付金额</view>
|
||||
<view class="c-warning">¥{{detail.pay_price}}</view>
|
||||
</view>
|
||||
<view class="flex-between f-paragraph c-title mt-lg">
|
||||
<view class="c-desc">支付方式</view>
|
||||
<view>{{payType[detail.pay_model]}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from "vuex"
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
scrollTop: 0,
|
||||
options: {},
|
||||
detail: {},
|
||||
payType: {
|
||||
1: '微信支付',
|
||||
2: '余额支付',
|
||||
3: '支付宝支付'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.$util.showLoading()
|
||||
this.options = options
|
||||
this.initIndex()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop
|
||||
},
|
||||
computed: mapState({
|
||||
primaryColor: state => state.config.configInfo.primaryColor,
|
||||
subColor: state => state.config.configInfo.subColor,
|
||||
configInfo: state => state.config.configInfo,
|
||||
userInfo: state => state.user.userInfo
|
||||
}),
|
||||
methods: {
|
||||
...mapActions(['']),
|
||||
async initIndex() {
|
||||
let {
|
||||
id
|
||||
} = this.options
|
||||
let data = await this.$api.claim.breedOrderInfo({
|
||||
id
|
||||
})
|
||||
this.detail = data
|
||||
this.$util.hideAll()
|
||||
},
|
||||
initRefresh() {
|
||||
this.initIndex()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.claim-order-detail {
|
||||
|
||||
.order-video-info {
|
||||
width: 750rpx;
|
||||
height: 380rpx;
|
||||
margin-top: 26rpx;
|
||||
|
||||
.video-img {
|
||||
width: 750rpx;
|
||||
height: 380rpx;
|
||||
}
|
||||
|
||||
.video-bg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 750rpx;
|
||||
height: 380rpx;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
|
||||
.iconfont {
|
||||
font-size: 70rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-count-info {
|
||||
.count-item {
|
||||
width: 33.33%;
|
||||
}
|
||||
}
|
||||
|
||||
.order-seed-item {
|
||||
.seed-img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.send-btn {
|
||||
width: 180rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
263
uniapp/uni-app/claim/pages/order/breed/list.vue
Normal file
263
uniapp/uni-app/claim/pages/order/breed/list.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<view class="claim-order-detail">
|
||||
<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 breed abs" src="https://lbqny.migugu.com/admin/farm/bg-breed.png"></image>
|
||||
|
||||
<view @tap.stop="goDetail(index)" class="order-item flex-center fill-base mg-big pd-lg radius-16 box-shadow"
|
||||
:class="[{'mt-md':index!=0}]" v-for="(item,index) in list.data" :key="index">
|
||||
<image mode="aspectFill" lazy-load class="avatar big radius-24" :src="item.cover"></image>
|
||||
<view class="flex-1 ml-lg">
|
||||
<view class="f-title c-title text-bold ellipsis" style="max-width: 468rpx;"> {{item.title}}
|
||||
</view>
|
||||
<view class="f-caption c-caption mt-md mb-md ellipsis" style="max-width: 468rpx;"> {{item.sub_title}}
|
||||
</view>
|
||||
<view class="flex-between">
|
||||
<view class="f-title c-warning"> ¥{{item.price}} </view>
|
||||
<view class="add-remove-item flex-warp">
|
||||
<block v-if="item.car_num>0">
|
||||
<i @tap.stop="toAddCar(index, -1)" class="iconfont icon-remove-square"></i>
|
||||
<view class="number-text flex-center">{{item.car_num}}</view>
|
||||
</block>
|
||||
<i @tap.stop="toAddCar(index,1)" class="iconfont icon-add-square"
|
||||
:style="{color:primaryColor}"></i>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
|
||||
</load-more>
|
||||
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
|
||||
|
||||
<view class="space-footer"></view>
|
||||
<view class="space-max-footer"></view>
|
||||
<view class="footer-btn fix pl-lg pr-lg fill-base" v-if="list.count > 0">
|
||||
<image mode="aspectFill" lazy-load class="cart-img abs" src="/static/image/farm/breed-cart.png"></image>
|
||||
<view class="cart-msg flex-center c-base f-icontext abs" :style="{width: list.count<10 ? '30rpx' : '50rpx'}"
|
||||
v-if="list.count">
|
||||
{{list.count < 100 ? list.count : '99+'}}
|
||||
</view>
|
||||
<view class="footer-item flex-between">
|
||||
<view class="flex-y-baseline">总计:<view class="c-warning ml-sm">¥{{list.total_price}}</view>
|
||||
</view>
|
||||
<view @tap.stop="toOrder" class="order-btn flex-center f-title c-base text-bold radius-20"
|
||||
:style="{background:primaryColor}">立即下单
|
||||
</view>
|
||||
</view>
|
||||
<view class="space-safe"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions,
|
||||
mapMutations
|
||||
} from "vuex"
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
scrollTop: 0,
|
||||
detail: {},
|
||||
number: 1,
|
||||
param: {
|
||||
page: 1,
|
||||
},
|
||||
list: {
|
||||
data: [],
|
||||
count: 0,
|
||||
total_price: 0
|
||||
},
|
||||
loading: true,
|
||||
lockTap: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
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()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.list.current_page >= this.list.last_page || this.loading) return
|
||||
this.param.page = this.param.page + 1
|
||||
this.loading = true
|
||||
this.getList()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop
|
||||
},
|
||||
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,
|
||||
}),
|
||||
methods: {
|
||||
...mapMutations(['updateOrderItem']),
|
||||
async initIndex() {
|
||||
this.getList()
|
||||
},
|
||||
initRefresh() {
|
||||
this.param.page = 1
|
||||
this.initIndex()
|
||||
},
|
||||
handerTabChange(index) {
|
||||
this.activeIndex = index
|
||||
this.$util.showLoading()
|
||||
this.param.page = 1
|
||||
this.list.data = []
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
let {
|
||||
list: oldList,
|
||||
param
|
||||
} = this
|
||||
let {
|
||||
farmer_id
|
||||
} = this.options
|
||||
param.farmer_id = farmer_id
|
||||
let newList = await this.$api.claim.breedList(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()
|
||||
},
|
||||
// 添加购物车
|
||||
async toAddCar(index, goods_num) {
|
||||
let {
|
||||
id: goods_id,
|
||||
car_id = 0
|
||||
} = this.list.data[index]
|
||||
await this.toUpdateCar(goods_id, goods_num, car_id, index)
|
||||
},
|
||||
// 修改购物车数量
|
||||
async toUpdateCar(goods_id, goods_num, car_id, index) {
|
||||
if (this.lockTap) return;
|
||||
this.lockTap = true;
|
||||
let methodModel = goods_num > 0 ? 'addCar' : 'delCar'
|
||||
let {
|
||||
farmer_id
|
||||
} = this.options
|
||||
let param = goods_num > 0 ? {
|
||||
farmer_id,
|
||||
goods_id,
|
||||
goods_num,
|
||||
type: 1
|
||||
} : {
|
||||
id: car_id,
|
||||
goods_num: 1
|
||||
}
|
||||
try {
|
||||
let curCarId = await this.$api.claim[methodModel](param)
|
||||
this.lockTap = false
|
||||
let {
|
||||
car_num,
|
||||
} = this.list.data[index]
|
||||
let num = car_num + goods_num
|
||||
let cur_car_id = car_id ? num == 0 ? '' : car_id : curCarId
|
||||
this.list.data[index].car_id = cur_car_id
|
||||
this.list.data[index].car_num = num
|
||||
this.getCount()
|
||||
} catch (e) {
|
||||
this.lockTap = false
|
||||
}
|
||||
},
|
||||
async getCount() {
|
||||
let {
|
||||
farmer_id
|
||||
} = this.options
|
||||
let {
|
||||
count,
|
||||
total_price
|
||||
} = await this.$api.claim.breedList({
|
||||
farmer_id
|
||||
});
|
||||
this.list.count = count
|
||||
this.list.total_price = total_price
|
||||
},
|
||||
toOrder() {
|
||||
let {
|
||||
id: claim_order_id,
|
||||
farmer_id
|
||||
} = this.options
|
||||
let {
|
||||
total_price: pay_price
|
||||
} = this.list
|
||||
let param = {
|
||||
claim_order_id,
|
||||
pay_price,
|
||||
page_type: 'breed'
|
||||
}
|
||||
this.updateOrderItem({
|
||||
key: 'orderInfo',
|
||||
val: param
|
||||
})
|
||||
let url = `/mine/pages/pay`
|
||||
this.$util.goUrl({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.claim-order-detail {
|
||||
|
||||
.footer-btn {
|
||||
bottom: 0;
|
||||
|
||||
.cart-img {
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
top: -8rpx;
|
||||
}
|
||||
|
||||
.cart-msg {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
border-radius: 15rpx 15rpx 15rpx 0;
|
||||
background: #f12c20;
|
||||
top: -8rpx;
|
||||
left: 108rpx;
|
||||
}
|
||||
|
||||
.footer-item {
|
||||
height: 114rpx;
|
||||
margin-left: 180rpx;
|
||||
|
||||
.order-btn {
|
||||
width: 226rpx;
|
||||
height: 88rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
253
uniapp/uni-app/claim/pages/order/collage/detail.vue
Normal file
253
uniapp/uni-app/claim/pages/order/collage/detail.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<view class="claim-order-collage-detail" v-if="detail.id">
|
||||
<view class="mg-md">
|
||||
<view class="collage-item flex-center pd-lg fill-base radius-16">
|
||||
<image mode="aspectFill" lazy-load class="cover radius-10" :src="detail.claim_cover"></image>
|
||||
<view class="flex-1 ml-md">
|
||||
<view class="f-title c-title text-bold ellipsis">{{detail.claim_title}}</view>
|
||||
<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">{{detail.price}}</view>
|
||||
</view>
|
||||
<view class="f-icontext c-caption text-delete ml-sm">原价 ¥{{detail.claim_price}}</view>
|
||||
</view>
|
||||
<view class="flex-center mt-md">
|
||||
<view class="collage-tag flex-center f-caption c-base" :style="{background:primaryColor}">
|
||||
{{detail.success_num}}人团
|
||||
</view>
|
||||
<view class="flex-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-md pd-lg flex-center flex-column fill-base radius-16">
|
||||
<view class="space-md"></view>
|
||||
<view class="flex-center">
|
||||
<image lazy-load class="tag-img mr-lg" src="/static/image/farm/tag.png"></image>
|
||||
<view class="f-md-title text-bold" :style="{color:primaryColor}">
|
||||
{{detail.status==1?`还差${detail.surplus_num}人, 成团立享超值优惠`:statusType[detail.status].title}}
|
||||
</view>
|
||||
<image lazy-load class="tag-img ml-lg" src="/static/image/farm/tag.png"></image>
|
||||
</view>
|
||||
<block v-if="detail.status==1">
|
||||
<view class="user-list flex-center mt-lg mb-md">
|
||||
<block v-for="(item,index) in detail.user_list" :key="index">
|
||||
<image class="avatar radius" :src="item"
|
||||
v-if="index< detail.success_num > 4 ? 4 : detail.success_num - 1"></image>
|
||||
</block>
|
||||
<block v-if="detail.surplus_num">
|
||||
<view class="avatar flex-center radius" v-for="(item,index) in detail.more_num"
|
||||
:key="index"><i class="iconfont icon-add"></i>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="flex-y-center mt-lg mb-lg" :style="{color:primaryColor}">
|
||||
<min-countdown :type="2" :targetTime="detail.end_time * 1000" color="#333" textColor="#999"
|
||||
bgColor="#F7F7F7" className="sm" @callback="countEnd">
|
||||
</min-countdown>
|
||||
</view>
|
||||
<view class="f-desc c-caption">还差{{detail.surplus_num}}人成团,距离结束还剩</view>
|
||||
<view class="space-lg"></view>
|
||||
</block>
|
||||
<view class="collage-status-icon iconfont icon-biaoqian flex-center"
|
||||
:style="{color:detail.status==2?primaryColor:'#E82F21'}" v-else>
|
||||
<view class="f-md-title text-bold abs">{{statusType[detail.status].text}}</view>
|
||||
</view>
|
||||
<block v-if="detail.status == 1 && !detail.can_join">
|
||||
<!-- #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 -->
|
||||
</block>
|
||||
|
||||
<view @click="toOrder" class="share-btn flex-center f-sm-title" :style="{background:primaryColor}"
|
||||
v-if="(detail.status == 1 && detail.can_join) || (detail.status>1 && detail.can_start)">
|
||||
{{detail.status==1 ? '立即参与' : '再开一团'}}
|
||||
</view>
|
||||
<view class="space-lg"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from "vuex"
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
options: {},
|
||||
detail: {},
|
||||
statusType: {
|
||||
2: {
|
||||
title: '众筹活动已人满成功',
|
||||
text: '众筹成功'
|
||||
},
|
||||
3: {
|
||||
title: '众筹超时失败',
|
||||
text: '众筹失败'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.$util.showLoading()
|
||||
this.options = options
|
||||
this.initIndex()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// #ifndef APP-PLUS
|
||||
uni.showNavigationBarLoading()
|
||||
// #endif
|
||||
this.initRefresh()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
computed: mapState({
|
||||
primaryColor: state => state.config.configInfo.primaryColor,
|
||||
subColor: state => state.config.configInfo.subColor,
|
||||
configInfo: state => state.config.configInfo,
|
||||
userInfo: state => state.user.userInfo
|
||||
}),
|
||||
methods: {
|
||||
...mapActions(['']),
|
||||
async initIndex() {
|
||||
let {
|
||||
id
|
||||
} = this.options
|
||||
let data = await this.$api.claim.claimCollageInfo({
|
||||
id
|
||||
})
|
||||
let {
|
||||
success_num,
|
||||
user_list
|
||||
} = data
|
||||
let len = user_list.length
|
||||
data.more_num = len > 3 ? 1 : success_num > 4 ? 5 - len : success_num - len
|
||||
this.detail = data
|
||||
this.$util.hideAll()
|
||||
},
|
||||
initRefresh() {
|
||||
this.initIndex()
|
||||
},
|
||||
countEnd() {
|
||||
this.$util.log("倒计时完了")
|
||||
setTimeout(() => {
|
||||
this.initRefresh()
|
||||
}, 1000)
|
||||
},
|
||||
toAppShare() {
|
||||
// #ifdef APP-PLUS
|
||||
let {
|
||||
siteroot
|
||||
} = siteInfo
|
||||
let url = siteroot.split('/index.php')[0]
|
||||
let href = `${url}/h5/#/user/pages/coupon/share?coupon_atv_id=${id}&pid=${pid}`
|
||||
let scene = type == 1 ? 'WXSceneSession' : 'WXSceneTimeline'
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene,
|
||||
type: 0,
|
||||
href,
|
||||
title,
|
||||
summary,
|
||||
imageUrl,
|
||||
success: function(res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log("fail:" + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
toOrder() {
|
||||
let {
|
||||
id,
|
||||
atv_id,
|
||||
claim_id,
|
||||
status
|
||||
} = this.detail
|
||||
let type = status == 1 ? 2 : 1
|
||||
let cid = type == 1 ? atv_id : id
|
||||
let url = `/claim/pages/order?id=${claim_id}&cid=${cid}&type=${type}`
|
||||
this.$util.goUrl({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.claim-order-collage-detail {
|
||||
|
||||
.collage-item {
|
||||
|
||||
.cover {
|
||||
width: 180rpx;
|
||||
height: 170rpx;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
max-width: 450rpx;
|
||||
}
|
||||
|
||||
.collage-tag {
|
||||
height: 36rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-img {
|
||||
width: 26rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.collage-status-icon {
|
||||
width: 210rpx;
|
||||
height: 200rpx;
|
||||
font-size: 200rpx;
|
||||
margin: 50rpx auto;
|
||||
|
||||
.text-bold {
|
||||
height: 40rpx;
|
||||
transform: rotate(-32deg);
|
||||
}
|
||||
}
|
||||
|
||||
.user-list {
|
||||
|
||||
.avatar {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
margin: 0 17rpx;
|
||||
|
||||
.icon-add {
|
||||
color: #D8D8D7
|
||||
}
|
||||
}
|
||||
|
||||
.avatar.flex-center {
|
||||
background: #F8F8F8;
|
||||
border: 1px solid #DBDBDB;
|
||||
}
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
width: 590rpx;
|
||||
height: 90rpx;
|
||||
color: #fff;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
187
uniapp/uni-app/claim/pages/order/collage/list.vue
Normal file
187
uniapp/uni-app/claim/pages/order/collage/list.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<view class="claim-order-collage-list">
|
||||
<fixed>
|
||||
<view class="fill-base pd-lg f-paragraph c-title b-1px-b">我参与了{{list.total_num||0}}个众筹</view>
|
||||
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
|
||||
:width="100/tabList.length + '%'" height="100rpx"></tab>
|
||||
<view class="b-1px-b"></view>
|
||||
</fixed>
|
||||
<view @tap.stop="goDetail(index)" class="order-item rel fill-base mg-big pd-lg radius-16"
|
||||
v-for="(item,index) in list.data" :key="index">
|
||||
<view class="flex-between pb-lg f-desc b-1px-b" :style="{color:primaryColor}"
|
||||
v-if="activeIndex==0 && item.status==1">
|
||||
<view> 距离开团结束仅剩 </view>
|
||||
<min-countdown :type="2" :targetTime="item.end_time * 1000" :color="primaryColor"
|
||||
:textColor="primaryColor" :borderColor="primaryColor" @callback="countEnd">
|
||||
</min-countdown>
|
||||
</view>
|
||||
<view class="pb-lg f-sm-title c-title text-bold" :class="[{'pt-lg':activeIndex==0 && item.status ==1}]">
|
||||
{{item.claim_title}}
|
||||
</view>
|
||||
<view class="flex-center">
|
||||
<view class="flex-warp flex-1">
|
||||
<block v-for="(aitem,aindex) in item.user_avatar" :key="index">
|
||||
<view class="avatar-group md" v-if="aindex<4">
|
||||
<image mode="aspectFill" lazy-load class="abs avatar fill-body radius" :src="aitem">
|
||||
</image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="common-btn flex-center f-desc c-base" :style="{background:primaryColor}"
|
||||
v-if="activeIndex==1">查看订单</view>
|
||||
</view>
|
||||
<view class="collage-status-icon abs iconfont icon-biaoqian flex-center"
|
||||
:style="{color:item.status==1?primaryColor:'#E82F21'}" v-if="activeIndex==0">
|
||||
<view class="f-icontext text-bold abs">{{statusType[item.status]}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
|
||||
</load-more>
|
||||
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
|
||||
|
||||
<view class="space-footer"></view>
|
||||
<common-popup @confirm="confirmCancel" ref="cancel_item" type="CANCEL_ORDER" :info="popupInfo"></common-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
} from "vuex"
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
options: {},
|
||||
activeIndex: 0,
|
||||
tabList: [{
|
||||
id: 1,
|
||||
title: '未成团'
|
||||
}, {
|
||||
id: 2,
|
||||
title: '已成团'
|
||||
}],
|
||||
statusType: {
|
||||
1: '进行中',
|
||||
2: '众筹成功',
|
||||
3: '众筹超时'
|
||||
},
|
||||
param: {
|
||||
page: 1,
|
||||
},
|
||||
list: {
|
||||
data: []
|
||||
},
|
||||
loading: true,
|
||||
popupInfo: {},
|
||||
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,
|
||||
}),
|
||||
onLoad(options) {
|
||||
this.$util.showLoading()
|
||||
this.options = options
|
||||
let {
|
||||
tab = 0
|
||||
} = options
|
||||
this.activeIndex = tab
|
||||
this.initIndex()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// #ifndef APP-PLUS
|
||||
uni.showNavigationBarLoading()
|
||||
// #endif
|
||||
this.initRefresh()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.list.current_page >= this.list.last_page || this.loading) return
|
||||
this.param.page = this.param.page + 1
|
||||
this.loading = true
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
initIndex() {
|
||||
this.getList()
|
||||
},
|
||||
initRefresh() {
|
||||
this.param.page = 1
|
||||
this.initIndex()
|
||||
},
|
||||
countEnd() {
|
||||
this.$util.log("倒计时完了")
|
||||
setTimeout(() => {
|
||||
this.initRefresh()
|
||||
}, 1000)
|
||||
},
|
||||
handerTabChange(index) {
|
||||
this.activeIndex = index
|
||||
this.$util.showLoading()
|
||||
this.param.page = 1
|
||||
this.list.data = []
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
let {
|
||||
list: oldList,
|
||||
param,
|
||||
tabList,
|
||||
activeIndex
|
||||
} = this
|
||||
param.status = tabList[activeIndex].id
|
||||
let newList = await this.$api.claim.userCollageList(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()
|
||||
},
|
||||
// 订单详情
|
||||
goDetail(index) {
|
||||
let {
|
||||
start_id,
|
||||
order_id
|
||||
} = this.list.data[index]
|
||||
let {
|
||||
activeIndex
|
||||
} = this
|
||||
let url = activeIndex == 0 ? `/claim/pages/order/collage/detail?id=${start_id}` :
|
||||
`/claim/pages/order/detail?id=${order_id}`
|
||||
this.$util.goUrl({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.claim-order-collage-list {
|
||||
|
||||
.order-item {
|
||||
.collage-status-icon {
|
||||
right: 30rpx;
|
||||
bottom: 30rpx;
|
||||
width: 110rpx;
|
||||
height: 100rpx;
|
||||
font-size: 100rpx;
|
||||
|
||||
.text-bold {
|
||||
height: 26rpx;
|
||||
transform: rotate(-32deg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1067
uniapp/uni-app/claim/pages/order/detail.vue
Normal file
1067
uniapp/uni-app/claim/pages/order/detail.vue
Normal file
File diff suppressed because it is too large
Load Diff
294
uniapp/uni-app/claim/pages/order/list.vue
Normal file
294
uniapp/uni-app/claim/pages/order/list.vue
Normal file
@@ -0,0 +1,294 @@
|
||||
<template>
|
||||
<view class="farmer-order-land-list">
|
||||
<fixed>
|
||||
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
|
||||
:width="100/tabList.length + '%'" height="100rpx"></tab>
|
||||
<view class="b-1px-b"></view>
|
||||
</fixed>
|
||||
<view @tap.stop="goDetail(index)" class="order-item fill-base mg-big pd-lg radius-16 box-shadow"
|
||||
v-for="(item,index) in list.data" :key="index">
|
||||
<view class="flex-between pb-lg c-title">
|
||||
<view class="f-title flex-y-baseline"><i class="iconfont icon-dianpu mr-sm"></i>
|
||||
<view class="text-bold max-400 ellipsis">{{item.farmer_info.title}}</view>
|
||||
</view>
|
||||
<view class="f-paragraph"
|
||||
:style="{color:item.pay_type == 1? subColor: item.pay_type == 2? primaryColor: ''}">
|
||||
{{statusType[item.pay_type]}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-center">
|
||||
<image mode="aspectFill" lazy-load class="avatar radius-24" :src="item.goods_cover"></image>
|
||||
<view class="flex-1 ml-lg">
|
||||
<view class="f-title c-title text-bold ellipsis" style="max-width: 498rpx;"> {{item.goods_name}}
|
||||
</view>
|
||||
<view class="f-caption c-caption mt-sm"> 数量:{{`${item.num}/${item.unit}`}} </view>
|
||||
<view class="f-caption c-caption"> 配送周期:{{item.send_cycle}} </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between f-paragraph mt-md pt-md b-1px-t">
|
||||
<view class="c-desc max-380 ellipsis">认养编号 {{item.claim_code}}</view>
|
||||
<view class="flex-y-baseline c-title">总计:<view class="f-title c-warning">¥{{item.pay_price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-between mt-md">
|
||||
<view></view>
|
||||
<view class="flex-warp" v-if="item.pay_type == 1">
|
||||
<view @tap.stop="toChangeOrder(index,'cancel_item')"
|
||||
class="common-btn disabled flex-center f-caption c-title radius-4">取消订单
|
||||
</view>
|
||||
<view @tap.stop="toPay(index)" class="common-btn flex-center f-caption c-base radius-4 ml-lg"
|
||||
:style="{background:primaryColor}">去支付
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-warp" v-if="item.pay_type == 2">
|
||||
<view @tap.stop="goDetail(index,2)" class="common-btn flex-center f-caption c-base radius-4 ml-lg"
|
||||
:style="{background:primaryColor}">养殖管理
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-warp" v-if="item.pay_type == 7 && !item.have_eva">
|
||||
<view @tap.stop="toEvaluate(index)" class="common-btn flex-center f-caption c-base radius-4 ml-lg"
|
||||
:style="{background:primaryColor}">去评价
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
|
||||
</load-more>
|
||||
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
|
||||
|
||||
<view class="space-footer"></view>
|
||||
<common-popup @confirm="confirmCancel" ref="cancel_item" type="CANCEL_ORDER" :info="popupInfo"></common-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
} from "vuex"
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
options: {},
|
||||
activeIndex: 0,
|
||||
tabList: [{
|
||||
id: 0,
|
||||
title: '全部'
|
||||
}, {
|
||||
id: 2,
|
||||
title: '认养中',
|
||||
number: 0
|
||||
}, {
|
||||
id: 3,
|
||||
title: '配送中',
|
||||
number: 0
|
||||
}, {
|
||||
id: 7,
|
||||
title: '已完成'
|
||||
}],
|
||||
statusType: {
|
||||
'-1': '已取消',
|
||||
1: '待支付',
|
||||
2: '认养中',
|
||||
3: '配送中',
|
||||
7: '已完成',
|
||||
},
|
||||
param: {
|
||||
page: 1,
|
||||
},
|
||||
list: {
|
||||
data: []
|
||||
},
|
||||
loading: true,
|
||||
popupInfo: {},
|
||||
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,
|
||||
}),
|
||||
onLoad(options) {
|
||||
this.$util.showLoading()
|
||||
this.options = options
|
||||
let {
|
||||
tab = 0
|
||||
} = options
|
||||
this.activeIndex = tab
|
||||
this.initIndex()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// #ifndef APP-PLUS
|
||||
uni.showNavigationBarLoading()
|
||||
// #endif
|
||||
this.initRefresh()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.list.current_page >= this.list.last_page || this.loading) return
|
||||
this.param.page = this.param.page + 1
|
||||
this.loading = true
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
initIndex() {
|
||||
this.getList()
|
||||
},
|
||||
initRefresh() {
|
||||
this.param.page = 1
|
||||
this.initIndex()
|
||||
},
|
||||
handerTabChange(index) {
|
||||
this.activeIndex = index
|
||||
this.$util.showLoading()
|
||||
this.param.page = 1
|
||||
this.list.data = []
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
let {
|
||||
list: oldList,
|
||||
param,
|
||||
tabList,
|
||||
activeIndex
|
||||
} = this
|
||||
param.pay_type = tabList[activeIndex].id
|
||||
let newList = await this.$api.claim.orderList(param);
|
||||
|
||||
if (this.param.page == 1) {
|
||||
this.list = newList
|
||||
} else {
|
||||
newList.data = oldList.data.concat(newList.data)
|
||||
this.list = newList
|
||||
}
|
||||
this.loading = false
|
||||
let {
|
||||
claim_count,
|
||||
send_count
|
||||
} = newList.count
|
||||
this.tabList[1].number = claim_count
|
||||
this.tabList[2].number = send_count
|
||||
this.$util.hideAll()
|
||||
},
|
||||
// 取消订单/确认收货
|
||||
async toChangeOrder(index, key) {
|
||||
let {
|
||||
id,
|
||||
order_code,
|
||||
goods_cover: image,
|
||||
} = this.list.data[index]
|
||||
this.popupInfo = {
|
||||
id,
|
||||
name: `订单编号:${order_code}`,
|
||||
image,
|
||||
index,
|
||||
}
|
||||
this.$refs[key].open()
|
||||
},
|
||||
async confirmCancel() {
|
||||
let {
|
||||
id,
|
||||
index,
|
||||
} = this.popupInfo
|
||||
if (this.lockTap) return;
|
||||
this.lockTap = true;
|
||||
this.$util.showLoading()
|
||||
try {
|
||||
await this.$api.claim.cancelOrder({
|
||||
id
|
||||
})
|
||||
this.$util.hideAll()
|
||||
if (this.activeIndex == 0) {
|
||||
this.list.data[index].pay_type = -1
|
||||
} else {
|
||||
this.list.data.splice(index, 1)
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: `取消成功`
|
||||
})
|
||||
this.lockTap = false
|
||||
this.$refs.cancel_item.close()
|
||||
} catch (e) {
|
||||
setTimeout(() => {
|
||||
this.lockTap = false
|
||||
this.$util.hideAll()
|
||||
}, 2000)
|
||||
}
|
||||
},
|
||||
// 去支付
|
||||
async toPay(index) {
|
||||
if (this.lockTap) return;
|
||||
this.lockTap = true;
|
||||
this.$util.showLoading()
|
||||
let {
|
||||
id,
|
||||
pay_model
|
||||
} = this.list.data[index]
|
||||
try {
|
||||
let {
|
||||
pay_list
|
||||
} = await this.$api.claim.claimRePayOrder({
|
||||
id
|
||||
})
|
||||
this.$util.hideAll()
|
||||
if (pay_list) {
|
||||
if (pay_model == 3) {
|
||||
pay_list = {
|
||||
orderInfo: pay_list,
|
||||
provider: 'alipay'
|
||||
}
|
||||
}
|
||||
try {
|
||||
await this.$util.pay(pay_list)
|
||||
this.lockTap = false;
|
||||
if (this.activeIndex == 0) {
|
||||
this.list.data[index].pay_type = 2
|
||||
} else {
|
||||
this.list.data.splice(index, 1)
|
||||
}
|
||||
let {
|
||||
number
|
||||
} = this.tabList[1]
|
||||
this.tabList[1].number = number + 1
|
||||
} catch (e) {
|
||||
this.lockTap = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
setTimeout(() => {
|
||||
this.lockTap = false
|
||||
this.$util.hideAll()
|
||||
}, 2000)
|
||||
}
|
||||
},
|
||||
// 去评价
|
||||
toEvaluate(index) {
|
||||
let {
|
||||
id
|
||||
} = this.list.data[index]
|
||||
let url = `/mine/pages/evaluate/edit?id=${id}&type=claim`
|
||||
this.$util.goUrl({
|
||||
url
|
||||
})
|
||||
},
|
||||
// 订单详情
|
||||
goDetail(index, tab = 0) {
|
||||
let {
|
||||
id
|
||||
} = this.list.data[index]
|
||||
let url = `/claim/pages/order/detail?id=${id}&tab=${tab}`
|
||||
this.$util.goUrl({
|
||||
url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
</style>
|
||||
Reference in New Issue
Block a user