master
parent
0da5ee3496
commit
80800b98c7
|
@ -234,7 +234,7 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
|||
.receive-left{width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;}
|
||||
/* 活动任务 */
|
||||
.activity-dai{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;}
|
||||
.activity-mo{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;}
|
||||
.activity-mo{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #CCCCCC;}
|
||||
.task-cancle-btn,.task-confrim-btn{width: 196rpx;height: 60rpx;line-height: 60rpx;border-radius: 10rpx;}
|
||||
.task-cancle-btn{background: #E6E6E6;color: #FFFFFF;}
|
||||
.task-confrim-btn{background: #3875F6;color: #FFFFFF;}
|
||||
|
|
|
@ -112,6 +112,7 @@
|
|||
publicColor:uni.getStorageSync('publicColor'),
|
||||
newList:[],
|
||||
timeList:[],//时间列表
|
||||
timer:''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -129,7 +130,7 @@
|
|||
})
|
||||
this.$toolAll.tools.showToast('加载中...','none',1000);
|
||||
if(this.timeList!=0){
|
||||
let timer = setInterval(()=>{//定时器
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.dataList[item.nIndex].id){
|
||||
|
@ -152,6 +153,11 @@
|
|||
}
|
||||
},
|
||||
methods:{
|
||||
destroyev(){
|
||||
uni.clearInterval(this.timer);
|
||||
console.log(12);
|
||||
this.$emit('destroyEv')
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
|
||||
|
|
|
@ -347,8 +347,11 @@ const tools = {
|
|||
let totalSecond = '';
|
||||
// 本地倒计时
|
||||
// if(startTime=='') totalSecond = Math.floor((new Date(endTime).getTime() - new Date().getTime())/1000);
|
||||
// 解决苹果手机问题
|
||||
let date = endTime;
|
||||
date = endTime.replace(/-/g,'/')
|
||||
// 服务器倒计时
|
||||
if(startTime!='') totalSecond = Math.floor((new Date(endTime).getTime() - startTime)/1000);
|
||||
if(startTime!='') totalSecond = Math.floor((new Date(date).getTime() - startTime)/1000);
|
||||
// 总秒数
|
||||
let second = totalSecond;
|
||||
// 天数
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
publicColor:uni.getStorageSync('publicColor'),
|
||||
canIGetUserProfile: false,
|
||||
imgSrc: '/static/public/logo.png',//默认logo头像
|
||||
isShowP:false
|
||||
isShowP:false,
|
||||
userCode:''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
|
@ -59,26 +60,27 @@
|
|||
},
|
||||
methods: {
|
||||
refuse(){//暂不绑定事件
|
||||
this.isShowP=false
|
||||
this.isShowP=false;
|
||||
this.$toolAll.tools.showToast('登录成功','success')
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
console.log(e);
|
||||
let ya = this;
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success')
|
||||
// this.isShowP = false
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
||||
ya.updateUserInfo(this.userCode);
|
||||
uni.setStorageSync('bindPhone',false)
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
}
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{})
|
||||
} else {
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('登录成功','success')
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
// this.isShowP = false
|
||||
// this.$toolAll.tools.showToast('登录成功','success')
|
||||
// uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
}
|
||||
},
|
||||
goXie(){
|
||||
|
@ -112,7 +114,8 @@
|
|||
success: function(res) {
|
||||
if (res.code) {
|
||||
let code = res.code;
|
||||
ya.updateUserInfo(code);
|
||||
ya.userCode = code;
|
||||
ya.isShowP = true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
|
@ -151,7 +154,6 @@
|
|||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
uni.hideToast()
|
||||
this.isShowP = true
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
|
|
|
@ -246,6 +246,14 @@
|
|||
})
|
||||
},1000)
|
||||
}
|
||||
if(res.code==302){
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},1500)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeEv(){
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<view class="search-input-box bacf poszy shop-nav-box" :style="{top: statusHNH+'px'}">
|
||||
<view class="disac pad-zy30 mar-s20">
|
||||
<!-- 输入框 -->
|
||||
<input @focus="focusEv" class="width100 fon34 radius10" type="text" @confirm="searchEv" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||
<input class="width100 fon34 radius10" type="text" @confirm="searchEv" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||
<!-- 搜索 -->
|
||||
<view class="flexs mar-z30 radius10 pad-zy40 fon34 colf" @tap="searchEv" :style="{background:publicColor}">搜索</view>
|
||||
</view>
|
||||
|
@ -27,7 +27,15 @@
|
|||
</view>
|
||||
<view v-if="activeIndex==1">
|
||||
<view class="fon28 bold mar-sx40">医生选择</view>
|
||||
<input type="text" class="mar-x40" value="" placeholder="请输入医生姓名并选择" />
|
||||
<view class="posir">
|
||||
<input disabled @tap="chooseEv" type="text" class="mar-x40" v-model="doctorName" placeholder="请输入医生姓名并选择" />
|
||||
<view v-if="showDoctor" class="posia" style="top: 52px;left: 0;right: 0;border: 1rpx solid #E6E6E6;padding: 20rpx;background: #FFFFFF;">
|
||||
<view @tap="chooseDoctor(index)" class="disjbac fon28 col9" v-for="(item,index) in doctorList" :key="index">
|
||||
<span>姓名:{{item.doctor_extra.name}}</span>
|
||||
<span>部门:{{item.doctor_extra.skill}}</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 重置、筛选 -->
|
||||
|
@ -39,7 +47,7 @@
|
|||
</view>
|
||||
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
||||
<!-- 数据列表 -->
|
||||
<view v-if="loading" :style="{marginTop:statusHNH+titleHeight+'px'}">
|
||||
<view v-if="loading" :style="{marginTop:statusHNH+titleHeight+(isClick?52:0)+'px'}">
|
||||
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}商品`"></nothing-page>
|
||||
</view>
|
||||
|
@ -86,7 +94,10 @@
|
|||
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||
disease_id:'',//病种ID
|
||||
loading:false,
|
||||
cartNum:0
|
||||
cartNum:0,
|
||||
doctorName:'',
|
||||
doctorList:[],
|
||||
showDoctor:false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -94,8 +105,8 @@
|
|||
this.cartNumEv();//查询购物车数量
|
||||
},
|
||||
onLoad() {
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
this.titleList = uni.getStorageSync('footTitle');
|
||||
this.imgList = uni.getStorageSync('footimg');
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.search-input-box').boundingClientRect((rect) => {
|
||||
|
@ -105,6 +116,21 @@
|
|||
this.checkSX();
|
||||
},
|
||||
methods: {
|
||||
chooseDoctor(index){//选择医生
|
||||
this.searchVal = this.doctorName = this.doctorList[index].doctor_extra.name;
|
||||
this.showDoctor = false;
|
||||
},
|
||||
chooseEv(){//查询医生列表
|
||||
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.doctorName = '';
|
||||
if(res.data.list.length!=0){
|
||||
this.doctorList = res.data.list;
|
||||
this.showDoctor = true;
|
||||
} else this.$toolAll.tools.showToast('暂无医生可选');
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
cartNumEv(){//购物车数量
|
||||
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
|
||||
if(res.code==0){
|
||||
|
@ -250,6 +276,7 @@
|
|||
shaix(){//筛选
|
||||
this.isXiao = false
|
||||
this.isClick = true;
|
||||
|
||||
this.checkShopList();
|
||||
},
|
||||
deleteSX(index){//删除筛选
|
||||
|
@ -258,16 +285,10 @@
|
|||
this.isClick = false;
|
||||
}
|
||||
},
|
||||
focusEv(){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/shopSearch/shopSearch'
|
||||
})
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
// uni.navigateTo({
|
||||
// url:'/pagesB/shopSearch/shopSearch'
|
||||
// })
|
||||
// this.checkShopList();
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopSearch/shopSearch?keyWorld=${this.searchVal}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,19 +19,38 @@
|
|||
<view class="mar-s20">结束时间:{{item.endTime}}</view>
|
||||
</view>
|
||||
<view class="disjcac">
|
||||
<!-- 线下签到 -->
|
||||
<view v-if="item.ntype=='offline_sign_in'">
|
||||
<view @tap="btnEv(index)" class="mar-s30" :class="item.isStatus!=0?'activity-dai':'activity-mo'"><span>{{partakeVal}}</span></view>
|
||||
</view>
|
||||
<!-- 线上签到 -->
|
||||
<view v-if="item.ntype=='sign_in'" class="disja">
|
||||
<view class="disja" v-if="item.account_status!=1">
|
||||
<view @tap="goTosigin" class="mar-s30" :class="item.isStatus!=0?'activity-dai':'activity-mo'" :style="{width:(item.danc==item.allc)?'260rpx':'546rpx'}">{{siginVal}}</view>
|
||||
<view v-if="item.danc==item.allc" @tap="btnEv(index)" class="mar-s30 mar-z20" :class="item.isStatus!=0?'activity-dai':'activity-mo'" style="width: 260rpx;background: #f8bf2c;">{{partakeVal}}</view>
|
||||
</view>
|
||||
<view v-if="item.ntype!='offline_sign_in' && item.ntype!='sign_in'">
|
||||
<view v-if="item.account_status==1">
|
||||
<view class="activity-mo mar-s30"><span>已完成</span></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分享截图任务 -->
|
||||
<view v-if="item.ntype=='share_screenshots'" class="disja">
|
||||
<view class="disja" v-if="item.account_status!=1">
|
||||
<view @tap="btnEv(index)" class="mar-s30" :class="item.isStatus!=0?'activity-dai':'activity-mo'" :style="{background:item.account_status==0?'#ccc':''}">
|
||||
<span>{{['审核中...','立即完成','审核不通过','立即完成'][item.account_status]}}</span>
|
||||
<span>{{['审核中...','立即完成','审核不通过'][item.account_status]}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.account_status==1">
|
||||
<view class="activity-mo mar-s30"><span>已完成</span></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 线下签到 -->
|
||||
<view v-if="item.ntype=='offline_sign_in'" class="disja">
|
||||
<view v-if="item.account_status==4" @tap="btnEv(index)" class="mar-s30 activity-dai"><span>立即完成</span></view>
|
||||
<view v-else class="activity-mo mar-s30"><span>已完成</span></view>
|
||||
</view>
|
||||
<!-- 分享注册任务 -->
|
||||
<view v-if="item.ntype=='share'">
|
||||
<view v-if="item.account_status==4" @tap="btnEv(index)" class="mar-s30 activity-dai"><span>立即完成</span></view>
|
||||
<view v-else class="activity-mo mar-s30"><span>已完成</span></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分享孔雀币 -->
|
||||
|
@ -132,15 +151,17 @@
|
|||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkList();
|
||||
},
|
||||
onLoad() {
|
||||
this.checkList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
btnEv(index){
|
||||
this.chooseIndex = index;
|
||||
if(this.activityList[index].isIcon!=3 && this.activityList[index].account_status==1 || this.activityList[index].account_status==3) {
|
||||
if(this.isNum==0) {
|
||||
console.log(1);
|
||||
this.isNum++;
|
||||
this.$requst.post('task/task/complete-task',{task_id:this.activityList[index].id}).then(res=>{
|
||||
if(res.code==0){
|
||||
|
@ -157,7 +178,15 @@
|
|||
if(this.activityList[index].account_status==1 || this.activityList[index].account_status==3){
|
||||
this.isScreenshot = true;
|
||||
}
|
||||
if(this.activityList[index].account_status==0){
|
||||
this.$toolAll.tools.showToast('正在审核...');
|
||||
}else {
|
||||
this.$toolAll.tools.showToast('请先完成任务,再来领取');
|
||||
}
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.isNum = 0;
|
||||
},2000)
|
||||
},
|
||||
checkList(){//查询任务列表
|
||||
this.$requst.post('task/task/task-list').then(res=>{
|
||||
|
|
|
@ -208,7 +208,7 @@
|
|||
isSuccess:false,//支付成功
|
||||
ntype:'money',//默认money孔雀币转钱 coin钱转孔雀币
|
||||
times:0,//点击次数
|
||||
isCurrent:2
|
||||
isCurrent:2,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -412,57 +412,57 @@
|
|||
is_only:is_only,//是否是单独购买0 不是单独购买,2是单独购买
|
||||
is_score:is_score,//是否是积分商品0 不是积分商品,1是积分商品
|
||||
coin:this.zf_kqPrice//孔雀币
|
||||
|
||||
}
|
||||
if(this.addressInfo=='' && self!=1){
|
||||
this.$toolAll.tools.showToast('请完善收件人信息');
|
||||
} else if(nphone=='') {
|
||||
this.$toolAll.tools.showToast('请填写收货人手机号');
|
||||
this.focusEv();
|
||||
} else if(this.$toolAll.tools.isPhone(nphone)) {
|
||||
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
||||
this.focusEv();
|
||||
} else if(this.isNei == 3 && !this.payFS[2].isActive){//积分判断条件
|
||||
this.$toolAll.tools.showToast('请选择积分付款方式');
|
||||
} else if(this.isNei == 3 && this.expressInfo.default_price!=0){//积分判断条件
|
||||
this.$toolAll.tools.showToast('请添加微信支付方式');
|
||||
} else if(this.isNei != 3 && !this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('请选择支付方式')
|
||||
} else if(this.isNei != 3 && !this.payFS[0].isActive && this.allPrice*1 > this.coin_price*1){
|
||||
this.$toolAll.tools.showToast('孔雀币不足');
|
||||
} else {
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
if(this.allPrice==0){
|
||||
this.$toolAll.tools.showToast('正在支付','loading',1500);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('正在调起支付','loading',1500);
|
||||
}
|
||||
uni.request({
|
||||
url:'https://hengmei.scdxtc.cn/api/order/create',
|
||||
data:parmas,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
this.times = 0;
|
||||
this.payment(res.data.data);
|
||||
// uni.setStorageSync('orderList',this.orderList);
|
||||
// uni.setStorageSync('orderInfo',res.data.data);
|
||||
// uni.navigateTo({
|
||||
// url:`/pagesA/immediatePayment/immediatePayment?allPrice=${this.allPrice}&allNum=${this.allNum}&startTime=${new Date(res.header.Date).getTime()}`
|
||||
console.log('拼单人ID',this.orderList.pin_user_id);
|
||||
// if(this.addressInfo=='' && self!=1){
|
||||
// this.$toolAll.tools.showToast('请完善收件人信息');
|
||||
// } else if(nphone=='') {
|
||||
// this.$toolAll.tools.showToast('请填写收货人手机号');
|
||||
// this.focusEv();
|
||||
// } else if(this.$toolAll.tools.isPhone(nphone)) {
|
||||
// this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
||||
// this.focusEv();
|
||||
// } else if(this.isNei == 3 && !this.payFS[2].isActive){//积分判断条件
|
||||
// this.$toolAll.tools.showToast('请选择积分付款方式');
|
||||
// } else if(this.isNei == 3 && this.expressInfo.default_price!=0){//积分判断条件
|
||||
// this.$toolAll.tools.showToast('请添加微信支付方式');
|
||||
// } else if(this.isNei != 3 && !this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
// this.$toolAll.tools.showToast('请选择支付方式')
|
||||
// } else if(this.isNei != 3 && !this.payFS[0].isActive && this.allPrice*1 > this.coin_price*1){
|
||||
// this.$toolAll.tools.showToast('孔雀币不足');
|
||||
// } else {
|
||||
// if(this.times==0){
|
||||
// this.times++;
|
||||
// if(this.allPrice==0){
|
||||
// this.$toolAll.tools.showToast('正在支付','loading',1500);
|
||||
// } else {
|
||||
// this.$toolAll.tools.showToast('正在调起支付','loading',1500);
|
||||
// }
|
||||
// uni.request({
|
||||
// url:'https://hengmei.scdxtc.cn/api/order/create',
|
||||
// data:parmas,
|
||||
// method:'post',
|
||||
// header:{
|
||||
// 'Content-Type': 'application/json; charset=UTF-8',
|
||||
// 'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
// },
|
||||
// success: (res) => {
|
||||
// if(res.data.code==0){
|
||||
// this.times = 0;
|
||||
// this.payment(res.data.data);
|
||||
// // uni.setStorageSync('orderList',this.orderList);
|
||||
// // uni.setStorageSync('orderInfo',res.data.data);
|
||||
// // uni.navigateTo({
|
||||
// // url:`/pagesA/immediatePayment/immediatePayment?allPrice=${this.allPrice}&allNum=${this.allNum}&startTime=${new Date(res.header.Date).getTime()}`
|
||||
// // })
|
||||
// } else {
|
||||
// this.$toolAll.tools.showToast(res.data.msg);
|
||||
// this.times = 0;
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.data.msg);
|
||||
this.times = 0;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
},
|
||||
payment(info){
|
||||
if(info.needPay){
|
||||
|
|
|
@ -9,16 +9,16 @@
|
|||
<view class="disjb">
|
||||
<view class="disac">
|
||||
<!-- 头像 -->
|
||||
<image class="mar-sx20" src="/static/public/like.png" style="width:90rpx;height: 90rpx;border-radius: 100%;" mode="aspectFill"></image>
|
||||
<image class="mar-sx20" :src="levelInfo.headimgurl" style="width:90rpx;height: 90rpx;border-radius: 100%;" mode="aspectFill"></image>
|
||||
<view class="mar-z20">
|
||||
<!-- 昵称 -->
|
||||
<view class="fon28 bold disac">昵称<view style="background: #FFFFFF;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFBD39;padding: 5rpx 16rpx;margin-left: 10rpx;">VIP</view></view>
|
||||
<view class="mar-s10" style="color: #C27417;">黄金会员</view>
|
||||
<view class="fon28 bold disac">{{levelInfo.nickname}}<view style="background: #FFFFFF;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFBD39;padding: 5rpx 16rpx;margin-left: 10rpx;">VIP</view></view>
|
||||
<view class="mar-s10" style="color: #C27417;">{{levelInfo.level.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-s30 " style="color: #C27417;">当前等级</view>
|
||||
</view>
|
||||
<view style="margin-top: 62rpx;color: #C27417;">还差1200积分升级</view>
|
||||
<view style="margin-top: 62rpx;color: #C27417;">还差{{levelInfo.level.value}}积分升级</view>
|
||||
<view class="fon28 mar-s10" style="color: #C49F74;">升级到钻石会员享有更多权益</view>
|
||||
</view>
|
||||
<image class="posia" style="top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 0;" src="/static/public/member.png" mode=""></image>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<!-- 功能列表 -->
|
||||
<view class="bacf radius20 mar-s20">
|
||||
<view class="disac fon28 fw pad-x20" style="color: #C27417;">
|
||||
<view v-for="(itemh,indexh) in huiList" :key="indexh" class="mar-s20" style="width: 25%;">
|
||||
<view v-if="levelInfo.level.rights[indexh]==itemh.ntype" v-for="(itemh,indexh) in huiList" :key="indexh" class="mar-s20" style="width: 25%;">
|
||||
<view class="disac fc">
|
||||
<image :src="itemh.src" style="width: 50rpx;height: 50rpx;" mode="aspectFill"></image>
|
||||
<view class="mar-s20 mar-x10">{{itemh.title}}</view>
|
||||
|
@ -37,7 +37,8 @@
|
|||
<!-- 当前权益介绍 -->
|
||||
<view class="bacf radius20 mar-s20 pad20">
|
||||
<view class="mar-x30 fon32 bold" style="color: #C27417;">当前权益介绍</view>
|
||||
<image src="../../static/public/dang-quan.png" style="width: 100%;" mode="widthFix"></image>
|
||||
<rich-text :nodes="detailInfo"></rich-text>
|
||||
<!-- <image src="../../static/public/dang-quan.png" style="width: 100%;" mode="widthFix"></image> -->
|
||||
</view>
|
||||
<view class="fon30 bold tc mar-s50 mar-x30" :style="{color:publicColor}">积分兑换</view>
|
||||
</view>
|
||||
|
@ -57,13 +58,15 @@
|
|||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
huiList:[
|
||||
{src:'/static/public/ru-hui50.png',title:'入会权益'},
|
||||
{src:'/static/public/birthday50.png',title:'生日礼物'},
|
||||
{src:'/static/public/member-scor50.png',title:'积分权益'},
|
||||
{src:'/static/public/te-quan50.png',title:'特权日'},
|
||||
{src:'/static/public/share-hai50.png',title:'分享海报'},
|
||||
{src:'/static/public/ru-hui50.png',title:'入会权益',ntype:'membership_interests'},
|
||||
{src:'/static/public/birthday50.png',title:'生日礼物',ntype:'birthday'},
|
||||
{src:'/static/public/member-scor50.png',title:'积分权益',ntype:'score'},
|
||||
{src:'/static/public/te-quan50.png',title:'特权日',ntype:'privilege_day'},
|
||||
{src:'/static/public/share-hai50.png',title:'分享海报',ntype:'poster'},
|
||||
],
|
||||
dataList:[]
|
||||
dataList:[],
|
||||
levelInfo:{},
|
||||
detailInfo:''//富文本
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -75,7 +78,9 @@
|
|||
checkInfo(){
|
||||
this.$requst.post('level/index').then(res=>{
|
||||
if(res.code==0){
|
||||
|
||||
this.levelInfo = res.data;
|
||||
// 富文本
|
||||
this.detailInfo = this.$toolAll.tools.escape2Html(this.levelInfo.level.content)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -159,7 +159,6 @@
|
|||
make(index,index2){
|
||||
this.isHeyan = true;
|
||||
this.text = `${this.orderList[index].orderNum},${this.orderList[index].childrenList[index2].id}`;
|
||||
console.log(this.text);
|
||||
// var that = this;
|
||||
// setTimeout(function() {
|
||||
// that.canvasQrPath = that.$refs.qrPath.canvasQrPath;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<status-nav :titleVal="'订单详情'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
|
||||
<!-- 订单类型 -->
|
||||
<block v-if="loading">
|
||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||
<view class="disjbac">
|
||||
<view class="bold">{{['商城订单','积分商城订单'][orderInfo.is_score]}}</view>
|
||||
|
@ -53,8 +54,8 @@
|
|||
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||
<view class="orderDetail-sku">{{item.sku_name}}</view>
|
||||
<view class="disjbac mar-s10">
|
||||
<view class="colf8 fon32 bold"><span v-if="orderInfo.is_score==0">¥{{item.price/100}}</span><span v-else>积分:{{item.score}}</span></view>
|
||||
<view class="fon28 col6">x{{item.num}}</view>
|
||||
<view class="colf8 fon32 bold"><span v-if="orderInfo.is_score==0">¥{{item.price/100}}</span><span v-else>积分:{{item.score}}</span><span class="fon28 col6 mar-z20 font4">x{{item.num}}</span></view>
|
||||
<view @tap.stop="make(index)" v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1" class="order-btn">线下核销</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -82,22 +83,43 @@
|
|||
<view @tap="paymentEv">立即支付</view>
|
||||
</view>
|
||||
<!-- 待发货 -->
|
||||
<view class="disac paid-btn-box" v-if="orderInfo.status=='paid'">
|
||||
<view class="disac paid-btn-box" v-if="orderInfo.status=='paid' && orderInfo.virtual_check==0">
|
||||
<view @tap="cancleEv">取消订单</view>
|
||||
</view>
|
||||
<!-- 确认收货 -->
|
||||
<view class="orderInfo-btn" v-if="orderInfo.status=='shipped'">确认收货</view>
|
||||
</view>
|
||||
<!-- 待核验弹框 -->
|
||||
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;">
|
||||
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isHeyan=true">
|
||||
<view class="fon28 col3">订单二维码</view>
|
||||
<view class="mar-sx30">
|
||||
<yz-qr ref="qrPath" :text="text" :size="size" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
|
||||
<!-- <image src="/static/public/member-head.png" class="order-hx-img" mode="aspectFill"></image> -->
|
||||
</view>
|
||||
<view class="fon24 col3">
|
||||
<view class=" mar-s40 mar-x20">工作人员扫码核销订单</view>
|
||||
<view>订单未完成前请勿出示二维码</view>
|
||||
</view>
|
||||
<image @tap.stop="isHeyan=false" src="/static/public/closequan.png" class="posia heyan-close" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||
export default {
|
||||
components:{
|
||||
yzQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
loading:false,
|
||||
isExpress:true,
|
||||
switchQuan:true,
|
||||
showQuan:false,
|
||||
|
@ -108,6 +130,12 @@
|
|||
allNum:0,//共
|
||||
times:0,//点击次数
|
||||
goAddress:'四川省成都市青羊区青羊大道213号',
|
||||
isHeyan:false,
|
||||
canvasQrPath: '',
|
||||
text: 'hello',
|
||||
size: 162,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -117,6 +145,10 @@
|
|||
this.checkInfo(options.id);
|
||||
},
|
||||
methods: {
|
||||
make(index){
|
||||
this.isHeyan = true;
|
||||
this.text = `${this.orderInfo.coding},${this.orderInfo.skus[index].id}`;
|
||||
},
|
||||
cancleEv(){//取消订单
|
||||
this.times++;
|
||||
if(this.times==2){
|
||||
|
@ -194,6 +226,7 @@
|
|||
userAddress:naddress[2].trim()
|
||||
}
|
||||
}
|
||||
this.loading = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -44,13 +44,13 @@
|
|||
imgList:uni.getStorageSync('imgSrcList'),
|
||||
imgSrc:'',
|
||||
showBtn:false,
|
||||
isHaib:true,
|
||||
isHaib:false,
|
||||
haved:true
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.haved = true
|
||||
this.haved = true;
|
||||
},
|
||||
onLoad() {
|
||||
// uni.removeStorageSync('imgSrcList')
|
||||
|
@ -72,6 +72,7 @@
|
|||
},error=>{})
|
||||
},
|
||||
chooseImg(index){//选择海报模板,并生成海报
|
||||
this.imgSrc = '';
|
||||
this.haved = this.showBtn = true;
|
||||
this.$toolAll.tools.showToast('正在生成海报...','loading',10000);
|
||||
this.$requst.post('user/poster-info',{poster_src:this.imgList[index]}).then(res=>{
|
||||
|
|
|
@ -117,6 +117,21 @@
|
|||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 去拼单弹框 -->
|
||||
<!-- <view v-if="showPD" class="pd-tk-box" @tap.stop="showPD=false"> -->
|
||||
<view v-if="showPD" class="pd-tk-box">
|
||||
<view class="bacf radius20 width100 posir">
|
||||
<view class="fon28 col3">参与{{pinInfo.name}}的拼单</view>
|
||||
<view class="fon24 col3">仅剩{{pinInfo.num}}个名额,{{pinDao}}后结束</view>
|
||||
<view class="disjcac">
|
||||
<image :src="pinInfo.imgSrc" mode="aspectFill"></image>
|
||||
<image src="/static/public/pin-jie.png" mode=""></image>
|
||||
<image src="/static/public/weiz.png" mode=""></image>
|
||||
</view>
|
||||
<view @tap="atOnceSpellOrder(1)">参与拼单</view>
|
||||
<image @tap="atOnceSpellOrder(0)" src="/static/public/pin-close.png" class="posia" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情 -->
|
||||
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||
<view class="fon28 col3 bold">产品详情</view>
|
||||
|
@ -260,20 +275,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 去拼单弹框 -->
|
||||
<view v-if="showPD" class="pd-tk-box" @tap.stop="showPD=false">
|
||||
<view class="bacf radius20 width100 posir" @tap.stop="showPD=true">
|
||||
<view class="fon28 col3">参与{{pinInfo.name}}的拼单</view>
|
||||
<view class="fon24 col3">仅剩{{pinInfo.num}}个名额,{{pinInfo.time_text.slice(3)}}后结束</view>
|
||||
<view class="disjcac">
|
||||
<image :src="pinInfo.imgSrc" mode="aspectFill"></image>
|
||||
<image src="/static/public/pin-jie.png" mode=""></image>
|
||||
<image src="/static/public/weiz.png" mode=""></image>
|
||||
</view>
|
||||
<view>参与拼单</view>
|
||||
<image @tap.stop="showPD=false" src="/static/public/pin-close.png" class="posia" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
|
@ -364,7 +365,13 @@
|
|||
ispt:0,//拼团的方式0默认发起拼团,1参与平台 2单独购买
|
||||
isScore:0,//是否是积分
|
||||
cartNum:0,
|
||||
skuCate:[]//类型
|
||||
skuCate:[],//类型
|
||||
pinDao:'',//平团倒计时
|
||||
serverTime:'',//服务器时间
|
||||
timerServer:null,
|
||||
timerp:null,
|
||||
timera:null,
|
||||
pinUserId:0//发起拼单人ID
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -390,6 +397,11 @@
|
|||
onShow() {
|
||||
uni.removeStorageSync('chooseAddress');
|
||||
},
|
||||
onUnload() {
|
||||
clearInterval(this.timera);
|
||||
clearInterval(this.timerp);
|
||||
clearInterval(this.timerServer);
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.category_id!=undefined) {
|
||||
this.category_id = options.category_id
|
||||
|
@ -444,10 +456,23 @@
|
|||
})
|
||||
},
|
||||
checkPTList(id){//查询正在拼团的人数
|
||||
this.$requst.post('spu/group-list',{id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
uni.request({
|
||||
url:'https://hengmei.scdxtc.cn/api/spu/group-list',
|
||||
data:{id:id},
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
let ntime = new Date(res.header.Date).getTime();//服务器时间
|
||||
this.timerServer = setInterval(()=>{
|
||||
ntime = ntime + 1000
|
||||
this.serverTime = new Date(ntime);
|
||||
},1000);
|
||||
if(res.data.data.length!=0){
|
||||
res.data.data.forEach(item=>{
|
||||
let pObj = {
|
||||
id:item.id,
|
||||
imgSrc:item.cover,
|
||||
|
@ -469,6 +494,7 @@
|
|||
this.pingArr = newPArr;
|
||||
}
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
goGetReadyDan(index){//弹框中的立即购买
|
||||
|
@ -490,7 +516,8 @@
|
|||
sku_name:this.skuDetail.title,
|
||||
is_score:this.detailObj.is_score,
|
||||
group_id:this.ispt,//0发起拼团 1参与拼团 2单独购买
|
||||
is_only:this.ispt
|
||||
is_only:this.ispt,
|
||||
pin_user_id:this.pinUserId//发起拼单人ID
|
||||
}
|
||||
let newList = [params];
|
||||
uni.setStorageSync('orderList',newList);
|
||||
|
@ -515,6 +542,26 @@
|
|||
comeTuan(pinId,index,index2){//去拼单
|
||||
this.showPD = true;
|
||||
this.pinInfo = this.pingArr[index][index2];
|
||||
this.pinDao = this.$toolAll.tools.dayTime(this.pinInfo.time,this.serverTime);
|
||||
this.timerp = setInterval(()=>{
|
||||
if((new Date(this.pinInfo.time).getTime()) - (new Date(this.serverTime).getTime())<=0){
|
||||
this.pinDao = '已结束';
|
||||
this.checkPTList(this.detailObj.id);
|
||||
this.showPD = false;
|
||||
clearInterval(this.timerp);
|
||||
} else {
|
||||
this.pinDao = this.$toolAll.tools.dayTime(this.pinInfo.time,this.serverTime);
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
atOnceSpellOrder(index){//参与拼单
|
||||
if(index==1){
|
||||
this.showTK = true;
|
||||
this.pinUserId = this.pinInfo.id;
|
||||
}
|
||||
this.showPD = false;
|
||||
clearInterval(this.timerp);
|
||||
this.daoTime = '';
|
||||
},
|
||||
chooselei(index){//类型选择
|
||||
this.leiIndex = index
|
||||
|
@ -687,9 +734,10 @@
|
|||
let endTime = new Date(res.data.data.detail.activity_end_at).getTime();
|
||||
if(startTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
this.daoTime = "活动已结束";
|
||||
clearInterval(this.timera);
|
||||
} else {
|
||||
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);//初始化
|
||||
let timer = setInterval(()=>{//倒计时赋值
|
||||
this.timera = setInterval(()=>{//倒计时赋值
|
||||
startTime = startTime + 1000;
|
||||
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);
|
||||
},1000)
|
||||
|
|
|
@ -3,47 +3,107 @@
|
|||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'商品搜索'" :statusTitle="true"></status-nav>
|
||||
<!-- 输入框 -->
|
||||
<view class="search-input-box bacf" :style="{paddingTop: statusHNH+'px'}">
|
||||
<view class="search-input-box bacf poszy shop-nav-box" :style="{top: statusHNH+'px'}">
|
||||
<view class="disac pad-zy30 mar-s20">
|
||||
<!-- 输入框 -->
|
||||
<input @confirm="searchEv" style="border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;" class="width100 fon34 radius10" type="text" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||
<input @confirm="checkShopList" style="border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;" class="width100 fon34 radius10" type="text" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||
<!-- 搜索 -->
|
||||
<view @tap="searchEv" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- 分类标题 -->
|
||||
<view style="background: #FFFFFF;font-size: 24rpx;" class="disjbac pad-zy20 pad-s20">
|
||||
<view v-for="(item,index) in shopCate" @tap="chooseShopCate(index)" :class="activeIndex==index?'activecate':'shopMo'" :style="{background:activeIndex==index?publicColor:'#F2F2F2'}" :key="index"><span>{{item}}</span></view>
|
||||
<view @tap="checkShopList" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
|
||||
</view>
|
||||
<!-- 筛选结果 -->
|
||||
<view v-if="isClick" class="pad-zy50 disac fw pad-x20">
|
||||
<view class="col3 fon28 mar-s30">筛选:</view>
|
||||
<view v-for="(item,indexx) in shaiList" :key="indexx">{{item}} <view class="mar-z10" @tap="deleteSX(indexx)">×</view></view>
|
||||
</view>
|
||||
<view v-if="isXiao">
|
||||
<view class="pad-zy30">
|
||||
<view class="mar-s50 mar-x20 fon28 bold">{{cateTitle}}</view>
|
||||
<view class="disac fw">
|
||||
<view @tap="chooseBing(indexb)" v-for="(itemb,indexb) in bingzList" class="mar-y30 fon26 mar-s30" :key="indexb" :class="itemb.isActive?'activebcate':'shopBMo'" :style="{background:itemb.isActive?publicColor:'#F2F2F2'}">{{itemb.title}}</view>
|
||||
</view>
|
||||
<view v-if="activeIndex==1">
|
||||
<view class="fon28 bold mar-sx40">医生选择</view>
|
||||
<input type="text" class="mar-x40" value="" placeholder="请输入医生姓名并选择" />
|
||||
<view v-if="search_result" class="pad-z20 pad-x20">
|
||||
<view class="col3 fon28 mar-s30">搜索结果:</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 重置、筛选 -->
|
||||
<view class="disjbac pad-zy20 mar-s50 mar-x30 pad-s20">
|
||||
<view @tap="chongz">重置</view>
|
||||
<view @tap="shaix">筛选</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
||||
<!-- 数据列表 -->
|
||||
<view v-if="loading" :style="{marginTop:statusHNH+titleHeight+'px'}">
|
||||
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}商品`"></nothing-page>
|
||||
<view v-if="search_result" :style="{marginTop:statusHNH+titleHeight+10+45+'px'}">
|
||||
<view v-if="dataList.length!=0" style="margin-top: -20rpx;">
|
||||
<view class="pad20">
|
||||
<view style="width: 48.6%;float: left;">
|
||||
<view v-if="index1%2==0" v-for="(item1,index1) in dataList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn posir" @tap="goPage(item1.id,index1)">
|
||||
<image :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
|
||||
<view class="pad-zy20 pad-s10 pad-x30">
|
||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||
<view class="radius10 colf mar-y10" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
||||
<view class="radius10 colf" v-if="item1.isTuan" style="padding: 6rpx 10rpx;background: #F85050;">团购</view>
|
||||
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||
<view v-if="item1.isIntegral" class="mar-s20">
|
||||
<view>积分:{{item1.integral}}</view>
|
||||
<view class="disac mar-s20" v-if="item1.grade!=0">
|
||||
<image src="/static/public/huiy.png" style="width: 40rpx;height: 33rpx;" mode=""></image>
|
||||
<view class="fon24 col3 mar-z10">{{item1.level_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<span v-if="item1.isPing">拼团价</span>
|
||||
<span v-if="item1.isXian">促销价</span>
|
||||
¥{{item1.zhePrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view>
|
||||
</view>
|
||||
<view v-if="item1.isPing" class="disjbac mar-s20">
|
||||
<view class="fon24 col80">已拼团{{item1.activity_group_num}}组</view>
|
||||
<view class="disac">
|
||||
<image v-for="(itemm,indexm) in item1.activity_group_cover" :key="indexm" :src="itemm" mode="" style="width: 40rpx;height: 40rpx;border-radius: 100%;margin-left: -20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 48.6%;float: right;">
|
||||
<view v-if="index1%2!=0" v-for="(item1,index1) in dataList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn posir" @tap="goPage(item1.id,index1)">
|
||||
<image :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
|
||||
<view class="pad-zy20 pad-s10 pad-x30">
|
||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||
<view class="radius10 colf mar-y10" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
||||
<view class="radius10 colf" v-if="item1.isTuan" style="padding: 6rpx 10rpx;background: #F85050;">团购</view>
|
||||
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||
<view v-if="item1.isIntegral" class="mar-s20">
|
||||
<view>积分:{{item1.integral}}</view>
|
||||
<view class="disac mar-s20" v-if="item1.grade!=0">
|
||||
<image src="/static/public/huiy.png" style="width: 40rpx;height: 33rpx;" mode=""></image>
|
||||
<view class="fon24 col3 mar-z10">{{item1.level_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<span v-if="item1.isPing">拼团价</span>
|
||||
<span v-if="item1.isXian">促销价</span>
|
||||
¥{{item1.zhePrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isTuan || item1.isPing || item1.isXian" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view>
|
||||
</view>
|
||||
<view v-if="item1.isPing" class="disjbac mar-s20">
|
||||
<view class="fon24 col80">已拼团{{item1.activity_group_num}}组</view>
|
||||
<view class="disac">
|
||||
<image v-for="(itemm,indexm) in item1.activity_group_cover" :key="indexm" :src="itemm" mode="" style="width: 40rpx;height: 40rpx;border-radius: 100%;margin-left: -20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :contentVal="pu_content" @comfirmev="submitQu" @cancleev="isShowT=false"></pu-po>
|
||||
</view>
|
||||
</view>
|
||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多商品列表`"></nothing-page>
|
||||
</view>
|
||||
<!-- 历史搜索和热门搜索 -->
|
||||
<view v-if="!search_result" class="pad-z30 mar-s30" :style="{marginTop:statusHNH+titleHeight+10+'px'}">
|
||||
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
|
||||
</view>
|
||||
<!-- 购物车 -->
|
||||
<navigator url="/pagesA/shopCart/shopCart?isScore=false" hover-class="none">
|
||||
|
@ -54,20 +114,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 历史搜索和热门搜索 -->
|
||||
<view class="pad-z30 mar-s30" v-if="isList">
|
||||
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
|
||||
</view>
|
||||
<view v-else class="pad-zy20 mar-s20">
|
||||
<!-- 列表 -->
|
||||
<view v-if="dataList.length!=0">
|
||||
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 40%;">
|
||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">您搜索的内容暂无结果,换个关键词试试吧</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
<!-- 返回顶部 -->
|
||||
|
@ -76,13 +122,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||
import shopList from '@/components/shop-list.vue';
|
||||
import {cartNum} from '@/jsFile/publicAPI.js';
|
||||
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||
export default {
|
||||
components:{
|
||||
cateTu,
|
||||
shopList
|
||||
cateTu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -108,14 +152,10 @@
|
|||
},
|
||||
],
|
||||
isShowT:false,//是否显示弹框
|
||||
isList:true,//是否显示默认显示
|
||||
dataList:[//小课堂数据列表
|
||||
|
||||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
newCurrent:0,
|
||||
page:1,
|
||||
size:10,
|
||||
size:200,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
activeIndex:'-1',
|
||||
|
@ -123,52 +163,59 @@
|
|||
cateTitle:'',
|
||||
bingzList:[],//小分类列表
|
||||
zanBingArr:[],//暂存小分类
|
||||
isXiao:false,//
|
||||
titleHeight:'',//标题高度
|
||||
shaiList:[],//筛选后的结果列表
|
||||
isClick:false,//是否点击了筛选
|
||||
dataList:[],
|
||||
searchVal:'',//关键词
|
||||
doctor_role:'',//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||
doctor_name:'',//医生姓名 模糊搜索
|
||||
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||
disease_id:'',//病种ID
|
||||
loading:false,
|
||||
cartNum:0
|
||||
cartNum:0,
|
||||
search_result:false,
|
||||
timeList:[],
|
||||
zanArr:[],
|
||||
timer:''
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.searchEv()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
// if(this.total!=this.dataList.length){
|
||||
// this.page++
|
||||
// this.checkShopList();
|
||||
// } else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000);
|
||||
setTimeout(()=>{
|
||||
this.isZanw = true;
|
||||
},10000)
|
||||
// }
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.keyWorld!=undefined && options.keyWorld!='') {
|
||||
this.searchVal = options.keyWorld
|
||||
this.searchEv()
|
||||
this.searchVal = options.keyWorld;
|
||||
this.checkShopList();
|
||||
} else {
|
||||
this.search_result = false;
|
||||
}
|
||||
this.checkSearchHistory()
|
||||
this.checkKey()
|
||||
this.checkSearchHistory();
|
||||
this.checkKey();
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.search-input-box').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect.height);
|
||||
this.titleHeight = rect.height
|
||||
}).exec()
|
||||
this.checkSX();
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv();
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.checkShopList();
|
||||
this.cartNumEv();//查询购物车数量
|
||||
},
|
||||
onUnload() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
methods: {
|
||||
cartNumEv(){//购物车数量
|
||||
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
|
||||
|
@ -177,78 +224,12 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
async checkSX(){//商品筛选条件
|
||||
this.$requst.get('spu/condition').then(res=>{
|
||||
if(res.code==0){
|
||||
this.zanBingArr = res.data;
|
||||
}
|
||||
})
|
||||
await this.checkShopList();
|
||||
},
|
||||
chooseShopCate(index){//大分类选择事件
|
||||
if(this.activeIndex==index && this.isXiao) {
|
||||
this.isXiao = false;
|
||||
} else this.isXiao = true;
|
||||
this.bingzList = [];
|
||||
this.isClick = false;
|
||||
this.activeIndex = index;
|
||||
let arr = [];
|
||||
let obj = {};
|
||||
if(this.activeIndex==0) {
|
||||
this.cateTitle = '病种选择';
|
||||
this.zanBingArr.disease.forEach(item=>{
|
||||
obj = {
|
||||
pid: item.pid,
|
||||
title: item.name,
|
||||
id: item.id,
|
||||
sort: item.sort,
|
||||
isActive:false
|
||||
}
|
||||
arr.push(obj);
|
||||
})
|
||||
this.bingzList = arr;
|
||||
this.bingzList.unshift({pid: '', title: "全部", id: '', sort: '',isActive:true});
|
||||
this.bingzList.push({pid: '', title: "其他", id: '', sort: ''});
|
||||
}
|
||||
if(this.activeIndex==1) {
|
||||
this.cateTitle = '职位选择';
|
||||
this.zanBingArr.doctor_roles.forEach(item=>{
|
||||
obj = {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
title: item.title,
|
||||
pid: item.pid,
|
||||
is_group: item.is_group,
|
||||
isActive:false
|
||||
}
|
||||
arr.push(obj);
|
||||
})
|
||||
this.bingzList = arr;
|
||||
this.bingzList.unshift({id: '', name: '', title: "全部", pid: '', is_group: '',isActive:true});
|
||||
}
|
||||
if(this.activeIndex==2) {
|
||||
this.cateTitle = '活动选择';
|
||||
this.zanBingArr.activity.forEach(item=>{
|
||||
obj = {
|
||||
name: item.name,
|
||||
title: item.title,
|
||||
isActive:false
|
||||
}
|
||||
arr.push(obj);
|
||||
})
|
||||
this.bingzList = arr;
|
||||
this.bingzList.unshift({name: '', title: "全部",isActive:true});
|
||||
}
|
||||
},
|
||||
checkShopList(){
|
||||
this.isZanw = true;
|
||||
let params = {
|
||||
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
||||
page:1,
|
||||
size:10,
|
||||
doctor_role:this.doctor_role,//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||
doctor_name:this.doctor_name,//医生姓名 模糊搜索
|
||||
activity:this.activity,//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||
disease_id:this.disease_id//病种ID
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
}
|
||||
uni.request({
|
||||
url:'https://hengmei.scdxtc.cn/api/spu/list',
|
||||
|
@ -260,7 +241,13 @@
|
|||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
clearInterval(this.timer);
|
||||
// if(this.page==1) {
|
||||
this.zanArr = [];
|
||||
this.dataList = [];
|
||||
this.timeList = [];
|
||||
// }
|
||||
this.total = res.data.total;
|
||||
if(res.data.data.list.length!=0){
|
||||
res.data.data.list.forEach(item=>{
|
||||
let tuan = false,ping = false,xian = false,integral = false;
|
||||
|
@ -286,84 +273,63 @@
|
|||
isIntegral:integral,//是否是积分
|
||||
grade:'',
|
||||
disease_name:item.disease_name,//病种名称
|
||||
disease_id:item.disease_id,//病种ID
|
||||
reponseTime:res.header.Date,//接口响应时间
|
||||
activity_end_at:item.activity_end_at,//限时结束时间
|
||||
activity_group_cover:group_cover,//参团人的头像
|
||||
activity_group_num:item.activity_group_num,//已经参团人数
|
||||
}
|
||||
this.dataList.push(obj)
|
||||
this.zanArr.push(obj)
|
||||
})
|
||||
this.loading = true;
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.activity_end_at!='') {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
reponseTime:item.reponseTime,
|
||||
time:item.activity_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList!=0){
|
||||
this.$toolAll.tools.showToast('加载中...')
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
this.timeList[index].reponseTime = new Date(this.timeList[index].reponseTime).getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(this.timeList[index].reponseTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
this.zanArr[item.nIndex].activity_end_at = "活动已结束";
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
this.dataList = this.zanArr;
|
||||
this.search_result = true;
|
||||
},1000)
|
||||
} else {
|
||||
this.dataList = this.zanArr;
|
||||
}
|
||||
} else {
|
||||
this.search_result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
// this.$requst.post('spu/list',params).then(res=>{
|
||||
// if(res.code==0){
|
||||
// this.dataList = [];
|
||||
// if(res.data.list.length!=0){
|
||||
// res.data.list.forEach(item=>{
|
||||
// let tuan = false,ping = false,xian = false,integral = false;
|
||||
// if(item.activity_type=='group_make') ping = true;
|
||||
// if(item.activity_type=='group_buy') tuan = true;
|
||||
// if(item.activity_type=='limit_time') xian = true;
|
||||
// let group_cover = [];
|
||||
// if(item.activity_group_cover.length!=0) {
|
||||
// item.activity_group_cover.forEach(item=>{
|
||||
// group_cover.push(this.$http + item)
|
||||
// })
|
||||
// }
|
||||
// let obj = {
|
||||
// id:item.id,
|
||||
// imgSrc: this.$http + item.cover,
|
||||
// title: item.name,
|
||||
// zhePrice:item.price/100,
|
||||
// yuanPrice:item.original_price/100,
|
||||
// integral:'',
|
||||
// isTuan:tuan,//是否是团购
|
||||
// isPing:ping,//是否是拼团活动
|
||||
// isXian:xian,//是否是限时活动
|
||||
// isIntegral:integral,//是否是积分
|
||||
// grade:'',
|
||||
// disease_name:item.disease_name,//病种名称
|
||||
// disease_id:item.disease_id,//病种ID
|
||||
// activity_end_at:item.activity_end_at,//限时结束时间
|
||||
// activity_group_cover:group_cover,//参团人的头像
|
||||
// activity_group_num:item.activity_group_num,//已经参团人数
|
||||
// }
|
||||
// this.dataList.push(obj)
|
||||
// })
|
||||
// this.loading = true;
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
},
|
||||
chooseBing(index){//小分类选择事件
|
||||
this.bingzList.forEach(item=>{
|
||||
item.isActive = false;
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
|
||||
})
|
||||
this.bingzList[index].isActive = true;
|
||||
this.shaiList[this.activeIndex] = this.bingzList[index].title;
|
||||
console.log(this.shaiList);
|
||||
},
|
||||
chongz(){//重置
|
||||
this.isClick = false;
|
||||
this.shaiList = []
|
||||
},
|
||||
shaix(){//筛选
|
||||
this.isXiao = false
|
||||
this.isClick = true;
|
||||
this.checkShopList();
|
||||
},
|
||||
deleteSX(index){//删除筛选
|
||||
this.shaiList.splice(index,1);
|
||||
if(this.shaiList.length==0){
|
||||
this.isClick = false;
|
||||
}
|
||||
},
|
||||
checkKey(){//查询热搜关键词事件
|
||||
this.$requst.get('index/hot-keywords').then(res=>{
|
||||
this.$requst.get('index/hot-keywords',{type:'spu'}).then(res=>{
|
||||
// console.log('关键词列表:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
|
@ -379,7 +345,7 @@
|
|||
},error=>{})
|
||||
},
|
||||
checkSearchHistory(){//查询历史搜索的搜索记录
|
||||
this.$requst.post('user/search-history',{page:this.page,size:this.size}).then(res=>{
|
||||
this.$requst.post('user/search-history',{page:1,size:100}).then(res=>{
|
||||
// console.log(res);
|
||||
if(res.code==0){
|
||||
if(res.data.list.length!=0){
|
||||
|
@ -396,40 +362,6 @@
|
|||
}
|
||||
},error=>{})
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
this.$toolAll.tools.showToast('搜索中...')
|
||||
this.$requst.post('archives/category',{page:this.page,size:this.size,keyword:this.searchVal}).then(res=>{
|
||||
// console.log('搜索提交:',res);
|
||||
if(res.code==0){
|
||||
// 获取列表
|
||||
if(this.page==1) this.dataList = []
|
||||
this.total = res.data.list.total
|
||||
if(res.data.list.list.length!=0){
|
||||
res.data.list.list.forEach(item=>{
|
||||
let tObj = {
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img:'/static/public/logo.png',//发布者头像
|
||||
name:'恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(tObj)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
content:this.searchVal
|
||||
}
|
||||
this.reSearchList[0].list.push(obj)
|
||||
this.isList = false
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
delev(){//删除事件
|
||||
this.isShowT = true
|
||||
},
|
||||
|
@ -445,13 +377,6 @@
|
|||
cancleev(){//取消事件
|
||||
this.isShowT = false
|
||||
},
|
||||
chooseTwo(index){//二级分类选择
|
||||
// console.log('二级分类:',index);
|
||||
this.isZanw = true
|
||||
this.page = 1
|
||||
this.newCurrent = index
|
||||
this.searchEv()
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue