|
@@ -3,7 +3,14 @@
|
|
|
<!-- <view class="img-box" @click="showImg()">
|
|
|
<image :src="item.imgUrl"></image>
|
|
|
</view> -->
|
|
|
-
|
|
|
+ <!-- 购买轮播列表 -->
|
|
|
+ <view class="buy-lists" v-if="notics&¬ics.length>0" :style="{height: boxHeight+'px'}">
|
|
|
+ <view :class="{'buy-top': animate == true }" :style="{marginTop: animate == true ? `-${marginTop}px`:'0'}">
|
|
|
+ <view class="buy-list buy-txtbox" v-for="(item,index) in notics" :key="index">
|
|
|
+ <view class="buy-item"><text class="textOne buy-name" >{{item.fsUserName|| ''}}</text><text>{{item.timeTxt}} 已下单</text></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="cont-box">
|
|
|
<view class="goods-banner" @click="showImg()">
|
|
|
<swiper
|
|
@@ -175,7 +182,7 @@
|
|
|
</u-popup>
|
|
|
<view class="message-box" v-if="orderCount>0">
|
|
|
<view class="left">
|
|
|
- <image src="/static/images/close24.png" mode="" @click="closeOrder()" ></image>
|
|
|
+ <image src="/static/images/close.png" mode="" @click="closeOrder()" ></image>
|
|
|
<view class="text ellipsis">您有{{count}}个待支付订单</view>
|
|
|
</view>
|
|
|
<view class="btn" @click="showOrder()">查看</view>
|
|
@@ -184,9 +191,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { caculateTimeago } from '@/pages/TUIKit/utils/date.ts';
|
|
|
import {create,getOrderCount} from '@/api/packageOrder.js'
|
|
|
import {bindCompanyUser} from '@/api/companyUser.js'
|
|
|
- import {getPackageById,getPackageDoctorList} from '@/api/package.js'
|
|
|
+ import {getPackageById,getPackageDoctorList,getNewOrderByPackageId} from '@/api/package.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -209,7 +217,12 @@
|
|
|
doctorTotal:0,
|
|
|
companyUserId:null,
|
|
|
companyId:null,
|
|
|
- choose: 0
|
|
|
+ choose: 0,
|
|
|
+ boxHeight: 94,
|
|
|
+ marginTop: 30,
|
|
|
+ animate:false,
|
|
|
+ timer:null,
|
|
|
+ notics:[],
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
@@ -222,6 +235,12 @@
|
|
|
this.companyUserId=option.companyUserId
|
|
|
}
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ this.getNewOrderByPackageId()
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ if(this.timer) clearInterval(this.timer)
|
|
|
+ },
|
|
|
onShow() {
|
|
|
var that=this;
|
|
|
this.$isLogin().then(
|
|
@@ -265,6 +284,47 @@
|
|
|
|
|
|
},
|
|
|
methods:{
|
|
|
+ getNewOrderByPackageId() {
|
|
|
+ if(this.timer) clearInterval(this.timer)
|
|
|
+ getNewOrderByPackageId({packageId:this.packageId}).then(res=>{
|
|
|
+ if(res.code== 200) {
|
|
|
+ this.notics = res.data
|
|
|
+ if(res.data&&res.data.length > 0) {
|
|
|
+ this.notics = res.data.map(item=>({
|
|
|
+ ...item,
|
|
|
+ timeTxt: caculateTimeago(new Date(item.payTime).getTime(),1)
|
|
|
+ }))
|
|
|
+
|
|
|
+ this.getText()
|
|
|
+ this.timer = setInterval(this.scroll, 1400);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.notics = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ scroll() {
|
|
|
+ this.animate = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.notics.push(this.notics[0]);
|
|
|
+ this.notics.shift();
|
|
|
+ this.animate = false;
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ getText() {
|
|
|
+ const query = uni.createSelectorQuery().in(this);
|
|
|
+ query
|
|
|
+ .select(".buy-txtbox")
|
|
|
+ .boundingClientRect((data) => {
|
|
|
+ this.marginTop = data.height + uni.upx2px(14)
|
|
|
+ if(this.notics.length>2) {
|
|
|
+ this.boxHeight = this.marginTop * 3 + uni.upx2px(8)
|
|
|
+ } else {
|
|
|
+ this.boxHeight = this.marginTop * this.notics.length + uni.upx2px(8)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ },
|
|
|
closeOrder(){
|
|
|
this.messageShow=false;
|
|
|
},
|
|
@@ -443,6 +503,50 @@
|
|
|
page{
|
|
|
height: 100%;
|
|
|
}
|
|
|
+ .textOne {
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ .buy-lists{
|
|
|
+ height: 188rpx;
|
|
|
+ background-color:transparent;
|
|
|
+ overflow: hidden;
|
|
|
+ width: 60%;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 99;
|
|
|
+ top: 20vh;
|
|
|
+ left: 20rpx;
|
|
|
+ }
|
|
|
+ .buy-list{
|
|
|
+ height: 46rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ margin-top: 14rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ color: #fff;
|
|
|
+ .buy-item {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ background-color: rgba(0, 0, 0, 0.35);
|
|
|
+ border-radius: 10rpx;
|
|
|
+ padding: 0 20rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .buy-name {
|
|
|
+ width: 50%;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
+ text {
|
|
|
+ word-break: break-all;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .buy-top {
|
|
|
+ transition: all 1.5s ease-in;
|
|
|
+ margin-top: -60rpx;
|
|
|
+ }
|
|
|
.content{
|
|
|
height: 100%;
|
|
|
display: flex;
|